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...cation_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 .
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 )
abd pull /system/framework/framework-res.apk framework
Now let's install the framework
Open command prompt cd to the folder containing the pulled framework and type:-
apktool if framework-res.apk
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
adb pull /system/app/ applications
Open cmd ,cd to the folder containg the apk and type
apktool d xxx.apk xxx
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.
apktool b xxx xxx_new.apk
For more information on signing zipaling and other tools that were developed over apktool and offering more features checkout: http://forum.xda-developers.com/show....php?t=2295002
Thanks to @XperienceD for this awesome write up.