yashsingh1/xdaforums huggingface dataset:
[Magisk] zgfg:
Are you talking about 25209 and 25210 Delta or official Canary?

Or are you constantly switching from one to another?

(In some posts you say "I'm now or 25xxx Delta")

Magisk Delta 25210 does not include regression flaw from the official Canary 25210 - with Delta 25210 modules do work and specially Systemless Hosts/AdAway works

Hence, with Magisk Delta there is no, and there was no need to downgrade Magisk to 25209 or so

---

I have two devices, one with Delta (Canary), the other with offcial Canary

On my daily driver with Delta, I have upgraded through practically all versions (sometimes they are coming too fast, two the same day or so and I maybe skip one)

But all my modules, incl. Systemless Hosts worked with all Delta releases and I never needed to downgrade Magisk Delta

Only on my older, spare phone where I run official Canary - there,yes, modules (those that mount their changes to System partitions, like Systemless Hosts) do not work and I had to revert to 25209 (that version has another regression flaw: it does not properly patch stock boot.img - but that bug was also not 'ported' to Delta 25209 - btw, that's one of the reasons I run Delta on my daily driver)
[Magisk] m0han:
Would've been useful info back then, I'd say.
[Magisk] zgfg:
Are you asking how to switch from one slot (eg B) to another (slot A) or how to stay with the same slot but boot with another boot img?

These are different things. Please if you are new to A/B devices, google about the concepts

---

1)

You can switch the active slots from Fastboot:

fastboot --set-active=a

or

fastboot --set-active=b

And the following command will give you various info, incl which slot is currently active:

fastboot getvar all

It's also possible to switch slots from TWRP (if TWRP is available for your device)

Please google for more details (they were also posted in this thread but maybe months ago)

However, pls be aware, on some phones that other slot is maybe not bootable (System or its parts are missing there) and when you switch to that slot, phone will boot(loop) to Fastboot

Fortunately, you can execute then the above command from Fastboot, to switch back to the bootable slot

---

2) However, you can stay with your currently active slot but choose to temporarily boot with another boot img (present on your PC)

For that, use:

fastboot boot <some-boot.img-from your PC>

That command does not flash the given boot.img, it just boots one time to the given boot.img

That way you can eg test if your boot.img patched by the new version of Magisk is ok - you temporarily boot to that img:

- if all ok, do Direct install

- if not ok, just reboot and the phone will reboot to the 'old' boot.img that you successfully used before

But again, if your currently active slot is not bootable (eg, System partitions are missing on that slot), playing with boot images will 'not help'

Ie, be aware that on dual slot devices, each slot contains its own System, not just Boot - only the Data and Storage are common
[Magisk] zgfg:
Magisk Delta has its own thread. And in that thread it WAS NEVER posted about that bug with modules for 25210, and WAS NEVER discussed there about the need to downgrade Delta to 25209

Btw, if you are a Delta user, you should better monitor also its TG support channel (to promptly read about the potential bugs in the new Delta releases, etc)

This thread here is generally for (official) Magisk - hence if not specifically stated otherwise, discussion here applies to the official Magisk (not to Delta, Alpha, Lygisk, etc)

