yashsingh1/xdaforums huggingface dataset:
[Magisk] _JAD3N:
Hi, looking for some help:

Using a OnePlus 6T, flashed from clean factory reset/format data

Flashed TWRP first via fastboot, then via recovery

Flashed Magisk via TWRP recovery

Phone shows rooted per Root Checker app, pop-up appears showing Root Checker was granted Superuser rights

When opening Magisk app from the app drawer, it starts as generic Android logo and then upgrades itself to the version with the mask logo

Upon launching the Magisk app, it hangs on the mask logo splash screen for over 5 minutes at a time and does not successfully launch

I've tried un-installing and re-installing Magisk a few times, including trying v24.3, v25.2, and v26.2 (latest)

When trying to un-install from ADB, adb uninstall com.topjohnwu.magisk yields the error message "/system/bin/sh: pm: inaccessible or not found"

I'm unable to open Magisk but I do have root access generally, and Magisk hangs on the splash screen. Can anyone advise on how to get this working?

Thanks in advance.

EDIT: For anyone looking at this post in the future, I re-flashed TWRP as .zip, and then used TWRP to also install Magisk v24.3 as a .zip. This allowed me to access Magisk normally -- seems like there are a few issues opened up for Magisk v26.2 currently regarding hanging splash screens.
[Magisk] J.Michael:
Sorry, I thought you were "applying" to other slot and were still in Magisk-active Android just before rebooting to newly installed other slot.

Have you tried building a new 9GB ZIP file to see if it fails to install?

By the way, I really hate you people using "OTA" to refer to a file. There has to be some other way to refer to the full-ROM file that supposedly includes the incremental updates otherwise delivered Over-The-Air, without using exactly the same phrase used to refer to the incremental update received OTA.
[Magisk] zgfg:
In my posts, I didn't refer to incremental but the full zip packages

One, with payload bin that contains boot and other images, full stock Xiaomi package. It can be delivered over-the-air for automatical upgrade

In the other case, full Xiaomi.eu (so custom ROM) package that can be also downloaded manually or downloaded automatically by the built-in Updater that serves for the Xiaomi.eu upgrade

Both full packages are about 4.5 GB for me

Btw, I just downloaded also the official but incremental OTA upgrade package, it contains the payload.bin but there was no boot img (Boot was not changed/upgraded, hence not included to the incremental OTA)
[Magisk] V0latyle:
Correct

Nope but I doubt it would because any modification would change the hash so it would fail verification

I'm coming from the Pixel series. TBH I'm not totally sure what is different between the factory images and the OTA images, but in the realm of Pixels, "OTA" refers to the OTA update package that's either pushed to the device "over the air" or downloaded here to be sideloaded via ADB

I haven't paid too much attention to how OTA updates work but I would assume that instead of being divided into multiple components, the OTA update would be in one large checksummed file for integrity, and out of habit we generally refer to that file as "the OTA". I don't use that term interchangeably with the factory image, which is meant to be flashed from bootloader/fastbootd instead of recovery; the installation process also differs because on A/B devices the OTA always installs to the inactive slot whereas the factory image installs to the currently active slot unless otherwise specificed via command line - it can be installed to a specific slot, both slots, the inactive slot, or by default the currently active slot.

I understand the pet peeve though, I don't like it when people describe their device as "bricked" when it's just an easily fixed bootloop.
[Magisk] J.Michael:
Not you, but earlier in the subthread there was much back and forth over which "OTA".
[Magisk] J.Michael:
If "correct" means you are still in Magisk-active Android after applying new ROM to inactive slot, you should be able to blast patched boot image onto inactive slot's boot image partition before rebooting.

I assume you can use "dd" from a terminal emulator. Just be very sure which partition you want to overwrite.
[Magisk] V0latyle:
Yes...but you could also use "install to inactive slot"

