[GUIDE] How to make GSIs overlay file for your phone

Search This thread

minadzuki

Member
Oct 10, 2018
18
19
Hello, when you using phh's GSIs, you may found bugs on auto brightness, battery usage data, etc (e.g: Xiaomi, Huawei, etc.). For this, you can make an overlay files for your mobiles.

Requirements:
  • framework-res.apk on your stock rom. (It may on /system/framework/framework-res.apk)
  • apktool (to extract framework-res.apk)
  • git (to clone repo)
  • Linux (to build overlay files)

Steps:
1. Fork phhusson/vendor_hardware_overlay on GitHub.

2. Clone Repository which you forked, and make a new branch for your works.

3. Copy a device which similar for your device, and rename it to your own device.

4. Edit <Your device>/Android.mk (Just modify the contents of the brackets, same as below)
Code:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := treble-overlay-[Manufacturer of your device]-[Name of your device]
LOCAL_MODULE_PATH := $(TARGET_OUT)/overlay
LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true
LOCAL_PRIVATE_PLATFORM_APIS := true
include $(BUILD_PACKAGE)

5. Edit <Your device>/AndroidManifest.xml
Code:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="me.phh.treble.overlay.[Manufacturer of your device].[Name of your device]"
        android:versionCode="1"
        android:versionName="1.0">
        <overlay android:targetPackage="android"
                android:requiredSystemPropertyName="ro.vendor.build.fingerprint"
                android:requiredSystemPropertyValue="+[write as similar format]*"
		android:priority="[Take next number of last used]"
		android:isStatic="true" />
</manifest>
If you don't know how to take android:priority, you can execute this commands to list priority which used already:
Code:
cd [Path of repository]
find -name AndroidManifest.xml |while read manifest;do packagename="$(xmlstarlet sel -t -m '//manifest' -v @package -n $manifest)";priority="$(xmlstarlet sel -t -m '//overlay' -v @android:priority -n $manifest)";echo -e "$priority\t$packagename";done|more
(the single line command split here, just for viewing or making a shell script):
Code:
find -name AndroidManifest.xml |while read manifest;do
    packagename="$(xmlstarlet sel -t -m '//manifest' -v @package -n $manifest)";
    priority="$(xmlstarlet sel -t -m '//overlay' -v @android:priority -n $manifest)";
    echo -e "$priority\t$packagename";
done
It will print a list for you (unsorted), and you just take an unused priority.

You can find device fingerprint on /vendor/build.prop, or execute following commands (on your device or adb shell):
Code:
getprop ro.vendor.build.fingerprint
If you can't find ro.vendor.build.fingerprint, you can find ro.vendor.product.name or ro.product.vendor.device, then change android:requiredSystemPropertyName and android:requiredSystemPropertyValue what you found.
Huawei seems to use ro.hw.oemName to detect phone, and others manufacturer maybe have their own detection, too. But it should be unique for other phones with same manufacturer.
(It's NOT recommended unless your device don't have ro.vendor.build.fingerprint.)

6. Extract framework-res.apk with apktool on another side. (to avoid commited by mistake)

7. Replace <Your device>/res/xml/power_profile.xml to which power_profile.xml for your device.
It will on <Extracted framework-res.apk>/res/xml/power_profile.xml.
Or you can find whoever's device tree, it may have this file, too.

8. Edit <Your device>/res/values/config.xml
Find each key on following files what for your device:
Code:
[Extracted framework-res.apk]/res/values/arrays.xml
[Extracted framework-res.apk]/res/values/bools.xml
[Extracted framework-res.apk]/res/values/fractions.xml
[Extracted framework-res.apk]/res/values/integers.xml
And then replace values into <Your device>/res/values/config.xml

9. Add your device into <Path of repository>/overlay.mk
Just write like other lines.

