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 32.2%
  • I don't think so. They'll never overcome custom ROMs.

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

    Votes: 26 44.1%
  • Absolutely. Device tree maintenance is outdated already.

    Votes: 12 20.3%

  • Total voters
    59
Search This thread

MPK99

Senior Member
409 in this ROM is uncomfortably small
Yes. It IS small. Because of it being a 6.4" screen with 1080p resolution.
....I really shouldn't have messed up with DPI
You actually shouldn't (Although it's a GSI so it didn't know the device dpi, so you gotta set it manually).
Just set the default native dpi of your display (409) & instead lowering it, try to increase font size. That's the best experience to get the plenty of workspace with ample font size to read to.
Same goes to computers. Instead of messing with resolution & dpi, it's better to increase icons & font sizes.
It's funny that when you have 409dpi, the 40dp status bar that I had actually looks better, infact more smaller than the punch hole calculations you did.
 
Last edited:

ChristianWS

Senior Member
Sep 6, 2016
120
18
Moto G
Redmi Note 10
Yes. It IS small. Because of it being a 6.4" screen with 1080p resolution.

You actually shouldn't (Although it's a GSI so it didn't know the device dpi, so you gotta set it manually).
Just set the default native dpi of your display (409) & instead lowering it, try to increase font size. That's the best experience to get the plenty of workspace with ample font size to read to.
Same goes to computers. Instead of messing with resolution & dpi, it's better to increase icons & font sizes.
It's funny that when you have 409dpi, the 40dp status bar that I had actually looks better, infact more smaller than the punch hole calculations you did.
I did some testings, here the results:

409dpi:
Screenshot_20221017-133420_Firefox.png


409dpi with increased font:
Screenshot_20221017-133625_Firefox.png

390dpi no font change:
Screenshot_20221017-134242_Firefox.png



Regardless, you might want to add a warning on the OP about checking the DPI on the developer settings
 
  • Like
Reactions: MPK99

alpitu21

Member
Jun 13, 2019
46
0
What is the difference between a GSI and any other custom rom? Let's say, for example, pixel experience.
 

alpitu21

