Skip to content

Commit

Permalink
Fix bugs(hooklib)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xF committed Jun 22, 2021
1 parent fc80866 commit d5d1e01
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion VirtualApp/libsandhook/src/main/java/andhook/SandXposed.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,19 @@ private static int getPreviewSDKInt() {
private static boolean isQ() {
return Build.VERSION.SDK_INT > 28 || (Build.VERSION.SDK_INT == 28 && getPreviewSDKInt() > 0);
}

private static int getCurrentSdkVer()
{
return getPreviewSDKInt() > 0 ? (Build.VERSION.SDK_INT + 1) : Build.VERSION.SDK_INT;
}

/**
* 在Application,Va的App进程的初始化调用,onVirtualProcess
*/
public static void init(boolean debug, File cacheDir) {
SandHookConfig.DEBUG = debug;
HookLog.DEBUG = debug;
SandHookConfig.SDK_INT = isQ() ? 29 : Build.VERSION.SDK_INT;
SandHookConfig.SDK_INT = getCurrentSdkVer();
SandHookConfig.compiler = SandHookConfig.SDK_INT < Build.VERSION_CODES.O;
// Should not use delay hook
/*
Expand Down

0 comments on commit d5d1e01

Please sign in to comment.