Not sure about dd, never used that before. When I did things long hand before going to Pixel Flasher, I'd extract the boot image from the factory update, patch in Magisk, pull back to PC, reboot to bootloader, and after applying the update: fastboot update image-device-buildnumber.zip --skip-reboot flash the patched boot image: fastboot flash boot <patched boot image>

I don't personally update via OTA so you might be referring to something else....writing patched image to /boot_other post update but pre reboot?

Regardless, I'm still confused as to why we'd want the ability to natively extract and patch a boot image from an OTA payload. Why not just fix inactive slot patching? It's much easier and doesn't require the use of a terminal emulator. Sure, it's nice being able to generate a patched image but you still have to use extra steps to write it to /boot, which doesn't make sense when you can just use Install to inactive slot (After OTA)
[Magisk] _JAD3N:
Any advice?
[Magisk] pndwal:
There are a couple of unresolved OnePlus issues... This for some (only MTK soc?) models launched with A13:

Direct Install fails on the OnePlus Pad due to empty init_boot partition confirmed #7231

and this regression which seems to be your issue:

Magisk app freezes when rooted on OOS10+OOS11 devices after commit 3938322 APP regression #7214

I'd watch that space and revert to the last Stable build (26.1) which was unaffected, till a fix is built...

To revert, flash un-patched boot.img again... Nb. A different (already fixed) issue was also causing device type to be wrongly identified (as Ramdisk=No) and therefore Recovery mode checkbox appeared erroneously on some devices... If that occurred and you updated with Recovery mode checked, Magisk will also have patched ramdisk in /recovery partition and you will need to flash un-patched recovery.img again also... So I'd just flash both to be safe...

Next, after booting w/ clean images, App should open again... Uninstall it first, then install 26.1... Patch clean boot.img, then flash with fastboot (or other)...

🙂 PW
[Magisk] _JAD3N:
Thank you! I actually ended up completely wiping my device to remove root and starting again, because I saw the same issues posted that you did.

For anyone looking at this post in the future, I re-flashed TWRP as .zip, and then used TWRP to also install Magisk v24.3 as a .zip.

Not clear as to why, but the app opened just fine and I was able to proceed with the process normally.
[Magisk] J.Michael:
I thought you said something like "so I still need a PC to install Magisk. I was suggesting a way to "flash" the patched boot image without involving another device.

As to why it does what it does without doing every other thing you can imagine wanting it to do: making the Magisk manager app capable of locating the boot image in a payload.bin file spares users from needing to find and use a payload dumper; maybe it includes figuring out whether the needed image is boot.img or init_boot.img. If there are problems with Direct Install, how can it "flash" the patched image? And Direct Install can't work unless Magisk is already installed, so there has to be a sequence of steps for initial installation -- that has traditionally been produce a patched image, with a separate step of flashing however things can be flashed.

Ultimately, it doesn't matter what "we'd" want. What matters is what some developer wants.
[Magisk] shoey63:
Not just OTA payload, some full rom zips use payload.bin to flash all the necessary images.

And now that flashing Magisk as a zip in recovery is pretty much deprecated, the ability to use Magisk to directly extract and patch the boot.img from payload.bin is a welcome feature, especially for custom rom flashers, and non-Pixel users.
[Magisk] rodken:
It seems that simply uninstalling Magisk or reflashing a clean boot image may not be enough. A complete format of data or factory resetting 'clears the air'.
[Magisk] Chocka99:
Great! Here the same problem on my Samsung Galaxy Note 10.1 2014 (LTE) with LineageOS 17.1

Restored 26.1 and will wait till there is an update which works
[Magisk] Lughnasadh:
Just to be clear....while it's true that you need to unlock your bootloader (which will wipe the device) to flash factory images, you can still flash a factory image without wiping (assuming the bootloader has already been unlocked) by removing the -w from the flash-all.bat script.

I do realize it appears you were quoting someone or something else, but just wanted to clarify that quote.

For what it's worth, I am still seeing some users able to use the "Install to Inactive Slot" method with success on Pixel 6s and 7s as recently as last month. In some instances I've even seen some with these devices be able to successfully take and install an OTA (delta) while rooted, although after the update they lost root, which is of course to be expected.

