You've already forked TrickyStore
mirror of
https://github.com/5ec1cff/TrickyStore.git
synced 2025-09-06 06:37:07 +00:00
retry
This commit is contained in:
@@ -88,7 +88,8 @@ object KeystoreInterceptor : BinderInterceptor() {
|
|||||||
return Skip
|
return Skip
|
||||||
}
|
}
|
||||||
|
|
||||||
private var tried = false
|
private var triedCount = 0
|
||||||
|
private var injected = false
|
||||||
|
|
||||||
fun tryRunKeystoreInterceptor(): Boolean {
|
fun tryRunKeystoreInterceptor(): Boolean {
|
||||||
Logger.i("trying to register keystore interceptor ...")
|
Logger.i("trying to register keystore interceptor ...")
|
||||||
@@ -96,25 +97,28 @@ object KeystoreInterceptor : BinderInterceptor() {
|
|||||||
val bd = getBinderBackdoor(b)
|
val bd = getBinderBackdoor(b)
|
||||||
if (bd == null) {
|
if (bd == null) {
|
||||||
// no binder hook, try inject
|
// no binder hook, try inject
|
||||||
if (tried) {
|
if (triedCount >= 3) {
|
||||||
Logger.e("inject tried but still has no backdoor, exit")
|
Logger.e("inject tried but still has no backdoor, exit")
|
||||||
exitProcess(1)
|
exitProcess(1)
|
||||||
}
|
}
|
||||||
Logger.i("trying to inject keystore ...")
|
if (!injected) {
|
||||||
val p = Runtime.getRuntime().exec(
|
Logger.i("trying to inject keystore ...")
|
||||||
arrayOf(
|
val p = Runtime.getRuntime().exec(
|
||||||
"/system/bin/sh",
|
arrayOf(
|
||||||
"-c",
|
"/system/bin/sh",
|
||||||
"exec ./inject `pidof keystore2` libtricky_store.so entry"
|
"-c",
|
||||||
|
"exec ./inject `pidof keystore2` libtricky_store.so entry"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
// logD(p.inputStream.readBytes().decodeToString())
|
||||||
// logD(p.inputStream.readBytes().decodeToString())
|
// logD(p.errorStream.readBytes().decodeToString())
|
||||||
// logD(p.errorStream.readBytes().decodeToString())
|
if (p.waitFor() != 0) {
|
||||||
if (p.waitFor() != 0) {
|
Logger.e("failed to inject! daemon exit")
|
||||||
Logger.e("failed to inject! daemon exit")
|
exitProcess(1)
|
||||||
exitProcess(1)
|
}
|
||||||
|
injected = true
|
||||||
}
|
}
|
||||||
tried = true
|
triedCount += 1
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
val ks = IKeystoreService.Stub.asInterface(b)
|
val ks = IKeystoreService.Stub.asInterface(b)
|
||||||
|
|||||||
Reference in New Issue
Block a user