If I have code: if(blockedMethod()) {code}
and I set a hook to blockedMethod such as:
new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
if(bootCompleted) {
param.setResult(null); //Blocks method call.
}
}
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
param.setResult(false); //Should I do this if I want a result?
}
}
What happens to return value when using param.setResult(null) in before-hook? Will {code}
be executed or not? What is returned? Should I use param.setResult() to actually get a return value at all? Is the if-clause even executed?