[Treble-Enabled Device Development A/AB ROMS] pvdeejay:
Hello,

I think you may remember me from earlier discussions.

I am still looking for a way to either temporarily or permanently disable root.

I'm thinking in the PHH settings there is a securize app. On my Android 10 install this is not working as the system partition is mounted read only.

However in Android 11 all devices have their system partition mounted read-only so I guess securize me is rewritten to be compatible with android 11 super partition.

Additionally in the v301 changelog, @phhusson is saying

How do I add magisk into this?

I assumed magisk is not compatible with treble roms and I should use something else e.g. securize.

Is it likelly I'll be able to use securize on my Xiaomi Redmi 9 galahad with super partition and Android 10 vendor?

Edit: Update to V302 went fine.

Once updated I have fired adb on my PC, used su to get a root shell, then ran

/system/bin/phh-securize.sh

It wrote a few warnings along the lines thaat access denied and similar.

But at the end it printed partition remounted, reboot for settings to take effect.

I have typed reboot in the root adb shell, device rebooted and it's now only booting to the stock recovery.

I can enter the fastboot mode however reflashing did not help and device is still looping on boot.

I'm going to wipe data to see if I can make it work from the begining.

Luckily I've made backup of all my apps with data and my files are backed too.

I'd appreciate all the hints you can give to me.

Edit2:

Wiped data and device is working with root enabled again.

I've found out adb backup and restore is useless so I've lost some of my data. It's nice that I'm learning new stuff all the time.

Edit3:

Flashed latest Xiaomi firmware for my device using fastboot so I have boot image to patch, flashed back V302 system image, installed magisk app from the canary channel and used it to patch the boot image. Flashed that patched boot image through fastboot but magisk app is telling me that it has detected unsupported magisk version and it only supports magisk 20.4 and upwards.

The device is not boot looping it's just that magisk is non functional and I still have root through built-in phh su.

Here is something that might be relevant but it looks as if this is perhaps a work in progress and there may not be a solution to what I'm trying to do...

Get Magisk Working on Android 11-based GSI's - Magisk

Edit4:

Trying to mount V302 image on linux and apply what phh-securize.sh does manually in order to be able to get magisk to work.

However I have noticed FCM push notifications aren't working for me with latest MicroG so I need to look into that too.

Edit5:

FCM is working great after the device reboot.

I can unsparsify, enlarge, unshare the blocks, mount the system image, apply phh-securize.sh tweaks manually, set selinux contexts for the new files using setfattr, shrink the partition. But I don't know how to enable shared_blocks feature on the raw ext4 image and / or use e2fsdroid to pack it into sparse file. Perhaps I should learn how to build GSI my-self or wait for the rootless variant as requested here https://github.com/phhusson/treble_experimentations/issues/1667

Or would you be so kind to try creating such an image?

I spent the whole day learning about all this and I still can't make it.

Greetings

Peter