Introduction

Generic System Images (GSI) are a concept introduced by Google along with Project Treble, the project to decouple vendor-specific code with the Android framework. Thanks to this decoupling, it is now possible to replace only the frameworks part of the Android operating system, now located in the system partition, without (supposedly) touching any proprietary binaries from the vendor, usually located in the vendor partition. GSIs are exactly these system images built to be generic to vendor implementation, such that they should be able to boot on any Treble-compliant Android device (i.e. basically anything released after Android 9).

phhusson has been the center of community GSI development for a long time since GSIs first became a thing. Android being Android, there are still occasionally hacks and workarounds needed for GSIs to work properly on some devices, which are often only included in the downstream phh-GSI. There are also some features which are not supposed to work under GSIs anyway, such as VoLTE, the support of which was also first introduced by phhusson.

Since phhusson has not decided to upgrade his GSIs to Android 13 yet, I figured it is a good time to introduce my previously personal GSI builds. My AOSP GSI does not use phhusson's device tree, and is instead based on pure upstream AOSP GSI. My original intention (when doing this on Android 12) was to attempt to refactor phhusson's rw-system.sh into a more manageable form, but since I only own a very limited subset of devices, this has not yet been completed. However, now that Android 13 is out, my GSI does have some forward-ported patches and my own fixes that are not included in AOSP GSIs available upstream. As a result, I thought it might be a good idea to post these builds here, just in case they might be useful.

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

Mega shared folder: https://mega.nz/folder/vIhxjJTZ#SYcnLU2n_1yNzbhKzn9a5Q

Currently, all the images are Android 13.

All updates will be uploaded to the same shared folder.

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.

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.
    • 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
  • Simple Gallery
  • K-9 Mail
  • MuPDF
  • Aurora Store
  • Aurora Droid
  • 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 Atom L
  • Unihertz Jelly 2
  • Sony Xperia 5 II
  • Motorola G50

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.