How to view the contents of an Android APK file?
Asked Answered
G

14

144

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

Gilly answered 30/8, 2010 at 9:27 Comment(2)
Check out android-apktool.Noticeable
apktool moved to ibotpeaches.github.io/ApktoolMccaffrey
E
160

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

Escorial answered 30/8, 2010 at 9:29 Comment(1)
The dalvik file can be converted to jar using dex2jar utility and then can be opened by any java decompiler tool.Tawnatawney
H
53

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

enter image description here

Hast answered 11/6, 2017 at 18:40 Comment(0)
E
22

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.

Edgerton answered 15/6, 2014 at 12:27 Comment(1)
You have to add -o to the command, otherwise, it thinks App is an input file, reporting the error: "Input file (App) was not found or was not readable". Proper command: apktool decode App.apk -o App.Phylactery
A
12

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.

Alarm answered 8/7, 2012 at 15:31 Comment(0)
F
9

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
    
Flexile answered 25/1, 2014 at 1:43 Comment(0)
K
8

unzip my.apk

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

Koenig answered 31/10, 2017 at 8:26 Comment(0)
P
8

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)

Pumphrey answered 23/6, 2018 at 12:20 Comment(0)
B
3

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

Blastomere answered 3/12, 2014 at 6:23 Comment(0)
B
3

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

Bluepencil answered 29/6, 2018 at 4:37 Comment(0)
I
2

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.

Induline answered 19/1, 2017 at 8:55 Comment(0)
C
1

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!

Cherianne answered 11/8, 2016 at 11:30 Comment(0)
R
1

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

Regnant answered 28/2, 2019 at 7:34 Comment(0)
L
0

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.

Lions answered 20/5, 2018 at 16:42 Comment(0)
C
0

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

Coh answered 9/2, 2023 at 8:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.