0

I was following some tutorials on how to create custom Runtime Resource Overlay (RRO) APKs, but I am not able to enable mine.

adb shell cmd overlay list

...

com.example.mytarget
--- com.example.myoverlay

Google said that --- mean that it is installed, but has errors and can’t be enabled.

adb shell cmd overlay dump com.example.myoverlay

com.example.myoverlay:0 {
  mPackageName...........: com.example.myoverlay
  mOverlayName...........: null
  mUserId................: 0
  mTargetPackageName.....: com.example.mytarget
  mTargetOverlayableName.: null
  mBaseCodePath..........: /system/product/overlay/myoverlays.apk
  mState.................: STATE_MISSING_TARGET
  mIsEnabled.............: true
  mIsMutable.............: true
  mPriority..............: 2147483647
  mCategory..............: null
  mIsFabricated..........: false
}
IDMAP OF com.example.myoverlay
<missing idmap>

The documentation said that mState.................: STATE_MISSING_TARGET means that "Your target is not installed". This sounds kind of like a loop and I don’t know what I should do.


The code:

Tree:

└── MyOverlays
    ├── AndroidManifest.xml
    └── res
        └── xml
            └── overlays.xml

AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="https://schemas.android.com/apk/res/android"
    package="com.android.systemui">
    <application android:hasCode="false" /> 
    <overlay android:targetPackage="com.android.systemui"
                android:targetName="res.values.colors.xml"
                android:resourcesMap="@xml/overlays"
                                        android:priority="1"/>
 
</manifest>

overlays.xml:

<overlay xmlns:android="http://schemas.android.com/apk/res/android" >
    <item target="color/global_actions_lite_background" value="#FFBF360C" />
    <item target="color/notification_primary_text_color" value="#55FF0000" />
</overlay>

And followed this guide to build it: https://github.com/MartinStyk/Android-RRO

Android : 12.1
Device : Sony Xperia 1
ROM : LineageOs

Andrew T.
  • 4,701
  • 8
  • 43
  • 62

1 Answers1

0

First of all you are dumping info on an overlay com.example.myoverlay, which is not the same overlay you are providing code from. You should be running the following command:

adb shell cmd overlay dump com.android.systemui

As you are specifying in the AndroidManifest.xml that the package of your RRO is com.android.systemui. In the output of your command the overlay com.example.myoverlay has the state STATE_MISSING_TARGET as you may not have any app with the package name com.example.mytarget installed (which is your target). Also try to change the name of your RRO package to something else to be easier to check if it is installed.

Hope this find you well, do let me know if you have any more questions