Magisk General Support / Discussion

Search This thread

pndwal

Senior Member
Well done, your perseverance paid off.
Clearly Magisk failed at disabling modules, shouldn't the ticket remain open?
Possibly... Others have made various suggestions for more reliable disabling of modules etc, and these have been closed...
Curious if you determined which module was the culprit.
Same...
Furthermore, it would be great to add a feature into Magisk Manager UI to set a flag for disabling modules, yes I realize that it would need to be set outside of /data/adb, why not in /data/local/tmp? rooted Magisk can check for existence of a disable_modules or similar file and not load modules.
I think any flag in data may be difficult to set w/ the TWRP / ADB issues this user had and others may face...

Entering Safe Mode from device off state w/ needed magisk Daemon detection is fraught on some devices also... I have a longstanding issue open for MIUI (and other devices?):
https://github.com/topjohnwu/Magisk/issues/4624

It seems that Magisk detects safe mode correctly when restarted into Safe mode (this method doesn't use key combo detection) so this alternative method from @Didgeridoohan might have worked (bit late to try now 😬) if this trick actually causes a detected reboot to safe mode from bootloader/fastboot screen as indicated:
If you cannot get the button combination working, you could also disable Magisk completely by flashing the stock boot image to your device. This should let it boot, but with Magisk (and thus all it's modules) disabled. From here you can activate Safe Mode from the Power Menu. Long press "Power Off" and you should get a prompt to enable it. Once the device reboots, press and hold the button combination to enter the bootloader menu or equivalent for your device. From here you should be able to then install a Magisk patched boot image (through fastboot, or equivalent) and when you then reboot your device it will go to Safe Mode which in turn will let Magisk disable all the modules and you can continue as described above.
https://www.didgeridoohan.com/magisk/MagiskModuleIssues#

... I'll keep that trick in mind...
What is the order of Magisk modules loading?
Is it ordered by Name?

If so, perhaps such flag can easily be added to BootloopSaver, but that would require people to have that module in the first place.
Bootloop Protector should just work as it is however as it checks looping (via Zygote Process ID mismatch for some 30 secs) before disabling modules and rebooting...

I love @gecowa6967's build-core-only-mode-magisk concept as a solution here however...

Simply adding an option in Magisk App to Magisk-patch a boot image with module loading parts disabled for emergency use seems to be a concept that may have legs and be useful for many especially when other methods to disable modules fail...

Comments?

😋 PW
 
Last edited:

badabing2003

Recognized Contributor
Sep 17, 2012
1,354
1,554
I think any flag in data may be difficult to set w/ the TWRP / ADB issues this user had and others may face...
Yeah that would be an issue if @gecowa6967 was stuck in bootloop, he was able to flash a stock boot.img and boot normally, install Magisk, create a patch, but booting to the patched version obviously had the issue.
My suggestion is to have an unrooted Magisk, set a flag in /data/local/tmp or somewhere convenient, so that a rooted Magisk will skip loading modules.
Basically
Same as your comment below, but without really having two different versions, disabling would be based on the flag.
Simply adding an option in Magisk App to Magisk-patch a boot image with module loading parts disabled for emergency use seems to be a concept that may have legs and be useful for many especially when other methods to disable modules fail...

Thanks for the tip from @Didgeridoohan I didn't think I could do that,
On Pixel phones you have to press the Power and Volume up to bring up the reboot options, and then long press the power button to boot to safe mode.
Great handy tip, thanks
 
  • Like
Reactions: ipdev and pndwal

pndwal

Senior Member
Yeah that would be an issue if @gecowa6967 was stuck in bootloop, he was able to flash a stock boot.img and boot normally, install Magisk, create a patch, but booting to the patched version obviously had the issue.
My suggestion is to have an unrooted Magisk, set a flag in /data/local/tmp or somewhere convenient, so that a rooted Magisk will skip loading modules.
Basically
Same as your comment below, but without really having two different versions, disabling would be based on the flag.
mmm... So just a simple fastboot flashable mod that only writes an empty file named 'disable' to /data/adb/modules would be perfect, but can we do this with fastboot?...

I guess you're actually suggesting a more complex mod to a boot image that is capable of writing similar files to data?...
Thanks for the tip from @Didgeridoohan I didn't think I could do that,
On Pixel phones you have to press the Power and Volume up to bring up the reboot options, and then long press the power button to boot to safe mode.
Great handy tip, thanks
Yup... bit late but might have worked...

I tested reboot to Safe mode from system with Magisk and it works to disable modules... Haven't tested if reboot to Safe mode from bootloader/fastboot occurs in practice when fastboot mode was called from Safe mode, or if Magisk Daemon detects this successfully to disable modules, but Didge suggests it should work and may have tested... PW
 

badabing2003

Recognized Contributor
Sep 17, 2012
1,354
1,554
mmm... So just a simple fastboot flashable mod that only writes an empty file named 'disable' to /data/adb/modules would be perfect, but can we do this with fastboot?...
We can't write to /data/adb/modules without root (and we're bootlooping with root), hence why it has to be to somewhere like /data/local/tmp
We definitely can create such file in adb which would have helped @gecowa6967 but can we create such file using fastboot?

I looked at fastboot commands, and I see this, but I have no idea how to use it and if it can help us create an empty file
Code:
Android Things:
 stage IN_FILE              Sends given file to stage for the next command.
 get_staged OUT_FILE        Writes data staged by the last command to a file.

If we can, then @gecowa6967 code, instead of disabling loading modules would simply look for the presence of such file and if found skip loading the modules.
 
  • Like
Reactions: pndwal and ipdev

zgfg

Senior Member
Oct 10, 2016
7,945
5,484
We can't write to /data/adb/modules without root (and we're bootlooping with root), hence why it has to be to somewhere like /data/local/tmp
We definitely can create such file in adb which would have helped @gecowa6967 but can we create such file using fastboot?