Btw, pndwall afaik (sorry if I'm wrong) does not run Magisk Delta - hence he could not advice you accountably and accurately about Delta😁

Ask about Delta in the Delta thread

---

Btw, when HuskyDG upgrades his Delta to the latest (eg 25210) commits from the official Magisk - it does not mean that he would also upgrade to the new regression bugs from the official code

First, he does not release blindly (expecting users to find the obvious bugs like that one that modules do not work)

Second, if some serious bugs are really found in the new Delta, then he withdraws the problematic release and/or immediately releases the new Delta upgrade with the fix

Particularly, Delta 25210 (first 25210, many newer 25210 followed with the changes back and forth in Delta UI) was released like a day later than the official Canary 25210. And by that time it was already known about the bug with modules in the official Canary 25210. Hence, he had enough time to include the fix before releasing Delta 25210

All that is also another reason (the main one being the better options to hide root) I chose Delta for my daily driver👍

However, if there was no official Magisk, there would be no forks (like Delta)

Hence the main credits go to the Magisk founder TJW and the whole group of developers who maintain the official code - incl. now the active group of (mostly, female Chinese) developers around Magisk Alpha (imo, Delta was also inspired by Alpha and the concepts we've seen there)
[Magisk] pndwal:
Well if it installs 25210 that's only because you updated App to 25210 first... I thought you'd gone from 25206 to 25209... Seems you hit App Update in App?... Then you would have got latest available...

You should simply have closed the 25206 App, found 25209 in Releases, downloaded and installed it then taken Direct install from that... 🙂 You would have gotten good 25209...

This is confusing... Do you mean from App? ... (Maybe cos you restored .zip to .apk?)... Please say if other...

Yes! This will give good Magisk (still with some issues I've mentioned however) because you patched image while system was loaded... That's the point I've been making...

Flashing Magisk as .zip from recovery w/ 25207+ results in bad/limited Magisk (modules etc broken as installer cannot now properly select directory for selinux/module rules), at least for initial installation...

I'm really not sure if .zip (recovery) installation to update from builds already using refactored selinux will be good, but initial root results in only partial root gained and further patching while system is loaded is needed to fix the installation... Direct install and patching image from app will work, and I'm guessing installing magisk.zip as a module (in App) should work too, but I haven't tested. 😉

mmm... So Magisk is probably limited/broken ATM... PW
[Magisk] zgfg:
Btw, it was clearly posted: in an even earlier post from the last Tuesday:

https://xdaforums.com/t/magisk-general-support-discussion.3432382/post-88250169
[Magisk] m0han:
https://xdaforums.com/t/magisk-general-support-discussion.3432382/post-88276981
[Magisk] bombadier:
I am looking for some ideas as to why the Halifax banking app is detecting root, I have posted the issue and my setup, over at this thread , my problems started with the broken cannary builds 25207 onwards where the magisk app not being able to be hidden, didnt use the halifax app until I could hide magisk again, canary 25210 which broke loading modules, fixed the app hiding, ever since the halifax app detects I am rooted, reverted to magisk 25206 which worked before I updated, reinstalled the hallifax app but it now detects root and I cannot work out how, through all this google wallet worked but I know banking apps use other detection methods,

Would much appreciate any help getting it working again, thanks
[Magisk] badabing2003:
I know you're mostly interested in managing it from the phone, and various approaches are already mentioned.

If you want a GUI management from PC that lists Magisk backups and allows you to selectively delete or add backups (if one is missing) you can take a look at Magisk Backup Manager button in PixelFlasher.
[Magisk] pndwal:
Not sure what you sent me back there for...

The fact is, since 22.0 we have single-package Magisk... The old Manager is gone along with it's seperate version scheme... Single package 22.0+ contains both the new Magisk App and corresponding binaries for Magic Mask... Also, as John said:

To put it simply, if "Direct Install installs 25210" then you MUST have had 25210 App installed... 😃 PW
[Magisk] m0han:
If I tap the 'Uninstall Magisk' button in the app and the device reboots itself, what do I have? What am I left with? Then if I install 25206 apk and flash 25206 zip from recovery what am I left with?

Now I am on 25209. If I tap Update I will be updated to 25210; first the Manager and then Magisk, right?
[Magisk] pndwal:
Nb. Your screenshots show Delta fork installed... I am not fully familiar with its differences to TJW Magisk, so my comments will reflect behaviour of official builds only...

What you have / are left with depends on which of the two options you took after taking Uninstall Magisk... Either way you should get original (unpatched) images restored as long as Magisk image backups are intact...

25206 Magisk most likely with only partial root gained (modules may be broken incl Zygisk and further patching while system is loaded is likely needed to fix the installation) as I've explained several times...

Yes... So don't tap Update if you want to keep 25209...

If you arrived at 25209 using .zip install from recovery (ie. flashed w/o system loaded) you likely have limited (broken) root.

Just tap Direct install to re-flash the currently loaded 25209 binaries (ie. Now flashing with system loaded) and Magisk should be fixed (sepolicy/module rules loaded successfully)...

Hope this time it's clear... 😉 PW
[Magisk] zgfg:
If I understand correctly, you're and you were all that time on Magisk Delta

With Delta 25209 (and earlier Delta versions) and 25210 (originally, when you upgraded), Systemless Hosts worked for you, did they?

Then you started to downgrade/upgrade...

Now you're on Delta 25209 (25206, whatever) and Systemless Hosts do not work, right?

Irregardless of your attempts to upgrade back to Delta 25210, check the following and report back, see my screenshots and post yours

1) Delta,Settings, Core only mode is not enabled?

If enabled: disable and reboot

2) Delta, Modules, Systemless Hosts is enabled?

Again, enable and reboot if it was disabled

3) AdAway. Is it not paused? See my screenshot and post yours

