topjohnwu / Magisk

The Magic Mask for Android
GNU General Public License v3.0
46.97k stars 11.86k forks source link

Requires Additional Setup Issue, Zygisk Never Works, Recovery Patch Method (no ramdisk) #8230

Closed Hermais closed 2 weeks ago

Hermais commented 1 month ago

Device: Xiaomi Redmi Note 8 (ginkgo) Android version: 9 PKQ1.190616.001 Magisk version name: magisk-debug Magisk version code: b38ab2a7 (27004) (D)

My device does not have ramdisk (despite being android 9), so following the instructions of magisk installation, I patched the recovery file that I extracted from the firmware that I have. then installed it via fastboot and did also the flash the vbmeta, now when I press the recovery keys combo to activat magisk mode, device boots successfully, then I open magisk with the infamous pop-up appearing to me named Requires Additional Setup so I press OK, and after a few seconds, a floating snackbar pops and says setup failed. Despite that root previliges are working (using game gaurdian to hack candy crush πŸ˜† 🍬 ). But Zygisk never works. Even when I try to turn it on from the settings and apply a reboot ( A RECOVERY REBOOT, NOT A NORMAL REBOOT ), Zigisk still never works! this causes any module that I flash (like Shamiko) to fail premetaruly requiring me to install magisk 20.4+! Help please. boot_logcat.txt magisk_log_2024-07-19T17.23.03.log

pndwal commented 1 month ago

Not sure why you have the issues with Recovery mode Magisk, but sounds like it may be this issue: https://github.com/topjohnwu/Magisk/issues/8219 fixed in https://github.com/topjohnwu/Magisk/pull/8223

Anyway, you don't need Recovery mode for your Xiaomi device... That's for A-only L-SAR devices (all launched with Android 9) like Samsung S10 that don't have bootloader support for Magisk in /boot partition... While you device doesn't have OEM supplied ramdisk in /boot, it does have bootloader support which is the critical factor... Since Magisk adds generic ramdisk components when missing you can use Boot (normal) mode Magisk.

Recommend you restore unpatched images (recovery, vbmeta, other?) then uncheck Recovery Mode (and ensure it always remains unchecked) before patching and flashing boot.img... Magisk will add basic ramdisk while patching (App will still say Ramdisk=No) and you'll be able boot to system with Magisk normally... πŸ‘

coolzyd commented 1 month ago

On some of the devices without ramdisk,you can install magisk without choose "install to recovery" option.It does not have any influent on use magisk functions.I have tried to install like this,it do work and zygisk can normally work on my Android8.1 device(no ramdisk)

Hermais commented 1 month ago

Unfortunately, the latest canary release didn't also work. Neither by using the boot.img or the recovery method. Still root access is availble, but again my issue is the inability to use zygisk and installing any module fails. This is the log of the debug version of the latest canary release on #8223

Edit: I found this old issue #4010 , it perfectly depicts the issue that I have, any ideas? Is there a way to do the additional setup for magisk manually?

magisk_log_2024-07-26T12.41.01.log

