topjohnwu / Magisk

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

Executing magiskinit causes fatal crash on some devices #2133

Closed sgs2ofameer closed 4 years ago

sgs2ofameer commented 4 years ago

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??

androiddisk commented 4 years ago

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

androiddisk commented 4 years ago

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

sgs2ofameer commented 4 years ago

can you please write it in English?

androiddisk commented 4 years ago

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

androidacy-user commented 4 years ago

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

mandfx commented 4 years ago

Xiaomi 8 executes the command and causes the system to crash

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

topjohnwu commented 4 years ago

@androiddisk are you using custom ROM or official ROM?

androiddisk commented 4 years ago

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

official ROM

androiddisk commented 4 years ago

@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 commented 4 years ago

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

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

androiddisk commented 4 years ago

不知道你的系统来自哪里,这是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

androiddisk commented 4 years ago

不知道你的系统来自哪里,这是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的了解

androiddisk commented 4 years ago

不知道你的系统来自哪里,这是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开发人员么?

topjohnwu commented 4 years ago

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

topjohnwu commented 4 years ago

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

androiddisk commented 4 years ago

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

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

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

androiddisk commented 4 years ago

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

topjohnwu commented 4 years ago

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

topjohnwu commented 4 years ago

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

androiddisk commented 4 years ago

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

topjohnwu commented 4 years ago

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

androiddisk commented 4 years ago

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

抱歉 晚点才能上传上来

androiddisk commented 4 years ago

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

magiskinit.ZIP

sgs2ofameer commented 4 years ago

@topjohnwu did you solve this issue? thanks in advance

Vanman989 commented 4 years ago

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

sgs2ofameer commented 4 years ago

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

Vanman989 commented 4 years ago

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

sgs2ofameer commented 4 years ago

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?

Vanman989 commented 4 years ago

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

topjohnwu commented 4 years ago

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

Vanman989 commented 4 years ago

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 :)

androiddisk commented 4 years ago

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

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

Vanman989 commented 4 years ago

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?

androiddisk commented 4 years ago

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

androiddisk commented 4 years ago

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

androiddisk commented 4 years ago

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

Vanman989 commented 4 years ago

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)

androiddisk commented 4 years ago

/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

Vanman989 commented 4 years ago

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

androiddisk commented 4 years ago

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

thank you

androiddisk commented 4 years ago

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

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

Vanman989 commented 4 years ago

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 :)

sgs2ofameer commented 4 years ago

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?

Vanman989 commented 4 years ago

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.

sgs2ofameer commented 4 years ago

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 🙂

Vanman989 commented 4 years ago

@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 commented 4 years ago

@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 commented 4 years ago

@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 :(

Vanman989 commented 4 years ago

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.

sgs2ofameer commented 4 years ago

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