How to get source code of any android application?[Reverse engineering ]

 Hi all, today I am posting a very interesting topic "Reverse Engineering of Android Application". 

You need to follow the below steps to get all code & resources.


Download any .apk file.

Create a New folder and paste that .apk into the folder.

Now you just need to change the extension with .zip or .rar. [ ex: abc.apk to abc.zip or abc.rar]

Extract the .zip or .rar file, Now you can access the .dex file (compilation file) and many more (resources that were used in the application ex-: images, fonts, etc) but still, you are not able to access the java and XML file.

Download https://github.com/pxb1988/dex2jar and extract it to the folder.

Move the classes.dex file into dex2jar folder.

Now open the command prompt and change the directory to that folder (or NEW FOLDER). Then write d2j-dex2jar classes.dex (for mac terminal or ubuntu write ./d2j-dex2jar.sh classes.dex) and press enter. You now have the classes.dex.dex2jar file in the same folder.


Download java decompiler, double click on jd-gui, click on the open file, and open classes.dex.dex2jar file from that folder: now you get class files.

Save all of these class files (In jd-gui, click File -> Save All Sources) by src name. At this stage, you get the java source but the .xml files are still unreadable, so continue.

Now open another new folder Put in the .apk file which you want to decode Download the latest version of apktool AND apktool install window (both can be downloaded from the same link) and place them in the same folder Open a command window Now run command like apktool if framework-res.apk (if you don't have it get it here)and next apktool d myApp.apk (where myApp.apk denotes 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.

just copy the contents of both folders(in this case, both new folders) to the single one and enjoy the source code.

0 comments:

Post a Comment

Enter Here Your Ideas and Comment to improve this Blog

Popular Posts

Nilesh Jha. Powered by Blogger.

Contact Form

Name

Email *

Message *

Copyright © Nilesh Jha's Blog |
|