Xpose模块开发
2014-12-03 09:29
253 查看
原文:https://github.com/rovo89/XposedBridge/wiki/Development-tutorial
正文
1 .AndroidManifest.xml
application标签下增加3个meta-data<application
android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <meta-data
android:name="xposedmodule"
android:value="true" />
<meta-data
android:name="xposeddescription"
android:value="Easy example which makes the status bar clock red and adds a smiley" />
<meta-data
android:name="xposedminversion" android:value="30" />
</application>
2 .lib/XposedBridgeApi.jar
从这里http://forum.xda-developers.com/xposed/xposed-api-changelog-t2714067下载最新的XposedBridgeApi-<version>.jar,,放入lib,然后Build Path => Add to Build Path,meta-data中xposedminversion的value为<version>。PS:Files in the libs (with "s") folder are automatically included by Eclipse, so don't put the API file there.
Asset/xposed_init
Create a new text file with that name in the assets folder. In this file, each line contains one fully qualified class name. In this case, this is de.robv.android.xposed.mods.tutorial.Tutorial.java文件
For examle:the package de.robv.android.xposed.mods.tutorial
必须实现IXposedMod的子类(4个)
package de.robv.android.xposed.mods.tutorial;import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;
public class Tutorial implements IXposedHookLoadPackage {
public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
XposedBridge.log("Loaded app: " + lpparam.packageName);
findAndHookMethod("com.android.systemui.statusbar.policy.Clock", lpparam.classLoader, "updateClock", new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
// this will be called before the clock was updated by the original method
}
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
// this will be called after the clock was updated by the original method
}
});
}}
Have fun!
相关文章推荐
- Almp 安卓系统上搭建本地php服务器环境的步骤
- 谷歌被屏蔽后如何搭建安卓环境
- 安卓(Android)中如何实现滑动导航
- 六款值得推荐的android(安卓)开源框架简介
- 浅谈Android虚拟机的动态加载技术
- 安卓系统手机无法连接***
- android intent和intent action大全
- OGEngine介绍
- OGEngine_修改器
- OGEngine 弹出软件盘手动输入文字处理
- OGEngine 弹出软件盘手动输入文字处理
- 【游戏推荐】癞子斗地主--OGEngine精品游戏推荐系列【一】
- 场景精灵间的坐标转换
- Mac下的OGEngine游戏开发环境的搭建
- Android 内存溢出解决方案(OOM) 整理总结
- The connection to adb is down, and a severe error
- [Android]记录程序崩溃Log
- FTDI最新推出安卓免驱USB HOST FT311D
- 安卓系统浏览器中select下拉按钮无法弹出选择面板奇怪问题解决