yashsingh1/xdaforums huggingface dataset:
[Magisk] alex.do:
Need your all help!

Got my device out of battery for couple days. When i plugged in charger it boots up but it didnt go to recovery obviously (yes I got rooted with Magisk v26.1). Then when I tried to power off and restart again with intention to go to recovery (to allow magisk to boot with), I got booploop!

I tried all possible ways I could find, including:

Re-flash the whole firmware files (with HOME_CSC) again and again

`adb wait-for-device shell su -c magisk --remove-modules`

Safe mode

Safe mode, by setting prop

Patch new magisk version (v27)

Leave the device out of battery again, and recharge

None of them help!

Flashing CSC_ file or re-partition is not an option as I am trying to save my data. I was so stupid I didn't have any backup recently.

I then tried with TWRP see if it helps. I was able to flash TWRP. what I did was flashing the same BL, magisk_patched.tar, HOME_CSC, etc.. and for the TWRP i put the tar in USERDATA.

TWRP booted successfuly. But it didnt ask for password. I knew theres something wrong! Turns out the /data is encrypted. All I can see in TWRP's file manager is just folders and files with random strings!

I dont know if there's a way to recover my data. I know the pattern to unlock. Just dont know how to use it to decrypt. I think that's the reason it was bootloop...

My device info:

- Samsung S10+ (beyond2lte)

- Android 12

- Stock firmware (PDA G975FXXSGHWC1)

- Magisk v26.1 (I tried with v27.0 too) recovery mode patched image

- TWRP 3.7.0_9.2 (beyond2lte)

- Still have ADB debugging

- Root still there. I can quickly exec some adb commands with root at the Samsung logo screen.

I only need to keep my data. As long as I can grab it over somehow, I don't mind a factory reset.
[Magisk] J.Michael:
When did the problems start?

I assume the "Got my device out of battery for couple days" means you deliberately ran down the battery to try to jar the device out of an inconvenient state. What was the original problem, and what did you do to cause it?

You say you tried flashing Magisk-patched ROM with TWRP. Stop trying to install Magisk. Especially if you think your problem is caused by a Magisk module. Flashing an unpatched ROM is the most direct way to "disable" modules -- no Magisk, modules don't matter.

If you connect your device to a PC, does it show up as a mass storage device? At least you would be able to copy files from internal memory.

Since you mention CSC vs HOME_CSC, I assume you have a Samsung. The instructions I remember start with wiping data as part of removing encryption. I don't remember reading that that has changed.

You might have more luck flashing a custom ROM. Maybe a current LineageOS can handle encryption and does not require a wipe to install.

