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 配置。)

拷贝完成后 运行:apktool

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

若有帮助信息展示,则 说明成功。

然后  跳转到  apk所在目录,运行命令:apktool d XXXXX.apk

 

即可反编译 查看资源文件 内容。

 

apk 文件后缀名变更为 .zip 并解压  将其中的 classes.dex 拷贝至 dex2jar 文件夹中,运行命令:

sh dex2jar.sh classes.dex   即可,然后使用 JD-GUI 工具查看 源代码。

 

 

使用JD-GUI 查看 有时会出现 其他 错误:(譬如:

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

  {

    // 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


posted @ 2016-08-22 17:15  CrazyMax  阅读(258)  评论(0编辑  收藏  举报