Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extracting Android .apk and reading contents of XML file in res/layout

Tags:

java

android

I am trying to reverse engineer an existing android app and understand how a particular UI is constructed. I've found that I can rename the apk to zip and view some of the compiled source. The res/layout directory is populated with all the xml files that define the UI, but while they do have the xml extension, they are not in XML format. Is there anyway to convert these files back to text based markup?

like image 458
nolan Avatar asked Oct 06 '10 00:10

nolan


People also ask

How do I view the contents of an APK file in Android?

If you want to locate the APK files in your Android phones, you can find the APK for user-installed apps under /data/app/directory while the preinstalled ones are located in /system/app folder and you can access them by using ES File Explorer.

Which tool is used to extract the Android manifest file from the APK file?

Extracting and reading the manifest file - iOS Tutorial xml is used to describe the functionality and requirements of an Android application. And it's generated as part of the build process for that Android application. This is a compiled XML binary file and, to read it, we'll use a tool called Apktool.


2 Answers

I think you can use android-apktool. The XML files look very well.

like image 110
pengwang Avatar answered Sep 18 '22 17:09

pengwang


Create a new folder and put the .apk file which you want to decode into that.

Download the latest version of from here.

Open cmd then navigate to the root directory of APKtool and type the following command:

apktool d myApp.apk  

(where myApp.apk is the filename that you want to decode)

now you get a file folder in that folder and can easily read the apk's xml files.

Here is the link for more detail install instructions

like image 36
Milad Faridnia Avatar answered Sep 19 '22 17:09

Milad Faridnia