Android Tutorials


Saturday, 14 December 2013

Retrieve Source ode from .APK file

How to get source (java files) from .apk file?

As we now know that APK file is just a zip file containing all program resource file, we can now get java code from APK files with ease. Following are steps to get java code from APK files.

Step 1:

                     Make a new folder and put .APK file in it (which you want to decode). Now rename the extension of this .APK file to .zip (eg.: rename from filename.apk to and save it. Now you get classes.dex files, etc. At this stage you are able to see drawable but not xml and java files, so continue.

Step 2:

                   Now you download two tool(dex2jar and java decompiler ) from this link:


java decompiler:

Step 3: Extract Dex2jar and copy all file and into a same folder

Now open command prompt and go to the folder created in previous step and type the command "dex2jar classes.dex" and press enter.This will generate "classes.dex.dex2jar" file in the same folder.

Step 3:  
                   Now extract java decompiler and open it. From jd-gui window browse the generated "classes.dex.dex2jar" file in demofolder, this will give all the class files by src name.

Extract that zip file ( and you will get all java files of the application.
Above steps will generate java files but to get xml files perform following steps.

Above steps will generate java files but to get xml files perform following steps.

Step 3: 
          Getting xml files from APK

Now download two more tool for getting xml file:

Extract both files and place it in the same folder (for example "demoxmlfolder").
Place the .apk file in same folder (i.e demoxmlfolder)
Now open command prompt and goto  the directory where apktool is stored (here "demoxmlfolder") and type the command "apktool if framework-res.apk" 
Above command should result in "Framework installed ..."
Now in command prompt type the command "apktool d filename.apk" (where filename is name of apk file)
This will generate a folder of name filename in current directory (here demoxmlfolder) where all xml files would be stored in res\layout folder.

Friday, 6 December 2013


         Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES] Error When         Trying To Install An App In Android 

This error occurs when you try to install an app via ADB and there is already another version of the same app which was installed from a different development machine.
To get round it uninstall the previous version and rerun the install.