eclipse導入smali進行調試,現在簡單記錄一下
一.反編譯APK
apktool.bat d -d NowInfo.apk
I: Using Apktool 2.0.2 on NowInfo.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Administrator\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
反編譯APK.png
二.導入eclipse
new 一個java Project,修改項目名與地址
導入eclipse.png
三.加入調試等待
a=0;// invoke-static {}, Landroid/os/Debug;->waitForDebugger()V
加入調試等待.png
四.回編譯APK
apktool.bat b -d NowInfo -o debug.apk
I: Using Apktool 2.0.2
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
Warning: AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest.
I: Building apk file...
五.APK簽名
略過
六.打開應用,選擇ddms,配置debug選項,點擊debug
注意:端口與項目要選對
ddms.png
Paste_Image.png
七.開始debug
開始debug前,記得加斷點喲!!
debug.png