Mac Android 反編譯 隨筆

 
 
 
 
  1. 須要 

Machine generated alternative text:
app20160510.apk 
apktool-jdgui 
apktool 
apktool.jar 
framewo k-res.apk 
apktool 
dex2jar-O. 
. .15 
apktool.zip 
jd-gui-O.2.7.osx.i686.dmg 
apache-tomcat-7.0.69-deployer 
apache-tomcat-7.O.69-deployer.zip 
Macintosh HD > > 
m leonardo > 
apktool-jdgui 
Java JA 
Unix e... 
Unix e... 
ZIP 
ZIP 
apkt

 

以上 三個 文件 經過cp 命令可拷貝至 /usr/local/bin 目錄中(拷貝至其中的緣由是爲了 配置全局 變量,相似於Windows java 環境的 path 配置。)java

拷貝完成後 運行:apktoolgit

Machine generated alternative text:
usage: apktool 
—advance, ——advanced 
prints advance information. 
—version, ——version 
prints the version then exits 
apktool if I install—framework [options] <framework. apk> 
—p,——frame—path <dir> Stores framework files into <dir>. 
Tag frameworks using <tag>. 
—t, ——tag <tag> 
apktool d [ecode] [options] <file_apk> 
usage: 
usage: 
f, ——force 
—o, ——output <dir> 
—p, ——frame—path <dir> 
r, — no—res 
s, ——no—src 
—t, ——frame—tag <tag> 
apktool b[uild] 
usage: 
f, ——force—all 
—o, ——output <dir> 
.apk 
—p, ——frame—path <dir> 
Force delete destination directory. 
The name of folder that gets written. Default is apk.ou 
Uses framework files located in <dir>. 
Do not decode resources. 
Do not decode sources. 
Uses framework files tagged by <tag>. 
[options] <app_path> 
Skip changes detection and build all files. 
The name of apk that gets written. Default is dist/ name 
For additional info, see: 
For smali/baksmali info, 
Uses framework files located in <dir>. 
http://ibotpeaches.github. io/Apktool/ 
see: https://github. com/JesusFreke/smali

如有幫助信息展現,則 說明成功。github

而後  跳轉到  apk所在目錄,運行命令:apktool d XXXXX.apkapache

 

便可反編譯 查看資源文件 內容。tomcat

 

apk 文件後綴名變動爲 .zip 並解壓  將其中的 classes.dex 拷貝至 dex2jar 文件夾中,運行命令:安全

sh dex2jar.sh classes.dex   便可,而後使用 JD-GUI 工具查看 源代碼。app

 

 

使用JD-GUI 查看 有時會出現 其餘 錯誤:(譬如:工具

public void put(String paramString, byte[] paramArrayOfByte)ui

  {spa

    // Byte code:

    //   0: aload_0

    //   1: getfield 66        cn/com/hfgo/cache/ACache:mCache        Lcn/com/hfgo/cache/ACache$ACacheManager;

    //   4: aload_1

    //   5: invokestatic 132        cn/com/hfgo/cache/ACache$ACacheManager:access$100        (Lcn/com/hfgo/cache/ACache$ACacheManager;Ljava/lang/String;)Ljava/io/File;

    //   8: astore_3

    //   9: new 339        java/io/FileOutputStream

    //   12: dup

    //   13: aload_3

    //   14: invokespecial 340        java/io/FileOutputStream:<init>        (Ljava/io/File;)V

    //   17: astore 4

    //   19: aload 4

    //   21: aload_2

    //   22: invokevirtual 342        java/io/FileOutputStream:write        ([B)V

    //   25: aload 4

    //   27: ifnull +13 -> 40

    //   30: aload 4

    //   32: invokevirtual 343        java/io/FileOutputStream:flush        ()V

    //   35: aload 4

    //   37: invokevirtual 344        java/io/FileOutputStream:close        ()V

    //   40: aload_0

    //   41: getfield 66        cn/com/hfgo/cache/ACache:mCache        Lcn/com/hfgo/cache/ACache$ACacheManager;

    //   44: aload_3

    //   45: invokestatic 322        cn/com/hfgo/cache/ACache$ACacheManager:access$200        (Lcn/com/hfgo/cache/ACache$ACacheManager;Ljava/io/File;)V

    //   48: return

    //   49: astore 9

    //   51: aload 9

    //   53: invokevirtual 155        java/io/IOException:printStackTrace        ()V

    //   56: goto -16 -> 40

    //   59: astore 5

    //   61: aconst_null

    //   62: astore 4

    //   64: aload 5

    //   66: invokevirtual 181        java/lang/Exception:printStackTrace        ()V

    //   69: aload 4

    //   71: ifnull +13 -> 84

    //   74: aload 4

    //   76: invokevirtual 343        java/io/FileOutputStream:flush        ()V

    //   79: aload 4

    //   81: invokevirtual 344        java/io/FileOutputStream:close        ()V

    //   84: aload_0

    //   85: getfield 66        cn/com/hfgo/cache/ACache:mCache        Lcn/com/hfgo/cache/ACache$ACacheManager;

    //   88: aload_3

    //   89: invokestatic 322        cn/com/hfgo/cache/ACache$ACacheManager:access$200        (Lcn/com/hfgo/cache/ACache$ACacheManager;Ljava/io/File;)V

    //   92: return

    //   93: astore 8

    //   95: aload 8

    //   97: invokevirtual 155        java/io/IOException:printStackTrace        ()V

    //   100: goto -16 -> 84

    //   103: astore 6

    //   105: aconst_null

    //   106: astore 4

    //   108: aload 4

    //   110: ifnull +13 -> 123

    //   113: aload 4

    //   115: invokevirtual 343        java/io/FileOutputStream:flush        ()V

    //   118: aload 4

    //   120: invokevirtual 344        java/io/FileOutputStream:close        ()V

    //   123: aload_0

    //   124: getfield 66        cn/com/hfgo/cache/ACache:mCache        Lcn/com/hfgo/cache/ACache$ACacheManager;

    //   127: aload_3

    //   128: invokestatic 322        cn/com/hfgo/cache/ACache$ACacheManager:access$200        (Lcn/com/hfgo/cache/ACache$ACacheManager;Ljava/io/File;)V

    //   131: aload 6

    //   133: athrow

    //   134: astore 7

    //   136: aload 7

    //   138: invokevirtual 155        java/io/IOException:printStackTrace        ()V

    //   141: goto -18 -> 123

    //   144: astore 6

    //   146: goto -38 -> 108

    //   149: astore 5

    //   151: goto -87 -> 64

    //

    // Exception table:

    //   from        to        target        type

    //   30        40        49        java/io/IOException

    //   9        19        59        java/lang/Exception

    //   74        84        93        java/io/IOException

    //   9        19        103        finally

    //   113        123        134        java/io/IOException

    //   19        25        144        finally

    //   64        69        144        finally

    //   19        25        149        java/lang/Exception

  }

這時須要  使用更專業的安全破解軟件,能夠查看 字節碼(JEB (收費))。

官網地址:https://www.pnfsoftware.com/jeb2

相關文章
相關標籤/搜索