Tutorial MIUI DEVELOPERS TRANSLATION GUIDE (V1.0) MUCH TO ADD!


tooo much errors^^:
.....
C:\Users\Tobias\Desktop\NEUERVERSUCH\APK_Dekompiliert\framework-miui-res\res\val
ues\public.xml:668: error: Public symbol id/unknown_contact_location declared he
re is not defined.
C:\Users\Tobias\Desktop\NEUERVERSUCH\APK_Dekompiliert\framework-miui-res\res\val
ues\public.xml:700: error: Public symbol id/unlock_sim_via_puk declared here is
not defined.
C:\Users\Tobias\Desktop\NEUERVERSUCH\APK_Dekompiliert\framework-miui-res\res\val
ues\public.xml:649: error: Public symbol id/visible_panel declared here is not d
efined.
C:\Users\Tobias\Desktop\NEUERVERSUCH\APK_Dekompiliert\framework-miui-res\res\val
ues\public.xml:1247: error: Public symbol xml/android_apns declared here is not
defined.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec comma
nd: [aapt, p, -F, C:\Users\Tobias\AppData\Local\Temp\APKTOOL2140567160205271988.
tmp, -x, -I, C:\Users\Tobias\apktool\framework\1.apk, -S, C:\Users\Tobias\Deskto
p\NEUERVERSUCH\APK_Dekompiliert\framework-miui-res\res, -M, C:\Users\Tobias\Desk
top\NEUERVERSUCH\APK_Dekompiliert\framework-miui-res\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U
sers\Tobias\AppData\Local\Temp\APKTOOL2140567160205271988.tmp, -x, -I, C:\Users\
Tobias\apktool\framework\1.apk, -S, C:\Users\Tobias\Desktop\NEUERVERSUCH\APK_Dek
ompiliert\framework-miui-res\res, -M, C:\Users\Tobias\Desktop\NEUERVERSUCH\APK_D
ekompiliert\framework-miui-res\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
... 6 more
 
tooo much errors^^:
.....
C:\Users\Tobias\Desktop\NEUERVERSUCH\APK_Dekompiliert\framework-miui-res\res\val
ues\public.xml:668: error: Public symbol id/unknown_contact_location declared he
re is not defined.
C:\Users\Tobias\Desktop\NEUERVERSUCH\APK_Dekompiliert\framework-miui-res\res\val
ues\public.xml:700: error: Public symbol id/unlock_sim_via_puk declared here is
not defined.
C:\Users\Tobias\Desktop\NEUERVERSUCH\APK_Dekompiliert\framework-miui-res\res\val
ues\public.xml:649: error: Public symbol id/visible_panel declared here is not d
efined.
C:\Users\Tobias\Desktop\NEUERVERSUCH\APK_Dekompiliert\framework-miui-res\res\val
ues\public.xml:1247: error: Public symbol xml/android_apns declared here is not
defined.

These things aren't defined. Fix that XML up, and it'll build.
 
  • Like
Reactions: DaLuigi3
and why they are not defined? i don't made any changes

i need an example:

error:
C:\Users\Tobias\Desktop\NEUERVERSUCH\APK_Dekompiliert\framework-miui-res\res\val
ues\public.xml:1247: error: Public symbol xml/android_apns declared here is not
defined.

xml line 1247:
<public type="xml" name="android_apns" id="0x030f0000" />

what i have to change?

Thank's for your help:)
 
in ids.xml you are missing some definitions....

open framework-miui-res.apk/res/values/ids.xml

add in the missing entries:

Code:
<item type="id" name="unknown_contact_location">false</item>
<item type="id" name="unlock_sim_via_puk">false</item>

and so on... so for the other missing definitions add them in the same manner as the examples above then attempt a recompile. Also make sure none have <id name=""></id> if they do they need to be in the <item type="id" name="">...</item> format.
 
  • Like
Reactions: DaLuigi3
thank you, but if i look into ids.xml the entries
<item type="id" name="unknown_contact_location">false</item>
<item type="id" name="unlock_sim_via_puk">false</item>

already exists but android_apns not and visible_panel are in there like this <item type="id" name="visible_panel" /> so
it has to be like in your example <item type="id" name="visible_panel">false</item>? And why your examples already existing?
(maybe theses errors will lost if the others are corrected?)
 
hi,

i minimized the errors but i got a new one...

C:\Users\Tobias\Desktop\NEUERVERSUCH\APK_Dekompiliert\framework-miui-res\res\values\ids.xml:157: error: Resource entry list_item_padding_right is already defined.
res\layout\list_item_padding_right.xml:0: Originally defined here.

which one i have to remove? from ids.xml or from res\layout\list_item_padding_right.xml?

Thanks

edit:

ok i have it:) the declaration errors only come up because of the wrong declaration
<id name=""></id>
so lets see if the builded apk works...