Sidenote: As for users with newer Pixels, I don't think the recent changes in Magisk (being able to extract and patch boot or init_boot images from ROM zips (Full OTA or Factory Images)) has any real practical affect on updating and/or rooting methodologies, nor was it meant to, as PW alluded to above.
[Magisk] zgfg:
I'm running now Zygisk-LSPosed v1.9.1 and generally all is ok / as previously with v1.8.6

On my older phone with A11, GravityBox does not fully work but I'm not quite sure what mods I checkmarked long ago (and some mods didn't work at that time either)

On A13, I had to grant the root privilege to AOSP Mods module and to checkmark the wanted mods again but that module was not fully stable previously and I similarly had to reset in the past
[Magisk] pndwal:
Source was Google download page for full OTA packages, first paragraph here:

https://developers.google.com/android/ota

... Sorry I didn't cite that before... Added it with a rider, so now reads:

Yeah, I understand that it's still working for some...

The documentation vv linked does suggest that the new partition digest checking is real however... Just not clear which updates/configurations implement it... And I did say:

Guess you mean not using Install (Magisk) to inactive slot method then, as root retention is expected...

Thinking about this, if update doesn't contain boot.img (P6) or init_boot.img (P7), delta OTA while rooted could succeed since boot image wouldn't necessarily be checked... But since streamed A/B updates still build all images for the inactive slot I would have thought boot image would then be an exact copy from active slot, so would be rooted... 🤔

Perhaps incremental delta OTAs can still include full images, eg boot.img or init_boot.img, so integrity checks for these is skipped?... Then OTA would presumably work and root would be lost... (For P7, init_boot.img would be very small anyway as kernel is in boot.img/not included.)

This could explain why Install (Magisk) to inactive slot method can still work also... If delta OTAs can include full boot images, flashing Magisk to inactive slot would restore root and post-boot digest checks, at least for boot image(s), could be skipped...

This is only conjecture on my part of course, but may be plausible...

Yeah... Just makes Magisk a more complete (initial) rooting solution.

🙂 PW
[Magisk] Neumii:
Hi, i just need a little help! i just came to the conclusion that there was something wrong with Google play Services, Google Play System Update and Google Play Store when i installed magisk (v26.1) on my phone (Infinix Note 10 Pro X695D). Installation was fine and smooth (Used TWRP Recovery) to install magisk. the first problem here is, once i booted up back again my phone to finish the initial setup (Download apps from Playstore, update google play services and etc) The updated versions of the Google apps that i mentioned somehow conflict the magisk install, thus when i reboot my phone. it gets stuck on a bootloop stage.

I tested if i could only use the Stock versions of the google Apps. it works fine tho with magisk installed and it does work for quite a while. now the 2nd problem goes in. the Google apps persisted to download new versions of themselves while I'm connected on a wifi. and my phone is on bootloop again (I guess my phone got bootlooped 5+ times because of many trials and errors). Luckily i have TWRP Recovery, uninstalled the magisk root and i wiped all of the data in my phone. put back together my stock rom and now i'm afraid to install magisk again
[Magisk] J.Michael:
I've never heard of a problem with Google Play components.

You say you concluded there was a problem. Was that before you installed Magisk?

Before installing Magisk, when your system is running properly, you should be able to find a Google Play Store setting to turn off automatic updates. Separately, you should be able to set the internet connection to "metered", to discourage automatic downloading of updates.

Check this thread to see if Magisk v26.1 is the one with problems.
[Magisk] Neumii:
The problem starts after i installed magisk successfully, Those things you mentioned above. I turned them off, set to metered connections once i rebooted back again. but still i woke up in the morning with my phone on a bootloop. i did install and went through a lot yesterday night.

GP Store version: 37.2.18-29 [0] [PR] 558223983

GP Services version: 23.33.16 (150400-560149061)

