在AS3.3.2及Android8.1環境下下復現醜小鴨大佬的操作
教程地址:https://www.52pojie.cn/thread-850885-1-1.html
基本按照教程走,大佬採用的是AS3.0.1 nexus4 以及xposedbridge54版本
Xposed框架安裝不再贅述,本次採用Android8.1下的 90 beta3版本
僅敘述由於環境不同而遇到的一些問題及解決方案
基本不存在編譯錯誤,只是編譯後無法實現hook功能。
無法實現hook的可能原因
- 導入bridge-api文件後,gradle文件中的dependencies中會自動生成
implement fileTree(include: ['*.jar'], dir: 'libs')
刪除該行,原因:Xposed裏已有該JAR包內容,再次打包進去會衝突,就會導致handleLoadPackage沒有回調。
成功hook的dependencies舉例:
dependencies {
//provided 有錯就替換爲 compileOnly
compileOnly files('libs/api-82.jar')
compileOnly files('libs/api-82-sources.jar')
//如果需要可以引入文檔,
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
- AS爲方便編譯默認開啓了Instant run功能,使得hook類未打包到apk中。在設置中關閉該功能即可
- 在AS中直接編譯運行,無法hook。原因:應與上一條類似。
將文件打包成apk後手動安裝,即可hook。