OP5 upgraded to Android 10 and rooted with Magisk, system changes don't stick - OnePlus 5 Questions & Answers

Hi,
Just upgraded my OP5 to Android 10 official stable version. Rooted successfully with Magisk 20.4
Now I'm trying to do some changes to the system folder but they revert back when I reboot.
1- Trying to replace the emoji with another ttf file, as I always did in Pie but the file gets reverted upon restart.
2- Trying to apply hosts file for ad blocking, same issue the file gets reverted as soon as I restart.
it looks like my system partition is reverting itself for some reason, does anyone know why this happens and how to make the changes stick?
PS: I don't want to enable (Systemless hosts in Magisk) because I'm planning to unroot after doing these changes.
thanks..

medo159 said:
Hi,
Just upgraded my OP5 to Android 10 official stable version. Rooted successfully with Magisk 20.4
Now I'm trying to do some changes to the system folder but they revert back when I reboot.
1- Trying to replace the emoji with another ttf file, as I always did in Pie but the file gets reverted upon restart.
2- Trying to apply hosts file for ad blocking, same issue the file gets reverted as soon as I restart.
it looks like my system partition is reverting itself for some reason, does anyone know why this happens and how to make the changes stick?
PS: I don't want to enable (Systemless hosts in Magisk) because I'm planning to unroot after doing these changes.
thanks..
Click to expand...
Click to collapse
Just forget to change hosts file manualy, use the better Adbloacker Rootless, Blokada

medo159 said:
QUOTE
Click to expand...
Click to collapse
Hi Mate,
Ensure to give proper permissions as follows: rw-r--r-- (0644) to the file. If it is a folder, the permissions are: rwxr-xr-x (0755)

medo159 said:
Hi,
Just upgraded my OP5 to Android 10 official stable version. Rooted successfully with Magisk 20.4
Now I'm trying to do some changes to the system folder but they revert back when I reboot.
1- Trying to replace the emoji with another ttf file, as I always did in Pie but the file gets reverted upon restart.
2- Trying to apply hosts file for ad blocking, same issue the file gets reverted as soon as I restart.
it looks like my system partition is reverting itself for some reason, does anyone know why this happens and how to make the changes stick?
PS: I don't want to enable (Systemless hosts in Magisk) because I'm planning to unroot after doing these changes.
thanks..
Click to expand...
Click to collapse
You can't mount the system partition as rw directly in Android 10. Here's a thread by topjohnwu (slightly technical, but give it a read) on why: https://twitter.com/topjohnwu/status/1259039809361739776

Related

Change hosts file without root?

I am thinking of keeping my phone stock given (Android Pay, Security Updates, Work requirements for email/messages). Is there any way to update the hosts file without unlocking the bootloader and installing TWRP? I just want to get rid of the ads as they are soo annoying for non-donate/IAP/Pro-version apps.
Thanks! :fingers-crossed:
Don't Think it is Possible
Unfortunately I do not think that it is possible to adjust the host file without root access. It is in a protected area of the system storage.
Zlatty said:
I am thinking of keeping my phone stock given (Android Pay, Security Updates, Work requirements for email/messages). Is there any way to update the hosts file without unlocking the bootloader and installing TWRP? I just want to get rid of the ads as they are soo annoying for non-donate/IAP/Pro-version apps.
Thanks! :fingers-crossed:
Click to expand...
Click to collapse
There's no way to do this without root access, it's within the /system partition so that says it all really. You don't have to install TWRP, you can live-boot it instead. There's no way around unlocking your bootloader though, plus I'd strongly recommend unlocked it anyway, if something goes wrong with your phone one day and you can't unlock it you're gonna wish you did.
Dang it. I gave non-root a day. It's not for me. Thanks y'all!
can the system.img be modified so that the hosts file is overwritten? when i go in through TWRP and copy an edited hosts file over the one in /system/etc, i can copy it back out and confirm that the file has had its contents changed. but once the device boots up, it acts as if nothing is different.
is it a matter of when the system folder is mounted/read-only?
640k said:
can the system.img be modified so that the hosts file is overwritten? when i go in through TWRP and copy an edited hosts file over the one in /system/etc, i can copy it back out and confirm that the file has had its contents changed. but once the device boots up, it acts as if nothing is different.
is it a matter of when the system folder is mounted/read-only?
Click to expand...
Click to collapse
https://source.android.com/security/verifiedboot/
As far as I understand it, dm-verity will overwrite those changes on boot. Many ROM / Kernels disable it for that reason. Maybe @Heisenberg or someone else can give you a better explanation, though.