I looked at fastboot commands, and I see this, but I have no idea how to use it and if it can help us create an empty file
Code:
Android Things:
 stage IN_FILE              Sends given file to stage for the next command.
 get_staged OUT_FILE        Writes data staged by the last command to a file.

If we can, then @gecowa6967 code, instead of disabling loading modules would simply look for the presence of such file and if found skip loading the modules.

I don't see that Fastboot is needed (and I don't know of a command in Fastboot to achieve that)

But your previous post was in the great direction:

1) Flash a stock/original boot.img (not patched by Magisk) and reboot

2) Use adb to create a file in /adb/local/tmp to flag which (or put it simple - just all) modules to be disabled

Even more user friendly: let it be a file on Internal memory (like in Download folder) - hence one does not even need to pinpoint with adb

For this, root is not needed and without Magisk, there should be no bootloop due to the modules

3) Then flash back the patched boot.img and reboot.
Magisk should read the file from step 2 and disable the module(s)

---

Although I still don't understand what is wrong with Safe Mode. Are there devices that cannot boot to Android Safe Mode, or just ppl don't know about, or don't know (google about) how to use the fingers to boot to the Safe mode
 
Last edited:

badabing2003

Recognized Contributor
Sep 17, 2012
1,354
1,554
Even more user friendly: let it be a file on Internal memory (like in Download folder) - hence one does not even need to pinpoint with adb
Yeah, even better and more friendly
Although I still don't understand what is wrong with Safe Mode. Are there devices that cannot boot to Android Safe Mode, or just ppl don't know about, or don't know (google about) how to use the fingers to boot to the Safe mode
I think safe mode using key combination is not very reliable, or at best requires a tricky timing.
@gecowa6967 can comment, but it wouldn't work for him, not sure if it booted to safe mode and Magisk failed to disable the modules (in which case it would be a Magisk bug) or Safe mode never got activated.

I personally didn't know that we could boot to safe mode from the UI, which was a great tip that we can try if this happens again, I know that gecowa6967 was not the only one that experienced this issue.
 

zgfg

Senior Member
Oct 10, 2016
7,945
5,484
Yeah, even better and more friendly
More thoughts about:

- Magisk uses /data/adb (not /data/local/tmp or Internal memory) since an app needs a root to access there.
Otherwise, all banking and similar apps would be able to read the Magisk config files (which modules to disable, etc) and that would give them just one more and totally a simple way to seek for the 'oot'

- Since Magisk does already have a way to mark which modules have to be disabled (disable files in the corresponding /data/adb/modules folders), and since those have to be there (see the previous remark), we have to be very careful if proposing a new/additional file to disable the modules, plainly visible on Internal memory, how would it look and work like

- To avoid a conflict (and a question of precedence) between that new file and the established disable or uninstall files in /data/adb/modules folders, it has to be something very simple and limited only to the really emergency use

- Ie, a file that will force Magisk to boot to the root-only mode (that includes that all modules have to be disabled).
Magisk might even delete that file once it consumes the command, or user will be responsible to delete the file - knowing that as long as he does not delete, Magisk will continue booting to the root-only mode

That way, the file will be present only temporary and in special case, hence it won't cause a conflict with the existing modules flags (disable and uninstall files) in /data/adb/modules folders, and that new file would not become a common open door to seek for the Magisk presence

----

