-
-
[分享]EdXposed和LSPosed的使用(入门级)
-
发表于:
2021-7-28 13:51
8287
-
[分享]EdXposed和LSPosed的使用(入门级)
EdXposed和LSPosed使用
1.EdXposed与LSPosed的关系
参考网址:EdXposed与LSPosed的关系与区别
LSPosed是EdXposed的一个新分支,两者相互兼容,LSPosed比Edxposed 更加简洁、易用和高效,是Edxposed 的极佳替代品。
两者使用都类似。EdXposed和LSPosed都兼容了部分前Xposed模块。
2.EdXposed的使用
1.在AndroidStudio新建项目,在AndroidManifest.xml写入
1 2 3 4 5 6 7 8 9 10 11 12 | <application
........
<meta - data
android:name = "xposedmodule"
android:value = "true" / >
<meta - data
android:name = "xposeddescription"
android:value = "这是EdXposed案例" / >
<meta - data
android:name = "xposedminversion"
android:value = "54" / >
< / application>
|
2.在app文件夹下新建libs文件夹,拖入XposedBridgeApi-54.jar文件
3.找到build.gradle(Module:app)写入
1 2 3 4 5 6 7 8 | repositories {
jcenter()
}
dependencies {
......
compileOnly files( 'libs/XposedBridgeApi-54.jar' )
/ / implementation fileTree( dir : "libs" , include: [ "*.jar" ])(同时注释掉这行)
}
|
或者(下面这种方式可以取消第2步)
1 2 3 4 5 6 7 8 | repositories {
jcenter()
}
dependencies {
......
compileOnly 'de.robv.android.xposed:api:82'
compileOnly 'de.robv.android.xposed:api:82:sources'
}
|
两种方式均可。
4.实现IXposedHook类
1.implements IXposedHookLoadPackage
2.实现handleLoadPackage方法
1 2 3 4 5 6 | public class IXposedHook implements IXposedHookLoadPackage{ @Override
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {
XposedBridge.log( "包名:" + loadPackageParam.packageName);
XposedBridge.log( "进程名:" + loadPackageParam.processName);
}
}
|
5.新建xposed_init
右键点击 “main ” 文件夹,选择new --> Folder -->Assets Folder,新建assets文件夹.然后右键点击assets文件夹, new--> file,文件名为xposed_init(文件类型选text)。
写入: IXposedHook的全类名
1 | com.xxx.xposed.IXposedHook
|
6.EdXposed与LSPosed效果展示
EdXposed
LSPosed
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!
最后于 2021-7-29 13:39
被wulicc编辑
,原因: