Editing /system with Magisk - LG V20 Questions & Answers

Guys, I'm sorry but I have an obtuse question.
There have been a handful of mods that modify your ROM using Magisk systemless root. As I understand, Magisk roots without touching the /system folder to keep from breaking SafetyNet. Is that correct?
I ask because I know Arise4Android has a Magisk compatible zip you can flash that modifies your mixer_paths_taska.xml file as part of the installation. I'm trying to implement the permanent high impedence mod by modifying the mixer_paths_tasha.xml file and I obviously can't because I have no R/W access to the /system/etc folder.
Does anyone know a way to modify this file by either flashing a zip or otherwise?
Thanks much, everyone!

Related

[Q] Couple of questions about ROM development

Hello!
First of all, thanks to all you repliers!
I'd really like to know a few things creating a ROM:
1. how can I create an update.zip starting from a system.img? (I know how to sign) In case can I simply install the img and then push /system changes, like root or busybox?
2. how can I install busybox manually? Can I create a script which does the job for me (i.e. busybox --install command at first boot then delete the script itself), avoiding me to write loads of symlinks?
3. when I've created an update.zip, is it easy to root the ROM? I mean, just push su and SuperUser.apk? Or I need a particular boot.img?
Thanks
elegos said:
Hello!
First of all, thanks to all you repliers!
I'd really like to know a few things creating a ROM:
1. how can I create an update.zip starting from a system.img? (I know how to sign) In case can I simply install the img and then push /system changes, like root or busybox?
Click to expand...
Click to collapse
Clockwork Recovery won't install system image files for some reason. You'll need to dump the yaffs2 filesystem then zip it up into the update.zip, then use an updater-script to set unix permissions (zip doesn't preserve these). Also, there's no need to sign the update.zip. It's only meaningful to the device's firmware if it is signed by the device's manufacturer.
elegos said:
Hello!
2. how can I install busybox manually? Can I create a script which does the job for me (i.e. busybox --install command at first boot then delete the script itself), avoiding me to write loads of symlinks?
Click to expand...
Click to collapse
Certainly. You can add a script and call it from updater-script during the install.
elegos said:
Hello!
3. when I've created an update.zip, is it easy to root the ROM? I mean, just push su and SuperUser.apk? Or I need a particular boot.img?
Thanks
Click to expand...
Click to collapse
Boot image is irrelevant to a properly rooted system. Just adding SuperUser should be sufficient.
That's cool!
1. as of the system.img, I see there is a system folder too - is that just enought zipping it?
2. may you please tell me how to call a script within an edify updater-script please?
3. thanks
I don't understand. You have a system.img and a system folder? In what? What are you starting from? If you use a zipped system, you WILL need to set unix permissions, symlinks and modes as these are NOT preserved in a zip file.
As far as calling scripts, something like this:
run_program PACKAGE:installbusybox.sh

could not remount /system

Guys, i am on stock os, 7.0 , recently flashed magisk for systemless root and when i tried to use app mover to move some apps to system, i get error as could not remount/system. Tried supersu root as well but same result, im a newbie here. please help Used both Vegito and Ex kernel too. but i get the error everytime. But root checker shows i have root.
You could try the Magisk module named "App Systemizer". It can convert user apps to system apps, but systemlessly.
thorin0815 said:
You could try the Magisk module named "App Systemizer". It can convert user apps to system apps, but systemlessly.
Click to expand...
Click to collapse
Thanks, Is there a way to edit system files , like modifying host file ? It seems i have been using system root all these days. Is it still available ?

persistant changes to hosts file following reboot?

Hi everyone. I'm scratching my head here and struggling to find a solution that doesn't require root.
I've got a hosts file that I love as it blocks nearly all advert servers on my phone.
I know there are several adblocking apps but they all require root.
I have had to remove root as I have some critical apps that still don;t work, even after hiding magisk from the apps within the Magisk Manager.
I've got a magisk patched image that I can "fastboot boot" with and can edit the hosts file (after remounting /system as rw) but when I then reboot afterwards, the hosts file has been overwritten.
Can anyone help me please or give me a pointer of how to make the hosts edits remain following a reboot?
edit2add
I am using stock ROM with latest August patches on my Mi A1
You can't without root even if you do it your system partition will be modified and it will result in phone not booting or just safetynet won't pass.
Use a vpn or I'm pretty sure there's app that can fake a vpn with a ad ban list
Dead-neM said:
You can't without root even if you do it your system partition will be modified and it will result in phone not booting or just safetynet won't pass.
Use a vpn or I'm pretty sure there's app that can fake a vpn with a ad ban list
Click to expand...
Click to collapse
Interesting idea regarding spoof VPN.
Do you know how the hosts file is generated? If it's copied over from somewhere during boot then could I edit the source file it's copied from?
If it's generated procedurally, might I be able to script it to add my edits during creation?
wodgey said:
Interesting idea regarding spoof VPN.
Do you know how the hosts file is generated? If it's copied over from somewhere during boot then could I edit the source file it's copied from?
If it's generated procedurally, might I be able to script it to add my edits during creation?
Click to expand...
Click to collapse
System partition ? so that's a good idea but you'll have to compile a rom to change this file. On Linux distro the host file is a thing you can modify easily. On android it's just deprecated by google as it's use mostly used as an adfilter. And google is an ad company. That's my guess.
Anyway host file will always need root even on Linux.
Simply because it can be used against you.
The problem is more on apps that blocks you because you're rooted than being rooted for changing this file.
If any app could modify host then bang you go to YouTube and it redirect you to something else.
Maybe for you it's just an adblock file but it's a little more than that.
So sorry but it's root or vpn.
Dead-neM said:
System partition ? so that's a good idea but you'll have to compile a rom to change this file. On Linux distro the host file is a thing you can modify easily. On android it's just deprecated by google as it's use mostly used as an adfilter. And google is an ad company. That's my guess.
Anyway host file will always need root even on Linux.
Simply because it can be used against you.
The problem is more on apps that blocks you because you're rooted than being rooted for changing this file.
If any app could modify host then bang you go to YouTube and it redirect you to something else.
Maybe for you it's just an adblock file but it's a little more than that.
So sorry but it's root or vpn.
Click to expand...
Click to collapse
So? Could I possibly extract the system.img from the stock ROM, make the edits there and then recompile?
(I've got a copy of payload.bin that I extracted a few weeks ago, when trying to flash the August security patches (this was before I did a compete flash of stock ROM using fastboot)
That actually seems like it wouldn't take too much effort
wodgey said:
So? Could I possibly extract the system.img from the stock ROM, make the edits there and then recompile?
(I've got a copy of payload.bin that I extracted a few weeks ago, when trying to flash the August security patches (this was before I did a compete flash of stock ROM using fastboot)
That actually seems like it wouldn't take too much effort
Click to expand...
Click to collapse
This will lead to a corrupt system partition modified. As i said the worse thing is you could not boot and the good just won't pass safetynet.
Dead-neM said:
This will lead to a corrupt system partition modified. As i said the worse thing is you could not boot and the good just won't pass safetynet.
Click to expand...
Click to collapse
Ok I understand.
How does the device 'know' that the system partition is corrupt? Does it perform a hash check perhaps?
How would compiling my own custom ROM avoid this same problem?
wodgey said:
Ok I understand.
How does the device 'know' that the system partition is corrupt? Does it perform a hash check perhaps?
How would compiling my own custom ROM avoid this same problem?
Click to expand...
Click to collapse
It does many thing to know that its have been touched. You'll have to modify some stuff and it will work. You'll loose certification but you'll have you own rom.
Dead-neM said:
It does many thing to know that its have been touched. You'll have to modify some stuff and it will work. You'll loose certification but you'll have you own rom.
Click to expand...
Click to collapse
Any chance you can outline the other stuff I'd need to change?
If it's really in-depth then don't worry but if it's just a few bullet-points that I can Google more info on, I'd appreciate it.
wodgey said:
Any chance you can outline the other stuff I'd need to change?
If it's really in-depth then don't worry but if it's just a few bullet-points that I can Google more info on, I'd appreciate it.
Click to expand...
Click to collapse
Search "dm-verity" and "safetynet". The first one is what will look at any r/o partition like system and kernel. It's been a long time since i dig into this. I'm not into this anymore.
But You can disable it but you'll loose safetynet, encrypted partition etc... (i may be wrong but you got the idea). And safetynet look if partition have been modified and you are a certified device if it won't pass the banking app and apps like Pokemon go etc won't work.
Magisk hide the fact that the kernel img have been touch and most app that detect it detect just the app itself. That means magisk capability (su, hide and module)
So you could maybe compile stock rom with a custom host file. Never touch vendor partition! Make a backup before! By booting and not flashing twrp. Do not flash twrp just use the "fastboot boot command"
You'll need to make a custom kernel and system img to flash in order to do it.
I'll try to do a rom without anything modded except kernel without dm verity and system with your host and i guess it needs change too.
I dunno if it will pass safetynet after.
Just don't brick your phone ?
Keep in mind that you'll loose ota. There's a chance that the rom work with just some changes but i can be a mess to do.
Why not trying a custom rom like lineage os?
Using their supersu zip won't you be able to replace the host file then remove root?
Once you make a backup a move it to a pc as a savestate. You are free to try different solution
Dead-neM said:
Search "dm-verity" and "safetynet". The first one is what will look at any r/o partition like system and kernel. It's been a long time since i dig into this. I'm not into this anymore.
But You can disable it but you'll loose safetynet, encrypted partition etc... (i may be wrong but you got the idea). And safetynet look if partition have been modified and you are a certified device if it won't pass the banking app and apps like Pokemon go etc won't work.
Magisk hide the fact that the kernel img have been touch and most app that detect it detect just the app itself. That means magisk capability (su, hide and module)
So you could maybe compile stock rom with a custom host file. Never touch vendor partition! Make a backup before! By booting and not flashing twrp. Do not flash twrp just use the "fastboot boot command"
You'll need to make a custom kernel and system img to flash in order to do it.
I'll try to do a rom without anything modded except kernel without dm verity and system with your host and i guess it needs change too.
I dunno if it will pass safetynet after.
Just don't brick your phone ?
Keep in mind that you'll loose ota. There's a chance that the rom work with just some changes but i can be a mess to do.
Why not trying a custom rom like lineage os?
Using their supersu zip won't you be able to replace the host file then remove root?
Once you make a backup a move it to a pc as a savestate. You are free to try different solution
Click to expand...
Click to collapse
Thanks for info I'll investigate later in the week when I have more time. Monday has arrived too quickly!
Appreciated though

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.

There is a magisk module to mount r/w?

Hi , so apperntly the only way currently to modify system files of OnePlus 8 Pro is through flashing magisk modules , Tried using several file explorers but couldn't change permissions , tried via twrp but system won't be mounted , so my question is if there is a magisk module that someone made to mount r/w , if there is , I would like to get it , if there isn't , I would appreciate if anyone can create that for me , and please don't tell me to go to terminal and type commands because IT DOESN'T WORK, I don't know exactly what flashing magisk modules do but I figured out that it's the only way I can change system files , please help
Mounting system as R/W is impossible on stock software (OOS, OneUI etc).
This applies to all devices launched with Android 10, so, 7T/Pro and up.
https://source.android.com/devices/tech/ota/dynamic_partitions/implement
Your best shot is to create a module that 'modifies' the system systemless-ly.
Lossyx said:
Mounting system as R/W is impossible on stock software (OOS, OneUI etc).
This applies to all devices launched with Android 10, so, 7T/Pro and up.
https://source.android.com/devices/tech/ota/dynamic_partitions/implement
Your best shot is to create a module that 'modifies' the system systemless-ly.
Click to expand...
Click to collapse
That's literally the magisk module i'm asking for
ilan0098 said:
That's literally the magisk module i'm asking for
Click to expand...
Click to collapse
Literally not. You asked for a module that could make system R/W.
Anyway good luck
As mentioned, no r/w module...
galaxys said:
As mentioned, no r/w module...
Click to expand...
Click to collapse
Anyway such a module won't do any good IMHO. System/product/vendor partitions are combined into a single "super" partition.
The individual parts for /system, /vendor, /product are then mounted from there.
You will never be able to physically write on files in those partitions (if that is/was your intention).
However, you can write a Magisk module (easily) which replaces files with others (e.g. I replaced my /system/etc/hosts files with a version that has ad-blocked IP addresses). You can "delete" files by making them "empty" with a Magisk module (e.g. I have hidden the OnePlus phone/dialer/calculator/messages/notes apps in this way as I prefer the Google variants).
It's not that hard ... assuming you have a bit of Linux dev skills.
Can you be more specific about what exactly you want to do? Edit some file?
foobar66 said:
Anyway such a module won't do any good IMHO. System/product/vendor partitions are combined into a single "super" partition.
The individual parts for /system, /vendor, /product are then mounted from there.
You will never be able to physically write on files in those partitions (if that is/was your intention).
However, you can write a Magisk module (easily) which replaces files with others (e.g. I replaced my /system/etc/hosts files with a version that has ad-blocked IP addresses). You can "delete" files by making them "empty" with a Magisk module (e.g. I have hidden the OnePlus phone/dialer/calculator/messages/notes apps in this way as I prefer the Google variants).
It's not that hard ... assuming you have a bit of Linux dev skills.
Can you be more specific about what exactly you want to do? Edit some file?
Click to expand...
Click to collapse
Also if I do want to edit a system file , I can't , it won't let me do that , the file I edited just won't save
foobar66 said:
Anyway such a module won't do any good IMHO. System/product/vendor partitions are combined into a single "super" partition.
The individual parts for /system, /vendor, /product are then mounted from there.
You will never be able to physically write on files in those partitions (if that is/was your intention).
However, you can write a Magisk module (easily) which replaces files with others (e.g. I replaced my /system/etc/hosts files with a version that has ad-blocked IP addresses). You can "delete" files by making them "empty" with a Magisk module (e.g. I have hidden the OnePlus phone/dialer/calculator/messages/notes apps in this way as I prefer the Google variants).
It's not that hard ... assuming you have a bit of Linux dev skills.
Can you be more specific about what exactly you want to do? Edit some file?
Click to expand...
Click to collapse
I would very much like to edit the build.prop file, and let Adaway (F-droid) edit the hosts file to add its adblocking lists.
Are either of those things possible? Thanks!
R2-Brute said:
I would very much like to edit the build.prop file, and let Adaway (F-droid) edit the hosts file to add its adblocking lists.
Are either of those things possible? Thanks!
Click to expand...
Click to collapse
Enable systemless hosts in magisk manager and adaway will work. And for editing build prop, look up "resetprop", it's a magisk tool to modify build prop systemlessly.
Thank you so much! Adaway is up and running! I just got a new phone, and got so worried when it dawned on me that the System folder was locked down!
And I found "MagiskHide Props Config". Is it better or worse than Resetprop, or the same? "Props Config" has already flaked on me in the half hour I've been using it, but since a reinstall, it's working again.
I'm hoping it's just getting comfortable, but if you think Resetprop is more stable, please tell me.
And thanks again! Feeling good about technology.
I have ROOTED, rooted mean now you are Administrator of all in your phone. But live is not like a dream, I can't delete or modify anything in system folder on my rooted samsung phone, when using Z Archiver to delete empty and junk folder it says failed even sometimes it says Access Denied ( maybe the problem is here) converted RO->RW, tried through ES File it says in use or busy, Root Explorer is useless even if I adds write permission, but when using lucky patcher to uninstall & install and apps as system then it can creates or delete in systm app, which means there may be a way for me to modify it, if the trash can't be deleted then the system partition will be filled with garbage forever and can only get fatter. Who know how to solve it?
You have to patch super image to make everything r/w.
[GUIDE] How to make your System RW / Super R/W read/write-able
Welcome to the one and only, the original, universal SystemRW / SuperRW feat. MakeRW / ro2rw by lebigmac This script removes the read-only lock of all partitions embedded in the super partition of your stock firmware. This allows you to mount...
forum.xda-developers.com
in case someone still struggling with that
i wanted to copy trusted certificate ".0" file from storage to /system/etc/security/cacerts
i couldn't and tried to do the adb mount thing but i couldn't
anyway it worked when i tried MT manager ( i literally shocked ) its not in play store but you can find it online
if that didn't work i guess you have two option
1) open platform tools after enabling usb debugging and do "adb push /sdcard/yourfile /system/etc/security/cancerts
that will copy the file from sdcard to system/etc/security/cancerts
second option i didn't really tried but i saw it worked for some
is magisk module called "overlayfs" if you can't find it online i will attach it here
BUT before all that try MT manager .. idk how it really worked lol
Mazen550 said:
in case someone still struggling with that
i wanted to copy trusted certificate ".0" file from storage to /system/etc/security/cacerts
i couldn't and tried to do the adb mount thing but i couldn't
anyway it worked when i tried MT manager ( i literally shocked ) its not in play store but you can find it online
if that didn't work i guess you have two option
1) open platform tools after enabling usb debugging and do "adb push /sdcard/yourfile /system/etc/security/cancerts
that will copy the file from sdcard to system/etc/security/cancerts
second option i didn't really tried but i saw it worked for some
is magisk module called "overlayfs" if you can't find it online i will attach it here
BUT before all that try MT manager .. idk how it really worked lol
Click to expand...
Click to collapse
i have installed overlay fs but i can edit only /system, /product and some files in /vendor and /system_ext, i have android 13 with one ui 5.1

Categories

Resources