How to view the contents of an Android APK file?

AndroidApk

Android Problem Overview


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

Android Solutions


Solution 1 - Android

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

Solution 2 - Android

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

enter image description here

Solution 3 - Android

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.

Solution 4 - Android

There is also https://github.com/Shachar/Lingnu-Android-Tools">zzos</a>;. (Full disclosure: I wrote it). It only decompiles the actual resources, not the dex part (http://code.google.com/p/smali/">baksmali</a>;, 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.

Solution 5 - Android

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
    

Solution 6 - Android

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)

Solution 7 - Android

unzip my.apk

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

Solution 8 - Android

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

Solution 9 - Android

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.

Solution 10 - Android

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

Solution 11 - Android

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!

Solution 12 - Android

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.

Solution 13 - Android

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionnoobView Question on Stackoverflow
Solution 1 - AndroidDonGruView Answer on Stackoverflow
Solution 2 - AndroidTienLuongView Answer on Stackoverflow
Solution 3 - AndroidJens EratView Answer on Stackoverflow
Solution 4 - AndroidShachar ShemeshView Answer on Stackoverflow
Solution 5 - AndroidskanView Answer on Stackoverflow
Solution 6 - AndroidRasoul MiriView Answer on Stackoverflow
Solution 7 - AndroidCiro Santilli Путлер Капут 六四事View Answer on Stackoverflow
Solution 8 - AndroidZar E AhmerView Answer on Stackoverflow
Solution 9 - AndroideliasbagleyView Answer on Stackoverflow
Solution 10 - AndroidKailasView Answer on Stackoverflow
Solution 11 - AndroidMonal JainView Answer on Stackoverflow
Solution 12 - AndroidcbelwalView Answer on Stackoverflow
Solution 13 - AndroidSunggyu KamView Answer on Stackoverflow