如何查看 Android APK 文件的内容?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3599210/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to view the contents of an Android APK file?
提问by noob
Is there a way to extract and view the content of an .apk file?
有没有办法提取和查看 .apk 文件的内容?
回答by DonGru
Actually the apk file is just a zip archive, so you can try to rename the file to theappname.apk.zip
and extract it with any zip utility (e.g. 7zip).
实际上,apk 文件只是一个 zip 存档,因此您可以尝试将文件重命名为theappname.apk.zip
并使用任何 zip 实用程序(例如 7zip)将其解压缩。
The androidmanifest.xml
file and the resources will be extracted and can be viewed whereas the source code is not in the package - just the compiled .dex file ("Dalvik Executable")
的androidmanifest.xml
文件和资源将被提取并且可以被看作而源代码不是在包-刚编译.DEX文件(“的Dalvik可执行”)
回答by TienLuong
回答by Jens Erat
While unzipping will reveal the resources, the AndroidManifest.xml
will be encoded. apktool
can – among lots of other things – also decode this file.
虽然解压缩将显示资源,但AndroidManifest.xml
将被编码。apktool
可以——除此之外——还可以解码这个文件。
To decode the application App.apk
into the folder App
, run
要将应用程序解码App.apk
到文件夹中App
,请运行
apktool decode App.apk App
apktool
is not included in the official Android SDK, but available using most packet repositories.
apktool
不包含在官方 Android SDK 中,但可以使用大多数数据包存储库。
回答by Shachar Shemesh
There is also zzos. (Full disclosure: I wrote it). It only decompiles the actual resources, not the dex part (baksmali, which I did not write, does an excellent job of handling that part).
还有zzos。(完全披露:我写的)。它只反编译实际资源,而不是 dex 部分(baksmali,我没有写,在处理该部分方面做得很好)。
Zzos is much less known than apktool, but there are some APKs that are better handled by it (and vice versa - more on that later). Mostly, APKs containing custom resource types (not modifiers) were not handled by apktool the last time I checked, and are handled by zzos. There are also some cases with escaping that zzos handles better.
Zzos 的知名度远不如 apktool,但有一些 APK 可以由它更好地处理(反之亦然 - 稍后会详细介绍)。大多数情况下,我上次检查时 apktool 没有处理包含自定义资源类型(不是修饰符)的 APK,而是由 zzos 处理。在某些情况下,zzos 处理得更好。
On the negative side of things, zzos (current version) requires a few support tools to install. It is written in perl (as opposed to APKTool, which is written in Java), and uses aapt for the actual decompilation. It also does not decompile attrib resources yet (which APKTool does).
不利的一面是,zzos(当前版本)需要安装一些支持工具。它是用 perl 编写的(而不是用 Java 编写的 APKTool),并使用 aapt 进行实际的反编译。它也不会反编译 attrib 资源(APKTool 会这样做)。
The meaning of the name is "aapt", Android's resource compiler, shifted down one letter.
这个名字的意思是“aapt”,Android 的资源编译器,向下移动一个字母。
回答by skan
You have different tools:
你有不同的工具:
Apk Viewer
Apk 查看器
回答by Rasoul Miri
4 suggested ways to open apk files:
4 种打开 apk 文件的建议方法:
1.open apk file by Android Studio(For Photo,java code and analyze size) the best way
1.通过Android Studio打开apk文件(对于照片,java代码和分析大小)的最佳方式
2.open by applications winRar,7zip,etc (Just to see photos and ...)
2.通过应用程序winRar、7zip等打开(只是为了看照片和......)
3.use website javadecompilers(For Photo and java code)
3.使用网站javadecompilers(用于照片和java代码)
4.use APK Tools(For Photo and java code)
4.使用APK工具(用于照片和java代码)
回答by Jawad Zeb
There is a online decompiler for android apks
有一个适用于 android apks 的在线反编译器
http://www.decompileandroid.com/
http://www.decompileandroid.com/
Upload apk from local machine
从本地机器上传apk
Wait some moments
稍等片刻
download source code in zip format.
下载 zip 格式的源代码。
Unzip it, you can view all resources correctly but all java files are not correctly decompiled.
解压,可以正确查看所有资源,但是所有java文件都没有正确反编译。
For full detail visit this answer
有关完整详细信息,请访问此答案
回答by eliasbagley
Depending on your reason for wanting to extract the APK, APK Analyzer might be sufficient. It shows you directories, and file sizes. It also shows method counts grouped by package that you can drill down into.
根据您想要提取 APK 的原因,APK Analyzer 可能就足够了。它向您显示目录和文件大小。它还显示按包分组的方法计数,您可以深入查看。
APK Analyzer is built into Android Studio. You can access it from the top menu, Build -> Analyze APK.
APK 分析器内置于 Android Studio 中。您可以从顶部菜单中访问它,构建 -> 分析 APK。
回答by Kailas
In case of Hybrid appsdeveloped using cordova and angularjs, you can:
对于使用cordova 和angularjs 开发的混合应用程序,您可以:
1)Rename the .apk file to .zip
2)Extract/Unzip the contents
3)In the assets folder you will get the www folder
1)将 .apk 文件重命名为 .zip
2)提取/解压缩内容
3)在资产文件夹中,您将获得 www 文件夹
回答by monal94
You can also use Jadx - https://github.com/skylot/jadx. I have used all the tools mentioned in this page and found that Jadx works the best. The manifest file and other class files are converted to readable format as much as possible by this tool.
您也可以使用 Jadx - https://github.com/skylot/jadx。我使用了本页提到的所有工具,发现 Jadx 效果最好。清单文件和其他类文件通过此工具尽可能转换为可读格式。
PS - http://www.javadecompilers.com/apkalso uses the jadx decompiler to do the same work online. Simpler if you want to unarchive a single apk.
PS - http://www.javadecompilers.com/apk也使用 jadx 反编译器在线做同样的工作。如果您想取消归档单个 apk,则更简单。
Cheers!
干杯!