• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[How-To] GSI Definitive Guide (ROM+GApps+Bluetooth+GCam+90HZ+V4A)

Search This thread

EdgardoSchiffer

Senior Member
Oct 15, 2013
121
122
OnePlus 9
Hello everybody:

GSI ROMS finally have Fingerprint on display (fod) support, so I decided to try it today.
It was quite difficult to make everything work, since there are a lot of guides in X2 Pro forum and XDA, so I decided to create this thread to make things easier to other users that want to use GSI ROMS.
My device is a Realme X2 Pro Chinese, but this should work on any X2 Pro.

The guides I used as references are these ones:
https://forum.xda-developers.com/realme-x2-pro/how-to/how-to-flash-aosp-android-10-gsi-realme-t4036825
https://forum.xda-developers.com/realme-x2-pro/how-to/how-to-flash-havoc-evolution-gsi-t4040607
https://forum.xda-developers.com/realme-x2-pro/how-to/how-to-flash-aosp-android-10-gsi-realme-t4036825
https://forum.xda-developers.com/project-treble/trebleenabled-device-discussion/guide-fix-bluetooth-audio-a2dp-aptx-gsi-t3950938
And probably other ones I found at internet that I can't remember at this point :confused:

1. Pre-requisites
- Unlocked bootloader
- TWRP Installed (I use Orange Fox)
- Color OS Firmware A08+ or A13+ (chinese)
Don't do it being on Realme UI, there are some features that won't work with the new firmware/vendor, FP included (Ironically, bluetooth gets fixed).
- Any software that can uncompress .xz files (most of GSI comes in this format)

2. Choosing your ROM
The first step is to find any rom that you like, it must has these features:
- It has to be based on phh's AOSP v214 or newer.
- It must be A/B ARM64.

You can look for one here:
https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-%28GSI%29-list
Screenshot_6.png


I would suggest to pick phh's AOSP ROM or LOSQ Project which is really close to phh's source.
https://github.com/phhusson/treble_experimentations/releases
https://github.com/eremitein/treble-patches/wiki/LOSQ-Project

Bugs as of March 03, 2020
At this time, every phh's based rom has the following bugs:
- In-call bluetooth
- Bluetooth media playback (can be solved)
- Auto brightness
- Securize (I tried to use it but never done anything)

And there may be more bugs included on the rom you're using (lineage, havoc, evo, losq, posp, etc)

3. GApps (Optional)
Note: many roms has 2 variants, one with GApps included and one vanilla, depending on the one you choose, you'll have to do this step.

If you need Google Services and the ROM you downloaded does not include them, you need to pick a Gapps package.
Personally, I like BitGapps, but you can choose any you like as long as they are made for ARM64 Android 10.

BitGApps
FlameGApps
OpenGApps

4. Bluetooth fix
Before flashing the ROM, you have to delete the file BluetoothResCommon.apk from your vendor. You may want make a copy of it.
For this, you can do this action in the following ways:
- using a file explorer
Search in the root (/) the path /vendor/overlay
Search the file BluetoothResCommon.apk
Make a backup of the file
Delete the file

- adb and root
Connect your phone to your PC and run these commands from terminal or cmd:
adb pull /vendor/overlay/BluetoothResCommon.apk
adb shell
su
rm /vendor/overlay/BluetoothResCommon.apk

- adb and twrp
Enter in recovery mode
Mount vendor partition
Connect your phone to your PC and run these commands from terminal or cmd:
adb pull /vendor/overlay/BluetoothResCommon.apk
adb shell
rm /vendor/overlay/BluetoothResCommon.apk

This section is based from this guide. Only the first step is needed, X2 Pro build.prop has already some working configurations.