aviraxp commented 1 month ago
06-07 07:46:43.635   558   560 D Magisk  : resetprop: get prop [ro.crypto.state]: [encrypted]
06-07 07:46:43.635   558   560 D Magisk  : resetprop: get prop [init.svc.vold]: [running]
06-07 07:46:43.635   558   560 I Magisk  : ** post-fs-data mode running
06-07 07:46:43.681   558   560 I Magisk  : * Initializing Magisk environment
06-07 07:46:43.681   558   560 E Magisk  : mkdir /data/adb/magisk failed with 1: Operation not permitted
06-07 07:46:43.682   558   560 E Magisk  : open /data/adb/magisk failed with 1: Operation not permitted
06-07 07:46:43.682   558   560 E Magisk  : fdopendir failed with 9: Bad file descriptor
--------- beginning of crash
06-07 07:46:43.683   558   560 F libc    : FORTIFY: readdir: null DIR*
06-07 07:46:43.683   558   560 F libc    : Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 560 (magiskd), pid 558 (magiskd)
06-07 07:46:43.706   563   563 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
06-07 07:46:43.706   563   563 E libc    : failed to connect to tombstoned: No such file or directory
06-07 07:46:43.706   563   563 I crash_dump64: performing dump of process 558 (target tid = 560)
06-07 07:46:43.707   563   563 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
06-07 07:46:43.707   563   563 F DEBUG   : Build fingerprint: 'xiaomi/ginkgo/ginkgo:9/PKQ1.190616.001/V11.0.12.0.PCOMIXM:user/release-keys'
06-07 07:46:43.707   563   563 F DEBUG   : Revision: '0'
06-07 07:46:43.707   563   563 F DEBUG   : ABI: 'arm64'
06-07 07:46:43.707   563   563 F DEBUG   : pid: 558, tid: 560, name: magiskd  >>> magiskd <<<
06-07 07:46:43.707   563   563 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
06-07 07:46:43.707   563   563 F DEBUG   : Abort message: 'FORTIFY: readdir: null DIR*'
06-07 07:46:43.707   563   563 F DEBUG   :     x0  0000000000000000  x1  0000000000000230  x2  0000000000000006  x3  0000000000000008
06-07 07:46:43.707   563   563 F DEBUG   :     x4  0000000000000000  x5  0000000000000000  x6  0000000000000000  x7  0000000000000020
06-07 07:46:43.707   563   563 F DEBUG   :     x8  0000000000000083  x9  9903fc654b0491d2  x10 0000000000000000  x11 fffffffc7fffffdf
06-07 07:46:43.707   563   563 F DEBUG   :     x12 0000000000000001  x13 ffffffffffffffff  x14 ff00000000000000  x15 ffffffffffffffff
06-07 07:46:43.707   563   563 F DEBUG   :     x16 00000076534f22b0  x17 0000007653411f60  x18 0000007652c5d000  x19 000000000000022e
06-07 07:46:43.707   563   563 F DEBUG   :     x20 0000000000000230  x21 00000057b9bae000  x22 00000057b9b62a6f  x23 0000007652c19000
06-07 07:46:43.707   563   563 F DEBUG   :     x24 000000000000010c  x25 00000076529df588  x26 00000057b9baf258  x27 000000003b9aca00
06-07 07:46:43.707   563   563 F DEBUG   :     x28 00000057b9baf000  x29 00000076529dcf60
06-07 07:46:43.707   563   563 F DEBUG   :     sp  00000076529dcf20  lr  00000076534053d4  pc  00000076534053fc
06-07 07:46:43.708   563   563 F DEBUG   : 
06-07 07:46:43.708   563   563 F DEBUG   : backtrace:
06-07 07:46:43.708   563   563 F DEBUG   :     #00 pc 00000000000223fc  /system/lib64/libc.so (abort+116)
06-07 07:46:43.708   563   563 F DEBUG   :     #01 pc 000000000002402c  /system/lib64/libc.so (__fortify_fatal(char const*, ...)+120)
06-07 07:46:43.708   563   563 F DEBUG   :     #02 pc 0000000000024208  /system/lib64/libc.so (readdir+192)
06-07 07:46:43.708   563   563 F DEBUG   :     #03 pc 0000000000046908  /sbin/magisk
06-07 07:46:43.708   563   563 F DEBUG   :     #04 pc 00000000000273b0  /sbin/magisk
06-07 07:46:43.708   563   563 F DEBUG   :     #05 pc 000000000002a158  /sbin/magisk
06-07 07:46:43.708   563   563 F DEBUG   :     #06 pc 00000000000424a8  /sbin/magisk
06-07 07:46:43.708   563   563 F DEBUG   :     #07 pc 0000000000029d08  /sbin/magisk
06-07 07:46:43.708   563   563 F DEBUG   :     #08 pc 0000000000090534  /system/lib64/libc.so (__pthread_start(void*)+36)
06-07 07:46:43.708   563   563 F DEBUG   :     #09 pc 0000000000023cb8  /system/lib64/libc.so (__start_thread+68)

https://github.com/topjohnwu/Magisk/issues/4010

pndwal commented 1 month ago

Again, you should stop using Recovery mode and need to restore your ROM (patched recovery.img will cause issues) before trying Boot mode installation... Did you do that?

Also, you should take Uninstall Magisk, Complete Uninstall from App or delete everything in /data/adb while you still have root for clean Magisk installation (in case Magisk configuration or modules are corrupt or incompatible) as configuration won't be rebuilt unless the old data is removed...

I know Boot mode works fine for willow and ginkgo...

Hermais commented 1 month ago

Again, you should stop using Recovery mode and need to restore your ROM (patched recovery.img will cause issues) before trying Boot mode installation... Did you do that?

Also, you should take Uninstall Magisk, Complete Uninstall from App or delete everything in /data/adb while you still have root for clean Magisk installation (in case Magisk configuration or modules are corrupt or incompatible) as configuration won't be rebuilt unless the old data is removed...

I know Boot mode works fine for willow and ginkgo...

