Description
Bug description
The Problem
I built a custom patch for GitHub app, for changing the DARK
theme to AMOLED
. The patch is divided into two patches, one that patches the smali code (classes.dex)
and the other that patches resources.arsc
.
The thing is that when applying the resources patch to patch the resources.arsc
, the patch is successful, but the recompiling process FAILS
because in the AndroidManifest.xml
for the GitHub
app, there are some Android 15 Features
which Revanced Manager
can't handle, and the recompiling process FAILS
.
The GitHub app (v1.214.0) was compiled with Android 15 SDK (API 35), which includes new manifest features:
<uri-relative-filter-group>
element - New XML element for grouping URI patternsandroid:allow attribute
- Controls whether URI patterns are allowed/blockedandroid:queryAdvancedPattern
attribute - Advanced regex pattern matching for query parameters
The Root Cause
The ReVanced Manager's APK compiler (libaapt2.so) is from an older version that doesn't understand these Android 15 features. When it tries to recompile the APK, it fails with:
error: attribute android:allow not found.
error: attribute android:queryAdvancedPattern not found.
error: unexpected element <uri-relative-filter-group> found.
Why This Happens
- Resource patches require full APK recompilation to rebuild the resources.arsc file
- Bytecode patches don't require recompilation (they modify existing files directly)
- The recompilation step exposes the Android 15 compatibility issue
Additional Context
- The resource patch logic works correctly and modifies the XML files as intended
- The failure occurs during the APK recompilation step, not during the patch application
- Older app versions (v1.190.0) work correctly with the same resource patch and also if the above mentioned features are removed from the
AndroidManifest.xml
file in newer versions of theGitHub
app, the recompiling process isSUCCESSFUL
. - This affects GitHub app versions compiled with Android 15 SDK that requires resource modifications and have the above mentioned features in the
AndroidManifest.xml
file.
Problematic Features Code in the AndroidManifest.xml
<uri-relative-filter-group
android:allow="false">
<data
android:path="/sessions/two-factor/mobile"/>
<data
android:queryAdvancedPattern=".+"/>
</uri-relative-filter-group>
<uri-relative-filter-group
android:allow="false">
<data
android:path="/login/oauth/authorize"/>
<data
android:queryAdvancedPattern=".+"/>
</uri-relative-filter-group>
<uri-relative-filter-group
android:allow="false">
<data
android:path="/enterprises/github/sso"/>
<data
android:queryAdvancedPattern=".+"/>
</uri-relative-filter-group>
<uri-relative-filter-group
android:allow="false">
<data
android:path="/login"/>
<data
android:queryAdvancedPattern=".+"/>
</uri-relative-filter-group>
<uri-relative-filter-group
android:allow="true">
<data
android:pathPattern="/.*"/>
</uri-relative-filter-group>
<data
android:pathAdvancedPattern="/[^l].*"/>
<data
android:pathAdvancedPattern="/l[^o].*"/>
<data
android:pathAdvancedPattern="/lo[^g].*"/>
<data
android:pathAdvancedPattern="/log[^i].*"/>
<data
android:pathAdvancedPattern="/logi[^n].*"/>
<data
android:pathAdvancedPattern="/login[a-zA-Z0-9\-\_].*"/>
<data
android:pathAdvancedPattern="/l"/>
<data
android:pathAdvancedPattern="/lo"/>
<data
android:pathAdvancedPattern="/log"/>
<data
android:pathAdvancedPattern="/logi"/>
Summary of what if removed from the AndroidManifest.xml
file for testing purposes on newer versions of the GitHub
app, the recompiling process will SUCCEED
:
- 5 complete
<uri-relative-filter-group>
blocks with their contents - 10
android:pathAdvancedPattern
data elements
The Solution
I hope the ReVanced Manager team will update their APK compilation tools (AAPT2) to support Android 15 features or whatever else is needed in order for this to work.
Version of ReVanced Manager and version & name of app you are patching
- ReVanced Manager v1.25.0
- GitHub v1.214.0
revanced-manager_logcat_20250628205406203826.log
Installation method
Regular
ReVanced Manager logs
Couldn't upload, the log file produced when clicking on Share logs in the ReVanced Manager Settings is too big, so I uploaded it in the section: "Version of ReVanced Manager and version & name of app you are patching".
Patch logs
- Logs
Reading APK
Decoding app manifest
Loading patches
Deleting existing temporary files directory
Decoding resources
Initializing lookup maps
Executing patches
Applied 1 patches
Compiling modified resources
/data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/apk/AndroidManifest.xml:71: warn: unexpected element <uri-relative-filter-group> found in <manifest><application><activity-alias><intent-filter>.
/data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/apk/AndroidManifest.xml:75: warn: unexpected element <uri-relative-filter-group> found in <manifest><application><activity-alias><intent-filter>.
/data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/apk/AndroidManifest.xml:79: warn: unexpected element <uri-relative-filter-group> found in <manifest><application><activity-alias><intent-filter>.
/data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/apk/AndroidManifest.xml:83: warn: unexpected element <uri-relative-filter-group> found in <manifest><application><activity-alias><intent-filter>.
/data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/apk/AndroidManifest.xml:87: warn: unexpected element <uri-relative-filter-group> found in <manifest><application><activity-alias><intent-filter>.
/data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/apk/AndroidManifest.xml:71: error: attribute android:allow not found.
/data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/apk/AndroidManifest.xml:73: error: attribute android:queryAdvancedPattern not found.
/data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/apk/AndroidManifest.xml:75: error: attribute android:allow not found.
/data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/apk/AndroidManifest.xml:77: error: attribute android:queryAdvancedPattern not found.
/data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/apk/AndroidManifest.xml:79: error: attribute android:allow not found.
/data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/apk/AndroidManifest.xml:81: error: attribute android:queryAdvancedPattern not found.
/data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/apk/AndroidManifest.xml:83: error: attribute android:allow not found.
/data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/apk/AndroidManifest.xml:85: error: attribute android:queryAdvancedPattern not found.
/data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/apk/AndroidManifest.xml:87: error: attribute android:allow not found.
error: failed processing manifest.
An error occurred:
brut.androlib.exceptions.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/data/app/~~TGlbk4x8ZR4pBwfeyBproQ==/app.revanced.manager.flutter-1dYNG-_kDFIJUddYmEPGXw==/lib/arm64/libaapt2.so, link, -o, /data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/patched/resources/resources.apk, --package-id, 127, --min-sdk-version, 26, --target-sdk-version, 35, --version-code, 857, --version-name, 1.214.0, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, --warn-manifest-validation, -e, /data/user/0/app.revanced.manager.flutter/cache/APKTOOL5633238660687729094.tmp, -0, arsc, -I, /data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/1.apk, --manifest, /data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/apk/AndroidManifest.xml, /data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/apk/build/resources.zip]
at app.revanced.patcher.patch.ResourcePatchContext.get(SourceFile:146)
at app.revanced.patcher.Patcher.get(Unknown Source:18)
at app.revanced.manager.flutter.MainActivity.runPatcher$lambda$34(Unknown Source:391)
at app.revanced.manager.flutter.MainActivity.$r8$lambda$_NYn7P0Ss3RCL0-SqEFL-opMsQw(Unknown Source:0)
at app.revanced.manager.flutter.MainActivity$$ExternalSyntheticLambda6.run(Unknown Source:18)
at java.lang.Thread.run(Thread.java:1117)
Caused by: brut.common.BrutException: could not exec (exit code = 1): [/data/app/~~TGlbk4x8ZR4pBwfeyBproQ==/app.revanced.manager.flutter-1dYNG-_kDFIJUddYmEPGXw==/lib/arm64/libaapt2.so, link, -o, /data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/patched/resources/resources.apk, --package-id, 127, --min-sdk-version, 26, --target-sdk-version, 35, --version-code, 857, --version-name, 1.214.0, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, --warn-manifest-validation, -e, /data/user/0/app.revanced.manager.flutter/cache/APKTOOL5633238660687729094.tmp, -0, arsc, -I, /data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/1.apk, --manifest, /data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/apk/AndroidManifest.xml, /data/user/0/app.revanced.manager.flutter/files/patcher/tmp-WENQBQ/revanced-temporary-files/apk/build/resources.zip]
at brut.util.OS.exec(Unknown Source:72)
at app.revanced.patcher.patch.ResourcePatchContext.get(SourceFile:142)
... 5 more
Acknowledgements
- I have checked all open and closed bug reports and this is not a duplicate.
- I have chosen an appropriate title.
- All requested information has been provided properly.
- The bug is only related to ReVanced Manager.