4) Is AdAway really in the root/hosts mode?

Go to AdAway Preferences, Root mode, open Hosts file - see my screenshot and post yours

5) Use some root file explorer like MiXPlorer, grant root, go to:

/data/adb/modules/hosts/system/etc

and check properties of your hosts file - does it exist, is the size some Megabytes?

See my screenshot

If you open that hosts file (as textual), it should be exactly the same file as from (4)

6) Go to

/system/etc

and also find the hosts file there - is it same/similar in the size as the one from (5)?

(After reboot, it should be the same as from (4) and (5))

See my screenshot

Open this hosts file, does it show at the beginning that it was created by AdAway - like the one from (4)

If you see problems with AdAway - resume if it was paused, let it update host sources and reboot

Or uninstall AdAway and install it from scratch in the root/hosts mode, let it update hosts sources and reboot
[Magisk] pndwal:
FWIW, users should probably avoid using .zip install from custom recovery altogether since refactoring in 25207 broke it...

Since custom recovery users can simply patch images properly in App and then flash these from custom recovery (and this method is NOT broken), why not just do that?... .zip installations won't need fixing (re-flashing) in that case...

Nb. For 25209 you'll need to install an earlier build first then update since SYSTEM_ROOT is not passed to boot patch (bug) when unpatched images are patched... This is fixed in 25210... 🙂 PW
[Magisk] jons99:
I'll tell you why cause rn when I have an update for my rom I

1. flash the rom in twrp

2. flash twrp

3. reboot to twrp and flash magisk apk

when what you suggesting is I need to first extract the boot img from the rom I what to patch then move that boot img to the phone patch that boot img with magisk and only then start flashing in twrp it's way more work and you need a pc so I hope they fix that in the stable release
[Magisk] pndwal:
As it seems you mean 25209 Delta fork, the need to fix .zip installation won't apply unless @huskydg has committed

Refactor sepolicy.rules resolve and related commits... I believe he was holding off earlier but I'm not aware if 25209 built these... PW
[Magisk] zgfg:
Continuation on your problems with Systemless hosts (see my previous post):

What other modules do you have installed - post the screenshot (scrollshot) of the Magisk Delta tab - to see what others systemless modules you have installed and that we can inspect if they work

---

Regarding to update:

Yes, click on Update to update the Delta app to 25210

Then open the Delta app again, it should ask now to update the Magisk - take Update and choose Direct install and reboot

After reboot it must not bother with the Update option again (unless huskydg releases a new version in the meantime) and it must show that you are on the latest Delta Canary app and Magisk

Then post the Settings screenshot to see what do you have enabled or not (Zygisk, SuList, etc)
[Magisk] pndwal:
Actually you don't need ROM... Take a partition backup incl. boot in TWRP then find the *.win backup... You can rename that to *.img or not... Either way, you can use that in place of a boot image extracted from ROM...

This way the whole process is still on-device... Just more booting... 👍 PW
[Magisk] jons99:
yeah no I only flash magisk when I updated my rom

I want to keep rooted and not lose root cause of gpay and such
[Magisk] m0han:
Check the screenshots in my post. With original (unpatched) images restored (hopefully), I installed apk, flashed zip in recovery, booted up, then patched boot.img (taken) from the zip file of the rom I'm currently running and flashed that to the boot partition. I am vary about 'Direct Install' because the version that is shown is 25210. Do you think I now have unlimited/unbroken root?
[Magisk] m0han:
I had done all that you mentioned, including this: After (seemingly) getting proper root, I 'removed' Systemless Hosts module and uninstalled AdAway app - after restoring default hosts. I then rebooted, re-added the module, rebooted, installed AdAway, chose root mode, updated hosts, rebooted. I still get ads, links I click take me to pr0n sites.... I'll repeat your steps later and get screenshots.
[Magisk] zgfg:
According to the screenshots, you should have now Delta 25209 properly installed

Please check by and answer to my post #54756

Also, from a Terminal emulator, execute the following:

whoami
su
whoami

magisk -c

ls -l /system/etc/hosts
head -5 /system/etc/hosts
tail -5 /system/etc/hosts

You can execute the same via ADB, but then instead of just su, start with:

adb wait-for-device devices
adb shell
su

See my screenshot and post yours

