បកប្រែភាសា

Tuesday, June 25, 2013

រៀបកប្រែFramwork-rea.apk

TRANSLATE ANDROID SYSTEM APKS INTO KHMER

20120331_142039

Concept:
  1. Use apktool to decompile the android system files.
  2. modify the resources in res folders
  3. recompile them back.
  4. replace resources.arsc and other xml and images resources with the modified one using winrar make sure you save it in zip format and “store” as compression method.
  5. when replacing the framework-res.apk in your phone with modified framework-res.apk. make sure you set the permission to all 777.


+Translate Framworks-res.apk


step 1: extract your Apktool to c:\apktool (note: I use the original apktool, not the ICS one)
step 2: extract frameworks-res.apk from your phone located in /system/frameworks/ using Root Explorer to copy it to your sdcard, and transfer the file on to your desktop.
step 3: copy the frameworks-res.apk from your desktop to the same folder as apktool which is c:\apktool in this example. (now you should have 2 copies of frameworks-res.apk, one on your desktop and one in c:\apktool folder)
step 4: go to command prompt (run command prompt, if you don’t know just google it ), and type following commands (as shown in the photo above)
cd c:\apktool
apktool if frameworks-res.apk
apktool d framworks-res.apk
At this point, don’t close the command prompt windows. Go to c:\apktool you will seeframework-res folder.
Now you can start translating files in res folder of the framework-res. (Please read how to translate an apk file here for more info)
…………
………….
Ok, now I assume that you have completed the translation. So, let’s rebuild the frameworks-res using the command below.
apktool b frameworks-res
Once it’s done. you find framework-res.apk in C:\apktool\framework-res\dist folder
Let’s put translated resources into the original framework-res.apk
The main different between translating an apk and a kernel system file is that you cannot re-sign the apk, it will brick your phone. To solve this problem you need to transfer the translated resources into the orignal system file (in here, frameworks-res.apk).
Note:
Blue colour framework-res.apk = the translated framework resource apk.
Red colour framwork-res.apk = the original framework resource apk on desktop.

Step 1:
- open the modified framework-res.apk in C:\apktool\framework-res\dist folder with winrar
- extract resources.arsc or other resources that you modified such images from the drawable-hdpi onto desktop folder.
Step 2:
- Open the original frameworks-res.apk that you first saved on desktop with winrar.
- drag the modified resources.arsc that you just extracted from the modified frameworks-res.apk to replace the original resources.arsc in the original frameworks-res.apk on the desktop. make you sure save in zip format and “store” as compression method
- replace other original xml and images resources with the modified xml and images files one using the same method as replacing resource.arsc
Step 3: make you sure save in zip format and “store” as compression method.
Step 4: install copy the frameworks-res.apk from your desktop to your phone.
WARNING!: Make sure you backup your phone first.
This is the tricky bit.
1. First, you need to copy it into /system/ folder of your phone first. (don’t skip this step)
2. Then, change the permission to 777. Refer to below image. (user, group, other, all read, write, execute). That’s the only permission that works for me.
3. restart your phone. If everything goes well, you can boot into you home screen. otherwise. you just bricked your phone, and need to restore it from backup. and try it again. :)
Done!
If you want to translate setting menu, then you need to translate settings.apk.


+ Translating settings.apk


(Note: errors are only for Samsung Galaxy S2 Android MIUI ROM 2.3.2b, if you not using this ROM don’t worry about this )
Pretty much the same step as translating frameworks-res.apk
  1. copy settings.apk from phone to desktop. And make another copy from desktop to c:\apktool\, make you that you have frameworks-res.apk in the same folder as well.
  2. run command prompt:
cd c:\apktool
apktool if frameworks-res.apk
apktool d settings.apk
 ————————————————–
[update 07/07/12] compile settings.apk errors due to missing dependency framework files.
Sony Xperia Arc
To compile Sony Xperia Arc settings.apk you need to install 2 frameworks file: framework-res.apk and semcgenericuxpres.apk (should be in system/framework folder)commands:apktool if framwork-res.apk
apktool if semcgenericuxpres.apk
apktool d settings.apk
apktool b settings
Samsung (using touchwiz framework)
you need to install framework-res.apk and twframework-res.apk
HTC
you need to install framework-res and com.htc.resources.apk
Others
you may need to install SystemUI.apk as well to compile the settngs.apk
——————————————————
3. find the settings folder in c:\apktool\ and start translating the resources in settings folder.
If you don’t know how, read this
4 now, rebuild the settings.apk using command prompt:
apktool b settings
Now, you should have a modified settings.apk in C:\apktool\settings\dist
The same as frameworks-res.apk
  1. exract resources.arsc (or other xml file in res\xml folder) from the modified settings.apk.
  2. replace resource.arsc (or other xml file) to the original settings.apk
  3. copy the original setting.apk (but with the modified resource.arsc) to /system/ on your phone, change permission, then copy to /system/app (this one doesn’t need 777 permission, just user: read write, group: read, others: read)
  4. restart your phone.
Done!

+ Translate Android stock applications
Translate Android stock application (such as desktopclock, music, camera, gallery)  and normal Android apk are pretty much the same.  But when you install it, you need to use RootAppDelete to delete the stock app
  1. Click on SysApp button, disable the apk (example, deskclock.apk)
  2. play with your phone, if it stable, then to go Recycler of RootAppDelete to uninstall it
  3. install the translated apk file (signed-deskclock.apk) to replace it.

No comments:

Post a Comment