折腾:
【已解决】尝试破解小花生app安卓apk希望看到api返回的json中的J的解密算法得到明文
期间,先要去mac中安装最新版本的Apktool。
还是继续参考官网:
“A tool for reverse engineering 3rd party, closed, binary Android apps. It can decode resources to nearly original form and rebuild them after making some modifications. It also makes working with an app easier because of the project like file structure and automation of some repetitive tasks like building apk, etc.
It is NOT intended for piracy and other non-legal uses. It could be used for localizing, adding some features or support for custom platforms, analyzing applications and much more.”
去安装:
➜ ~ java -version java version "1.8.0_112" Java(TM) SE Runtime Environment (build 1.8.0_112-b16) Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode)
是java 1.8
然后再去下载
下载:apktool-2
-》
重命名为:apktool.jar
把:
- apktool
- apktool.jar
移动到:
/usr/local/bin
里:
➜ reverse engineering ll total 65520 -rw-r--r--@ 1 crifan staff 2.3K 3 14 11:26 apktool -rw-r--r--@ 1 crifan staff 16M 3 14 11:29 apktool.jar -rw-r--r--@ 1 crifan staff 16M 3 14 11:29 apktool_2.4.0.jar ➜ reverse engineering cp apktool apktool.jar /usr/local/bin ➜ reverse engineering ll /usr/local/bin/apk* -rw-r--r--@ 1 crifan admin 2.3K 3 14 11:31 /usr/local/bin/apktool -rw-r--r--@ 1 crifan admin 16M 3 14 11:31 /usr/local/bin/apktool.jar
设置可执行权限:
➜ reverse engineering chmod +x /usr/local/bin/apk* ➜ reverse engineering ll /usr/local/bin/apk* -rwxr-xr-x@ 1 crifan admin 2.3K 3 14 11:31 /usr/local/bin/apktool -rwxr-xr-x@ 1 crifan admin 16M 3 14 11:31 /usr/local/bin/apktool.jar
去终端中运行apktool试试
➜ reverse engineering which apktool /usr/local/bin/apktool ➜ reverse engineering apktool Apktool v2.4.0 - a tool for reengineering Android apk files with smali v2.2.6 and baksmali v2.2.6 Copyright 2014 Ryszard Wiśniewski < [email protected] > Updated by Connor Tumbleson < [email protected] > usage: apktool -advance,--advanced prints advance information. -version,--version prints the version then exits usage: apktool if|install-framework [options] <framework.apk> -p,--frame-path <dir> Stores framework files into <dir>. -t,--tag <tag> Tag frameworks using <tag>. usage: apktool d[ecode] [options] <file_apk> -f,--force Force delete destination directory. -o,--output <dir> The name of folder that gets written. Default is apk.out -p,--frame-path <dir> Uses framework files located in <dir>. -r,--no-res Do not decode resources. -s,--no-src Do not decode sources. -t,--frame-tag <tag> Uses framework files tagged by <tag>. usage: apktool b[uild] [options] <app_path> -f,--force-all Skip changes detection and build all files. -o,--output <dir> The name of apk that gets written. Default is dist/name.apk -p,--frame-path <dir> Uses framework files located in <dir>. For additional info, see: http://ibotpeaches.github.io/Apktool/ For smali/baksmali info, see: https://github.com/JesusFreke/smali ➜ reverse engineering apktool --version 2.4.0
注:
上面的apktool脚本,其实是可选非必须的,其目的是省去每次都输入:
java -jar apktool.jar
才能调用到apktool.jar,比较方便些。
再去看看高级用法:
➜ reverse engineering apktool --advanced Apktool v2.4.0 - a tool for reengineering Android apk files with smali v2.2.6 and baksmali v2.2.6 Copyright 2014 Ryszard Wiśniewski < [email protected] > Updated by Connor Tumbleson < [email protected] > Apache License 2.0 ( http://www.apache.org/licenses/LICENSE-2.0 ) usage: apktool [-q|--quiet OR -v|--verbose] -advance,--advanced prints advance information. -version,--version prints the version then exits usage: apktool [-q|--quiet OR -v|--verbose] if|install-framework [options] <framework.apk> -p,--frame-path <dir> Stores framework files into <dir>. -t,--tag <tag> Tag frameworks using <tag>. usage: apktool [-q|--quiet OR -v|--verbose] d[ecode] [options] <file_apk> -api,--api-level <API> The numeric api-level of the file to generate, e.g. 14 for ICS. -b,--no-debug-info don't write out debug info (.local, .param, .line, etc.) -f,--force Force delete destination directory. --force-manifest Decode the APK's compiled manifest, even if decoding of resources is set to "false". -k,--keep-broken-res Use if there was an error and some resources were dropped, e.g. "Invalid config flags detected. Dropping resources", but you want to decode them anyway, even with errors. You will have to fix them manually before building. -m,--match-original Keeps files to closest to original as possible. Prevents rebuild. --no-assets Do not decode assets. -o,--output <dir> The name of folder that gets written. Default is apk.out -p,--frame-path <dir> Uses framework files located in <dir>. -r,--no-res Do not decode resources. -s,--no-src Do not decode sources. -t,--frame-tag <tag> Uses framework files tagged by <tag>. usage: apktool [-q|--quiet OR -v|--verbose] b[uild] [options] <app_path> -a,--aapt <loc> Loads aapt from specified location. -c,--copy-original Copies original AndroidManifest.xml and META-INF. See project page for more info. -d,--debug Sets android:debuggable to "true" in the APK's compiled manifest -f,--force-all Skip changes detection and build all files. -nc,--no-crunch Disable crunching of resource files during the build step. -o,--output <dir> The name of apk that gets written. Default is dist/name.apk -p,--frame-path <dir> Uses framework files located in <dir>. --use-aapt2 Upgrades apktool to use experimental aapt2 binary. usage: apktool [-q|--quiet OR -v|--verbose] publicize-resources <file_path> usage: apktool [-q|--quiet OR -v|--verbose] empty-framework-dir [options] -f,--force Force delete destination directory. -p,--frame-path <dir> Stores framework files into <dir>. For additional info, see: http://ibotpeaches.github.io/Apktool/ For smali/baksmali info, see: https://github.com/JesusFreke/smali
【总结】
参考官网:
去:
- 确保自己的java版本是1.8
- 如果没有自己去安装
- 用:java -version 输出可以确认是否是1.8
- 下载(封装脚本):apktool
- 地址:
- 非必须
- 但是用了的好处是,方便:
- 免去每次都要输入:java -jar apktool.jar
- 再去下载:apktool-2
- 得到:apktool_2.4.0.jar
- 地址:
- 然后把apktool_2.4.0.jar改名为apktool.jar
- 把apktool和apktool.jar拷贝到/usr/local/bin/
- 添加可运行权限
- chmod +x /usr/local/bin/apk*
- 即可运行:apktool
- 查看位置:which apktool
- 看版本:apktool –version
转载请注明:在路上 » 【已解决】mac中安装最新版本的安卓反编译工具:Apktool