Magisk: Executing magiskinit causes fatal crash on some devices

Created on 7 Dec 2019  ·  71Comments  ·  Source: topjohnwu/Magisk

I have the k20 pro indian global rom, so every thing was running smooth until latest MIUI 11 update, I installed magisk ( differnet versions 20.1, 20 and 19.7) using twrp and my device always boots back to recovery any advice??

confirmed regression

Most helpful comment

works fine here mi 9t miui 11 eea and magisk 20.3

What install method did you use? I assume itll work for global now

Hey! i used the magisk manager to patch the boot.img from the ota file (https://xiaomifirmwareupdater.com/miui/) < --download the ota from here (select your miui type eea or global and whatever and select the same version)
20200115_225708 and then i rebooted to fastboot mode and tested it with fastboot boot magisk_patched.img (after pacthing with magisk manager it's located in downloads) after execute fastboot boot magisk_patched.img it should boot normal after that go to magisk manager and If it says installed go to fastboot again and type fastboot flash boot magisk_patched.img i hope that will help you ! :) sorry for that long text haha

EDIT 1 : i made a picture so you know what's miui type and miui version (somehow it changed to global but i never modified the type but the version code still says PFJ(EU)XM so it's still EEA weird)

All 71 comments

#2134 获取和我的情况一样。 如果不存在manager 自动执行了 /sbin/magiskinit -x manager /data/magisk.apk 也会 bootlooop

can you please write it in English?

我说蹩脚的英文你也看不懂啊。。。。

For the sake of everyone reading please keep conversation in English only.
为了大家阅读,请保持英语对话。

Xiaomi 8 executes the command and causes the system to crash

Order: /sbin/magiskinit -x manager /data/magisk.apk

@androiddisk are you using custom ROM or official ROM?

@androiddisk您使用的是自定义ROM还是官方ROM?

official ROM

@androiddisk您使用的是自定义ROM还是官方ROM?
小米8 Android Q
if uninstall manager or if cannot find manager。
then bootstages.cpp run /sbin/magiskinit -x manager /data/magisk.apk
then phone bootloop。

BUG : /sbin/magiskinit != boot.img/init

if phone is launcher ok . i use adb shell su -c magiskpolicy or supolicy . phone bootloop

如果我描述得不够好, 请看中文描述
错误来自于 /sbin/magiskinit 他不是magisk的init 他好像是官方 boot.img/.backup/init
所以它不能被执行 /sbin/magiskinit -x manager /data/magisk.apk 。神奇的是手机立马死机
截图请看 https://github.com/topjohnwu/Magisk/issues/2134

@androiddisk您使用的是自定义ROM还是官方ROM?

only 小米8 Andoird Q have bug。other 小米 AndroidQ 正常

不知道你的系统来自哪里,这是raphael/raphaelin(红米K20 Pro全球各版本)的MIUI 稳定版android dump,都不存在magiskinit文件(开发版一样,自行查阅),请自行检查你的MIUI版本来源?
另,raphael/raphaelin采用system-as-root,boot分区并没有其他可执行文件

https://github.com/AndroidDumps/xiaomi_raphaelin_dump/tree/raphaelin-user-10-QKQ1.190825.002-V11.0.1.0.QFKINXM-release-keys/system/sbin

https://github.com/AndroidDumps/xiaomi_raphael_dump/tree/raphael-user-10-QKQ1.190825.002-V11.0.1.0.QFKMIXM-release-keys/system/sbin

https://github.com/AndroidDumps/xiaomi_raphael_dump/tree/raphael-user-10-QKQ1.190825.002-V11.0.3.0.QFKEUXM-release-keys/system/sbin

https://github.com/AndroidDumps/xiaomi_raphael_dump/tree/raphael-user-10-QKQ1.190825.002-V11.0.4.0.QFKCNXM-release-keys/system/sbin

我们在说官方rom上安装magisk

不知道你的系统来自哪里,这是raphael/raphaelin(红米K20 Pro全球各版本)的MIUI 稳定版android dump,都不存在magiskinit文件(开发版一样,自行查阅),请自行检查你的MIUI版本来源?
另,raphael/raphaelin采用system-as-root,boot分区并没有其他可执行文件
https://github.com/AndroidDumps/xiaomi_raphaelin_dump/tree/raphaelin-user-10-QKQ1.190825.002-V11.0.1.0.QFKINXM-release-keys/system/sbin
https://github.com/AndroidDumps/xiaomi_raphael_dump/tree/raphael-user-10-QKQ1.190825.002-V11.0.1.0.QFKMIXM-release-keys/system/sbin
https://github.com/AndroidDumps/xiaomi_raphael_dump/tree/raphael-user-10-QKQ1.190825.002-V11.0.3.0.QFKEUXM-release-keys/system/sbin
https://github.com/AndroidDumps/xiaomi_raphael_dump/tree/raphael-user-10-QKQ1.190825.002-V11.0.4.0.QFKCNXM-release-keys/system/sbin

我们在说magisk

我需要纠正的是,这个文件不是由MIUI产生的,也不是所谓MIUI官方文件

没人在说这个文件是由MIUI产生的。 你应该先纠正你对这个issues的了解

不知道你的系统来自哪里,这是raphael/raphaelin(红米K20 Pro全球各版本)的MIUI 稳定版android dump,都不存在magiskinit文件(开发版一样,自行查阅),请自行检查你的MIUI版本来源?
另,raphael/raphaelin采用system-as-root,boot分区并没有其他可执行文件
https://github.com/AndroidDumps/xiaomi_raphaelin_dump/tree/raphaelin-user-10-QKQ1.190825.002-V11.0.1.0.QFKINXM-release-keys/system/sbin
https://github.com/AndroidDumps/xiaomi_raphael_dump/tree/raphael-user-10-QKQ1.190825.002-V11.0.1.0.QFKMIXM-release-keys/system/sbin
https://github.com/AndroidDumps/xiaomi_raphael_dump/tree/raphael-user-10-QKQ1.190825.002-V11.0.3.0.QFKEUXM-release-keys/system/sbin
https://github.com/AndroidDumps/xiaomi_raphael_dump/tree/raphael-user-10-QKQ1.190825.002-V11.0.4.0.QFKCNXM-release-keys/system/sbin

我们在说magisk

我需要纠正的是,这个文件不是由MIUI产生的,也不是所谓MIUI官方文件

你是MIUI开发人员么?

@androiddisk 請將你的 ROM 上傳 (或提供下載地址)
@1582130940 我應該證實後再發布信息,這是我的疏失,已經將相關的文刪除了。
將你的留言一併刪除,並不是希望抹滅我說過的話,只是希望不要在這裡繼續流傳。

@1582130940 @vvb2060 看起來他說的應該是這個 ROM 吧
https://github.com/AndroidDumps/xiaomi_dipper_dump/tree/dipper-user-10-QKQ1.190828.002-9.10.17-release-keys
沒毛病,感覺可能是 kernel 出毛病?

@androiddisk 請將你的 ROM 上傳 (或提供下載地址)
@1582130940 我應該證實後再發布信息,這是我的疏失,已經將相關的文刪除了。
將你的留言一併刪除,並不是希望抹滅我說過的話,只是希望不要在這裡繼續流傳。

https://hugeota.d.miui.com/9.12.5/miui_MI8_9.12.5_6e60503465_10.0.zip
感谢你的付出 thank you!

另外,请教一下 。Magisk 的很多日志都没有打印。这是为什么呢(这里不是说LOGD )。

最早的日志 是 LOGI(SHOW_VER(Magisk) " daemon startedn");
比这个还早的日志一个都看不到

@androiddisk 裝完 Magisk 之後可以透過 adb shell 回傳 cat /proc/mounts 的結果嗎?
BTW, 你的 zip 是 OTA 包,無法獲的完整 system

Oh,那得跑一些 tool 還原 system image

Oh,那得跑一些 tool 還原 system image
这个是完整的ROM
111111

@1582130940 剛剛把 image dump 出來了,初步看起來沒有問題
@androiddisk 你可以把壞掉的 magiskinit 上傳過來嗎?

@1582130940 剛剛把 image dump 出來了,初步看起來沒有問題
@androiddisk 你可以把壞掉的 magiskinit 上傳過來嗎?

抱歉 晚点才能上传上来

@1582130940 剛剛把 image dump 出來了,初步看起來沒有問題
@androiddisk 你可以把壞掉的 magiskinit 上傳過來嗎?
久等了, 由于无法直接上传我修改了后缀名

magiskinit.ZIP

@topjohnwu did you solve this issue? thanks in advance

https://forum.xda-developers.com/k20-pro/help/magisk-bootloop-miui-11-11-0-1-0-global-t4015471

Solution is here by changing some permissions to 644
thanks for your respond
I'm able to boot up and have root access but can't install any module

https://forum.xda-developers.com/k20-pro/help/magisk-bootloop-miui-11-11-0-1-0-global-t4015471
Solution is here by changing some permissions to 644
thanks for your respond
I'm able to boot up and have root access but can't install any module

Yeah I thought I couldn't either. But I installed Magiskhide prop config. Downloaded a terminal command propt thing. Typed "su" then "magiskhide enable" and then "magiskhide status" to see if it was enabled. After a few minutes magiskhide was in my dropdown list for magisk :) but not under modules. Was still working but not showing up in modules

https://forum.xda-developers.com/k20-pro/help/magisk-bootloop-miui-11-11-0-1-0-global-t4015471
Solution is here by changing some permissions to 644
thanks for your respond
I'm able to boot up and have root access but can't install any module

Yeah I thought I couldn't either. But I installed Magiskhide prop config. Downloaded a terminal command propt thing. Typed "su" then "magiskhide enable" and then "magiskhide status" to see if it was enabled. After a few minutes magiskhide was in my dropdown list for magisk :) but not under modules. Was still working but not showing up in modules

Never cared about magiskhide, what I need is Xposed any other workaround for that?

I might have to get Xposed to use my apartment nfc card on my phone from shortly reading the help file. Will see later when I'm home. Otherwise I've asked in link below. Comes down to just reading a ton of forums too

https://forum.xda-developers.com/apps/magisk/module-magiskhide-props-config-t3789228/page254#post81210873

@Vanman989 that is not a solution, it is nuking busybox used internally in Magisk, which will break tons of functionality

Probably explains why modules are installing but not saving into magisk module list. But for now it gets me what I need instead of a constant recovery bootloop. Hopefully someone smarter then me figures out a better solution :)

@ Vanman989不是解决方案,它使Magisk内部使用了nubusybox,这将破坏大量功能

请问小米8的 /sbin/magiskinit 是为什么被替换的呢。谢谢

Not sure if the English translation is right on google. I don't know anything about Xiaomi 8's sbin / magiskinit being replaced sorry. Might not be a solution but if I don't use those permission settings I have constant recovery bootloop on Mi9t/K20 MIUI 11. I'd rather have magisk installed and magiskhide working and the apps working I wanted then nothing. Suits me. Otherwise, how do I install Magisk without my phone stuck loading into recovery?

Thank you. But I don't understand why topjohnwu said that changing the permissions of the busybox is not allowed.

Under normal circumstances, busybox should be 644. Why K20 needs to modify 644 permissions

Google Translate may have missed important news. Did you replace the busybox and then modify the 644 permissions. Or did you only modify the 644 permissions and did not replace the busybox

I modified busybox permissions installed with magisk to 664 following instructions below.... maybe it was a typo and I should do 644 and see what happens

Quote:
Originally Posted by shinigami_tsin
Go to /data/adb/magisk/chromeos find "futility" file. Permission 644 for it.
Go to /data/adb/magisk find "BusyBox" file and permission 664 for it.
Reboot and done.
In future, when you flash any rom on k20 pro. Remember that do it if you flash magisk.
Good luck!
(Solution from 4pda)