Do you have any idea what software is currently on your device? When you tried flashing an unpatched ROM, are you sure it was the current ROM? Not the older ROM that you think of as the good, old, ROM that used to work? (If you updated the ROM, and that updated the bootloader, you could be running afoul of the rollback protection.

Can you get to recovery? Where did you install Magisk? In recovery or in boot?
[Magisk] alex.do:
Thank you for reaching back!

So my S10+ was running all fine with Magisk v26.1. I got it rooted quite long time ago it was working without a problem! I used the recovery mode and patching the AP image file. I still have all files i flashed last time.

The bootloop happened when I forgot to charge the phone so it went off. One day I plugged it in, it started up. I knew that it was supposed to boot into Recovery mode for Magisk to load so I unplugged the charger, plugged into my PC (which I had ADB debugging - I still have it), then I forced device off by pressing all keys and then Power + VolUp (with the cable plugged in) to go Recovery. I dont remember exactly it was at which state when it was forced off. But since then it stucks at the Samsung logo for 30 secs - 1 min then it blacks out and go back from the start.

Not really. What I did was using another Android device, and patch the AP image with latest Magisk. I still go with the Recovery mode ticked and Patch the image. I never flash Magisk zip with TWRP.

Unfortunately not. I am only able to run adb command (when the screen is at Samsung logo). I can run adb shell su that indicates I still can boot with Magisk injected. It simply stucks at Samsung logo for some time and goes black and start over.

No any news software recently, I got a lot of apps but all working before the accident. I didnt flash an unpatched ROM as explained above. Im pretty sure it is the same AP file the same version I had on device (S10+ does no longer receive updates so I'm 99.99% sure it is). And it is a stock FW.

Yes, I can get to both stock recovery, and after installing TWRP using the method I mentioned above, I still can get to TWRP. I did install Magisk with Recovery mode and Patching the AP file.

Let me know if you need any further information. I can also try to get some logs from the device. Let me know how to get those logs.
[Magisk] J.Michael:
I do not understand "I can run adb shell su that indicates I still can boot with Magisk injected". Say it again in smaller pieces. Do you mean that when you run "adb shell su" you get a response, so you know that you are currently booted with Magisk active?

If so, at that point can't you access your files from within the adb shell?

Have you ever tried flashing an unpatched ROM?

This "using another Android device, and patch the AP image with latest Magisk" is a bad idea. If you can't boot to Android, stop trying to install Magisk. Once you can boot to Android, use the device to patch -- using another device may not work.
[Magisk] pndwal:
So don't flash another ROM for now... If only dirty flashed, even if upgraded, keys for encryption should be ok... Doubt issue is module related... Guess you didn't get into safe mode? (Or you could recover most data from there.)...

Don't flash ROMs without Magisk unless you know better (but looks like you already did, flashing unpatched AP?)... Official instructions say:

... Seems you've now done both... Unpatched AP, then installed recovery w/o Magisk injected...

Probably wouldn't hurt to try patching AP with old Magisk 26.1 since it worked before... (Edit, see below if patching on other device!) Be sure to select Recovery Mode when patching... Alternatively, try patching custom TWRPRecovery.img and flash that...

Still not sure why you had original issue... Did you use standard patch recovery only or the other method for S10 series where recovery is patched but a custom Magisk-patched kernel is used afterwards (effectively using kernel instead of Ramdisk for init)?...

... Now see you're patching on another device!!! You can't do that since 26.0!!! You'll probably still get bootloop! (Refactoring determination of sepolicy/module rule folder meaning patching must be done on the booted device... All devices, even the same are/can be different.)... If you must patch on another device, use 25.x etc... should work if it's another legacy Ramdisk [I meant to say SAR] boot type device also on A12, or at least A10+ (legacy Ramdisk devices update to 2SI w/ A10, legacy SAR don't; they're stuck always on L-SAR... Devices launched with 2SI may also differ in the way Magisk boots, ie. how it injects magiskinit...

Otherwise, please hold fire for now... Haven't had much time today... Still at work... I'll get back with more info... Say if you try patching AP w/ 25.x... remember to flash all binaries... Maybe re-read official instructions... 👍 PW
[Magisk] alex.do:
Sorry if that confused you. I meant I can run `adb shell su <something>` at the Samsung logo screen without errors. This indicates that it still can boots with Magisk injected. The problem is it only stays for 30secs to 1min. Not so much so I can barely do anything.

I can check if I can access to /sdcard with `adb shell su`. But I really doubt that because when I boot into TWRP I can only see /sdcard and /data with lots of files and folders with random strings.

I think for some reasons the device won't boot up because the encryption key somewhere somehow went missing or corrupted?

No I did not flash any other ROM so far. Just that exact AP file the current FW, patched by Magisk. You are right, it seems I couldn't be able to get into Safe Mode. I tried different ways from combo keys to quickly using adb shell (with su) command to modify prop. To be exact this command:

`adb shell su -c 'setprop persist.sys.safemode 1'`

It always ends up hanging at the Samsung logo screen and start over.

Again, I did not flash unpatched AP. What I did was trying reflash multiple times the same set of images (BL, CP, HOME_CSC and magisk_patched_xxxx.tar as AP). I got 2 versions of magisk_patched_xxxx.tar files, v26.1 and v27.0. None of them solves the issue.

I did use the method specifically for Samsung (with NO ramdisk). That's why I got the device running with Magisk v26.1 for a long time.

for v27.0, I used another device (not root), to just install Magisk latest and patch the AP file (again, that same AP file) of my S10+ using the recovery mode method. If you are saying Magisk works differently when patching AP file alone on another device, then perhaps I will try to find another S10+ and try again.

Current status: I flashed TWRP and was able to boot into TWRP. The only problem now is I can't get access to actual files on /sdcard (like I said its all random strings - encrypted).

How did I flash TWRP? with Odin, I loaded all images BL, CP, HOME_CSC, magisk_patched, and additionally TWRP image in USERDATA slot. I believe doing this won't change anything at all except for only the `recovery.img` so that I can be able to boot into TWRP instead of stock recovery. Now I believe booting into Magisk may not work because Magisk also patched the same `recovery.img`. I was using the "official" TWRP for `beyond2lte` here: https://dl.twrp.me/beyond2lte/twrp-3.7.0_9-2-beyond2lte.img.tar.html

I will also try with v25.x too!

I understand that simply flashing CSC or wipe data partition would solve the bootloop, but I want to try everything to save some important data. Pics of my kids I don't want to lose. So I truely appreciate any any help!
[Magisk] zgfg:
For TWRP to see the storage, it must ask for your Android unlock print screen - but if something is messed up with encryption, it wouldn't

For ADB, you can prepare a command, or batch script and wait for the moment when device boots and the hit the Enter on the PC

Better, you can use adb wait-for-device like in this example:

adb wait-for-device shell magisk --remove-modules

Hit Enter when device starts booting, ADB will wait for server to connect and will execute the given command right at that moment
[Magisk] mrgbuzz:
So I tried again using canary magisk. I did a clean install data wipe. Followed instructions: adb pull patched rom. That finished, reboot device and I am now stuck again on Poco logo. Phone is not booting.

Poco X5 pro

Evo X 9.0 (Android 14)

Back working again. Noob question so. Do I need to flash the patched img to both partitions of my phone to get magisk working? I dont recall doing this originally before I flashed the new rom. But if this gets magisk working, I'll try!

Thanks again
[Magisk] pndwal:
Maybe... But puzzle if nothing updated?... only device completely powered down... Should be able to boot standard system (shouldn't hurt) and then system with Magisk by using key combo to boot via recovery for injected magiskinit...

Oh... You said tried "Re-flash the whole firmware files (with HOME_CSC) again and again"... So firmware with Magisk patched to recovery in AP binary very time?...

So from powered down state, key combo for safe mode with usb device (can be headphones even) connected (required w/ A11+ on OneUI)??

Ah, good... But 27.0 is broken for reasons I gave... Is 26.1 the last you had working and patched file produced on this device and exactly the same ROM (no updates taken since?... Assume that's a safe bet as 12 would have arrived some time ago)... If so, that should work... If you made it again on different device, likely an issue as 26.0 had the refactored sepolicy rule directory selection...

Well, for any A-only device launched with Android 9 (le A-only L-SAR device lacking B/L support for ramdisk in /boot partition)...

Even that may be fraught... Would need to be same device on same ROM to be certain... Try with 25.x if doing that...

Not sure what USERDATA slot means then (I'm not a Sammy user)... But if recovery partition is flashed, you've lost original Magisk patched recovery... Magisk-patching custom TWRPRecovery.img can work to have root + custom recovery as I mentioned however... Don't think it'll help if can't see encrypted data however...

Still not clear if you patched the image intentionally... Or how did Magisk patch it?

Maybe... 🤔 Maybe not...

But you said:

So I wonder if you were actually releasing keys at the correct time to boot to system with Magisk 🤔...

Please confirm that with all stock images (in Odin binaries) but AP Magisk patched in Recovery mode you can reach recovery with recovery key combo (incl. connected USB device), and that when attempting to boot to system with Magisk (which fails), you are similarly pressing Power + Bixby + Volume Up (with USB device connected), but as soon as the device vibrates (with the splash screen) you are releasing all buttons... Please say what occurs when you release the keys at splash screen/vibration occurrence...

If correct timing doesn't work and standard booting bootloops with original Magisk patched ROM, try patched 25.x on another device... use only stock binaries (no TWRP) for this and take care with key combo timing... If that fails, I'd probably be asking experienced S10 series devices users in these threads:

• https://xdaforums.com/t/magisk-root-for-the-galaxy-s10-series.3918699/post-89477938

• https://xdaforums.com/t/tutorial-ro...android-12-one-ui-4-1-stock-firmware.4394629/

🤠 PW
[Magisk] pndwal:
No... Just per official instructions to current slot. 🤠 PW
[Magisk] mrgbuzz:
Ok .. I had to flash the rom boot.img to get phone working again. I flashed it to both a and b partitions. On previous attempts of flashing the patched img without specifying or flashing to both a and b, I ended up with phone not booting. Followed the patching instructions correctly.
[Magisk] alex.do:
I'm pretty sure nothing updated since. As it's kinda old device, no longer updates since Mar 2023.

Also pretty sure on that. I'm aware of flashing all stock binaries would potentially cause the device to "re-lock" the bootloader automatically. so I always use (BL, CP, HOME_CSC, and magisk_patched_xxxx.tar). Every single time.

Yes. It's Power then when Samsung logo press and hold VolDown. I did both with and without usb plugged in. Did not work for me unfortunately.

Understood. And yes 26.1 is the last I had it working. Patched file magisk_patched_xxxx.tar produced on this device from exactly the same binary AP file. Unless I'm mistaken, the last update was on Mar 2023 so there should be no more updates since. (Shame on Samsung for this!)

It's kind of a slot. So with Odin there are 5 slots AP, BL, CP, CSC and USERDATA where you can put respective binaries. Normally USERDATA is not used, and for rooting with Magisk, the AP will always be magisk_patched_xxxx.tar. (When flashing Odin uses some kind of PIT definition to determine the order of image files to be flashed. This I'm not sure at all and I never touch PIT option.)

the magisk_patched_xxxx.tar I have, I patched it with Magisk on this device. it was still running that exact ROM since then. I strictly followed this instructions back then: https://topjohnwu.github.io/Magisk/install.html#samsung-devices

I believe I did. As when I tried without recovery mode (no usb plugged in nor holding VolUp), I was not able to execute `magisk` or `su` command using adb shell. It said binary inaccessible or not found something. When I tried with recovery mode (usb plugged in, holding VolUp and releasing right after the very first screen), I was able to run `adb wait-for-device shell su -c magisk --remove modules`. It returns without errors (assumedly works, right?).

Yes. The ability to exec some command with `adb shell su` and `adb shell magisk` should prove that it was booted with Magisk.
[Magisk] Siema89:
Edited the original post with added logcat since boot (adb reboot && adb -d logcat >> logcat.log) and boot image.
[Magisk] SimplyCity:
Oh, that would be great, kind sir.

I uploaded my simple module, made with template her: https://we.tl/mOcwE4M0QL

It contains two apps: one inside "system/app/folder4app/" and one inside "system/priv-app/folder4app/"

Those are not mine apps, I took them from well known Dolby dap6.5 mod. It has recovery flashable zip, and it works if flashed from recovery beside Magisk, but then it is "hard" system mod. (Dolby is not harmfull for any system and can be simply deleted without affecting in any way. At least for me. Thats why I decided to work on those project using a part of Dolby mod).

The same is with my mod: when I flash it form recovery beside Magisk, I mean not systemlessy way, my app works being installed to system/priv-aap.

But if I install module with mine app from Magisk Manager, it gives me bootloop.

Mine module is as same as one I've shared via wetransfer above, it just has my own app instead of that one I placed there.

I discuss it with mr [MENTION=2226076]stangri[/MENTION] here: http://xdaforums.com//apps/magisk/module-app-systemizer-t3477512/post69664844, if you can take a look, please, bc it is a lot of writing and I do not want to duplicate that.

So, if you would be so nice and help me finding solution for problem I got (and it seems not me only), it would be bigest help you could give me. Much, much appreciated.

To be true solution would be for me like bottle of water for thirsty trooper in the middle of Sahara.

Thanks in advance
[Magisk] Captain_Throwback:
Before I take a look, first did you try flashing the Magisk module in recovery?
[Magisk] Captain_Throwback:
Module installed fine for me.

If the problem you're concerned about is the bootloop, a logcat from bootup would be necessary to help figure that out, as well as the advanced Magisk logs.
[Magisk] JohnCorleone:
Well, I have been super patient as this project as progressed but now I want to give it a try. I am on a T-Mobile HTC 10 with SuperSU v2.78 forceencrypt and systemless Xposed installed.

I just got an update last night for November's Security update anyhow, I grabbed Magisk v9, phh superuser-Magisk r266-2.zip and Magisk Manager v2.5.apk.

My questions are...did I grab the correct zips and apks for the HTC 10 and secondly, do I need to do anything more then uninstall Xposed ?? Should I go the full mile and run a RUU and start completely clean or is that unnecessary? Big thanks for the help! I have really been excited about the possibilities with this!
[Magisk] SimplyCity:
Yes, same result: bootloop.

I can tell something may be not important, but maybe it is: when I install mymodule form Magisk Manager, at the end it informs me that changes will be visible after restart. Well, when I - b4 restart - look into /magisk/mymodulefolder/ - there is no system folder inside, which I supposed has to be there...

I tell more, maybe I told that already: if I remove apk files from mymodule, and install it with Magisk Manager, I got bootloop, too...

I see you just test it and install it, well, it installs on my device, too. I got bootloop after restart. Phone never boot up after that...

Did your device boots up after restart?
[Magisk] Captain_Throwback:
Installs fine here, and no bootloop. Seems like its specific to your device, and thus the logging I previously mentioned would be necessary. Since it works for me using Magisk, I'm not sure how/if Magisk is at fault.
[Magisk] Captain_Throwback:
[MENTION=5295919]SimplyCity[/MENTION]

A few more screenshots for you.
[Magisk] phuhcue:
I think anything that modifies boot.img on dm-verity Galaxy phones will cause SN to fail.

Several SN updates ago I was able to use magiskhide and pass. Since the last update the only thing I can do to pass is to flash stock boot.img and verity patch.

To get root I flash magish and phh. To pass SN I flash magisk uninstaller. I can go back and forth like this with no issues. Really inconvenient but works for now.

I imagine you can do the same with supersu by reflashing the kernel to get root back but that's even more tedious.

If better options are out there anyone please chime in.
[Magisk] SimplyCity:
Ok, thank you very much. It is very good to hear that it is not Magisk related problem. You are very helpfull, thank you.

Now I have to dig in my system, and talk with my team mates to search for solution.

Very much appreciated, thanks again!

:)
[Magisk] Captain_Throwback:
It's not supposed to be there before reboot - it gets merged on the following boot so magisk.img can be expanded if necessary. See the Magisk log in the attached screenshot.
[Magisk] SimplyCity:
:) it is trully amazing, that whole Magisk. And at this point I would like to appologise any ane could be touched by my issue. Thanks for help. When I would have other Magisk related questions, I know where to knock to get fastest answers!

Thank you again.
[Magisk] Captain_Throwback:
Please don't, lol.

Fighting with SafetyNet is bad enough. I don't want to have to start fighting with AirWatch (again).

I'm sure [MENTION=3400685]digitalhigh[/MENTION] agrees with me ;).
[Magisk] dimm0k:
Magisk module woes

having troubles flashing modules in Magisk so I went ahead and also grabbed the "mytestmodule" and tried to flash within Magisk, however I still get the very generic error "Installation error!" do you or [MENTION=4470081]topjohnwu[/MENTION] have any suggestions for this error?

EDIT: just went ahead with a catlog while installing and noticed

11-17 10:01:25.344 D/SU (15278): OUT: ! /data/magisk_merge.img mount failed... abort

attached a snippet of my catlog while trying to install a module...
[Magisk] olivercervera:
AirWatch isn't that bad, the problem is compromised detection that all enterprise software have!

I had an informal chat with our security guys. They basically said as long as a system is able to bypass SafetyNet, there is not much we can do.

We all know that at some point SafetyNet will show up, but the developers community has shown a huge effort in this, and this is great to see in my opinion!

I would like to send you a private message. Is this possible?
[Magisk] Captain_Throwback:
Go ahead.
[Magisk] knipp21:
Do these help with the whole losing root issue?
[Magisk] Captain_Throwback:
What errors? When what happens?
[Magisk] Captain_Throwback:
No.

I've thoroughly logged this issue for [MENTION=4470081]topjohnwu[/MENTION]. No additional logs are required. Right now it seems to be random and inconsistent. I'm pretty sure he already knows what the issue is, but figuring out how to fix it has been a challenge.

So I ask everyone to be patient. If rebooting your device after losing root is too much of a hassle for you, then I guess you'll have to use an alternative solution for the time being :rolleyes:.
[Magisk] alex.do:
I did use adb wait-for-device. But the magisk --remove-modules did not help me at all. Any other command that I should try?
[Magisk] wilsonhlacerda:
I haven't read past posts, but do you want to disable Magisk so you can boot? If so, some alternatives also:

- force device booting into Safe Mode by pushing appropriate buttons. Search for how it is on your device. Try not only once, it may be tricky on timing.

- get the boot image file from your same ROM (untouched/not Magisk patched) and flash it in your device boot (thru Fastboot or TWRP or similar)
[Magisk] zgfg:
I didn't check what was your original issue.

magisk --remove-modules was only an example how to use adb wait-for-device to postpone adb command to the moment when ADB server initializes

Put your own command there (you were talking that you have no time to enter adb command to check /sdcard or so), that you don't need to wait for few seconds when ADB becomes available and before the phone bootloops (?)