Skip to content

Commit

Permalink
- root获取默认key1
Browse files Browse the repository at this point in the history
  • Loading branch information
zsqw123 committed May 14, 2020
1 parent 0a550ac commit fe19c5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/src/main/java/qhaty/qqex/Dialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ fun Context.rootGetKeyDialog(): AlertDialog = alertDialog {
1 -> Data.keyType = 1
2 -> Data.keyType = 2
}
}
okButton {
GlobalScope.launch(Dispatchers.Main) {
val a = withContext(Dispatchers.Default) {
try {
Expand All @@ -92,11 +94,7 @@ fun Context.rootGetKeyDialog(): AlertDialog = alertDialog {
return@withContext 1
}
}
if (a == 1) {
toast("获取失败 请检查是否安装QQ")
} else {
toast("已获取key")
}
if (a == 1) toast("获取失败 请检查是否安装QQ") else toast("已获取key")
mainActivity?.key_edit?.setText(Data.key)
}
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/qhaty/qqex/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ fun getKeyUseRoot(context: Context) {
if (Data.hasRoot) {
if (Shell.SU.available()) {
val dir = context.getExternalFilesDir("qqxml")!!
if (!dir.exists()) dir.mkdirs()
val qqPkg = "com.tencent.mobileqq"
val cmd1 =
"cp -f /data/data/$qqPkg/shared_prefs/appcenter_mobileinfo.xml ${dir.absolutePath}/1.xml"
Expand Down

0 comments on commit fe19c5e

Please sign in to comment.