Android杂谈:smali动态调试

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

参考:http://blog.csdn.net/oo_oo_/article/details/27183897

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容