Commit 795c09b2 authored by swift_gan's avatar swift_gan

tweak demo

parent 59726be9
......@@ -2,6 +2,7 @@ package com.swift.sandhook;
import android.app.Activity;
import android.app.Application;
import android.os.Build;
import android.util.Log;
import com.swift.sandhook.test.TestClass;
......@@ -35,7 +36,10 @@ public class MyApp extends Application {
}
SandHook.disableVMInline();
SandHook.passApiCheck();
if (SandHookConfig.SDK_INT >= Build.VERSION_CODES.P) {
SandHook.passApiCheck();
}
try {
SandHook.addHookClass(JniHooker.class,
......
......@@ -38,7 +38,11 @@ public class CtrHook {
@HookMode(HookMode.INLINE)
public static void onAdd1(TestClass thiz) throws Throwable {
Log.e("TestClassHook", "add1 been hooked");
SandHook.callOriginByBackup(add1backup, thiz);
try {
SandHook.callOriginByBackup(add1backup, thiz);
} catch (Exception e) {
e.printStackTrace();
}
}
@HookMethod("add2")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment