Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] error: attribute android:systemUserOnly not found #3757

Closed
farfromrefug opened this issue Jan 3, 2025 · 1 comment
Closed

[BUG] error: attribute android:systemUserOnly not found #3757

farfromrefug opened this issue Jan 3, 2025 · 1 comment

Comments

@farfromrefug
Copy link

farfromrefug commented Jan 3, 2025

Information

  1. Apktool Version (apktool -version) - 2.10.1
  2. Operating System (Mac, Linux, Windows) - Ubuntu
  3. APK From? (Playstore, ROM, Other) - LOS Apk
  4. Java Version (java --version) - 11

Trying to modify framework-res.apk coming from LOS GSI i am facing an error trying to compile back.
The error is error: attribute android:systemUserOnly not found.
Any idea on how to fix it?

Stacktrace/Logcat

jarfile /home/mguillon/dev/android/Apktool/brut.apktool/apktool-cli/build/libs/apktool-2.10.1-dirty.jar
I: Using Apktool 2.10.1-dirty on framework-res-TMP.apk with 8 threads
I: Checking whether resources have changed...
I: Building resources with aapt2...
W: /home/mguillon/dev/android/a9/A9PatchingService/app/external_scripts/system_img_patcher/TMP/temp_framework-res/AndroidManifest.xml:1774: error: attribute android:systemUserOnly not found.
W: /home/mguillon/dev/android/a9/A9PatchingService/app/external_scripts/system_img_patcher/TMP/temp_framework-res/AndroidManifest.xml:1796: error: attribute android:systemUserOnly not found.
W: error: failed processing manifest.
Exception in thread "main" brut.androlib.exceptions.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_175945716267898023568302640793820594858.tmp, link, -o, /tmp/APKTOOL17777172333869606841.tmp, --min-sdk-version, 34, --target-sdk-version, 34, --version-code, 34, --version-name, 14, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --no-compile-sdk-metadata, --warn-manifest-validation, --enable-sparse-encoding, --enable-compact-entries, -x, --manifest, /home/mguillon/dev/android/a9/A9PatchingService/app/external_scripts/system_img_patcher/TMP/temp_framework-res/AndroidManifest.xml, /home/mguillon/dev/android/a9/A9PatchingService/app/external_scripts/system_img_patcher/TMP/temp_framework-res/build/resources.zip]
        at brut.androlib.AaptInvoker.invoke(SourceFile:0)
        at brut.androlib.ApkBuilder.buildResources(SourceFile:0)
        at brut.androlib.ApkBuilder.build(SourceFile:0)
        at brut.apktool.Main.main(SourceFile:0)
Caused by: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_175945716267898023568302640793820594858.tmp, link, -o, /tmp/APKTOOL17777172333869606841.tmp, --min-sdk-version, 34, --target-sdk-version, 34, --version-code, 34, --version-name, 14, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --no-compile-sdk-metadata, --warn-manifest-validation, --enable-sparse-encoding, --enable-compact-entries, -x, --manifest, /home/mguillon/dev/android/a9/A9PatchingService/app/external_scripts/system_img_patcher/TMP/temp_framework-res/AndroidManifest.xml, /home/mguillon/dev/android/a9/A9PatchingService/app/external_scripts/system_img_patcher/TMP/temp_framework-res/build/resources.zip]
        at brut.util.OS.exec(SourceFile)
        ... 4 more

Steps to Reproduce

  1. apktool --frame-path /home/mguillon/.local/share/apktool d -s -f d/system/framework/framework-res.apk -o temp_framework-res
  2. apktool --frame-path /home/mguillon/.local/share/apktool b temp_framework-res -api 29 -o framework-res-TMP.apk
@iBotPeaches
Copy link
Owner

I'm guessing you have an out of date framework file. I don't have a sample to replicate, but I queried that resource and it indeed exists in the current Apktool (2.11.0) framework file.

➜ aapt2 d resources 1.apk| grep 'systemUserOnly'
    resource 0x0101068d attr/systemUserOnly PUBLIC STAGED_ID=0x01bd0005

@iBotPeaches iBotPeaches closed this as not planned Won't fix, can't repro, duplicate, stale Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants