[Realme X2 Pro Guides, News, & Discussion] EdgardoSchiffer:
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://xdaforums.com/realme-x2-pro/how-to/how-to-flash-aosp-android-10-gsi-realme-t4036825

https://xdaforums.com/realme-x2-pro/how-to/how-to-flash-havoc-evolution-gsi-t4040607

https://xdaforums.com/realme-x2-pro/how-to/how-to-flash-aosp-android-10-gsi-realme-t4036825

https://xdaforums.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

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://xdaforums.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

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:
[MENTION=1915408]phhusson[/MENTION] [MENTION=1971611]natedogg20050[/MENTION] [MENTION=8106230]ospeto[/MENTION] [MENTION=9792389]SrCDA[/MENTION] @Jerry08 [MENTION=4712355]mauronofrio[/MENTION]