Member
Jun 13, 2019
46
0
Hello! when i try this, it fails writing vbmenta (FAILED (remote: No such file or directory) and also how do i flash system with gsi.img? the gsi is filename .xz? I tried flashing fastboot flash system gsi.xz but i get errors with write_sparse_skip_chunk and when it writes system it fails (no such fileor directory)
 

Attachments

  • Screenshot 2022-10-26 105156.png
    Screenshot 2022-10-26 105156.png
    46.5 KB · Views: 21

MPK99

Senior Member
Hey, can anyone verify if charging the phone while it is turned off works as normal?

I'm using Andy's LineageOS, and it just keeps stuck in the MI logo forever.
I think it's the issue with all GSIs, since they're generic. Try holding power / force reboot after you connect it. Or atleast charge for a minute, then force reboot after disconnect. Should reboot with atleast 1% charge left.

@alpitu21 I think you should stick to ROMs for a while. Understanding GSIs is a little bit clunky & different.
 

ChristianWS

Senior Member
Sep 6, 2016
120
18
Moto G
Redmi Note 10
I think it's the issue with all GSIs, since they're generic. Try holding power / force reboot after you connect it. Or atleast charge for a minute, then force reboot after disconnect. Should reboot with atleast 1% charge left.
Yeah, I know how to mitigate it, but I was hoping this was an issue with Andy's LOS, meaning it could be fixed rather than just dealt with. Specially considering this is an OLED device and boot happens with maximum brightness, so it has a non negligible chance of burn-in

I made Tasker reboot the phone if it receives the command to shutdown while charging, as a way to prevent it getting stuck in that screen. Still, I'd rather have a proper solution.
 

AlsoKouki

Member
Aug 1, 2022
22
1

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

Yes. But this thread exists due to the following reasons:
  • You have issues daily driving custom roms​
  • You don't wanna re-flash your custom recovery & kernel after each update​
  • You don't wanna fear about devs dropping support & stop giving monthly OTA updates​
  • You don't want to depend on / trust buildbot roms lurking on xda & telegram​
  • All GSIs support signature spoofing out of the box​
AOSP GSI project is being alive for almost many years now. And it'll still continue it's regular updates for AOSP's existence & entirety. I've been daily driving his project on this device for almost an year. Everyone claim GSIs are buggy & not daily drivable, which is a complete false claim.

It's a one time procedure since you'll be greeted with monthly OTA updates (thanks to phhusson).

PREREQUISITES

Recommended variants :
system-squeak-arm64-ab-vndklite-gapps-secure.img.xz for google play services
system-squeak-arm64-ab-vndklite-vanilla-secure.img.xz for vanilla/microg
For b*S, you have to run securize from phh settings, to remove magisk conflicts.

Some recommended GSIs :
All phh based GSIs are dirty flashable (on top of each other, without wipe), unless you try switching from vanilla to gapps or viceversa.

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 (make sure there are no spaces in folder names). 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.​
  • Flash Magisk (for safetynet fixes) and NetErnels / WCSF-PLC (for performance), either by twrp (copying them into an SD card), or through TWRP > Advanced > adb sideload <zip-file>.
BUG_1: Don't touch the screen while booting, else it'll make the display unresponsive, leading you to force reboot. A minor bug, but can be ignored.
BUG_2: Don't set up password on startup wizard. Instead, set it up later & then disable Android Setup app if it exists. Else it'll crash fingerprint settings.

POST CONFIGURATION​

  • Setup Magisk from app-drawer. Follow in-app prompts & reboots.​
  • From magisk settings, hide the Magisk app, enable Zygisk & Enforce Denylist.​
  • Use SafetyNet Fix magisk module to pass CTS. Still won't pass? Try Redfin Props or any other Pixel-Props that ensures fingerprinting.​
  • microG module if you chose vanilla variant (Safety net works. Most of the banking apps work except gpay).​
  • Enable the following Settings > Phh Treble Settings:
  • Qualcomm features / Use alternate audio policy.​
  • Misc features / Disable audio effects & Force-disable A2DP offload.​
  • IMS features / Request IMS network & Force the presense of 4G calling. Also Install IMS Apk for Qualcomm vendor from notification panel.​
NOTE: Reflash kernels only through your custom recovery. Updating through apps like FKM or SPKM is not suggested.

OVERLAY​

Skip this step for GSIs that've been updated after sept 18, since overlay's already been merged. Do this only if you have the following issues :
  • Brightness stack​
  • Missing battery usage stats​
  • Missing night light toggle​
  • Ambient light & doze​
Extract this overlay into /product/overlay/treble-overlay-xiaomi-redminote10.apk with permissions 644/rw-r-r through any root explorer.
NOTE: If there's no space available issue, remove these two folders /system_ext/apex/com.android.vndk.{v28/v29}, reboot & try again.

EXTRAS​

My Recommendations for great experience:
  • Lawnchair / Quickswitch for launcher customization with gesture navigation support.​
  • Lineage Dialer for built-in call recording (push into /product/priv-app/Dialer/Dialer.apk).​
  • ANXCam for stock MIUI camera's post processing.​
  • CameraGo for google camera's post processing with built-in translation support.​
  • KProfiles (NetErnels only) to improve performance ( Settings > Battery > KProfiles > Performance )​
  • Aurora Store / Droid for microg users.​
  • Bromite (arm64_SystemWebView.apk) for uptodate android webview (Developer options / Webview Implementation).​
  • Migrate to backup & restore user apps & data, incase you lose your setup.​
Thanks for reading all the way through here. Here's my usage stats on 20% brightness.
is it possible for mojito to flash gsi through custom recovery like twrp soon?
 

bobtear1

Member
Dec 3, 2021
27
3
should i be concerned if the script for flashing stock rom force closes right after it says "writing cust completed"?

i checked the script and it should do a few more things before booting to fastbootd. i tried running the script twice but both times it would close right after flashing cust (whatever that is)

so what i did was run the few remaining command manually before booting to fastbootd and flashing the gsi. ive been using it for a day and the only bug i found was that i couldnt get my phone to output audio to my bluetooth earphones, even though its connected and detects its an earphone, although i think thats just because it was the initial build for the gsi. there are also ui lags but idk if the issue was the unsuccessful (?) flashing of stock rom or an issue with the gsi

GSI: LineageOS 20 TD-Based file: lineage-20.0-20221111-UNOFFICIAL-arm64_bgN-vndklite-secure.img.xz
Kernel: WCSF-PLC


edit: going forward if i need to update my gsi, do i flash from twrp's fastbootd? and what about updatijng the stock rom files? is flashing updated firmware enough?
 

MPK99

Senior Member
should i be concerned if the script for flashing stock rom force closes right after it says "writing cust completed"?
You should reflash everything from scratch if a previous trial is interrupted (without messing the existing fastboot session)
the only bug i found was that i couldnt get my phone to output audio to my bluetooth earphones, even though its connected and detects its an earphone
follow post configuration in OP to fix bluetooth issue. Should be "force disable a2dp offload" (reboot required).

Use any kernel manager (spkm from "extras"). Under GPU section, change GPU governor to "performance mode". Set "apply to boot" if everything feels smooth.
edit: going forward if i need to update my gsi, do i flash from twrp's fastbootd?
Yep. Special case, data wipe for A12->A13 migration, or else no need.
 

bobtear1

Member
Dec 3, 2021
27
3
You should reflash everything from scratch if a previous trial is interrupted (without messing the existing fastboot session)
Do i have to wipe userdata too or can I just reflash stock and then gsi with magisk etc and boot no problem?
follow post configuration in OP to fix bluetooth issue. Should be "force disable a2dp offload" (reboot required).
I did all post configurations before using it, still broken. its not actually bluetooth connectivity thats broken but its audio output transfer, or whatever its called. ill have to try with my wired earphones tho if its only for TWS
Use any kernel manager (spkm from "extras"). Under GPU section, change GPU governor to "performance mode". Set "apply to boot" if everything feels smooth.
ill try this tomorrow and let u know how it goes
Yep. Special case, data wipe for A12->A13 migration, or else no need.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 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.