/data/adb/magisk/chromeos find "futility"
It should be the file needed by the chromeos operating system. The busybox should have 644 permissions by default. Why you need to modify 644 permissions. A little strange

I have no idea sorry. I just follow stuff blindly hopping to get stuff to work :)

I have no idea sorry. I just follow stuff blindly hopping to get stuff to work :)

thank you

@ Vanman989不是解决方案,它使Magisk内部使用了nubusybox,这将破坏大量功能

请问,他们只是修改busybox的权限怎么会破坏大量功能呢。 busybox默认权限应该就是644 也不需要修改呀。抱歉我有很重的好奇心。即使这不是我遇到的问题。还是忍不住了解关于magisk的一切

If it means anything to anyone. I went into TWRP and changed magisk busybox permission to 644 not 664. Phone booted up without bootloop.

But I still have to run playstore busybox pro then enable magiskhide through terminal and im good to go :)

If it means anything to anyone. I went into TWRP and changed magisk busybox permission to 644 not 664. Phone booted up without bootloop.

But I still have to run playstore busybox pro then enable magiskhide through terminal and im good to go :)

What difference did that make to you?

Nothing. Modules are still not saving under the module list. If I run busy box then I can install modules but I have to Reboot and they don't stay. Would be good to get magisk working properly to see if making a module of my apartment fob will get it to work on my phone from card emulator pro.

