反编译android APK
我们经常会在如下的情况使用反编译

.dex文件简介
dex2jar使用方法(转载自官方):
资源文件反编译
android-apktool简介
android-apktool安装方法
Quick Check
- Apktool 2.x (Versions after 1.5.2)
- Is Java 1.7 installed?
- Does executing java -version on command line / command prompt return 1.7?
- If not, please install Java 7 and make it the default.
- Apktool 1.x (Versions prior to 1.5.2)
- Is Java 1.6 or higher installed?
- Does executing java -version on command line / command prompt return 1.6 or above?
- If not, please install Java 6 or Java 7.
Installation for Apktool 2.x
- Windows:
- Download Windows wrapper script (Right click, Save Link As apktool.bat)
- Download apktool-2 (find newest here)
- Rename downloaded jar to apktool.jar
- Move both files (apktool.jar & apktool.bat) to your Windows directory (Usually C://Windows)
- If you do not have access to C://Windows, you may place the two files anywhere then add that directory to your Environment Variables System PATH variable.
- Try running apktool via command prompt
- Linux:
- Download Linux wrapper script (Right click, Save Link As apktool)
- Download apktool-2 (find newest here)
- Rename downloaded jar to apktool.jar
- Move both files (apktool.jar & apktool) to /usr/local/bin (root needed)
- Make sure both files are executable (chmod +x)
- Try running apktool via cli
- Mac OS X:
- Download Mac wrapper script (Right click, Save Link As apktool)
- Download apktool-2 (find newest here)
- Rename downloaded jar to apktool.jar
- Move both files (apktool.jar & apktool) to /usr/local/bin (root needed)
- Make sure both files are executable (chmod +x)
- Try running apktool via cli
Note - Wrapper scripts are not needed, but helpful so you don't have to type java -jar apktool.jar over and over.
android-apktool参数介绍
Confused about some of the commands Apktool can do?
Utility Options
-version, --version
Outputs current version. (Ex: 1.5.2)
-v, --verbose
Verbose output. Needed before all other commands.
-q, --quiet
Quiets output. Needed before all other commands.
-advance, --advanced
Prints advance options
Decompile Options
--api <API>
The numeric api-level of the smali files to generate (eg 14 for ICS).
-b, --no-debug-info
Prevents baksmali from writing out debug info (.local, .param, .line, etc). Preferred to use if you are comparing smali from the same APK of different versions. The line numbers and debug will change among versions, which can make DIFF reports a pain.
-d, --debug
Decodes in Debug Mode. Check SmaliDebugging
--debug-line-prefix <prefix>
Smali line prefix when decoding in debug mode. Default "a=0;//"
-f, --force
Force delete destination directory. Use if trying to decompile to a folder that already exists.
--keep-broken-res
If there is an error like "Invalid Config Flags Detected. Dropping Resources...". This means that APK has a different structure then Apktool can handle. This might be a newer Android version or a random APK that doesn't match standards. Running this will allow the decode, but then you have to manually fix the folders with -ERR in them.
-m, --match-original
Keeps files closest as possible to original. Prevents rebuilding, used for analysis"
-o, --output <dir>
The name of the folder that gets written.
-p, --frame-path <dir>
The location where framework files are loaded from / placed.
-r, --no-res
This will prevent the decompile of resources. This keeps the resources.arsc intact without any decompile. If only editing Java (smali) then this is the recommend for faster decompile & rebuild.
-s, --no src
This will prevent the decompile of the java source. This keeps the APK classes.dex file and simply moves it during re-compile. If your only editing the resources. This is recommended for faster decompile & rebuild.
-t, --frame-tag <tag>
Uses framework files tagged by <tag>.
How to Decompile?
Prior to Decompile, you must have frameworks installed. Please read this wiki: FrameworkFiles for more information. Once complete run
apktool d name_of_apk.apk
With any configurations noted above.
Recompile Options
-a, --aapt <file>
Loads aapt from the specified file location, instead of relying on path. Falls back to PATH loading, if no file found.
-c, --copy-original
Copies original AndroidManifest.xml and META-INF folder into built apk.
-d, --debug
Builds in Debug Mode, see SmaliDebugging
-f, --force-all
This overwrites an existing file during rebuild.
-o, --output <dir>
The name of the folder that gets written.
-p, --frame-path <dir>
The location where framework files are loaded from / placed.
How to Recompile?
Prior to Recompile, you must have a decompiled application installed. Once complete run
apktool b folder_of_decoded_apk
With any configurations noted above.
工具打包下载~附件列表
反编译android_APK_Attachments.zip
反编译android APK的更多相关文章
- 反编译Android APK及防止APK程序被反编译
怎么逆向工程对Android Apk 进行反编译 google Android开发是开源的,开发过程中有些时候会遇到一些功能,自己不知道该怎么做,然而别的软件里面已经有了,这个时候可以采用反编译的方式 ...
- 『原』在Linux下反编译Android .apk文件 使用apktool dex2jar JD-eclipse
一.使用apktool 将 apk反编译生成程序的源代码和图片.XML配置.语言资源等文件 具体步骤: (1)下载反编译工具包:apktool 官方的打不开 http://apktool.shouji ...
- 实例具体解释:反编译Android APK,改动字节码后再回编译成APK
本文具体介绍了怎样反编译一个未被混淆过的Android APK,改动smali字节码后,再回编译成APK并更新签名,使之可正常安装.破译后的apk不管输入什么样的username和password都能 ...
- linux下反编译android apk
1.所需要的工具 1)apktool,功能:反编译出apk所需要的资源文件和布局设置文件等, 下载地址:https://code.google.com/p/android-apktool/downlo ...
- Mac上反编译Android apk安装包
什么是反编译 我们知道,Android的程序打包后会生成一个APK文件,这个文件可以直接安装到任何Android手机上,因此,反编译就是对这个APK进行反编译.Android的反编译分成两个部分: 一 ...
- 只需三步--轻松反编译Android Apk文件
安卓程序是通过java语言进行编写的,可以很容易进行反编译.很多apk文件被反编译后再二次打包,就成了自己的产品,很是流氓.下面我们来看看如何进行apk的反编译,以及常用的防反编译手段. 一.反编译A ...
- mac下反编译android apk
所需要的工具 http://pan.baidu.com/disk/home#path=%252Fandroid%252Fdecompile%252Fapktool-all apktool用于将资源文件 ...
- Mac 下反编译Android APK
准备工作:安装ApkTool.dex2jar.JD-GUI 安装ApkTool 1.下载ApkTool.大家可以从 https://ibotpeaches.github.io/Apktool/inst ...
- 反编译Android的apk包得到源码(使用工具:dex2jar和jd-gui)
1. 先从 http://download.csdn.net/detail/dingyuming1991/9618125 下载反编译工具dex2jar和jd-gui(当然也可以google搜索下载): ...
随机推荐
- .NET设计模式(6):原型模式(Prototype Pattern)(转)
概述 在软件系统中,有时候面临的产品类是动态变化的,而且这个产品类具有一定的等级结构.这时如果用工厂模式,则与产品类等级结构平行的工厂方法类也要随着这种变化而变化,显然不大合适.那么如何封装这种动态的 ...
- LVM quick start
这里记录一些任务用到的快速命令,详细LVM管理可参考: http://wenku.baidu.com/view/c29b8bc4bb4cf7ec4afed0ad.html 1.把home分区的磁盘空间 ...
- 【面试题043】n个骰子的点数
[面试题043]n个骰子的点数 题目: 把n个骰子扔在地上,所有骰子朝上一面的点数之和为s, 输入n,打印出s的所有可能的值出现的概率. n个骰子的总点数,最小为n,最大为6n,根据排列组 ...
- 谈JavaScript组合拼接字符串的效率 --转载
JavaScript组合拼接字符串的效率.在脚本开发过程中,经常会按照某个规则,组合拼接出一个大字符串进行输出.比如写脚本控件时控制整个控件的外观的HTML标签输出,比如AJAX里得到服务器端的回传值 ...
- HDU 4034 Graph(floyd,最短路,简单)
题目 一道简单的倒着的floyd. 具体可看代码,代码可简化,你有兴趣可以简化一下,就是把那个Dijsktra所实现的功能放到倒着的floyd里面去. #include<stdio.h> ...
- UVA 557 Burger 排列组合递推
When Mr. and Mrs. Clinton's twin sons Ben and Bill had their tenth birthday, the party was held at t ...
- windows条件下,Ping加上时间戳,并保存到文件,适用于测试网络
在c盘下面新建文件 ping.vbs 在 ping.vbs中输入代码如下: Dim args, flag, unsuccOut args="" otherout="&qu ...
- QTreeWidget的一个例子,C++语法和item迭代循环都比较巧妙
学习一下,据说QTreeWidget简单好用,不需要单独设置Model和View,更没有delegate.Signal和Slot应该可以正常使用(未验证,以后补充). #include <QtG ...
- Android笔记——导入Github开源项目CircleRefreshLayout
百度n久都找不到android studio导入第三方类库的正确方法,纠结睡不着 ,最后终于蒙到了方法,原来想太多了 ---------------------------------------- ...
- ECharts本地部署
将下载的包解压,再将包内文件copy到C:\inetpub\wwwroot下 在html中做如下引用: <script type="text/javascript" sr ...