5. Flashing ROM and Gapps
- Download the ROM file (if you haven't)
- If ROM it's compressed (xz), then uncompress the file and copy the rom_name.img file to your phone
- Copy GApps to your phone (optional)
- Enter in TWRP
- Choose the file rom_name.img
- Flash it as "System image"
- If you're flashing GApps, follow this steps:
- Go to Partitions
- Select system
- Resize partition
- Flash GApps package
If this steps shows you errors, you can reboot to recovery and try again​
- Format data
- Reboot system


Note: according to many guides and people, certain roms like havoc won't boot if you don't set your selinux to permissive.
I tried havoc some weeks ago and I didn't needed to do that, but in case the rom you picked doesn't boot, flash Permissiver_v5 from this thread:
https://forum.xda-developers.com/realme-x2-pro/how-to/how-to-flash-havoc-evolution-gsi-t4040607

6. Magisk
As of March 15, 2020, phh's Magisk works, yes, but it has the following issues:
- App installation becomes slower
- Internal storage becomes read and append only, you can't modify files or delete them.

For those reasons I do not recommend to install it at this moment. Whenever it gets fixed, I'll update the guide with the proper links.


7. First steps in your new ROM (including 90hz)
Now that your rom has booted (I think), there are some basic configs that you may want to do:
- Get LTE working:
In my case, by default the ROM were locked on WCDMA, which is 3G+ in my operator, follow this steps to change it

- Go to Settings
- Open Network & internet
- Select Mobile network
- Look for Preferred network type
- Choose the one that works better for you. I selected global.

- Enable device features:
By default, some of our device features come disabled, lets change it

- Go to Settings
- Open Phh Treble Settings
- Open Oppo features

- Select Enable DT2W
- Select Enable Game Mode
- Select Enable USB OTG
- Open Misc features

- Select Expose Aux cameras
- Select Force Enable Camera2API HAL

- Enable 90HZ!
And finally, for enabling 90HZ:
- Go to Settings
- Open Phh Treble Settings
- Open Misc features
- Select Force FPS
- Choose 90.0 (or 60.0 if you don't want it)
- Nice

8. Google Camera (GCam)
Get a funcional GCam was really hard, I tried several versions like Urnyx, Tiger, BSG and Arnova. They didn't work, whenever I made a picture or video the app closed, even loading the config.xml
After a lot of effort, I found one that is working pretty well, including features like night mode! It's a very specific version, GCam_5beta6.200105.0445build-7.2.018.apk others didn't work
Just download and install it:
https://www.celsoazevedo.com/files/android/google-camera/f/changelog955/

Note: You probably will need to download Google Photos app, I already use it, so it worked from the first run.

9. Viper4Android (V4A)
And last but not least, for people that uses V4A, these are the steps to making it work without Magisk.
1. You will have to set your selinux to permissive, if you haven't, flash Permissiver_v5
2. Go to this site https://zackptg5.com/android.php#viper and download Rootless Driver Installer
Screenshot_7.png

3. Flash the file
4. Reboot and install Viper4Android 2.7.0.1 or newer
5. Profit!

There are some screenshots at the attachments :)

Many thanks to all the devs, contributors and XDA Users that made possible to have AOSP GSI in X2 Pro, some of them:
@phhusson @natedogg20050 @ospeto @SrCDA @Jerry08 @mauronofrio
 

Attachments

  • Screenshot_7.png
    Screenshot_7.png
    23.9 KB · Views: 2,117
  • Screenshot_20200315-184925.jpg
    Screenshot_20200315-184925.jpg
    106.1 KB · Views: 2,293
  • Screenshot_20200315-184939_Lawnchair.jpg
    Screenshot_20200315-184939_Lawnchair.jpg
    170.6 KB · Views: 2,327
  • Screenshot_20200315-184946_Settings.png
    Screenshot_20200315-184946_Settings.png
    188.1 KB · Views: 2,315
  • Screenshot_20200315-185005_Settings.png
    Screenshot_20200315-185005_Settings.png
    147.4 KB · Views: 2,265
  • Screenshot_20200315-185011_Settings.png
    Screenshot_20200315-185011_Settings.png
    159.3 KB · Views: 2,180
  • Screenshot_20200315-185018_Settings.png
    Screenshot_20200315-185018_Settings.png
    147.4 KB · Views: 2,139

EdgardoSchiffer

Senior Member
Oct 15, 2013
121
122
OnePlus 9
Can't tell, no VoLTE in my country

@EdgardoSchiffer Good stuff, did you use a specific config for the Gcam?

Also you could add Youtube Vanced to your guide I've found that the non-root works best https://vanced.app/
I ran GCam with stock config, It does a great Job

Does Google Pay work? How to get root access like magisk stable?
GPay probably not, by default even Netflix does not appear on Play Store
You can get root with Magisk, but you will have the bugs I wrote on thread. I don't know if there is any other root method
 

ospeto

Senior Member
Feb 28, 2017
82
35
Ah yes, it become read only file system. But magisk modules working OK right? We can use twrp for deleting or modifying system file.
 

exadeci

Senior Member
Jul 21, 2010
855
314
Sydney
Don't forget that all those ROMs that we can use on our phones are because of one guy and he just added fingerprint reading on Realme phones a few days ago, so go and Sponsor him on Github!

https://github.com/sponsors/phhusson

I just did and for a year Github matches the donation:
To supercharge community funding, GitHub created the GitHub Sponsors Matching Fund, which matches up to $5000 USD total per sponsored developer in their first year, or 12 months, of sponsorship.
 
  • Like
Reactions: tiennemannes

gamr13

Senior Member
Apr 5, 2017
145
27
Great work guys!!!
ist it possible to fix the Bluetooh Audio issue (Headphones are connected, but music is played with the speakers of the phone) after installation of the ROM?
Furthermore, left swipe does not show the Google Discover feed and 'o.k. Google' doesn't respond to my voice.

Read the guide, mount Vendor in TWRP or OrangeFox and you'll be able to find it in the file manager in the recovery.
Can't help with the last part though.
 

alwaystong

New member
Jan 21, 2012
4
0
For me, Bluetooth for media audio didn't work. I've remove Bluetoothres.apk before flashing. How to do? Flash last version 215, is it value to do?
 

IIABODEII

Senior Member
Oct 11, 2010
67
9
Many thanks for the great effort, OP.

I haven't had any luck in installing any GSI on my Gloabl X2 Pro and I have been trying for a week now. I noticed every thread has different method, which got me very confused. I would like to thank you for stating the system Pre-requisites, not many HOW-TO guides state the firmware requirement.

Before i ask my question, i didn't have any luck with your method either. The question is, in the reference links you provided, they talk about vbmeta and pushing fstab.qcom, but you didn't mention anything about them in the steps. Am i missing something?

i just want to install a GSI, i don't care about any fix. I just want a GSI to boot because after SUCCESSFULLY installing the image then wiping data, i get into a bootloop. So my priority is just getting a GSI to boot.

I am on RMX1931EX_11_A.10


I appreciate anyone's input into solving my issue
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 17
    Hello everybody:

    GSI ROMS finally have Fingerprint on display (fod) support, so I decided to try it today.
    It was quite difficult to make everything work, since there are a lot of guides in X2 Pro forum and XDA, so I decided to create this thread to make things easier to other users that want to use GSI ROMS.
    My device is a Realme X2 Pro Chinese, but this should work on any X2 Pro.

    The guides I used as references are these ones:
    https://forum.xda-developers.com/realme-x2-pro/how-to/how-to-flash-aosp-android-10-gsi-realme-t4036825
    https://forum.xda-developers.com/realme-x2-pro/how-to/how-to-flash-havoc-evolution-gsi-t4040607
    https://forum.xda-developers.com/realme-x2-pro/how-to/how-to-flash-aosp-android-10-gsi-realme-t4036825
    https://forum.xda-developers.com/project-treble/trebleenabled-device-discussion/guide-fix-bluetooth-audio-a2dp-aptx-gsi-t3950938
    And probably other ones I found at internet that I can't remember at this point :confused:

    1. Pre-requisites
    - Unlocked bootloader
    - TWRP Installed (I use Orange Fox)
    - Color OS Firmware A08+ or A13+ (chinese)
    Don't do it being on Realme UI, there are some features that won't work with the new firmware/vendor, FP included (Ironically, bluetooth gets fixed).
    - Any software that can uncompress .xz files (most of GSI comes in this format)

    2. Choosing your ROM
    The first step is to find any rom that you like, it must has these features:
    - It has to be based on phh's AOSP v214 or newer.
    - It must be A/B ARM64.

    You can look for one here:
    https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-%28GSI%29-list
    Screenshot_6.png


    I would suggest to pick phh's AOSP ROM or LOSQ Project which is really close to phh's source.
    https://github.com/phhusson/treble_experimentations/releases
    https://github.com/eremitein/treble-patches/wiki/LOSQ-Project

    Bugs as of March 03, 2020
    At this time, every phh's based rom has the following bugs:
    - In-call bluetooth
    - Bluetooth media playback (can be solved)
    - Auto brightness
    - Securize (I tried to use it but never done anything)

    And there may be more bugs included on the rom you're using (lineage, havoc, evo, losq, posp, etc)

    3. GApps (Optional)
    Note: many roms has 2 variants, one with GApps included and one vanilla, depending on the one you choose, you'll have to do this step.

    If you need Google Services and the ROM you downloaded does not include them, you need to pick a Gapps package.
    Personally, I like BitGapps, but you can choose any you like as long as they are made for ARM64 Android 10.

    BitGApps
    FlameGApps
    OpenGApps

    4. Bluetooth fix
    Before flashing the ROM, you have to delete the file BluetoothResCommon.apk from your vendor. You may want make a copy of it.
    For this, you can do this action in the following ways:
    - using a file explorer
    Search in the root (/) the path /vendor/overlay
    Search the file BluetoothResCommon.apk
    Make a backup of the file
    Delete the file

    - adb and root
    Connect your phone to your PC and run these commands from terminal or cmd:
    adb pull /vendor/overlay/BluetoothResCommon.apk
    adb shell
    su
    rm /vendor/overlay/BluetoothResCommon.apk

    - adb and twrp
    Enter in recovery mode
    Mount vendor partition
    Connect your phone to your PC and run these commands from terminal or cmd:
    adb pull /vendor/overlay/BluetoothResCommon.apk
    adb shell
    rm /vendor/overlay/BluetoothResCommon.apk

    This section is based from this guide. Only the first step is needed, X2 Pro build.prop has already some working configurations.

    5. Flashing ROM and Gapps
    - Download the ROM file (if you haven't)
    - If ROM it's compressed (xz), then uncompress the file and copy the rom_name.img file to your phone
    - Copy GApps to your phone (optional)
    - Enter in TWRP
    - Choose the file rom_name.img
    - Flash it as "System image"
    - If you're flashing GApps, follow this steps:
    - Go to Partitions
    - Select system
    - Resize partition
    - Flash GApps package
    If this steps shows you errors, you can reboot to recovery and try again​
    - Format data
    - Reboot system


    Note: according to many guides and people, certain roms like havoc won't boot if you don't set your selinux to permissive.
    I tried havoc some weeks ago and I didn't needed to do that, but in case the rom you picked doesn't boot, flash Permissiver_v5 from this thread:
    https://forum.xda-developers.com/realme-x2-pro/how-to/how-to-flash-havoc-evolution-gsi-t4040607

    6. Magisk
    As of March 15, 2020, phh's Magisk works, yes, but it has the following issues:
    - App installation becomes slower
    - Internal storage becomes read and append only, you can't modify files or delete them.

    For those reasons I do not recommend to install it at this moment. Whenever it gets fixed, I'll update the guide with the proper links.


    7. First steps in your new ROM (including 90hz)
    Now that your rom has booted (I think), there are some basic configs that you may want to do:
    - Get LTE working:
    In my case, by default the ROM were locked on WCDMA, which is 3G+ in my operator, follow this steps to change it

    - Go to Settings
    - Open Network & internet
    - Select Mobile network
    - Look for Preferred network type
    - Choose the one that works better for you. I selected global.

    - Enable device features:
    By default, some of our device features come disabled, lets change it

    - Go to Settings
    - Open Phh Treble Settings
    - Open Oppo features

    - Select Enable DT2W
    - Select Enable Game Mode
    - Select Enable USB OTG
    - Open Misc features

    - Select Expose Aux cameras
    - Select Force Enable Camera2API HAL

    - Enable 90HZ!
    And finally, for enabling 90HZ:
    - Go to Settings
    - Open Phh Treble Settings
    - Open Misc features
    - Select Force FPS
    - Choose 90.0 (or 60.0 if you don't want it)
    - Nice

    8. Google Camera (GCam)
    Get a funcional GCam was really hard, I tried several versions like Urnyx, Tiger, BSG and Arnova. They didn't work, whenever I made a picture or video the app closed, even loading the config.xml
    After a lot of effort, I found one that is working pretty well, including features like night mode! It's a very specific version, GCam_5beta6.200105.0445build-7.2.018.apk others didn't work
    Just download and install it:
    https://www.celsoazevedo.com/files/android/google-camera/f/changelog955/

    Note: You probably will need to download Google Photos app, I already use it, so it worked from the first run.

    9. Viper4Android (V4A)
    And last but not least, for people that uses V4A, these are the steps to making it work without Magisk.
    1. You will have to set your selinux to permissive, if you haven't, flash Permissiver_v5
    2. Go to this site https://zackptg5.com/android.php#viper and download Rootless Driver Installer
    Screenshot_7.png

    3. Flash the file
    4. Reboot and install Viper4Android 2.7.0.1 or newer
    5. Profit!

    There are some screenshots at the attachments :)

    Many thanks to all the devs, contributors and XDA Users that made possible to have AOSP GSI in X2 Pro, some of them:
    @phhusson @natedogg20050 @ospeto @SrCDA @Jerry08 @mauronofrio
    2
    Before i ask my question, i didn't have any luck with your method either. The question is, in the reference links you provided, they talk about vbmeta and pushing fstab.qcom, but you didn't mention anything about them in the steps. Am i missing something?

    Those steps aren't mentioned since they are part of the process of installing TWRP and can be found in their respective guides. BTW, never done anything about fstab.qc, only the vbmeta step.


    how can i check the version from the name of the image?

    example: losq-v214-a64ab-200315-vanilla


    I appreciate anyone's input into solving my issue

    Well, it's quite easy, the name should always contain "arm64", and "ab" or "a/b", if they are separated by a character or join it's a thing for every developer.

    In the example you provided the string you gotta check is a64ab, which is for a64 processors which ab partitions. It won't boot on X2 pro, a64 it's not arm64.
    1
    Auto brightness and aptx hd also not working out of the box . But aptx hd can be enable with a magisk module. Thanks for this guide.
    1
    Don't forget that all those ROMs that we can use on our phones are because of one guy and he just added fingerprint reading on Realme phones a few days ago, so go and Sponsor him on Github!

    https://github.com/sponsors/phhusson

    I just did and for a year Github matches the donation:
    To supercharge community funding, GitHub created the GitHub Sponsors Matching Fund, which matches up to $5000 USD total per sponsored developer in their first year, or 12 months, of sponsorship.
    1
    Hello friends, I have a very big problem. I have a Lenovo Z5 pro gt 8/256 with locked bootloader. I've tried the ZUI unlock tool about 20 times to get the unlock code, but I never get an email back?!?! There is a blue tick "they receive an email", but nothing comes. What can I do to unlock the boot loader, or is there a Rome with an unlocked boot loader? I need help urgently.

    If you do not receive a confirmation code you can contact technical support of Lenovo and ask for help, perhaps they can provide you the code you need. Also you could create some other email account and try with that one.

    Anyway, you may get better help on Lenovo forums instead on realme forum.