Edit framework-res.apk problems (translation)


pclaren

Members
Feb 28, 2011
4
11
Hi,

I hope I've posted this in the correct thread.

I've just started playing with translations. My first attempt was to change the "Emergency call" button in the lock screen. The new apk was built without problems and I updated resources.arsc in a copy of the original framework-res.apk with the one from the build/apk directory. Installed the new apk on the phone and rebooted. Now the lock screen has a different look compared to stock miui-dev English language pack.

Stock lock screen:
original_framework-res_apk.jpg

Edited framework-res.apk:
edited_framework-res_apk.jpg

As can be seen from the screen shoots the font size in both the "Emergency call" button and "Enter password to unlock" has increased. The button text is line wrapped and the other text has been truncated.

What have I done wrong or missed and what to do in order to fix it?

Note:
As a test I just decompiled and compiled the original framework-res.apk again, without changes, and then updated resources.arsc in a copy of the original framework-res.apk with the one from the build/apk directory. Installed and rebooted. This gave me the same problem again. "Emergency call" button is line wrapped and "Enter password to unlock" is truncated.

Regards
PClaren
 
Funy, you just took the only string that needs to be layout edited...
when you decompile the framework-res.apk you will see inside the "res" folder a folder called "layout-en", inside it you will find "keyguard_screen_password_portrait.xml", copy it and paste itnto a new folder you'll create called layout-[your language code] (for swedish I think is "layout-sv"). If you want to make it default just overwrite the file in "layout" folder.
after you build the new framework-res you must move the new folder (layout-sv) inside the "res" folder on the original APK (in addition to the resources).

Hope it helps.

BTW, for other apps you have to pay atention too to the localized folders (layout-en, drawable-en-hdpi, xml-en, etc.) because they are there for a reason, normally fixing problems for layout or changing Chinese drawables...
For future problem there is a post specially for that, just go there and i'll be happy to help you.
http://forums.miui-dev.com/showthread.php?2492-MIUI-DEVELOPERS-TRANSLATION-GUIDE-(V1.0)-MUCH-TO-ADD!
 
Hi,

Thanks for your reply. It worked like a charm. A couple of questions around this.
- When doing a decompile of framewrok-res.apk from the stock deodexed rom the res/layout-en doesn't exist. So if I don't create a layout-<lang> folder and copy "keyguard_screen_password_portrait.xml" to it, the "keyguard_screen_password_portrait.xml" in layout is used?
- When are you supposed to include any <apk>/build/apk/res/... changes in the original apk? Does it matter if you use compression or not when adding the changes? Can you just add the whole build/apk/res structure and esources.arsc to the original apk or will that brake things?
- Are there any rule of thumb of when to play around with the layout xml's etc?

Thank you for helping me straighten some ?-marks.

Maybe this should be moved to the "MIUI DEVELOPERS TRANSLATION GUIDE (V1.0) MUCH TO ADD!" thread?

Regards
PClaren
 

Similar threads

  • Locked
HyperOS 1.0 24.3.25
Replies
169
Views
63K
  • Locked
HyperOS 1.0 24.3.18
Replies
115
Views
42K
  • Locked
HyperOS 1.0 24.3.11
Replies
128
Views
44K
  • Locked
HyperOS 1.0 24.3.4
Replies
150
Views
46K
  • Locked
HyperOS 1.0 24.2.26
Replies
161
Views
53K