[OnePlus 7 Pro Themes, Apps, and Mods] dianoandr:
Tutorial - How to edit Framework-res.apk - OxygenOS 10

To you the guide to modify the framework-res, to insert the following changes:

- Disable keyboard switcher notification

- Disable high volume warning

- Enable burnin protection

- Change battery notification low level from 15% to 10%

- Enable 360° rotation

I assume that you already know how to use apktool, you will need:

•	Apktool

•	A text editor (I use Notepad ++)

•	7zip

•	Stock Framework-res file of your firmware

Once the framework-res.apk has been decompiled, the files we are going to modify are located in this path:

framework-res.apk\res\values.

The .xml files we are going to modify are:

•	bools.xml

•	integers.xml

•	styles.xml

Let's start!

Always remember that you do everything at your own risk!

In the bools.xml file we will change the following strings:

1 (Enable 360° rotation):

from: <bool name="config_allowAllRotations">false</bool>

to: <bool name="config_allowAllRotations">true</bool>

2 (Enable burnin protection):

from: <bool name="config_enableBurnInProtection">false</bool>

to: <bool name="config_enableBurnInProtection">true</bool>

3 (Disable high volume warning):

from: <bool name="config_safe_media_volume_enabled">true</bool>

to: <bool name="config_safe_media_volume_enabled">false</bool>

4 (Disable keyboard switcher notification):

from: <bool name="show_ongoing_ime_switcher">true</bool>

to: <bool name="show_ongoing_ime_switcher">false</bool>

In the integers.xml file we will change the following strings:

1 (Burnin protection parameters):

from: <integer name="config_burnInProtectionMaxHorizontalOffset">0</integer>

to: <integer name="config_burnInProtectionMaxHorizontalOffset">2</integer>

2 (Burnin protection parameters):

from: <integer name="config_burnInProtectionMaxVerticalOffset">0</integer>

to: <integer name="config_burnInProtectionMaxVerticalOffset">2</integer>

3 (Burnin protection parameters):

from: <integer name="config_burnInProtectionMinHorizontalOffset">0</integer>

to: <integer name="config_burnInProtectionMinHorizontalOffset">2</integer>

4 (Burnin protection parameters):

from: <integer name="config_burnInProtectionMinVerticalOffset">0</integer>

to: <integer name="config_burnInProtectionMinVerticalOffset">2</integer>

5 (Battery notification low level parameters):

from: <integer name="config_lowBatteryWarningLevel">15</integer>

to: <integer name="config_lowBatteryWarningLevel">10</integer>

6 (High volume warning parameters):

from: <integer name="config_safe_media_volume_index">18</integer>

to: <integer name="config_safe_media_volume_index">-1</integer>

In style.xml we will have to eliminate duplicate lines of text, if we do not, at compile time, apktool will return a series of errors. Usually the duplicated lines are at:

1186

1263

1272

1274

and in detail they are (but it is not excluded that they can change with the new firmware):

•	<item name="textEditSuggestionItemLayout">@layout/text_edit_suggestion_item</item>

•	<item name="preferenceFrameLayoutStyle">@style/Widget.Holo.PreferenceFrameLayout</item>

•	<item name="textEditSuggestionContainerLayout">@layout/text_edit_suggestion_container</item>

•	<item name="textEditSuggestionHighlightStyle">@style/TextAppearance.Holo.SuggestionHighlight</item>

If you also want to change the height of the navigation bar, we will have to modify the file:

dimens.xml

the values to be modified can be found in:

<dimen name="navigation_bar_height">56.0dip</dimen>

<dimen name="navigation_bar_height_landscape">56.0dip</dimen>

where 56.0 is the default value and that's what you'll need to work on, I use a height of 38dip without problems, my advice is not to decrease the value too much, go tentatively without exaggerating.

Once this modification is completed we can compile the new apk but be careful we cannot directly use the new framework-res obtained, otherwise the bootloop is certain so we extract the content of the new apk (just extract it with 7zip) and delete the "android-manifest.xml" file and the whole "meta-inf" folder, the rest of the content is what we need to get the mod.

The remaining content of the modified apk, I recommend to install it with a magisk module "vrthemer", like this (the same one I use for my mods):

Magisk Module Vrthemer

module created by [MENTION=5346465]Tulsadiver[/MENTION], which I take this opportunity to thank for his fantastic work.

Inside the module we will insert the content extracted from the new apk in \vrtheme\system\framework\framework-res.apk and the module is ready to be installed.

This is the procedure I have always used.

Have fun!

Always remember that you do everything at your own risk!

I remind you that in case of problems that do not allow you to remove a module with "Magisk Manager", as in the case of bootloop, it is always possible to solve it from recovery, using the TWRP file manager and deleting the offending module located in the following path:

/data/adb/modules