How to view AndroidManifest.xml from APK file?

360,620

Solution 1

Yes you can view XML files of an Android APK file. There is a tool for this: android-apktool

It is a tool for reverse engineering 3rd party, closed, binary Android apps

How to do this on your Windows System:

  1. Download apktool-install-windows-* file
  2. Download apktool-* file
  3. Unpack both to your Windows directory

Now copy the APK file also in that directory and run the following command in your command prompt:

apktool d HelloWorld.apk ./HelloWorld

This will create a directory "HelloWorld" in your current directory. Inside it you can find the AndroidManifest.xml file in decrypted format, and you can also find other XML files inside the "HelloWorld/res/layout" directory.

Here HelloWorld.apk is your Android APK file.

See the below screen shot for more information: alt text

Solution 2

Android Studio can now show this. Go to Build > Analyze APK... and select your apk. Then you can see the content of the AndroidManifest file.

Solution 3

aapt d xmltree com.package.apk AndroidManifest.xml

will dump the AndroidManifest.xml from the specified APK. It's not in XML form, but you can still read it.

aapt (Android Asset Packaging Tool) is a built in tool that comes with the Android SDK.

Solution 4

Google has just released a cross-platform open source tool for inspecting APKs (among many other binary Android formats):

ClassyShark is a standalone binary inspection tool for Android developers. It can reliably browse any Android executable and show important info such as class interfaces and members, dex counts and dependencies. ClassyShark supports multiple formats including libraries (.dex, .aar, .so), executables (.apk, .jar, .class) and all Android binary XMLs: AndroidManifest, resources, layouts etc.

ClassyShark screenshot

Install version 8.2:

wget https://github.com/google/android-classyshark/releases/download/8.2/ClassyShark.jar

Run:

java -jar ClassyShark.jar -open <file.apk>

Solution 5

In this thread, Dianne Hackborn tells us we can get info out of the AndroidManifest using aapt.

I whipped up this quick unix command to grab the version info:

aapt dump badging my.apk | sed -n "s/.*versionName='\([^']*\).*/\1/p"
Share:
360,620
bharath
Author by

bharath

Android development.

Updated on July 10, 2022

Comments

  • bharath
    bharath almost 2 years

    Is it possible to view Androidmanifest.xml file?

    I just changed the extension of the apk file to zip. This zip file contains the Androidmanifest.xml file. But I am unable view the contents of Androidmanifest.xml. It is fully encrypted.

    How can I view the Androidmanifest.xml file?