How To Guide [GSI][PHH] Guide & Support [Mojito][Sunny]

Do you believe GSIs overcome custom ROMs in future ?

  • Meh. Both suck. Android devices are increasingly turning restrictive every year.

    Votes: 19 31.7%
  • I don't think so. They'll never overcome custom ROMs.

    Votes: 12 20.0%
  • I have fair skepticism on it. Both will have balanced usershare.

    Votes: 27 45.0%
  • Absolutely. Device tree maintenance is outdated already.

    Votes: 12 20.0%

  • Total voters
    60
Search This thread

ChristianWS

Senior Member
Sep 6, 2016
120
19
Moto G
Redmi Note 10
Well didn't really work as well as I wanted, did it?

I rather not go with CrDroid.

Can I just use TWRP to flash BgS on top of my system? I just need to disable the MicroG Module before, right?

Do I need to reflash Magisk and Kernel?
 

MPK99

Senior Member
Can I just use TWRP to flash BgS on top of my system?
Neither TWRP, nor OrangeFox have ability to flash logical partitions bydefault. It's not possible on dynamic partition table. As of now, you have to do it on fastbootd.
Maybe in future we might get updates from twrp/ofox to manage logical partitions.
Do I need to reflash Magisk and Kernel? I just need to disable the MicroG Module before, right?
Magisk would be enough. No need to disable any module.
 

ChristianWS

Senior Member
Sep 6, 2016
120
19
Moto G
Redmi Note 10
Argh, fine.

I just need to fastboot and flash the LineageOS bgS on top of my bvS, right? I don't need to do anything after that? I don't need to add the overlay again, or to wipe data, or do anything else besides fastboot flash?
 

MPK99