Please post also screenshot of your Settings from Delta (Magisk and MagiskHide parts) and the scrollshot of the Modules installed
[Magisk] manjaroid:
Usually this is a sign of a hijacked hosts file. Hopefully it's not DNS poisoning. Does it happen over wi-fi only or mobile too? Any other devices in the same LAN acting this way?
[Magisk] ctcx:
Essentially I'm asking whether there's a way to switch from root to non-root at will through the device itself without needing a PC. Restoring original boot image or uninstalling Magisk would imply reflashing patched img to go back to rooted, and reflashing is only possible with a PC and fastboot.

And yes, I'm googling the concepts right now.

I had just thought this was closer to the wanted approach I just mentioned above, just wondering if this was possible directly from the device itself without a PC and fastboot.

I'm sorry, it's just that even after previously googling/reading, I'm still a bit paranoid about having root enabled 24/7 and using as daily driver.

I need some Magisk module for some apps to work, but just installing Magisk roots the device...

Finally, if using file manager with root access, can I just delete/manage Magisk image backups directly, without breaking Magisk itself?

Thanks again everyone.
[Magisk] m0han:
Here.... More later.

Edit: The True Phone Stub module is not working after the downgrade/upgrade fiasco; awaiting 'removal' or resolution of the issue.
[Magisk] m0han:
Both. I've no other devices, ATM. Screenshot 1 - WiFi. Screenshot 2 - Mobile Data.
[Magisk] zgfg:
Deleting /data/magisk_backup_* files is safe, but don't delete the newest if you would later need to uninstall Magisk (backup keeps the not-patched images)

---

You could switch from root to non-root by using Terminal emulator commands

AB=$(getprop ro.boot.slot_suffix)
BOOT_PART=/dev/block/bootdevice/by-name/boot"$AB"

dd if=/sdcard/boot.img of="$BOOT_PART"

reboot

First line reads the property telling is your currently active slot _a or _b - to test, execute

getprop ro.boot.slot_suffix

Together with the second line it will provide full path to the Boot partition in your currently active slot, being

/dev/block/bootdevice/by-name/boot_a

or

/dev/block/bootdevice/by-name/boot_b

or just

/dev/block/bootdevice/by-name/boot

(for not A/B devices)

You must have your original, not-patched boot.img file saved to /sdcard - ie to Internal memory (root folder - if you save to Download then change its path to /sdcard/Download/boot img)

dd command will flash that original boot.img to the active Boot partition

Execute on your own risk

---

But you cannot do that in the opposite direction since dd command requires root

Instead, you would have to flash your patched boot.img from Fastboot (or TWRP)

---

Btw,. to be able to flash, you must have your Bootloader unlocked

But then, you cannot pass Play Integrity API and thus you cannot use Wallet or use 'banking' and similar apps

And you exactly need then Magisk to hide itself and to hide the fact that BL is unlocked, to be able to trick PI API, Wallet, 'banking' apps - hence I don't see the point of keeping the unlocked BL but not running Magisk
[Magisk] m0han:
Yes

I believe so. Not sure about '25210 (originally, when you upgraded)'.

Guess so. Troubled by ads; that never happened before. For my responses to the rest of your advice, please see my screenshots. A few others in post #54768.

My hosts file is 6.13MB in size.
[Magisk] badabing2003:
This is possible on Older devices with Dual slots.

I have tested this in Pixel XL

However newer devices fail due to AVB

I have a post about the details, I'll try to find it if you have an older device.
[Magisk] manjaroid:
Looks like redirection in your hosts file or DNS lookups are being hijacked another way. First thing is to make sure the phone's DNS is something proper like Google's 8.8.8.8.

If you open Adaway and disable all hosts entries, Adaway will restore /system/etc/hosts to defaults which should only be localhost IPs for IPv4 and v6. Is that what you see when you open hosts in Adaway? And does it match what you see if you open it in a file manager?

If DNS is good and hosts defaults are normal, are you still getting bogus redirection? If so disable any Chrome extensions or try a different browser.

Network issues are off topic for this thread. You should start a new Q&A elsewhere on XDA, I'm not sure where though. You might start with one of the ad blocking discussions.
[Magisk] zgfg:
From your other screenshots I see that you're running Riru modules. I hope they are ok (I use Zygisk, no experience with Riru) but they should not affect Systemless hosts

Nevertheless, you could disable all other modules leaving only Systemless hosts, and reboot

