Commit 2beba56b authored by swift_gan's avatar swift_gan

catch error of load call origin class

parent 9fdd0a05
package com.swift.sandhook.xposedcompat.hookstub;
import android.util.Log;
import com.swift.sandhook.SandHook;
import com.swift.sandhook.SandHookMethodResolver;
import com.swift.sandhook.utils.ParamWrapper;
......@@ -162,20 +164,21 @@ public class HookStubManager {
return null;
return new StubMethodsInfo(stubArgs, curUseStubIndex, hook, backup);
}
} catch (Exception e) {
} catch (Throwable throwable) {
return null;
}
}
public static Method getCallOriginMethod(int args, int index) {
String className = SandHook.is64Bit() ? MethodHookerStubs64.class.getName() : MethodHookerStubs32.class.getName();
Class stubClass = SandHook.is64Bit() ? MethodHookerStubs64.class : MethodHookerStubs32.class;
String className = stubClass.getName();
className += "$";
className += getCallOriginClassName(args, index);
try {
Class callOriginClass = Class.forName(className);
Class callOriginClass = Class.forName(className, true, stubClass.getClassLoader());
return callOriginClass.getDeclaredMethod("call", long[].class);
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable e) {
Log.e("HookStubManager", "load call origin class error!", e);
return null;
}
}
......
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