I cannot find it now but I think there used to be a setting to force Magisk to boot to the root-only mode, and it used to use a config file like disable_magisk in /data/adb or so (sorry, I also didn't search through the documentation now before posting)

Hence something like that but on Internal memory now, that user can easily create it by one-time booting without Magisk...

---

But there is already a great Magisk Bootloop Protector module (and the corresponding mechanism built-in to Magisk Delta) by @huskydg - read more about and install from (it can be also found by Fox MMM):

In fact, nost of the stuff above (a control file on /data/local/tmp and so) makes actually a re-inventiion of the wheel, once compared to the documentation how already the MBP module works😁
 
Last edited:

badabing2003

Recognized Contributor
Sep 17, 2012
1,354
1,554
- Magisk uses /data/adb (not /data/local/tmp or Internal memory) since an app needs a root to access there.
Otherwise, all banking and similar apps would be able to read the Magisk config files (which modules to disable, etc) and that would give them just one more and totally a simple way to seek for the 'oot'
Yes of course, this file needs to be written by a user / process without root for emergency purposes, this is not something that should be there permanently or be used in any other way,

Ie, a file that will force Magisk to boot in the root-only mode (that includes that all modules are disabled.
Magisk might even delete that file when it consumes the command, to prevent that file remains.
That would be perfect, in fact consuming it is a good idea, basically the no modules boot is a one time thing. if the user just reboots, the Magisk will attempt to load the modules.
It's up to the user to delete modules that are causing an issue.

Hence something like that but on Internal memory, that user can easily create it by one-time booting without Magisk (and hence without his bootloop problem)
yep
Most of the stuff about (a control file on /data/local/to or Internal mem) is actually a re-incentiion of the wheel, when you read the documentation how the MBP module works
Indeed it is, the only catch with MBP is that users need to have had that module prior to the problem.
I do, but do we all, this being integrated into Magisk makes it simpler and easier.
 
  • Like
Reactions: ipdev and zgfg

pndwal

Senior Member
We can't write to /data/adb/modules without root (and we're bootlooping with root), hence why it has to be to somewhere like /data/local/tmp
We definitely can create such file in adb which would have helped @gecowa6967
Yup, but doesn't this still require USB debugging enabled?... And @gecowa6967 had issue where adb command magisk --remove-modules had no effect...
but can we create such file using fastboot?

I looked at fastboot commands, and I see this, but I have no idea how to use it and if it can help us create an empty file
Code:
Android Things:
 stage IN_FILE              Sends given file to stage for the next command.
 get_staged OUT_FILE        Writes data staged by the last command to a file.

If we can, then @gecowa6967 code, instead of disabling loading modules would simply look for the presence of such file and if found skip loading the modules.
Yup... No idea either. 😶
I don't see that Fastboot is needed
It's just a working possibly (actually allowed the fix used); seems ADB (requires USB debugging enabled anyway) and Safemode (user could only enter it w/ unpatched boot image) had no effect and are also often inaccessible to other users...
...Even more user friendly: let it be a file on Internal memory (like in Download folder) - hence one does not even need to pinpoint with adb

For this, root is not needed and without Magisk, there should be no bootloop due to the modules

3) Then flash back the patched boot.img and reboot.
Magisk should read the file from step 2 and disable the module(s)
This seems a good approach...

My further thoughts: Seems it would be even simpler to restore old core-only mode toggle in-app instead of using a file-based flag however...

Of course we could then simply flash unpatched image and set this mode in such an 'emergency' before re-flashing patched image to boot Magisk w/ modules disabled! 🤪

This would also circumvent these difficulties:
- Magisk uses /data/adb (not /data/local/tmp or Internal memory) since an app needs a root to access there.
Otherwise, all banking and similar apps would be able to read...

Magisk might even delete that file once it consumes the command...
-----​
I think safe mode using key combination is not very reliable, or at best requires a tricky timing.
Correct...
@gecowa6967 can comment, but it wouldn't work for him, not sure if it booted to safe mode and Magisk failed to disable the modules (in which case it would be a Magisk bug) or Safe mode never got activated.
He was only able to boot to Android Safe mode w/o root (ie after flashing unpatched boot image) which doesn't trip Magisk Safe mode (requires running Magisk daemon to detect Safe mode triggers and to set flags for disabling modules)... Not a Magisk bug since it wasn't running! 😉
I personally didn't know that we could boot to safe mode from the UI, which was a great tip that we can try if this happens again, I know that gecowa6967 was not the only one that experienced this issue.
And need for running Magisk daemon is the key to this too; We boot to Android Safe mode w/o root but rely on reboot after a fastboot flash (we access fastboot from Safe mode to flash Magisk-patched image) being reboot back to Safe Mode... Modules will only be disabled at this point...
Although I still don't understand what is wrong with Safe Mode. Are there devices that cannot boot to Android Safe Mode, or just ppl don't know about, or don't know (google about) how to use the fingers to boot to the Safe mode
User simply couldn't get access w/ key combo w/ patched boot image, but this is also problematic due to Magisk's need to detect user entering key combo (booting from off state only) and timing is also critical... Eg on MIUI we can generally get Android Safe Mode w/o triggering Magisk Safe Mode unless we alter the usually key release timing... I know others have also had different problems with this approach...
In fact, nost of the stuff above (a control file on /data/local/tmp and so) makes actually a re-inventiion of the wheel...
Praps we could just use an old wheel (Core Only mode) again for emergency use!... 😋 PW
 
  • Like