Nothing. Modules are still not saving under the module list. If I run busy box then I can install modules but I have to Reboot and they don't stay. Would be good to get magisk working properly to see if making a module of my apartment fob will get it to work on my phone from card emulator pro.

Yeah, I'm waiting too for magisk update till then I guess we have to stick with what we have, but don't forget to post if you get anything new 🙂

@sgs2ofameer maaaaate! This seems to have worked :) a pain formatting but worked anyway

https://forum.xda-developers.com/mi-9t/help/phone-stuck-bootloop-try-to-install-t4007259

@sgs2ofameer maaaaate! This seems to have worked :) a pain formatting but worked anyway

https://forum.xda-developers.com/mi-9t/help/phone-stuck-bootloop-try-to-install-t4007259

thx good to hear I'll try it and report back...

@sgs2ofameer maaaaate! This seems to have worked :) a pain formatting but worked anyway

https://forum.xda-developers.com/mi-9t/help/phone-stuck-bootloop-try-to-install-t4007259

which recovery are you using? I can't boot up after formatting data :(

I used twrp-3.3.1-0-davinci.img. The standard one. Install the latest magisk uninstall too so you dont have to keep formatting.

I managed to brick my phone..... not to do with this! because I flashed with "clean all and lock" on rushing. So guttered. Need a hairdryer to take my phone case off and get into EDL mode and flash.

I can confirm I have found a solution to this issue thanks to @Vanman989 hint as follows:
1-Installed official twrp for the k20 pro via fastboot
2-Rebooted to recovery using power bottom + volume up then wipe then format data typed yes
3-Copied latest version of disable dm verity and flashed it and rebooted to system, now twrp should be persistent
4-Rebooted back to recovery and flashed latest magisk zip and rebooted to system again
5-booted up and set up my device for first time and then installed magisk manager and everything is working fine
ps: this was done on miui 11.0.3 QFKINXM

This same issue happens on latest Oneplus 7T, according to @osm0sis

Seems that way, unfortunately:

:/ $ magiskpolicy
 Bad system call
 159|:/ $ su
 :/ # magiskpolicy
 Aborted
 134|:/ # ls
 /system/bin/sh: /system/bin/ls: No such file or directory
 1|:/ # 

