I Can't Get Root Back - General Questions and Answers

I have a Motorola Edge (regular not +) running LineageOS 17.1 (20210528). I had it rooted and decided I wanted to use the hosts file for ad blocking. I couldn't figure out how to get the OS to allow me to modify the host file. While I was doing so, I some how corrupted to OS and couldn't boot into it. That was easily fixed by flashing the the OS, but now I can't get root back. When I reboot after I flash the patched boot.img (to both partitions), I get "Can't load Android system. Your data maybe corrupt..." (This happens when I try to boot into both partitions). Before I see the error message, it goes into a bootloop.
I'd also like to know how to modify the hosts file.
Thanks

Heat84 said:
I'd also like to know how to modify the hosts file.
Click to expand...
Click to collapse
Once phone is rooted
1. You mount Android's directory /system/etc as RW
2. Pull out the hosts file what is located therein to PC
3. Edit the hosts file according to your needs
4. Make sure hosts file gets saved in UNIX-file format
5. Push back the hosts file to Android's /system/etc directory
6. Make hosts file RW

Thanks. Any clue about the rooting problem?

I forgot to mention that I patched boot.img with Magisk.

TWRP has a file system repair function. Does that have anything to do with this?

Related

[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

I'm rooted, trying to install Xposed Framework, how do I delete a file from /system/?

I tried installing it with both Flashify and Magisk, but both methods failed.
When I tried installing it via the included Xposed Installer, it also failed, but gave me the message:
> Error: Xposed_Framework.jar already exists in /system/framework
I'm guessing a previous installation failed, but left the file there.
My next idea is to delete that file from /system/framework and try again, but since it's in an RO directory I don't have permission.
I tried using a terminal emulator to mount the drive in rw mode, and also tried using a root file explorer, but either both methods don't work, or I just couldn't figure it out.
Anyone have an idea of how to remove or rename that file so I can try to install the .zip ?
-Thanks
Highfiverobot said:
I tried installing it with both Flashify and Magisk, but both methods failed.
When I tried installing it via the included Xposed Installer, it also failed, but gave me the message:
> Error: Xposed_Framework.jar already exists in /system/framework
I'm guessing a previous installation failed, but left the file there.
My next idea is to delete that file from /system/framework and try again, but since it's in an RO directory I don't have permission.
I tried using a terminal emulator to mount the drive in rw mode, and also tried using a root file explorer, but either both methods don't work, or I just couldn't figure it out.
Anyone have an idea of how to remove or rename that file so I can try to install the .zip ?
-Thanks
Click to expand...
Click to collapse
In the Xposed app you should be able to just run the uninstaller script. If that doesn't work, boot TRWP and delete it from there.
D3RP_ said:
In the Xposed app you should be able to just run the uninstaller script. If that doesn't work, boot TRWP and delete it from there.
Click to expand...
Click to collapse
Unfortunately, the uninstaller also fails.
It says it can't remove that file from a read only directory..
Highfiverobot said:
Unfortunately, the uninstaller also fails.
It says it can't remove that file from a read only directory..
Click to expand...
Click to collapse
flash installer or uninstaller through TWRP
wmcdrugs said:
flash installer or uninstaller through TWRP
Click to expand...
Click to collapse
Root Explorer....
This app does wonders, it allows you to modify directories in /system and other root folders. You can even change permissions of specific folders/files from read/write/read-only....etc. I've had this app since the earliest of android days and it has been my go to file explorer. Root Explorer of course requires root....but it completely unlocks your phone and allows you to modify any system file that is set to any permission. Of course there are other file explorers that allow you to modify system files, but this is the one that i have the most experience with. You should be able to access the system folder where the Xposed file remains and modify it so it can fix your problem.
djer34 said:
Root Explorer....
This app does wonders, it allows you to modify directories in /system and other root folders. You can even change permissions of specific folders/files from read/write/read-only....etc. I've had this app since the earliest of android days and it has been my go to file explorer. Root Explorer of course requires root....but it completely unlocks your phone and allows you to modify and system file that is set to any permission. Of course there are other file explorers that allow you to modify system files, but this is the one that i have the most experience with. You should be able to access the system folder where the Xposed file remains and modify it so it can fix your problem.
Click to expand...
Click to collapse
This!. I've used it for years. Not muss no fuss. It's not bloated like a certain couple others I know of. It just does what it does and does it well. Manages files. No extra garbage.Give it a try. I'd be surprised if you can't delete it with Root Explorer. If you do try it, go to the folder you want to delete the file from. Once in there, look at the top right of the screen. Somewhere up there It will say MOUNT R/W. Touch that and you should be able to do whatever you want to within that folder.
Do you have the magisk DNSCrypt module installed? If so, thats why you cant modify anything in /system. Not sure why or how it breaks it, but it does. Took me for ever to figure out what was causing it. Now that i removed the module, i can modify anything i want again.
Sent from my [device_name] using XDA-Developers Legacy app

No longer able to copy files to /System

Recently had some issues with my device that caused me to to come back from a soft brick. Since then I have not been able to copy or replace files in the /System directory.
Items that have been tried and do not result in access:
Re-flash ROM (RR)
Taken back to stock image and then Re-flashed ROM (RR)
Flashed a new version of Magisk
Tried mounting the /system and making rw
Used RootExplorer and ES to change permissions to rw (chmod 777)
With all these, I try and overwrite files in system and they fail. Items with non conflicting names will appeared moved, but upon reboot all files are missing.
Ultimately what I am trying to do is move additional .ogg files into the media folder within system.
Any and all help appreciated.
Edit: Finally was able to mount /system and replace/add files after fully uninstalling Magisk and then flashing Magisk-v16.1(1610).zip
If I understand correctly, you can't modify /System with Magisk. With SuperSU, you can.
shopealope said:
If I understand correctly, you can't modify /System with Magisk. With SuperSU, you can.
Click to expand...
Click to collapse
yes you can modify /system with magisk. I do it all the time. Usually delete some aosp apps I don't need and they are in system/apps.

even with root no write permissions in the file browser.

I need your help, I successfully rooted my LG Velvet 5G with TWRP and Magisk. Now I want to edit files with a root browser / file manager. But it doesn't work with a single file browser despite root rights! If I want to change xml files, it does not work in spite of the set write and read rights! Even if I extract the XML and edit it on the PC and then want to insert it back into the system, it is there, but it is then empty. Is there still write protection in spite of root? It's Android 10. Please help me. best regards
The partition where the files you want to operate on as 1st thing of all things must be mounted as RW.
Many thanks for the answer. How do I install the source code (kernel) I haven't done it yet. can it be because of that? mount as rw is not successful. Here are the instructions, did I forget something? Https: //forum.xda-developers.com/t/recovery-3-5-0-caymanlm-lm-g900em-unofficial-twrp-for-lg-velvet-5g. 4193275 /

help edit android file

Hello, I am trying to modify my cell phone "samsung galaxy s6" with android 11 "lineage 19.1 unofficial", twrp and magisk installed, the root is working, I have modified several files with a magisk module that I am doing, the file that I want to modify is "/sys /kernel/debug/sched_features" but I can't. It has permissions of 666 and it is the root owner. Is there any way to edit it? . i was thinking of editing twrp backup but i dont know how to unpack the *.win file
You have root in TWRP, so what's the problem?
twrp does not save changes
kuroro82 said:
twrp does not save changes
Click to expand...
Click to collapse
What are you doing?
I create a backup with zip I open it in notepad++ without decompressing it I edit it I give it save the 7zip it asks me if I want to update the file I put it if I put it on the cell phone and flash it I restart the cell I check the changes and nothing happens
You can change the contents of the file directly in the TWRP terminal while keeping the ownership of the file (chown) and its permissions (chmod)?
kuroro82 said:
I create a backup with zip I open it in notepad++ without decompressing it I edit it I give it save the 7zip it asks me if I want to update the file I put it if I put it on the cell phone and flash it I restart the cell I check the changes and nothing happens
Click to expand...
Click to collapse
Make sure the partition where the mentioned file should be copied onto is mounted as RW.

Categories

Resources