Is there any way to root a device in a way that the user only has write permissions on a few files, while all other files in the system folder would still be protected? Specifically, I ONLY want to access build.prop. Alternatively, is there a way to change the contents of a system file without rooting at all? Kind of like flashing a zip but without booting into recovery?
Nope. Just temp root instead of perma root if thats the case.
Related
This is not a question about how to root the Atrix. I've already done that.
My question is about what actually is changed in the phone by following the root procedure. (I searched the forum but didn't find elsewhere the answers I look for).
Why do I ask?
1) Because I'd like to have a better understanding of the android OS.
2) Because I'd like to understand and know what do I need to do in case I want to unroot and return to plain stock.
My case:
(I've just rooted my Atrix. I didn't unlock it)
I've followed the "manual" procedure proposed by BriefMobile.
I can essentially understand (more or less) the commands listed (mount, remount, cp, install, chmod 6755, flash...)
What I'd like to understand better is what changes does the command
Code:
fastboot flash preinstall root.img
Does it just copy new files? Or does it copy (and replace) files on the phone?
(In the second case I'm afraid I made a mistake in not backing them up before running that command...)
Thanks in advance for your help.
Putting it in Windows terms (because Android is Linux), root is like having administrator privileges on your computer. It allows you to modify any system files that would normally be kept locked down. It also allows you to run applications, such as SetCPU, which can directly control hardware (in this case CPU frequency/speed and voltage) and low-level system files. Root in Android is comprised of two main files: the "su" binary (which is the command that applications use to invoke a request to do something with root privileges) and the SuperUser.apk (SuperUser app that's in the app drawer). The SuperUser app exists to prompt you whenever an application asks for root permission. So if you go into the terminal and type a low-level command, you'll see something like, "You do not have permission to do this". But if you type "su" before the command, it will run if you hit "Allow" on the SuperUser request.
Get it?
Product F(RED) said:
....
Get it?
Click to expand...
Click to collapse
Thanks Product F(RED) .
Yes I got it.
I already knew what rooting means in general terms.
What I really asked (sorry if I wasn't clear enough) is what does the root "physically" change on the phone.
According to your answer I assume it just adds the "su" binary and the "SuperUser" app (apart from changing some permission on some system folders) and that it doesn't replace any "stock" system file.
I also assume that these new files are extracted from the "root.img" (or "preinstall.img") files flashed by the fastboot command.
Is it so?
I was a little confused because I saw in some other forum a reference to some "stock" files wiped out in the /preinstall/app/ folder by the root process, mining the reversibility of the procedure (in case of no previous full system backup).
sphere314 said:
Thanks Product F(RED) .
Yes I got it.
I already knew what rooting means in general terms.
What I really asked (sorry if I wasn't clear enough) is what does the root "physically" change on the phone.
According to your answer I assume it just adds the "su" binary and the "SuperUser" app (apart from changing some permission on some system folders) and that it doesn't replace any "stock" system file.
I also assume that these new files are extracted from the "root.img" (or "preinstall.img") files flashed by the fastboot command.
Is it so?
I was a little confused because I saw in some other forum a reference to some "stock" files wiped out in the /preinstall/app/ folder by the root process.
Click to expand...
Click to collapse
Pretty much, yes, you're adding those two files (as well as another called BusyBox that allows other files to run, but this you can install after you root). The scenario I'm describing is that you're on a stock ROM and you just rooted your phone for the first time.
Though fastboot is present on every phone, using it to flash those two files seems to be unique to your phone because rooting methods vary from phone to phone. But basically the two most common methods are:
1. You flash a custom recovery from your computer if your phone's bootloader is not locked, and then you can flash the root files (su/SuperUser.apk) to the ROM from there or just flash a custom ROM that includes them.
or
2. You use fastboot/adb/some third-party method to root the stock ROM on your phone from your computer, then you install a custom recovery, and then you can flash custom ROMs/kernels/etc.
That /preinstall/app folder seems to be unique to your phone, but if I had to guess, it has something to do with deleting preloaded bloatware that comes with the phone. Because out of the box you can't, but once you have root permissions, you can go to that folder with a file manager to delete the APKs or use something like Titanium Backup to do it.
Product F(RED) said:
Pretty much, yes, you're adding those two files (as well as another called BusyBox that allows other files to run, but this you can install after you root). The scenario I'm describing is that you're on a stock ROM and you just rooted your phone for the first time.
Though fastboot is present on every phone, using it to flash those two files seems to be unique to your phone because rooting methods vary from phone to phone. But basically the two most common methods are:
1. You flash a custom recovery from your computer if your phone's bootloader is not locked, and then you can flash the root files (su/SuperUser.apk) to the ROM from there or just flash a custom ROM that includes them.
or
2. You use fastboot/adb/some third-party method to root the stock ROM on your phone from your computer, then you install a custom recovery, and then you can flash custom ROMs/kernels/etc.
That /preinstall/app folder seems to be unique to your phone, but if I had to guess, it has something to do with deleting preloaded bloatware that comes with the phone. Because out of the box you can't, but once you have root permissions, you can go to that folder with a file manager to delete the APKs or use something like Titanium Backup to do it.
Click to expand...
Click to collapse
Thanks again Product F(RED).
Things are clearer now.
I wasn't aware of the installation of "BusyBox" (I found it in my phone in the folder /osh/bin/)
I think the root method I used (BriefMobile) is the type 2. I didn't install a custom recovery as I'm not interested yet in flashing custom ROMs/kernels/etc.
So, to summarize...
The basic root methods (no unlock) consists in
1) install the "su" binary
2) install the "busybox" binary
3) install the "superuser.apk" app
4) change some r-w permissions
In my case (probably) the root method also wiped out some preloaded bloatware file in the /preinstall/app folder but that's not essential (unless Moto makes a check for the presence of those files before an OTA update).
They usually do check (and will fail) because OTA's are like patches; not really replacements for the whole /system/ partition. Never take an OTA when you're rooted, especially because they can do things like update and lock your bootloader, among other things. It's safer to wait until rooted versions pop up in the development section for your phone.
I recently rooted my Gnex Toro build IMM76K using the wugfresh root toolkit and before rooting I took a backup of a few directories in the sdcard directory then restored them after finishing the root. It appears now that those directories that were restored do not have root access as I cannot move or delete any of the content via ES Explorer with root access, Error: File xx.mp3 cannot be deleted!. I've tried the built-in file permissions tool but am not getting anywhere. I haven't flashed a ROM. SuperUser comes via the root process so I did not think it would be wise to try to reinstall that.
Is there a way for me to fix these directories without having to unroot and re-root my phone?
Hi, I have a rooted Lenovo B device (Mediatek M6735M) with TWRP recovery. I tried to change some build.prop values using an editor app but the result was I bricked my phone (and had to flash stock firmware again). Now, I wonder if and how I can apply some changes to the system files after flashing the firmware.
I want to ask you: is it possible to modify sys/system files after the firmware has been flashed (even the read-only ones), or is pre-flash manipulation the only solution? For example: is it safe to pull a system file with adb, modify it, then push it to the phone with adb?
Black Heretic said:
Hi, I have a rooted Lenovo B device (Mediatek M6735M) with TWRP recovery. I tried to change some build.prop values using an editor app but the result was I bricked my phone (and had to flash stock firmware again). Now, I wonder if and how I can apply some changes to the system files after flashing the firmware.
I want to ask you: is it possible to modify sys/system files after the firmware has been flashed (even the read-only ones), or is pre-flash manipulation the only solution? For example: is it safe to pull a system file with adb, modify it, then push it to the phone with adb?
Click to expand...
Click to collapse
No. You want to root your android again to do these.
Ashwinrg said:
No. You want to root your android again to do these.
Click to expand...
Click to collapse
I forgot to say that I rooted the phone again. I'd like to know if it is possible to edit system files after flashing a firmware (and rooting the phone) or if I'm forced to apply all system changes before flashing. Also, I'd like to know what kind of changes are allowed and/or forbidden (in order to avoid another brick).
For example, I found a read-only "serialno" file in "sys" folder and this file contains the serial number of the device. Could I pull this file with adb, change the content of this file (with another serial number) then push it into the phone?
Black Heretic said:
I forgot to say that I rooted the phone again. I'd like to know if it is possible to edit system files after flashing a firmware (and rooting the phone) or if I'm forced to apply all system changes before flashing. Also, I'd like to know what kind of changes are allowed and/or forbidden (in order to avoid another brick).
For example, I found a read-only "serialno" file in "sys" folder and this file contains the serial number of the device. Could I pull this file with adb, change this file (with another serial number) then push it into the phone?
Click to expand...
Click to collapse
You can change anything after rooting your phone. Make sure you are doing it correctly. Keep nandroid backup to recover from bad scenarios.
Ashwinrg said:
You can change anything after rooting your phone. Make sure you are doing it correctly. Keep nandroid backup to recover from bad scenarios.
Click to expand...
Click to collapse
Ok, but I'd like to have some general tips or advices before doing that. For example, I read (somewhere, here on xda) that file permissions have to be the same as the original file, so if I edit a read-only file I have to restore its read-only status or I could brick the phone. Is this true?
Black Heretic said:
Ok, but I'd like to have some general tips or advices before doing that. For example, I read (somewhere, here on xda) that file permissions have to be the same as the original file, so if I edit a read-only file I have to restore its read-only status or I could brick the phone. Is this true?
Click to expand...
Click to collapse
Yes. If you change permission to read-write then after modification you want change permission to read-only.
Grab ithat build.prop file and transfer to memory card using TWRP. Edit at PC and restore it
Hello,
is there any way to root a Moto G5 without a factory reset or deleting the data partition ?
I need access to the encryption key in folder /data/misc/vold in order to recover data from a sd card which isn't being recognized by the phone.
This file is only accessible as root. For this reason I have to root the phone. Is there any way to achieve this ?
All help is appreciated.
Regards,
Holger
Holger1970 said:
Hello,
is there any way to root a Moto G5 without a factory reset or deleting the data partition ?
I need access to the encryption key in folder /data/misc/vold in order to recover data from a sd card which isn't being recognized by the phone.
This file is only accessible as root. For this reason I have to root the phone. Is there any way to achieve this ?
All help is appreciated.
Regards,
Holger
Click to expand...
Click to collapse
Hello , to recover the encryption key , you don't need root access. Because root access allows you to write system file , but without root you can always read the file (you have the read only permission). So you can copy it .
To do this download Root Browser and browse to your file , then long press it , copy it and paste it into the download folder for example.
You can download every root file manager app
Here is the link :
https://play.google.com/store/apps/details?id=com.jrummy.root.browserfree
No other ideas anyone?
Is it possible to edit file permissions of voltage_max file located in sys/class/power_supply/battery via TWRP? In TWRP's File Manager I can only get to battery and no further. It's seemingly shown as a file instead of a folder.
And more importantly if its possible will the tweaked file permissions stick after booting into the ROM? I know with root access it's easy just wanted to know if via recovery it can be accomplished w/o root or not?
Thanks.
Bump.
Anyone?