----

About the hosts file - they look ok:

6 MB, header created by AdAway

Particularly /system/etc/hosts

Therefore, seems that Magisk had properly done its part - /data/adb/modules/hosts/system/etc/hosts is properly mounted to /system/etc/hosts

That's all that Magisk does for Systemless hosts - don't expect anything else or don't blame Magisk for anything else

---

However, on the AdAway screenshot I see one strange thing:

- your hosts file says at the top that it was merged from 3 hosts sources

- but AdAway says that only 1 hosts source is up-to-date and 0 out-of-date

1 + 0 not equals to 3?!

Inspect in AdAway, hosts sources tabs, which of them are really up-to-date

It must look like as on my screenshot

---

For those domains like sugar-girls, search in AdAway, Blocked, are they really blocked

Check in the native Settings on the phone that no private DNS is enabled

And still try with all other modules disabled (and reboot)

IMO, further questions are for AdAway, not for Magisk

---

PS: Why are you on the initial v6, AdAway v6.0.0 - the latest is v6.0.3 and there were fixes through v6.0.1-v6.0.3

GitHub, XDA and F-Droid, all have v6.0.3 as the latest

My AdAway was installed directly from the link in XDA thread and and it always auto-updates correctly
[Magisk] ctcx:
So the process for installing Magisk involves extracting the boot image from the ROM one is currently using, patching it with Magisk, then flashing it with fastboot.

In the case of LOS, their downloads page, aside the ROM zip itself, also includes direct download of the corresponding boot.img, which is the same as the one inside the zip. The checksums between the two may or may not match though, because generally one of them is zero padded at the end of the file.

For Magisk, is it safe to use any of the boot images, zero padded or not?

Thanks again.
[Magisk] zgfg:
If the difference is really only in the 0x00 bytes filled to the end, it shouldn't matter

I don't know for your LOS boot images but I used to have a similar case with my MIUI boot images. boot img file zipped in the Xiaomi.eu OTA ROMs were about 21 MB, while the TWRP backup boot.emmc.win were of course full size, zero padded, 64 MB (size of the Boot partition on that phone)

Sometimes I patchef small ones, sometimes the full size zero padded boot images and never had a problem

The only difference was that if I patched the 21 MB img, the patched one was again 21 MB (few KB bigger than original).

But if I patched the zero padded one, the resulting patched was again full size 64 MB

I even played myself for curiosity and cut off the full size, zero padded boot.img to like 35 or 50 MB, patched that one, flashed and it worked fine

(I used to have a primitive script for Terminal emulator, using od and dd commands, to find where the zero padding begins, and to cut-off by the end of the last non-empty block)
[Magisk] pndwal:
Not due to broken .zip installation... Patching with system loaded should fix that issue if it exists in Delta... As I said:

To be clear, I'm not sure about Delta issues...

However it seems very likely that you may have some corruption in Magisk configuration in /data/adb... This occurs especially when swapping to forks that configure magisk.db etc differently without cleaning that directory. (Nb the in-app Uninstall Magisk, Complete Uninstall functions will clear this; Restore Images won't)

If you suspect that this may be the source of issues just delete everything in /data/adb and reboot; Magisk configuration will then be rebuilt... Of course settings, modules, DenyList, Superuser list etc will need to be configured again.

I don't understand this concern... Direct install can only install binaries from currently installed Magisk .apk archive, ie. App Installed version which is 25209... Where does 'version show as 25210'? PW
[Magisk] pndwal:
Apparently padding affected some devices only, where bootloader objects to residual signing etc from previous (unpatched) images:

- https://github.com/topjohnwu/Magisk/issues/2005#issuecomment-547667142

- https://github.com/topjohnwu/Magisk/issues/2005#issuecomment-548033569

This was fixed for Magisk in:

https://github.com/topjohnwu/Magisk/commit/9ceb14a4c8ea0abc6658be22f1989bb8014c22db

... not sure why commit linked above is not found in repo.

... Ah... Commit was revised and replaced with:

https://github.com/topjohnwu/Magisk/commit/c91ebfbcc118be728c7ecfbcc593cecb9b975619

There may be other issues with AVBv1 for a few devices but John said 'not Magisk's problem':

- https://github.com/topjohnwu/Magisk/issues/2005#issuecomment-703740751

however further adjustments were made, eg:

Skip image padding on Pixel C

I see you commented in this issue too. PW