Look ( in Joe Biden's voice πŸ˜‚), Whenever I want to remove root access and magisk to use my banking apps or any annoying apps that object at magisk's mere presence (like Vodafone app, even if I hide magisk, somehow it knows it's there that's why I need to flash shamiko module, since it can specifically handle this app and a ton of others) SO, what I simply do is boot my phone into the fastboot mode and reflash these stock: boot, recovery and vb-meta partitions. That is before I uinistall magisk from the app.Then for the given magic version that I'm going to use I take the stock boot file make MAGISK patch it without checking the recovery mode I'm now using the boot mode and it works exactly as the recovery mode with the same mentioned issue, so I will add to the steps removing the /data/adb and edit this comment to find out what happens.

Edit: I successfully deleted /data/adb folder and there is a new issue that appears to be specific to the latest debug canary version of the app with the uninstall, it used to work before, but now it crashes shortly after this: Screenshot_2024-07-27-10-12-39-318_com topjohnwu magisk

pndwal commented 1 month ago

Edit: I successfully deleted /data/adb folder and there is a new issue...

You deleted /data/adb folder? Not sure you should... Is it restored (with original permissions)?

stephiemtz12 commented 1 month ago

El mar, 23 de jul de 2024 5:54 a. m., pndwal @.***> escribiΓ³:

Not sure why you have the issues with Recovery mode Magisk, but sounds like it may be this issue: #8219 https://github.com/topjohnwu/Magisk/issues/8219 fixed in #8223 https://github.com/topjohnwu/Magisk/pull/8223

Anyway, you don't need Recovery mode for your Xiaomi device... That's for A-only L-SAR devices (all launched with Android 9) like Samsung S10 that don't have bootloader support for Magisk in /boot partition... While you device doesn't have OEM supplied ramdisk in /boot, it does have bootloader support which is the critical factor... Since Magisk adds generic ramdisk components when missing you can use Boot (normal) mode Magisk.

Recommend you restore unpatched images (recovery, vbmeta, other?) then uncheck Recovery Mode (and ensure it always remains unchecked) before patching and flashing boot.img... Magisk will add basic ramdisk while patching (App will still say Ramdisk=No) and you'll be able boot to system with Magisk normally... πŸ‘

β€” Reply to this email directly, view it on GitHub https://github.com/topjohnwu/Magisk/issues/8230#issuecomment-2245028245, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMCFTLPENW3TEOVQYIGACL3ZNZABDAVCNFSM6AAAAABLEZXJE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBVGAZDQMRUGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Hermais commented 1 month ago

Edit: I successfully deleted /data/adb folder and there is a new issue...

You deleted /data/adb folder? Not sure you should... Is it restored (with original permissions)?

What do you mean that I shouldn't, you suggested so πŸ€” and No all permissions were reset and root gain was prompt was required again.

pndwal commented 1 month ago

Edit: I successfully deleted /data/adb folder and there is a new issue...

You deleted /data/adb folder? Not sure you should... Is it restored (with original permissions)?

What do you mean that I shouldn't, you suggested so πŸ€”

I don't know if it's safe to delete it... I said delete everything in it...

Hermais commented 1 month ago

Edit: I successfully deleted /data/adb folder and there is a new issue...

You deleted /data/adb folder? Not sure you should... Is it restored (with original permissions)?

What do you mean that I shouldn't, you suggested so πŸ€”

I don't know if it's safe to delete it... I said delete everything in it...

Anyways, no harm was done, I still need a fix for why magisk fails to make the additional setup, and the modules tab is greyed out as a result... Should I provide my boot.img?

yujincheng08 commented 2 weeks ago

Duplicate of #4010

Hermais commented 4 days ago

So what is the suggested fix given that both the ginkgo_global_images_V11.0.12.0.PCOMIXM_20201119.0000.00_9.0_global_37804edbcb OEM ROM is broken (mine) and the Pixel Experience Custom ROM is also broken? (the duplicate issue) @yujincheng08

pndwal commented 4 days ago

... I take the stock boot file make MAGISK patch it without checking the recovery mode I'm now using the boot mode and it works exactly as the recovery mode with the same mentioned issue...

Interesting that I never had an issue with boot mode Magisk in Redmi Note 8T (willow), but don't have that device now... Used up to early 26.x however.

Hermais commented 2 days ago

... I take the stock boot file make MAGISK patch it without checking the recovery mode I'm now using the boot mode and it works exactly as the recovery mode with the same mentioned issue...

Interesting that I never had an issue with boot mode Magisk in Redmi Note 8T (willow), but don't have that device now... Used up to early 26.x however.

The issue is not with how Magisk is installed. The root privileges can be obtained either by the recovery mode or by the boot mode. So essentially Magisk partially installs. The problem is that Magisk Manager never succeeds in completing or preparing its Magisk environment because Magisk Manager fails to create the folder required in the data adb. I thought this is because of the enforcing SE Linux, And I tried to make it permissive, but I couldn't... @yujincheng08 assumed in the previous issue, or the duplicate issue that it is because of a broken ROM. But he doesn't specify more. What does that mean? What is the solution?

pndwal commented 2 days ago

Yeah, doubtful it's a stock ROM issue too, but looking back see you flashed vbmeta (generally unnecessary)... I'd be dirty flashing stock ROM to restore images next, especially as you've made non-standard changes... Use fastboot ROM (not recovery) as it's more complete... Also, latest stock stable seems to be MIUI V12.5.2.0.RCOMIXM, so why stay on old ROM?

Next, patch extracted boot.img in App without Recovery mode selected and flash via fastboot...