TrebleDroid / treble_experimentations

Scripts to automatically build/CI/Release TrebleDroid GSI
Other
212 stars 27 forks source link

Magisk does not work #44

Open suiminn opened 1 year ago

suiminn commented 1 year ago

Describe the bug

Magisk does not work (works with StockROM and other GSIs)

To Reproduce

1. Flash Magisk 26.1 patched boot.img 2. Flash system-td-arm64-ab-vanilla.img 3. adb install Magisk-v26.1.apk 4. See error ### Expected behavior Working Magisk ### Photos ![Screenshot_20230608-225401](https://github.com/TrebleDroid/treble_experimentations/assets/111758374/53d45e4e-36ea-489e-ac08-9d04c73a8a32) ### Smartphone (please complete the following information): - Device: Legion Y700 - Build Flavor: system-td-arm64-ab-vanilla.img.xz - Version 20230614 ### Additional context
suiminn commented 1 year ago

magisk_log_2023-06-28T02.33.45[1].log

kenOfYugen commented 1 year ago

From the logs:

---Magisk Logs---
17 me.phh.superuser cm-su subind suinit (-1)

Probably this happens because of built-in SU topjohnwu/Magisk/issues/6404

However, the securize script to remove the built-in SU does not work #26.

@sui827 have you tried to remove SU manually?

suiminn commented 1 year ago

I tried the following two methods to manually remove it, but Magisk remained unavailable

  1. https://github.com/phhusson/treble_experimentations/issues/906#issuecomment-553775422

  2. "Phh Treble Settings" -> "Misc features" -> "Securize"

goblin535353 commented 1 year ago

I have the same problem. I cannot install Magisk on this rom.

DeadPool-4422 commented 1 year ago

I too am facing the same issue

Device : A7 2018 codename : a7y18lte Kernel : Stock

kenOfYugen commented 1 year ago

I tried the following two methods to manually remove it, but Magisk remained unavailable

1. [root remove phhusson/treble_experimentations#906 (comment)](https://github.com/phhusson/treble_experimentations/issues/906#issuecomment-553775422)

2. "Phh Treble Settings" -> "Misc features" -> "Securize"

Yeah 2. also executes the phh-securize.sh srcript mentioned in 1. Since I am also affected by this, I will try to understand why the script does no longer work and hopefully fix it, unless someone else fixes it first.

601t commented 1 year ago

You can try sas-creator. In environments without simg2img, you can also try AndyCGYan's.

hk87928629 commented 1 year ago

Install superuser app from f-droid (direct link)

ddeevvaa commented 1 year ago

good thread

goblin535353 commented 1 year ago

Install superuser app from f-droid (direct link)

will magisk work afterwards? Wont it overlap together?

oddsito commented 1 year ago

@goblin535353 did you make it work? Anyone knows of an effective and easy way to debloat phone without De-bloater app for example? for those who cant install magisk? Besides that. Great Rom, Very very fluid and fast, we're grateful.

goblin535353 commented 1 year ago

@goblin535353 did you make it work? Anyone knows of an effective and easy way to debloat phone without De-bloater app for example? for those who cant install magisk? Besides that. Great Rom, Very very fluid and fast, we're grateful.

no

kenOfYugen commented 1 year ago

You can try sas-creator. In environments without simg2img, you can also try AndyCGYan's.

I can confirm that AndyCGYan sas-creator worked perfectly and Magisk installed fine

AnonVendetta commented 11 months ago

As others have said, it's due to the built in root. If you have twrp, mount the system/system_root partition as RW (must be using vndklite img), then delete the following files: /system/xbin/su /system/etc/init/su.rc /system/bin/phh-su

In twrp the path to these files may be be prepended with /system_root/system/, so be aware of this detail.

Or you can install the Phh Superuser app from F-Droid, then use a root file manager to delete or rename these files. After this, Magisk should hopefully work.

However, in my personal experience, securize still won't work even after magisk is functional. Magisk mounts into /system/bin/ where its' root files would normally live, this seems to block the securize script from properly executing.

To address this, create an sbin directory in the root filesystem (the path from booted Android should be /sbin). Chmod its' permissions to 0755. Then edit init.environ.rc (also located in the root of the filesystem) and add sbin to the path. The text line should look something like: export PATH /sbin

Then reboot, Magisk will move itself into sbin. After that, you should be able to securize properly.

To verify that it worked, a simple test is typing this into a terminal app:

getprop ro.build.fingerprint

It should return the build fingerprint of the underlying stock firmware you have installed, instead of the test/debug fingerprint the gsi otherwise uses.

SuperPou1 commented 3 months ago

i have the same issue, however i can't get the vndklite image to boot on my galaxy A51, it's just bootlooping. only the non-vndklite image works for me.