GP System Update version: July 1, 2023

(These versions of GP Components i have a problem with magisk fully installed)
[Magisk] J.Michael:
Have you seen this thread about your device?

I haven't read the whole thread. You should.

Next time you restore your device, try letting all things Google update themselves *before* you install Magisk.

If it still screws up, try what it says in that thread: use TWRP to wipe data, then reboot and see where that leaves you.

At least it should make for interesting reading.
[Magisk] Neumii:
Thanks for this! but i did try that one too. but still it fails

i guess i will give up on giving root access on my device
[Magisk] pndwal:
Please say Rom, OS (Android version, stock/custom)...

And please say how you're rooting with TWRP... You're not flashing a pre-patched boot image from online source are you?...

Even if flashing magisk.apk as .zip installer from TWRP etc, the method is fraught per:

Also, might this apply?:

... Have you tried in-app Patch Image method?... If so, how are you obtaining boot.img?

Personally, due to issues with TWRP compatibility especially unofficial forks, I'd be avoiding its use for rooting (and other) purposes on modern devices running stock OSs generally....Use for custom ROMs...

Please say if there are special reasons for using it on your MTK device... 🤠 PW
[Magisk] badabing2003:
Late to the party of payload.bin / patching OTA discussion.

My thoughts (speculation) and some random/wild assumptions based on observations from Pixel devices.

We know that there are two types of OTA.

Delta OTA, which gets downloaded (by the phone, I have not seen manual download option for these) and installed every month as an incremental / differential update, and can only work if the hashes pass, ie the current state of the phone is the exact expected before state for the update.

Full OTA, which can be downloaded (at least for Pixel phones from here) and sideloaded in recovery. But are at times also downloaded by the phone and applied (more on this further below).

Both of these are always applied to the alternate (inactive) slot without a wipe, and do not require an unlocked bootloader.

I believe that the hash verification is by design to guarantee proper update rather than some measure to circumvent rooting. Obviously if there is a mismatch of the before state, then corruption would be unavoidable.

I say this because with full OTA, you can flash regardless of the state of the phone, you could have both slots rooted and still flash full OTA without an issue, and in fact, you can even alter the boot / init_boot before rebooting to system and it would still work, and this is exactly what PixelFlasher does, it flashes full OTA, and then flashes patched boot / init_boot before rebooting to system, and the phone accepts it.

With OTA, the boot / init_boot are inside the payload.bin, and it's a good thing that Magisk now supports being able to extract and create a patch directly from payload.bin or even if it is inside a zip or tgz. A user does not have to do that on a PC using 3rd party tools and potentially making mistakes.

Of course it's one thing to create a patch, it's another to flash it.

I believe for now one still needs to download the OTA (or similar file with payload.bin) to the phone for Magisk to be able to extract the boot / init_boot and create a patch, but I wouldn't be surprised to see the next thing from Magisk that detects when the phone downloads the OTA, and uses that image to extract / create the patch (anyone know where is that downloaded? and be able to detect automatically if one gets downloaded).

There has been quite few reports that people with Pixel devices, got updated and lost root without their knowledge or specific action.

This could be the case where a phone falls behind few releases and Google (for security) detects the case and downloads the full OTA instead a delta OTA, which would install without the need of hash verification.

I don't know if it is possible to trigger and perform OTA update from the phone by supplying the OTA file ourselves, if this is possible, then theoretically we should be able to download the stock full OTA, create a patch, trigger the update (which would not need to do a hash verification) then apply the patch (to the inactive slot) before rebooting all on the phone.
[Magisk] osm0sis:
Update on the ONDK regression causing all 32bit devices to fail after Magisk 26.2:

All 32-bit arm static executables segmentation fault after commit 41226c1 · Issue #7264 · topjohnwu/Magisk

Device: Galaxy Tab 4 10.1" LTE (matisselte) (SM-T535) Android version: 11 (LineageOS 18.1) Magisk version name: e47e869 Magisk version code: 26201 Magisk 26.1 can patch the boot.img just fine Howev...

