This page contains links and documentation to PeterGSI, a Generic System Image (GSI) build that I use on all of my personal, unlockable Android devices. Although it is mainly intended for my personal use, I figured that it could be useful in general, and thus I decided to share my builds publicly.

The main difference between my build and TrebleDroid is that I have rewritten parts of the compatibility script (rw-system.sh) in cpp, and I decided not to include support for devices that require too many hacks, and those before "full Treble" (circa Android 9). This results in a simplified GSI device tree but a narrower range of hardware support. As it is mainly intended for my personal use, I find this to be a reasonable compromise. There is also no built-in support for VoLTE due to the amount of hacks needed, and the fact that I mainly use jmp.chat for phone calls along with a pure data plan. I have however included a fix for a long-running bug in AOSP that hinders the user experience of such VoIP services (see below). In addition, all of my builds are signed with my private key instead of AOSP test keys, and are -userdebug by default (with more security defaults like authenticated adb than -eng).

Warning

By flashing GSIs, you are taking the risk of customizing your device outside of what your warranty likely covers. Remember that there is NO GUARANTEE that any of the features will work on this GSI. Your device might not even be able to boot. I am NOT RESPONSIBLE for any potential damage that might result from YOU attempting to customize YOUR device.

Download

Shared folders:

Android 14: https://share.typeblog.net/share/rhUs8MOA

All updates will be uploaded to the same shared folder. You can expect semi-monthly updates corresponding to Google's security patch releases.

Source code: https://gitea.angry.im/PeterGSI

Source code for OpenEUICC is available at https://gitea.angry.im/PeterCxy/OpenEUICC, and the prebuilt dependencies to use in AOSP is located at https://gitea.angry.im/PeterCxy/android_prebuilts_openeuicc-deps.

Installation

First download and extract the .img file, and the rest is the same as any other GSI:

  • For devices with dynamic partitions:
    • Boot into recovery, select enter fastboot, and then fastboot flash system <insert_name_of_the_img_file>
    • If it fails with something along the lines of not enough space, try fastboot delete-logical-partition product, and/or fastboot delete-logical-partition system_ext.
  • For devices without dynamic partitions:
    • Boot into fastboot mode, and then fastboot flash system <insert_name_of_the_img_file>
  • You might need to do fastboot flash --disable-verity --disable-verification vbmeta vbmeta.img in order to disable dm-verity, otherwise your device might not be able to boot
    • vbmeta.img really can be anythiing at all. You can get one from your device's official images, or an open source ROM like LineageOS. It does not even have to be from your device whatsoever -- it just need to be any valid vbmeta.img.
    • Note that on some devices doing this step will break boot, but on others this step is required to boot. Try both ways and see which works.

After flashing, remember to wipe all data before rebooting.

Contact

Join us on Matrix at #peter-gsi:neo.angry.im

What Works

If your device is truly Treble-compliant (released after Android 9), then all features covered by CTS and VTS should work as expected. This includes booting (of course), audio, telephony, camera, WLAN, bluetooth, etc. However, some features are never expected to work on vanilla GSIs:

  • In-display fingerprint scanners (except for devices after Android 13 with standardized HALs, such as Pixels)
    • These require injections into the framework to make the icon appear and to use the correct color and brightness for scanning (in the case of optical ones).
    • Making these work will require a lot of conditional hacks on the framework side, and it is unlikely that I will add them in the near future.
  • VoLTE
    • System-side ims.apk and overlays are needed.
    • I have added the overlays required for IMS to work. However, there is not any signed ims.apk published by me yet, so without building the system image from source yourself, you will not be able to use them even if you acquired a supposedly working ims.apk for your chipset.
    • I am willing to start publishing signed ims.apk if someone can 1) make a working port; 2) test and confirm to me that they work.

Modifications

The following incomplete list of modifications on top of AOSP has been made:

  • Forward-port of the fix for in-call audio on older MTK devices
  • SEPolicy compatibility fixes for old devices, especially MTK ones
  • Bluetooth fixes for devices released before Android 13
    • A system-side generic bluetooth audio HAL, sysbta, has been included for generic bluetooth audio support.
    • This should work better than previous solutions from GSIs, but hardware offloading is likely unavailable even if turned on.
  • Launcher3 UI / UX fixes and inclusion of ThemePicker (thanks to ProtonAOSP)
  • Fix for calling account selection automatically resetting when a third-party calling app is in use, such as jmp.chat
  • microG signature spoofing support

The full list of patches can be viewed here.

Preinstalled Apps

Peter's AOSP GSI strives to be as much FOSS as possible. A set of FOSS apps are included by default:

  • microG Services Core
  • Firefox (Fennec F-Droid)
  • Bromite
  • Fossify Gallery
  • K-9 Mail
  • MuPDF
  • Aurora Store
  • Neo Store
  • Etar

In addition, the following FOSS apps made by me are included because they have to be system apps:

  • OpenEUICC
    • A generic eSIM manager application for FOSS ROMs. It supports downloading new eSIM profiles via QR codes or SM-DP+ addresses, switching between profiles, and, of course, profile deletion.

Tips and Tricks

  • On Qualcomm devices, if your device audio does not work as expected, try the following:
    • Run adb shell, and input the command su (to gain temporary root via adb)
    • Run setprop persist.sys.gsi.alternate_audio_policy true
    • Reboot
    • This instructs the GSI to use /vendor/etc/audio/audio_policy_configuration.xml instead of /vendor/etc/audio_policy_configuration.xml, which is needed on some Qualcomm devices (but breaks on others)
  • To test Qualcomm IMS, set persist.sys.phh.ims.caf to true. To test MTK IMS, set persist.sys.phh.ims.mtk to true. These are the same as in phh GSI's overlays.

Tested Devices

I regularly use the following devices:

  • Unihertz Jelly Star
  • Unihertz / 8849 Tank Mini
  • Unihertz Luna
  • Fairphone FP4
  • Google Pixel 7 Pro

This GSI will most likely work on these devices (except features that are never expected to work, of course).

FAQs

  • Q: Does it work on my device?
  • A: Maybe, or maybe not. But if your device is released after Android 11, then it is more likely to at least boot than not. Keep in mid that THERE IS NO GUARANTEE.

  • Q: It does not boot on my device X.

  • A: Unfortunate, but in this case there is not a lot I could do to help. If you have access to console-ramoops, you can try to extract that after a failed boot and send that to me. Otherwise, if I do not own the device myself, it would be extremely hard to debug. In addition, I have never intended to support devices released before Android 9 (i.e. vndklite), or any device that is not currently supported by the latest Treble standards (N + 3, i.e. if a device is released on Android N, then the last officially supported version would be N + 3). They may or may not work, but there is no guarantee.

  • Q: Will you fix bug X on my device Y?

  • A: Maybe, or maybe not. If you can fix it yourself, however, you are always welcome to make a contribution by contacting me via the Matrix group.