How to Extract Media Contents Contained Within Android Apk App File
How do we extract the media contents of an Android Apk file or application, the audio and picture files contained within without using any software?
First,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”)
It’s shipped with Android Studio now. Just go to Build/Analyze APK… then select your APK 🙂
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
, runapktool decode
App
.
apk
App
apktool
is not included in the official Android SDK, but available using most packet repositories.
What is Android APK? In a simple term, APK can be describe as an extension of Android application file, just as .jar is an extension of Java and .sisx/.sis are extensions of Symbian file. The extension here means, the unique characters that appear after the period (.) in a full file name specific to a certain program, in this case which is Android. In another point of view, the codes, files and data contained within an Android apk file is what makes it an application.
Now that you know what Android APK file and extension (.apk) are, how do we get into the contents within its wall (I mean the data part here and not the code) without installing it, without any software? You might ask, what are the benefits and advantages involved. Let me put it this way. You download and install an Android game, launch it, and you discover you love the song, music or instrumental playing in the background while you were kicking the bad guys. You realize you won’t mind doing anything just to get your hands on the song. That is where this tutorial comes in.
Unlike other mobile operating system extensions, apk seems the most easiest to break through. Just get yourself any file explorer with zip/rar compression and extraction feature and the job is half done. Most File manager or explorer can penetrate into any apk file to reveal the contents within just like zip and rar files. Android file manager such as ES File Explorer, MiXplorer, X-plore just to mention few can do the trick. The good news is root is not required.
We will be using ES File Explorer for Android as our file manager in this tutorial (version 3.2.5.3 to be specific). We recommend you use ES File Explorer as well. If you already have the app you want to break-through installed on your Android device, you will need to first get its Apk file before you can dive into its core. Fortunately, you do not need to download its apk file again as we will help you to achieve that by simply following the steps below. If you already have the apk file or apk installer, just jump to the next step.
- Launch ES File Explorer from the app drawer on your device
- Click the menu button at the top left corner or simply swipe a finger from far-left to the right (gesture)
- Select “Library” from the menu that opened and click on “APP”
- The list of applications installed on your phone will be displayed
- Click and hold the application you want to have its apk file (you can select multiple apps at once)
- Select Backup from the list of options that shown under the screen. The process will start
To view the apk file of the application you have just backed up, simply go to the memory card root folder -> Backups -> Apps and you’ll find it there.
How to extract media files contain within an Android Apk file/installer
Before we proceed, there is something you should know. In most Android apk file or application, the media files such as picture and audio are usually placed within the assets and res folders. Look for these two folders first before you check other folders within the Apk file. In a rare occasion, you may find two res folders inside the apk file, check both folders. The res folder inside assets folder in most cases usually contains the media files. Inside the assets folder you may also find a folder named data, this sometimes also contain the media files.
- Locate the Android Apk app file you want to extract its content in ES File Explorer
- Click on it and hold, a menu will show at the bottom of the screen
- Click “More” from the menu that shows and select “Open”
- In next screen that shows up, select “EZ Zip Viewer”
- Locate “assets” from lists of folders that display, if you find res within this folder then you are on the right path
- Click and hold the res folder, then click the extract button that shows under the screen
- Choose path and select the folder in which you want to extract the contents
That’s it.
Now that you have extract the res folder where the media contents of the apk file is located, the next part is to identify the media files among other files within the res folder. This require skills as most time the media files are named in alphanumeric or in random letters that mingles well with other files within the folder. Also, in most cases, the extension of the media files are removed, so, it is hard to tell which of the files are media files and which are not. But don’t worry, we will give you a head-start.
File size is one of the factors that can reveal those that are likely to be a media file and those that are not. An ordinary file that contain a set of codes shouldn’t weigh more than 500 kilobytes. You should start from the heaviest files in the folder to the lightest files. This will be easier to do on a PC than on a smartphone, but if you are good on mobile phone then that’s fine. Just click and open each file within the res folder until you identify those that are media files.
It is easy once you know how to do it. Hope we’ve helped.
Please Note: Some games that requires additional data to be downloaded before they can work usually store their media files in a separate folder located in the phone external storage and NOT in the game apk installer. E.g FiFa game series. Getting the media files of such games is also easy. You’ll need to catch up with us on our next tutorial to learn that.
Alternatively,You will need to read the article from the beginning to understand this part.
In the picture above, the apk file in number “1” is Candy Crush Saga (version 1.63.0.2). That is the app we will be using as an example. ES File Explorer is the file manager.
1.) The Candy Crush apk file is placed in one of the folders on the phone storage. ES File Explorer is used to navigate to where the apk file is. Long-clicking on the file brings out menu which can be seen below the screen, among the options is “More”. Selecting “More” brings out another options which includes “Extract to”.
2.) The “Extract to” is clicked and that brings out a tiny window with three options:
i. Candy Crush Saga
ii. Current Path
iii. Choose Path
In this case the “Current Path” was chosen. Selecting this option will extract the contents within the apk to the same folder where Candy Crush apk file is.
3.) The extraction has began. This might take some time.
4.) The extraction is complete. Now in the same folder where the Candy Crush Saga is we have four new folders and three files:
i. assets
ii. lib
iii. META-INF
iv. res
v. AndroidManifest.xml
vi. Classes.Dex
vii. resources.arsc
The “res” folder doesn’t contains what we are looking for so we dive into the “assets” folder.
5.) In the “assets” folder there is another folder named “res_output”. We look into this folder.
6.) And here we are, we have what we are looking, the “Sound” folder.
7.) Diving into the “Sound” folder leads to two new folders, “sounds” folder and “music” folder, and two files “music.xml” and “sounds.xml”. The “music” give us a clue that we are near to our target. In this case we opened the “music” folder.
8.) And there we have them, all the music files in the game. ES recognize these files as audio files because they all ends with “.ogg” which is an audio file extension. Some Android apps may choose to use “.mp3” or even “.mp4”. In rare cases, the audio extension file may be removed. If removed, it might be difficult to know which is an audio file and which is not. In this case, you might “sort” the files by “size” and start from the heaviest, then open it one by one with a music player.
9.) Clicking on one of the audio files, ES brings out audio players that can play the file. In this case we choose “Music” which is our Android pre-installed audio player.
10.) The file is playing.
Hope this gives you some clue on how to locate and extract the audio files in an Android apk file. Have a question? Drop it using the comment form below.