Reactions: badabing2003

m0han

Senior Member
Apr 30, 2012
5,191
2,198
.....the only catch with MBP is that users need to have had that module prior to the problem.... this being integrated into Magisk makes it simpler and easier.
Screenshot_20221004_130934.jpg
 

gecowa6967

Member
Nov 11, 2020
17
12
Yeah, even better and more friendly

I think safe mode using key combination is not very reliable, or at best requires a tricky timing.
@gecowa6967 can comment, but it wouldn't work for him, not sure if it booted to safe mode and Magisk failed to disable the modules (in which case it would be a Magisk bug) or Safe mode never got activated.

I personally didn't know that we could boot to safe mode from the UI, which was a great tip that we can try if this happens again, I know that gecowa6967 was not the only one that experienced this issue.

Yes, I was not able to boot into safe mode using key combination when I was using the patched boot image.

I only have the log of the bootloop I posted before, I do not know which module caused the issue. Once I was able to boot with my modified patched boot image, I ran "magisk --remove-modules" to remove all modules.

When I ran "magisk --remove-modules" with the "normally" patched boot image during boot, the phone would restart, but the modules would not be removed. I think magisk did not have write permission for the folder or something like this.

The idea of a "dumb" patched image that does not load any modules would have been good, that's why I posted the APK for anyone else having this issue.

I am very grateful for all the kind feedback you gave me for my hacky solution. And also thank you to my roommate who helped me with all of this. :)
 

badabing2003

Recognized Contributor
Sep 17, 2012
1,354
1,554
Does any of the resident Magisk experts know what process is responsible for creating magisk_backup of the stock boot.img ?

This post peeked my interest about the issue.
I started looking at this gist and did some investigation on my phones.

And I first posted by observations / questions in here.

To summarize.
It appears that Magisk stores a reference to the last stock boot.img's SHA1 in a config file (see location in the above gist)
And this is my Pixel 6's contents
Code:
KEEPVERITY=true
KEEPFORCEENCRYPT=true
PATCHVBMETAFLAG=false
RECOVERYMODE=false
SHA1=2bde725117d3bd0990437faf06d37baa9adeb818

All the entries make sense, and the SHA1 matches October release's stock boot.img SHA1
All good.

Then looking at the Magisk backups, I see the following backup
Code:
drwxr-xr-x   2 root     root      3452 2022-10-03 14:21 magisk_backup_7f04123661284ff8d554f01060b00eb6f188a07b

The date / time of the backup matches when I dirty flashed the October release including the patched boot.img through PF (not other flashing was done since)

I find it odd that the backup SHA1 is the SHA1 of the September's boot.img SHA1, but created when I flashed the October image.

Aside from the concern of why it is not the correct one, my question is, what process did actually create that?
I never flashed anything directly in Magisk, (no Direct Install)
I only created patched image using boot_patch.sh.
So I thought perhaps patch creation actually creates the backups, but that is not the case.
I moved that folder out, and created a patch both in Magisk Manager UI and through boot_patch.sh
None created it.

It can't possibly be created by a dirty flash through fastboot, so what is actually creating it, and why it backed up the old boot.img?
Perhaps this relates to the mystery I reported here.
 
  • Like
Reactions: pndwal

pndwal

Senior Member
Goognisance?

John Wu, 59m

I recently got the chance to know how many devices are running Magisk (yes, some teams at Google are tracking Magisk usage closely 🕵️), and the number is actually INSANE. Also, it only counts devices running GMS; I know for a fact that there is a substantial userbase in China.

Just a reminder that rooting Android is nowhere near dead, and is here to stay 😉
www.twitter.com/topjohnwu/status/1577787539116605442

😋 PW
 

pndwal

Senior Member
Does any of the resident Magisk experts know what process is responsible for creating magisk_backup of the stock boot.img ?

This post peeked my interest about the issue.
I started looking at this gist and did some investigation on my phones.

And I first posted by observations / questions in here.

To summarize.
It appears that Magisk stores a reference to the last stock boot.img's SHA1 in a config file (see location in the above gist)
And this is my Pixel 6's contents
Code:
KEEPVERITY=true
KEEPFORCEENCRYPT=true
PATCHVBMETAFLAG=false
RECOVERYMODE=false
SHA1=2bde725117d3bd0990437faf06d37baa9adeb818

All the entries make sense, and the SHA1 matches October release's stock boot.img SHA1
All good.

Then looking at the Magisk backups, I see the following backup
Code:
drwxr-xr-x   2 root     root      3452 2022-10-03 14:21 magisk_backup_7f04123661284ff8d554f01060b00eb6f188a07b

The date / time of the backup matches when I dirty flashed the October release including the patched boot.img through PF (not other flashing was done since)