AdAway on stock nougat- copying of host file failed

hello im getting the following message everytime i try and download the lists "copying of host file failed! please read help for more information"
ive just updated to the android 7.0 through the developer program, twrp custom recovery installed with root access build number NRD90M
just wondering what could be causing this and if i can do anything to try and fix it thanks
Is your /system set to read only, or read/write? If read only, adaway will not be able to update /system/etc/hosts
dratsablive said:
Is your /system set to read only, or read/write? If read only, adaway will not be able to update /system/etc/hosts
Click to expand...
Click to collapse
i have it set to read write im gonna try to flash the systemless hosts right now ill update how it goes
flashing the AdAway_systemless_hosts_v2.zip in the recovery, then unistalling and reinstalling the app seems to have worked
you can also use Magisk now to enable complete systemless root and then the hosts file /system/etc will be forwarded to the systemless version
I didn't even install Adaway, I just downloaded a host file and replaced it in /etc/
Works good enough for me and one less app running...
kennehh said:
hello im getting the following message everytime i try and download the lists "copying of host file failed! please read help for more information"
ive just updated to the android 7.0 through the developer program, twrp custom recovery installed with root access build number NRD90M
just wondering what could be causing this and if i can do anything to try and fix it thanks
Click to expand...
Click to collapse
In the exact same boat. Frustrating. Tried Adfree, to no avail. Adaway, to no avail. Tried the adaway bind zip file, making hosts writable, and even System to writable. Nothing.
treoo0_1 said:
In the exact same boat. Frustrating. Tried Adfree, to no avail. Adaway, to no avail. Tried the adaway bind zip file, making hosts writable, and even System to writable. Nothing.
Click to expand...
Click to collapse
i have fixed this by converting adaway from user apps to system apps using Link2SD, reboot and adaway working properly again
Very old thread, but I've had exactly the same problem installing AdAway on the last 3 or 4 phones -- all but one running Nougat 7.0, the other on Oreo 8.1. This was when trying to install AdAway versions 3.1 and 3.3.something.
I finally got it to write hosts file updates using one of the following, not sure which was the key:
-- Installed version 3.2 which had been running problem-free on an old phone for years. The biggest difference is this older phone is running Resurrection Remix 5.8.3 (Nougat 7.1.2).
-- Before trying to update the hosts file on this fresh install, I went straight to AdAway preferences and set "Check for updates daily", "Enable webserver", and "Start webserver on boot". After making those settings I tapped Download Files and Apply Ad Blocking, and it successfully wrote to the hosts file.
Again I don't know which was the fix. It seems weird that version 3.2 would work when a version just before and after it didn't work for me. But of course it is possible that the version is the difference. It seems even more weird that those 3 little preference settings make any difference at all . . . unless it's just the act of writing changes to the AdAway app itself.
Before installing 3.2, using Root Explorer I checked permissions on the working phone and one non-working phone, for the systems and etc folders, and for the hosts file itself. (In all cases AdAway is/was set to use /systems/etc/hosts.) I also checked Android permissions in the Apps list. All permissions were exactly the same on both phones: 0755 for system, 0755 for etc, and 0644 for hosts. No permissions assigned via Android.
Hoping this bump will also get fresh attention from somebody who might know the details of a real answer.
@Moondroid
Why the hell you trying to make some really old ass version of it work instead of installing the newest version? Lol
I've been using 4.2.7 and though its kind of weird on a fresh install I need to update and apply the hosts twice before searching for newer hosts comes back its up to date. But at least it works.

Can't seem to make write changes to system