edit2:
so it compiled without errors but i saw that in arrays.xml still the wrong declaration exist
<array name="test">@android:balblap</array>

should i anyway change it?
 
hi,

i minimized the errors but i got a new one...

C:\Users\Tobias\Desktop\NEUERVERSUCH\APK_Dekompiliert\framework-miui-res\res\values\ids.xml:157: error: Resource entry list_item_padding_right is already defined.
res\layout\list_item_padding_right.xml:0: Originally defined here.

which one i have to remove? from ids.xml or from res\layout\list_item_padding_right.xml?

Thanks

edit:

ok i have it:) the declaration errors only come up because of the wrong declaration
<id name=""></id>
so lets see if the builded apk works...

edit2:
so it compiled without errors but i saw that in arrays.xml still the wrong declaration exist
<array name="test">@android:balblap</array>

should i anyway change it?

it should be like <item type="array" name="test">....</item>
 
  • Like
Reactions: DaLuigi3
hi,

so i have tested my compiled framework-miui-res.apk (no errors) but i also get a bootloop. all my other apps working especially twframework and framework-res...

so i have uploaded my files, maybe you can find my mistakes
https://www.dropbox.com/sh/1ckis3x84sqv1bh/dWHCZ4I0Bk

thanks
Yes, the bootloop is because the resource addesses wont be picked up at 0x03 offsets. To correct this find com.htc.resources.apk (google it!) and you need to do two things:

1. apktool if com.htc.resources.apk
(This installs at 2.apk framework) note the 2.apk = 0x02 = resource offset, framework-miui-res.apk is 0x03 (3.apk) when installed)

2. Edit the framework-miui-res.apk/apktool.yml file and add at the bottom of the file:

Code:
-  2

Basically doing this is telling the compiler to jump 0x02 and use the correct base resource offset which is at 0x03 :)
 
  • Like
Reactions: DaLuigi3
Hi Mark. I asked you at your profile, but ask you here again.
Could you provide me info how to add Russian T9 into the ICS ROM? If you can help me, I even agree to share with you my translation programm (you can see it at http://burgerz.pro/miui-translation-tool-v-2-update/ for example - this one for GB MIUI, I have written such tool for ICS MIUI too).
 
Hi Mark. I asked you at your profile, but ask you here again.
Could you provide me info how to add Russian T9 into the ICS ROM? If you can help me, I even agree to share with you my translation programm (you can see it at http://burgerz.pro/miui-translation-tool-v-2-update/ for example - this one for GB MIUI, I have written such tool for ICS MIUI too).
As i've said, not sure sure we we'd start, your language is not what i'd call simplistic to approach from my side of things :-(

What does the tool you've made do? we're developing our scripting in Bash and using gawk, sed, github and other cool bits ;-)
 
As i've said, not sure sure we we'd start, your language is not what i'd call simplistic to approach from my side of things :-(

What does the tool you've made do? we're developing our scripting in Bash and using gawk, sed, github and other cool bits ;-)
These are abilities of my tool:
1. Choose translation files sourse (local folder, github repo)
2. Choose single ROM file to proceed or you can choose folder (all ROMz from which will be translated)
3. Simple click on start button and you'll have all you ROMz translated (names for these ROMz my tool takes from build.prop)
4. It can change procedures in smali files (not the whole file, but just one or more methods in it)
5. It automatically fix crap in the res of such apk's as framework-miui-res, settings, email, mms etc. So these apks recompiles w/o errors.
6. It can change and add build.prop values
7. More and more features, all of them (mostly) you can change in ini files (settings)
I wrote it to work under windows (my native system is Gentoo - so I wrote another one tool in QT, but it sucks as QT it)))
 
The only problem I can't resolve is russian T9 coz MIUI now (since 2.3.30) have no more HanziToPinyin.smali in framework and other files in contacts which concern with it.
I don't understand how to add RU symbols to T9 mechanism.
 