Then the global system shell is broken (see the ls command above) until a reboot. :face_with_head_bandage:

Wtf is causing this? I assume the usual was attempted, eg selinux permissive, clean install, etc?

Can confirm this bug for Galaxy S9+ with Android 10 beta (rooted stock). Also, got many reports from users of my app, mostly from devices with custom ROMs. Pixels have no issue.

Here's the kmsg log:

<11>[  571.992710]  [5:       supolicy:30166] supolicy: mount("proc", "/proc", "proc", 0, "hidepid=2,gid=" MAKE_STR(AID_READPROC)) failed Device or resource busy
<11>[  571.992753]  [5:       supolicy:30166] supolicy: mount("sysfs", "/sys", "sysfs", 0, NULL) failed Device or resource busy
<11>[  571.992771]  [5:       supolicy:30166] supolicy: mount("selinuxfs", "/sys/fs/selinux", "selinuxfs", 0, NULL) failed Device or resource busy
<10>[  571.992823]  [5:       supolicy:30166] supolicy: Init encountered errors starting first stage, aborting

Even supolicy --help causes this problem:

$ adb shell
star2lte:/ $ su
star2lte:/ # supolicy --help
Aborted
134|star2lte:/ # ls
/system/bin/sh: /system/bin/ls: No such file or directory

Permissive also has no effect on the issue.

works fine here mi 9t miui 11 eea and magisk 20.3

works fine here mi 9t miui 11 eea and magisk 20.3

What install method did you use? I assume itll work for global now

works fine here mi 9t miui 11 eea and magisk 20.3

What install method did you use? I assume itll work for global now