Senior Member
I just need to fastboot and flash the LineageOS bgS on top of my bvS, right?
Read OP prerequisites section again. I mentioned that vanilla to gapps migration (or vice versa) is not dirty flashable. Only one to one is.
If you wanna move to gapps variant from vanilla, you gotta wipe data & start fresh.
I don't need to add the overlay again
Overlay is inside /system/product/overlay. So basically a re-flash will remove it so you gotta do it again.
From newer october build, overlay will be pre-included, since merge happened in september (& you're running sept build).
 

ChristianWS

Senior Member
Sep 6, 2016
120
19
Moto G
Redmi Note 10
Inside phh settings > Misc section, execute "Securize system". Then re-flash magisk from recovery.
This is the reason many GSI builders avoid shipping "su" (a.k.a bvS/bgS) & just build N variants (bvN/bgN). Because it causes overlap with Magisk, since both ship same root binaries. I donno why Andy still builds su variant. He doesn't even include non-su along with it...¯\_(ツ)_/¯
I did that (after redoing everything from the beginning to flash BgS), after clicking "Securize" I re-flashed magisk from TWRP but now Magisk doesn't work, it doesn't think it is installed, I have no option inside Magisk
 

MPK99

Senior Member
I did that (after redoing everything from the beginning to flash BgS), after clicking "Securize" I re-flashed magisk from TWRP but now Magisk doesn't work, it doesn't think it is installed, I have no option inside Magisk
Try flashing magisk again, since su might got nuked after reboot.
You can check out /system/bin/phh-securize.sh script what securize doing behind.
 

MPK99

Senior Member
I have flashed Magisk again, and it doesn't work
As per securize script...
Code:
rm $SYSTEM/xbin/su
rm $SYSTEM/bin/phh-su
rm $SYSTEM/etc/init/su.rc
rm -Rf $SYSTEM/{app,priv-app}/me.phh.superuser/
rm -Rf /data/su || true
mkdir /metadata/phh
touch /metadata/phh/secure
is the main stuff to be removed. You can manually remove them, re-flash stock boot & twrp + magisk again. Should work.

Unfortunately, Andy is the only one who ships prerooted lineage gsi ¯\_(ツ)_/¯
Strangely, he quoted to keep both & ignore Abnormal state warning though.
 
Last edited:

Samir2298

Senior Member
Apr 3, 2015
269
27

Attachments

  • Screenshot_20221002-134224_1.png
    Screenshot_20221002-134224_1.png
    1.3 MB · Views: 13

Samir2298

Senior Member
Apr 3, 2015
269
27
My bad, had to extract file.

Also on an unrelated note, I have noticed note 10 has low sensitivity on borders/edges, in other words extreme left and right. Which is annoying when you're playing a game and the buttons are near border(for example in Minecraft) and you have to touch with extra force. Do you know of any way to increase it?
 

Samir2298

Senior Member
Apr 3, 2015
269
27
I provided apk btw, not zip

That's funny. Touch sensitivity is always monotonous, there's no such thing as custom pressure. I think it's your display that's messed up. Was that same across roms too?
No, it's not my display coz on MIUI there was this option in game mode(see attached ss), setting it to "None" would fix issue as I described in MC.

I believe by default Xiaomi has it decreased for whatever reasons, and it can be altered through software.
 

Attachments

  • MIUI-Game-Turbo-2.0-FoneArena-Overview-09-1024x473.jpg
    MIUI-Game-Turbo-2.0-FoneArena-Overview-09-1024x473.jpg
    35.1 KB · Views: 8

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Andy warned about the QPR2 changes and how he needed more time to update his LineageOS GSI. Might take a while until GSI ROMs stabilizes
  • 15

    Why should I use a GSI ? Mojito already have custom ROMs ¯\_(ツ)_/¯

    Yes. But this thread exists due to the following reasons:
    • You don't wanna fear about devs stop shipping updates.​
    • You don't wanna re-flash your custom recovery / kernel after each update.​
    • Unlike some ROMs, no clean flashes necessary after you update.​
    • You don't wanna be a flashoholic / beta tester of a ROM maintainer.​
    • GSIs are like Linux Distros. Flexible, hasslefree & minimal.​
    • All GSIs support signature spoofing out of the box.​
    Differences between GSIs & ROMs:
    • ROM updates modify all the partitions (boot, recovery, kernel, system, vendor, etc). A GSI update is just a system partition that updates "only" the system, that runs upon stock firmware.​
    • You can't flash gapps on vanilla GSIs, as you do on vanilla ROMs. You must use bgS/bgN GSI variants.​
    • For now, GSIs have to be installed via fastbootd, as recoveries still yet to support logical partitions. So you need computer available when you update or change them.​
    AOSP GSI project is being alive for almost many years now. I've been daily driving his project on this device since I made the overlay. Everyone claim GSIs are buggy & not daily drivable, which is a complete false claim. There are no compromises with GSIs when compared to ROMs.

    PREREQUISITES

    Recommended GSIs :

    INSTALLATION​

    NOTE: I'm assuming you've already unlocked bootloader, backed up your data & know all the technical consequences of flashing & modding.
    • Download / extract all prerequisites in one place.​
    • From stock firmware, edit flash_all_except_data_storage.bat/sh & modify last line to fastboot reboot fastboot
    • Enter fastboot mode {vol_down+power}, connect to PC & flash firmware using above edited script. When device enters fastbootd, from terminal/cmd execute :​
    • fastboot erase userdata
    • fastboot flash vbmeta vbmeta.img
    • fastboot flash system <gsi-file.img> (ignore INVALID SPARSE warning)​
    • fastboot reboot & make sure your GSI boots up. Power off & return to fastboot again.​
    • fastboot boot <twrp-file.img>, head to Advanced & run flash current TWRP to make recovery persistent across reboots.​

    UPDATE / DIRTY FLASH HOW ?​

    • fastboot reboot fastboot
    • fastboot flash system <new-gsi.img> & reboot twice
    All phh based GSIs are dirty flashable (unless you switch between vanilla & gapps).

    POST CONFIGURATION​

    • Enable the following Settings > Phh Treble Settings:
    • Misc features / Disable audio effects
    • IMS features / Install IMS Apk for Qualcomm vendor from notification panel.​

    MAGISK NOT WORKING ?​

    In this case, the GSI you selected isn't securized (comes with su bydefault). Through TWRP, do
    • mount -o rw /dev/block/mapper/system_a /system_root from terminal
    • Code:
      rm /system_root/system/xbin/su
      rm /system_root/system/bin/phh-su
      rm /system_root/system/etc/init/su.rc
    • Or instead, you can use recovery's file manager to delete the above files. Then reboot.

    EXTRAS​

    My Recommendations for great experience:
    • SPKM to set GPU > GPU Governor > Performance (fixes UI lags)​
    • Lineage Dialer for built-in call recording (push into /product/priv-app/Dialer/Dialer.apk).​
    • ANXCam for MIUI camera's post processing.​
    • GCam for google camera's post processing.​
    • Aurora Store / Droid for microg users.​
    • Migrate to backup / restore user apps & data, incase you lose your setup.​
    Thanks for reading all the way through here.
    4
    UPDATE: Overlay has been merged. No need of manual overlay injection for the upcoming phh based A13 GSIs.
    3
    Here's the report for the current GSI development state. This is to keep this thread alive.
    • Phhusson now moved from his personal builds to CI/CD builds (testing, automated) which is now called TrebleDroid (AOSP-TD).
    • But he still hasn't decided to ship secure builds yet (which help pass CTS & magisk compatibility)
    • Lot of AOSP-TD based builds have been released by many developers/builders, which some also happened to have secure builds. Links are in the OP.
    • A13 forks are still in development stage. So you might experience couple of bugs here & there.
    • As of now, the last stable A12 builds held to November sec patch. Beware if you still on Nov patch, since it has a serious security vulnerability (CVE-2022-20465) that allows anyone to unlock your encrypted device through sim PUK reset, which has been patched on December sec patch.
    • Andy's maintaining his own phh treble patchset builds which he calls LineageOS Light. It might or might not be dirty flashable over other TD based builds.
    • The current overlay state is the same as of last year. If anyone have any requests regarding overlay modification, plz do.
    If you have any doubts & issues, discussion is always open. This isn't my personal device anyways, so I'm free to experiment anything on it. Currently it's running phh's android_13.0.0_r14 ci-20221219 (system-td-arm64-ab-vndklite-vanilla), securized, magisk rooted, microg moduled & passing safety net via kdrag0n fix & redfin props.

    MERRY JINGLE CHRISTMAS 🎅🎄

    3
    it is okay for us to give review about the GSI that we have been tested ? or better on the other thread ? asking for an opinion here 😅
    I don't really care. Discuss anything mate. This thread is all about gsi support for community.
    The more you guys talk, the more better.
    (just dont private msg. I want all discussions to be public✌️)
    3
    Followed exactly as in OP.

    I did remove some apps tho from product app/priavpp and system app/privapp, so maybe that caused an issue? Is there anything related to fingerprint in those folders?
    If you want to gain more space (≈ 200mb) in system you can delete 2 folders safely without problems :
    /system/system_ext/apex/com.android.vndk.v28/
    and
    /system/system_ext/apex/com.android.vndk.v29/
    Already did it in DSSI builds without issues.