Two module hook same method
lehungmt94 opened this issue · 0 comments
lehungmt94 commented
I hook to method getIntExtra but some another module of another developer hook to this method too. After hook I can't control setResult().
can Xposed set priority of module?
`XposedHelpers.findAndHookMethod(
"android.content.Intent", lpparam.classLoader,"getIntExtra", String.class, int.class, new XC_MethodHook() {
@OverRide
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
}
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
Intent intent = (Intent) param.thisObject;
final String action = intent.getAction();
if (action.equals(Intent.ACTION_BATTERY_CHANGED)) {
if (BatteryManager.EXTRA_LEVEL.equals(param.args[0] + "")) {
Random r = new Random();
int I =r.nextInt(100);
param.setResult(I);
Log.e(TAG, "getIntExtra: "+param.args[0]+" Value: "+ I);
}
else if ("status".equals(param.args[0] + "")) {
XposedBridge.log("status");
Log.e(TAG, "getIntExtra: "+param.args[0]);
param.setResult(BatteryManager.BATTERY_STATUS_CHARGING);
}
}
}
}
);`