I find it odd that the backup SHA1 is the SHA1 of the September's boot.img SHA1, but created when I flashed the October image.

Aside from the concern of why it is not the correct one, my question is, what process did actually create that?
I never flashed anything directly in Magisk, (no Direct Install)
I only created patched image using boot_patch.sh.
So I thought perhaps patch creation actually creates the backups, but that is not the case.
I moved that folder out, and created a patch both in Magisk Manager UI and through boot_patch.sh
None created it.

It can't possibly be created by a dirty flash through fastboot, so what is actually creating it, and why it backed up the old boot.img?
Perhaps this relates to the mystery I reported here.
This may help as a starting point:

Check code after lines 608, 617 (# Installation Related section, # Legacy backup, # Stock backups) here:
https://github.com/topjohnwu/Magisk...a0346615d5fea79f6bc/scripts/util_functions.sh

🤠 PW
 

badabing2003

Recognized Contributor
Sep 17, 2012
1,354
1,554
This may help as a starting point:

Check code after lines 608, 617 (# Installation Related section, # Legacy backup, # Stock backups) here:
https://github.com/topjohnwu/Magisk...a0346615d5fea79f6bc/scripts/util_functions.sh

🤠 PW
Thanks

@capntrips led me to the same piece of code in the other thread.
Then to avoid cluttering that thread, we took it to a conversation.
For posterity and benefit of others, I'll summarize the findings and the tips below.

  • If rooted boot_patch.sh creates stock_boot.img file in the directory where boot_patch.sh is run, typically /data/adb/magisk
  • Simply opening Magisk Manager app, run the run_migrations routine, which creates the backup and then deletes the stock_boot.img
  • When a patch is created through Magisk Manager, the stock_boot.img file is created in: /data/user_de/0/com.topjohnwu.magisk/install/stock_boot.img
  • For obvious reasons (root might still not be available at that point), the migration is not performed, Magisk application restarts have no effect.
  • Upon reboot, Magisk migrates the stock_boot.img to /data/adb/magisk and then run the migration, effectively creating the backup and clearing /data/user_de/0/com.topjohnwu.magisk/install

Things still to check / verify
  • Is /data/user_de/0/com.topjohnwu.magisk/ path constant or varies per device / platform ?
  • where is the config file that stores the SHA1 value created when Magisk Manager is used.
The following piece of code (thanks @capntrips ) would run the migration, and hence could be invoked programmatically and not require Magisk manager start.

Code:
cd /data/adb/magisk
./magiskboot cleanup
. ./util_functions.sh
run_migrations
 

pndwal

Senior Member
Rooting itself is here to stay.

However, over time, fewer and fewer other apps will work properly on a rooted Android device.

Rooting is dead. Long live rooting.
But not yet!

... And , of course, you're only speaking of the (small) subset of apps who's Devs require proper attestation to an unmodified execution environment, and who's designs you want to take advantage of while circumventing the same... and their wishes...

The vast majority of apps are not threatened at all!

... And not yet because Google has clearly been in no great rush to fix that attestation...

And of course many of us thought this would have been achieved years ago!... Ie. Game Over for the mouse... But the Cat hasn't killed the mouse yet; it's still playing with it... so the game continues!

Fun eh! (?)...

... Bye, MagiskHide. Long live MagiskHide (Wu) - PW

Perspective is a funny thing...
 
Last edited:

YNSHNDR

New member
Oct 7, 2022
1
0
Hello can you help me please !
me installing a magisk and twrp to the xiaomi mi 9T device after and while installing, I accidentally installed it on the boot partition instead of the recovery, and then when I restart, fastboot mode starts, so it does not boot. log files are attached
 

Attachments

  • recovery[1].log
    24.7 KB · Views: 1
  • logcat[1].txt
    16 KB · Views: 2
  • dmesg[1].log
    275.4 KB · Views: 1

Top Liked Posts

  • 1
    Good day everyone i have a problem in disabling my dm-verity using magisk, im trying to disable the dm-verity of my phone using magisk and after i flashed it i always ended up in bootloop it will only boot if the forcencryption option is enabled any solution how to solve this? Im still amatuer.


    Device name: Oppo A71 CPH1717
    Color Os: 3.1.0
    Android version: 7.1.1
    Magisk installed: Magisk 25.2 latest
    Bootloader unlocked
    When disabling forced encryption, you usually have to delete data or factory reset so a new, unencrypted data partition is created. At least that is what I had to do when I used it on older, Android 6 devices I used to have.
    1
    thank you for answering me sir, how am i going to factory data reset if im not able to boot up should i use stock recovery or twrp recovery?
    Yes, you can use the stock or twrp recovery to do the factory reset.
  • 8
    New Shamiko-v0.6(126)

    With this new Shamiko, Momo does no more detect Zygisk and Zygote (official latest Magisk Canary 25205, Zygisk enabled, DenyList configured and not enforced, Shamiko v0.6 in default black-list mode)
    7
    Just Curious
    Which command did you use to flash the patched_magisk...img with?
    1. fastboot flash init_boot magisk_patched...img
      or
    2. fastboot boot init_boot magisk_patched...img
    I think they both will work. :)
    Personally, unless booting an image is not an option..

    I always test boot the Magisk patched image using fastboot boot NameOfFile.img instead of flashing it.
    If it boots, Magisk will be active and I then use the Direct install option to make it permanent.
    If it does not boot, then no harm since the stock boot image is still installed. 🙃

    Cheers. :cowboy:
    7
    S-Check:

    Root detection, as on the screenshot

    I can pass with Delta but cannot with TJW Canary

    Delta:
    latest, Zygisk, MagiskHide, no Shamiko, App Data Isolation, HMA

    Canary:
    latest, Zygisk, DenyList, Shamiko, App Data Isolation, HMA, even with Magisk app uninstalled

    I have tested thoroughly on my two Xiaomi phones, one with A11 and the other with A12.
    Tested on both phones with Canary and with Delta - and I have the same results on both phones

    Not to mention that I fully pass Oprek, Ruru, TB-Checker, SafetyNet/Play Integrity
    Yup, Native bridge loading based on Maru Magisk fork implementation of Riru's loading method seems to have much merit...

    Nb. Original author says it's an experiment however, still not perfectly implemented and may be issues w/ some modules... Also Shamiko hiding with probably not work properly with this... Long read here for those interested:
    https://github.com/5ec1cff/my-notes/blob/master/maru.md

    For others, I put more here too:
    https://forum.xda-developers.com/t/...third-party-magisk-fork.4460555/post-87729841

    🙂 PW
    Worth pointing out that @zgfg asked me to test that on Magisk Canary (official) earlier but ive broken something it seems with my uber Samsung debloat and cant get S-check to even open anymore :)

    Anyone else care to chime in with Magisk Canary (official)
    I had that issue a while back, I do not remember what I did to fix it. :unsure:
    I just setup my Pixel 5a (it did not like updating from July to November 🙄) so clean flash. 😛

    No issues with Security Check. 🙂

    Pixel 6 - Stock Google 12L (July 2022).
    Pixel 5a - Stock Google 13 (November 2022).

    Magisk debug (snapshot)
    - Personal build from the official branch, so it includes the commits since the last canary/debug release.
    Magisk - [GitHub] - Building and Development

    USNF - Not the one that includes Displax's changes.
    - Personal test build that includes some other (mostly prop) changes.
    Fork - [GitHub] - commits
    One of these days I will have to pull Displax's Zygisk changes. 🙃

    MHPC
    - Set fingerprint back to stock Pixel 12.
    Pixel 6 is using the Pixel 6 12 print, 5a is using the 5a 12 print.

    Shamiko and LSPosed modules.

    HMA (Beta v3.0.5 r373)
    Two templates.
    Magisk
    - Settings (renamed Magisk app).
    - Hide My Applist.

    PlayStore
    - YouTube
    - YouTube Music​

    AdAway running in VPN (non-root) mode. ;)

    Cheers. :cowboy:
    6
    Personally, unless booting an image is not an option..

    I always test boot the Magisk patched image using fastboot boot NameOfFile.img instead of flashing it.
    If it boots, Magisk will be active and I then use the Direct install option to make it permanent.
    If it does not boot, then no harm since the stock boot image is still installed. 🙃

    Cheers. :cowboy:
    Some have said it's a waste of time to test by booting first, then direct installing because you can just flash the stock image back if it doesn't work.
    This maybe true, but directly flashing the patched image does NOT give Magisk the chance to back up the stock boot image, whereas booting then installing does.
    This makes it easier to take an OTA update on devices that require everything to be pure stock before proceeding by using Magisk's restore images function.
    6
    Hello everyone!

    Thank you for the very active thread i finally managed to figure out what i did wrong (yet again).

    I rarely tinker with the device, and when i am forced to, then i forget about A/B partitions, and wipe boot.img.

    I was hoping there is now another way for keeping TWRP and Magisk. Aside from embedding twrp image in stock boot, and than patching from magisk manager?

    Thank you.

    Also if someone more knowledgeable could help (even though it is slightly Offtopic), do i patch boot img with firmware boot img, or boot img from the custom rom i was using?

    Because that rom was then for testing (even though i kept it), and i can't figure out the version.
    I suspect when i run adb shell getprop "ro.product.version" it will probably fail, because i did a number on that device trying to fix it without understanding A/B partitions.
    Only if you don't have Recovery partition, then you patch TWRP to Boot (and afterwards the Magisk)

    (It's not necessarily specific to A/B devices - there are A/B devices that do have separated Boot and Recovery partitions, and in that case TWRP goes to Recovery partition, Magisk to Boot)

    But when you update Magisk, you can just take Direct Install (update)

    ---

    And of course, you must patch the boot.img corresponding to your current ROM. Usually, you can find it in the ROM zip file

    If you use some stock boot.img instead, then you risk the bootloop (of course, if boot img from your custom ROM coincides with the stock boot img then it doesn't matter, but usually it won't be the case - or you will not know

    That does not depend on Magisk - if the boot.img is wrong and you flash it (with or without Magisk) it will cause the bootloop (in the 'better' case, it may boot but you might have troubles later because of eg the wrong Kernel).
    Hence make sure to always use (for patching) the correct boot img
  • 1089
    This is the place for general support and discussion regarding "Public Releases", which includes both stable and beta releases.
    All information, including troubleshoot guides and notes, are in the Announcement Thread
    156
    Hello, I haven't given much support on XDA lately. It can be resulted from
    • University started and I have limited free time. In fact, I mostly develop during midnight
    • I live in Taiwan, which has large time zone differences between my European/American contributors/testers, which usually forces me to stay up late at night to discuss/test stuffs.
    • The new version is about to come, I don't want to spend effort on supporting old releases
    The planned update is delayed again and again, to some point I think I'll shed some light about what has been happening lately, also along with some announcements.

    New Forum!
    As you might have already discovered, Magisk got its own subforum on XDA! Many thanks to all the support you gave me, and much more information/features/support is about to come!
    **For developers supporting all the devices that are not using standard Android boot format, feel free to create threads in this section (actually, PLEASE do so) for your favorite devices after v7 is out. As I currently know, Asus devices require signing the boot image before flashing, and is model dependant; Sony devices seems to use ELF kernel that is unpatchable, or some has two ramdisks (inner + outer), both requires different workarounds; LG bootloader locked devices has to manually "BUMP" the boot image after flashing Magisk..... and there may be lots of other crazy boot image formats that haven't come up to my attention yet.
    It is impossible for me to support all these non-standard boot images, and I hope the community can collaborate to make Magisk running across all the devices. Overall, community collaboration is what XDA about :D

    The Pixel Phone
    Some of you might already know this news, that the next Pixel Phone right around the corner seems like it does not have ramdisk in boot image, which pretty much wrecked Magisk in all ways. However, it pretty much doomed root itself too. Kernel modifications is inevitable IMO, so I'll try to migrate my scripts to C programs that could possibly be included into the kernel itself. Note that I'm not familiar with linux kernel, I'm not even sure if my idea and concept is correct or not. But once the device is available, I think developers will find a way to bypass all the difficulties, and I'll do my best to learn things ;)

    Current Progress
    In the past month, I've spent quite some time learning SELinux, so that I can avoid using SuperSU's sepolicy patches. Thanks to the helps and tips from @phhusson and @Chainfire, I finally have a much clearer understanding of how SELinux works. The Magisk core parts (the scripts, boot image patches, new features, more supports) are actually done some time ago. What is causing all the delays is the Magisk Manager.
    To be completely honest, although I can code in Java without much issues, Magisk Manager is actually my first Android application, I had to reach out for assistance, and fortunately awesome developers like @DVDandroid and @digitalhigh contributed a lot, which makes the current Manager awesome.
    After the repo system and module management is mostly done, I was about to do some adjustments and release, but what we really done is decided to add another feature: auto-unroot with per-app settings. I decided to wait for it to be finished, and then do my adjustments. Due to reasons that'll be mentioned later, this feature will likely not be available for the next release (should come in future updates)

    Safety Net Disaster
    Those who are using Magisk for Safety Net bypass purposes must have known that Google recently updated the detection method of my Systemless Xposed. I still have no idea what Safety Net is detecting, so currently I cannot fix it on my side (also because I'm busy working on the next update). However, suhide developed by @Chainfire is able to hide Xposed and worked fine.
    However, only my Systemless Xposed v86.2, which is based on SuperSU's su.d, is supported using that method. v86.2 and v86.5 (latest, Magisk based) have nearly identical binaries, and the only difference is the path where the binaries are stored.
    I'm still not sure what's the real issue for it not being supported, I just hope it is not done intentionally.

    Conclusion
    Due to the fact that my Safety Net bypass is not 100% perfect now, I do not want to spend any more time waiting for auto-unroot to be polished. What I'm doing now is finishing up all the things I'd like to change in Magisk Manager (it has been a while since I last contributed to Manager, my fellow developers are doing all the heavy job), which might take a little more time, after that, packed with tons of information to be announced in Magisk Section, I'll release the long awaited update.

    Hope this lengthy post gives you the idea of the whole situation, and again thanks for all your support!!
    121
    Ah, some Chainfire bashing, I hope it is not too late for me to exercise additional villainy.

    First, let me make clear I have nothing against @topjohnwu, nor against Magisk. Magisk is an interesting project and it certainly displays @topjohnwu ingenuity and persistence. I don't doubt we will see more interesting things from his hands.

    -------------------------

    What has happened here is not all that dark and complicated, from either end. I returned from holidays, and someone pointed me at Magisk. My first thought: interesting!

    Among other things, the thread lists some issues with SuperSU, which in combination with the phrase The developer also requests users to not bug Chainfire with compatibility requests for SuperSU with Magisk from the portal article, raised my left eyebrow by nigh half an inch. The popular systemless xposed mod is apparently now based on it, and apparently it now no longer works with SuperSU, and apparently I'm not supposed to fix that, nor any of the other found issues. I found that a bit weird. So yes, I have told @topjohnwu that I was a bit surprised he was posting about issues with SuperSU without notifying me about them (I can't fix or help fix issues I'm not aware of, after all).

    He's also spreading a modified version of the SuperSU package, which is not all that uncommon, nor necessarily a problem. I have not looked into what he modified, I only ran a few quick tests on one of my devices, and found some commonly used commands run as root to be broken. I have informed him of this as well.

    It appears the tool of choice for Magisk is phh's Superuser, because of some of the mentioned issues with SuperSU. That's fine by itself, but fixing issues in that superuser by incorporating SuperSU's binaries into it is a somewhat questionable practise. After all, SuperSU is a commercial closed-source package that helps pay for my dinner, and superuser is a direct competitor. I have informed him that I was surprised he did this without asking for permission. I have expressed similar surprise on him spreading a modified version of LiveBoot (which helps pay for a snack now and then).
    @topjohnwu has also stated that Magisk's scripts are largely influenced by mine (I have not checked). Scripts based on mine are used all over the place on XDA, some people have crafted amazing things based on them, I have never made an issue of this (otherwise I would have just made them binaries). But yes, I have also stated to him that I don't think it's very nice to base something on one program, and then using that to (almost exclusively) push something directly competing with that program.

    tl;dr Towards @topjohnwu, I have:
    - expressed surprise he has issues getting Magisk to work with SuperSU, and has chosen not to inform me about those
    - expressed surprise he is using SuperSU binaries in a competing superuser without permission
    - expressed surprise he is posting a modified LiveBoot without permission
    - informed him of issues with the modified SuperSU he has posted
    - let him know I thought it wasn't very nice to be applying my scripts to benefit seemingly exclusively that same competing superuser

    To be crystal clear:
    - I have not asked for an apology
    - I have not asked for Magisk to be abandoned, neither the root hiding nor systemless module parts, and certainly not systemless xposed
    - I have not made an issue of any of this anywhere, until this post
    - I have not even specifically asked for anything to be taken down (though obviously in my opinion the other superuser package mixed with SuperSU's binaries, as well as the LiveBoot package, should go)
    - I have not reported this thread to XDA moderators for copyright violations or otherwise

    While my conversation with @topjohnwu may not win any awards for being friendly (though it may win some for brevity), I think all things considered my response has been rather mild. To be perfectly honest, until the apology post, I thought this was over with already. I think the apology post was triggered because I haven't replied to his last PM for a while - I was in the zone, it happens.

    To emphasize again, I have nothing against @topjohnwu, Magisk, or systemless xposed, and it is certainly not my goal to see any of them go. If it can be made to work together with SuperSU, great.

    I get it though: you think of something, you want to see if you can make it work, you finally get it to work, you publish it, it takes off - enthusiasm gets the better of you. Maybe in the rush some mistakes are made. That doesn't mean you have to just drop it and run. None of my stuff would make it past 0.1 if I stopped at the first big mistake :)

    Aside from said being in the zone coding, I usually regret actually responding to these sort of things the day after, which has made me hesitant to reply. Surprise me.
    76
    Thread temporarily closed so everyone sees this.

    The flood of "SafetyNet isn't working for me either!" posts are not helpful, at all. Please refrain from posting further, it will be looked into. Please do not forget that not passing SafetyNet is 100% NORMAL AND INTENDED when you have an unlocked booloader or running custom firmware. These are workarounds and they will be worked around in turn.

    The Flash
    Forum Moderator

    EDIT: Thread is reopened... I will be cleaning any SafetyNet posts for a while to keep the thread clean for real issues.
    75
    Hello everyone!

    I am aware that Google has updated Safety Net that makes Magisk itself a no go for Android Pay. In fact, I witnessed the change live while I am developing the new magiskhide, which should hide all Magisk modules and Magisk installed root.

    Google is serious about Safety Net now, clearly hunting down all possibility to run Xposed with Safety Net passed. I spend quite some time examining the new security measures last midnight, and fortunately it seems that it is possible to run Magisk and root along with Safety Net if no Xposed is running. I'm glad I removed the old root toggle at the right time lol, that is no longer feasible with the latest detection.

    So stay tuned for the next update, it will come with bug fixes, along with the new magiskhide to bypass that Safety Net.

    Google, how will a few systemless mods do any harm :p:p