如何查看Android APK文件的内容?

发布于 2024-09-16 15:48:45 字数 29 浏览 4 评论 0原文

有没有办法提取并查看 .apk 文件的内容?

Is there a way to extract and view the content of an .apk file?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(14

音栖息无 2024-09-23 15:48:45

实际上,apk 文件只是一个 zip 存档,因此您可以尝试将文件重命名为 theappname.apk.zip 并使用任何 zip 实用程序(例如 7zip)将其解压。

androidmanifest.xml 文件和资源将被提取并可以查看,而源代码不在包中 - 只是编译后的 .dex 文件(“Dalvik 可执行文件”)

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).

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")

临风闻羌笛 2024-09-23 15:48:45

它现在随 Android Studio 一起提供。
只需转到构建/分析 APK...,然后选择您的 APK :)

在此处输入图像描述

It's shipped with Android Studio now.
Just go to Build/Analyze APK... then select your APK :)

enter image description here

深爱不及久伴 2024-09-23 15:48:45

虽然解压缩会显示资源,但 AndroidManifest.xml 将被编码。 apktool 还可以(除其他功能外)解码此文件。

要将应用程序 App.apk 解码到文件夹 App 中,请运行

apktool decode App.apk App

apktool 未包含在官方 Android SDK 中,但可以使用大多数数据包存储库。

While unzipping will reveal the resources, the AndroidManifest.xml will be encoded. apktool can – among lots of other things – also decode this file.

To decode the application App.apk into the folder App, run

apktool decode App.apk App

apktool is not included in the official Android SDK, but available using most packet repositories.

我纯我任性 2024-09-23 15:48:45

还有 zzos。 (完全披露:我写的)。它只反编译实际资源,而不反编译dex部分(baksmali,我没有写,在处理该部分方面做得非常出色)。

Zzos 比 apktool 更不为人所知,但它可以更好地处理一些 APK(反之亦然 - 稍后会详细介绍)。大多数情况下,包含自定义资源类型(不是修饰符)的 APK 在我上次检查时并未由 apktool 处理,而是由 zzos 处理。还有一些转义的情况 zzos 处理得更好。

不利的一面是,zzos(当前版本)需要安装一些支持工具。它是用 perl 编写的(与用 Java 编写的 APKTool 不同),并使用 aapt 进行实际的反编译。它还不会反编译 attrib 资源(APKTool 会反编译)。

这个名字的意思是“aapt”,Android的资源编译器,向下移动一个字母。

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

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).

The meaning of the name is "aapt", Android's resource compiler, shifted down one letter.

杀手六號 2024-09-23 15:48:45

您有多种可用工具:

  • Aapt(它是Android SDK)

    $ aapt dump badging MyApk.apk
    $ aapt转储权限MyApk.apk
    $ aapt dump xmltree MyApk.apk
    
  • Apktool

    $ java -jar apktool.jar -q 解码 -f MyApk.apk -o myOutputDir
    
  • Android 多功能工具

  • Apk 查看器

  • ApkShellext

  • Dex2Jar

    $ dex2jar/d2j-dex2jar.sh -f MyApk.apk -o myOutputDir/MyApk.jar
    
  • NinjaDroid

    $ ninjadroid MyApk.apk
    $ ninjadroid MyApk.apk --all --extract myOutputDir/
    
  • AXMLParser

    $ apkinfo MyApk.apk
    

You have several tools available:

  • Aapt (which is part of the Android SDK)

    $ aapt dump badging MyApk.apk
    $ aapt dump permissions MyApk.apk
    $ aapt dump xmltree MyApk.apk
    
  • Apktool

    $ java -jar apktool.jar -q decode -f MyApk.apk -o myOutputDir
    
  • Android Multitool

  • Apk Viewer

  • ApkShellext

  • Dex2Jar

    $ dex2jar/d2j-dex2jar.sh -f MyApk.apk -o myOutputDir/MyApk.jar
    
  • NinjaDroid

    $ ninjadroid MyApk.apk
    $ ninjadroid MyApk.apk --all --extract myOutputDir/
    
  • AXMLParser

    $ apkinfo MyApk.apk
    
爱要勇敢去追 2024-09-23 15:48:45

4种打开apk文件的建议方法:

1.通过Android Studio (对于照片,java代码和分析大小)最好的方法

在此处输入图像描述

2.通过应用程序 winRar、7zip 等打开(只是为了查看照片和...)

3.使用网站 javadecompilers (对于照片和 java 代码)

4.使用 APK 工具(用于照片和 java 代码)

4 suggested ways to open apk files:

1.open apk file by Android Studio (For Photo,java code and analyze size) the best way

enter image description here

2.open by applications winRar,7zip,etc (Just to see photos and ...)

3.use website javadecompilers (For Photo and java code)

4.use APK Tools (For Photo and java code)

黑寡妇 2024-09-23 15:48:45

unzip my.apk

这可以通过 Linux 命令行来实现,因为 APK 格式只是顶部的 ZIP 文件。

unzip my.apk

This does the trick from the Linux command line since the APK format is just a ZIP file on the top.

七秒鱼° 2024-09-23 15:48:45

有一个针对 android apk 的在线反编译器

http://www.decompileandroid.com /

从本地计算机上传 apk

稍等片刻,

下载 zip 格式的源代码。

解压后,可以正确查看所有资源,但是所有java文件都没有正确反编译。

有关完整详细信息 访问此答案

There is a online decompiler for android apks

http://www.decompileandroid.com/

Upload apk from local machine

Wait some moments

download source code in zip format.

Unzip it, you can view all resources correctly but all java files are not correctly decompiled.

For full detail visit this answer

℡寂寞咖啡 2024-09-23 15:48:45

对于使用 cordova 和 angularjs 开发的混合应用,您可以:

1) 将 .apk 文件重命名为 .zip
2)提取/解压缩内容
3) 在资产文件夹中,您将获得 www 文件夹

In case of Hybrid apps developed using cordova and angularjs, you can:

1) Rename the .apk file to .zip
2) Extract/Unzip the contents
3) In the assets folder you will get the www folder

在风中等你 2024-09-23 15:48:45

根据您想要提取 APK 的原因,APK 分析器可能就足够了。它显示目录和文件大小。它还显示按包分组的方法计数,您可以深入了解。

APK 分析器内置于 Android Studio 中。您可以从顶部菜单“构建”->“构建”访问它。分析 APK。

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 Analyzer is built into Android Studio. You can access it from the top menu, Build -> Analyze APK.

橘味果▽酱 2024-09-23 15:48:45

您还可以使用 Jadx - https://github.com/skylot/jadx。我使用了本页提到的所有工具,发现 Jadx 效果最好。该工具会尽可能将清单文件和其他类文件转换为可读格式。

PS - http://www.javadecompilers.com/apk 也使用 jadx 反编译器来完成相同的工作在线的。如果您想取消存档单个 apk,则更简单。

干杯!

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.

PS - http://www.javadecompilers.com/apk also uses the jadx decompiler to do the same work online. Simpler if you want to unarchive a single apk.

Cheers!

青芜 2024-09-23 15:48:45

APK扫描器可以显示PC上APK文件的信息。
另外,可以从 Android 设备中提取 apk 文件。
并且可以链接到其他工具。(JADX-GUI、JD-GUI...)

在此处输入图像描述

The APK Scanner can be show the information of APK file on PC.
also, can be pull an apk file from the android device.
And can be link to other tools.(JADX-GUI, JD-GUI...)

enter image description here

琉璃梦幻 2024-09-23 15:48:45

您还可以在 Android 设备本身中查看 APK 文件的内容,这对调试有很大帮助。

包括应用程序清单在内的所有文件都可以使用电子邮件、云等查看和共享,无需生根。应用程序可从以下位置获取:

https://play.google .com/store/apps/details?id=com.dasmic.android.apkpeek

免责声明:我是这个应用程序的作者。

You can also see the contents of an APK file within the Android device itself, which helps a lot in debugging.

All files including the manifest of an app can be viewed and also shared using email, cloud etc., no rooting required. App is available from:

https://play.google.com/store/apps/details?id=com.dasmic.android.apkpeek

Disclaimer: I am the author of this app.

书信已泛黄 2024-09-23 15:48:45

在无法重命名文件扩展名后,我用pezip打开了它。

I opened it with peazip after I couldn't rename file extension.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文