Hey, I installed a new treble gsi today and wanted to edit the keylayout on my device (S8). I went to system/usr/keylayout and edited the generic.kl file. I then saved and exited. Then I set 755 permissions for the file and rebooted. This is what I've done multiple times before with the same file explorer and it always worked.
This time, after the reboot, everything was reset to how it was before I made any edits. The permissions are not the ones that I set, but that had been there before. The generic.kl file itself doesn't contain my edits anymore as well. I can even delete all the files in system/usr/keylayout and they still show up after a reboot.
Now the question is what is overwriting my edits and/or how can I find out what's causing this behaviour? I asked the devs and other people that have installed the gsi before, but nobody seemed to know.
Me too i have the same problem
Related
Hello all,
I have written a script to push as file to my TB and it works kind of...I just want to know why it is not functioning as it should.
Here is what I am attempting to do.
Since my HTC weather does not have my city listed and my weather is always way off, I hacked the HTC weather database to add my city. And it works great.
So I wanted to create a weather_update.zip to install using CWM to do all of this for me if I changed roms and to allow others to use it as well.
the file goes into the /data/data/com.htc.provider.weather/files directory.
My script mounts data, pushes the file, changes the appropriate permissions, then unmounts.
It works as intended because I can see the file using adb prior to reboot.
However, after a reboot, the file is overwritten by the original. I can even delete the file completely, reboot and it is rebuilt. So my modified file does not stick.
BUT, if I use root explorer and copy the file to the correct directory and change permissions, my modified file works even after a reboot.
I don't understand why it works one way but not another.
Is there a step I am missing in the updater-script?
Any help would be appreciated....
Thanks,
Scott
UPEngineer said:
Hello all,
I have written a script to push as file to my TB and it works kind of...I just want to know why it is not functioning as it should.
Here is what I am attempting to do.
Since my HTC weather does not have my city listed and my weather is always way off, I hacked the HTC weather database to add my city. And it works great.
So I wanted to create a weather_update.zip to install using CWM to do all of this for me if I changed roms and to allow others to use it as well.
the file goes into the /data/data/com.htc.provider.weather/files directory.
My script mounts data, pushes the file, changes the appropriate permissions, then unmounts.
It works as intended because I can see the file using adb prior to reboot.
However, after a reboot, the file is overwritten by the original. I can even delete the file completely, reboot and it is rebuilt. So my modified file does not stick.
BUT, if I use root explorer and copy the file to the correct directory and change permissions, my modified file works even after a reboot.
I don't understand why it works one way but not another.
Is there a step I am missing in the updater-script?
Any help would be appreciated....
Thanks,
Scott
Click to expand...
Click to collapse
I could be way off base here but wouldn't you have to recursively delete the original to keep it from rebuilding?
dbu said:
I could be way off base here but wouldn't you have to recursively delete the original to keep it from rebuilding?
Click to expand...
Click to collapse
LOL, what I was thinking too, but it doesn't seem to work, unless I am doing it wrong.
If I replace the file and reboot, the original rebuilds.
If I delete the file completely and reboot, the original rebuilds.
If I replace the file using root explorer after phone has booted and then reboot, my modified file sticks.
That is what I can't figure out. Why it sticks after OS has loaded but rebuilds if the same file is placed before reboot.
And I can't figure out where the file is being rebuilt from.
Uggggg.
I am trying to sync a rostering app between two devices using dropsync.
The .db files that need syncing are in the /data/data/com.blah.blah/databases directory. Using Root explorer I can change the permissions to give full rw permission to others. The two .db files will then upload to the dropsync server.
The problem is that whenever the app is opened and anything modified, the permissions change back to default and thus dropsync can't access the modified .db
Is there anyway to change this or am I wasting my time? what is the 'sticky' box option in RE?
I'm not sure precisely what "sticky" means, but it's not what you want--it doesn't involve persistence or "sticking".
You could try to make the files not owned by the app but set it so the group is the app. Make sure the group can read/write/execute, or whatever it needs. This way, the app can still use the file but won't be able to change its permissions.
Of course, it could see that it doesn't own the file and refuse to run. I'm not sure what sort of checks the program's authors implemented. This also won't work if the file is deleted and created anew--the new file would be owned by the app.
Yeah thanks for that,
I tried the ownership and group swap earlier, and am pretty sure the app re- writes the db.
Don't think is going to work.
cheers
Well its obvious that the app, when opened sets the permissions to the .db files so that they wont be usable by others. The way you describe the problem is more likely to be a file owner problem and not with the permissions. Try to set the app and the files to the same owner and see if that works. You could always make a script that would change the permissions/ownership of the file.
FYI,
The sticky bit is a special part of the permissions mask for a file or directory. When set on a directory, it tells the system to prevent anyone but a containing file's owner from deleting files in that directory. This is handy if you have a directory that's being used by multiple users on a system as scratch space as it prevents people from wiping out others' files.
For files....the behavior isn't defined.
Hope this helps,
- chris
I have rooted my HTC One aka M7 and all is well except when I try to edit my keyboard layout which is located in:
/system/usr/keylayout
I can edit the file but when rebooting to test it, my changes have reverted back to stock.
I am familiar with editing the files as I have done this before on many phones and tablets.
I usually just use ES File Explorer with R/W (Read / Write) permissions turned on for the /system directory.
Very easy to do and have never had a problem before.
As a test, I have tried renaming the original file by adding a number 1 to the end of the file and then replacing the stock file with my edited version.
This has always worked but when I try this on the HTC One upon reboot the original file that has been renamed with a 1 at the end is now gone from the /system/usr/keylayout folder and the stock file is back and the edited version of the file is gone.
I know 'file permissions' are correct as I have set the file to what it was before any changes and I know I have R/W permisions for the /system folder set correctly because without it I can not even rename the stock file (adding the 1 on to the end of the file's name is not allowed unless R/W is set for the /system folder).
It is almost like there is a backup that is being replaced upon reboot to the /system/usr/keylayout folder.
If there is a backup, I can not find where the backup file is to edit/change it also.
I am trying to change the AVRCP.kl file but it its the same no matter which file I edit or rename, it always reverts back to stock file (both the name and the contents) after a reboot.
Anyone have any ideas? Anyone edited there keylayout on the HTC One aka M7 yet?
Thanks
Come on people, no one can answer this question?
I have the exact same problem except I have an M8. Something somewhere keeps reverting the kl file/folder on reboot.
I have a rooted Galaxy M Style phone with stock Gingerbread 2.3.4 firmware. I am trying to customize my stock camera app, but am not sure what I'm doing wrong. I plan to replace the autofocus_ok.ogg with a different tune from my phone. I checked the properties of the autofocus_ok.ogg and saw it's a mono, 44100hz, and 96 bitrate file. The tune that I have has the same properties. So this is what I have done so far:
I backed up camera.apk to /system/app/camera.apk.bak and the camera.odex to /system/app/camera.odex.bak. I left a copy of camera.odex in /system/data. I copied the camera.apk to my memory card and placed the file on my computer. I renamed the file to a .rar. I then deleted the autofocus_ok.ogg and placed the tune that I wanted in that directory. Then I renamed it to autofocus_ok.ogg. I renamed the file back to .apk and transferred the file back to the memory card, then over to /system/app. The camera app will not install/not showing up on my phone. I am transferring the files through root explorer on my phone.
I worked with the original apk file again with apktool. I was able to decompile and replaced and renamed the files that I needed again. I compiled the file and transferred the file to /system/app again, but the apk will still not install. I checked the complied apk file and noticed that the file didn't have the META-INF folder, so I copied that over to. Tried to install it again by copying the file to /system/app, but it still won't show up on my phone. Is there anyway for me to change the autofocus_ok.ogg without a custom rom?
Thanks.
ImAhNoBoDy said:
I have a rooted Galaxy M Style phone with stock Gingerbread 2.3.4 firmware. I am trying to customize my stock camera app, but am not sure what I'm doing wrong. I plan to replace the autofocus_ok.ogg with a different tune from my phone. I checked the properties of the autofocus_ok.ogg and saw it's a mono, 44100hz, and 96 bitrate file. The tune that I have has the same properties. So this is what I have done so far:
I backed up camera.apk to /system/app/camera.apk.bak and the camera.odex to /system/app/camera.odex.bak. I left a copy of camera.odex in /system/data. I copied the camera.apk to my memory card and placed the file on my computer. I renamed the file to a .rar. I then deleted the autofocus_ok.ogg and placed the tune that I wanted in that directory. Then I renamed it to autofocus_ok.ogg. I renamed the file back to .apk and transferred the file back to the memory card, then over to /system/app. The camera app will not install/not showing up on my phone. I am transferring the files through root explorer on my phone.
I worked with the original apk file again with apktool. I was able to decompile and replaced and renamed the files that I needed again. I compiled the file and transferred the file to /system/app again, but the apk will still not install. I checked the complied apk file and noticed that the file didn't have the META-INF folder, so I copied that over to. Tried to install it again by copying the file to /system/app, but it still won't show up on my phone. Is there anyway for me to change the autofocus_ok.ogg without a custom rom?
Thanks.
Click to expand...
Click to collapse
erm... is the permissions set correctly rw-r--r-- ?
MoonBlade said:
erm... is the permissions set correctly rw-r--r-- ?
Click to expand...
Click to collapse
Yup, permissions were set correctly like rw-r--r--. Owner is root:root. Those are the permission that I set on the apk file like they were on the original file. I just realized that the compiled apk's from apktools doesn't show up on my phone. The apk that I created by opening up winrar and just replacing the .ogg files do show up, but I get the error "The application Camera (process com.sec.android.app.camera) has stopped unexpectedly. Please try again."
Anything else I can try or a thread to refer to?
ImAhNoBoDy said:
Yup, permissions were set correctly like rw-r--r--. Owner is root:root. Those are the permission that I set on the apk file like they were on the original file. I just realized that the compiled apk's from apktools doesn't show up on my phone. The apk that I created by opening up winrar and just replacing the .ogg files do show up, but I get the error "The application Camera (process com.sec.android.app.camera) has stopped unexpectedly. Please try again."
Anything else I can try or a thread to refer to?
Click to expand...
Click to collapse
why dont you try to push the modified apk manually using root explorer or so instead of pushing via adb ..
after decompiling apk and modifying it, compile it into some folder and then copy it into you sd card then use root explorer and manually push(copy) the apk into system/app .. give proper permissions and then reboot your phone..
Here are some guides to use apktool
http://forum.xda-developers.com/showthread.php?t=1891686
http://forum.xda-developers.com/showthread.php?t=1989533
MoonBlade said:
why dont you try to push the modified apk manually using root explorer or so instead of pushing via adb ..
after decompiling apk and modifying it, compile it into some folder and then copy it into you sd card then use root explorer and manually push(copy) the apk into system/app .. give proper permissions and then reboot your phone..
Here are some guides to use apktool
http://forum.xda-developers.com/showthread.php?t=1891686
http://forum.xda-developers.com/showthread.php?t=1989533
Click to expand...
Click to collapse
I have been pushing the modified apk through root explorer all this time. I don't even have adb install, haha. The procedure you explained have been the way I have been doing it the whole time, lol. I read the threads you posted and the procedure is the same as I've been doing it, except for the second thread. I can't grab the apktool from 4shared because I don't have an account. I am using the latest apktool 1.5.2. Also, I didn't understand what PulseDroid was talking when he said "We are NOT done just yet, we cannot use the new apk's... we have to take what we did and add it back to the original apk file to keep proper signature use something like 7zip, take the 'resources.arcs' file and any other xml files you edited out of the "-new" apk and copy them into Original apk". So I'm suppose to replace the resources.arcs and the .ogg files that I created from the new apk to the old apk? I didn't mess with any xml file.
Anyways, is there anything else I can try?
EDIT: ........I feel so embarrassed. I checked out this thread http://forum.xda-developers.com/showthread.php?t=2378177 and saw this post "Drag your replacement files into WinRAR and (here's the important part) in the Compression Method drop-down choose "Store"." All this time I have been compressing the file as "Normal" in Winrar, instead of "Store".
All in all, I did not need apktool at all. I used the original apk and opened it up in Winrar. I deleted the files that I wanted to replaced and put in the files that I wanted. Each time I put something in the file in Winrar I get a prompt for compression and instead of "Normal" compression just use "Store". It was that simple.
This helped me, thank you!
So I've got a problem and hopefully it's not something stupid that I've done. I got my 6p yesterday and immediately did a nandroid backup and flashed Pure Nexus (and SuperSU 2.67). For some reason I'm totally unable to download, delete, etc, a lot of the files on/to internal memory. If I try to delete a file from the root of /sdcard/ it works, but if I try to delete something in /sdcard/Download/ it doesn't work. I checked permissions for files within /sdcard/Download/ and the permissions are rw-rw----. If I go into Root Explorer and try to add Execute permissions it tells me the change was not successful. Any ideas?
Ok so I figured it out. When I got my new phone I copied files from my old phone to my computer, then copied them back to my new phone. I swear I've done that before without issue but apparently this time it messed up permissions big time. I was able to rename the folders via PC and create new folders via Solid Explorer, but still couldn't move/delete the files. I ended up booting to TWRP and was able to delete the folders using the file explorer there.