I was one of the people that did the initial backup methods (telling you how to backup your certificate and rsa keys) or using cat which doesn't actually backup your wimax.img properly. After hours of playing around in a hex editor I finally got my 4g working again, and i'll explain how
****EDIT****
I added a hex converter you can use for your rsa key if you are too lazy to find one on google. I say to use hex instead of text replace because it's safer in regards to \n's
I was too lazy to make a gui for it but its haxt.net/evohex.php?rsa=yourrsa&cert=yourcert [obviously replace it with your 2 values]
Also, don't try to flash this image without editing it. The rsa key is invalid until you put your valid key in!
***********
Note - this won't work for anybody who actually has no idea what their RSA keys/certificate is.
So there are a few things you need first.
1. Your phones wimax mac address (take out your battery and look at the sticker)
2. Your RSA private key
3. Your Certificate
4. The wimax image file template I attached here in the zip
To simplify, use XVI32 freeware hex editor. If you search "BEGIN" you will see begin rsa key and begin certificate. You need to copy these values for later use.
Download the template file and open it in the hex editor.
Our template's mac is 00:18:41:81:8B:5C
Our templates Certificate is :
http://pastebin.com/vEnKFtS8
Our templates RSA Certificate is :
http://pastebin.com/gJbrh3ii
Convert both of these strings to hexidecimal and write them down! (it will look like a bunch of 4D 49 49 44 6B 44 43 43 41 6E 69 67 41 77 49 42 41 67 49 51 5A 4F 75 35 44 5A 4C 55 44 76 44 57 4B 57 2F 36 6D 48 66 4C 4F 54 type stuff)
If you don't know what your rsa key or certificate is, open it up in a unix friendly text editor(on windows i recommend notepad++). Search case sensitive for BEGIN. You will see the begin rsa key and begin certificate. Copy all of the text in between with no spaces or newlines! Now convert these both to hex and write them down.
Hit search -> replace on xvi32, click hex search and paste your converted hex for the templates RSA key.. and then replace with the hex value of YOUR rsa key. Do the same thing for the certificate as well.
The length of our templates rsa key might be different than yours, and your ending file size MUST be the same as your starting file size(the template is 12,582,912 bytes). There are a bunch of null characters in the template after --END KEY--- you might need to add or remove some to correct this! Just click on one and press the delete key if you have to
Now the only thing you have to do is fix your mac. In your new wimax partition file, text search for 00:18:41:81 to Replace that mac with your mac but subtract 1 from the last digit(if your mac was 00:23:76:EC:214 put 00:23:76:EC:213).
Replace the first 2 of the 3 instances with your mac -- minus 1. (If it ends on a letter, B would become A, C would become B, etc.
The last instance of your mac, put the actual mac address with nothing subtracted as it appears on the sticker under your battery.
Once you have saved the file.. name it something like wimax_fixed_resized.img and copy it to your sdcard.
Boot to fastboot and run "fastboot erase wimax"
Reboot to your recovery and adb shell in.
type "mount /sdcard" so you can run flash_image properly.
Run flash_image wimax /sdcard/wimax_fixed_resized.img
(or whatever you named it)
Profit!
One highly recommended addition to this is to use the correct ROM base version while you do this for testing if your wimax restored correctly. Quite often firmware/wimax mismatches will cause things to not auto connect, or various odd issues (true story)
Thanks for writing this up - I was planning on doing it at some point with a full guide on how to backup and restore the whole nine yards, but this will do in the meantime for people who want to restore things.
At first I thought this was for people who had lost their own RSA keys lol.
Great tutorial nonetheless.
haxt said:
I was one of the people that did the initial backup methods (telling you how to backup your certificate and rsa keys) or using cat which doesn't actually backup your wimax.img properly. After hours of playing around in a hex editor I finally got my 4g working again, and i'll explain how
****EDIT****
I added a hex converter you can use for your rsa key if you are too lazy to find one on google. I say to use hex instead of text replace because it's safer in regards to \n's
I was too lazy to make a gui for it but its haxt.net/evohex.php?rsa=yourrsa&cert=yourcert [obviously replace it with your 2 values]
***********
Note - this won't work for anybody who actually has no idea what their RSA keys/certificate is.
So there are a few things you need first.
1. Your phones wimax mac address (take out your battery and look at the sticker)
2. Your RSA private key
3. Your Certificate
4. A wimax.img from an evo that has has an intact wimax partition(borrow a friends nandroid backup).
To simplify, use XVI32 freeware hex editor. If you search "BEGIN" you will see begin rsa key and begin certificate. You need to copy these values for later use.
Next, open up the backup you got from a friend and save the certificate/rsa information between the ---BEGIN --- and ---END --- tags.
Now that you have the rsa key/certificate for both it is time to run a str_replace.
(Make sure to look at the original file size of the backup you got of someones wimax.img. Once you are done the file size needs to be the same).
Take YOUR rsa key and convert it to hexidecimal.. you can find tons of sites that will do this .. just google convert string to hex (it will be a long string of stuff like 4D 49 49 44 6B 44 43 43 41 6E 69 67 41 77 49 42 41 67 49 51).
Next, take your buddies RSA key and convert it to hex as well.
Open a copy of your buddies backup now and this will be used as the template for your new wimax partition. Hit search -> replace. For the hex to search paste your buddies RSA key you converted to hex.. and for the replace with.. put the hex of your rsa key.
Repeat these last steps for the certificate as well (convert to hex and replace your buddies certificate with your own certificate text)
REMEMBER!!!! if the length is not the same of the certificate/key you can fix this by adding or removing the blank bytes at the end of the ---END RSA or --END CERTIFICATE area.
You should be able to save the file now and the size should be exactly the same as the original backup you borrowed.
Now the only thing you have to do is fix your mac. In your new wimax partition file, search for 00: to locate the mac address of your buddies partition. You might find a few random ones first but just look at the surrounding text to know it's their mac. Replace that string with your mac but subtract 1 from the last digit(if your mac was 00:23:76:EC:214 put 00:23:76:EC:213).
Replace the first 2 of the 3 instances with your mac -- minus 1. (If it ends on a letter, B would become A, C would become B, etc.
The last instance of your mac, put the actual mac address with nothing subtracted as it appears on the sticker under your battery.
Once you have saved the file.. name it something like wimax_fixed_resized.img and copy it to your sdcard.
Boot to fastboot and run "fastboot erase wimax"
Reboot to your recovery and adb shell in.
type "mount /sdcard" so you can run flash_image properly.
Run flash_image wimax /sdcard/wimax_fixed_resized.img
(or whatever you named it)
Profit!
Click to expand...
Click to collapse
is there any way to break it down anymore? and do you have to use a buddies backup? i have my RSA keys i made a backup a while ago... cant you just use one of your old backups and replace wimax? thanks in advance and thanks for the post.
Great post, had been wondering how to actually restore the wimax keys once you had 'em.
Question for any devs that may have them: are the RSA keys generated by or linked to MAC ID somehow? Would it be possible to use backups of an one phone's keys with the another phone's baseband MAC ID?
I'll try to clean up the post to make it an easier read tomorrow but if you have an intact backup of your wimax image you can just restore it with flash_image or fastboot.. or just restore the nandroid backup. This is just for people that have the key itself but the image they have might be corrupted. If it would help everyone I can take a working wimax.img and remove the RSA keys so you can just download it as a template and put your keys in
I updated the thread.. has a template file in there too with dummy certs and keys to make it easier for you guys.
This is a big deal bro. Thanks!
Has anyone been having issues connecting to 4G? I've been having some issues where it authenticates, launches then disconnects. My keys are present but not really sure what else to do from here.
NYCHitman1 said:
Has anyone been having issues connecting to 4G? I've been having some issues where it authenticates, launches then disconnects. My keys are present but not really sure what else to do from here.
Click to expand...
Click to collapse
Does it get to the "Obtaining IP Addres..." then moves to "Disconnected"?
Caanon said:
Does it get to the "Obtaining IP Addres..." then moves to "Disconnected"?
Click to expand...
Click to collapse
That's exactly what it does.
Sent from my PC36100 using XDA App
NYCHitman1 said:
That's exactly what it does.
Click to expand...
Click to collapse
Good news and bad news...
Bad news is that I wasn't ever able to fix it. I tried flashing up and down all the radios I could find, trying all the radio/rom combos I could think of. RUU'd even, and no dice.
Good news is that it might not have actually been your fault. I ended up biting the bullet and going to the Sprint store to explain what was going wrong. The tech looked at it and said, "Let me guess, this happened after an update, right?" Apparently this is a "known issue" to Sprint, and it actually ended up happening to the tech herself about a week before it happened to mine. They ordered me a refurb no charge (I have insurance, but didn't have to use it I don't think) and got it a few days later. New one connects to 4g no problem, and 4g on CM works like a charm (thanks toast and shin!).
Caanon said:
Good news and bad news...
Bad news is that I wasn't ever able to fix it. I tried flashing up and down all the radios I could find, trying all the radio/rom combos I could think of. RUU'd even, and no dice.
Good news is that it might not have actually been your fault. I ended up biting the bullet and going to the Sprint store to explain what was going wrong. The tech looked at it and said, "Let me guess, this happened after an update, right?" Apparently this is a "known issue" to Sprint, and it actually ended up happening to the tech herself about a week before it happened to mine. They ordered me a refurb no charge (I have insurance, but didn't have to use it I don't think) and got it a few days later. New one connects to 4g no problem, and 4g on CM works like a charm (thanks toast and shin!).
Click to expand...
Click to collapse
Damn! I really don't want to go through all that trouble right now. Lol, eff it. I'll wait for the next best thing.
Sent from my PC36100 using XDA App
Question, wouldn't it be easier to just backup the existing wimax.img and restore it if/when needed using recovery? Or does this method address something that can't be done via recovery?
Sticky
Sent from my HTC EVO 4G running Frost 4.0 using XDA app.
i am confused when it come to this. is there a video or something. i know for a fact that i lost my RSA keys and i have used the "WiMAX Keys Checker" to check it and it say they are missing. but during my first initial backup i see the "img" file in there. i can't connect to 4g anymore so i am guessing for some reason it can't read it when i restore to the old version of my evo or when i change rom. i need some serious slow help
ericvbp21 said:
i am confused when it come to this. is there a video or something. i know for a fact that i lost my RSA keys and i have used the "WiMAX Keys Checker" to check it and it say they are missing. but during my first initial backup i see the "img" file in there. i can't connect to 4g anymore so i am guessing for some reason it can't read it when i restore to the old version of my evo or when i change rom. i need some serious slow help
Click to expand...
Click to collapse
Flash the WiMAX radio again and Update Profile, it will grab the keys from the carrier based on your phone's programming information
aph said:
Flash the WiMAX radio again and Update Profile, it will grab the keys from the carrier based on your phone's programming information
Click to expand...
Click to collapse
i flashed the wimax radio and updated the profile but it still does the same thing. any idea? I do have the RSA keys so i don't know why it doesn't grab 4G....
Well I thought I lost my RES keys after doing haxts back up, after I checked using Explorer and there was no res_OEM.key file. I did the back up again, still no file. I used Astro on my phone and the files where there. (res_OEM.key 4,575 KB & res_OEM.keycat 16,863 KB. Now a day later and the files show up using Explorer? I did do a winmax back up before I did anything and that is still there. Bottom line, if you think you lost you res keys after doing a backup, check it with a file manager program on your phone.
ericvbp21 said:
i am confused when it come to this. is there a video or something. i know for a fact that i lost my RSA keys and i have used the "WiMAX Keys Checker" to check it and it say they are missing. but during my first initial backup i see the "img" file in there. i can't connect to 4g anymore so i am guessing for some reason it can't read it when i restore to the old version of my evo or when i change rom. i need some serious slow help
Click to expand...
Click to collapse
I have my keys (WiMAX Keys Checker) but i can only connect when i do a restore of the orginal EVO rom from backup, but on all other roms(elite II for now) it just saids searching and never conects. Please help
edit drop and broke the phone that im talking about.. got new one thur insurance and rooted it and and 4 g works with no problme wonder what i ddi when i root the first phone
Related
For various reasons I need to change the android_id from time to time and to keep things nice and tighty, I always backup any settings before hand and restore to my original settings (android_id) when done. I wanted to have everything in one little package because plugging the commands in a terminal on the phone is not fun when the SDK is not available.
I could not find a solution for this so for simplicity, I wrote a quick bash script and decided to alter to make it more user friendly in case someone else has the need.
By default it will backup your settings.db (android_id location), generate a random letter/number 16 characters long and update the existing settings.db. You can edit the script to specific paths and even if you would like use your own hex code instead of a randomly generated one.
Anyways, from the terminal/adb this can be executed with 'sh android_id.sh'
Note: I used an array to generate the random hex. you may need to follow the steps here to obtain bash on your phone: http://forum.xda-developers.com/showthread.php?t=537827
can you explain a bit more abt the script? why is it needed to change the android_id?
nicandris said:
can you explain a bit more abt the script? why is it needed to change the android_id?
Click to expand...
Click to collapse
It's nothing too complicated..
the script provides a prompt with 3 options, backup, update and restore.
Backup does just that - it checks if the specified directory exists and if so, copies it to that location creating a backup of the original.
update checks for the settings.db in the backup location, generates a 16 character random number/letter string, updates the settings.db via sqlite and reboots the phone. Once your phone is rebooted, the randomly generated string is now your android id.
Restore deletes the altered settings.db and copies the original so the specified location reverting your phone back to it's original settings. This may or may not be necessary for some people....I'm just anal.
Why change the android_id?
I'm no stranger to Linux but am rather new to the droid. However, from what I read everybody has a unique android_id. Some apps will check the id when you register and won't allow you to register again (some games for example). Also, there are some roms will install a generic android id that multiple users may share. This can be problematic for certain apps that require a unique ID.
paxx- said:
Why change the android_id?
I'm no stranger to Linux but am rather new to the droid. However, from what I read everybody has a unique android_id. Some apps will check the id when you register and won't allow you to register again (some games for example). Also, there are some roms will install a generic android id that multiple users may share. This can be problematic for certain apps that require a unique ID.
Click to expand...
Click to collapse
thanx for the heads up! will have this on mind
Digging Deeper
paxx- said:
By default it will backup your settings.db (android_id location), generate a random letter/number 16 characters long and update the existing settings.db. You can edit the script to specific paths and even if you would like use your own hex code instead of a randomly generated one.
Anyways, from the terminal/adb this can be executed with 'sh android_id.sh'
Note: I used an array to generate the random hex. you may need to follow the steps here to obtain bash on your phone: http://forum.xda-developers.com/showthread.php?t=537827
Click to expand...
Click to collapse
I know this is an old post, But id like to know if this .sh can be added to a ROM and run after each ROM restore. The purpose is to use the same CWM backup, but during the restore process create unique android_id's.
I need to duplicate this on over 4500 devices. Pantech Element Tablet to be specific.
*****ROOT IS REQUIRED BEFORE PROCEEDING *****
*****FOLLOW THIS FOR ROOT, THANKS TO AYOTEDDY: http://forum.xda-developers.com/showthread.php?t=1100513
*****CREDITS GO TO SANFRANX415, SS2006, AND FROZ3N*****
The following process was originally made for the Samsung Galaxy S 4G, but works perfectly on the Sidekick 4G as well. I have tested and verified this working.
Steps:
1. Install "010 Hex Editor" you can use the trial version found here: http://www.sweetscape.com/010editor/
2. Install "Terminal Emulator" from the Market. Go to your Sidekick 4G and open the emulator.
*****FOLLOW THESE STEPS VERY CARFULLY*****
After opening a terminal emulator, type the following:
cd /dev/block <enter>
su <enter> <at this point your phone will ask for superuser, click access ALLOW it, if you already havent done so>
dd if=/dev/block/bml3 of=/sdcard/bml3.bak <enter>
*****THE PREVIOUS STEPS WILL PLACE A FILE NAMED "BML3.BAK" ONTO THE ROOT OF YOUR SD CARD*****
Go find the file on your SD Card and transfer it to your computer desktop.
3. Open 010 Hex Editor
4. In 010 Hex Editor, go to "File", "Open File", and open the "bml3.bak" file.
5. Once the file is opened, go to "View", "Linefeeds", "Fixed Custom", and ensure the number is set to "32"
6. Using your keyboard, select CRTL+F to search for a hex string, when the search window pops up select "Hex Byte" in the type field and then search for the following string below:
"FFFFFFFFFF0100000000" ALL TOGETHER, then hit the FIND ALL button to the right, some of you will get 2 results and others up to 10 results on your screen.
7. If you look at your Hex editor there are 3 window panes on the selected line
e.g 4CCC60h <-- Offset
01 01 01 01 < -- Hex Keys
yyyyyyyyy <- ASCII text (your 8 digit unlock code will be here)
8. Go through each result from the above search and you will see on the 3rd window pane (yyyyyyyyy) after the hex keys there is an 8 DIGIT CODE (write this code down), this is your unlock code NCK for your phone.
Sidenote: THIS 8 DIGIT CODE SHOULD SHOW ON AT-LEAST ONE MORE RESULT CHECK ALL YOUR RESULTS FROM THE SEARCH ABOVE IF YOU HAVE ANY DOUBTS (SOME OF YOU WILL HAVE YOUR CODE SHOWN AT-LEAST 2 TIMES AND SOME OF YOU WILL HAVE THE CODE SHOW MORE THAN 4 TIMES BUT YOU SHOULD NOT HAVE THAT MANY RESULTS)
***** TO INPUT THE UNLOCK NETWORK CODE DO THE FOLLOWING *****
9. Turn off your phone
10. Insert a foreign SIM card not attached to your current provider (e.g if you have T-Mobile, use an AT&T SIM CARD), and turn on your phone.
11. You will be prompted to enter a Network Unlock Control Key (use the code above that you wrote down and type it in your phone exactly)
12. After entering your NCK please hit "Unlock" or "GO" button and you should see a screen that says "Network Unlock Successful", and your phone should go in the main screen after your phone has been unlocked.
there is a thread in the general section with 3 or 4 different ways to do this and since u just copied an entire post in the SGS forum, u should link to that thread in ur post
I didn't just copy and paste, I change some small things that were a bit confusing, and I also gave credit to all who made the SGS4G guide at the very top of this post. The posts you say this is mentioned in, is not very noob friendly or easy to find.....this is.
Sent From My UNLOCKED Sidekick 4G
hey im trying to unlock my sidekick and im running into a problem, im good all the way up to when you search, im getting over 700 results, what am i doing wrong?
700 results ! are you 100% sure ?
what is the size of your bml3.bak file ?
do you get the same 6 digits sequence (in ASCII) after each result ?
If so that's probably the code.
I had the same problem. I was getting 700 results.when I scrolled all the way down the code was there. In results 699 and 700
Sent from my SGH-T839 using XDA App
You get a lot of results... once you get the results you look through every one of them till you find the code on the right... its 8 numbers really obvious that its the code your looking for
Any chance for a screenshot of the hexeditor on the correct string?
I ended up getting 468 results. After scrolling down the results slowly I found the unlock code. You'll know once you see it, as it stands out very clearly as a 8 digit code, it just takes time finding it if you end up getting a lot of results.
Very useful. I'm going to be unlocking a friends Sidekick 4G and didn't want him to have to pay for it. I'll give feedback when I actually try it. Thanks!
Very Nice!! simple! easy!! great post! thank you!!
Sent From My Samsung Sidekick 4G UNLOCKED
I've found the code TWICE but it never worked! any ideas?
I've reformated the SD card, rebooted the phone, and this time got the very same code 7 times, I've tried to enter it using the soft keypad and the hard one, still same result
Yay!!!
Thanks!!! Worked Fine for Me!
This will come in handy when my little cousin comes to visit.
Thanks for posting this. I followed the instructions exactly and it worked on my Sidekick 4G. There were over 120 matches to that hex string, and the unlock code was with the last two matches in the file. In case it wasn't clear, you should see 8 digits (hex values 0x30 to 0x39) right after the string you are searching for. The ASCII values (what you would actually type on the keyboard) are in the right pane of the hex editor.
ok so i followed all the instructions step by step and i opened the file in the editor 2 different ways from this forum and another, i searched for "FFFFFFFFFF0100000000" and it looked thru all 565 results and most of the results are "0.1.2.3.4.5.6.7.8.9" always in order but sometimes split up found 1 result with the correct amount of numbers but didnt work, just wondering if i went wrong somewhere?
mojo4713 said:
ok so i followed all the instructions step by step and i opened the file in the editor 2 different ways from this forum and another, i searched for ...
Click to expand...
Click to collapse
There is a much easier way which does not require complicated directions:
http://forum.xda-developers.com/showpost.php?p=15992373&postcount=7
Very useful. I have successfully unlock my SK4G without any problems. Thanks, man.
Worked perfect the first try. Thanks
Quick and short of it:
The SK4G has the same exact physical Keyboard layout of the G1. But it sucks in comparison to the G1's layout because someone at Samsung dropped the ball. Shift + a number does not give you the normal expected symbol. There is a lack of a comma on the right hand side. Shift+Alt tends to not do anything on most keys. With this mod, I fixed 90% of the annoyances of the hardware keyboard (Just need to turn the [useless everywhere but the stock messaging app] smilie key into the voice key, and the voice key into an alt key and I'll be 100% good)
By hacking the corresponding kcm.bin file in the /system/usr/keychars/ directory, you can change the action of a key. This is not the same as changing the kl file in /system/usr/keylayout/ which allows you to change the behavior of a physical key. (A bit of semantics really.)
I modded the default kcm.bin (Binary Keyboard Character Map) file s3c-keypad.kcm.bin to match the G1 kcm closely, adjusting for what is printed on the SK4g keyboard, so w, e, and r are still smilies, and m is still /, while alt+shift+? is now ¿ as the g1 has. Only change to what is printed was fixing the multiplication sign symbol on alt+o to show an actual multiplication sign, instead of an x. Some unused alt+shift+key were used to improve usage, and for flair.
Main Changes:
shift+number provides its corresponding symbol, like it should.
alt+shift+O is the Umlat combining accent (press another character afterwards it it might combined, like ¨ + u is ü. Same result as longpressing U).
Alt+Q default by Samsung is a Space. Alt+Shift+Q is now Tab.
Alt+Shift+T is the "¬" not symbol. Sideways L. Useful for ¬_¬ sideway glances.
Alt+Shift+Y is the unicode STAR AND CRESCENT. SK4G can't display it, but it will show up correctly in OSes that understand it/have the right encoding (like the G1).
Shift+Period is a comma. Because the comma belongs on the right side of the keyboard dammit.
Alt+Period is a bullet symbol.
Alt+Shift+Period is a "`" Grave combining accent (same as Umlat. Grave + space is regular grave)
Alt+Shift+Enter is a CR return key, instead of the normal LF return key. Some apps recognize the difference (ConnectBot)
[email protected] and [email protected] is the ~ tilde. I did not add the combining accent version. An adult keyboard requires the ~.
[email protected] is the Eighth Note. Because we all need some music in our lives. Displays properly on the SK4g.
Instructions:
If you want to use the character map I created, you will need root, adb, and be comfortable mucking about the phone's system files. You can install with RootExplorer or any other file manager instead, if you know how to do it:
Code:
adb push /path/to/unzipped/files/mods3c-keypad.kcm.bin /data/local/tmp/
adb shell
su
mount -o remount,rw /dev/block/stl9 /system
cp /data/local/tmp/mods3c-keypad.kcm.bin /system/usr/keychars/
cp /system/usr/keychars/s3c-keypad.kcm.bin /system/usr/keychars/s3c-keypad.bu
mv /system/usr/keychars/mods3c-keypad.kcm.bin /system/usr/keychars/s3c-keypad.kcm.bin
chmod 644 /system/usr/keychars/s3c-keypad.kcm.bin
You need to push the file to the tmp folder, then going in as superuser, remount the system partition.
Once remounted, you can copy the file to the correct folder.
Safety first, make a backup of the original file. A copy of the original is also provided in the zip folder.
Now you overwrite the original.
Once that's done, you want to correct the permissions to 644 like the original.
At this point, you can reboot. If you want to give it a try before rebooting, you can just load any app that isn't in memory, or kill an existing app, and load it back up, and type to see the difference. You must reboot if you want to see the changes everywhere. Any app in memory, including home and system, will not see the new file till you kill it/reboot.
What's in the zip:
Four files are provided in the zip.
1: "s3c-keypad.kcm.bin" This is the original kcm.bin from the stock KD1 firmware. Most likely, it has not been change in KG2.
2: "trout-keypad-v3.kcm" This is a plain text readable version of the G1 kcm. Look at this if you want to see the format android uses to build the kcm.bin file. Easy to read.
3: "mods3c-keypad.kcm" This is a modified kcm file, easy to read showing what my modded layout is, with notes.
4: "mods3c-keypad.kcm.bin" the actual kcm.bin file you can use to drastically improve your keyboard.
If You want to make your own:
Some Resources First:
ASOP Developers Guide to the Keyboard:
http://www.kandroid.org/online-pdk/guide/keymaps_keyboard_input.html
Describes how Android uses (some of) the keyboard files, and the file layouts.
Extending the keyboard mapping of an Android system
http://jahrome.free.fr/index.php/keyboard-mapping-android-htc-desire?lang=en
Found this after the fact, some xda members doing this on the g1 way back when:
http://forum.xda-developers.com/showthread.php?t=468703
Someone had a python tool to turn kcm.bin to kcm files.
http://forum.xda-developers.com/showthread.php?t=837002
Basically, you will be mucking around a hexeditor to change the kcm.bin file.
Make the hex editor show you 16 bytes per line, and you will see a nice pattern, as shown on the http://jahrome.free.fr/index.php/keyboard-mapping-android-htc-desire?lang=en.
Any non-normal (unicode) character should be put on the hex side, so 0x0300 would be typed in. Additionally, hex editors tend to show lsb first. So unicode 0x0300 would show up as "00 03". 0xEF01 will be seen as 01 EF.
If you look and compare the hex editor screen to the kcm file provided, you can easily modify the kcm.bin file to your liking.
Future:
I'm trying to find where the LongPress Keyboard character maps are. Like when you longpress ! lets you choose ¡, or long pressing shift+4 ($) gives you the option to insert a couple of currency marks, or longpressing a will let you choose from accented a characters (å,ä,â etc).
Additionally, also looking for the same on the Extended Feature keys, like SYM, and the smilies. The smilies are just macros that get typed when you press them, as using the regular smilie types ":" "-" and ")", and you can delete each one individually. Having a customizable macro key would be great.
But from my guess, one or both of those features are embedded in the keyboard device driver. I will muck around the filesystem to see what I can find.
Notes:
I am not responsible for anything ever anywhere. You break it, you pay it, not me.
Also, this is only for the hardware keyboard, not the virtual IMEs. Changing those would require apk code signing, and desamali and everything. headthefrickache.
thank you!
this is gonna be really helpful and fun to mess around and make my own. glad to have another dev aboard!
Update: I poked around a bit, and looked at the ime-htc.apk that is floating around. Decompiled the apk, and found that it's popup alternatives for the virtual keyboard is in res/values/strings.xml, with the fields pointed at it by res/xml-normal-hdpi/*.xml depending on which language/shape/layout keyboard you are using.
So I think I am right in assuming that the hardware keyboard popups are in the device driver. :/ Will investigate further.
Oh, and a note about the sidekick keyboard. You cannot press and hold ALT+SHIFT and a third key at the same time. You can't press any three keys and have it register at the same time at all. Another instance where the g1 was just better
Additionally, doesn't seem like all keys respond to a alt-lock+shift-lock the same. The @ and ? key seems to only produce the alt or shift version, while most of the others produce the alt+shift version of the key.
This ****ing guy, eh? When can I buy you strippers and blow, eh? I ****ing love you.
chaostic_2k1 said:
Update: I poked around a bit, and looked at the ime-htc.apk that is floating around. Decompiled the apk, and found that it's popup alternatives for the virtual keyboard is in res/values/strings.xml, with the fields pointed at it by res/xml-normal-hdpi/*.xml depending on which language/shape/layout keyboard you are using.
So I think I am right in assuming that the hardware keyboard popups are in the device driver. :/ Will investigate further.
Oh, and a note about the sidekick keyboard. You cannot press and hold ALT+SHIFT and a third key at the same time. You can't press any three keys and have it register at the same time at all. Another instance where the g1 was just better
Additionally, doesn't seem like all keys respond to a alt-lock+shift-lock the same. The @ and ? key seems to only produce the alt or shift version, while most of the others produce the alt+shift version of the key.
Click to expand...
Click to collapse
Port G1 driver? Whoz got the sauce? erm Source?
Well, I figure the g1 just dedicated more gpio than sumsung did for the keyboard. I doubt the g1 driver can be ported. And the sumsung keyboard driver might be hackable, but without the source for it, it be a pain to try. Still looking for the long press keys though.
I may be confused about your question. I can't seem to understand what you mean by hardware keyboard popup, but yes, the keyboard driver is in the kernel, so you'd need a custom kernel to change that.
The kernel source is available at opensource.samsung.com
If you can pm me/write what you're trying to do/fix (as I'm currently a bit confused as to your goal) I would be open to helping work on this
If you hold down the a key on the keyboard, you get a little popup screen that lets you choose the alternative versions of a, like å, ä, á, etc. Same for holding shift+4 or alt+4, would give you the alternatives for $, like ¥, british pound symbol, etc.
I am trying to find where that information is held. On an ime, it's in the strings.xml file inside the apk. For the hardware keyboard, I'm guessing its in the driver. I'm trying to locate that, so that it can be changed to include more things (and in the sk4g, even add macros like the smilies).
Unfortunately, noone else has found it, or if they have, it's buried in some obscure thread inside some obscure device's forum. The problem with android information, is that with so many devices, and versions, there is a ton of information, being redundantly found/created, and buried under other information.
Haha I hear that. I guess I was testing it out using the wrong buttons before, as I didn't get that popup before. Now I was able to, but it looks like it's only for certain keys. At any rate, let me look in the kernel source to see if I can find the correct files there.
sduvick said:
Haha I hear that. I guess I was testing it out using the wrong buttons before, as I didn't get that popup before. Now I was able to, but it looks like it's only for certain keys. At any rate, let me look in the kernel source to see if I can find the correct files there.
Click to expand...
Click to collapse
I will donate money to this project. No ****ing joke. I wanna see this **** happen.
$50 is what I'm putting down at the moment. I'll put down more if more coders want to help out sduvick and make this work wonderfully.
Requirements,
01. Have all the features which the OP is attempting to incorporate.
02. Have a secondary .apk which allows users to modify key layout whilst using the phone.
Update/message towards chaostic: it appears that the longpress popup is coming from /system/framework/services.jar (desmali'd) com/android/server/KeyInputQueue.
On a somewhat related note, trying to find the keymaps for smileys to remove the extra alt added after the '<3' alt key if anyone might know where that is. EDIT: re-read your OP, looks like you couldn't find these either, but apparently this was fixed in the KG2 update, so maybe the kernel updates might give me more details. will update shortly.
UPDATE: found the smileys in /system/framework/framework.jar (desmali'd) com/android/internal/widget/smileys.smali
sduvick said:
Update/message towards chaostic: it appears that the longpress popup is coming from /system/framework/services.jar (desmali'd) com/android/server/KeyInputQueue.
On a somewhat related note, trying to find the keymaps for smileys to remove the extra alt added after the '<3' alt key if anyone might know where that is. EDIT: re-read your OP, looks like you couldn't find these either, but apparently this was fixed in the KG2 update, so maybe the kernel updates might give me more details. will update shortly.
UPDATE: found the smileys in /system/framework/framework.jar (desmali'd) com/android/internal/widget/smileys.smali
Click to expand...
Click to collapse
So the smilies have been found is great, but the two things of note is how difficult it would be for a regular edit, so for rom builders or themers its great, but individuals would be hard press to change it.
Just to make sure, these are the alt+w or alt+e or alt+r smilies/macros, or is it the smiliey key widgets?
Either way it gives me somewhere to look. Seems the longpress alternatives is a longshot for easy modding at this time. But ever forward. Thanks.
I would integrate it as part of the tweaks thread I've been working out of, but it's a matter of changing some very simple (once you get it extracted and desmali'd) source, just looking through one file and looking for the strings for each smiley. Mind you, this is only for the smiley button itself, that is the popup that appears in messaging when you try to use the smiley button. This doesn't really relate at all to the keyboard at all actually.
Any key presses are gonna be from the kernel somewhere, still waiting on the download, samsung's opensource server is slow as balls.
Works great; how to edit
I just did this and it solved one of my two huge dissatisfiers with the Sk4G over the G1 and the actual original Sidekicks (where I was one of the people who convinced them to add | and ` and ~ back at Danger).
I really wanted to type ` by itself, so I edited my keymap so that [email protected] is ~ but alt-~ is `. I did this using emacs, with hexl-mode, and it was a snap!
Also, even though I've used adb in the past, I got stuck at su and it did nothing. I realized I needed to be running the SuperUser app first, and once I did that and ^C'd out of the su, it prompted me and I allowed it to remember shell request, and everything from then on worked great!
Thanks!
Leigh.
Glad it Helped someone
Can you hack the keyboard to allow virtual keyboard to work while in landscape mode?
Thanks that is awesome
This was really helpful.
I'm been bothered with the funky behaviour of shift+0-9
I also mapped alt-a a to escape
and changed alt-q from space to really being tab
The .kl file was also interesting:
/system/usr/keylayout/s3c-keypad.kl
It is just a textfile, so easy to edit and I was able to remap the mostly useless SMILEY key to GRAVE.
which is helpfull when I need a ~.
The .kl file also has all the other buttons on the SK4G so they can be reassigned.
I moved VOICE_INPUT to what was MULTITASKER, so I can enter voice commands without opening the keyboard.
and made myself a ALT_LEFT.
Smart Quote-enabled Physical Keyboard
First off, a huge thanks to chaostic_2k1, whose hack of the Sidekick 4G keyboard is brilliant. It was the only one I could find, and his instructions are first-rate. Using his modified s3c-keypad.kcm.bin file, I’ve been able to concoct a keyboard that has all of his fine variations along with smart-quote and easier em-dash ability.
If users are trying to write a professional manuscript, they need smart quotes (curly quotes), em dashes, and ellipses. The attached file has these modifications:
ALT-f = left double quotation mark
SHIFT-ALT-f = still gives the left bracket
ALT-g = right double quotation mark
SHIFT-ALT-g = still gives the right bracket
[These brackets are also stock-accessible with ALT-space]
[Right and left double quotation marks are stock-accessible with ALT-k, long press, etc. The keystrokes in this file cut down the number of steps]
ALT-lowercase L = right single quotation mark (curly apostrophe)
SHIFT-ALT-lowercase L = straight apostrophe
ALT-t = regular hyphen
SHIFT-ALT-t = em dash
[The em dash is still stock-accessible with ALT-t, long press, etc.]
The ellipsis is stock-accessible with ALT-space. I didn't modify anything connected with the ellipsis.
Follow the instructions in the first post of this thread for proper s3c-keypad.kcm.bin copying into /system/usr/keychars
Root obviously a must, and I used Total Commander file manager to copy file from sd card to /system/usr/keychars
If using Total Commander, remember to change /system directory to read-write.
Proper screen display of smart quotes: neither ThinkFree or Kingsoft word processors will display the actual right and left double quotes, though the quotes will enter correctly and display on a desktop word processor, printer, etc. In order to see double quotes correctly, users must use QuickOffice or TextMaker word processors [for reasons I can’t figure, KingSoft doesn’t even allow ALT-space or any SHIFT-ALT keystroke].
This keyboard mapping works on my Sidekick 4G, but I take no responsibility for any problem. I’ve also hacked the /system/usr/keylayout/s3c-keypad.kl to change key 54 SMILEY to key 54 TAB WAKE_DROPPED
This changes the SMILEY to a proper tab.
Do take care with the /system/usr/keylayout/s3c-keypad.kl If you screw it up, all physical keys, including Menu, etc, are dead, and you have to touch-screen the restoration of the original file. A little scary.
EDIT/UPDATE: Attached is the kcm file with an additional character: the left apostrophe. SHIFT-ALT-k = left single quotation mark
This is needed for smart quote usage when quoting within double quotes: "So when you said 'yes,' you really meant no."
Jake
Introduction:
After I saw that that there is an Adb command to backup Android devices, I said to myself why I don't make batch file to make it easier for people to use it ? Luckily, it didn't take me long before I made a batch file that is able to backup your device ,any Android device, which is extremely easy to use.It consists of only 5 questions that will help decide what you wish to backup. This batch file uses a unadvertised feature in Android 4.0+ to Backup everything on your Android device. A Galaxy S4,a Chinese branded mobile phone, or even a tablet. This batch file can backup all of them.
Disclaimer:
I’m not responsible if something goes wrong on your phone(Usually nothing goes wrong), you’re doing this on your own responsibility. Rooting your phone will void your warranty so don’t root your device unless you know what you are doing.
Method:
Advantages:
Easy to use.
Backs up all your apps with all their data.No need to worry about reinstalling them again.
Uses Android stock feature so it less likely –if not at all- to find an incompatible Android device.
Extremely useful for cheap unbranded chinese Android Devices
Doesn't require a rooted device.
Disadvantages:
If you have a mobile device you need to backup your messages and call logs separately.
Needs a Windows PC .
Download:
To download the toolkit and for more instructions on how you can use it, consider visiting How to Back up Almost Every Android Device
Has anyone had issues with this backup tool? I have a 6.9 GB .ab file in my backup folder, so I'm 90% sure I did the backup correctly... But I can't get it to restore. I point the tool to the backup, it reads back the complete file extension correctly, I select "backup now" on the phone and let it run till it gets to the "thank you for using this tool, press any key to continue" and it closes itself out. There's nothing on the phone though. I've performed the restore twice, the second time I made sure the file extension was exactly how windows shows it in the event that the tool is case sensitive. Still nothing on the phone.
@tsiah: The script seems to be using the adb backup command. According to this thread (at the bottom) you need to set a desktop backup password:
copkay said:
NOTE 06/12: There seems to be a bug in which backup and restore operations will fail unless a desktop backup password is set under Developer Options. It will not work with a blank password.
Click to expand...
Click to collapse
The post itself is a little bit older, so you might have to search around if this is still the case.
zAfi2014 said:
@tsiah: The script seems to be using the adb backup command. According to this thread (at the bottom) you need to set a desktop backup password:
The post itself is a little bit older, so you might have to search around if this is still the case.
Click to expand...
Click to collapse
Great... That would have been nice to know before hand
So now I've wasted all this time trying to get it to work and it probably won't ever work at this point...
tsiah said:
Great... That would have been nice to know before hand
So now I've wasted all this time trying to get it to work and it probably won't ever work at this point...
Click to expand...
Click to collapse
When you did the backup, didn't your phone ask you for a password to input?
polobunny said:
When you did the backup, didn't your phone ask you for a password to input?
Click to expand...
Click to collapse
It says you can encrypt it with a password but that it's optional.
I've been messing around with this a little bit more. I set a password in developer options and attempted the restoration again. It runs for about 30 minutes, I get the toast "restore ended" (something to that effect) and nothing has changed.
Currently attempting to restore in safe mode. No idea if it'll take or not.
I lost a lot of photos that were attached to an app (you have to manually select the ones you want to save and save them to your library...wtf? good idea dev!) my wife is quite upset that the photos are gone and I'm about at my wits end trying to get this restoration to work.
What I can't understand is why the file is 6.9 GB, but there's no restoration taking place. Everyone that reported issues with the password not being set was getting a 0kb or maybe a few hundred mb as their file they pulled in the backup. I really don't think the backup failed...but why is the restore failing???
Attempting the restoration in safe mode made no difference.
Pretty bummed out.
I've been twisting the ear of someone over at VSCO cam. No idea if it will make a difference in future versions of the application but IMO they should inform you when you START using their app that you MUST manually save all the photos you want to keep...or, the logical thing that every other camera on the planet does, JUST SAVE THE DAMN PHOTOS!
VSCO stores pictures in some cache folder of their own. If you uninstall the app or have to factory reset a phone and you haven't selected and saved all your photos inside the app, you lose everything. They don't own MY pictures. I think that kind of blurs some...ethical? ...lines. Storing them in a folder that basically "belongs" to them? not cool VSCO. Not cool at all.
I'm pissed about this whole situation.
Sometimes I just want to tell all technology to bite my shiny metal ass...
---------- Post added at 10:20 AM ---------- Previous post was at 10:15 AM ----------
kalo0osh97 said:
Disadvantages:
If you have a mobile device you need to backup your messages and call logs separately.
Needs a Windows PC .
Click to expand...
Click to collapse
add to this list that the restoration might not work, even if the backup seems to have worked properly...
I won't ever use this backup method again. It's way too time consuming and you can't depend on it.
I know this post is pretty ancient, but I just wanted to toss in that the beginnerguides domain appears to have expired and been picked up by a domain scalper, so the resources this thread mentions are no longer available Here's hoping they can be put up somewhere else, or that someone has a link to similar instructions!
microwiz said:
I know this post is pretty ancient, but I just wanted to toss in that the beginnerguides domain appears to have expired and been picked up by a domain scalper, so the resources this thread mentions are no longer available Here's hoping they can be put up somewhere else, or that someone has a link to similar instructions!
Click to expand...
Click to collapse
very true ! will the author of the 1st post please respond !
kalo0osh97 said:
To download the toolkit and for more instructions on how you can use it, consider visiting How to Back up Almost Every Android Device
Click to expand...
Click to collapse
the site seems to be empty....
I have tried to restore using beginner guide's toolkit but everytime i restore....a message pops up and says "restore started" after 3 seconds..."restore ended" ...but there is no changes to my actual phone files...nothing got restored. What is the problem with this toolkit ? I expected this to work several years ago and now it doesn't and I basically lost all my files and everything
Hi all.
I'm after quite specific need but would like to know more general answer / solution if possible at all.
I know that wihtout being rooted there's not much one can do with system folders, but still, there are some ways and tricks to get to them, one of them being Backup option provided by android, using ADB shell.
I'm after specific file, that is /data/data/com.android.mms/shared_prefs/com.android.mms.categoryInfo.xml
Using Htc One M8, stock rom, I've tried to do adb backup of com.android.mms application, but all I got was 1kb (actually 41 bytes) sized file, which contains nothing.
I wonder, is there any other way to get to the specific system app folder, if you're NOT rooted?
Any help would be highly appreciated.
Additional info: I'm after that file because it has stored Secure message box password in Plain text. My phone is about to go to the service due to several issues, including battery getting way overheated when used, and not charging over 25% at all, and the only thing left to make a backup is the secure box storage, which I used as an "Other inbox" folder in order to have the main Inbox a bit more "clean", and I know I've set it to something stupid and short, and I've accessed them not long ago, but for the f's sake I can't get in the folder anymore (and I'm highly betting that after several attempts even the real password is no longer accepted, and that being the reason I can't figure out the pass by trying, but there's nowhere info it thats true, and if so, how long to wait before real one would be accepted etc...)
Big thanks if anyone could help out, if not - not gonna be the end of the world. But would kinda like to store some of the messages that are newer than my latest backup...
Cheers!
cucolino said:
Hi all.
I'm after quite specific need but would like to know more general answer / solution if possible at all.
I know that wihtout being rooted there's not much one can do with system folders, but still, there are some ways and tricks to get to them, one of them being Backup option provided by android, using ADB shell.
I'm after specific file, that is /data/data/com.android.mms/shared_prefs/com.android.mms.categoryInfo.xml
Using Htc One M8, stock rom, I've tried to do adb backup of com.android.mms application, but all I got was 1kb (actually 41 bytes) sized file, which contains nothing.
I wonder, is there any other way to get to the specific system app folder, if you're NOT rooted?
Any help would be highly appreciated.
Additional info: I'm after that file because it has stored Secure message box password in Plain text. My phone is about to go to the service due to several issues, including battery getting way overheated when used, and not charging over 25% at all, and the only thing left to make a backup is the secure box storage, which I used as an "Other inbox" folder in order to have the main Inbox a bit more "clean", and I know I've set it to something stupid and short, and I've accessed them not long ago, but for the f's sake I can't get in the folder anymore (and I'm highly betting that after several attempts even the real password is no longer accepted, and that being the reason I can't figure out the pass by trying, but there's nowhere info it thats true, and if so, how long to wait before real one would be accepted etc...)
Big thanks if anyone could help out, if not - not gonna be the end of the world. But would kinda like to store some of the messages that are newer than my latest backup...
Cheers!
Click to expand...
Click to collapse
Yes and not.
if you don't have root access, you can not copy an application from the system folder, to make this the ADB would need root permissions. but....
You can download the stock rom, and copy/extract/edit the app you need it.
xdedeone said:
Yes and not.
if you don't have root access, you can not copy an application from the system folder, to make this the ADB would need root permissions. but....
You can download the stock rom, and copy/extract/edit the app you need it.
Click to expand...
Click to collapse
Actually no, if the file is user specific, as in my case, the help of stock rom's file is not gonna help.
Anyway, SOLVED now.
As per this post: http://forum.xda-developers.com/showthread.php?t=2054401
The backup of the app was made and got the file. I've done the same thing without success, because on HTC, the messaging app is com.htc.sense.mms and NOT com.android.mms.
Therefore creating backup of the com.htc.sense.mms did result kin getting exactly what I needed.
In the extraction of the tar .ab archive using dd in linux, I got folder app, within there is a folder com.htc.sense.mms, wihtin there's a folder sp, and there is com.htc.sense.mms.categoryInfo.xml which has the secure box password stored in plaintext.
Voila! )