Google+ Fundroid: Want to learn how to compile /decompile a Android APK here is how you do it !!

Thursday 5 July 2012

Want to learn how to compile /decompile a Android APK here is how you do it !!


There are basically two ways to do it the first one is an MANUAL method  and the second one is an SEMI AUTOMATED  method



ManualMethod :-

REQUIREMENTS :-
1)WINDOWS
2)THE LATEST JRE AND JDK INSTALLED
3)APKTOOL or APKTOOL for ics
(both can be found in the attached  files of the following link:- APKTOOLS

METHOD:-

1) EXTRACT THE CONTENTS OF THE RAR FILE INTO A FOLDER
2) EVEN PUT THE APK YOU WANT TO MESS WITH AND EVEN THE FRAMEWORK_RES.APK WHICH YOU CAN GET FROM YOUR  ROM ZIP FILE
(suppose I have extractes all the file in the location c://android/apkedit)

3)NOW WE OPEN THE CMD AND TYPE THE FOLLOWING COMMANDS TO ENTER THIS DIRECTORY IT IS SHOWED IN THE FOLLOWING IMAGE


4)NOW TO DECOMPILE APK TYPE THE FOLLOWING COMMANDS IN THE CMD :-
  • apktool if framework-res.apk
  • apktool d Nova.apk Nova
WHERE Nova.apk is the apk name and Nova is the folder to be created that will contain the decompiled apk

5)NOW IN THE  NOVA FOLDER MAKE THE CHANGES YOU WANT TO MAKE TO THE XML,DRAWABLE ETC..

6)NOW TO RECOMPILE THE APK TYPE THE FOLLOWING COMMAND IN THE CMD:-
  • apktool b Nova Nova-new.apk

WHERE Nova is the folder you have edited and Nova-new.apk is the new apk to be created

Now we are NOT done... we cannot use the new apk's... we have to take what we did and add it back to the original apk file to keep proper signature

use something like 7zip, take the 'resources.arcs' file and any other xml files you edited out of the "-new" apk and copy them into Original apk

now the apk is ready to flash with your new changes


NOTE:- ics user use the APK TOOL for ics




SemiAutomatedMethod:-

REQUIREMENTS:-
1) WINDOWS
2) THE LATEST JRE AND JDK INSTALLED
3) AUTO APK TOOL

METHOD:-

1) EXTRACT THE CONTENTS OF THE AUTO APK TOOL RAR FILE INTO AN FOLDER
2) RUN THE  AutoAPKToolMain FILE


3)NOW PLACE THE APK YOU WANT TO PAY WITH IN THE _INPUT_APK FOLDER
4)NOW PUT 6 AND ENTER IN THE ABOVE CMD THAT YOU HAVE OPENED AND THEN DRAG THE APK FROM THE _INPUT_APK INTO THE CMD AND THEN PRESS ENTER
5)ONCE YOU HIT ENTER THE APK WILL START THE DECOMPILING PROCESS AND AN POPUP LOG WILL APPEAR ,ONCE COMPLETED CLOSE THE LOG AND NOW GO TO THE _INPUT_APK FOLDER  YOU WILL SEE AN FOLDER WITH THE SAME NAME AS YOUR APK,NOW YOU CAN MAKE WHATEVER CHANGES YOU WANT TO MAKE INTO THE XML,DRAWABLE FILES

6) NOW ONCE YOU HAVE MADE THE CHANGES WE HAVE TO COMPILE THE APK
ENTER 7 IN THE CMD WE HAVE OPENED AND NOW WE HAVE TO DRAG THE ENTIRE FOLDER WE HAVE EDITED AND NOT THE APK AND PRESS ENTER





7) ONCE THE RECOMPILING THAT FINISHED OPEN THE DECOMPILED FOLDER AND OPEN DIST FOLDER THERE YOU WILL GET YOUR EDITED APK
8)YOU MUST NOW SIGN THE APK WITH OPTION 10 IN THE CMD YOU HAVE OPENED 
 (NOTE: drag the apk from dist folder to the prompt, then press enter, and in the SAME folder, a signedxxx.apk will appear)

9)RENAME THE APK AND PUSH IT (note : you can push the apk with option 62 or sdk typing )

   Code:
adb remount
adb push xxx.apk system/app
adb reboot


 






No comments:

Post a Comment