[quote="MarkHUK, post: 120498, member: 3"you need to do two things:

1. apktool if com.htc.resources.apk
(This installs at 2.apk framework) note the 2.apk = 0x02 = resource offset, framework-miui-res.apk is 0x03 (3.apk) when installed)

2. Edit the framework-miui-res.apk/apktool.yml file and add at the bottom of the file:

Code:
-  2

Basically doing this is telling the compiler to jump 0x02 and use the correct base resource offset which is at 0x03 :)[/quote]

Hi,

Thank you again!

i have done this but still Bootloop sad:(
i have uploaded the new one again into my dropbox....
https://www.dropbox.com/home/MIUI
Hope i don't nerve you und you will help still;)

greetz
 
DaLuigi3, you need to fix some errors in xml (its not enough to add in apktool.yml "- 2" option.
Put my program in one folder with your decompiled framework and execute it, it will not appear but It will fix all crap in xml in it's folder and subfolders. For example, your decompiled framework-miui-res files is in ../decompiled/framework-miui-res/(res,smali,AndroidManifest.xml....). Put my programm in res folder and execute.Than you jus compile framework and enjoy (but don't forget to delete my tool from framework folder).
 

Attachments

  • FixCrap.zip
    361.5 KB · Views: 239
  • Like
Reactions: DaLuigi3
DaLuigi3, you need to fix some errors in xml (its not enough to add in apktool.yml "- 2" option.
Put my program in one folder with your decompiled framework and execute it, it will not appear but It will fix all crap in xml in it's folder and subfolders. For example, your decompiled framework-miui-res files is in ../decompiled/framework-miui-res/(res,smali,AndroidManifest.xml....). Put my programm in res folder and execute.Than you jus compile framework and enjoy (but don't forget to delete my tool from framework folder).
Depends if there is compile error, if no compile error then its something else. Trust me, I do this every day for 2yrs :)
 
  • Like
Reactions: DaLuigi3
Thanks for your tool, but also bootloop.
do i have to edit more files than the .xml's from values Folder and the apktool.yml File?

my steps: (working for all apps except this sh**** framework-miui-res)
1. installed twframework-res, framework-res and framework-miui-res
2. decompiled with apktool 1.4.2
3. fixed .xml files and apktool.yml (with and without your tool)
4. installed com.htc.resources
5. compiled with apktool 1.4.3
5. copied the \build\apk\resources.arsc into original framework-miui-res

maybe i do something wrong?

Thanks for your help guys
 
Thanks for your tool, but also bootloop.
do i have to edit more files than the .xml's from values Folder and the apktool.yml File?

my steps: (working for all apps except this sh**** framework-miui-res)
1. installed twframework-res, framework-res and framework-miui-res
2. decompiled with apktool 1.4.2
3. fixed .xml files and apktool.yml (with and without your tool)
4. installed com.htc.resources
5. compiled with apktool 1.4.3
5. copied the \build\apk\resources.arsc into original framework-miui-res

maybe i do something wrong?

Thanks for your help guys
OK. Tommorrow morning I'll write the small tool to recompile framework-miui-res. Hope it'll help. Coz I don't have any problems with recompiling framework. And I use just 1.4.3 apktool (not 1.4.2) to decompile and compile and latest aapt.exe (800kb size). No errors.
 
  • Like
Reactions: DaLuigi3
Thank you very much

i also use the latest aapt.exe (805kb)
and i forgot in the last post: i have no errors by decompile and compile

I read in a tutorial to use 1.4.2 for decompile and 1.4.3 for recompile...
 
Thank you very much

i also use the latest aapt.exe (805kb)
and i forgot in the last post: i have no errors by decompile and compile

I read in a tutorial to use 1.4.2 for decompile and 1.4.3 for recompile...
Hi. Do you use comression while replace resources.arsc in the original framework? You must use compression level = 0 for this file.
Just issue "7za a -y -tzip original_apk.apk new_resources.arsc -mx0 -r" command in command prompt
 
you dont need all that command line for 7za, just do:

7za a -tzip -mx0 File.apk resources.arsc

DO NOT Call it new_resources.arsc! this is wrong.
 

Similar threads

  • Locked
HyperOS 1.0 24.3.4
Replies
150
Views
42K
  • Locked
HyperOS 1.0 24.2.26
Replies
161
Views
49K
Replies
259
Views
66K
  • Locked
HyperOS 1.0 24.1.29
Replies
227
Views
120K
  • Locked
HyperOS 1.0 24.1.22
Replies
193
Views
65K