EDIT: Fixed by flashing latest factory images via fastboot, then the latest TWRP, then MagiskSU.
Hi there,
I'm rooted on stock 7.1.1 but I can't seem to make write changes consistently on the system partition. I was trying to rename NotoColorEmoji.ttf in /system/fonts so I could copy across the version with the iOS emojis, and somehow the rename worked so it's now named NotoColorEmojiOld.ttf - I managed to do this with root permissions in Solid Explorer. However, when I try and copy across the new NotoColorEmoji.ttf to the fonts folder, Solid Explorer says it's unable to do so. I've tried rebooting into TWRP, mounting system and using the file manager but it fails with Error 1. What's worse is I can't seem to rename NotoColorEmojiOld.ttf back to NotoColorEmoji.ttf either - neither Solid Explorer nor TWRP work for this despite both obviously having root access, both throw errors. As a result I have no emoji font file so all my emojis are blank boxes.
Any help in fixing this would be appreciated!
Try flashing a zip version of notocolor in twrp
CarteNoir said:
Hi there,
I'm rooted on stock 7.1.1 but I can't seem to make write changes consistently on the system partition. I was trying to rename NotoColorEmoji.ttf in /system/fonts so I could copy across the version with the iOS emojis, and somehow the rename worked so it's now named NotoColorEmojiOld.ttf - I managed to do this with root permissions in Solid Explorer. However, when I try and copy across the new NotoColorEmoji.ttf to the fonts folder, Solid Explorer says it's unable to do so. I've tried rebooting into TWRP, mounting system and using the file manager but it fails with Error 1. What's worse is I can't seem to rename NotoColorEmojiOld.ttf back to NotoColorEmoji.ttf either - neither Solid Explorer nor TWRP work for this despite both obviously having root access, both throw errors. As a result I have no emoji font file so all my emojis are blank boxes.
Any help in fixing this would be appreciated!
Click to expand...
Click to collapse
Are you using either phh superuser or magisksu?
Try changing your SELinux to Permissive with this app https://forum.xda-developers.com/showthread.php?t=2524485
bozinsky73 said:
Try flashing a zip version of notocolor in twrp
Click to expand...
Click to collapse
I get "set_perm: some changes failed, Updater process ended with ERROR: 7" and it doesn't work.
blitzkriegger said:
Are you using either phh superuser or magisksu?
Click to expand...
Click to collapse
Nope, just plain old systemless SuperSU.
collinjames said:
Try changing your SELinux to Permissive with this app https://forum.xda-developers.com/showthread.php?t=2524485
Click to expand...
Click to collapse
For some reason the app claims I don't have root permission despite the SuperSU dialog popping up and me granting it root.
CarteNoir said:
I get "set_perm: some changes failed, Updater process ended with ERROR: 7" and it doesn't work.
Nope, just plain old systemless SuperSU.
For some reason the app claims I don't have root permission despite the SuperSU dialog popping up and me granting it root.
Click to expand...
Click to collapse
Selinux didn't work for me at first on 7.1.1, I got the same error as you. But I went into twrp made sure system mounted, go into twrp terminal and cd into /system/bin and /system/xbin and in both of these directories type in (touch su) with out parenthesis. Reboot and see if that makes selinux changer works now.
Fe Mike said:
Selinux didn't work for me at first on 7.1.1, I got the same error as you. But I went into twrp made sure system mounted, go into twrp terminal and cd into /system/bin and /system/xbin and in both of these directories type in (touch su) with out parenthesis. Reboot and see if that makes selinux changer works now.
Click to expand...
Click to collapse
That got the app working and I was able to change SELinux to permissive, but I still can't make lasting changes to /system unfortunately.
Bumping - anyone else have any ideas? I'm not so much concerned with not being able to change emoji fonts as I am concerned with the ramifications of not having system write access - if anything breaks or comes up in the future that I need rw system for, I won't be able to fix stuff unless I sort this out.

[Q] Ads reapearing after Rooting->Building hosts file>Uninstalling Magisk