Hey! i used the magisk manager to patch the boot.img from the ota file (https://xiaomifirmwareupdater.com/miui/) < --download the ota from here (select your miui type eea or global and whatever and select the same version)
20200115_225708 and then i rebooted to fastboot mode and tested it with fastboot boot magisk_patched.img (after pacthing with magisk manager it's located in downloads) after execute fastboot boot magisk_patched.img it should boot normal after that go to magisk manager and If it says installed go to fastboot again and type fastboot flash boot magisk_patched.img i hope that will help you ! :) sorry for that long text haha

EDIT 1 : i made a picture so you know what's miui type and miui version (somehow it changed to global but i never modified the type but the version code still says PFJ(EU)XM so it's still EEA weird)

I managed to get a useable full dmesg log of what happens during boot when simply magiskpolicy was attempted (as early as post-fs-data), and the good news is @topjohnwu thinks he knows what's going on, so stay tuned. :grin:

I can confirm @topjohnwu's suspicion that somehow the wrong init binary was being saved and linked to magiskpolicy, etc. on at least some 2-stage init (2SI) devices.

After booting my device I checked and /init is symlinked to /system/bin/init (which is likely the new normal), but then /sbin/.magisk/rootdir/init appears to be a copy of /system/bin/init (where it should probably be the ramdisk 1st stage init from /.backup/init), and /sbin/magiskinit appears to be a copy of the ramdisk 1st stage init. So no magiskinit anywhere! I'm surprised this isn't affecting more devices!

I added a post-fs-data.d script with the following and it got things working normally on my device until @topjohnwu can work out a proper fix; mileage may vary!

__/data/adb/post-fs-data.d/magiskinitfix__:

#!/system/bin/sh

cp -f /data/adb/magisk/magiskinit /sbin;

I added a post-fs-data.d script with the following and it got things working normally on my device until @topjohnwu can work out a proper fix; mileage may vary!

Thanks! I have checked and it fixed the problem on my device too

Fixed in commit ba55e2bc3288963d093b5fbd88f18c4622e3a43c

Awesome, Will this be implemented in v20.4?

I have a k20 davinci, using magisk canary debug version ce7cb1ee. I got the same bootloop problem. Changing busybox to 644 fixed the bootloop but magisk would be crippled.

I tried @osm0sis 's script: https://github.com/topjohnwu/Magisk/issues/2133#issuecomment-576095312 but it does not solve the bootloop problem.

I noticed @Vanman989 and @sgs2ofameer formated the data partition and got it fixed. But I'm reluctant to format. Did you guys format it as ext4 or f2fs? I noticed the stock miui 11 use f2fs + encryption on data partition, is it due to f2fs bugs?

@topjohnwu Below is a /cache/magisk.log. I could not find any problem in it, yet it reboots to recovery. How can I get more detailed information, like dmesg or init coredump?

--------- beginning of main
--------- beginning of system
09-24 00:59:28.114   606   606 I Magisk  : Magisk vce7cb1ee(20306) daemon started
09-24 00:59:28.114   606   606 I Magisk  : * Device API level: 29
09-24 00:59:28.125   606   607 D Magisk  : resetprop: getprop [ro.crypto.state]: [encrypted]
09-24 00:59:28.125   606   607 D Magisk  : resetprop: getprop [init.svc.vold]: [running]
09-24 00:59:28.135   606   607 I Magisk  : ** post-fs-data mode running
09-24 00:59:28.137   606   607 I Magisk  : * Initializing Magisk environment
09-24 00:59:28.157   606   607 I Magisk  : * Mounting mirrors
09-24 00:59:28.157   606   607 I Magisk  : mount: /sbin/.magisk/mirror/vendor <- /sbin/.magisk/block/vendor
09-24 00:59:28.157   606   607 I Magisk  : mount: /sbin/.magisk/mirror/data <- /sbin/.magisk/block/data
09-24 00:59:28.157   606   607 I Magisk  : link: /sbin/.magisk/mirror/system <- /sbin/.magisk/mirror/system_root/system
09-24 00:59:28.157   606   607 I Magisk  : link: /sbin/.magisk/mirror/product <- /sbin/.magisk/mirror/system/product
09-24 00:59:28.158   606   607 I Magisk  : * Setting up internal busybox
09-24 00:59:28.168   606   607 I Magisk  : * Running post-fs-data.d scripts
09-24 00:59:28.170   606   607 D Magisk  : magiskdb: query magiskhide=[1]
09-24 00:59:28.175   606   614 I Magisk  : * Starting MagiskHide
09-24 00:59:28.175   606   614 I Magisk  : hide_policy: Hiding sensitive props
09-24 00:59:28.175   606   614 D Magisk  : resetprop: getprop [ro.boot.verifiedbootstate]: [orange]
09-24 00:59:28.175   606   614 D Magisk  : resetprop: setprop [ro.boot.verifiedbootstate]: [green] by modifing prop data structure
09-24 00:59:28.175   606   614 D Magisk  : resetprop: getprop [ro.boot.flash.locked]: [0]
09-24 00:59:28.175   606   614 D Magisk  : resetprop: setprop [ro.boot.flash.locked]: [1] by modifing prop data structure
09-24 00:59:28.176   606   614 D Magisk  : resetprop: getprop [ro.debuggable]: [0]
09-24 00:59:28.176   606   614 D Magisk  : resetprop: getprop [ro.secure]: [1]
09-24 00:59:28.176   606   614 D Magisk  : resetprop: getprop [ro.build.type]: [user]
09-24 00:59:28.176   606   614 D Magisk  : resetprop: getprop [ro.build.tags]: [release-keys]
09-24 00:59:28.176   606   614 D Magisk  : hide_list: initialize
09-24 00:59:28.182   606   614 I Magisk  : hide_list init: [com.google.android.gms/com.google.android.gms.unstable]
09-24 00:59:28.184   606   614 I Magisk  : hide_list init: [org.microg.gms.droidguard/com.google.android.gms.unstable]
09-24 00:59:28.190   606   614 D Magisk  : proc_monitor: nothing to monitor, wait for signal
02-20 13:49:18.598   606   614 D Magisk  : proc_monitor: nothing to monitor, wait for signal
02-20 13:49:18.606   606   614 D Magisk  : proc_monitor: nothing to monitor, wait for signal
02-20 13:49:20.631   606  1132 I Magisk  : ** late_start service mode running
02-20 13:49:20.631   606  1132 I Magisk  : * Running service.d scripts

@ccaapton, it pretty clearly sounds like a different issue than this.

If you need any further help you should ask in the Magisk Discussion/Help thread on xda or start your own GitHub issue, but from your description it sounds like you might just have a rogue module or post-fs-data.d/service.d script. Make sure you're on the latest Canary, then try Magisk in Core Only/Safe Mode.

I just fixed my issue by copying the canary-manager apk file to /data/adb/magisk/magisk.apk . Turns out @androiddisk is right

According to the code below, the boot daemon will copy MANAGERAPK to /data/magisk.apk and install it, but if MANAGERAPK does not exist, the daemon will generate /data/magisk.apk out of the blue, but this file is much smaller than a real apk, thus may cause a big problem in the boot process.

if (access(MANAGERAPK, F_OK) == 0) {
        // Install Magisk Manager if exists
        rename(MANAGERAPK, "/data/magisk.apk");
        install_apk("/data/magisk.apk");
} else {
        // Check whether we have manager installed
        if (!check_manager()) {
                // Install stub
                exec_command_sync("/sbin/magiskinit", "-x", "manager", "/data/magisk.apk");
                install_apk("/data/magisk.apk");
        }
}

Again, that's a very different issue from the one we resolved above. Start a new issue with the information from your last 2 posts so that your issue can be properly looked into.

I can confirm @topjohnwu's suspicion that somehow the wrong init binary was being saved and linked to magiskpolicy, etc. on at least some 2-stage init (2SI) devices.

After booting my device I checked and /init is symlinked to /system/bin/init (which is likely the new normal), but then /sbin/.magisk/rootdir/init appears to be a copy of /system/bin/init (where it should probably be the ramdisk 1st stage init from /.backup/init), and /sbin/magiskinit appears to be a copy of the ramdisk 1st stage init. So no magiskinit anywhere! I'm surprised this isn't affecting more devices!

I added a post-fs-data.d script with the following and it got things working normally on my device until @topjohnwu can work out a proper fix; mileage may vary!

/data/adb/post-fs-data.d/magiskinitfix:

#!/system/bin/sh

cp -f /data/adb/magisk/magiskinit /sbin;

Would you be kind enough to explain how I do this and when in the process of installing magisk I do this to stop the recovery bootloop.

I just fixed my issue by copying the canary-manager apk file to /data/adb/magisk/magisk.apk . Turns out @androiddisk is right

According to the code below, the boot daemon will copy MANAGERAPK to /data/magisk.apk and install it, but if MANAGERAPK does not exist, the daemon will generate /data/magisk.apk out of the blue, but this file is much smaller than a real apk, thus may cause a big problem in the boot process.

if (access(MANAGERAPK, F_OK) == 0) {
        // Install Magisk Manager if exists
        rename(MANAGERAPK, "/data/magisk.apk");
        install_apk("/data/magisk.apk");
} else {
        // Check whether we have manager installed
        if (!check_manager()) {
                // Install stub
                exec_command_sync("/sbin/magiskinit", "-x", "manager", "/data/magisk.apk");
                install_apk("/data/magisk.apk");
        }
}

How do I see these file locations. Do you install magisk manager and then find those locations and move it? Sorry still learning

Would you be kind enough to explain how I do this and when in the process of installing magisk I do this to stop the recovery bootloop.

Just use the latest Canary. The bug described by this issue and my script has been resolved.

For any other problems people should start their own GitHub issue, since they're not the same.

Was this page helpful?
0 / 5 - 0 ratings