Sunday, May 29, 2016

Can't replace return values with setResult

I'm not able to change the return values of a method. The hook is working. Even the logs are correct - but when i actually call the method in another app the real information is shown.

Code:

findAndHookMethod("android.net.wifi.WifiInfo", lpparam.classLoader, "getSSID",new XC_MethodHook() {
    @Override
    protected void afterHookedMethod(MethodHookParam param) throws Throwable {
        XposedBridge.log("getSSID1 "+(String) param.getResult());                       
        param.setResult("\"Changed\"");
        XposedBridge.log("getSSID2 "+(String) param.getResult());
    }

    @Override
    protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
    }
});

Output:
Code:

getSSID1 "realSSID"
getSSID2 "Changed"

In app the call actually produces: "realSSID"

Can you help me with that?


from xda-developers http://ift.tt/1XHqPHs
via IFTTT

No comments:

Post a Comment