Hey, I'm having an interesting issue that I haven't seen before on my previous phones. Normally, I'll occasionally flash magisk to root and update my hosts file with Adaway (and several lists that I've added to it which seem to block most/all ads), then unroot my phone. I noticed with the 6T that after I unroot (restore images, then uninstall through Magisk Manager) that the hosts file seems to be restored back to the stock file without any of my blocks. Am I doing something wrong? Thanks!
the00guy said:
Hey, I'm having an interesting issue that I haven't seen before on my previous phones. Normally, I'll occasionally flash magisk to root and update my hosts file with Adaway (and several lists that I've added to it which seem to block most/all ads), then unroot my phone. I noticed with the 6T that after I unroot (restore images, then uninstall through Magisk Manager) that the hosts file seems to be restored back to the stock file without any of my blocks. Am I doing something wrong? Thanks!
Click to expand...
Click to collapse
Without having some type of ramdisk patch in place, like Magisk or custom kernel, the system will default to the stored system image and effectively undo any changes to the /system partition. Any changes to the system partition that you have made will not be there until you install Magisk or a custom kernel again.
So basically with the stock boot image unmodified you cannot make persistent edits on the /system partition from my experience.
Wow, I was not aware that the system started keeping a clean system image like that. Historically I've always been able to modify /system with root and then unroot and the changes would remaim. Since TWRP is part of /boot now, perhaps that would be sufficient to prevent the stock boot from rewriting my /system changes...? Are there any other ways to prevent the system from being restored to stock after unrooting?
the00guy said:
Wow, I was not aware that the system started keeping a clean system image like that. Historically I've always been able to modify /system with root and then unroot and the changes would remaim. Since TWRP is part of /boot now, perhaps that would be sufficient to prevent the stock boot from rewriting my /system changes...? Are there any other ways to prevent the system from being restored to stock after unrooting?
Click to expand...
Click to collapse
As far as I know the phone wont boot with just TWRP installed, you need Magisk as well. So if you don't want to keep Magisk installed I suggest installing only a custom kernel. I personally love Smurf Kernel here (https://forum.xda-developers.com/oneplus-6t/development/kernel-smurfkernel-2-0-49-t3868360). Although I have not tested to see if /system modifications stick with only custom kernel but I feel like they should since it is modifying the ramdisk to allow the phone to boot modified. I know that Smurf Kernel will detect if you have Magisk or not and patch the boot image accordingly. So you will be able to run just a custom kernel without root if this is what you want.
Also if you are not aware you can disable all root access from the Magisk app without having to uninstall anything, maybe that could work for you as well.
Make sure to hit the thanks button if I was able to help you out here!
the00guy said:
Wow, I was not aware that the system started keeping a clean system image like that. Historically I've always been able to modify /system with root and then unroot and the changes would remaim. Since TWRP is part of /boot now, perhaps that would be sufficient to prevent the stock boot from rewriting my /system changes...? Are there any other ways to prevent the system from being restored to stock after unrooting?
Click to expand...
Click to collapse
You could always, edit the partition directly in TWRP and install an alternative host file.
tech_head said:
You could always, edit the partition directly in TWRP and install an alternative host file.
Click to expand...
Click to collapse
The issue is that Android will replace the /system partition with the stored stock system image if you do not have a modified ramdisk. So if you remove Magisk and don't use custom kernel you effectively cannot modify anything on /system as it will not persist.
yerger said:
The issue is that Android will replace the /system partition with the stored stock system image if you do not have a modified ramdisk. So if you remove Magisk and don't use custom kernel you effectively cannot modify anything on /system as it will not persist.
Click to expand...
Click to collapse
Hopefully the community can find a workaround eventually for this that won't replace the /system with a clean image, or find a way to patch the clean image when performing root operations. Some apps can still detect/are broken by magisk, as good as it is, and I hate running any of my phone without ad blocking. I tried going the DNS route, but have yet to find a good private dns provider that oxygen os plays nicely with that also doesn't log.
the00guy said:
Hopefully the community can find a workaround eventually for this that won't replace the /system with a clean image, or find a way to patch the clean image when performing root operations. Some apps can still detect/are broken by magisk, as good as it is, and I hate running any of my phone without ad blocking. I tried going the DNS route, but have yet to find a good private dns provider that oxygen os plays nicely with that also doesn't log.
Click to expand...
Click to collapse
Try using just a custom kernel. You can do that without root and it should prevent /system from being overwritten with the stored system image. The issue is that you need a patched ramdisk in order for the /system partition to boot modified. No way around that unfortunately.
I personally use Smurf Kernel (https://forum.xda-developers.com/one...-0-49-t3868360) and get much better battery life than the stock kernel. The phone is much smoother and snappier as well.
yerger said:
Try using just a custom kernel. You can do that without root and it should prevent /system from being overwritten with the stored system image. The issue is that you need a patched ramdisk in order for the /system partition to boot modified. No way around that unfortunately.
I personally use Smurf Kernel (https://forum.xda-developers.com/one...-0-49-t3868360) and get much better battery life than the stock kernel. The phone is much smoother and snappier as well.
Click to expand...
Click to collapse
Thank you all for the information. It seems I need to read up more on how android pie works behind the scenes particularly with the ramdisk and how the system position is managed.
https://blokada.org/
Non root adblocker, many lists available, DNS change
Or just use Adguard DNS. Works great.

boot animation

I'm wanting to change the boot animation on my OnePlus 6T but when I go to move a new bootanimation.zip to
/system/media it say task failed and the .zip file that's there has 0 bytes.
Anyone got any idea why it's not working? Didn't have this issue with any other phone.
Cheers
Newrooter22 said:
I'm wanting to change the boot animation on my OnePlus 6T but when I go to move a new bootanimation.zip to
/system/media it say task failed and the .zip file that's there has 0 bytes.
Anyone got any idea why it's not working? Didn't have this issue with any other phone.
Cheers
Click to expand...
Click to collapse
A couple of reasons.
OnePlus left zero room on system partition. You'd need to remove something beforehand.
Many file explorers, titanium backup, etc are having issues modifying the system partition. Best luck I've had is using the built in file explorer in TWRP.
I literally replaced my bootanimation yesterday. I used a Magisk module for a bootanimation and repalced the bootanimation in the module install location which is on your data partition. This way, you can remove the module and still keep your original bootanimation should you wish to revert back. The bootanimation I used was originally for a 720p screen so I had to modify it for the dimensions of the OP6T (1080 x 2340). I am still trying to work on modifying the Magisk module so it has my bootanimation instead. It didn't work when I tried it yesterday and had to replace the file manually after, which then worked.
ffejy462 said:
A couple of reasons.
OnePlus left zero room on system partition. You'd need to remove something beforehand.
Many file explorers, titanium backup, etc are having issues modifying the system partition. Best luck I've had is using the built in file explorer in TWRP.
Click to expand...
Click to collapse
You can increase the size of the system partition with this tool: https://forum.xda-developers.com/oneplus-6/how-to/tool-epr-enchilada-partition-resizer-t3963587
I would avoid trying to resize the partitions as suggested above unless you fully understand what it is doing and what issues may arise from messing with the partition tables.
I just put my bootanimation.zip into the system-less hosts Magisk module. I have been using that module for any system files I need to replace. It's nice and simple plus you can revert the changes by just disabling the module.
Jager said:
I would avoid trying to resize the partitions as suggested above unless you fully understand what it is doing and what issues may arise from messing with the partition tables.
I just put my bootanimation.zip into the system-less hosts Magisk module. I have been using that module for any system files I need to replace. It's nice and simple plus you can revert the changes by just disabling the module.
Click to expand...
Click to collapse
Can you tell me the name of the module I searched for "system-less host" module but magisk never showed anything. Thanks
Newrooter22 said:
Can you tell me the name of the module I searched for "system-less host" module but magisk never showed anything. Thanks
Click to expand...
Click to collapse
It's built into Magisk. In the settings...
Edit:
Also if you understand what I am doing then you will see that you can basically use any Magisk module to accomplish this. It just has to be mounting files against the /system partition. I used the system-less hosts since it literally is only replacing one file on the /system partition so nothing complex was going on with this module.

Categories

Resources