[Solved] Magisk? - Xperia Z3 Compact Q&A, Help & Troubleshooting

Solved: See this post.
After the recent SuperSU 2.81 update sent my Z3C into a boot-loop I came across a few comments on this XDA article saying that MagiskSU is the way to go these days.
Now, I gather from this thread that the best way to root is to just install stock Marshmallow and run the provided installer then flash a root binary via TWRP.
However, the FAQ in the official Magisk post states:
Sony Devices: If you're using stock kernel, it is using Sony's special ELF format. Magisk will repack it to standard AOSP format, which requires your device to be unlocked.
Click to expand...
Click to collapse
So, if the bootloader needs to be unlocked to install Magisk, does that mean you can't have the phone's DRM features active? Or is it possible to restore the DRM stuff after Magisk has been installed (assuming you've backed up the DRM keys)?
Also, does the fact that Magisk repacks the kernel mean SafetyNet will always fail on a Sony device, regardless of Magisk Hide being enabled?

I'm on latest MM and no problems with new SuperSU. All latest updates installed and 2.81 and 2.82 are working well.

Chamelleon said:
I'm on latest MM and no problems with new SuperSU. All latest updates installed and 2.81 and 2.82 are working well.
Click to expand...
Click to collapse
I guess you must be lucky then since Chainfire has advised Xperia users to stay on 2.79, as per the news article I linked.
Still, regardless of whether SuperSU works for some people or not, I'd still like to find out if MagiskSU is a viable alternative for Sony devices and what the correct procedure is to install it and retain all the phone's features.

Did Your SuperSU app was converted to system app? Mine wasn't, maybe thats an answer.

Chamelleon said:
Did Your SuperSU app was converted to system app? Mine wasn't, maybe thats an answer.
Click to expand...
Click to collapse
Possibly; can't remember to be honest. Anyway, flashing back to 2.79 fixed the boot loop and I've disabled auto-update until Chainfire says otherwise.
I still want to learn about Magisk though; not keep discussing SuperSU
I found a few bits of info on the subject:
RootKernel can apparently repack the stock kernel with a DRM fix so that all the DRM features can be restored with an unlocked bootloader.
BootBridge can install Magisk without repacking the ELF kernel in AOSP format, which the author says is preferable. However, BootBridge itself requires an unlocked bootloader so the DRM is still an issue I guess... <-- This is only meant for specific older devices; not the Z3C.
Magisk Patch claims Magisk won't work without disabling Sony RIC and provides a fix if you haven't used RootKernel already.
Trying to piece it all together is a little confusing so if anyone has actually done it, I'd be interested to hear from you.

Do we even need the SuperSU updates? 2.79 works fine for me without any issues plus the new versions are maintained by the Chinese company (I'm using some different version compiled by Chainfire himself). The only problem is the update notification in Play Store tho....

nogaff said:
After the recent SuperSU 2.81 update sent my Z3C into a boot-loop I came across a few comments on this XDA article saying that MagiskSU is the way to go these days.
Now, I gather from this thread that the best way to root is to just install stock Marshmallow and run the provided installer then flash a root binary via TWRP.
However, the FAQ in the official Magisk post states:
So, if the bootloader needs to be unlocked to install Magisk, does that mean you can't have the phone's DRM features active? Or is it possible to restore the DRM stuff after Magisk has been installed (assuming you've backed up the DRM keys)?
Also, does the fact that Magisk repacks the kernel mean SafetyNet will always fail on a Sony device, regardless of Magisk Hide being enabled?
Click to expand...
Click to collapse
actually, i have my DRM partition and Magisk on my z3c UB. Here is what i did, first i did patch boot.img with magisk and then used ta-poc tool to restore my TA-backed up partition. oh! magisk hide works properly as well giving me full access to SafetyNet.

espaciosalter20 said:
first i did patch boot.img with magisk and then used ta-poc tool to restore my TA-backed up partition
Click to expand...
Click to collapse
I finally got a chance to try this out and I'm not having much success to be honest.
I'm starting off with an unlocked bootloader and flashing stock MM 23.5.A.1.291, then flashing TWRP.
In TWRP, the current version of Magisk (v14.0) refuses to install; it just complains about Sony ELF32 format and instructs me to use BootBridge, which is only supposed to be required for older devices like the Z2.
Anyway, I tried installing Magisk via BootBridge and it claims to have installed successfully, but then Magisk Manager says Magisk is not installed when I boot into Android (yes, I've rebooted a couple of times as well).
Next, I started over from the beginning and tried Magisk v13.3 instead, which at least begins to install, but then fails to patch the boot image.
Does anyone have a working method they could describe here?

Solution
I figured it all out by myself in the end. For anyone else having trouble, here's what I did:
Made sure I had a backup of my DRM keys!!! I already had one from when I first rooted my phone on KitKat, but I decided to make another backup using Universal TA Backup v2, just in case anything was wrong with the original.
Obtained the official Marshmallow 23.5.A.1.291 firmware from XperiFirm, created a .ftf file with Flashtool, unlocked the bootloader on my device and flashed the .ftf file via Flashtool.
Flashed TWRP custom recovery via fastboot.
Extracted the stock kernel.elf boot image from the .ftf file using Flashtool.
Ran ta_poc on the kernel.elf file, answering "Y" when prompted to disable Sony RIC*. This produced a repacked boot.img with the DRM features added back in.
Copied the boot.img to my SD card.
Booted to Android and installed the Magisk Manager apk.
Used the "Install" button in Magisk Manager and selected the boot.img on my SD card.
Noted the location of the patched_boot.img that Magisk Manager created, then booted into TWRP and flashed patched_boot.img.
Booted back into Android and checked Magisk Manager status.
My device is now fully rooted, has all the DRM features intact and is passing all SafetyNet checks.
As an alternative to steps 7-9, you could simply flash the boot.img from step 6 via TWRP and then also flash the Magisk zip file via TWRP. You'd end up with exactly the same result at step 10.
I believe you could even complete the installation without TWRP or any custom recovery at all, by using Magisk Manager to create a patched_boot.img, then copying it to your PC and flashing it via fastboot.
* Disabling Sony RIC in my boot.img was what solved all my problems. This thread suggests you don't need to do that any more, but I couldn't get it to work without doing so.

Hi, I recently installed magisk 14, I get it to work. However, somehow it broke my wifi and LTE functionality. DNS NOT FOUND. I have a m4 aqua with 6.0.1 ver.1.33. Do you have any idea what could be the cause of this problem?
Enviado desde mi E2306 mediante Tapatalk

any know magisk for Z3 Compact Docomo MM 6.1 Bootloader Lock ?

Hi nogaff,
I tried your solution but there are two difficulties I can't resolve:
1) Where can I download a valid TWRP image for the Sony Xperia Z4 Tablet? My search in the internet was without success, and TWRP doesn't seem to support this device.
2) I used the same procedure to patch the kernel:
TA_POC'd the kernel with disabling DM-verity and disabling Sony-RIC
copied this image to a SD-card
put the SD-card into my SGP771
patched this image with Magisk 22.1 (this version of Magisk supports officially my Android 7.1.1)
flashed this image using FlashTool (because I don't have a TWRP recovery for the SGP771) - flashing ended without error!
BUT​​The SGP771 stucks in a boot loop!!!​​Can you tell me if I forgot something?​
Regards
Ansgar

Related

OTA Updates and Magisk

Hey y'all - I saw this and am wondering if this is still applicable?
I'm on v7 with phh's SuperUser r259; so if, say, the November security patch drops, I can accept, download, and install directly from the notification panel? Or am I reading this wrong?
TIA!
alamo76 said:
Hey y'all - I saw this and am wondering if this is still applicable?
I'm on v7 with phh's SuperUser r259; so if, say, the November security patch drops, I can accept, download, and install directly from the notification panel? Or am I reading this wrong?
TIA!
Click to expand...
Click to collapse
You should be able to, but you will have to reflash the magisk zip so that the boot image is re-patched. I accepted an OTA on my Nexus 6P without any issues although I did use Flashfire.
ryaniskira said:
You should be able to, but you will have to reflash the magisk zip so that the boot image is re-patched. I accepted an OTA on my Nexus 6P without any issues although I did use Flashfire.
Click to expand...
Click to collapse
I want to try to start from stock and be able to get OTA updates.
First post in phh's SuperUser states that phh's SuperUser r259 "Magisk compatible, no boot image modifications are required"
So then I am guessing we don't need to reflash Magisk again since boot image is untouched.
Also what about the recovery? Will OTA update replace the twrp and therefore, TWRP needs to be reflshed after each OTA update.
Maybe someone who experienced this can write what needs to be done in order to successfully flash OTA update.
Thanks.
Orochi77 said:
I want to try to start from stock and be able to get OTA updates.
First post in phh's SuperUser states that phh's SuperUser r259 "Magisk compatible, no boot image modifications are required"
So then I am guessing we don't need to reflash Magisk again since boot image is untouched.
Also what about the recovery? Will OTA update replace the twrp and therefore, TWRP needs to be reflshed after each OTA update.
Maybe someone who experienced this can write what needs to be done in order to successfully flash OTA update.
Thanks.
Click to expand...
Click to collapse
Yes because Magisk itself modifies the boot image. So that's why the Magisk version of PHH Superuser doesn't modify the boot image.
Also, you can use FlashFire to install OTAs and preserve the custom recovery, also you can set it to reflash Magisk after the OTA. (With PHH Superuser, SELinux needs to be in permissive mode to use FlashFire)
ryaniskira said:
Yes because Magisk itself modifies the boot image. So that's why the Magisk version of PHH Superuser doesn't modify the boot image.
Also, you can use FlashFire to install OTAs and preserve the custom recovery, also you can set it to reflash Magisk after the OTA. (With PHH Superuser, SELinux needs to be in permissive mode to use FlashFire)
Click to expand...
Click to collapse
But FlashFire says it needs SuperSU or cm's SU
KaMonsieur said:
But FlashFire says it needs SuperSU or cm's SU
Click to expand...
Click to collapse
PHH's Superuser technically is CM's SU, it's a fork of Koishik's Superuser that was used in CM up until MM.
ryaniskira
With PHH Superuser, SELinux needs to be in permissive mode to use FlashFire
Click to expand...
Click to collapse
I am on stock samsung kernel which is set to SELinux enforcing.
What are my options in terms of getting OTA and what needs to be done?
Do I accept OTA, then flash recovery and flash Magisk + PHH Supersuser?
Can I use Flashfire with supersu instead of PHH superuser, will it work with SELinux enforcing?
Thanks for your time.
ryaniskira said:
PHH's Superuser technically is CM's SU, it's a fork of Koishik's Superuser that was used in CM up until MM.
Click to expand...
Click to collapse
I once used SuperSU and FlashFire. But I did not set SElinux to permissive myself. Does SuperSU automatically do it?
KaMonsieur said:
I once used SuperSU and FlashFire. But I did not set SElinux to permissive myself. Does SuperSU automatically do it?
Click to expand...
Click to collapse
SELinux does not need to be set to permissive when you use SuperSU because SuperSU modifies SEPolicy to allow his apps to work with SELinux set to enforcing.
ryaniskira
So to get OTA update in a reliable way. One has to do the following steps.
1. TWRP
2. SuperSu
3. Magisk 7
4. Flashify
Let me know if this is correct?
ryaniskira said:
SELinux does not need to be set to permissive when you use SuperSU because SuperSU modifies SEPolicy to allow his apps to work with SELinux set to enforcing.
Click to expand...
Click to collapse
Thanks for your help!
Answering to my previous post.
In my case flashfire was useless as it could not detect ota zip update at all on my S5, even when I pointed flashfire to the exact location.
It is possible that the OTA zip is encrypted. I could not even open it as archive.
Even if system is untouched, updater detects custom boot image (patched by supersu) and custom recovery. I was able to fool the system by turning the device status to official. Then flashing original recovery and flashing the OTA. Of course after this, you would have to flash custom recover, root and magisk. Unless the process with stock recovery and stock boot is automated, it seems like too much work.
For now, the easiest solution is just to flash an updated firmware when it comes out. This way it will update everything while preserving your data partition.
This begs me to ask this question. Why even bother with systemless this or systemless that. At the end after flashing an updated firmware, the system partition will be overwritten whether it was systemless or not.
Orochi77 said:
Answering to my previous post.
In my case flashfire was useless as it could not detect ota zip update at all on my S5, even when I pointed flashfire to the exact location.
It is possible that the OTA zip is encrypted. I could not even open it as archive.
Even if system is untouched, updater detects custom boot image (patched by supersu) and custom recovery. I was able to fool the system by turning the device status to official. Then flashing original recovery and flashing the OTA. Of course after this, you would have to flash custom recover, root and magisk. Unless the process with stock recovery and stock boot is automated, it seems like too much work.
For now, the easiest solution is just to flash an updated firmware when it comes out. This way it will update everything while preserving your data partition.
This begs me to ask this question. Why even bother with systemless this or systemless that. At the end after flashing an updated firmware, the system partition will be overwritten whether it was systemless or not.
Click to expand...
Click to collapse
For me, the greatest benefit with Magisk is that after an update (by flashing relevant parts of the factory image) all that is needed for my different system modifications is to flash Magisk. It has cut the time it takes for me to update by a huge factor.
Didgeridoohan said:
For me, the greatest benefit with Magisk is that after an update (by flashing relevant parts of the factory image) all that is needed for my different system modifications is to flash Magisk. It has cut the time it takes for me to update by a huge factor.
Click to expand...
Click to collapse
What tool are you using to flash your firmware?
Orochi77 said:
What tool are you using to flash your firmware?
Click to expand...
Click to collapse
Big update, fastboot from my PC. Small update (monthly security update), flash boot and system image in TWRP.
Didgeridoohan said:
Big update, fastboot from my PC. Small update (monthly security update), flash boot and system image in TWRP.
Click to expand...
Click to collapse
Ok thanks. I have to use odin as I have Samsung phone.
When you flash system and boot, don't you lose root?
Orochi77 said:
Ok thanks. I have to use odin as I have Samsung phone.
When you flash system and boot, don't you lose root?
Click to expand...
Click to collapse
Flashing boot image means I need to reflash Magisk (and my custom kernel), but that's it. I use Magisk compatible phh's superuser, which means that's all I need to do. That's why I use (and love) Magisk.
I'm sorta n00b these days been years since ive been much into modding, but got a couple simple questions, i think i know the answer from what i've seen and read, but just want to verify. Save myself a bit of time if i screw it up.
My Device:
LG Nexus 5x Stock ROM 7.1.1 (Recently Flashed clean image that included Feb 2017 security patch) w/ElementalX Kernel
Magisk v11.x (whatever the most recent is, it's up to date) w/phh superuser
I want to flash the new March 2017 Security patch, ideally without losing any data or having to restore all my apps and data from backup ect.. This is what it seems i should do, i think i can use Flashfire (yes it detects my OTA packages and asks to prepare to flash):
I do backups regularly via otg to an external drive. Just completed one before this post
1. Flash OTA, allow flashfire to handle
2. (RE)flash magisk zip
3. (RE)flash phh superuser
4. (RE)flash elementalX kernel
This should leave everything as it was when i started relatively unmodified besides having the new security patch added yes?
g0d0fmischief said:
I'm sorta n00b these days been years since ive been much into modding, but got a couple simple questions, i think i know the answer from what i've seen and read, but just want to verify. Save myself a bit of time if i screw it up.
My Device:
LG Nexus 5x Stock ROM 7.1.1 (Recently Flashed clean image that included Feb 2017 security patch) w/ElementalX Kernel
Magisk v11.x (whatever the most recent is, it's up to date) w/phh superuser
I want to flash the new March 2017 Security patch, ideally without losing any data or having to restore all my apps and data from backup ect.. This is what it seems i should do, i think i can use Flashfire (yes it detects my OTA packages and asks to prepare to flash):
I do backups regularly via otg to an external drive. Just completed one before this post
1. Flash OTA, allow flashfire to handle
2. (RE)flash magisk zip
3. (RE)flash phh superuser
4. (RE)flash elementalX kernel
This should leave everything as it was when i started relatively unmodified besides having the new security patch added yes?
Click to expand...
Click to collapse
PHH Superuser is not compatible with v11
1. It is either Systemless SuperSU (installed before Magisk, or the included MagiskSU (if systemless SU is not installed before Magisk).
jhedfors said:
PHH Superuser is not compatible with v11
1. It is either Systemless SuperSU (installed before Magisk, or the included MagiskSU (if systemless SU is not installed before Magisk).
Click to expand...
Click to collapse
I did it with a previous version, and upgrade to version 11. As long as i follow those steps to get back to 11 it shouldn't matter does it? Meaning flash the other version of magisk i did to start with along with the corresponding phh su, then allow it to update to v11. This is how i got to v11. I planned on using the very same files to flash and root that i did before and allowing it to update. I read the magisk thread about the updates and changes to it. If this isn't a good idea, or just flat out won't work on that basis of trying to flash the older version and allowing the upgrade as i did initially, should i just flash magisk v11? Didn't want to stray from what worked in this regard. But yea ive read this from the magisk thread
If you're already rooted with MagiskSU, Magisk phh's superuser (not original), or Official Systemless SuperSU
Install/upgrade Magisk Manager from Play Store
Install/upgrade Magisk as prompted in the application
Reboot and you're done!!
I will have lost root by flashing the OTA, right? So say i flash just magisk v11 afterwards, what would i need to flash for root and the app to use once started?
This is the method for rooting and magisk install that i used.. Just allowed it to update to 11 after it starts. Do you mean to say this won't work again?
http://www.theandroidsoul.com/systemless-root-magisk-android/

Unable to install Magisk on my Z3C

For the past two days I've tried unsuccessfully to install Magisk for the hide SafetyNet option.
My phone is a D5803 with the firmware 23.5.A.1.291 R12D Nordic Combined
Let me give the background to my dilemma.
I bought the phone already unlocked
I had TWRP installed and rooted with SuperSU
After a few months, I've decided to change the root for magiskSU so I uninstalled SuperSU 2.92 and attempted to flash Magisk 14 with the result of Error 1. After some fiddling I've bricked the phone and did a full reinstallation of my phone with the untouched firmware.
After reinstalling TWRP 3.1.1 I've tried my luck again to no avail, this time backing up my system.
I scoured the forum and on the net for pointers on how I could do this but I can't seem to find anything to make this work.
I tried going back to the kernel 575, flash Magisk, flash 291 just like the superSU thread,
tried reinstalling stock firmware, unSU, uninstall Magisk, flash magisk,
tried using bootbridge and even Magisk Manager app to patch the boot.img but comes up as failed ELF32 format detected and to use bootbridge needs to be used.
Using bootbridge with Magisk in TWRP "appears" to work but really doesn't do anything
I've tried flash tool from and xperifirm to get a boot.img different of the one I have but when I come to create a ftf, the program jams on me.
I don't want to reinstall SuperSU if I can as I tried HideSU with no results. Help would be greatly appreciated
Kesymos said:
For the past two days I've tried unsuccessfully to install Magisk for the hide SafetyNet option.
My phone is a D5803 with the firmware 23.5.A.1.291 R12D Nordic Combined
Let me give the background to my dilemma.
I bought the phone already unlocked
I had TWRP installed and rooted with SuperSU
After a few months, I've decided to change the root for magiskSU so I uninstalled SuperSU 2.92 and attempted to flash Magisk 14 with the result of Error 1. After some fiddling I've bricked the phone and did a full reinstallation of my phone with the untouched firmware.
After reinstalling TWRP 3.1.1 I've tried my luck again to no avail, this time backing up my system.
I scoured the forum and on the net for pointers on how I could do this but I can't seem to find anything to make this work.
I tried going back to the kernel 575, flash Magisk, flash 291 just like the superSU thread,
tried reinstalling stock firmware, unSU, uninstall Magisk, flash magisk,
tried using bootbridge and even Magisk Manager app to patch the boot.img but comes up as failed ELF32 format detected and to use bootbridge needs to be used.
Using bootbridge with Magisk in TWRP "appears" to work but really doesn't do anything
I've tried flash tool from and xperifirm to get a boot.img different of the one I have but when I come to create a ftf, the program jams on me.
I don't want to reinstall SuperSU if I can as I tried HideSU with no results. Help would be greatly appreciated
Click to expand...
Click to collapse
Have you tried with a different stock kernel, (maybe Elite)? Not sure what the problem is. I've never had trouble with Magisk, but now that I think about it, I don't think I ever tried to flash it on straight stock rom, (I prefer phh anyway in general).
Another thought I had is, if Magisk has a problem with elf format, maybe use Rashr to make a kernel backup image, then flash the backup, (I really don't know anything about this stuff, just shooting in the dark...).

Help ! Problems with Magisk, root and OTA.

Hi guys I'm a beginner so sorry if i did so many stupid mistakes.
I succesfully rooted my Xiaomi Mi A1 with Magisk about 3 months ago and tried to ignore OTA updates until today
I tried to follow a guide in github which i can't link because i'm new in this foru.
Since i rooted with Magisk i followed the first method
I "restored images" then tried to update but still doesn't work
Then i decided to reboot and then tried to update but it doesn't work
So then i tried to uninstall Magisk by dragging it from the home Just like any other app but didn't work
Then proceded to delete all Magisk folders from my downloads but the update still doesn't work
Then desperately tried to reinstall Magisk but it isn't the v16 version so i tried to install it(i don't know which file i need to select so i tried selcting any image files) says it worked but it didn't so i rebooted and tried over and now i'm stuck with incomplete rooting, non-working Magisk and no OTA update.
I'd like to update OTA and bring back Magisk and root.
Ibra2800 said:
Hi guys I'm a beginner so sorry if i did so many stupid mistakes.
I succesfully rooted my Xiaomi Mi A1 with Magisk about 3 months ago and tried to ignore OTA updates until today
I tried to follow a guide in github which i can't link because i'm new in this foru.
Since i rooted with Magisk i followed the first method
I "restored images" then tried to update but still doesn't work
Then i decided to reboot and then tried to update but it doesn't work
So then i tried to uninstall Magisk by dragging it from the home Just like any other app but didn't work
Then proceded to delete all Magisk folders from my downloads but the update still doesn't work
Then desperately tried to reinstall Magisk but it isn't the v16 version so i tried to install it(i don't know which file i need to select so i tried selcting any image files) says it worked but it didn't so i rebooted and tried over and now i'm stuck with incomplete rooting, non-working Magisk and no OTA update.
I'd like to update OTA and bring back Magisk and root.
Click to expand...
Click to collapse
Why you didn just flash Magisk uninstaller. Zip file?
Poslato sa VTR-L29 uz pomoć Tapatoka
urbanboymne said:
Why you didn just flash Magisk uninstaller. Zip file?
Poslato sa VTR-L29 uz pomoć Tapatoka
Click to expand...
Click to collapse
Sorry, i thought that i could still keep Magisk and root intact if i didn't use the uninstaller.
Ibra2800 said:
Sorry, i thought that i could still keep Magisk and root intact if i didn't use the uninstaller.
Click to expand...
Click to collapse
No you cant. You are lucky you didnt brick your phone. Flash uninstaller and than try OTA update. Download TWRP for your phone/new rom and flash working Magisk again and root phone. Is simple. Of course, if you are on TWTP you will be unable to OTA update your phone. You need stock recovery or wait for ZIP flash file of newes rom
Poslato sa VTR-L29 uz pomoć Tapatoka
@Ibra2800 There's no need to uninstall Magisk to update with an OTA. There are however a few prerequisites that need to be fulfilled:
You need to have the stock boot image installed. That can be done by using the restore images option in the Manager or manually flashing the boot.img file with fastboot or equivalent.
You need to have the stock recovery installed. This means the OTA will fail if you have TWRP or another custom recovery installed. Either keep the stock recovery installed and only boot the TWRP image when necessary (the fastboot boot command), or you make sure you restore the stock recovery image when you need to update.
You also need to have a few important partitions on your device untouched. Those include (but may not be limited to) /system and /vendor. If you've so much as mounted these as rw, the OTA will fail. This one can be tricky, because if an app has root access it can easily do this without you noticing.
If you manage to fulfill the above, you should be able to update your device. If the A/B method from @topjohnwu's OTA tips didn't work, use the general case instructions instead.
Right now, it sounds like you need to start from scratch though...
If you can get a hold of a full firmware file for your device, you might be better of flashing that instead. Or, wait for a flashable update, as stated above. And if you want to reinstall Magisk you might have to first uninstall it, to start clean. Use this uninstaller.
Thanks for trying to help me
Sorry to ask but i just can't wrap my head around it, how am i supposed to use the uninstaller, what are the steps ? Also i only user Magisk so i think i don't have any custom recovery and don't know what's TWRP purpose.
Ibra2800 said:
Sorry to ask but i just can't wrap my head around it, how am i supposed to use the uninstaller, what are the steps ? Also i only user Magisk so i think i don't have any custom recovery and don't know what's TWRP purpose.
Click to expand...
Click to collapse
The uninstaller is a zip that you flash in a custom recovery (i.e. TWRP) to uninstall Magisk completely. You should also be able to use the "Complete uninstall" option in the Magisk Manager.
TWRP is a custom recovery that you can use to make backups of your device partitions (so you don't loose any data if anything goes wrong, it's highly recommended to make regular backups in some way) and install custom ROMs and other modifications to your device. You can either install it permanently or just boot it whenever you need it (there are likely gonna be guides about this in your device's forum).
Since you seem to be quite new at this, I would suggest that you take some time to browse through your device's forum and familarise yourself with things like ADB, fastboot, custom recoveries, custom kernels, ROMs, etc. And if you have more questions like this, it's often best to ask them in the device forum, since there sometimes are device specific things that need to be done for everything to work right.

Rooting Moto G6 with PPS29-118-15-11. What versions of noverity, twrp, magisk to use?

Hello forum, I have been trying to root my motorola G6..
After much struggle, getting stuck in a boot loop and other issues I finally have restored stock roms and now have build PPS29-118-15-11 installed. So at least the phone works again My bootloader is unlocked.
But I still want to root it.
I think I understand the procedure well enough, but I am unsure of the correct/best versions I need for the ROMS/boot, Magisk, and TWRP.
ROMS/boot:
I found a youtube with instructions for updating Android v9
But I haven't tried it as this recommends a boot img:
OPS27.104-15-10_no-verity_boot.img
OPS27.104-15-10_no-verity_boot.img | by dejello for Moto G6
Download GApps, Roms, Kernels, Themes, Firmware, and more. Free file hosting for all Android developers.
androidfilehost.com
I am reluctant to use the above as it looks to be a downgrade from my current version 29-118-15-11.
Also, I thought that the filename prefix "O" indicated oreo instead of "P" for pie? So would this be a version 8 file?
TWRP:
Similarly, I am not sure if I am using the right, or best TWRP version. I currently have twrp-v3.2.3-ali.img
I flash this (with fastboot) and it works but shortly after I encounter the "no command" error (when booting to recovery) and I have to redo it. I am NOT overwriting it with a stock recovery.img.
I have also run into the "encryption password" problem, where I am unable to provide one to decrypt the data partition. So I can't backup the data with twrp (something I really would like to do).
Magisk
I have Magisk-23-0.zip
But I saw a post from brunogroa that recommends installing Magisk 19 and updating it to 23 later. Is this something that is required or can I just install v23?
So, I am looking for the correct versions for ROM, Magisk and TWRP to use, given that I have installed PPS29-118-15-11
Any assistance will be greatly appreciated.
Well I finally have it I think. I noticed a comment in
[GUIDE][ROOT][Moto G6][ALI] TWRP, Root, and Magisk installation guide. by djello
"(you may not need a modified boot image for Magisk)"
When using PIE instead of OREO.
Being an optimist, I gave it a try and it worked... I installed Magisk and was able to verify root access using the Root Checker Basic App. Kept stock boot img.
This is probably not too amazing for the old hands but us newbies need a break every now and them
So in the end, all I had to do was:
(0) Unlock bootloader
(1) Install stock PPS29-118-15-11
Done earlier with another version of twrp.
Install TWRP 3.5.2
(2) fastboot flash recovery twrp-3.5.2_9-0-ali.img
(3) Use twrp to install Magisk
adb push Magisk-v23-0.zip /tmp
Boot phone into recovery and use twrp to install Magisk
(4) Boot the phone into System and verify Magisk is there and use Root Checker App to confirm I am now rooted.
Issues:
I noticed that a security update for
PPS29-118-15-11-5 failed to apply.
The phone boots into recovery mode and asks for the decrypt password. I don't know the password to decrypt data and how to proceed from here.
I suspect that if I flash the stock recovery img the security update might work. If anyone knows please comment ; I will research this also and maybe just try it.
pdpantages said:
Well I finally have it I think. I noticed a comment in
[GUIDE][ROOT][Moto G6][ALI] TWRP, Root, and Magisk installation guide. by djello
"(you may not need a modified boot image for Magisk)"
When using PIE instead of OREO.
Being an optimist, I gave it a try and it worked... I installed Magisk and was able to verify root access using the Root Checker Basic App. Kept stock boot img.
This is probably not too amazing for the old hands but us newbies need a break every now and them
So in the end, all I had to do was:
(0) Unlock bootloader
(1) Install stock PPS29-118-15-11
Done earlier with another version of twrp.
Install TWRP 3.5.2
(2) fastboot flash recovery twrp-3.5.2_9-0-ali.img
(3) Use twrp to install Magisk
adb push Magisk-v23-0.zip /tmp
Boot phone into recovery and use twrp to install Magisk
(4) Boot the phone into System and verify Magisk is there and use Root Checker App to confirm I am now rooted.
Issues:
I noticed that a security update for
PPS29-118-15-11-5 failed to apply.
The phone boots into recovery mode and asks for the decrypt password. I don't know the password to decrypt data and how to proceed from here.
I suspect that if I flash the stock recovery img the security update might work. If anyone knows please comment ; I will research this also and maybe just try it.
Click to expand...
Click to collapse
I am stuck in a similar position.
SOLVED IT!!! Followed all of the steps that you posted except I installed Magisk with the patch method because I couldn't get the zip file to push onto the device. Kept getting a read only error, maybe because it wasn't rooted?
Anyway, I am rooted now!!!

Magisk 25.2 severely breaks LineageOS 18.1 on Samsung Galaxy Tab S5e (SM-T725)

For some odd reason Magisk breaks auto-rotation and sets selinux to permissive on boot after updating to 25.2 (from 25.1).
This is not the first time Magisk messes up Selinux rules. I usuall solved this by making a fresh OS install already with patched boot and by installing the managing app afterwards.
However, this time autorotation stopped working for some reason. And when i try to uninstall Magisk using its app -- OS no longer boots, as if it fails to restore initial boot image.
This selinux problem began since v25.
I use latest official build of Lineage OS 18.1. I have TWRP installed, which i use to install LineageOS.
What am i doing wrong? Has anyone experienced such issues?
I posted the same problem here (did not notice/checked SELinux back then and sound is probably also not working), figured out that all sensors do not work, checked with "Sensor Test" app. I was already considering a separate thread, thus I'll continue here, because this issue definitely deserves a separate thread. Documentation is so scattered and sometimes so confusionly described, that it was hard to make sense of it all...
(Disclaimer: Although I have necessary experience with installing custom ROMs etc., everything stated below is at my own understanding ).
My device: Samsung Galaxy Tab S5e LTE
My goal was: TWRP, LineageOS and Magisk. How hard can it be?
Problems are that (most of the) Samsung devices do not have a "ramdisk" partition where Magisk is normally installed, also the increasingly complexity of encryption en integrity checks makes this more annoying.
First, let me retrace my steps, as far as I can.
When reading the TWRP page, we get a clue where to start: "You are therefore strongly advised to first root your device with Magisk and then pre-root a TWRP image before flashing it to recovery", this is because "Both TWRP and Magisk-rooted Android boot using the recovery kernel, with the device's hardware keys used to choose between TWRP and Android at boot time".
(Magisk "hijacks" part of the recovery partition, since the absence of a ramdisk partition.)
Spoiler: later on you learn this is not completely the case any more, but I would still recommend to hold on to this method, because the TWRP page also states that: "The usual path of installing TWRP prior to rooting is problematic on this device, because the Magisk installer does not support installation to recovery from TWRP. Furthermore, prior rooting of the device with Magisk carries the significant advantage of disabling various device protection mechanisms that you will otherwise need to take care of manually.", and it continues with more scary warnings...
1. Thus followed the Samsung section of the Magisk documentation to have the bootloader unlocked and Magisk installed, but stock firmware is still installed, no problem whatsoever.
Then decipher the already mentioned instruction: "...pre-root a TWRP image before flashing it to recovery". This apparently means that Magisk has to patch the TWRP image, just like as was done with the Samsung firmware.
2. Downloaded the *.tar file of TWRP, extracted the image, patched with Magisk and repacked to the *.tar file with 7-Zip in order to be able to flash it with Odin (see step 4).
*3. I do not recall when I installed the "VBMeta file", although this is instructed in the Lineage OS installation instructions, when following the TWRP instructions it says "...you can now jump to its own section", thus skipping it?? (I did it somewhere in the process...)
Unknown: whether it is still required to patch and flash VBmeta (to disable some verification process)...
4. Flash TWRP recovery, see YouTube video below. This video mentions the use of "multidisabler-samsung", which disables "FBE, proca, Vaultkeeper and auto-reflash of stock recovery on Samsung Pie devices". Current latest version was 3.1, downloaded from this XDA post, I think.
Just as in the YouTube video, I also was stuck at the Samsung logo. After booting into the stock firmware you can check if Magisk still works.
Not sure: "multidisabler-samsung" needed?
5. Install LineageOS (and GApps). The most straightforward step, just install LineageOS, read the instructions. Then install GApps (e.g., BiTGApps).
6. After booting (power and volume + button) and setting up LineageOS, a Magisk icon should be visible in the app drawer, click it and the Magisk app is installed, when opened, Magisk is setting up a few more things and reboots the tablet.
*******************************************************************************************
This is the point were you finally think you made it, but no, here the issues arise.
Issues thus being SELinux permissive status (Xandros Darkstorm), no sound and non-working sensors, thus "auto rotating" feature is not working.
At this point I started to regret my purchase...
In the search of a solution to the problem I stumbled upon the following familiar and solved Magisk issue #4911 (LineageOS 18.1 no sound and no sensors after booting with Magisk), which refers to issue #4394 (Magisk > 21.4 is difficult to install on LineageOS (18.1) with TWRP (Direct Install not enabled unless you use old zip)).
In short: this post mentioned patching the boot image instead of the recovery image.
*******************************************************************************************
I. I extracted "boot.img" from the LineageOS zip file, patched it via Magisk (ramdisk is added to the boot image) and replaced the "boot.img" in the zip file with 7-Zip.
II. Booted into TWRP, flashed an original TWRP image, so recovery is replaced. (Rebooted I guess.)
III. Then wiped previously LineageOS installation and, flashed the LineageOS zip file with patched boot image and GApps and rebooted to system.
IV. After setting up, install Magisk, let is do its thing.
V. I installed "Root Checker Basic" in order to check I gained root checker. It was a PASS! And checked with "Sensor Test" if all sensors worked, they did! And sound also worked .
Yay!
Clearly, all of this can be optimized. Some questions remain, what steps are really necessary and I am also still wondering how to apply a LineageOS update... Anyhow at least it is working.
What resolved
Xandros Darkstorm said:
For some odd reason Magisk breaks auto-rotation and sets selinux to permissive on boot after updating to 25.2 (from 25.1).
This is not the first time Magisk messes up Selinux rules. I usuall solved this by making a fresh OS install already with patched boot and by installing the managing app afterwards.
However, this time autorotation stopped working for some reason. And when i try to uninstall Magisk using its app -- OS no longer boots, as if it fails to restore initial boot image.
This selinux problem began since v25.
I use latest official build of Lineage OS 18.1. I have TWRP installed, which i use to install LineageOS.
What am i doing wrong? Has anyone experienced such issues?
Click to expand...
Click to collapse
What fixed this for me is after re-flashing stock in Odin to get everything working again, just rename the magisk apk to install.zip and flash that in twrp, and open the magisk app once booted, no other steps needed for install, no image patching or anything.
Might be worth seeing if this is the same issue or if there's a more fundamental problem with 25.2
Hi,
I stumbled upon this thread while searching for a way to install Magisk on a S5e.
Following the guide here: https://wiki.lineageos.org/devices/gts4lvwifi/install I already unlocked the bootloader, flashed vbmeta.tar with Odin, flashed lineage-19.1-20221114-recovery-gts4lvwifi.img with Odin and flashed lineage-19.1-20221114-nightly-gts4lvwifi-signed.zip with TWRP-recovery.
Lineage is working fine, but I would also like to use Magisk.
I understood, that the order I follwed is not the recommended order for having both Magisk and Lineage. At least, that is, what you described at the beginning of your post.
But as with your last part you mentioned, that there where issues with sensors, ...
And the solution was to
I. Replace recovery with a patched boot.img of Lineage zip and wipe a prev. Lineage installation
I guess, I might be able to stiull do that though I already have Lineage on the S5e (currently with Lineage/TWRP recovery), right?
I can patch the boot.img from within lineage-19.1-20221114-nightly-gts4lvwifi-signed.zip with Magisk app, right?
Or would I have to patch lineage-19.1-20221114-recovery-gts4lvwifi.img
Is there anything to consider, when zipping the image with the patched boot.img again?
Which TWRP image did you choose to be flashed at step II.?
Barium said:
I. I extracted "boot.img" from the LineageOS zip file, patched it via Magisk (ramdisk is added to the boot image) and replaced the "boot.img" in the zip file with 7-Zip.
II. Booted into TWRP, flashed an original TWRP image, so recovery is replaced. (Rebooted I guess.)
III. Then wiped previously LineageOS installation and, flashed the LineageOS zip file with patched boot image and GApps and rebooted to system.
IV. After setting up, install Magisk, let is do its thing.
V. I installed "Root Checker Basic" in order to check I gained root checker. It was a PASS! And checked with "Sensor Test" if all sensors worked, they did! And sound also worked .
Yay!
Clearly, all of this can be optimized. Some questions remain, what steps are really necessary and I am also still wondering how to apply a LineageOS update... Anyhow at least it is working.
Click to expand...
Click to collapse
Thanks
If this is also a solution, can you please let me know, if there is anyhting to consider, when flashing the stock (got it from SAMMOBILE)? Can the lineage-19.1-20221114-recovery-gts4lvwifi.img still be left on the tab?
After re-flashing the stock, I guess you flashed lineage again, right?
Or did you stay with the stock and just flashed magisk (after renaming the apk to zip)?
Thanks
TheTofu said:
What fixed this for me is after re-flashing stock in Odin to get everything working again, just rename the magisk apk to install.zip and flash that in twrp, and open the magisk app once booted, no other steps needed for install, no image patching or anything.
Click to expand...
Click to collapse
I dared patching the TWRP recover for S5e and flashed it via Odin (AP).
S5e boots up in Lineage, Magisk is working fine.
But when I power off the tablet or restart, Lineage Recovery shows up telling me, that my data would be corrupt.
My only options are to try again or to do a factory reset.
Only way out of this is to re-flash the above mentioned recovery image again.
So how do I get the Magisk patched TWRP recovery permanent?
I wiped system? and re-flashed Lineage via TWRP, got "original" TWRP Recovery for S5e Magisk permanent.
I have to admid, I tried several things and got lucky I did not break something.
I had nearly, what I wanted - TWRP, Lineage and Magisk, but there were issues with the sensors (no auto rotate).
Again I helped myself:
1) flashed the original, unpatched TWRP Recovery for S5e
2) flashed unpatched Lineage for S5e
3) flashed MindTheGapps
4) flashed Magisk-v25.2.apk
No bootloop, original TWRP permanent, Magisks working fine, no issues with sensors.
Tried steps 1, 2 and 4 with the Lineage Recovery and it worked too.

Categories

Resources