標籤:Mobile Security
1、反編譯可偵錯模式的smail代碼
D:\software\android\ApkTool\dump\apktool>java -jar apktool.jar d -d b11842d4126d72df16c1c1870c819c37.apk -o outI: Using Apktool 2.0.0-RC3 on b11842d4126d72df16c1c1870c819c37.apkI: Loading resource table...I: Decoding AndroidManifest.xml with resources...I: Loading resource table from file: C:\Users\topsec\apktool\framework\1.apkI: Regular manifest package...I: Decoding file-resources...I: Decoding values */* XMLs...I: Baksmaling classes.dex...Cleaning up unclosed ZipFile for archive C:\Users\topsec\apktool\framework\1.apkI: Copying assets and libs...I: Copying unknown files...I: Copying original files...
2、在輸出的out檔案夾中,用文本編輯工具開啟AndroidManifest.xml,在application節點中設定屬性android:debuggable=”true”
D:\software\android\ApkTool\dump\apktool>java -jar apktool.jar b -d out -o debug.apkI: Using Apktool 2.0.0-RC3 on outI: 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: Copying libs...I: Building apk file...I: Copying unknown files/dir...Cleaning up unclosed ZipFile for archive C:\Users\topsec\AppData\Local\Temp\APKTOOL5083930743852064505.tmpD:\software\android\ApkTool\dump\apktool>cd D:\software\android\ApkTool\dump\apktool
3、使用簽名工具對debug.apk檔案進行簽名,簽名後安裝
D:\software\android\ApkTool\dump\apktool>adb install -r debug.apk1726 KB/s (14505061 bytes in 8.203s) pkg: /data/local/tmp/debug.apksuccessD:\software\android\ApkTool\dump\apktool>
4、啟動軟體等待調試
5、下面開始設定EclipseJust-in-Time 偵錯的環境,進入第1步產生的OUT檔案夾,把裡面的BUILD和DIST檔案夾刪除,這是APKTOOL編譯APK時產生的。
6、啟動ECLIPSE,構建JAVA項目
1) File -> New -> Project -> Java Project -> Next
2) Project Name隨便起,Use default location選項去掉,Location選擇out檔案夾,然後Next
3) 把smali檔案夾設為Source Folder,然後Finish
7、ddms中查看要調試進程連接埠,然後找到我們要下斷點的smail代碼設定斷點
8、選擇eclipse下run->debug configurations->new一個新配置選擇連接埠,點擊debug開始調試
9.手機中操作開始收報發包跟蹤即可,同時抓包查看詳細資料,調試跟蹤找到加解密演算法實現資料還原。
著作權聲明:本文為博主原創文章,未經博主允許不得轉載。
【Mobile Security】Android App Smail代碼動態跟蹤調試方法