简体   繁体   中英

Xposed Framework hooking Samsung s7 edge system processes?

Im just getting into developing modules for Xposed Framework.

I get a basic module working, just a module that does nothing but saying that its loaded and prints to log.

Next step was to try hooking the Clock in SystemUI, following rovo89's instructions on GitHub (dont know if I can link?)

The code is as follows:

package com.example.xxx.xposedtest;

import android.graphics.Color;
import android.widget.TextView;

import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
import de.robv.android.xposed.XposedHelpers;

public class xposedTest implements IXposedHookLoadPackage {

    public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {


        if(!lpparam.packageName.equals("com.android.systemui")) {
            XposedBridge.log("Did not find package")
            return;
        }

        findAndHookMethod("com.android.systemui.statusbar.policy.Clock", lpparam.classLoader, "updateClock", new XC_MethodHook() {
            @Override
            protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                TextView tv = (TextView) param.thisObject;
                String text = tv.getText().toString();
                tv.setText(text + " :)");
                XposedBridge.log("Package loaded: Function ran");
            }
        });
    }
}

The log says "Did not find package". And the hook method ofcourse did not run.

My guess is that Samsung s7 edge has some kind of other implementation, other class/method name.

How do I find out what method to actually hook since Samsung decided to not go AOSP? All information on the subject is appriciated.

The answer was other xposed modules were interfering. Answering if anyone encounters the same problem

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM