bharath
bharath

Reputation: 14453

How to view AndroidManifest.xml from APK file?

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?

Upvotes: 386

Views: 444792

Answers (18)

JohnnyLambada
JohnnyLambada

Reputation: 12826

2024-07-02 Update

In the intervening years, I found I need to get the entire XML to query it using XML tools. Here's a (reasonably) foolproof bash/zsh function that will just dump the file XML formatted:

apkmanifest() { (export d=$(mktemp -d) && trap 'rm -rf $d' EXIT && unzip -q $1 -d $d AndroidManifest.xml && (cd $d && zip -q temp.apk AndroidManifest.xml && apktool d temp.apk > /dev/null 2>&1) && cat $d/temp/AndroidManifest.xml) }

You can just paste it into bash then run it like this:

apkmanifest /path/to/your/android.apk

It:

  1. Creates a temp directory
  2. unzips just the AndroidManifest.xml (gibberish version)
  3. zips it back int temp.apk
  4. Uses apktool to get it back out in an xml form
  5. Cats it out
  6. Removes the temp directory

You need zip, unzip, apktool on your path.

Original Answer

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"

Upvotes: 48

Vikas Patidar
Vikas Patidar

Reputation: 43349

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 install apktool: see instructions on the apktool website

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

apktool d HelloWorld.apk -o ./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

Upvotes: 257

BitByteDog
BitByteDog

Reputation: 3484

Aapt2, included in the Android SDK build tools can do this - no third party tools needed.

$(ANDROID_SDK)/build-tools/28.0.3/aapt2 d --file AndroidManifest.xml app-foo-release.apk

Starting with build-tools v29 you have to add the command xmltree:

$(ANDROID_SDK)/build-tools/29.0.3/aapt2 d xmltree --file AndroidManifest.xml app-foo-release.apk

Upvotes: 18

Dan Dascalescu
Dan Dascalescu

Reputation: 151906

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>

Upvotes: 73

Gert
Gert

Reputation: 176

Just upload the apk at https://www.sisik.eu/apk-tool and you can view the AndroidManifest.xml

Upvotes: 0

pureth
pureth

Reputation: 828

All these answers seem a bit over-engineered!

  1. Just grab this chrome extension: https://chrome.google.com/webstore/detail/apk-downloader/fgljidimohbcmjdabiecfeikkmpbjegm

  2. Download the .apk file you want from the playstore using the above extension.

  3. Upload the .apk to this online tool to grab the manifest.xml: https://www.sisik.eu/apk-tool

Upvotes: 5

hostar
hostar

Reputation: 186

Another option is to use Jadx: https://github.com/skylot/jadx

Just open your APK and in treeview select "AndroidManifest.xml". It will be readable just like that.

Upvotes: 3

Jonas Jongejan
Jonas Jongejan

Reputation: 3136

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.

Upvotes: 251

johan
johan

Reputation: 824

Another useful (Python-based) tool for this is Androguard, using its axml sub-command:

androguard axml my.apk -o my.xml

This extracts and decodes the app manifest in one go. Unlike apktool this doesn't unpack anything else.

Upvotes: 2

caw
caw

Reputation: 31479

You can use apkanalyzer, the command-line version of the APK Analyzer bundled with the Android SDK. Just execute the following command on the CLI:

/path/to/android-sdk/tools/bin/apkanalyzer manifest print /path/to/app.apk

You only have to replace /path/to/android-sdk with the correct path to your version of the Android SDK, and /path/to/app.apk with the path to your APK file.

Upvotes: 50

rez
rez

Reputation: 2077

To decode the AndroidManifest.xml file using axmldec:

axmldec -o output.xml AndroidManifest.xml

or

axmldec -o output.xml AndroidApp.apk

Upvotes: 17

Kevin
Kevin

Reputation: 2406

The file needs to be decompiled (or deodex'd not sure which one). But here's another way to do it:

-Download free Tickle My Android tool on XDA: https://forum.xda-developers.com/showthread.php?t=1633333https://forum.xda-developers.com/showthread.php?t=1633333
-Unzip
-Copy APK into \_WorkArea1\_in\ folder
-Open "Tickle My Android.exe"
-Theming Menu
-Decompile Files->Any key to continue (ignore warning)
-Decompile Files->1->[Enter]->y[Enter]
-Wait for it to decompile in new window... Done when new window closes
-Decompiled/viewable files will be here: \_WorkArea3\_working\[App]\

Upvotes: -1

zmarties
zmarties

Reputation: 4859

You can also use my app, App Detective to view the manifest file of any app you have installed on your device.

Upvotes: 2

Ahmad Aghazadeh
Ahmad Aghazadeh

Reputation: 17131

You can use this command: save to file AndroidManifest.txt

aapt dump xmltree gmail.apk AndroidManifest.xml > AndroidManifest.txt

Upvotes: 22

Geobio Boo
Geobio Boo

Reputation: 1354

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.

Upvotes: 69

There is an online tool that lets you upload an APK It decompiles it and finally lets you to download a zip with all sources, manifest XML file and so on decompiled, all of that without having to install any program on your computer: http://www.javadecompilers.com/apk

Also if you wish just to check on some params you can, by their UI

Upvotes: 9

richbai90
richbai90

Reputation: 5204

This is an old thread, but I thought I would mention, of your phone has root, you can view it directly on your phone using the root explorer app. You don't even have to extract it to see.

Upvotes: 1

twlkyao
twlkyao

Reputation: 14628

The AXMLParser and APKParser.jar can also do the job, you can see the link. AXMLParser

Upvotes: 8

Related Questions