Enlighten me please... I want to edit the keymappings and define my own symbols and whatnot. I already found the init.etc/keymaps but how would i go about rebuilding the rootfs.img?
Thx.
How are you accessing rootfs.img? If you simply mount it as a loopback device in Linux, I don't think you have to rebuild it. Thor_Asgard listed the necessary commands needed to mount rootfs.img, if you don't know how to mount it.
How did I get into it? WinImg, or something like that. Looks like I gotta boot up some linux. HMM I could just use Rhobuntu to do it couldnt i?
Thanks for the link
andershizzle said:
How did I get into it? WinImg, or something like that. Looks like I gotta boot up some linux. HMM I could just use Rhobuntu to do it couldnt i?
Thanks for the link
Click to expand...
Click to collapse
Is it an "official" keymap update? Is it more complete or better than what is currently being used? Or even maybe a keyboard that has not been mapped at all yet? Would you like to put it in the main build, so that everyone else can use it? Contact babijoee or phhusson, they have access to update the main rootfs git!
Oh no I'd be doing this because my T Mobile TP2's ALT key doesn't work so I'd be swapping shift + letters for symbols instead of capital letters as well as including my own custom symbols like a < and > so i can text <3's to my girlfriend HAHA.
But yeah. It wouldn't be like an official thing, just tinker with which extra symbols i want on the keyboard such as < > { } [ ] | \
Hi!
I would like to make keymap for Finnish layout (only difference are FN-key combinations really). I already found the mentioned files from rootfs.img, but have a few questions:
What's the difference between rhod100* and rhod210* files?
Only place I found relevant things to change, is rhod210_microp-keypad.kcm file; what do I have to do to get the changes in use when I put the modified file back in place and into my Touch Pro 2?
Do I need to name it something different after modifications?
I'd like to submit it to general use when I'm done, so if you could just help me with these, I'd really appreciate it!
EDIT:
andershizzle said:
Oh no I'd be doing this because my T Mobile TP2's ALT key doesn't work so I'd be swapping shift + letters for symbols instead of capital letters as well as including my own custom symbols like a < and > so i can text <3's to my girlfriend HAHA.
But yeah. It wouldn't be like an official thing, just tinker with which extra symbols i want on the keyboard such as < > { } [ ] | \
Click to expand...
Click to collapse
Did you manage to create or modify files in the img file? If so, could you advise me how to do it?
"What's the difference between rhod100* and rhod210* files?"
They're just different layouts for different models. Rhod210 is based on one of the North American models, I forget which; Sprint or T-Mobile I think. The rhod100 layouts are the European ones.
"Only place I found relevant things to change, is rhod210_microp-keypad.kcm file; what do I have to do to get the changes in use when I put the modified file back in place and into my Touch Pro 2?"
You have to compile it to produce rhod210_microp-keypad.kcm.bin and put that into the rootfs. The tool to do this is only available inside the Android source. I have a compiled version of it here for Linux 32-bit, I can send you the tool or you can send me the .kcm and I can compile it for you, up to you.
"Do I need to name it something different after modifications?
I'd like to submit it to general use when I'm done, so if you could just help me with these, I'd really appreciate it!"
If you want to submit it for general use, yes, you have to name it something else. You should also submit it with a patch for the file 'init' in the rootfs.img image; look down the bottom and you can see how the keymap stuff actually works. The files are not actually used under their 'rhod*' names, if you specify in the kernel command line that you want a particular Rhodium keymap, it is copied to the filenames which are actually used. So add a little bit for your layout that corresponds to the others in there.
"Did you manage to create or modify files in the img file? If so, could you advise me how to do it?"
On Linux, you can just mount the rootfs.img file:
mount -o loop rootfs.img /mnt/some_mount_point
then edit stuff, then umount it. Dunno how to do it on Windows.
AdamWill said:
"What's the difference between rhod100* and rhod210* files?"
They're just different layouts for different models. Rhod210 is based on one of the North American models, I forget which; Sprint or T-Mobile I think. The rhod100 layouts are the European ones.
"Only place I found relevant things to change, is rhod210_microp-keypad.kcm file; what do I have to do to get the changes in use when I put the modified file back in place and into my Touch Pro 2?"
You have to compile it to produce rhod210_microp-keypad.kcm.bin and put that into the rootfs. The tool to do this is only available inside the Android source. I have a compiled version of it here for Linux 32-bit, I can send you the tool or you can send me the .kcm and I can compile it for you, up to you.
"Do I need to name it something different after modifications?
I'd like to submit it to general use when I'm done, so if you could just help me with these, I'd really appreciate it!"
If you want to submit it for general use, yes, you have to name it something else. You should also submit it with a patch for the file 'init' in the rootfs.img image; look down the bottom and you can see how the keymap stuff actually works. The files are not actually used under their 'rhod*' names, if you specify in the kernel command line that you want a particular Rhodium keymap, it is copied to the filenames which are actually used. So add a little bit for your layout that corresponds to the others in there.
Click to expand...
Click to collapse
Ok, I made some changes and renamed my new files. If you could do the compiling, I'd be very happy. I renamed them after rhod100, if that's the european model then. The attached zip contains the kcm and kl files.
Here are the rows to put in init:
Code:
elif /bin/grep -c 'physkeyboard=rhod100_fi' /proc/cmdline >/dev/null ; then
echo "USING EXPERIMENTAL RHOD100 FI LAYOUT"
cp -f /init.etc/keymaps/rhod100_fi_microp-keypad.kl /etc/keymaps/microp-keypad.kl
cp -f /init.etc/keymaps/rhod100_fi_microp-keypad.kcm.bin /etc/keymaps/microp-keypad.kcm.bin
cp -f /init.etc/keymaps/rhod100_uk_navi_pad.kl /etc/keymaps/raph_navi_pad.kl
If you could add these changes to the rootfs.img, I'd be very grateful!
hey good work guys! us CDMA guys have been desperatley seeking a verizon tp2 keyboard port. The symbols are way unmapped.... i only have windows. If someone could give me some instrucitons i'd happily try and help
Matt
Jekku said:
Ok, I made some changes and renamed my new files. If you could do the compiling, I'd be very happy. I renamed them after rhod100, if that's the european model then. The attached zip contains the kcm and kl files.
Here are the rows to put in init:
Code:
elif /bin/grep -c 'physkeyboard=rhod100_fi' /proc/cmdline >/dev/null ; then
echo "USING EXPERIMENTAL RHOD100 FI LAYOUT"
cp -f /init.etc/keymaps/rhod100_fi_microp-keypad.kl /etc/keymaps/microp-keypad.kl
cp -f /init.etc/keymaps/rhod100_fi_microp-keypad.kcm.bin /etc/keymaps/microp-keypad.kcm.bin
cp -f /init.etc/keymaps/rhod100_uk_navi_pad.kl /etc/keymaps/raph_navi_pad.kl
If you could add these changes to the rootfs.img, I'd be very grateful!
Click to expand...
Click to collapse
How did it go? Did you get a cool rootfs.img? I need a swedish keyboard layout..
Related
If anybody is interested in grabbing the ringtones/wallpaper/strange sample icons from WM7, it's possible to reverse engineer the BIN file to get at the raw files that make up WM7.
Happy to post steps if anybody wants to get at this stuff, if not please see wallpapers and ringtones attached to this post. Hopefully helpful to somebody out there.
thanks... please post how to extract the bin for noobs!
Of course... you need:
- The BIN file. In this case I used WM7Full.bin available from several sites
- viewbin.exe from Microsoft Platform SDK
- cvrtbin.exe from Microsoft Platform SDK
- dumprom.exe from Microsoft Platform SDK
You may also be able to find these utilities using Google.
Use viewbin.exe to analyse the file:
viewbin.exe -t wm7full.bin
You'll see an image start and length. Start was 0x81000000 with length 0x0496A294 for the specific file I used. Plug these values into cvrtbin.exe:
cvrtbin.exe -r -a 0x81000000 -l 0x0496A294 -w 32 wm7full.bin
(obviously substituting the -a and -l value for those obtained from viewbin. Leave -w as 32)
This will produce wm7full.nb0. Plug this file into dumprom.exe:
dumprom.exe -d c:\output wm7full.nb0.
And there you have it, the files will be chucked into c:\output in their entirety.
Thanks for this one, some good sounds inside
I can't find viewbin.exe, cvrtbin.exe, and dumprom.exe anywhere, can someone post a link?
EDIT: Or, better yet, could someone just upload the dump?
EDIT 2: Okay, I found the tools, but the dump didn't work. Any suggestions?
Could you provide details of the error that you're seeing please?
To answer your other questions, I'm not planning to upload the whole dump as it's copyright and against the forum rules. Same goes for the tools, they're part of the Platform Builder SDK.
akersj said:
Happy to post steps if anybody wants to get at this stuff, if not please see wallpapers and ringtones attached to this post. Hopefully helpful to somebody out there.
Click to expand...
Click to collapse
Thank you very much
Not to be a buzzkill, but these are the same ringtones and sounds from 6.1/6.5
Though I missed flamenco fire, thanks for bringing it back
mazzarin said:
Not to be a buzzkill, but these are the same ringtones and sounds from 6.1/6.5
Though I missed flamenco fire, thanks for bringing it back
Click to expand...
Click to collapse
LOL.. I didn't try 6.1/6.5, just saw the BIN file screaming to be taken apart! Flamenco Fire ... hmm interesting
akersj said:
Could you provide details of the error that you're seeing please?
To answer your other questions, I'm not planning to upload the whole dump as it's copyright and against the forum rules. Same goes for the tools, they're part of the Platform Builder SDK.
Click to expand...
Click to collapse
There is no error message; I run the tools exactly as described, which works, but when I look for "C:\output", I can't find it. Otherwise everything is fine.
Fdo35 said:
There is no error message; I run the tools exactly as described, which works, but when I look for "C:\output", I can't find it. Otherwise everything is fine.
Click to expand...
Click to collapse
You will need to substitute c:\output for a directory of your choice that exists on your system. Please also ensure that you are using the offset and length appropriate to the bin file you are using.
Fdo35 said:
There is no error message; I run the tools exactly as described, which works, but when I look for "C:\output", I can't find it. Otherwise everything is fine.
Click to expand...
Click to collapse
as akersj says above... you need to create the folder c:\output first or use another folder that already exists. The tools will not create a new directory for you.
Oh, I see now! I can't believe I didn't try that!
Well, anyway, this is pretty interesting. Especialy files like 'FileBrowser.exe,' FileBrowserCM.dll,'and 'NativeInstallerHost.exe' could be of some great use to us.
Tools needed: smali, baksmali (google them), a JDK, and an extracted factoryfs.rfs from an éclair ROM.
(If you don't have a linux machine to mount an .rfs file to a directory never forget that your device has linux on it, so it can actually mount the .rfs file to a directory)
First collect the files you need from factoryfs.rfs:
/app/AxT9IME.apk
/app/AxT9IME.odex
/lib/libXt9core.so (this is actually the same file that's inside the apk)
/lib/libDHWR.so
/framework/android.policy.odex
/framework/core.odex
/framework/ext.odex
/framework/framework.odex
/framework/services.odex
Copy all the odex files into the same directory as baksmali is. Disassemble it with:
java -jar baksmali.jar -x AxT9IME.odex
This should create an out directory, with the disassembled, and deoptimized files. Now reassemble them, with smali:
java -jar out
This should create an out.dex file. Rename it to classes.dex, and put it into the AxT9IME.apk (don't be fooled by the extension, it's a simple zip file)
Now copy the following files to your phone:
AxT9IME.apk --> /system/app
libXt9core.so --> /system/lib
libDHWR.so --> /system/lib
Remove the following files:
/system/app/AxT9IME.odex
/system/lib/libdhwr.so (this is lowercase. The above was uppercase. Case does matter!)
Now try to enable the samsung keyboard. If everything goes well then you can now use the old keyboard.
-----
Alternatively if you needed the keyboard from the XWJM8 version, you can download the result files from here: http://android.sztupy.hu/dl/SamsungKeyboardFroyo.zip
Thank you
can I use this method in order to replace framework.jar/framework.odex from another build?
JHJP4 support proper BIDI (for Hebrew/Arabic and other RTL languages)
And how do we do the opposite? Want 2.44 on eclair =)
Should work the same
omrij said:
Thank you
can I use this method in order to replace framework.jar/framework.odex from another build?
JHJP4 support proper BIDI (for Hebrew/Arabic and other RTL languages)
Click to expand...
Click to collapse
No, framework.jar is too much different between eclair and froyo. You can only port simple applications (in /system/app) this way.
dupel said:
And how do we do the opposite? Want 2.44 on eclair =)
Click to expand...
Click to collapse
It would only work if the new keyboard doesn't use anything FroYo specific (like gesture support, or enhanced multitouch support). If it does use froyo specific api functions it will break under eclair.
sztupy said:
No, framework.jar is too much different between eclair and froyo. You can only port simple applications (in /system/app) this way.
Click to expand...
Click to collapse
Both frameworks are from Froyo
just different version
JP4 framework has proper BIDI support
omrij said:
Both frameworks are from Froyo
just different version
JP4 framework has proper BIDI support
Click to expand...
Click to collapse
If framework.jar changes then all pre-optimized files (odex) have to be reoptimized (the same way as the tutorial above shows), and even after that it might not work...
hi can I ask a few questions. I don't know much about these complicated things, but I will try my best.
can we collect files you asked us from factoryfs, through root explorer.
you asked to copy file with capital letters to phone and then asked to remove same file name with small letters. can one directory have two files with same name?
and finally how would we copy files to the phone?
thanks.
Sent from my Nexus One using Tapatalk
pitsyapa said:
hi can I ask a few questions. I don't know much about these complicated things, but I will try my best.
can we collect files you asked us from factoryfs, through root explorer.
you asked to copy file with capital letters to phone and then asked to remove same file name with small letters. can one directory have two files with same name?
and finally how would we copy files to the phone?
thanks.
Sent from my Nexus One using Tapatalk
Click to expand...
Click to collapse
You can use rootexplorer to transfer the files to /sdcard modify them on the PC, tran transfer them back from /sdcard to their location.
thanks I really appreciate your help can I ask you another simple question. I have downloaded jdk.
and installed it. how do I use these commands to disessemble, java jar. is there any special java prograame. thanks.
thanks v much. problem solved. ported urdu keyboard from eclair to jpk. thanks again.
How do I know which files from /lib do I need to replace?
I'm trying to use contacts apk from other froyo rom
So, I tried the above instructions, and all I get is errors with bksmali, but i get the out directory, then when I run smali, it get another bunch of errors, but no out.dex. Any help would be amazing.
I haven't tried any of this other than trying to just install the AxT9IME.apk which obviously didn't work. I can enable it but trying to switch to it or access its settings instantly resorts in a force closure.
What I don't think I've seen mentioned is whether or not the end result of this allows you to have both the 2.2 and the 2.1 keyboards. Could anyone clarify for me if you get both or just the 2.1 keyboard in the end?
Lastly, would it be possible for someone to write an app (downloadable via market) for this keyboard for any android version? Because that'd be pretty awesome.
It'd be nice if it didnt create an app-drawer icon, but I wouldn't mind as Go Launcher allows me to hide unwanted apps.
I honestly like the 2.2 keyboard, but the 2.1 one (with its 4 pages) has symbols in on it that I have seen no where else, which is pretty cool and why I'm wanting it.
Hi all!
After searching the wide web of the world I didn't find anyone who cared to program the special characters for nordic keyboards (æ,ø and å). The norwegian stock ROM has got these mapped to own keys, but I've never liked to use stock ROMs, so I was stuck with the "long press method".
New! Now Spanish is also supported!
If you screw up your phone trying to adb push, cp -f these files I'm not responsible yada yada yada (nothing wrong should happend, really)
What I've done is taking the modified files from teferi, and added my own editing for the quick keys (as I had to make place for the chars I removed from jkl) and the special chars of course.
Confirmed on my G2 (running the Sense ROM from MoDaCo), but should work for the Desire Z too! Any guinea pigs out there?
Code:
*Norwegian*
version 0.3:
-Fixed issue with , and ; didn't work on hardware keyboard.
version 0.2:
Quick change to the "Z" button, since "`" is used in command substitutions.
-alt-z is still "^", alt-shift-z = "`"
version 0.1:
-alt+j,k,l = æ,ø,å (alt+shift gives capitol letter).
- make ".com" a TAB key, as it ought to be
- left softkey is now "\" "|" "/"
- right softkeys are now "[" "(" "<" and "]" ")" ">"
- alt-z is now "^"
Code:
*Spanish version*
Version 0.2
-Corrected filenames for the new files, and included the right "originals".
Version 0.1
[Key] - [Shift + key] - [FN + key] - [Shift + FN + key]
a - A - ! - á
e - E - 3 - é
i - I - 8 - í
o - O - 9 - ó
u - U - 7 - ú
n - N - = - ñ
? - ¿ - " - ¡
. - < - : - >
INSRUCTIONS:
*Add -wwe after "keypad" in the filename for both files if your running a Desire Z based ROM. CM and G2-based will work without -wwe*
- download file
- unzip *.zip
- adb push vision-keypad.kl /sdcard/
- adb push vision-keypad.kcm.bin /sdcard/
- adb shell
- su (if you don't have ro.secure turned off)
- mount -o remount,rw /dev/block/mmcblk0p25 /system
- cp -f /sdcard/vision-keypad.kl /system/usr/keylayout/
- cp -f /sdcard/vision-keypad.kcm.bin /system/usr/keychars/
- reboot
Btw... backup of original keymapping is included... just rename them without .orig, and follow the procedure above
Code:
Guide to make your own keys:
Download a hex editor (i prefer xvi32), open the "kcm.bin", and alter the symbols shown in the attached .jpg. If you wish to alter the "main" char of the key, you can change that in the .kl file with notepad (check the difference between esp and nor to see an example).
Thanks to teferi for the base files
Novek said:
I can make files for other special characters if someone wants that... or you could simply HEX-edit the files yourself
Click to expand...
Click to collapse
Great work! But, since I'm not Norwegian, I'm not going to try it
However, I'd love to see a modification of the original English Desire Z Sense keymap with just a few modifications.
Here's a picture of the Desire Z keyboard
http://www.theunwired.net/media/news/htc_desire_z_front_open.jpg
1) Getting á, é, í, ó and ú by Shift + FN + a, e, i, o, u (I think it's Shift + Alt in the G2 keyboard). Currently I have to long press the vowel key and then touching the screen. Not efficient.
2) Getting ¿ by using Shift + ? , and maybe ¡ by pressing Shift + FN + ?.
Would it be possible?
If you need the original files or whatever, just tell me
Thank you in advance.
I would need to get the original desire z keymapping files as I've just the g2... they are a little different with the non-letter keys.
Sent from my HTC Vision using XDA App
Here it is
I've just uploaded a file with the two directories, keychars and keylayout.
I think it's interesting that there are several kcm.bin files and several kl files, for different languages, but I don't know how to select them.
Thank you again.
Actually... You can't keep both ! and "á" at the "A" key.... or at least you can't get the "á" capitol that way...
It would then be a, A, !, á available on that key.
Do you want me to remove the !, or...
I don't mind having to long press A to get the Á, I don't use it that often
cool. this is useful for me. I don't got the Nordic version so thanks
Novek said:
Actually... You can't keep both ! and "á" at the "A" key.... or at least you can't get the "á" capitol that way...
It would then be a, A, !, á available on that key.
Do you want me to remove the !, or...
Click to expand...
Click to collapse
Novek, have you had time to look over the Spanish version?
No rush, just curious.
I've actually haven't had time today but I'll try to find some time tomorrow or wednesday...
Just found a bug in the norwegian mod (the comma button doesn't work) so I'll fix that tomorrow too...
Sent from my HTC Vision using XDA App
/edit
New version up with the , and ; working...
bra jobba!! my friend just go a desire z and he was looking for this
Novek said:
I've actually haven't had time today but I'll try to find some time tomorrow or wednesday...
Click to expand...
Click to collapse
As I said, no rush... And thank you for your work
I would like to state that these files /system/keymap/* and /system/kaychar/* might be affecting the capacitive buttons belove the screen also. This will not brick anyone's phone (probably ) but will make it hard to do anything unless fixed.
What I understand:
everyone should use only the files that are meant for their specific DZ version and modify that.
I.E. G2 files on Scandinavian DZ renders capacitive buttons useless. And if u dont have adb access nearby it can be hard to do anything
Novek, I hadn't seen your private message. I already answered and I'm willing to try your alternative files
By the way, does anybody know why there is a lot of different files in /system/usr/keychars and keylayout? I mean, there's a vision-keypad.kcm.bin and a vision-keypad-esn.kcm.bin.
It would seem that the esn file could be useful for us Spanish speakers, but I don't know how to use it.
Hi Novek.
Thanks a lot for the Spanish version, but I'm afraid I'm doing something wrong.
I substituted the original files for the ones you have uploaded (I tried both doing it via Root Explorer and following your guide using adb) and when I press Shift + FN + N I still get = instead of ñ. The same with the rest of the keys.
I think I've read somewhere that the Desire Z uses the vision-keypad-wwe.kcm.bin and vision-keypad-wwe.kl file instead of the ones without wwe, could that be it?
I would assume that you can just rename the files I posted...
/edit
If it works after renaming to wwe, I'll change the uploaded files..
I'll also re-do the norwegian keymapping with the DZ-files tomorrow - removing the files for G2 now.
Sent from my HTC Vision using XDA App
Novek said:
I would assume that you can just rename the files I posted...
/edit
If it works after renaming to wwe, I'll change the uploaded files..
I'll also re-do the norwegian keymapping with the DZ-files tomorrow - removing the files for G2 now.
Sent from my HTC Vision using XDA App
Click to expand...
Click to collapse
Takk veldig mye!
I just renamed the files and it worked. Thank you very much
Edit 1. Mmm.. it worked at first, but now when I use Shift+FN+key I get Á, É, Í... instead of á, é, í.
Edit 2. Nevermind... I get the capitalized version when the autocorrection kicks in, at the begining of a sentence
?
Hi!
Im Hungarian so i am very interested on this application. lots of time I need áéóöőüű!!! Im a begginer in the android world.
Could everyone help for me pls!
I wanna know is this appl. works in the original ROM or not?
And could you write a step by step guide for the installation?
Bests, David!
Hi again, Novek! Just noticed that my SYM key is now working like a shortcut key When I press it, I get the "Keyboard shortcuts: Would you like to assign a shortcut to the hardware keys?" screen.
Could you make another version with this fixed? Thank you in advance
daveeer said:
Im Hungarian so i am very interested on this application. lots of time I need áéóöőüű!!! Im a begginer in the android world.
Could everyone help for me pls!
I wanna know is this appl. works in the original ROM or not?
And could you write a step by step guide for the installation?
Click to expand...
Click to collapse
In the first posting, it pretty much is a step-by-step guide. Is there any particular part that's confusing you ? Don't be afraid to ask specific questions about things. It's not dumb to ask questions, it's dumb to just try something when you don't understand what you're doing and it could mess up your phone !
Yes, as far as I know this should work with the original ROM.
It's not really clear for me, how can I make my own layout?
So which file included "which key is which letter" table, and how can i edit it?
http://bbs.gfan.com/android-575451-1-1.html
ignore the link at the top that one is mostly chinese the english version is provided hear thanks to da900
DOWNLOAD LINK: http://www.multiupload.com/PVZRB1NRHK
P.P.S. All you do with this pack is on your own risk. I am not responsable for any damages of your phone.[/QUOTE]
please aware that this rom is only contain about 20% english , most of words are chinese
u should be able to change it to english in the language and input settings
Is this newer than the QnD 1.2.4 rom?
Look at the number lol. 1.2.11 > 1.2.4
no that one has chinese this one does to thou dnt flash nevermind
dictionary said:
Look at the number lol. 1.2.11 > 1.2.4
Click to expand...
Click to collapse
XD I was thinking 4 > 1.
here's the changelog:
MIUI 1.2.11 version update:
Phone:
Add in the phone settings to add "call from the sensors used in the process" of setting
Fix the call log to the Canadian people through IP numbers to send SMS / MMS will bring IP prefix, resulting in the issue could not be sent
Theme:
Add support for setting alarm
Ringing in the new system comes with the option "mute"
Optimize the system comes with the choice of ring tones
Repair some of the theme of the correct format does not show the problem package
System Update:
Add WIFI connection can support the Ad-Hoc (peer to peer) network
Press the Backspace key fixed the problem miscarriage of justice
Local Backup:
Installed on the sd card repair program can not be the problem with the backup and recovery
Click to expand...
Click to collapse
terrelltp said:
no that one has chinese this one does to thou dnt flash nevermind
Click to expand...
Click to collapse
What? Slow down and make sense lol. Are you saying that you screwed up, and there is next to no English in the build?
terrelltp said:
u should be able to change it to english in the language and input settings
Click to expand...
Click to collapse
i repeat :
this rom does contain 20% of english translation only !
Even you change to english language :
your 80% of menu still display "Chinese".
So, this is useless unless you understand simplified Chinese. I'll wait on g4rb4g3 to release a port.
Sent from my htc.desireZED
Weren't there language packs you could install
Sent from my HTC Vision
Device Specific Language Packs
I think that language packs are device specific.. I haven't been able to find a language pack on the net for the G2.. though I did manage to a how to guide but I'm green to this stuff..
If somebody out here is familiar with how to do this guide and create a language pack for the G2 for us.. that would be helpful.
djmcnz said:
Okay guys, there's a lot of demand for this rom and for language packs but not yet a lot of people who know how to make the packs. Whilst I set up the crowdin translation project I can not create or maintain language packs.
So, here's a summary of the instructions required to create a language pack for MIUI (indeed for any app/rom). You need a collection of tools and a little patience but the process isn't too difficult so do give it a go.
Also note that this summary includes generalisations for brevity. These instructions assume you have a deodexed rom.
Introduction
For the purposes of this post language information is stored in XML strings in files on the Android system. In the case of MIUI and these instructions we will be dealing with .apk files (applications).
Within the apk files is a resources directory (/res) and within this are various values directories, there is a default values directory (/res/values) and alternative language values directories (e.g. /res/values-DE and /res/values-IT).
If the rom is set to use it's default language it will read values from /res/values although these may NOT be in English. In MIUI, all of the common Android ASOP values in /res/values are English but the (additional) custom MIUI strings are in Simplified Chinese.
If you select a different language in the ROM than the default then the appropriate values directory will be searched. If a suitable string that matches your language selection is found in the alternative /res/values-xx directory then that string will be used instead. If an alternative does not exist then the default will be used.
Example:
Code:
/res/[COLOR="red"]values[/COLOR]/strings.xml
<stop_button_text>[COLOR="Red"]Stop[/COLOR]</stop_button_text>
/res/[COLOR="red"]values-DE[/COLOR]/strings.xml
<stop_button_text>[COLOR="red"]Halt[/COLOR]</stop_button_text>
/res/[COLOR="red"]values-IT[/COLOR]/strings.xml
<stop_button_text>[COLOR="red"]Basta[/COLOR]</stop_button_text>
In this example, if the language is set to the default the word "Stop" will be used, if it is set to German the word "Halt" will be substituted in, likewise "Basta" for Italian.
So, to add languages to a rom (or app) or to make an app multi-lingual you need to either change the default strings in /res/values/strings.xml to the ones you want to use or, and this is the preferable approach, add a /res/values-xx/strings.xml with the translations you want. The first approach will work (changing the default strings) but is not recommended because the Android Open Source Project and Android development in general, defaults to English. It's best to use the built in language substitution capabilities of Android rather than to work around them. Indeed, if the MIUI devs actually added their strings in English to /res/values/strings.xml and the Chinese equivalents in the appropriate directory this rom would already be in English!
Adding Languages
To add a translation file (strings.xml) to an apk you need to:
decode the apk
create a language directory
add the translation files
recompile the strings
add the new strings to the apk
Which all sounds a little daunting but it's really quite straight-forward, rewarding when you see the result and a good way to understand how parts of Android work. Here's how you can do it.
1. decode the apk
You will need the excellent apktool from brut.all which you can get from the link below. apktool is relatively easy to use but includes some little tricks so you will need to read the wiki and thread about it.
Do NOT just post problems about apktool if you can't get it to work. The tool DOES work so if it's not decoding (or encoding) your apps correctly then you're probably doing something wrong. If you start with this understand BEFORE you ask for support you'll get a lot more help...
apktool: http://code.google.com/p/android-apktool/
wiki: http://code.google.com/p/android-apktool/w/list
thread: http://forum.xda-developers.com/showthread.php?t=640592
Please make sure you run the following command to include the MIUI framework in apktool. You only need to do this once for each framework. If apktool works with one rom and not the next then (re)install the framework for that rom.
Code:
apktool if framework-res.apk
Where framework-res.apk is the one from the rom you are working with. Make sure apktool can find (the correct) framework-res.apk before you run this command.
This thread is not for apktool support.
Now, before you proceed, decode a simple app from MIUI (such as updater.apk) using apktool, do not make ANY changes, then re-encode it using apktool. For example:
Code:
apktool d Updater.apk ./decoded/
apktool b ./decoded/ new_updater.apk
Use the -v (verbose) flag in apktool if you have problems and need to diagnose further.
Remember, Android uses a case-sensitive file system, make sure your capitalisation is correct.
Typically you will not be able to install this apk because it is not signed so if you want to test the process further you can now just try step 5 below using the two apks you have.
2. create a language directory
Assuming you can decode/encode now, this is the easy bit. For your decoded app, navigate to the directory it was decoded in, then to the /res/ directory and simply create an empty directory for your language (e.g. /values-FR/) - use international naming conventions.
3. add the translation files
Again, not too difficult this. Download the appropriate language file for your apk from the crowdin project linked below and, using the same structure as exists in /res/values/strings.xml create a new file called strings.xml in your alternative language directory (e.g. /res/values-ES/strings.xml).
The news strings.xml may contain as many or as few translations as you like. Remember, if a translation does not exist the default value from /res/values/strings.xml will be used.
Crowdin: http://crowdin.net/project/miui-rom-translation/invite
The xml formatting and tag names need to match exactly with the default strings.xml in /res/values although the translated file does NOT need to be complete.
It is worth remembering here that unless your source apk is already translated to English then some of the default values in /res/values/strings.xml will still be in Chinese, it would pay to check these.
4. recompile the strings
Now, if you've done everything carefully and correctly this step is really easy, all you need to do is recompile the apk with apktool using the b (for Build) switch.
Code:
apktool b ./<decoded_apk_dir>/ <output_apk_name>.apk
If this throws errors or does not work then use the -v switch to turn on verbose mode and diagnose your problem. If you did the test in step #1 and it worked then any problem at this step is likely related to your news strings.xml. Back out the changes one by one until you have found the problem and try again.
If you simply can't get it to compile with your changes then try just making a single change to the default strings.xml file in /res/values and see if that works for you.
Do NOT sign the apk!
5. add the new strings to the apk
Easy. Open your new apk with a zip program (like 7Zip for Windows) and copy out the resources.arsc file in the root directory of the apk. Now take that file and copy it into the source apk from the rom overwriting the existing one. This process replaces the strings but keeps the integrity of the signatures on the files.
You can now push the modified file to your phone, replacing the stock one, reboot and you're translated. Push the file using "adb push" or copy it into place using a root file manager, do not "install" the new apk. Make sure you put it in the correct place (replace the original) and reboot.
Conclusion
This process will help you add languages to any app including those in the MIUI rom. Because it's a rom the strings are contained in many different apps as well as framework-res.apk. To completely translate the rom you will need to edit every apk that has strings in it.
You will need to do this every time an apk in the rom changes. If a new version is released and say launcher2.apk is changed but updater.apk is not, then you can retain your updater.apk but you'll need to re-edit your launcher2.apk.
When an app changes the default strings.xml may also change. In this case you will need to make corresponding changes to your translations.
Good luck and if you get really stuck there's lots of people in this that have achieved success and may be willing to help!
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=789566
MIUI 1.2.11 for Vision ENG
Hi, all. I like the MIUI ROM and as most of you want to have latest version as soon as posible. But I am not a dev and my skills in android development are very very poor. So, i followed the versions of MIUI by g4rb4g3. They all are very stable and fast. And i want to say once more HUGE THANX to him for his work.
But when i found this thread today in the morning i decide to make it in english. So, putting together the ROM from 1st post and ENG pack for N1 from MIUI-DEV.COM with some additional editing of built.prop and adding some apps. I made a pack. Flashed it and it is working fine.
P.S. The only chinese words that i found are in MIUI account registration in Accounts&sync.
Adding: Facebook, Twitter, VoiceSearch, Google Search, gMaps, Street, GMail etc. (all apks are up to date).
DOWNLOAD LINK: http://www.multiupload.com/PVZRB1NRHK
P.P.S. All you do with this pack is on your own risk. I am not responsable for any damages of your phone.
ok cool so basically u made a english version for that latest update cool cool
terrelltp said:
ok cool so basically u made a english version for that latest update cool cool
Click to expand...
Click to collapse
Maybe, you could add the link to ENG version to 1st post of this thread. Could you?
da900 said:
Maybe, you could add the link to ENG version to 1st post of this thread. Could you?
Click to expand...
Click to collapse
i thought thats what u did isint that link u posted the english version
terrelltp said:
i thought thats what u did isint that link u posted the english version
Click to expand...
Click to collapse
I think he means add the link that HE provided to your first post, so that users will actually have an ENG version, instead of the one you posted.
dictionary said:
I think he means add the link that HE provided to your first post, so that users will actually have an ENG version, instead of the one you posted.
Click to expand...
Click to collapse
That's what i mean. Thanx.
lol yes i did that now
da900 said:
Hi, all. I like the MIUI ROM and as most of you want to have latest version as soon as posible. But I am not a dev and my skills in android development are very very poor. So, i followed the versions of MIUI by g4rb4g3. They all are very stable and fast. And i want to say once more HUGE THANX to him for his work.
But when i found this thread today in the morning i decide to make it in english. So, putting together the ROM from 1st post and ENG pack for N1 from MIUI-DEV.COM with some additional editing of built.prop and adding some apps. I made a pack. Flashed it and it is working fine.
P.S. The only chinese words that i found are in MIUI account registration in Accounts&sync.
Adding: Facebook, Twitter, VoiceSearch, Google Search, gMaps, Street, GMail etc. (all apks are up to date).
DOWNLOAD LINK: http://www.multiupload.com/PVZRB1NRHK
P.P.S. All you do with this pack is on your own risk. I am not responsable for any damages of your phone.
Click to expand...
Click to collapse
WOOOO..good job . it's perfect !!!!!!!! work very well ~!! thanks a lot
This is a new thread on the subject of modifying the system or
applications on the Nook. I'd like to see a separate thread on
modifying the kernel, but let's keep that off this.
The Basics
A bit of the system or an app is usually written in Java. Different
tools are used to compile and process it to the final product.
The Java Runtime Environment (JRE) is what allows you to run various tools and program on your host computer.
The Java Development Kit (JDK), version 6, update 33 contains the tools you need to work with Java
javac - the Java compiler
jarsigner - a tool for signing products
Android Software Development Kit (SDK), with downloads for Level 7 API.
Android Asset Packaging Tool (AAPT) - processes resources like images and layouts
Android Debug Bridge (ADB) - allows connection and debugging to your device
The final product is either an APK file or a JAR file, both of which
are basically ZIP files. Both of these contain a file called
classes.dex which contain the executable code. An APK file also
contains resources in a directory hierarchy. Some of these items,
like regular PNG graphics are exactly as you'd find them anywhere.
Other items, like "9 patch files" (9.png), are modified and others,
like XML files, are compressed. An APK file also contains a file
called AndroidManifest.xml that describes the product. Both APK
and JAR files can also contain signatures in the META-INF
directory.
Reverse Engineering
In the best of all worlds, you would have the original Java code that
the developers used to make the product. This is seldom available.
To work around this you need to backwards step the entire
process to get back to the original Java code. There is a problem,
the backwards process is not unambiguous. Yes, you can
backtrack to some Java code, that if compiled would work the
same as the original, but it would not look the same. Often the
intent of a piece of software is apparent from its layout. Also, you
will have none of the comments in the original code.
We can easily backtrack to an intermediate place between source
Java code and the final product. This is a place that does not really
exist in the original product generation process. We can take the
raw executable code out of a product and display it in a human
readable (and editable) form. "Smali" is the name of this
representation. It is analogous to assembly code. As stated, it
really does not exist as a language in the original compilation.
There is a software tool for taking apart a product and dissecting
it into the Smali code and the resources (if any). This tool also can
be used for compiling the Smali code back into the modified
product.
apktool, a tool for reverse engineering Android files
One of the main actions of the apktool is to take apart classes.dex
and generate a whole tree of files that end in the extension ".smali".
These files will have names like:
\NeatoApp\smali\com\bigcompany\neatoapp\MainView$23.smali
Modifying a Product
So, we can take a finished product, use apktool on it to take it apart
to pieces, modify some piece, then put it back together with
apktool. Modifying a resource like a graphic is easy, just modify
it (except 9.png, more later). Changing the wording of a popup
message is also easy. Changing the language of the interface
takes a bit more care to do it correctly. Modifying the Smali code
takes a bit of knowledge and done incorrectly can even brick your
device (repairable with a backup). If you have a chunk of Smali
code that someone modified for some reason, it's not too difficult
to open up your extracted Smali file, edit in the chunk, save it and
run apktool to put everything back together.
The Problem
We see this problem with kernels all the time, that some users want
a kernel with A, B, C and others want it with C, D, E. The number
of competing configuration gets out of hand. Moreover if you
come up with feature F, then you have to find a way to package
it up with A, B, C, for the first user and D, E for the second user.
A Solution
One possible solution is to let the user decide. You can distribute
options A-F independently and let the user install them themselves.
In principle, this means the user takes whatever version of
something they have on their device, apply a specific patch, then
reinstall it on their device. This would also open things up to
modifying different versions (for example Nook Touch vs. Nook
Glow) with the same mod.
mergesmali
mergesmali is a new tool for managing modifications to Smali
code. There is no particular magic behind it. It simply can replace
sections of Smali in a text file. It is agile enough to not rely on line
numbers or exact specifics of the Smali file. Here is a simple
example how you would use it to modify something:
Code:
adb pull /system/framework/android.policy.jar
apktool d android.policy.jar \Policy
mergesmali /v \Policy\smali\com\android\internal\policy\impl\LockScreen.smali landscapemod.smali
apktool b \Policy android.policy.jar
adb push android.policy.jar /system/framework
Mod Developers
We'll get to how to make the modification files for Smali soon...
Renate,
Great post! :good:
Could you add few words on logcat/ddms to help with troubleshooting, if a mod doesn’t work as expected, please?
Yes, I'm still working on this.
I've been patching the stock reader for dictionary and other things.
I was doing the patches on the 1.1.2 Reader.apk and it worked fine.
I just switched over to the 1.1.5 Reader.apk and it patched it fine without any changes.
This post addresses the developer side of things.
It is possible to patch Smali by hand.
For quick and dirty, this is not a bad solution.
The problem is that one must be aware of how many registers are used and for what.
In the first instance, if I need another register for my mod, that can push register references on other instructions out of the 4 bit range.
Also, if the stock code is revised later that can also change register references.
Even the simple addition of a debug print statement (Log.d) can affect things.
The solution is to always replace entire methods.
That way you are not fighting with conflicting code.
The logical place to keep your patches is in Java.
Obviously you can't have a standalone method, there has to be a class.
For instance, the stock Reader.apk has a place where it validates EAN (ISBN).
It checks for all digits, which bombs on sequences with dashes.
We want to replace that, easy enough, but we have to wrap it in the class.
Code:
package com.bn.nook.model.product;
public class Products
{
public static boolean isValidEan(String ean)
{
return(true);
}
}
Obviously this does not fully implement the class, but it has enough for our little method.
We do a normal compile of this, then apktool d it to the smali.
mergesmali can then scan through this smali and edit the stock smali from the apktool d'ed stock app.
A final apktool b, jarsigning and zipaligning puts it all back together.
But what if the method that we want to replace called some other method?
We would have to put something in our class to prevent compilation errors and to ensure that the smali code for our method did the correct invocation.
We end up writing stubs for these methods that do nothing.
If it's a void method, the body of the method is simply {}, for boolean types {return(false);}, etc.
But how do we make sure that mergesmali does not substitute these stub methods for the good methods already in stock?
Annotations.
By putting Annotations before each method, we can tell mergesmali what to do.
These annotations are preserved in the decoded smali.
They are subsequently deleted when mergesmali merges the smali.
Expanding our original example (this is just an example, not realistic):
Code:
package com.bn.nook.model.product;
import com.whoever.MergeSmali.*;
public class Products
{
@Ignore
public Products() {}
@Ignore
public static double complicatedOtherMethod(String ean, String msg)
{ return(0.0); }
@Replace
public static boolean isValidEan(String ean)
{
if (complicatedOtherMethod(ean, "Hello")<2.3) return(false);
return(true);
}
}
The @Replace tells mergesmali to replace this method.
The @Ignore tells mergesmali not to replace this method.
We need to have the stub for complicatedOtherMethod in the source.
Well, why is the constructor in there?
The compiler will generate a default constructor if we don't write one and it would have no annotation.
mergesmali prints an error if any method does not have an annotation;
There is also @Append for new methods that are not in the stock.
There is also @Delete to delete methods (that either have a super or not being used at all with the rewritten methods).
What's in com.whoever.MergeSmali.* ?
Code:
package com.whoever;
public class MergeSmali
{
public @interface Ignore {}
public @interface Replace {}
public @interface Append {}
public @interface Delete {}
}
The package is not important as long as it's an Annotation and the class/subclasses are as indicated.
collaboration?
Maybe we could start some sort of work distribution (and knowledge) towards fullfiiling some common goal for the NST.
Here's the Windows (command line) executable for mergesmali.
The basic usage is:
Code:
mergesmali /v [i]stock.smali[/i] [i]patch.smali[/i]
And here's the commands to integrate the new dictionary app to the stock Reader.
Code:
apktool.bat d Reader.apk \Reader
mergesmali /v \Reader\smali\com\bn\nook\reader\ui\ReaderMainView.smali ReaderMainView.smali
apktool.bat b \Reader NewReader.apk
It should generate the following message:
Code:
Replaced: public showLookupView()V
At this point you only have the question of how you are going to sign the modified Reader.
If you have resigned your whole system already, you can just resign with that and install.
You could also edit AndroidManifest.xml before the apktool b and delete the sharedid.
Then you could install it as a regular app after deleting the system app.
Renate NST said:
At this point you only have the question of how you are going to sign the modified Reader.
If you have resigned your whole system already
Click to expand...
Click to collapse
I guess no one did it... yet.
Renate NST said:
You could also edit AndroidManifest.xml before the apktool b and delete the sharedid.
Then you could install it as a regular app after deleting the system app.
Click to expand...
Click to collapse
I don’t understand Android security well enough.
There a discrepancy between documentation and how it works or maybe I don’t understand it at all.
Anyway – if Reader.apk is resigned, it should run under different user, thus loose access to shared databases (internal, annotations, bookmarks, etc.)
Do we need to fix permission to make them RW for everyone?
Could you check (ps) what user(s) "home", "library" and "patched reader" use on you nook now, please?
Annotations, bookmarks, last reading point are all providers implemented and used in Reader.apk.
As far as I can tell, there is no particular reason why Reader.apk uses a sharedId.
I don't have stock Home or Library running on my Nook.
I forget where I have Reader.apk installed right now.
It's been in /system/app or /data/app and worked fine in either place.
Resigning does not change user.
Renate NST said:
Annotations, bookmarks, last reading point are all providers implemented and used in Reader.apk.
Click to expand...
Click to collapse
I would expect the provider for Annotations, bookmarks is Reader.apk
They are not used anywhere else.
last reading point is used in Home.apk too.
Out of curiosity, where Annotations, bookmarks and last reading point providers are implemented?
In framework itself?
Renate NST said:
Resigning does not change user.
Click to expand...
Click to collapse
Ouch.
Stock reader runs as shared user.
If we resign it – it has to run as different one, according to security docs...
And it doesn’t matter if shared id is in manifest still or not.
I guess, I need to do some testing…
Ok, I meant resigning it with the system signature it can keep the same sharedId.
If you don't sign it with the same signature then you have to get rid of the sharedId.
It will then have a normal application user ID.
As far as I can tell, this should make no difference in anything.
But I have gutted most of the B&N stuff so I can't guarantee that in-store browsing or something else won't be affected.
Renate,
Could you answer this one:
ApokrifX said:
Out of curiosity, where Annotations, bookmarks and last reading point providers are implemented?
In framework itself?
Click to expand...
Click to collapse
And one more:
Is it difficult to mod and stock side-by-side?
Change app name + package for every class?
In Reader.apk
com.bn.nook.reader.providers.AnnotationsProvider
com.bn.nook.reader.providers.BaseDictionaryProvider
com.bn.nook.reader.providers.BookmarksProvider
com.bn.nook.reader.providers.LastReadingPointProvider
com.bn.nook.reader.providers.ReaderLocalProvider
(I'd like to know some time why the forums breaks words up.)
On your second question, that's an interesting one.
You'd have to change the package name all over the place,
not just in the manifest, but every smali file and every function call.
But sure, it could be done.
Renate NST said:
In Reader.apk
com.bn.nook.reader.providers.AnnotationsProvider
com.bn.nook.reader.providers.BaseDictionaryProvider
com.bn.nook.reader.providers.BookmarksProvider
com.bn.nook.reader.providers.LastReadingPointProvider
com.bn.nook.reader.providers.ReaderLocalProvider
Click to expand...
Click to collapse
Thank you!
Renate NST said:
(I'd like to know some time why the forums breaks words up.)
Click to expand...
Click to collapse
No idea…
Renate NST said:
Annotations, bookmarks, last reading point are all providers implemented and used in Reader.apk.
As far as I can tell, there is no particular reason why Reader.apk uses a sharedId.
Click to expand...
Click to collapse
Looking at B&N coding style, I won’t be surprised if Home.apk uses its own provider to read the "last reading point".
If this is the case sharedId in a must.
Renate NST said:
On your second question, that's an interesting one.
You'd have to change the package name all over the place,
not just in the manifest, but every smali file and every function call.
But sure, it could be done.
Click to expand...
Click to collapse
and every function call But it can be automated easily, right?
ApokrifX said:
If this is the case sharedId in a must.
Click to expand...
Click to collapse
No.
The "Last read" icon in the upper left corner broadcasts com.bn.nook.launch.LAST_BOOK
This is usually received by Home.apk, which uses the LRP provider in Reader.apk to get the EAN of the last book.
Home.apk then sends the intent android.intent.action.VIEW to Reader.apk with the path of the book.
Reader.apk then uses it's own LRP provider to get the actual LRP in the book.
None of this requires sharedIDs.
#2 Sure, that could be automated.
Renate NST said:
No.
The "Last read" icon in the upper left corner broadcasts com.bn.nook.launch.LAST_BOOK
This is usually received by Home.apk, which uses the LRP provider in Reader.apk to get the EAN of the last book.
Home.apk then sends the intent android.intent.action.VIEW to Reader.apk with the path of the book.
Reader.apk then uses it's own LRP provider to get the actual LRP in the book.
None of this requires sharedIDs.
Click to expand...
Click to collapse
Home shows "last book thumbnail" + on page #XYZ of #ABC also.
I recall you have deleted Home.apk.
Renate NST said:
#2 Sure, that could be automated.
Click to expand...
Click to collapse
Ok. I gotta take a look.Will try to do later today.
ApokrifX said:
Home shows "last book thumbnail" + on page #XYZ of #ABC also.
I recall you have deleted Home.apk.
Click to expand...
Click to collapse
Yes, my Library.apk replacement has a receiver for the com.bn.nook.launch.LAST_BOOK intent.
Even though Home.apk uses the Reader.apk to find LB & LRP for the preview,
it only uses LB to tell the Reader.apk what to open.
Reader.apk does its own homework checking LRP for the desired book.
This can easily be verified by opening a few books with a file manager.
Renate NST said:
Yes, my Library.apk replacement has a receiver for the com.bn.nook.launch.LAST_BOOK intent.
Even though Home.apk uses the Reader.apk to find LB & LRP for the preview,
it only uses LB to tell the Reader.apk what to open.
Reader.apk does its own homework checking LRP for the desired book.
This can easily be verified by opening a few books with a file manager.
Click to expand...
Click to collapse
Ok. I.e. it shouldn't be a problem to run side-by-side readers, right?
They both modify LRP, and Home will be able to pull it via stock reader.
Same idiotic question: do we need to need to change any permissions to let both readers access media databases?
As it stands, if I understand what you want to do,
you'd have to disable the providers in one of the Readers.
You can't have two providers responding to the same intents.
Is there some overwhelming reason why you want to do all this?
Renate NST said:
As it stands, if I understand what you want to do,
you'd have to disable the providers in one of the Readers.
You can't have two providers responding to the same intents.
Click to expand...
Click to collapse
I didn't realize until now, provider responds to URI, so better have one only to avoid problems...
Renate NST said:
Is there some overwhelming reason why you want to do all this?
Click to expand...
Click to collapse
To "not break existing functionality"
I see, it'll be too difficult to have both, too many changes are needed...
Just a bump, old posts don't have signatures.
mergesmali & other stuff can be downloaded from my signature blob.