Android application package (APK) is the package file format used to distribute and install application software and middleware onto Google's Android operating system, and certain other operating systems, such as Blackberry 10 Devices with the OS version 10.2.1 or higher.
Read more here:http://en.wikipedia.org/wiki/Android_application_package
XDA PORTAL POST:http://www.xda-developers.com/apk-files-modifications/
What's inside an APK
- AndroidManifest.xml It contains the valuable information for an application to function well.The permission it takes from the android system,the libraries it requires for proper functioning ,the minimum sdk version/api level/or in general the android version required and much more.
- res(Resources) folder The most important folder inside an apk .It contains the all the things that an apk has.It got the xml codes which tell about diffrent sizes of things in apk the different colors ,labels ,icons ect.
- lib folder this may or mayn't be present .It contains the few library files required especially for the application to work properly
- assets folder
- an odex apk also contains class.dex the java part of the apk.
- smali folder the java part of the apk in deodexed apk
How to Re-Engineer or Decompile &Recompile an APK
There are many tools that you will find floating over the internet for this very purpose but actually the main tool over which these tools have been built is the APKTOOL .
check out:code.google.com/p/android-apktool/
Install your apktool.
I'll recommend you to install the Android SDK or use my reduced sdk in the attachments below (if you use windows)
Once you have installed the apktool.(I'm considering you have completly installed and configured java well)It's time to get started!
So we are going to pull the framework files from the system.
type in command prompt (cd it to the folder containing adb i.e. android-sdk/platform-tools or my the reduced sdk )
pull all the framework files from system/framework (only the apks) and systemui from the app folder .
Now let's install the framework
Open command prompt cd to the folder containing the pulled framework and type:-
Similarly install all resources.
Now let's decompile the an APK.
if you have an APK thats nice but if you don't let's pull some form the system
Lets say we are decompiling an APK names xxx.apk
Open cmd ,cd to the folder containg the apk and type
let's recompile the apk back
cd the cmd to the folder containing the decompile apk i.e. if /a/b/c contains folder xxx i.e. the decompiled apk then cd to a/b/c.
type
For more information on signing zipaling and other tools that were developed over apktool and offering more features checkout: http://xdaforums.com/showthread.php?t=2295002
Thanks to @XperienceD for this awesome write up.
Attachments
Last edited: