future of SuperSU vs. Magisk - Moto Z2 Force Guides, News, & Discussion

The guy who made SuperSU, @ChainfireXDA , retired from SuperSU. 2.82 SR5 was his last beta release. Some Chinese owned company named CCMT bought SuperSU a while back, but @ChainfireXDA retired from the aforementioned on 03OCT2017 (10th anniversary). https://plus.google.com/+Chainfire/posts/6Sp6t9LxtQZ
https://desktop.firmware.mobi
https://www.chainfire.eu
SuperSU at XDA
https://forum.xda-developers.com/apps/supersu
So, since nothing has yet been posted by CCMT for SuperSU (as of 14NOV2017), it seems that @topjohnwu Magisk will become more prominent.
Magisk at XDA
https://forum.xda-developers.com/apps/magisk

The purpose of this thread was what exactly?

choosing rooting app for OEM unlocked Moto Z2 Force
TheKnux said:
The purpose of this thread was what exactly?
Click to expand...
Click to collapse
Since Moto Z2 Force Sprint and T-Mobile variants are OEM unlockable, the long term choice of a systemless root for an OEM unlocked Moto Z2 Force seems to be a relevant topic for discussion and/or news for Moto Z2 Force. I wanted SuperSU to be developed further by @ChainfireXDA , but his retirement from SuperSU likely means that to get the most up-to-date systemless rooting app for my OEM unlocked Moto Z2 Force, I will have to soon switch to @topjohnwu Magisk.

The point of this thread was that we had to work extra hard for magisk support and we now have it via mine and @Uzephi kernel we have figured out why there are bootloops and will be adressing here shortly

On OEM unlocked T-Mobile Moto Z2 Force with latest TWRP (as of 15NOV2017), I just switched to Magisk 14.3 beta from SuperSU 2.82 SR5 beta w/SU Hide 1.09. In this long process, I lost all my data because Magisk 14.3 beta did not properly disable force encryption! I really didn't think it was going to be as hard as it was. It absolutely refused to boot properly with default upstream kernel (i.e., that comes along with latest TWRP; kernel probably soon to be tweaked per previous post) and latest Magisk 14.3 beta no matter how many times I formatted data, etc. I ended up having to use SuperR's Kitchen free for Linux.
SuperR's Kitchen free for Linux
https://forum.xda-developers.com/apps/superr-kitchen/kitchen-superr-s-kitchen-v1-1-50-v2-1-6-t3597434
SuperR's Kitchen donate version for Windows/Linux
https://forum.xda-developers.com/apps/superr-kitchen/windows-linux-superr-s-kitchen-v3-0-0-0-t3601702

jhofseth said:
On OEM unlocked T-Mobile Moto Z2 Force with latest TWRP (as of 15NOV2017), I just switched to Magisk 14.3 beta from SuperSU 2.82 SR5 beta w/SU Hide 1.09. In this long process, I lost all my data because Magisk 14.3 beta did not properly disable force encryption! I really didn't think it was going to be as hard as it was. It absolutely refused to boot properly with default upstream kernel (i.e., that comes along with latest TWRP; kernel probably soon to be tweaked per previous post) and latest Magisk 14.3 beta no matter how many times I formatted data, etc. I ended up having to use T-Mobile 05AUG2017 kernel, no-verity-opt-encrypt-5.2 (attached), and Android Terminal TWRP Installer. But the important thing is Magisk 14.3 beta is finally working with latest Moto Z2 Force TWRP!
Click to expand...
Click to collapse
Interesting experiment... two questions:
1. have you tried using flashable zip to unforce encryption for "any kernel" by @erfanoabdi on our device?
2. since latest TWRPs by @joemossjr come with a (little) modified/recompiled kernel, why don't disable forced encryption by default on them?

enetec said:
Interesting experiment... two questions:
1. have you tried using flashable zip to unforce encryption for "any kernel" by @erfanoabdi on our device?
2. since latest TWRPs by @joemossjr come with a (little) modified/recompiled kernel, why don't disable forced encryption by default on them?
Click to expand...
Click to collapse
i didn't read thread and other posts but please don't install my zip here
that will harm the device in worst way
1) Z2 have a/b boot partition
2) different fstab and partition table
@enetec remove my flashable zip from your old post

erfanoabdi said:
...
@enetec remove my flashable zip from your old post
Click to expand...
Click to collapse
:good:
P. S. : Welcome back pal!
P. P. S. : we *want* you on Z2!!!

re-encrypting not due to upstream kernel with TWRP
enetec said:
Interesting experiment... two questions:. ....
2. since latest TWRPs by @joemossjr come with a (little) modified/recompiled kernel, why don't disable forced encryption by default on them?
Click to expand...
Click to collapse
The re-encrypting was not the fault of the upstream kernel with TWRP, it was that the 14.3 beta Magisk didn't properly disable force encryption in a stock boot image. It errored & told me to use a stock boot image during Magisk direct install (i.e., inside Magisk manager), so I dd flashed a stock boot image and FlashFire flashed Magisk right afterward. Yeah.....force encryption fun! Eventually, I ended up having to use SuperR's Kitchen free for Linux. All's well that ends well.
SuperR's Kitchen free for Linux
https://forum.xda-developers.com/apps/superr-kitchen/kitchen-superr-s-kitchen-v1-1-50-v2-1-6-t3597434
SuperR's Kitchen donate version for Windows/Linux
https://forum.xda-developers.com/apps/superr-kitchen/windows-linux-superr-s-kitchen-v3-0-0-0-t3601702

jhofseth said:
The re-encrypting was not the fault of the upstream kernel with TWRP
Click to expand...
Click to collapse
Never intended that... I was only asking why don't include directly in modified kernel the possibility to remain unencrypted...

enetec said:
Never intended that... I was only asking why don't include directly in modified kernel the possibility to remain unencrypted...
Click to expand...
Click to collapse
I think @joemossjr and @Uzephi try, but this encryption can be frustrating. Many techniques that are supposed to stop it don't work properly. Somehow SuperSU 2.82 beta SR5 does a good job of stopping it when installed systemlessly. No version of Magisk that I've tested stops encryption on our phone--even though it is supposed to stop force encryption by default.

jhofseth said:
I think @joemossjr and @Uzephi try, but this encryption can be frustrating. Many techniques that are supposed to stop it don't work properly. Somehow SuperSU 2.82 beta SR5 does a good job of stopping it when installed systemlessly. No version of Magisk that I've tested stops encryption on our phone--even though it is supposed to stop force encryption by default.
Click to expand...
Click to collapse
user data is formatted f2fs and system/boot/etc ext4. SU decrypts both while magisk sees f2fs and decrypts only f2fs partitions.

Flashable unencrypter must format data will not work on stock kernel. But will with twrp.
https://drive.google.com/file/d/1Cr-7SiSiHpUDM9HYpyeXVsPHEB9Z9wym/view?usp=drivesdk

enetec said:
Never intended that... I was only asking why don't include directly in modified kernel the possibility to remain unencrypted...
Click to expand...
Click to collapse
the "encrypt" part is in /system, not kernel. I can add a module when I build with anykernel to do the same thing as joemoss's zip. But it isn't the kernel. The kernel will work both encrypted and decrypted.

Uzephi said:
the "encrypt" part is in /system, not kernel. I can add a module when I build with anykernel to do the same thing as joemoss's zip. But it isn't the kernel. The kernel will work both encrypted and decrypted.
Click to expand...
Click to collapse
I could be wrong, but I have maturated the idea that disabling force encryption is one of (many...) things which can be done both working on /boot or /system....
I had posted @erfanoabdi script for Moto Z (Griffin) even to have it studied for an eventual porting... (I'm quite sure it works on /boot... )
More... I think even SuperSU method could work on /boot: if it worked modifying /system, a kernel reflashing shoudn't disable it's tweak... am I wrong?

enetec said:
I could be wrong, but I have maturated the idea that disabling force encryption is one of (many...) things which can be done both working on /boot or /system....
I had posted @erfanoabdi script for Moto Z (Griffin) even to have it studied for an eventual porting... (I'm quite sure it works on /boot... )
More... I think even SuperSU method could work on /boot: if it worked modifying /system, a kernel reflashing shoudn't disable it's tweak... am I wrong?
Click to expand...
Click to collapse
AnyKernel pulls apart the boot image and injects the kernel. it doesn't put the image back correctly. to try this, dd pull your boot image and play with AIK (linux solution to manually add a kernel). Don't edit anything and it will lose root as well when you reflash the repacked boot image. it is something in the ramdisk that doesn't get saved.

Uzephi said:
AnyKernel pulls apart the boot image and injects the kernel. it doesn't put the image back correctly. to try this, dd pull your boot image and play with AIK (linux solution to manually add a kernel). Don't edit anything and it will lose root as well when you reflash the repacked boot image. it is something in the ramdisk that doesn't get saved.
Click to expand...
Click to collapse
Understood. But @ChainfireXDA should have found a solution to this... or not?

enetec said:
Understood. But @ChainfireXDA should have found a solution to this... or not?
Click to expand...
Click to collapse
How can he? he doesn't have the device to test this out. He just patches the boot image the normal way like other devices. (albeit it took some community testing to get the boot image and ramdisk to work for our device, but hey, you get what you can when the dev doesn't have your device)

enetec said:
Understood. But @ChainfireXDA should have found a solution to this... or not?
Click to expand...
Click to collapse
@Uzephi wrote, "data is formatted f2fs and system/boot/etc ext4. SU decrypts both while magisk sees f2fs and decrypts only f2fs partitions."
So, I think that's why when we formatted data ext4 in TWRP, SuperSU 2.82 beta SR5 was OK but not so for Magisk.

Ok what uzephi is trying to say is encryption in handled in our fstab.qcom. which if you have a stock kernel it's gonna be in there and one's gonna be in system and another in system_root. So in the fstab there is this line for userdata which isn't used as you can see the # means it's not used. When magisk sees this because it's right above our userdata it modifies the "forceencrypt" part to "encryptable" which allows decryption on the f2fs partition but we don't use that. Follow me? Now below that one is ours. And where you see the term "fileencryption" that's just another term for force encrypt. So when magisk is flashed it only sees the one above it and changes it and goes on. Now the difference between magisk and supersu is supersu looks for terms like "verify" for dm verity and "forceencrypt" for encryption and also "fileencryption" and removed the verify term to remove verity and changes all the above terms if noticed to "encryptable" instead of going line by line supersu does it better. Now if you have twrp it has a fstab in it that patched already but what I forgot to check is where twrp puts it and where it puts it is n in the root of our device where it doesn't belong. So that's why I made a flashable zip that sends that modified fstab to system where when the system boots it will see the new modified fstab and realize that it can boots.
#/dev/block/bootdevice/by-name/userdata /data f2fs rw,discard,nosuid,nodev,noatime,nodiratime,nobarrier,inline_xattr,inline_data wait,check,formattable,forceencrypt=/dev/block/bootdevice/by-name/metadata
/dev/block/bootdevice/by-name/userdata /data ext4 nobarrier,noatime,nosuid,nodev,discard,data=ordered,noauto_da_alloc wait,check,formattable,fileencryption=ice

Related

[ROOT][Kernel][TWRP] repack of the stock kernel with dm-verity and SONY RIC off

Changelog:
V5.23 Fix for Android 6 (Freeze on boot logo)
Installation of kcal kernel module for supported kernels. Get the app from https://forum.xda-developers.com/android/software-hacking/dev-kcal-advanced-color-control-t3032080
V5.22 Bug in the vendor overlay creation. Existing directories (like /vendor/bin) have not been replicated correctly
V5.21 Fix issue when running on Linux (some CR/LF)
Patch libsepol in bootimg for backwards compatibility with Android 6
V5.20 Support for superuser as an alternative to SuperSU (https://github.com/phhusson/Superuser)
Fix for the missing internal storage link in TWRP
V5.11 Support for Android 7.0
Fix in the overlay layout which could prevent some libraries from loading and cause battery drain
V5.1 Support for Android 7.0
Updated bootimg to deal with Android 7.0 policies
New tool inside bootimg for adding new contexts to binary file contexts
New system overlay layout due to a more restrictive linker in Android 7
V5.0 New system overlay method using the /vendor directory. As this directory is also in the library search path even libraries can be easily replaced without modifying the system partition
System-less SuperSU integration improved (Version 2.76 or higher recommended)
System-less xposed integration (using the standard distribution)
Support for 32.A.0.253
V4.51 Fix for awk script for Linux kernel version detection when running on Linux
V4.5 Fixed adb and mtp file access in TWRP for 32.2.A.0.224
V4.42 Added support for Z2 (Sirius) and TWRP fstab fix for leo and aries (thanks to waleedsq81)
V4.41 Fixed issue with Y/N choice on non-english Windows. Added support for Z3 (leo)
V4.4 Support for Z3+/Z4, Tablet Z2, Tablet Z3 and Tablet Z4 added (Z4 still has an issue with TWRP, but DRM fix works)
SuperSU integration reworked in order to need less SELinux exceptions and to be more secure
All tasks can now be individually selected. Therefore there is no separate DRM only script required
V4.31 Renabled Z5P (satsuki) and Z5C (suzuran) for TWRP and drmfix
V4.3 Support for older Lollipop added
Script execution for Linux fixed
V4.24 Fix for for a bug in SuperSU integration in V4.23
V4.23 Fix for repacking 3rd party kernel (Some permissions were on custom directories were lost)
V4.22 Bugfix for readta (flash_dk reported unit not)
V4.21 Fix for the Linux binary of bootimg
V4.2 Updated TWRP to 3.0.2
V4.1
Fix for WideWine (if you have your device key) Thanks a lot to goofnorf101 for testing
unpackinitfs and makeinitfs in my bootimg tool now maintain date/time of files correctly
Automatic SuperSU installation
V4.0
Fix for older kernels (Lollipop)
Binary for Linux (The older version had the ARM version packaged)
Device is not stored in the kernel image anymore
TWRP updated to version 3.0.1
FAQ - Please read
Is is possible to have root with locked bootloader?
Short answer: no
Long answer: The locked bootloader only boots unmodified kernel packages signed by Sony. The stock kernel only mounts unmodified /system partitions (dm-veritiy) -> No modification without unlocking
So any change to the kernel (like this script) or system partition requires unlocked bootloader
What is dm-verity?
A hash checksum on all blocks of a filesystem in order to verify the integrity
What is Sony RIC?
A protection to avoid mounting the root filesystem or system read/write
What happens if I unlock my bootloader
The device key (TA unit 0x1046b) will be wiped, which deactives everything DRM related. In addition a full wipe of your phone will be perfomed.
So extract your TA partition before with this great tool http://forum.xda-developers.com/crossdevice-dev/sony/iovyroot-temp-root-tool-t3349597 from zxz0O0
If you already unlocked the bootloader before, then at least the credentials will be restored, which will reactivate stuff like x-reality and camera de-noise
Why do I need to flash my device key?
Without your device only some functions can be reactivated, like x-reality. Other functions like widevine do not work with out your device key.
How do I enter TWRP recovery?
Restart your phone and press the volume key up as soon as the LED switches to yellow
I want to use a custom kernel with the DRM fix
Just say "N" to all other options. Nevertheless be prepared for problems if the custom kernel does not match your Android version.
What should I do if there is an update to this script?
First check if you really need to run this update by checking the changelog. E.g. if it says binary for Linux fixed and you are using Windows then probably you don't care. If you did not change your Android version then all you have to do is to update the kernel package with fastboot flash boot. If you do not use the automatic SuperSU integration then you have to reinstall SuperSU in TWRP.
This tool repacks an existing kernel package (usually the stock kernel) in order to make it rootable and adds TWRP recovery as well. Version 4 has been succesfully tested with LP and MM.
In particular it adresses the following issues:
DM-Verity: Android is now using dm-verity to verfy the integrity of the system partition. Until you switch it off your phone won't boot after modifying /system
SONY RIC: RIC is blocking the write access to the system partition
DRM Keys: After unlocking the bootloader your device key is wiped, which deactivates some functionaliy. E.g. x-reality, denoise in camera aso.
Recompiling the kernel is not required as only the init ramdisk needs to be modified. You can run these scripts either in Windows or Linux.
Thanks to the excellent work of zxz0O0 you can now backup the TA partition before unlocking the bootloader with this tool http://forum.xda-developers.com/crossdevice-dev/sony/iovyroot-temp-root-tool-t3349597
If you managed to backup your TA partition before you unlocked the bootloader then this version will fully reactivate your keys as well. (many thanks to addicted1900 for helping me with the testing)
As there has been some confusion I would like to point out one more time that you cannot run any kernel package which is not signed by Sony without unlocking the bootloader. So this works only with unlocked bootloader.
As it seems that it is not clear to everyone I also want to mention that <...> is a placeholder. E.g. <extracted kernel> means that you should replace it with then name of your extracted kernel, which could be kernel.elf
There was a report that having SuperSU in the system partition installed may lead to a bootloop. Therfore you shoud first install the bootimage created by this script and then install SuperSU afterwards, as it will then use the system-less strategy.
In order to use these scripts you need the kernel boot image of your current version. There two different ways to obtain it:
Method1:
If you have a .ftf image then open it with zip application (7Zip, WinZip, Windows Compressed Folder) and extract kernel.sin. Afterwards use Flashtool -> Tools -> SIN Editor to extract the kernel. You should end up with the boot image with extension .elf.
Method2:
Run your favourite recovery and connect via
Code:
adb -d shell
Now run
Code:
find /dev -name boot
dd if=<output of the find command before> of=/sdcard/kernel.img
Once you have the kernel image you are ready to use the script.
The newest version support superuser as an alternative to SuperSU. This is available open source and can be verified. In order to integrated you need the current superuser.zip from http://superuser.phh.me/superuser.zip and to be install the app afterwards from Google Play (look for superuser phh) or build it yourself from github.
To integrate the kernel part just place superuser.zip in the rootkernel directory.
You can also still use SuperSU, although it is causing a huge battery draining on my Z5 with Android 7.0 If you place SuperSU in the same directory (SuperSU*.zip, case sensitive) then it will be also installed automatically . It did all the tests with 2.76, but newer versions should work as well. Please be aware that you can not update SuperSU within the application. For a newer SuperSU version you need to rerun the script.
If you want to integrate xposed as well just place the distribution for you device and Android version in the same directory. (e.g. xposed-v86-sdk23-arm64.zip). Only support with Android 6.0 (sdk 23) and higher.
xPosed for Android 7.0+ is still not available.
Code:
rootkernel <extracted kernel> boot.img
You are prompted for several choices:
Sony RIC is enabled. Disable?
I prefer not to disable it in order to keep my phone more secure. Unfortunately there are a lot of bad guys in this world and SELinux and RIC still can save us if someone discovers a new kernel exploit.
Sony RIC basically prevents mounting the /system partition for write. You can still modify it in recovery of of course, but if you require write access to /system without entering recovery then you need to disable it.
Install TWRP recovery? Here you should say yes unless you are trying to patch a non-stock kernel, which comes already with a recovery
Install busybox? For security reasons I prefer not to install. In recovery you have it anyway. This choice is only available if you chose install TWRP
Found SuperSU-v....zip. Install? Integrates SuperSU. For this option to show up you have to place the SuperSU package into the same directory with the name SuperSU*.zip (case sensitive)
Found superuser.zip. Install? Integrates superuser. For this option to show up you have to place superuser.zip into the same directory (case sensitive)
# Make su permissive (Permits any action as su)? This only appears if you install superuser. Permissive means you can anything as root, without it is restricted mainly to file operations (sufficient for e.g. Titanium Backup)
Found xposed-v....zip. Install? Integrates xposed system-less. For this option to show up you have to place the xposed for your device and Android version into the same directory. (e.g. xposed-v86-sdk23-arm64.zip)
Install DRM fix? Installs the DRM fix. First it tries to use the device key which you flashed with flash_dk. If it does not exist it uses an alternative method which cannot fix everything (e.g. Widevine will not work, but X-reality, Camera denoise etc. will work)
Now put your phone into fastboot mode (Volume Up + connect USB) and then run:
To test it without actually flashing it:
Code:
fastboot boot boot.img
For flashing it:
Code:
fastboot flash boot boot.img
If you managed to backup for TA partition before then you can reactivate your original device key as follows:
Code:
flash_dk <ta backup image> DK.ftf
Flashing this file with flashtool will write your device key to an alternative unit, from where the drmfix library will pick it up.
This is a one-time task. It will survive a complete reset of the phone or Android system upgrade. The device key has a length of just 16 bytes, so it is correct that the resulting DK.ftf has a size of only aprox. 500 bytes.
If you like my work you can buy me a coffee
Some background information:
There are two main tools involved (for both Android and Windows)
- busybox
Probably everyone knows it
- bootimg
A multicall binary with several tools for unpacking and packing the boot image as well as adapting the SELinux policy. Part of the code is written by me from scratch, some other parts are cherry picked from other projects. I will also provide the source for it. As Windows doesn't have softlinks I modified the tools for unpacking and packing the init ramdisk to write text files with __lnk__ at the end instead.
Would be great if someone shared E6653 stock .200 kernel boot.img or flashable zip so we can try this out
Funkmasterchilla said:
Would be great if someone shared E6653 stock .200 kernel boot.img or flashable zip so we can try this out
Click to expand...
Click to collapse
Do you want the kernel.sin of stock . 200?
lordriguez said:
Do you want the kernel.sin of stock . 200?
Click to expand...
Click to collapse
I am downloading the whole firmware again from xperifirm. Thank you mate !
Edit: Working great! I'll stick to stock kernel now since Androplus' consumes more battery while asleep !
Edit2: I successfully flashed recoveries in command window from my PC but can't access TWRP at boot though, no LED flashing.
Edit3: Ok that's cuz there's no recovery boot script obviously, my bad. That's above my pay grade, if somebody is kind enough to create a stock. 200 with recoveries it'd be much appreciated PM me if so
Edit!: I flashed monx new stock based kernel
Thank you Tobias !
tobias.waldvogel said:
Hi everyone,
as most of you know, even after unlocking the bootloader there are a few more requirements before you can modify the system partition, i.e. install SuperSU, xposed etc.
- Android is now using dm-verity to verfy the integrity of the system partition. Until you switch it off your phone won't boot after modifying /system
- SONY RIC is blocking the write access to the system partition
The good news is, that it is not required to recompile the kernel. It is sufficent to modify the init scripts inside the init ram disk. So you can just stick to the stock kernel.
I created a package which precisely does this job for you. Just run it from TRWP after installing a new Android version
With this you don't have to wait anymore until someone creates the right kernel package for your phone
PS: It leaves a copy of the new boot image in the internal sdcard if you want to save it somewhere. (boot.img) It can be flashed with fastboot if required.
Click to expand...
Click to collapse
Hmm... I don't understand what this zip file do with phone.... Can you explain more primitive for me?!
Is that for recover stock kernel with stock drm keys?! I understand correct?!
zavpasha said:
Hmm... I don't understand what this zip file do with phone.... Can you explain more primitive for me?!
Is that for recover stock kernel with stock drm keys?! I understand correct?!
Click to expand...
Click to collapse
Before you can start to install thing like SuperSU and xposed you have to change the kernel, otherwise your phone won't boot anymore. In the past you had to wait for someone to come up with a compatible kernel for your phone, now this package just converts your existing kernel.
Regarding the DRM please install the package from the DRM restore thread.
Funkmasterchilla said:
I am downloading the whole firmware again from xperifirm. Thank you mate !
Edit: Working great! I'll stick to stock kernel now since Androplus' consumes more battery while asleep !
Edit2: I successfully flashed recoveries in command window from my PC but can't access TWRP at boot though, no LED flashing.
Edit3: Ok that's cuz there's no recovery boot script obviously, my bad. That's above my pay grade, if somebody is kind enough to create a stock. 200 with recoveries it'd be much appreciated PM me if so
Edit!: I flashed monx new stock based kernel
Thank you Tobias !
Click to expand...
Click to collapse
Thanks for the feedback. Future versions of this package will add TRWP as well. I am currently working on it.
tobias.waldvogel said:
Thanks for the feedback. Future versions of this package will add TRWP as well. I am currently working on it.
Click to expand...
Click to collapse
As promised the new package with TWRP is out
tobias.waldvogel said:
As promised the new package with TWRP is out
Click to expand...
Click to collapse
Great work thanks ,
How would I go about disabling the vibration for recovery?
Sent from my E6653 using Tapatalk
Well, the script which checks if recovery should be started is bin/init inside the zip. If you don't like the vibrate then just remove the line and run the package again
Gesendet von meinem E6683 mit Tapatalk
huh, so it is possible to have 2 recoveries at the same time? (and why would anyone want 2 recoveries? )
Three Recoveries are als possible
CWM, Phils Touch & TWRP
Sent from my E6653 @ XDA Portal
Sorry for being noob.
I miss my Oneplus one where things were so easy.
After unlocking BL what do i do with this zip.
Is it going to Root my phone and Install TWRP?
Thanks for help.
I flash the v2 and i got bootloop. 4 time red LED and the phone reboot and all over again. What's the problem?
Hi Tobias,
can you please build a v2 for the z5 compact too?
thx
stiffmeister
FakeSmile said:
I flash the v2 and i got bootloop. 4 time red LED and the phone reboot and all over again. What's the problem?
Click to expand...
Click to collapse
On which model did you use it and with which firmware version?
If you used flashtool before then you can just flash the kernel one more time (i.e. deselect everything else).
stiffmeister75 said:
Hi Tobias,
can you please build a v2 for the z5 compact too?
thx
stiffmeister
Click to expand...
Click to collapse
This should work on Z5 compact with stock kernel as well, without any change.
In case of any issues you can flash the kernel again via flashtool
If it did not work you can pass me the generated boot.img from your interal sdcard for further analysis
hi tobias,
i didn't try the v2, because i thought, that the twrp recovery wouldn't be compatible.
but when you say it's ok, than i'll try it
br
stiffmeister
stiffmeister75 said:
hi tobias,
i didn't try the v2, because i thought, that the twrp recovery wouldn't be compatible.
but when you say it's ok, than i'll try it
br
stiffmeister
Click to expand...
Click to collapse
I flashed zombie kernel without making backup of stock kernel, can you share it with me so I can try this method (I doubt it will work on zombie)
ps : I have .200 fw
tobias.waldvogel said:
On which model did you use it and with which firmware version?
If you used flashtool before then you can just flash the kernel one more time (i.e. deselect everything else).
Click to expand...
Click to collapse
E6653 on .200 firmware

[DEPRECATED] [Module/Tool] [2018.10.9] F2FS Loopback Bug Workaround -- No Kernel Patch Needed

THIS PROJECT IS NO LONGER SUPPORTED.
# F2FS Loopback Bug Workaround
## README.md
### Copyright (C) 2017-2018, VR25 @ xda-developers
#### License: GPL v3+
---
#### DISCLAIMER
This software is provided as is, in the hope that it will be useful, but without any warranty. Always read/reread this reference prior to installing/upgrading. While no cats have been harmed, I assume no responsibility under anything which might go wrong due to the use/misuse of it.
A copy of the GNU General Public License, version 3 or newer ships with every build. Please, read it prior to using, modifying and/or sharing any part of this work.
To prevent fraud, DO NOT mirror any link associated with this project; DO NOT share ready-to-flash-builds (zips) on-line!
---
#### DESCRIPTION
Some kernels from devices with F2FS-formatted data partition (i.e., Motorola) have a bug which prevents loopback devices (.img files) from being mounted read-write. This limits systemless modifications that can otherwise be achieved with Magisk.
This module works by moving magisk.img to the cache partition (EXT[2-4]-formatted) and linking it to its actual location (i.e., /data/adb/magisk.img). The other half of the process consists on automatically recreating magisk_merge.img shortly after boot and handling it the same way as magisk.img.
With this workaround, a patched kernel is dispensable.
Cache partition's size is essentially the only limiting factor -- and that's pretty much self-explanatory.
/cache/magisk_.img is automatically backed up to/data/adb on boot (only if modified) & restored on install. Thus, whenever cache is wiped, magisk_.img and its respective symlink can easily be restored by simply reinstalling the module.
---
#### PRE-REQUISITES
- Magisk v15+
- F2FS-formatted data partition
- EXT[2-4]-formatted cache partition
---
#### SETUP STEPS
Fist time
- Install from custom recovery as a regular flashable zip.
Upgrades
- Install from Magisk Manager or custom recovery.
- Reinstall after cache wipes to restore magisk.img backup.
---
#### NOTES/TIPS
Always install large modules from custom recovery only. In fact, I recommend installing every module from recovery if your device's cache partition has a very small size (i.e., only a few Megabytes).
To revert changes, uninstall the module, boot into custom recovery and delete </data/adb/magisk.img> & <magisk.img.bkp>. Lastly (while still in custom recovery), move </cache/magisk_.img> to </data/adb/magisk.img>.
Updates and reinstalls can be carried out from Magisk Manager as well.
---
#### ONLINE SUPPORT
- [Facebook Support Page](https://facebook.com/VR25-at-xda-developers-258150974794782/)
- [Git Repository](https://github.com/Magisk-Modules-Repo/f2fs-loopback-bug-workaround/)
- [XDA Thread](https://forum.xda-developers.com/apps/magisk/guide-magisk-official-version-including-t3577875/)
---
#### RECENT CHANGES
**2018.10.9 (201810090)**
- Bug fixes
- Latest module template, with added sugar.
- Magisk 15-17.2 support
- Updated documentation
**2018.9.2 (201809020)**
- Improved compatibility
- Major optimizations
- Updated documentation
**2018.8.1 (201808010)**
- General optimizations
- Striped down (removed unnecessary code & files)
- Updated documentation
**2018.7.24 (201807240)**
- Fixed modPath detection issue (Magisk V16.6).
- Updated documentation
Works with stock roms as well ?
My cat lost two and half lives because of this thread. Sadly, the disclaimer is in order, so I can't sue.
Is this for Nougat or Marshmallow?
does this work on nougat update or only on MM?
Can someone please confirm if it will work on retin channel with dual sim... I am running stock nougat... Will it work or does it only work on MM rom...
Anybody know how to fix notifications without breaking safety net?
VR25 said:
DISCLAIMER
Not taking responsibility for any thermonuclear war or cat harm. Do it at your any risk.
NEEDED
[Unlocked Bootloader] https://youshouldknowthisbynow.com
[Latest TWRP] https://forum.xda-developers.com/mo...recovery-unofficial-twrp-moto-z-play-t3495629 credits @Alberto97
[Latest FSFS patched Kernel] https://forum.xda-developers.com/moto-z-play/development/kernel-stock-kernel-f2fs-patched-t3546732 credits @tomparr
[Latest Magisk zip] https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445 credits @topjohnwu
[Latest Magisk Manager app] https://play.google.com/store/apps/details?id=com.topjohnwu.magisk&hl=en credits @topjohnwu
PROCEDURE
0. reboot bootloader
1. fastboot boot twrp.img
2. adb sideload fsfs patched kernel
3. adb sideload magisk
4. reboot system
5. install magisk manager from play store
6. reboot bootloader [yes, again]
7. fastboot boot twrp.img [yes, again]
8. adb sideload magisk [yes, again]
9. reboot system [yes, ag... you get the point]
10. open magisk manager settings, enable "magisk hide"
11. reboot, done
Click to expand...
Click to collapse
Works like a charm.
I however did not temporarly boot into TWRP, I flashed it as such.
mhp1995 said:
does this work on nougat update or only on MM?
Click to expand...
Click to collapse
I'm on Android 7.0 Nougat.
Thanks!
Erwin
fortunz said:
My cat lost two and half lives because of this thread. Sadly, the disclaimer is in order, so I can't sue.
Click to expand...
Click to collapse
Hopefully your cat is ok now
jjdavis699 said:
Is this for Nougat or Marshmallow?
Click to expand...
Click to collapse
mhp1995 said:
does this work on nougat update or only on MM?
Click to expand...
Click to collapse
mhp1995 said:
Can someone please confirm if it will work on retin channel with dual sim... I am running stock nougat... Will it work or does it only work on MM rom...
Click to expand...
Click to collapse
It should work on both Marshmallow and Nougat, as long as you pick the appropriate kernel for your system version (6 or 7). @mhp1995, I don't think the software channel matters. It should work across all (retus, retin , reteu, etc.).
xxBrun0xx said:
Anybody know how to fix notifications without breaking safety net?
Click to expand...
Click to collapse
No idea at this point, man. I've never had to fix mine. Perhaps only some people have it...?
@erwin, I chose not to touch the stock recovery to keep OTA installations straightforward. Easy for everyone.
one question... if i wanted to install viper4android and xposed framework, should i download it from the magisk download tab or shud i flash them manually via TWRP? thanks
mhp1995 said:
one question... if i wanted to install viper4android and xposed framework, should i download it from the magisk download tab or shud i flash them manually via TWRP? thanks
Click to expand...
Click to collapse
There are specific versions of these modified for systemless root. DO NOT install the standard versions. You should follow the instructions given in Magisk Manager app to download and install.
VR25 said:
There are specific versions of these modified for systemless root. DO NOT install the standard versions. You should follow the instructions given in Magisk Manager app to download and install.
Click to expand...
Click to collapse
Ok :good: I think xposed is not available at the moment for nougat ..Its WIP....If possible when the time comes try to include installing xposed via Magisk tutorial in this thread too.... Coming to the posts, u mind if i add this rooting tutorial in my all-in-one thread? Of course credits will be given
mhp1995 said:
Ok :good: I think xposed is not available at the moment for nougat ..Its WIP....If possible when the time comes try to include installing xposed via Magisk tutorial in this thread too.... Coming to the posts, u mind if i add this rooting tutorial in my all-in-one thread? Of course credits will be given
Click to expand...
Click to collapse
Oh, yes the availability... I forgot to mention that. Hopefully a proper Xposed version will be available for nougat very soon. When that happens, I'll update the thread.
About adding the tutorial to your thread... sure, go ahead.
I honestly declare I didn't read whole thread - is this method work for stock Nougat rom - I need root for Titanium Backup only for now , since facebook messenger goes crazy on my new phone MZP :-/ . Or maybe there is a way to restore old conversations ,not restored automatically in Facebook Messenger - anybody knows how to do it ? . On every phone I had I used root for two things mainly - Titanium Backup and to block adds - dns66 do block adds very well without root but , Titanium Backup has no alternative for me .
Just for the records: Magisk 12 release works fine.
@sebx_g1 incredible 2 pages! That are more than 10 postings! Sure nobody can read so much. And nearly all ask or answer your question, but it is just too much ...
tag68 said:
Just for the records: Magisk 12 release works fine.
@sebx_g1 incredible 2 pages! That are more than 10 postings! Sure nobody can read so much. And nearly all ask or answer your question, but it is just too much ...
Click to expand...
Click to collapse
[emoji4] but voting is only 3 works 2 not, so?
Wysłane z mojego XT1635-02 przy użyciu Tapatalka
What is expected to be done for next OTA to work? Just restore Nandroid backup of boot partition and everything should be ready for patchlevel newer than January 2017, right? And afterwards f2fs fixed kernel and Magisk again for having root again of course.
(twrp not flashed, no logo modified, system should be untouched)
---------- Post added at 09:14 PM ---------- Previous post was at 09:11 PM ----------
sebx_g1 said:
[emoji4] but voting is only 3 works 2 not, so?
Click to expand...
Click to collapse
Xposed does not work on Nougat by now. Magisk does. The 2 negative votes you counted referred to Xposed
Anyone have an adblock that works with systemless and passes safetynet? Do we need to check the "enable systemless for adblocks" in Magisk settings?
DNS66 do the same what do adblock, you can use it without root. But yes, there is special version of adblock systemless.
Wysłane z mojego XT1635-02 przy użyciu Tapatalka
Worked fantastically, thanks a lot!

AOSP Extended (Oreo) not booting with SuperSU 2.82 SR5

I've installed AOSP Extended 8.1.0 Oreo on the Axon 7. I'm also using @Chainfire's Aroma SuperSU Config zip to configure systemless mode. I've set it to sbin mode, with dm-verity disabled, encryption and forced encryption disabled for the data partition, factory reset protection enabled, xbin su binary binding disabled, and SELinux set to permissive. /system, /data, and /cache are formatted as ext4. I'm not using any custom kernels, just what was included with the ROM. When I try to boot, my device momentarily sits on the "Your device is unlocked and can't be trusted" screen. Afterwards it reboots to the bootloader menu and then into TWRP. No matter how many times I try booting this cycle repeats. I think that maybe SuperSU needs an update to address Oreo compatibility issues. I really don't want to use Magisk.
AnonVendetta said:
..... I really don't want to use Magisk.
Click to expand...
Click to collapse
Did you try to get it working with Magisk?
@NLBeev: Magisk does work, and I'm using it, but I would rather use SuperSU. I will ditch Magisk for SuperSU in a hot minute if someone can help me get it working.
On a side note, the ROM won't boot with Phh's Superuser installed either. I get exactly the same behavior. It seems Oreo has changed a lot of stuff.
AnonVendetta said:
[MENTION=528201]...Magisk does work, and I'm using it, but I would rather use SuperSU. I will ditch Magisk for SuperSU ...
Click to expand...
Click to collapse
There are many changes in Oreo that affect kernel and system files.
In Nougat SuperSU works great and also with rootswitch.
Unfortunately SuperSU is not updated since sr5.
I've been able to get SuperSU fully working on Oreo by:
1. Flashing SuperSU Aroma zip and configuring it for system mode installation
2. Then I flashed the SuperSU v2.82 SR5 zip
Afterwards the ROM boots up with no issues and root seems to be working as expected. I know system mode doesn't work with all ROMs, maybe I'm just lucky. Magisk is slow on my ROM and makes everything laggy. With SuperSU everything is smooth now.
AnonVendetta said:
1. Flashing SuperSU Aroma zip and configuring it for system mode installation
2. Then I flashed the SuperSU v2.82 SR5 zip
Click to expand...
Click to collapse
This worked for me and I didn't even know what the hell I was doing.

Strange Magisk installation behaviour

Hi guys.
I'm facing an issue with Magisk (stable and beta) that I never had before. I'm on OP5, PixelExperience, Android Pie (but I've tried also on a Oreo ROM yesterday, not sure if it was stable or beta version of Magisk). Here's the flash routine I do for every single ROM:
- Wipe everything, internal storage included
- Flash ROM
- Flash Magisk
- Boot
In the past few days, Magisk isn't installing MM, don't know why. It always installed MM on every single flash I did in my life, now suddenly it isn't installing it anymore. I haven't changed my flashing "habits", I do the exact steps I wrote above on every single flash (not on updates, of course).
This issue also leads to not being able to install modules from MM, but I can install them via TWRP (I've got the latest blu_spark, I'm decrypted, flashed no_verity_v2 for OP5). When I install modules via MM it says:
! /data/adb/magisk_merge.img mount failed.
I tried re-installing Magisk, using the uninstaller and then first time the stable, then the beta, but they won't installing MM after flashing.
What do you guys think?
Thanks.
EDIT: I've recreated the issue, I've attached the log. I tried 2 different modules, Sysconfig Patcher and Busybox. The first one is installing only via TWRP (via MM it produces the log in the attachments), the second one is istalling via MM correctly.
"update-binary: line 203: make_ext4fs: not found"
Unable to format the .IMG to ext4 it seems so there's no magisk merge image to be mounted
Not entirely sure where to go with that but it could be a start.
Bad version of twrp?
If I understand you correctly, the Busybox module install just fine, no matter if installed through the Manager or TWRP.
Have you tried other modules?
The Sysconfig Patcher module isn't using the official module template, so it's very likely that @VR25 need to fix something in his install script.
Didgeridoohan said:
If I understand you correctly, the Busybox module install just fine, no matter if installed through the Manager or TWRP.
Have you tried other modules?
The Sysconfig Patcher module isn't using the official module template, so it's very likely that @VR25 need to fix something in his install script.
Click to expand...
Click to collapse
Indeed, there's stuff to "fix". I've been working on that for a few days now. I noticed [some] recent ROMs lack a bunch of useful binaries, such as make_ext4fs and resize2fs. So, I'm migrating to Magisk Module Template and relying on Magisk's util_functions.sh for better "future-proof" compatibility.
Didgeridoohan said:
If I understand you correctly, the Busybox module install just fine, no matter if installed through the Manager or TWRP.
Have you tried other modules?
The Sysconfig Patcher module isn't using the official module template, so it's very likely that @VR25 need to fix something in his install script.
Click to expand...
Click to collapse
I tried YTVanced module, downloaded via MM and it installed just fine. So I think that, as VR25 said, the ROMs I've tried these days might have lacked of those utilities. So we might have "solved" this issue.
And what about the fact that flashing Magisk from TWRP doesn't install MM? Is it also related to the fact that those ROMs are recent?
Pipodi93 said:
And what about the fact that flashing Magisk from TWRP doesn't install MM? Is it also related to the fact that those ROMs are recent?
Click to expand...
Click to collapse
That happens once in a while, and may very well be ROM related. Fortunately, it's easy to install manually...
Didgeridoohan said:
That happens once in a while, and may very well be ROM related. Fortunately, it's easy to install manually...
Click to expand...
Click to collapse
Yeah, I thought so too. Because when I was on AICP, MM was installed after flashing. My concern was that "mount failed" was related to the fact that MM wasn't installed during the flashing operation, but I'm glad to see that's not the case and my phone isn't cursed. Thank you!

[TOOL] Magisk Module Manager for recovery v2.5 (Magisk 19)

Since mm isn't working on new Magisk 19, I took it for inspiration and created a simple manager, just for bypass some "bootlooper" module.
Just install it using recovery and run on terminal /data/media/magisk.
v1.0 - Initial build. Enabling and disabling functions
v2.0 - Added module removal function
v2.5 - No need to use storage to work. May avoid issues. Some others minor changes.
All thanks to
- topjonhwu for Magisk
- VR25 for mm
- TWRP team
- Me? Idk
Great work dev[emoji106], thanks
doesn't works for me (doesn't list modules)
mrhamed said:
doesn't works for me (doesn't list modules)
Click to expand...
Click to collapse
To list modules the script needs to write on /cache or /data. It will choose by itself.
Please send some screenshot of issue.
Looks very promising, especially enjoy having a GUI for this.
mrhamed said:
doesn't works for me (doesn't list modules)
Click to expand...
Click to collapse
I'm working to make script use no external files, so script will depends completely on your recovery binaries.
Hope to release it soon.
I suffer a boot freeze because of a bad module.
Cannot use TWRP and don't have module like Magisk Core Only installed.
I cannot boot to rooted system because of bad module.
Can boot non-rooted system only.
For my device LYA (Mate 20 Pro) which for rooting is using root-through-recovery-boot I can patch boot image with whatever Magisk edition which I assume is the best way to recover the device without full wipe.
Can a Magisk version be easily built which will either skip loading custom modules or delete them during boot? After successfully booting rooted I would flash a standard Magisk.
mikeos said:
I suffer a boot freeze because of a bad module.
Cannot use TWRP and don't have module like Magisk Core Only installed.
I cannot boot to rooted system because of bad module.
Can boot non-rooted system only.
For my device LYA (Mate 20 Pro) which for rooting is using root-through-recovery-boot I can patch boot image with whatever Magisk edition which I assume is the best way to recover the device without full wipe.
Can a Magisk version be easily built which will either skip loading custom modules or delete them during boot? After successfully booting rooted I would flash a standard Magisk.
Click to expand...
Click to collapse
I don't know if I got it correctly.
Well... commonly modules won't survive after Magisk removal.
If you can't access TWRP for flash Magisk uninstaller or disable the problematic module, you can try to flash or even boot the ROM's stock kernel through fastboot.
But if such module did others modifications into data, so you'll have to reflash whole ROM.
Are you planning on publishing this on magisk repo?
This has saved my bacon at least 4 times since installing it, many thanks Adriano
Saved me from bootloop module, works like a charm!
Adriano-A3 said:
Since mm isn't working on new Magisk 19, I took it for inspiration and created a simple manager, just for bypass some "bootlooper" module.
Just install it using recovery and run on terminal /data/media/magisk.
v1.0 - Initial build. Enabling and disabling functions
v2.0 - Added module removal function
v2.5 - No need to use storage to work. May avoid issues. Some others minor changes.
All thanks to
- topjonhwu for Magisk
- VR25 for mm
- TWRP team
- Me? Idk
Click to expand...
Click to collapse
It gives me the error "WTF?! The directory was here just now! It's gone! Please try again... Exiting..."
Thx bro, you saved my day
PixelHead0_0 said:
It gives me the error "WTF?! The directory was here just now! It's gone! Please try again... Exiting..."
Click to expand...
Click to collapse
Same here, on Samsung S10+ with August update, latest Magisk and Twrp.
very useful for android 10, thank you sir !
I can't understand how to run it on the terminal
will it work with Magisk 20.0??
Sivabalan said:
will it work with Magisk 20.0??
Click to expand...
Click to collapse
have you tried it? does it work on magisk 20.1
Confirmed working with Magisk 20.1, thanks a ton for this!
working on 20.2 + android 10

Categories

Resources