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...
![](https://img.haomeiwen.com/i3858093/0323e702c63b572e.png)
二.导入eclipse
new 一个java Project,修改项目名与地址
![](https://img.haomeiwen.com/i3858093/3331b3a5a98fa4f7.png)
三.加入调试等待
a=0;// invoke-static {}, Landroid/os/Debug;->waitForDebugger()V
![](https://img.haomeiwen.com/i3858093/6c9fbf8044e7f76b.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
注意:端口与项目要选对
![](https://img.haomeiwen.com/i3858093/439202bdd4183751.png)
![](https://img.haomeiwen.com/i3858093/3a58be95bc132a83.png)
七.开始debug
开始debug前,记得加断点哟!!
![](https://img.haomeiwen.com/i3858093/ffb7966188b9b542.png)
网友评论