我正在尝试制作一个 Xposed 模块。我首先阅读了一个教程,其中有操作时钟的说明。代码如下:
package de.robv.android.xposed.mods.tutorial;
import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;
import android.graphics.Color;
import android.widget.TextView;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
public class Tutorial implements IXposedHookLoadPackage {
public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
if (!lpparam.packageName.equals("com.android.systemui"))
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 + " :)");
tv.setTextColor(Color.RED);
}
});
}
}
我现在想制作自己的模块,在输入模式锁定后我必须在其中执行一些操作。输入模式后,我想读取模式并根据模式执行一些操作。请在这方面帮助我。我什至无法识别挂钩的方法。我试图在以下位置找到它: http: //grepcode.com/project/repository.grepcode.com/java/ext/com.google.android/android/
谢谢!