368

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?

Ahmad Aghazadeh
  • 16,571
  • 12
  • 101
  • 98
bharath
  • 14,283
  • 16
  • 57
  • 95
  • I have one APK file. I need to view the Androidmanifest.xml file. because i used one framework. That APK file also used same framework. So i need to see how to configure the Androidmanifest file from that APK file. – bharath Nov 16 '10 at 06:48
  • I wasn't able to do this in chrome, but when I opened it in Firefox and chose to *view the source code* (otherwise there's just error) then I was able to *partially* see the content. – jave.web Aug 04 '22 at 17:27

18 Answers18

249

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

Zoe
  • 27,060
  • 21
  • 118
  • 148
Vikas Patidar
  • 42,865
  • 22
  • 93
  • 106
  • 22
    This is nice, but I'd like to know how to just look at the AndroidManifest.xml without having to download all of this. Is it encrypted or compressed? – JohnnyLambada Jan 15 '11 at 00:59
  • 2
    **@JohnnyLambada**: Yes you can open and view it in a archiving tool like: **WinRar/WinZip/7Zip** but it make no sense because it is in encrypted form. – Vikas Patidar Feb 19 '11 at 09:24
  • is it possible to decrypt , change it a bit (for example the minSdkVersion) , and then put it back into the apk ? – android developer Jul 13 '12 at 08:25
  • 12
    The apktool is deprecated. Better refer to their [project homepage](http://code.google.com/p/android-apktool/) for latest version. – Deqing Jul 25 '12 at 05:49
  • 1
    I get: Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: at brut.androlib.res.data.ResConfig.addResource(Unknown Source) – WindRider Oct 02 '12 at 15:29
  • @VikasPatidar This is great.. but can you please tell how to do this on the device. I mean with SDK (using XMLPullParse/Sax/DocumentBuilder). – Kishore Jun 03 '13 at 09:46
  • 1
    @Kishore: You can not directly read `AndroidManifest.xml` from your application. However you can access various information like Version name, Version Code, Package Name etc. using the official API's. – Vikas Patidar Jun 17 '13 at 05:23
  • is it possible to use the apkTool even within an Android app? – android developer Feb 23 '14 at 18:18
  • is it possible to Look see Decrepted mean normal words i want to see Manifesto file or .xml Designing files is any way to do ....?? i got all the things by APK to convert in zip and Decampile code by tool Decompiler i can get xml or .manifesto details so how do i can look these file .code in Decreption format .....???? – Amitsharma May 04 '15 at 07:08
  • Command seems different in latest version, need to use "-o" before destination folder. Didn't worked for me, either way. – albf.unicamp Dec 30 '15 at 14:36
  • 1
    @JohnnyLambada You can try this http://www.javadecompilers.com/ or this http://www.decompileandroid.com/. – Alexandr Feb 26 '16 at 09:45
  • @VikasPatidar, as far as i know the android manifest is not encrypted, it is only in binary form . – turkishweb Mar 23 '16 at 09:49
  • @turkishweb thanks for the correction, I will update it. it has been so long since I answered it. – Vikas Patidar Mar 23 '16 at 10:38
  • 1
    Now that [Google released the ClassyShark Android binary inspection tool](http://stackoverflow.com/questions/4191762/how-to-view-androidmanifest-xml-from-apk-file/40686067#40686067), this answer is obsolete. – Dan Dascalescu Nov 18 '16 at 21:18
  • 12
    Now command has changed for the latest version `apktool d your_destination youraApk.apk` – Pranoy Sarkar Jul 31 '17 at 08:44
  • downvoting because it is an old answer. the easiest approach is to use Android Studio as indicated by @jonas – bkurzius Sep 28 '18 at 15:32
  • Also downvoting, no longer works. I get an error ... Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file – O'Rooney Nov 16 '21 at 21:51
  • I've used the @Deqing's comment to download the apk tool from [here](https://ibotpeaches.github.io/Apktool/) and then execute the following command in the terminal (_Windows 10_) `>java -jar apktool_2.6.0.jar d com.mihkov.helloworldapp.apk`. – mihkov Jan 04 '22 at 21:58
  • This answer is obsolete. The answer by @jonas-jongejan should be accepted instead. – Luzian Aug 12 '22 at 10:25
220

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.

Jonas Jongejan
  • 2,826
  • 1
  • 16
  • 17
68

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>
dolmen
  • 8,126
  • 5
  • 40
  • 42
Dan Dascalescu
  • 143,271
  • 52
  • 317
  • 404
64

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.

Dan Dascalescu
  • 143,271
  • 52
  • 317
  • 404
Geobio Boo
  • 1,284
  • 1
  • 10
  • 12
47

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"
JohnnyLambada
  • 12,700
  • 11
  • 57
  • 61
40

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.

caw
  • 30,999
  • 61
  • 181
  • 291
  • 13
    This should be the accepted answer as it does not require to install anything from unverified sources. – c4k Apr 23 '19 at 08:41
  • 1
    note that this doesn't seem to work on Windows :( https://stackoverflow.com/a/54593118/997940 – Yoav Feuerstein Dec 30 '19 at 10:33
  • 4
    I get error: Exception in thread "main" java.lang.IllegalStateException: The tools directory property is not set, please make sure you are executing apkanalyzer, I didn't know how to solve it – jk2K Jun 01 '20 at 09:48
  • This is most likely the path you need if you’re on macOS: `~/Library/Android/sdk/tools/bin/apkanalyzer manifest print ` – Frederik Jun 09 '20 at 10:07
  • works on windows now. the version I used was downloaded in 2022. – oldpride Jul 09 '23 at 17:59
21

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

aapt dump xmltree gmail.apk AndroidManifest.xml > AndroidManifest.txt
Ahmad Aghazadeh
  • 16,571
  • 12
  • 101
  • 98
  • 3
    `d` is an abbreviation for `dump`, which makes this answer identical to [this one](http://stackoverflow.com/questions/4191762/how-to-view-androidmanifest-xml-from-apk-file/28464940#28464940), which was posted more than a year earlier. – Dan Dascalescu Aug 09 '16 at 22:53
  • 6
    Yes, but this code save in file `> AndroidManifest.txt`. – Ahmad Aghazadeh Aug 10 '16 at 08:01
  • 2
    lol, that's the same answer, dumping the file is not making the difference – Leonardo Sapuy Oct 13 '17 at 19:00
  • 2
    It's a better written answer: I skipped the other one because I thought the output would be binary, but here it is clear right away that AndroidManifest.txt will be ASCII readable by humans. – Avio Jan 19 '22 at 12:58
16

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
Robert
  • 39,162
  • 17
  • 99
  • 152
BitByteDog
  • 3,074
  • 2
  • 26
  • 39
  • This doesn't output the original XML, but it's neat if I just need to look at a value in there without having to extract the APK or write to a temporary file. – Thomas Glaser Nov 13 '19 at 14:14
  • This very weirdly required both XML and .apk, I only had the XML, I found out that Archive Manager can "zipped" it to ".apk" and I just provided that as the `.apk` and then it worked :-) – jave.web Aug 04 '22 at 17:26
16

To decode the AndroidManifest.xml file using axmldec:

axmldec -o output.xml AndroidManifest.xml

or

axmldec -o output.xml AndroidApp.apk
amrezzd
  • 1,787
  • 15
  • 38
8

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

twlkyao
  • 14,302
  • 7
  • 27
  • 44
  • 2
    That tool hasn't been updated in give years. Google has just released an [Android binary inspection tool](http://stackoverflow.com/questions/4191762/how-to-view-androidmanifest-xml-from-apk-file/40686067#40686067) in Nov 2016. – Dan Dascalescu Nov 18 '16 at 21:19
7

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

Kailas
  • 7,350
  • 3
  • 47
  • 63
user3289695
  • 740
  • 1
  • 9
  • 20
4

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

pureth
  • 680
  • 6
  • 9
2

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

zmarties
  • 4,809
  • 22
  • 39
1

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.

richbai90
  • 4,994
  • 4
  • 50
  • 85
1

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.

johan
  • 764
  • 7
  • 17
1

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.

hostar
  • 166
  • 2
0

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

Gert
  • 166
  • 1
  • 5
-1

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]\
Kevin
  • 2,296
  • 21
  • 22