File tree Expand file tree Collapse file tree
app/src/main/java/com/nous/wxhook Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ class WxHookProvider : ContentProvider() {
1414 private var capturedKey: String? = null
1515 private var capturedTime: Long = 0
1616
17+ const val KEY_URI = " content://com.nous.wxhook.db_provider/key"
18+
1719 fun setKey (key : String ) {
1820 capturedKey = key
1921 capturedTime = System .currentTimeMillis()
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import android.app.Application
44import androidx.lifecycle.AndroidViewModel
55import androidx.lifecycle.viewModelScope
66import com.nous.wxhook.db.BackupManager
7+ import com.nous.wxhook.db.WxHookProvider
78import com.nous.wxhook.root.RootGateways
89import com.nous.wxhook.rootbridge.backup.BackupHookLocal
910import com.nous.wxhook.sync.Syncer
@@ -206,7 +207,7 @@ class ModuleViewModel(application: Application) : AndroidViewModel(application)
206207 try {
207208 val app = getApplication<Application >()
208209 val cursor = app.contentResolver.query(
209- android.net.Uri .parse(" content://com.nous.wxhook.db_provider/key " ),
210+ android.net.Uri .parse(WxHookProvider . KEY_URI ),
210211 null , null , null , null
211212 )
212213 val key = if (cursor != null && cursor.moveToFirst()) {
@@ -310,7 +311,7 @@ class ModuleViewModel(application: Application) : AndroidViewModel(application)
310311 try {
311312 val app = getApplication<Application >()
312313 val cursor = app.contentResolver.query(
313- android.net.Uri .parse(" content://com.nous.wxhook.db_provider/key " ),
314+ android.net.Uri .parse(WxHookProvider . KEY_URI ),
314315 null , null , null , null
315316 )
316317 val key = if (cursor != null && cursor.moveToFirst()) {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import android.widget.ScrollView
1111import android.widget.TextView
1212import androidx.appcompat.app.AppCompatActivity
1313import com.google.android.material.button.MaterialButton
14+ import com.nous.wxhook.db.WxHookProvider
1415import com.nous.wxhook.root.RootGateways
1516import com.nous.wxhook.ui.M3
1617import java.io.File
@@ -76,7 +77,7 @@ class SearchActivity : AppCompatActivity() {
7677 var key: String? = null
7778 try {
7879 val cursor = contentResolver.query(
79- android.net.Uri .parse(" content://com.nous.wxhook.db_provider/key " ),
80+ android.net.Uri .parse(WxHookProvider . KEY_URI ),
8081 null , null , null , null
8182 )
8283 if (cursor != null && cursor.moveToFirst()) {
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import android.widget.TextView
1212import androidx.appcompat.app.AppCompatActivity
1313import com.google.android.material.button.MaterialButton
1414import com.nous.wxhook.db.DbCleanup
15+ import com.nous.wxhook.db.WxHookProvider
1516import com.nous.wxhook.ui.M3
1617
1718class StatusActivity : AppCompatActivity () {
@@ -55,7 +56,7 @@ class StatusActivity : AppCompatActivity() {
5556 var key: String? = null
5657 try {
5758 val cursor = contentResolver.query(
58- android.net.Uri .parse(" content://com.nous.wxhook.db_provider/key " ),
59+ android.net.Uri .parse(WxHookProvider . KEY_URI ),
5960 null , null , null , null
6061 )
6162 if (cursor != null && cursor.moveToFirst()) {
You can’t perform that action at this time.
0 commit comments