-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8408a9d
commit 148d92e
Showing
7 changed files
with
90 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
app/src/main/java/org/lsposed/corepatch/hook/VerificationParamsHook.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.lsposed.corepatch.hook | ||
|
||
import android.annotation.SuppressLint | ||
import android.os.Build | ||
import io.github.libxposed.api.XposedInterface.BeforeHookCallback | ||
import org.lsposed.corepatch.Config | ||
import org.lsposed.corepatch.XposedHelper.BeforeCallback | ||
import org.lsposed.corepatch.XposedHelper.hookBefore | ||
import org.lsposed.corepatch.XposedHelper.hostClassLoader | ||
|
||
object VerificationParamsHook: BaseHook() { | ||
override val name = "VerificationParamsHook" | ||
|
||
@SuppressLint("PrivateApi") | ||
override fun hook() { | ||
if (Build.VERSION.SDK_INT != Build.VERSION_CODES.TIRAMISU) { | ||
return | ||
} | ||
|
||
val verificationParamsClazz = hostClassLoader.loadClass("com.android.server.pm.VerificationParams") | ||
|
||
val isVerificationEnabledMethod = verificationParamsClazz.declaredMethods.first { m -> m.name == "isVerificationEnabled" } | ||
hookBefore(isVerificationEnabledMethod, object : BeforeCallback { | ||
override fun before(callback: BeforeHookCallback) { | ||
if (Config.isDisableVerificationAgentEnabled()) { | ||
callback.returnAndSkip(false) | ||
} | ||
} | ||
}) | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
app/src/main/java/org/lsposed/corepatch/hook/VerifyingSessionHook.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.lsposed.corepatch.hook | ||
|
||
import android.annotation.SuppressLint | ||
import android.os.Build | ||
import io.github.libxposed.api.XposedInterface.BeforeHookCallback | ||
import org.lsposed.corepatch.Config | ||
import org.lsposed.corepatch.XposedHelper.BeforeCallback | ||
import org.lsposed.corepatch.XposedHelper.hookBefore | ||
import org.lsposed.corepatch.XposedHelper.hostClassLoader | ||
|
||
object VerifyingSessionHook : BaseHook() { | ||
override val name = "VerifyingSessionHook" | ||
|
||
@SuppressLint("PrivateApi") | ||
override fun hook() { | ||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU) { | ||
return | ||
} | ||
|
||
val verifyingSessionClazz = | ||
hostClassLoader.loadClass("com.android.server.pm.VerifyingSession") | ||
|
||
val isVerificationEnabledMethod = | ||
verifyingSessionClazz.declaredMethods.first { m -> m.name == "isVerificationEnabled" } | ||
hookBefore(isVerificationEnabledMethod, object : BeforeCallback { | ||
override fun before(callback: BeforeHookCallback) { | ||
if (Config.isDisableVerificationAgentEnabled()) { | ||
callback.returnAndSkip(false) | ||
} | ||
} | ||
}) | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters