How do I modify system files (so they STAY modified)? - General Questions and Answers

I think this is a universal issue that would apply to any android system. But in case it makes a difference, I've got some Samsung devices. I've got an original Tab S (10.5 inches) and a Note 4 (8 inches). The first is running Resurrection Remix (based on Nougat) and the second is running LineageOS 16.
WHAT I WANT TO DO:
I want to modify some files that live in subdirectories of sys and system. Basic text files, whether XML or anything else. I want to change the configuration settings within the files. I'm rooted and all that. I can edit the files, but after I do, the system puts them back the way they were.
I can only draw one conclusion from this: THE SYSTEM THINKS IT'S BETTER THAN ME, AND IT WANTS TO FIGHT.
I need help. How can I modify the files and have them stay modified? How do I put on my digital boxing gloves and show the system who's boss?

FailSafeNow said:
I think this is a universal issue that would apply to any android system. But in case it makes a difference, I've got some Samsung devices. I've got an original Tab S (10.5 inches) and a Note 4 (8 inches). The first is running Resurrection Remix (based on Nougat) and the second is running LineageOS 16.
WHAT I WANT TO DO:
I want to modify some files that live in subdirectories of sys and system. Basic text files, whether XML or anything else. I want to change the configuration settings within the files. I'm rooted and all that. I can edit the files, but after I do, the system puts them back the way they were.
I can only draw one conclusion from this: THE SYSTEM THINKS IT'S BETTER THAN ME, AND IT WANTS TO FIGHT.
I need help. How can I modify the files and have them stay modified? How do I put on my digital boxing gloves and show the system who's boss?
Click to expand...
Click to collapse
Well it looks like the app's data you want to modify is kept by the app itself and gets restored everytime. It's a security precautions and I don't think you can do much about it. Is it a game or something ?
But if you saw someone modify successfully the XML file without it being constantly restored I can't help you much, maybe uninstall/reinstall will do the trick but tbh it would be kinda weird.
Hope this help, good luck with your fight.

It's not an app. These are system files. They belong to the system itself.

FailSafeNow said:
It's not an app. These are system files. They belong to the system itself.
Click to expand...
Click to collapse
Can you precise the path to the file, it may come handy

FailSafeNow said:
I think this is a universal issue that would apply to any android system. But in case it makes a difference, I've got some Samsung devices. I've got an original Tab S (10.5 inches) and a Note 4 (8 inches). The first is running Resurrection Remix (based on Nougat) and the second is running LineageOS 16.
WHAT I WANT TO DO:
I want to modify some files that live in subdirectories of sys and system. Basic text files, whether XML or anything else. I want to change the configuration settings within the files. I'm rooted and all that. I can edit the files, but after I do, the system puts them back the way they were.
I can only draw one conclusion from this: THE SYSTEM THINKS IT'S BETTER THAN ME, AND IT WANTS TO FIGHT.
I need help. How can I modify the files and have them stay modified? How do I put on my digital boxing gloves and show the system who's boss?
Click to expand...
Click to collapse
Ok, you're rooted, that's only part of what you need in order to modify system files. The next step is, are you using an app that has a "root explorer" built-in and do you have your read/write permissions set to r/w? If you haven't set your read/write permissions to r/w, you won't be able make changes and have those changes persist.
Sent from my SM-S767VL using Tapatalk

Droidriven said:
Ok, you're rooted, that's only part of what you need in order to modify system files. The next step is, are you using an app that has a "root explorer" built-in and do you have your read/write permissions set to r/w? If you haven't set your read/write permissions to r/w, you won't be able make changes and have those changes persist.
Sent from my SM-S767VL using Tapatalk
Click to expand...
Click to collapse
Yes, I'm using FX, with the root explorer, and the system is mounted read-write.
Let's go with the example I'm most concerned with currently. My Note 4 has sound coming out of the wrong channels. Right and left are switched. I've tried modifying mixer_paths.xml in system/vendor/etc, which is supposed to be a way of fixing this. But the system just changes the file right back.

Edit: The permissions for the System directory are thus: All can read, but only Owner Root can write. Can I change this somehow?

Further update: I rooted my device even more than it was before. I installed the root binary for Lineage OS and set the built-in root to ADB and Apps. I used chmod from a terminal to change permissions for /system, /system/vendor, and /system/vendor/etc to 775. Those permission changes are sticking. But I can't seem to change the xml file so that it stays changed. I even used FX to modify its permission, but it just doesn't work. Nothing doing.

Related

[Q] How to copy a /data file from unrooted Nexus S [I9020XXKD1]?

Hi there,
Is there a way to temporary root my Nexus S [I9020XXKD1] or alternatively a non-root way to access /data so that I can copy a file in and out? Essentially I want to be able to backup and restore some game saves
Most posts I've read basically have folks saying "Just root it", which is good advice to most but isn't right for me - I really don't want to have to wipe my phone and I'd also like to be able to dip my toe into rooting before taking a full leap. That, and aside from needing this one file in /data my phone works exactly as I'd like it to
I only need "su" access for a brief moment to copy off a file to and from /data. I set up the android sdk but ADB didn't work because of the protection of "production builds".
VISIONary seemed like the right kind of thing, but I don't believe it works for the Nexus S or recent firmware, so while temp rooting would be nice so would any solution that allows me to backup and restore some files in /data.
At the moment I am wondering if writing an apk of my own that copies/replaces this one file is the way to go - but that seems perversely long way around!
So any help/suggestions most appreciated
There is no temporary root for the Nexus S. You're either rooted, or you're not. However, if, perchance, you are on Android 2.3.2 or earlier, you might be able to root without wiping.
Without root, you cannot see the files in /data, but you can read/write the files directly if they have the proper permissions and you know the exact path/filenames. After poking around a bit, it seems that read & write permissions vary among apps. Most apps have full permissions reserved for the parent app. Some allow other apps/user to read some files, and read+write others. (The permissions being app-specific, if it can't be done by command line, I doubt it could be done by creating an app, either.)
So, what is the game? Perhaps I can do some exploring.
If you have the old bootloader (2.3.2 i think) you can boot a recovery without flashing. From you computer use "adb boot recovery.img" and boot clockwork recovery. From there you can mount and access the filysystems.
Sent from my Nexus S using XDA App
Maximilian Mary said:
There is no temporary root for the Nexus S. You're either rooted, or you're not. However, if, perchance, you are on Android 2.3.2 or earlier, you might be able to root without wiping.
Without root, you cannot see the files in /data, but you can read/write the files directly if they have the proper permissions and you know the exact path/filenames. After poking around a bit, it seems that read & write permissions vary among apps. Most apps have full permissions reserved for the parent app. Some allow other apps/user to read some files, and read+write others. (The permissions being app-specific, if it can't be done by command line, I doubt it could be done by creating an app, either.)
So, what is the game? Perhaps I can do some exploring.
Click to expand...
Click to collapse
Thanks I figured as much. The game is Dungeon Hunter 2 and essentially I am trying to implement a simple fix to make my save game work again (the fix is here: http://forum.xda-developers.com/showthread.php?t=1042675 a few posts down) but it requires root. So I do know the exact paths and filename.
Thank you for your helpful answer
Ok, I'm not having any luck here, and it's pissing me off. FYI, I don't have that game, so I'm testing it with Angry Birds. I can read and copy the file just fine, but I can't modify it without using root. The data file itself has read/write access, but the containing folder (files/) is read-only, so I can't overwrite the file after I've modified it. Since the file itself has r/w access, I wonder if it would work to modify the file directly, instead of using an outside program to modify it then overwriting it. (I'm a bit ignorant of the finer points of linux permissions.) This would require an app that would allow you to open and modify a file by typing the full path & filename, instead of just browsing the directory tree. You could also try < adb pull /data/data/com.gameloft.android.TBFV.GloftD2HP.ML/files/dh2_000.savegame dh2_000.savegame > (using the correct path, if that's not it). Then see if < adb push dh2_000.savegame /data/data/com.gameloft.android.TBFV.GloftD2HP.ML/files/dh2_000.savegame > works. The fact that you can copy the file out is promising, anyway. So even if you had to root, you could backup the file before rooting wipes everything, then fix it & back it up after you had root.
Btw, what version of Android are you on?
Edit: I think I'm getting somewhere. While you can't modify the file itself, you can modify the file contents. So something like this might work: < adb shell >
< more /sdcard/dh2_000.savegame > /data/data/com.gameloft.android.TBFV.GloftD2HP.ML/files/dh2_000.savegame >
So the next step is to get some help from someone who has the game and is rooted as to the exact path to the savegame file. Once we have that, I think we're golden. (Or, let me know if adb pull works with the path I guessed at.)
wow! Thank you for your help
In answer to your questions: my Nexus s is running 2.3.4 and you are correct about the file path (many other kind xda users died to bring us those paths ) is /data/data/com.gameloft.android.TB with the filename being dh2_000.savegame
I don't want to drive you to distraction! If I could back it up I probably would go ahead then and root the phone given how complexplaying with a non-rooted phone is!
I will try the adb pull method and let you know how I get on.
Thank you again for your help and for showing me why I probably do want to root!

[Q] HELP - no build.prop

I just applied Daoist's CWM stock ROM update (should still be rooted, right?). It came up first time.
Then, I modded my build prop (set dpi to 120 because I like it that way). But maybe I screwed up the file name in Root explorer, because now I'm in a boot loop and if I try ADB PULL /system/build.prop it says "file not found."
I can't get SU through adb, so can't push build.prop to /system. ADB remount returns an error. permission denied. Transformer won't boot, so I can't do anything from it.
I CAN get to cwm, and have been trying to create an update.zip that will just copy build.prop to /system, but everything I have tried quits with "install aborted" message.
What can I do?
restore a nand and dont try and **** with it again, lol. no but really, restore a nand and then copy your build. prop and make a flashable zip and place on your sd card in case it happens again, so you can just flash it in cwm.
Resolved..
Well, why go back when you can go forward?
I went ahead and installed the Prime ROM. Looks like it is eating all my currently installed apps.
Y'all should know, though, that if your system can't find a build.prop it won't start. You can ADB to it and have a rudimentary set of commands, but your ability to significantly alter anything in your file system will be prohibited.
Lesson learned.
glg
as a side note most editors in android rename system files when you change them to "nameoffileyouedited".bak so if you pull and rename that file that might have fixed your problem. also try lcd dencity changer from the market. its a little less hazordous
mrevankyle said:
as a side note most editors in android rename system files when you change them to "nameoffileyouedited".bak so if you pull and rename that file that might have fixed your problem. also try lcd dencity changer from the market. its a little less hazordous
Click to expand...
Click to collapse
That is true. I had backups. But without a build.prop, the virtual machine won't start. There is no way to do a file operation to replace the backup. At least none that I found. I had to flash the whole system.
glg

[Q] Permissions - would someone explain

I'm rooted with CleanRom 2.3. Every now and then I read about modifying a system file and it always mentions "be careful and don't change permissions". How do you change permissions? What permission does a file have...are they talking about read/write ???
Would someone please tell us about permissions and how to not change them or change them, if appropriate?
Thanks!
Larry Fortune said:
I'm rooted with CleanRom 2.3. Every now and then I read about modifying a system file and it always mentions "be careful and don't change permissions". How do you change permissions? What permission does a file have...are they talking about read/write ???
Would someone please tell us about permissions and how to not change them or change them, if appropriate?
Thanks!
Click to expand...
Click to collapse
I don't think you have to worry too much about permission. If you rooted you do have the admin power to do anything to the Operating system. Usually people are using "root explorer" for "ES file explore" or what ever (they all available from the market) to view system files and you do have option to change permission of a file like read,write, execute etc... Just don't change them, unless you are using third party scripts or files to replace the original system files. In this case just make a backup of the original then replace the file and set the permission same as the original. Too much permission is not going to hurt the application but not enough permission will causes the app not to work anymore. To much permission usuallly introducing security risk, like the app could actually get your phone/personal information and send them to the third party. In short, if you don't know what you are doing, just stay away from permission. If you decided to mod your phone and involving in changing permission, make sure you understand. read carefully and ask for help before doing so.
Larry Fortune said:
I'm rooted with CleanRom 2.3. Every now and then I read about modifying a system file and it always mentions "be careful and don't change permissions". How do you change permissions? What permission does a file have...are they talking about read/write ???
Would someone please tell us about permissions and how to not change them or change them, if appropriate?
Thanks!
Click to expand...
Click to collapse
I'd recommend using Root Explorer or ES File Explorer to fix those 'permission' messages.
You'll be able to edit everything you want, without the hassle of changing the permissions to edit/mod stuff.
Eg. Changing DPI can be a mess, but using Root Explorer it only takes a minute of your time and you don't need some stupid app to do it for you, which always makes you feel like you know what you're doing, (while - in my case - some do not, but it just looks cool )

[Q] Renaming apks - not holding new name?!

Hey guys,
I still rename my bloat, I know, you probably see this as lame, but maybe someone has the answer anyway.
In system/app, the Motorola Migrate apk (fswriter.apk) can be renamed using root and Root Explorer, but after a minute or so, or a reboot, the apk returns to the original name (I usually add .old to the end). Just about all of the other apks I rename in that folder retain .old in the name even after a reboot. The entire contents of system/vendor/app does this. I can rename the apks, refresh and see they are still renamed, and then a minute later, or a reboot later, they drop the .old or .delete extension.
For now, I disabled the ones that appear in the app drawer, but maybe someone who is curious enough knows the answer.
Thanks,
Jason
JaBr1884 said:
Hey guys,
I still rename my bloat, I know, you probably see this as lame, but maybe someone has the answer anyway.
In system/app, the Motorola Migrate apk (fswriter.apk) can be renamed using root and Root Explorer, but after a minute or so, or a reboot, the apk returns to the original name (I usually add .old to the end). Just about all of the other apks I rename in that folder retain .old in the name even after a reboot. The entire contents of system/vendor/app does this. I can rename the apks, refresh and see they are still renamed, and then a minute later, or a reboot later, they drop the .old or .delete extension.
For now, I disabled the ones that appear in the app drawer, but maybe someone who is curious enough knows the answer.
Thanks,
Jason
Click to expand...
Click to collapse
are you rebooting into R/W mode aka recovery mode? For this line of Droids, after rooting, in order for you remove or change anything within the system you need to reboot into "recovery" and i use the quotations is because in all androids in the past (at least the ones i have had) recovery is TWRP or CWM but with our phones recovery is the OS but the OS is R/W...so make sure you are rooted and then you can either use an app like Rom Toolbox for example, use the rebooter option within and in that menu select Reboot Recovery, it'll reboot into the OS but rewritable once you are booted that way you can add and remove system apps as well as make any name changes to the system files and whatnot...hope this helps
Holo reboot in play store works great for rebooting into recovery or just a normal reboot!
Sent from my XT1080 using xda app-developers app

[solved] crashing accessibility app

To the Admins, I'm not entirely sure where you guys would want this thread...troubleshooting seemed to be the most sensible.
all right everyone, I'll explain here how I fixed this, but keep in mind I have the ATT LG G2 running KitKat with TWRP 2.7.0.0 and I'm rooted. I only recommend this for advanced users. If you aren't an advanced user, well, make sure you have a backup. I'm sure there was a faster way to fix this, but my goal wasn't to find the fastest way initially, it was to find a working way. For example, you could just ADB everything. You could also, assuming you know how to use your OS to search that deep into the device files, done a rename, copy/paste etc. etc. Not all devices are made equal, so be CAREFUL! BTW, I was in debugging mode + charge only.
WARNING: I AM ONLY OFFERING THIS FOR INSIGHT TO ADVANCED USERS THAT KNOW WHAT THEY ARE DOING - I DON'T OFFICIALLY RECOMMEND THAT ANYONE DO THIS. I AM NOT RESPONSIBLE FOR ANY TRANSMUTATION FROM LG G2 TO BRICK.
Here's what I did:
1) I opened accessibility while hooked up to the debugger in Android Studio to see that it was producing a Null Pointer Exception.
2) I have a slightly modified version of the TOT file so that I can run TWRP and still be rooted in KitKat.
3) I am rooted, so I used Root Explorer to search for accessibility and found that the file is called "LGSettingsAccessibility.apk" and .odex - it's under (WITH ROOT ONLY) /system/priv-app/
4) I searched for a system dump copy online...I found this site: http://hunterspad.com/Domains/StorageCow/Xda/Users/garyd9/Extracted System/priv-app/
I found that by typing "LGSettingsAccessibility.apk" and initially found a Google Drive version but it was posted in September of 2013 - unlikely to be the odex and apk from KitKat hahaha. I used a Google Search that searched custom range between Feb 1st and today. I found 2 links, one of which is the above.
NOTE: I don't recommend anyone do the following unless you KNOW what you are doing and definitely have a backup to restore to if things go wrong
5) I sent the link for each file to myself on Google Hangouts. I used Hangouts to download the March 14th upload of the LGAccessibilitySettings.apk and LGAcessibility.odex
5.5) I copied each of the original files (.apk and .odex) from /system/priv-app/ to my /sdcard/LGBackup folder I created using the Root Explorer app.
6) I went into the app "Root Explorer" again after downloading both files (DID NOT INSTALL IT, though it probably won't let you anyway). I checked both files and copied them.
7) I went back to /system/priv-app/ and renamed the existing files to be replaced with the extension ".bak" so that the system no longer points to those files (NOTE: Root Explorer asked me to remount as R/W (read and write vs. read-only) a good feature of root explorer to be in read-only by default; dangerous territory.
8) Bottom right corner of Root Explorer it was waiting for me to "Copy Here" when arriving at the location where I wanted to copy the files: /system/priv-app/ and after copying them I decided to be a fool and install the apk and it told me something like "app not found" or something.
9) FINALLY went into Settings and touched Accessibility and VOILA! It worked! A lot of luck involved - the odexed and apk files may not have been the proper version. I could have checked with relative ease (though likely time-consuming) by using some of my android dev skills/utilities.
WARNING: I AM ONLY RECOMMENDING THIS FOR ADVANCED USERS THAT KNOW WHAT THEY ARE DOING.
Thanks to garyd9 on XDA - without your uploaded files on storage cow, I couldn't have fixed this problem!

Categories

Resources