标签:project module 切换 injection inject ring %s owa 文件
保证所有配置正确,然后设置以下配置:
请确保禁用Instant Run(File -> Settings -> Build, Execution, Deployment -> Instant Run),否则您的类不会直接包含在APK中,而是通过Xposed无法处理的存根应用程序加载。
AndroidManifest.xml 添加:
<meta-data android:name="xposedmodule" android:value="true" /> <meta-data android:name="xposeddescription" android:value="测试Xp框架" /> <meta-data android:name="xposedminversion" android:value="30" />
build.gradle 添加:
compileOnly ‘de.robv.android.xposed:api:82‘
compileOnly ‘de.robv.android.xposed:api:82:sources‘
切换到project模式,在app\src\main目录下添加:assets目录(普通目录)
新建文件(不能有扩展名):xposed_init
文件内输入XP.class的入口包名+类名 例如:
cn.xp.android.injection.xphook
hook代码:
public class xphook implements IXposedHookLoadPackage { @Override public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable { Log.d("XPHOOK",String.format("输出包名:%s",lpparam.packageName)); } }
标签:project module 切换 injection inject ring %s owa 文件
原文地址:https://www.cnblogs.com/ugvnui/p/12912079.html