10. Build overlays
Just execute following commands:
Code:
chmod u+x [Path of repository]/build/build.sh
[Path of repository]/build/build.sh
If You get this, Do what it said:
Code:
Please install aapt (apt install aapt should do)
Or if you get this:
Code:
OpenJDK Server VM warning: You have loaded library /root/overlay/vendor_hardware_overlay/build/signapk/libconscrypt_openjdk_jni.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.conscrypt.NativeCrypto.get_cipher_names(Ljava/lang/String;)[Ljava/lang/String;
        at org.conscrypt.NativeCrypto.get_cipher_names(Native Method)
        at org.conscrypt.NativeCrypto.<clinit>(NativeCrypto.java:764)
        at org.conscrypt.OpenSSLProvider.<init>(OpenSSLProvider.java:56)
        at org.conscrypt.OpenSSLProvider.<init>(OpenSSLProvider.java:49)
        at com.android.signapk.SignApk.main(SignApk.java:942)
I have no solution, either. Try to build on another computer.

11. Test overlay with tests.sh and yourself
For general checks (symtax, etc.), just execute following command:
Code:
chmod u+x [Path of repository]/tests/tests.sh
[Path of repository]/tests/tests.sh
You should fix errors what reported for your device, and then restart from step 10.
If it reported errors but not for your device, just ignore it.
When check passed, you can find overlay file on <Path of repository>/build/treble-overlay-<Manufacturer of your device>-<Name of your device>.apk, just copy it into your phone's /system/overlay/, and set permission to rw-r--r-- / 0644.
And then reboot your phone to test your overlay.

12. If it works for your device, don't forget to perform a pull request for phhusson/vendor_hardware_overlay, to support his awesome works.
 
Last edited:

king1990

Senior Member
Oct 13, 2012
522
905
Thanks for the guide @minadzuki
but i'm getting this error after step 10:
(core dumped) aapt package -f -F ${name}-unsigned.apk -M $path/AndroidManifest.xml -S $path/res -I android.jar
even when i try to build for existing devices I got the same error
 

minadzuki

Member
Oct 10, 2018
18
19
Thanks for the guide @minadzuki
but i'm getting this error after step 10:
(core dumped) aapt package -f -F ${name}-unsigned.apk -M $path/AndroidManifest.xml -S $path/res -I android.jar
even when i try to build for existing devices I got the same error

Oh...I forgot this, sorry.
Because I haven't encountered this error, so I don't have a way to solve it, either. (I tried to built it on three remote servers only)
And...is it cause segment fault?

Or you can try to install google-android-build-tools instead of aapt. (because I can't find aapt on archlinux but found this)
 

phhusson

Recognized Developer
Jul 23, 2009
2,481
4,781
Paris
Very nice guide, thanks!
I'll link it as part of a "how to contribute"

For aapt, there is an aapt included in the git. If it doesn't work for you (like @king1990's segfault), know that the one included in the git has the lowest priority. It will pick up aapt from the system first.
(but then you'll need to have a system-wide aapt).
Or if you have an Android SDK somewhere, you can set your PATH to include it.

Edit: I just realized that what I just described might actually be the issue. If there is a system-wide aapt, it will use the libc++ in the git, which would explain the crash.
I fixed this case in my current git.
If there is a system-wide aapt it will use it.
If for some reason, system-wide aapt isn't suitable, you can run build.sh with --local-aapt to force the use of the in-git aapt (i.e. it will have higher priority than system's so no conflict should happen)

Thanks for the guide @minadzuki
but i'm getting this error after step 10:
(core dumped) aapt package -f -F ${name}-unsigned.apk -M $path/AndroidManifest.xml -S $path/res -I android.jar
even when i try to build for existing devices I got the same error
Could you check again with latest git?
If it still doesn't work, can you try to call build.sh --local-aapt ?
 
Last edited:
  • Like
Reactions: a7one and AzzyC

king1990

Senior Member
Oct 13, 2012
522
905
@phhusson Thanks now it working fine and building without faults
I have few questions regarding the AndroidManifest.xml :
1- for android:requiredSystemPropertyValue how do I know which name to use ? is it trial and error ?
2- for android:priority does matter which number I choose ?
3- some vendors have this overlay (framework-res__auto_generated_rro.apk) under "vendor/overlay". Does is affect the device overlay in system/overlay ?
4- to install the overlay is it just as @minadzuki says ?

and thanks again for your great work
 

minadzuki

Member
Oct 10, 2018
18
19
@phhusson Thanks now it working fine and building without faults
I have few questions regarding the AndroidManifest.xml :
1- for android:requiredSystemPropertyValue how do I know which name to use ? is it trial and error ?
2- for android:priority does matter which number I choose ?
3- some vendors have this overlay (framework-res__auto_generated_rro.apk) under "vendor/overlay". Does is affect the device overlay in system/overlay ?
4- to install the overlay is it just as @minadzuki says ?

and thanks again for your great work

1. For example, Xiaomi Mi 6X has this fingerprint:
xiaomi/wayne/wayne:8.1.0/OPM1.171019.011/8.7.12:user/release-keys/
So you can take xiaomi/wayne to use, and android:requiredSystemPropertyValue will be: +xiaomi/wayne*

2. it will affect to build images, or affect the detection on System. If you got this:
Code:
F: .xxx/AndroidManifest.xml: priority xx conflicts with another manifest
You just take next number and try again, until now priority 53 has been taken (without pull request), you can take priority since 54.

3. Sorry, I don't know for this.

4. Yes, just simply copy and permission change.
 

phhusson

Recognized Developer
Jul 23, 2009
2,481
4,781
Paris
@phhusson Thanks now it working fine and building without faults
Cool
3- some vendors have this overlay (framework-res__auto_generated_rro.apk) under "vendor/overlay". Does is affect the device overlay in system/overlay ?
overlays in /system/overlay and /vendor/overlay are the same thing, and on my GSI both are loaded, so yes it affects it.
But if your vendor has a framework-res__auto_generated_rro.apk, you probably don't need an overlay file for your phone, because it's already there.

(Please note that /system/overlay doesn't exist in AOSP, that's a change specific to my ROM, and custom ROMs based on it. AOSP only has /vendor/overlay)
 
  • Like
Reactions: a7one

king1990

Senior Member
Oct 13, 2012
522
905
@minadzuki Thanks for answering my questions. @phhusson its clear now , I don't know if this is related to your treble approach or not but some GSI ROMs refuse to go the minimum value in the brightness curve no mater what value I set in the curve, it never achieved.
is this treble or ROM related ?
 

phhusson

Recognized Developer
Jul 23, 2009
2,481
4,781
Paris
@minadzuki Thanks for answering my questions. @phhusson its clear now , I don't know if this is related to your treble approach or not but some GSI ROMs refuse to go the minimum value in the brightness curve no mater what value I set in the curve, it never achieved.
is this treble or ROM related ?
Brightness is a bit complex on Android Pie... (well it already was before, but it got even worse)
Do you have a link to your current overlay, so I can take a look at which code path you'd go to?
What's the lowest backlight value you get in /sys/class/backlight/panel0-backlight/brightness or /sys/class/leds/lcd-backlight/brightness?
Also what's your device? Does it have extended brightness range? (what's the value of getprop persist.sys.qcom-brightness // is it a samsung device?)
 

king1990

Senior Member
Oct 13, 2012
522
905
Brightness is a bit complex on Android Pie... (well it already was before, but it got even worse)
Do you have a link to your current overlay, so I can take a look at which code path you'd go to?
What's the lowest backlight value you get in /sys/class/backlight/panel0-backlight/brightness or /sys/class/leds/lcd-backlight/brightness?
Also what's your device? Does it have extended brightness range? (what's the value of getprop persist.sys.qcom-brightness // is it a samsung device?)
for overlay this the extracted files from the overlay apk (my device is Axon7)
The lowest backlight is 10 (once manually edit it to 1 it goes to really dim brightness)
what I don't understand that I already built two GSI ROMs one is DU13 & other Liquid pie both report the same backlight light value at 10 at minimum value but in DU its very dim and in liquid its still bright ?!
The command did not give back any information so I assume we don't extended brightness range.

Thanks

Edit : it was overlay problem , fixed after modifying it
 
Last edited:

Copperhead100

Member
Feb 25, 2018
10
0
I tried to create an overlay for my Honor View 10 (Berkeley)

Is there a list of recommended settings to copy over from the stock ROM? I started with copying everything listed in tests/knownKeys and it seems to work

There's a power_profile.xml in the framework-res.apk I dumped from my stock ROM but the battery capacity is set to 1000 instead of 3750. Is that right?

There's also a power_profile_test.xml in there with a much more sane value of 3000 mAh. Should I use this one instead?
 

minadzuki

Member
Oct 10, 2018
18
19
I tried to create an overlay for my Honor View 10 (Berkeley)

Is there a list of recommended settings to copy over from the stock ROM? I started with copying everything listed in tests/knownKeys and it seems to work

There's a power_profile.xml in the framework-res.apk I dumped from my stock ROM but the battery capacity is set to 1000 instead of 3750. Is that right?

There's also a power_profile_test.xml in there with a much more sane value of 3000 mAh. Should I use this one instead?

I don't have any Huawei phones, sorry.
Maybe you can referrer /Huawei/kirin970/CLT or /Huawei/kirin970/EML, Honor V10 maybe have its OEM name and called "BKL"
 

phhusson

Recognized Developer
Jul 23, 2009
2,481
4,781
Paris
I tried to create an overlay for my Honor View 10 (Berkeley)

Is there a list of recommended settings to copy over from the stock ROM? I started with copying everything listed in tests/knownKeys and it seems to work

There's a power_profile.xml in the framework-res.apk I dumped from my stock ROM but the battery capacity is set to 1000 instead of 3750. Is that right?

There's also a power_profile_test.xml in there with a much more sane value of 3000 mAh. Should I use this one instead?
On Huawei, you'll find real power_profile.xml somewhere in /odm or /product. I'd say /product/etc/power_profile.xml
 

JEANRIVERA

Senior Member
Mar 30, 2007
3,013
1,482
42
Nazareth, PA
HTC U12+
ASUS ROG Phone 3
@minadzuki I can't find a config.xml in my framework-res.apk, am I missing something? or that gets created somehow in the process?

another question

on step 5 you say to edit AndroidManifext.xml, does that means delete everything in it and copy paste what you put on the code box? or just add that at the end of the xml file?
 
Last edited:

minadzuki

Member
Oct 10, 2018
18
19
@minadzuki I can't find a config.xml in my framework-res.apk, am I missing something? or that gets created somehow in the process?

another question

on step 5 you say to edit AndroidManifext.xml, does that means delete everything in it and copy paste what you put on the code box? or just add that at the end of the xml file?

framework-res.apk doesn't contain config.xml, it split into several files: arrays.xml, bools.xml, fraction.xml, integers.xml. just create config.xml or copy from other devices and find values on these files (to replace it).

and step 5, just replace values which for your device, like what other devices wrote.
 
  • Like
Reactions: JEANRIVERA

JEANRIVERA

Senior Member
Mar 30, 2007
3,013
1,482
42
Nazareth, PA
HTC U12+
ASUS ROG Phone 3
framework-res.apk doesn't contain config.xml, it split into several files: arrays.xml, bools.xml, fraction.xml, integers.xml. just create config.xml or copy from other devices and find values on these files (to replace it).

and step 5, just replace values which for your device, like what other devices wrote.

thanks for the response but I am really lost here those 4 xml has way to much data in it, should I just copy everything to config.xml?

to be honest what I am trying to fix are 2 things the battery stats not showing and the auto brightness and brightness slider and if the led light is fixable by an overlay that too, I can provide you all the files needed could you build it for me please? my device is an HTC U12+
 

minadzuki

Member
Oct 10, 2018
18
19
thanks for the response but I am really lost here those 4 xml has way to much data in it, should I just copy everything to config.xml?

to be honest what I am trying to fix are 2 things the battery stats not showing and the auto brightness and brightness slider and if the led light is fixable by an overlay that too, I can provide you all the files needed could you build it for me please? my device is an HTC U12+

you can check like this:
https://github.com/phhusson/vendor_hardware_overlay/blob/master/Xiaomi/Mi8/res/values/config.xml
then take values from those 4 xmls.
 
  • Like
Reactions: JEANRIVERA

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    Hello, when you using phh's GSIs, you may found bugs on auto brightness, battery usage data, etc (e.g: Xiaomi, Huawei, etc.). For this, you can make an overlay files for your mobiles.

    Requirements:
    • framework-res.apk on your stock rom. (It may on /system/framework/framework-res.apk)
    • apktool (to extract framework-res.apk)
    • git (to clone repo)
    • Linux (to build overlay files)

    Steps:
    1. Fork phhusson/vendor_hardware_overlay on GitHub.

    2. Clone Repository which you forked, and make a new branch for your works.

    3. Copy a device which similar for your device, and rename it to your own device.

    4. Edit <Your device>/Android.mk (Just modify the contents of the brackets, same as below)
    Code:
    LOCAL_PATH := $(call my-dir)
    include $(CLEAR_VARS)
    LOCAL_MODULE_TAGS := optional
    LOCAL_PACKAGE_NAME := treble-overlay-[Manufacturer of your device]-[Name of your device]
    LOCAL_MODULE_PATH := $(TARGET_OUT)/overlay
    LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true
    LOCAL_PRIVATE_PLATFORM_APIS := true
    include $(BUILD_PACKAGE)

    5. Edit <Your device>/AndroidManifest.xml
    Code:
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
            package="me.phh.treble.overlay.[Manufacturer of your device].[Name of your device]"
            android:versionCode="1"
            android:versionName="1.0">
            <overlay android:targetPackage="android"
                    android:requiredSystemPropertyName="ro.vendor.build.fingerprint"
                    android:requiredSystemPropertyValue="+[write as similar format]*"
    		android:priority="[Take next number of last used]"
    		android:isStatic="true" />
    </manifest>
    If you don't know how to take android:priority, you can execute this commands to list priority which used already:
    Code:
    cd [Path of repository]
    find -name AndroidManifest.xml |while read manifest;do packagename="$(xmlstarlet sel -t -m '//manifest' -v @package -n $manifest)";priority="$(xmlstarlet sel -t -m '//overlay' -v @android:priority -n $manifest)";echo -e "$priority\t$packagename";done|more
    (the single line command split here, just for viewing or making a shell script):
    Code:
    find -name AndroidManifest.xml |while read manifest;do
        packagename="$(xmlstarlet sel -t -m '//manifest' -v @package -n $manifest)";
        priority="$(xmlstarlet sel -t -m '//overlay' -v @android:priority -n $manifest)";
        echo -e "$priority\t$packagename";
    done
    It will print a list for you (unsorted), and you just take an unused priority.

    You can find device fingerprint on /vendor/build.prop, or execute following commands (on your device or adb shell):
    Code:
    getprop ro.vendor.build.fingerprint
    If you can't find ro.vendor.build.fingerprint, you can find ro.vendor.product.name or ro.product.vendor.device, then change android:requiredSystemPropertyName and android:requiredSystemPropertyValue what you found.
    Huawei seems to use ro.hw.oemName to detect phone, and others manufacturer maybe have their own detection, too. But it should be unique for other phones with same manufacturer.
    (It's NOT recommended unless your device don't have ro.vendor.build.fingerprint.)

    6. Extract framework-res.apk with apktool on another side. (to avoid commited by mistake)

    7. Replace <Your device>/res/xml/power_profile.xml to which power_profile.xml for your device.
    It will on <Extracted framework-res.apk>/res/xml/power_profile.xml.
    Or you can find whoever's device tree, it may have this file, too.

    8. Edit <Your device>/res/values/config.xml
    Find each key on following files what for your device:
    Code:
    [Extracted framework-res.apk]/res/values/arrays.xml
    [Extracted framework-res.apk]/res/values/bools.xml
    [Extracted framework-res.apk]/res/values/fractions.xml
    [Extracted framework-res.apk]/res/values/integers.xml
    And then replace values into <Your device>/res/values/config.xml

    9. Add your device into <Path of repository>/overlay.mk
    Just write like other lines.

    10. Build overlays
    Just execute following commands:
    Code:
    chmod u+x [Path of repository]/build/build.sh
    [Path of repository]/build/build.sh
    If You get this, Do what it said:
    Code:
    Please install aapt (apt install aapt should do)
    Or if you get this:
    Code:
    OpenJDK Server VM warning: You have loaded library /root/overlay/vendor_hardware_overlay/build/signapk/libconscrypt_openjdk_jni.so which might have disabled stack guard. The VM will try to fix the stack guard now.
    It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
    Exception in thread "main" java.lang.UnsatisfiedLinkError: org.conscrypt.NativeCrypto.get_cipher_names(Ljava/lang/String;)[Ljava/lang/String;
            at org.conscrypt.NativeCrypto.get_cipher_names(Native Method)
            at org.conscrypt.NativeCrypto.<clinit>(NativeCrypto.java:764)
            at org.conscrypt.OpenSSLProvider.<init>(OpenSSLProvider.java:56)
            at org.conscrypt.OpenSSLProvider.<init>(OpenSSLProvider.java:49)
            at com.android.signapk.SignApk.main(SignApk.java:942)
    I have no solution, either. Try to build on another computer.

    11. Test overlay with tests.sh and yourself
    For general checks (symtax, etc.), just execute following command:
    Code:
    chmod u+x [Path of repository]/tests/tests.sh
    [Path of repository]/tests/tests.sh
    You should fix errors what reported for your device, and then restart from step 10.
    If it reported errors but not for your device, just ignore it.
    When check passed, you can find overlay file on <Path of repository>/build/treble-overlay-<Manufacturer of your device>-<Name of your device>.apk, just copy it into your phone's /system/overlay/, and set permission to rw-r--r-- / 0644.
    And then reboot your phone to test your overlay.

    12. If it works for your device, don't forget to perform a pull request for phhusson/vendor_hardware_overlay, to support his awesome works.
    2
    Very nice guide, thanks!
    I'll link it as part of a "how to contribute"

    For aapt, there is an aapt included in the git. If it doesn't work for you (like @king1990's segfault), know that the one included in the git has the lowest priority. It will pick up aapt from the system first.
    (but then you'll need to have a system-wide aapt).
    Or if you have an Android SDK somewhere, you can set your PATH to include it.

    Edit: I just realized that what I just described might actually be the issue. If there is a system-wide aapt, it will use the libc++ in the git, which would explain the crash.
    I fixed this case in my current git.
    If there is a system-wide aapt it will use it.
    If for some reason, system-wide aapt isn't suitable, you can run build.sh with --local-aapt to force the use of the in-git aapt (i.e. it will have higher priority than system's so no conflict should happen)

    Thanks for the guide @minadzuki
    but i'm getting this error after step 10:
    (core dumped) aapt package -f -F ${name}-unsigned.apk -M $path/AndroidManifest.xml -S $path/res -I android.jar
    even when i try to build for existing devices I got the same error
    Could you check again with latest git?
    If it still doesn't work, can you try to call build.sh --local-aapt ?
    1
    @phhusson Thanks now it working fine and building without faults
    Cool
    3- some vendors have this overlay (framework-res__auto_generated_rro.apk) under "vendor/overlay". Does is affect the device overlay in system/overlay ?
    overlays in /system/overlay and /vendor/overlay are the same thing, and on my GSI both are loaded, so yes it affects it.
    But if your vendor has a framework-res__auto_generated_rro.apk, you probably don't need an overlay file for your phone, because it's already there.

    (Please note that /system/overlay doesn't exist in AOSP, that's a change specific to my ROM, and custom ROMs based on it. AOSP only has /vendor/overlay)
    1
    @minadzuki I can't find a config.xml in my framework-res.apk, am I missing something? or that gets created somehow in the process?

    another question

    on step 5 you say to edit AndroidManifext.xml, does that means delete everything in it and copy paste what you put on the code box? or just add that at the end of the xml file?

    framework-res.apk doesn't contain config.xml, it split into several files: arrays.xml, bools.xml, fraction.xml, integers.xml. just create config.xml or copy from other devices and find values on these files (to replace it).

    and step 5, just replace values which for your device, like what other devices wrote.
    1
    thanks for the response but I am really lost here those 4 xml has way to much data in it, should I just copy everything to config.xml?

    to be honest what I am trying to fix are 2 things the battery stats not showing and the auto brightness and brightness slider and if the led light is fixable by an overlay that too, I can provide you all the files needed could you build it for me please? my device is an HTC U12+

    you can check like this:
    https://github.com/phhusson/vendor_hardware_overlay/blob/master/Xiaomi/Mi8/res/values/config.xml
    then take values from those 4 xmls.