Commit 6d5b4e2a authored by swift_gan's avatar swift_gan

add invokeOriginalMethod in XposedBridge

parent c0b453cd
......@@ -3,6 +3,7 @@ package de.robv.android.xposed;
import android.annotation.SuppressLint;
import android.util.Log;
import com.swift.sandhook.SandHook;
import com.swift.sandhook.xposedcompat.methodgen.DynamicBridge;
import com.swift.sandhook.xposedcompat.utils.DexLog;
......@@ -275,6 +276,27 @@ public final class XposedBridge {
}
@SuppressWarnings("unused")
public static Object invokeOriginalMethod(final Member method, final Object thisObject,
final Object[] args)
throws NullPointerException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
try {
return SandHook.callOriginMethod(method, thisObject, args);
} catch (NullPointerException e) {
throw e;
} catch (IllegalAccessException e) {
throw e;
} catch (IllegalArgumentException e) {
throw e;
} catch (InvocationTargetException e) {
throw e;
} catch (Throwable throwable) {
throw new InvocationTargetException(throwable);
}
}
/**
* Basically the same as {@link Method#invoke}, but calls the original method
* as it was before the interception by Xposed. Also, access permissions are not checked.
......
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