【Mobile Security】Android App Smail代碼動態跟蹤調試方法

來源:互聯網
上載者:User

標籤: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代碼動態跟蹤調試方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.