github.com

https://twitter.com/i/web/status/1697453423158075645

https://twitter.com/i/web/status/1697461838945071264

Edit:

And patched!

Update to ONDK r26.0 · topjohnwu/Magisk@be50f17

Close #7264

github.com
[Magisk] pndwal:
Pretty much what I explained, except that Delta OTAs fall into two categories themselves, and Google explains that Deltas for A/B type are not actually downloaded anywhere... Rather (as stated above):

So while Deltas for both A/B and A-only are essentially data streams rather than downloads, the resulting images (from combined OTA + current OS/active slot data) for A-only Delta OTAs are files stored (in cache partition) for later installation so this could be regarded as a download... For "Streaming A/B Seamless" (Google description) Deltas however, the resulting images are the inactive slot blocks themselves; there is no download file...

This is also as Google spruiks it (see bolded):

https://source.android.com/docs/core/ota/ab#overview

and should answer your query:

Also re:

Since there's no download file(s) for Streaming A/B Seamless Delta OTAs I guess you'd just need to detect successfully updated slot...

Yes, for sure... And the new post-boot digest checks @vvb2060 cited will be just an additional measure to ensure "device will boot an uncorrupted image".

Yup... accepts because you've used full OTA image for patching so no post-boot checking is done... Thanks for confirming this doesn't occur for full OTAs; I'd only guessed it wouldn't...

The issue for "Flash Magisk to Inactive slot" Magisk preservation thru (Delta) streaming A/B OTA method is, of course, that we can't patch boot image before reboot with such a check unless a way is found to bypass it completely or, as vv suggested, a way to implement a partition digest calculation that overwrites the original value is found...

Yup:

Addressed the 'download' issue for Delta Streaming A/B OTAs above, but I would like to see an inbuilt function for dumping boot images from inactive slot for use after OTA update but before reboot... That could easily be done as root exists and would eliminate the need to download full OTA/ROM just to obtain the image to patch...

Mmm... I think I read that OEMs can force critical updates even when "Install automatically" etc is disabled, but not sure now... 🤔

I know it is possible on many devices, eg MIUI's update engine can "Download latest package" and apply it even when no update is available, and has "Choose update package" function that allows 'Select folder' to apply user provided update packages... I don't know about Pixel, but I imagine it should sport equivalent functions.

Better still, just use Install Magisk to inactive slot method per https://github.com/topjohnwu/Magisk/blob/master/docs/ota.md#devices-with-ab-partitions

... This should just work with full OTA, ie without verification/digest checks anyway...

Should be able to keep current partition rooted (no need to restore images)... Just a big download required instead of taking delta OTA... 🙃

Nb. I've never tried this only since my Xiaomi MIUI device is not A/B. 😉

🤠 PW
[Magisk] zgfg:
Fix in Canary 26203
[Magisk] pndwal:
Latest Magisk Canary + Debug builds:

Magisk (96e559fb) (26203)​

[General] Update BusyBox to 1.36.1

[General] Fix compiling toolchain that produces broken arm32 executables

Diffs to v26.2​

[General] Fix device information detection script

[General] Update BusyBox to 1.36.1

[General] Fix compiling toolchain that produces broken arm32 executables

https://github.com/topjohnwu/magisk-files/blob/cd7fd78534f2f4b032d776b3ca2f2924a65353e0/notes.md

👍 PW
[Magisk] Neumii:
OS: XOS v7.6.0 (OS7.6-R-P86-2110323)

Android Version: Android 11

I'll try the in-app patch image method, but i can't find the specific XOS ROM version for my device. X695D is what i'm using but using X695C ROM will damage my device i guess? (Please educate me about this haha)

About the TWRP, i followed one of the Posts here about Installing TWRP on my Infinix Smartphone, i know it's unofficial method coz i cant find my device on the TWRP website. but hey

I'll look at it and try again in order to test if magisk will install properly. Thanks for your efforts!