Arthur Schopenhauer said :

"A man can do what he wants, but not want what he wants"







Sunday, October 14, 2012

apk working with them


requirements

-APK Manager (get it from somewhere search on XDA)
-framework-res.apk
-Android SDK install it from sources 
-JRE - search for Java Runtime and install it by default options
-to check your java version open cmd.exe and input java -version if you get error "not found" or something like that just install JRE or check if java folder is set to your path/ system variables - search somewhere how to do that

now open APK Manager (this is ver. 5.0.2) by script.bat located in program's folder

a window will be shown it looks like this



the most important options here are :
23- read important tips, request help link
22- set a project ( .apk file ) to work with
9 - to decompile an apk
11- to compile it back with modified sources/ resources

if you get in trouble comment this post or request help on XDA thread (original)

http://forum.xda-developers.com/showthread.php?t=695701

to start up just copy framework-res.apk to /place-apk-here-for-modding folder then open application by script.bat now prompt 22 and press enter to select desired apk to work with; in this case I select 3 then press enter to turn back to main window




now select 9 to decompile apk wait a while then look in /projects folder for application's files (decompiled); start editing files then compile it back by 11 option; when compiling you get a message press y for 2 times


..then look in the new-created /keep folder (this is important in fact everything is important because you work with an essential Android file ! ) if you omit this step nothing will be saved - you lost your work so proceed carefully with this step too- in this folder delete everything (every .jpg, .png ) that was changed by you and delete resources.arsc for the case you changed/ edited .xml files anyway you get the warning


..return to app window and press enter to continue compilation finally you get OK if everything is well done, now return where you started -  /place-apk-here-for-modding folder then look for unsignedframework-res.apk you have to rename it to framework-res.apk and copy to phone but use adb utility not Root Explorer because it's a system file

NOTES

1. pay attention to *9.png files i.e. btn_dropdown_pressed.9.png is a *9.png file read somewhere how to edit these "expandable" images yes you can edit it by your favorite photo editor no problems but never ever do that - to touch black borders here I open above *.9.png by draw9patch.bat ( placed in android-sdk/tools folder)


one is to read about these black dots before to edit/change them

2. anytime you get a compiling error solve that before to flash framework to phone look at log.txt file for details

3.  - edit .smali files to change code/ functionality
    - edit .xml files to change appearance/ Android interface

sometimes it's not enough to edit framework-res.apk files are correlated i.e. to add new options/ entries to Power Menu you edit framework-res.apk to add resources (strings/ icons) and android.policy.jar to add functionality (action to run when pressing an option from Menu )

4. never sign a system apk so do not use 12 option

5. to get/ put framework from/to  phone you can use adb push/ pull from SDK or you can use APK Manager

0 - pull/get file from phone
8 - push/send  file to phone

to use these options you have to set environment variable tell Windows where to search for adb executable


6. this is not a detailed guide "how to do everything with apk" you should manage yourself to decompile an apk if you just want to change it anyway I try my best to change this based on your feedback - just comment it !


1 comment:

  1. Hey can this tutorial be used to change the height of the navigation bar on my alcatel ot 997D? i tried several times to recompile the framework-res.apk after i changed the certain xmls, but it didnt work with any version of it. Alcatel stores the framework-res.apk under /system/framework/ and under /custpack/.
    Can you tell me anything about this? I think there are generally problems with modifying stock roms :(

    ReplyDelete