[Q] .kl file issues - Xperia Z2 Q&A, Help & Troubleshooting

I've been running my xperia Z2 for a month or two now and one of the first things I did was disable the camera button, and attempt to rebind it to a different button in the .kl files within system/usr/keylayout. Initially, it worked great. I commented out the key 212 camera in a few files with a #, and added a new line.
It's been a month or so since then and I hadn't been using the camera button and all, and recently I've noticed that the kl file changed back in one of my restores to just being commented out, so the camera button is now non functional. I attempted to add a line of code to change the camera to media next like this: key 212 MEDIA_NEXT, but was getting no response after restarting my phone. I removed the line, deleted the comment on the previous line in every file that I had disabled it in, and restarted the phone. Camera is still non functional even after confirming it stayed unchecked.
After this, I attempted to copy all of the files to my SD card and mass edited every single camera key reference to media_next for the sake of testing, and the button was still disabled. I completely purged my .kl files, and uploaded notepad++ edited copies and restarted my phone. None of my buttons worked. I did a restore from my SD card backup, and nothing worked after restarting, still. I did a backup from a TWRP backup and everything is functional again... however, I'm left wondering why my .kl files might not be reading.
I apologize for the long post, but I'm trying to understand where I've went wrong. I'm on a stock bell rom(canadian) firmware 4.4.2 model D6503 build 17.1.A.2.55. I'm rooted, with only minimal modifications to the device(cydia substrate, xposed framework using rootcloak, youtube adaway, a radio modification to allow headphoneless scanning and xposed additions).
Does anyone know where I might've went wrong? My end goal is to rebind a controller's R2(simple button) controller to the R2 axis as well as button press, so if anyone has any information on rebinding a key to a maxed out axis I would appreciate information on that as well(Eg. R2 key 105 to RTrigger 1.0 + key 105).

Not sure
Perhaps copy a working existing file and try from there
I had trouble understanding your problem

Envious_Data said:
Not sure
Perhaps copy a working existing file and try from there
I had trouble understanding your problem
Click to expand...
Click to collapse
I've restored a CRM backup and the .kl files all work great, but when I attempt to modify the files they don't seem to update any system functions or buttons unless I'm just disabling the button. Even if I copy the file to another directory, break all the buttons then overwrite it with the copy and restart, the buttons stay disabled until I restore a CRM recovery.
I hope that's a little easier to read, the phone just doesn't seem to update its internal system with button definitions except to disable them, and I'm trying to figure out why.

Zarreck said:
I've restored a CRM backup and the .kl files all work great, but when I attempt to modify the files they don't seem to update any system functions or buttons unless I'm just disabling the button. Even if I copy the file to another directory, break all the buttons then overwrite it with the copy and restart, the buttons stay disabled until I restore a CRM recovery.
I hope that's a little easier to read, the phone just doesn't seem to update its internal system with button definitions except to disable them, and I'm trying to figure out why.
Click to expand...
Click to collapse
Just a thought, not pretty sure.
When you are copying files from sd-card, you should also check for correct permissions.
Your permissions must match with original files, otherwise it may create an issue.

mvv1277 said:
Just a thought, not pretty sure.
When you are copying files from sd-card, you should also check for correct permissions.
Your permissions must match with original files, otherwise it may create an issue.
Click to expand...
Click to collapse
I hadn't even thought of that, thank you, I'll try that out

Related

[FIX] See ALL apps in Market (froyo only apps, and paid/protected apps) Automated!

laymil has posted a much better script for this. As such I will be discontinuing my work on this for now. Not for any hard feelings, but because it is now beyond me to help any further.
As always I am glad to have helped the community in some small way. Thank you all
CHEERS
Geniusdog254 Posted the exact lines in the build prop that needed to be changed. This is a pretty common fix for problems like this between versions of Android. There was some concern however that you may miss some of the newer apps released only for Froyo. I wrote some simple scripts that will fix this for us.
Simply: One puts the Froyo build.prop on your phone. The other puts the modded build.prop on your phone.
Prerequisites
YOU MUST HAVE GSCRIPT INSTALLED
YOU MUST HAVE BUSYBOX INSTALLED
(IF YOU ARE USING PAULS FROYO ROM FROM HERE
http://forum.xda-developers.com/showthread.php?t=686631
IT DOES NOT HAVE BUSYBOX INSTALLED
Also--
There are now 2 downloads.
One will reboot your phone automatically
One will not!
(I recommend this one for anyone that has problems, or doesn't know ADB well.)
Installation
Code:
Download the attached .zip file
Place the "buildprop" folder in the root of your sdcard
Place both "Normal_Froyo.sh" and "Modded_Froyo" files in the gscript folder on your sdcard
Code:
Open Gscript
Press menu and select Add Script
Press Load File button
Select Normal_Froyo file
Press Save button at bottom
Repeat for Modded_Froyo file
After that all you have to do is open gscript and select which one to run.
Normal_Froyo will give you stock froyo build.prop and let you see froyo only apps
Modded_Froyo will give you the market fix build.prop
You can also create shortcuts directly on your homescreen for each script if you wish
-----------------------------------------------
I've decided to skip the update.zip, I've found no way to copy the scripts to the gscript folder on the sdcard this way.
I'm going for an app instead.
P.S. I've never written an app before, java looks like russian to me lol. So if anyone has any tips, or knows any good tut's let PM me and let me know.
------------------------------------------------
fixed no buildprop folder
added NON-autoreboot download.
buildprop switcher v0.3.zip ORIGINAL
buildprop_switcher_no_rebootv0.3.zip NO REBOOT
buildprop swticher v0.3.1.zip DOWNLOAD THIS ONE
When the file is unzipped, there are 4 files - No Buildprop folder. Now I get the part about putting the two .sh files into Gscript folder.
Do I make another folder called buildprop and put build.2.1 and build.2.2 inside?
OR
Do I put build.2.1 and build.2.2 onto the root of the SDCARD?
Dayz xx
Dayzee said:
When the file is unzipped, there are 4 files - No Buildprop folder. Now I get the part about putting the two .sh files into Gscript folder.
Do I make another folder called buildprop and put build.2.1 and build.2.2 inside?
OR
Do I put build.2.1 and build.2.2 onto the root of the SDCARD?
Dayz xx
Click to expand...
Click to collapse
So sorry lol Didn't notice until I was making the update.zip that I didn't put the other files in a folder IN the zip. Just make a folder on your sdcard called buildprop. and put them in there.
BTW testing the flashable update.zip method right now
thx, seems to work
so no more *#*#etc.. afterwards?
watercool said:
thx, seems to work
so no more *#*#etc.. afterwards?
Click to expand...
Click to collapse
Right.. the checkin service runs on each reboot. So it is not needed.
Worked just fine, but I did have to do the checkin thing. Possibly had poor signal but checkin hadn't done on reboot. Worked fine after that...
Dayz xx
followinginsanity said:
Right.. the checkin service runs on each reboot. So it is not needed.
Click to expand...
Click to collapse
Can the checkin method be used, instead of rebooting? I'd much rather switch back and forth via checkin rather than having to reboot.
Thanks.
Namuna said:
Can the checkin method be used, instead of rebooting? I'd much rather switch back and forth via checkin rather than having to reboot.
Thanks.
Click to expand...
Click to collapse
The reboot is built into the script. On my phone, if I checkin, the apps still don't show till I reboot. But show if I only reboot. If checkin alone works for you though, you can remove the reboot command from the script.
I'm not sure what happened, but after following the instructions exactly, my phone crapped. It got as far as the first nexus logo (non-animated), then the buttons lit up and I got a black screen. And that's how it stayed.
Any ideas?
This worked great for me I also solved my (unrelated) prob with SlideIt by forcing the dictionary to save in the settings, so I'm no longer bothered about losing shortcuts stuff on a reboot.
Dandy!!
tested again with a second n1. works perfect! automated checkin works perfect.
Can you please post what changed in the .prop file.
Also you didn't add the video codecs in the "new" prop file
InGeNeTiCs said:
I'm not sure what happened, but after following the instructions exactly, my phone crapped. It got as far as the first nexus logo (non-animated), then the buttons lit up and I got a black screen. And that's how it stayed.
Any ideas?
Click to expand...
Click to collapse
Mine did this as well, though I am unsure why just yet. Been busy all day.
Mikey1022 said:
Can you please post what changed in the .prop file.
Also you didn't add the video codecs in the "new" prop file
Click to expand...
Click to collapse
The only thing I changed from the stock to the "modded" build.prop were these 2 lines
from this
ro.build.description=passion-user 2.2 FRF50 38042 release-keys
ro.build.fingerprint=google/passion/passion/mahimahi:2.2/FRF50/38042:user/release-keys
to this
ro.build.description=passion-user 2.1-update1 ERE27 24178 release-keys
ro.build.fingerprint=google/passion/passion/mahimahi:2.1-update1/ERE27/24178:user/release-keys
I didn't add anything else to these. If you would like other things added to the build.prop files. You are welcome to edit them yourselves, or let me know what things you want changed, and I can include them.
I can make it user friendly. With descriptions for each modded line, then you can simply un-comment the options that you want.
PS: I thought I had the flashable update ready, but the update-script is giving me problems. ANYONE that wants to help please let me know. I'd really like to get this out to everyone.
InGeNeTiCs said:
I'm not sure what happened, but after following the instructions exactly, my phone crapped. It got as far as the first nexus logo (non-animated), then the buttons lit up and I got a black screen. And that's how it stayed.
Any ideas?
Click to expand...
Click to collapse
same thing here....ANY IDEAS????????????
This is a great find, inductions were perfect and easy to follow. Not one issue getting all my paid apps back! Thank again!
JDMSirEK4 said:
same thing here....ANY IDEAS????????????
Click to expand...
Click to collapse
To anyone that can't get thier phone to boot all the way after doing this
Its not a big deal. Your phone booted. But the build.prop didn't get copied before the reboot.
If you did a nandroid before you tried it. Restore that!
If you didn't, OR you know how to use adb. Do this
Code:
adb remount
adb push [COLOR="red"]/path/to/build.2.1(or)build.2.2[/COLOR] /system/build.prop
adb reboot
I hope to have this fixed quickly.
ANYONE WHO'S PHONE WILL NOT BOOT AFTERWARDS!
Check and make sure you put the files in the right place.
build.2.2
&
build.2.1
go in
build.prop FOLDER ON YOUR SDCARD
that was the only reason I got the error, i deleted the files off my card when i was testing the flashable update.
If you still get an error. open both files in the gscript folder, and remove or comment out the reboot line. Then tell me what error you get in gscript.
So I did this and am able to see the new apps. When I reboot the phone I cannot see a bunch of old apps in my launcher. I revert to the normal script and reboot again and still cannot see a bunch of my apps. Appbrain says theyre installed and I can open them from there but no widgets or shortcuts for them Any Ideas?
r0adki111 said:
So I did this and am able to see the new apps. When I reboot the phone I cannot see a bunch of old apps in my launcher. I revert to the normal script and reboot again and still cannot see a bunch of my apps. Appbrain says theyre installed and I can open them from there but no widgets or shortcuts for them Any Ideas?
Click to expand...
Click to collapse
Are those apps moved to the SD by any chance? If so, best bet is to go to Settings>Applications>Manage Applications>Find your launcher, and force stop it. Should work after that.
dictionary said:
Are those apps moved to the SD by any chance? If so, best bet is to go to Settings>Applications>Manage Applications>Find your launcher, and force stop it. Should work after that.
Click to expand...
Click to collapse
Nope they're not on SD. I'll try the fc of launcher.
Ok it worked thank you! but my xiia widget still is not back and I'm assuming others. Anything I can do for the widgets?
Ok installed and reinstated the app. Works great thx again.
Update:
Ok after another reboot, apps don't show again. FC the launcher they come back but not the widgets.. Grrrrrr...

SystemUI.apk fix

Alright, I was trying to replace the SystemUI.apk with the new menu buttons. I renamed the old one to Systemui.apk.bak and after I did that ICS started acting up again and restarted by itself. When it turned back on, no menu bar, and the system won't let me rename it to the original or move the new one. I've tried everything I could think of, such as using adb through my pc and downloading multiple file explorer apps. Nothing works. Any help would be great cause I can't back out of an app without restarting the system.
Are you mounting the drive in R/O mode? Must be Read/Write to make changes.
Wow, I guess I should have thought of that. I got it working now. Thanks alot.

[Q] How to modify a system file?

Hi there,
I upgraded my Galaxy 551 to Gingerbread 2.3.6. All went well. Unfortunately it seems to be a common side effect that the Z and Y keys (and some others) get swapped. The fix is apparently to modify the file /system/usr/keychars/sec_keypad.kcm.bin. The ideal thing is to put the old file from before the FW update back in, but of course I don't have that anymore! But the existing one can apparently be altered. If I can copy it to the SD card I can alter it in a hex editor and put it back.
So, I rooted my phone with that one click application, and that went OK too. I installed root explorer and found the file. There were also some others in the same folder I may be able to use. But, I cant make the folder R/W (pressing the button does nothing) so cant do anything with the file. I also tried Super Manager with no luck.
I am new to the phone fiddling stuff so noob level instructions would be appreciated!
Think I have it sorted. I installed superuser and then Root Explorer allowed me to select read/write. Now to try sort out this file!
OK, seems that you need to edit the file /system/usr/keylayout/sec_keypad.kl. Did that. DO'H now my keyboard doesn't work at all! Glad it saved a backup for me! Not sure what I did wrong, only edited two characters in a text file! Even the power button doesn't work. Got to pull that battery out LOL!
It seems when the file was saved it was saved with zero size. When I try to delete it to replace it with the backup it says cant delete, read only. So, not sure how I am meant to replace this and fix this problem.
Any ideas, remembering that I cant actually use any buttons on the phone!

[Q] HELP! Messed my LWW keys..

http://forum.xda-developers.com/showthread.php?t=1535915
I tried this today, but instead of making walkman button as search button I tried to make it open POWERAMP.
But after that, I noticed that my home button stopped working
So I tried to replace the original file back, but it didn't worked
Then I tried to edit Generic.kl file, but after that now my keys doesn't work at all (including volume buttons, camera button, home button...)
I replaced all files back, made cache wipe, dalvik cache wipe, made settings reset but still nothing works.. :/
Can someone help me? (I don't want to wipe all data in my phone)
outoflock377 said:
http://forum.xda-developers.com/showthread.php?t=1535915
I tried this today, but instead of making walkman button as search button I tried to make it open POWERAMP.
But after that, I noticed that my home button stopped working
So I tried to replace the original file back, but it didn't worked
Then I tried to edit Generic.kl file, but after that now my keys doesn't work at all (including volume buttons, camera button, home button...)
I replaced all files back, made cache wipe, dalvik cache wipe, made settings reset but still nothing works.. :/
Can someone help me? (I don't want to wipe all data in my phone)
Click to expand...
Click to collapse
What ROM are you on? I doubt that simply putting Poweramp would do the trick for the Walkman button.
NOTE: On the WT19i, the only file you need to modify is pm8058-keypad.kl
1) Restore those files you modified : If you used Root Explorer to change those files, you can restore the originals simply from the .BAK files that RootExplorer creates by default. If not, simply copy those .KL files from your ROM's ZIP. (You may use some root explorer to copy the files that you modified. Make sure that permissions are properly set: rw-r--r--)
2) Goto: /system/usr/keylayout/ The only file you need to modify is pm8058-keypad.kl. Do not modify any other file. In front of key 200,(walkman key) write SEARCH. Save and exit. If you're on Cyanogenmod 7, from Cyanogenmod Settings, you can change the Search key behavior to launch a custom app(just look around the menus)
3)On CM9, this feature is not available(however you can still use predefined actions such as SEARCH or MUSIC(which will launch Apollo).

Enable EXTSD as writable on Rooted SGS4

You can fix the extsd write lock by using root explorer navigating to etc\platform\permissions.xml
You need to mount as RW and edit the file to match what I'm pasting below.
You can ignore the middle part about syscope info but change your permissions for "write_external_storage" the "access_all_external_storage" and the "write_external_storage"
Don't delete anything from the file or do this without paying attention. Do not alert the syscope permission in between the 2nd and 3rd permissions that relate to storage.
I found this method through Google but it's worked for me so fast with no problems. If you use root explorer and open the file in text editor when you save the modified file, the original file will have .bak appended to it. The guide I used only changed 2 of the 3 permissions I'm saying to edit but the sd lock fix went away after restarting but since I changed the permissions to what I changed below is been working gray even after restarting.
Remember be careful with how you edit the file, only change it in the places I showed to make sure there aren't any complications. If you type it manually make sure to match the formatting and symbols exactly. If you ate going to cut/paste make sure only to change the permissions to exactly how I show it.
I'm not responsible for any damage or issues caused by following this method incorrectly. Remember to save the file with the original name of permissions.xml and then restart the phone to check your now writable ext sd card.
Much easier to use "SDFix: KitKat Writable MicroSD":
https://play.google.com/store/apps/details?id=nextapp.sdfix
Rodger
I haven't tried that one but I've used the xposed framework app that is supposed to enable extsd write but it didn't seem to work properly for me or was at best unreliable when I tried it. I like knowing what patches or fixes are doing behind the scenes in case I need to change them or if there's a problem or an update and it stops working you can do it yourself especially when its add easy as copy and paste
rbird2 said:
Much easier to use "SDFix: KitKat Writable MicroSD":
https://play.google.com/store/apps/details?id=nextapp.sdfix
Rodger
Click to expand...
Click to collapse
This one hasn't worked for me very much on a few ROMs but I did have a little better luck using the Xposed module mentioned above.
Many thanks for the post, OP. I'll add that to my notes and try it on the next ROM that gives me write issues.
Awesome glad to be able to help. .. when I first upgrades yo NG6 I couldn't believe Google could screw up one of the best features in android phones compared to the iphone. At least we're able to workaround it in the current versions at least fornow
nj12nets said:
Awesome glad to be able to help. .. when I first upgrades yo NG6 I couldn't believe Google could screw up one of the best features in android phones compared to the iphone. At least we're able to workaround it in the current versions at least fornow
Click to expand...
Click to collapse
People wonder why Google apps which work fine are still considered "beta." It's because Google isn't done with something until they screw it up completely, preferably also changing the UI a zillion times so it's unusable on more than one level.
rbird2 said:
Much easier to use "SDFix: KitKat Writable MicroSD":
https://play.google.com/store/apps/details?id=nextapp.sdfix
Rodger
Click to expand...
Click to collapse
This one as well...
https://play.google.com/store/apps/details?id=jrummy.sdfix
Thanks for adding the app add an option but can you give an idea of how well or functions and its reliability
I just rooted my phone a few days ago. My phone decided to upgrade to NG6 by itself and it crippled the SD card almost completely. I had some work arounds, but this just made it so much harder. I downgraded to NC5, had a problem, did a full reset and redid my phone. Did Towelroot V3, SuperSU, turned SDM.apk and FWUpgrade.apk into backups. Then I did the SDFix app, rebooted and now the SD card works like it did with MK2. I'm very pleased.

Categories

Resources