xposed 框架学习

  • A+
所属分类:安卓

xposed 启动过程

app_main

看这篇最好看下zygote启动分析,其实很简单的,就是 xposed 对app_process 进行了修改加入了启动xposed的分支。个人觉得拿xposed的app_main.cpp和原来的app_main.cpp比较就很清楚。

然后对比了下原来的和现在的app_main 我们 看下main函数,

看到没有就这么点区别,翻译过来就是如果xposed存在就加载xposed的main ,如果不存在就加载原来的main 。那我们看下de.robv.android.xposed.XposedBridge.main

try {

SELinuxHelper.initOnce();

SELinuxHelper.initForProcess(null);

runtime = getRuntime();

if (initNative()) {

XPOSED_BRIDGE_VERSION = getXposedVersion();

if (isZygote) {

startsSystemServer = startsSystemServer();

initForZygote();

}

loadModules();

} else {

log("Errors during native Xposed initialization");

}

} catch (Throwable t) {

log("Errors during Xposed initialization");

log(t);

disableHooks = true;

}

// Call the original startup code

if (isZygote)

ZygoteInit.main(args);

else

RuntimeInit.main(args);

 

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: