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] Qualifier omittion causes conflict (Android 15 AOSP) #3743

Open
IgorEisberg opened this issue Dec 16, 2024 · 5 comments
Open

[BUG] Qualifier omittion causes conflict (Android 15 AOSP) #3743

IgorEisberg opened this issue Dec 16, 2024 · 5 comments

Comments

@IgorEisberg
Copy link
Contributor

IgorEisberg commented Dec 16, 2024

Conflict happens because Apktool currently doesn't preserve qualifiers as stored in resources.arsc.
While I get that omitting the API version qualifier makes sense in certain instances, apparently AAPT2 wasn't designed that way.
In this example values-en-rXA-neuter clashes with values-en-rXA-neuter-v33 because the -v33 is being omitted, the only way to decompile this APK is to not manipulate the output qualifiers with sdkVersion >= getNaturalSdkVersionRequirement().

Source: https://github.com/iBotPeaches/Apktool/blob/master/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/ResConfigFlags.java#L587-L589

APK: https://drive.google.com/file/d/1FVp1ZPv858hpzCuKx2o5BnA3uVtwNxmK/view

Log:

I: Using Apktool 2.10.1-SNAPSHOT on PermissionController.apk with 24 threads
I: Baksmaling classes.dex...
I: Loading resource table...
I: Baksmaling classes2.dex...
Exception in thread "main" brut.androlib.exceptions.AndrolibException: Multiple resources: spec=0x7f1302a5 string/permission_description_summary_storage, config=-en-rXA-neuter
        at brut.androlib.res.data.ResType.addResource(SourceFile:0)
        at brut.androlib.res.decoder.ARSCDecoder.readResourceTable(SourceFile:0)
        at brut.androlib.res.decoder.ARSCDecoder.decode(SourceFile)
        at brut.androlib.res.data.ResTable.loadResPackagesFromApk(SourceFile)
        at brut.androlib.ApkDecoder.decodeResources(SourceFile:0)
        at brut.androlib.ApkDecoder.decode(SourceFile:0)
        at brut.apktool.Main.main(SourceFile:0)
@iBotPeaches
Copy link
Owner

The only way to safely remove that is to remove appt1 support, which may not be too crazy of an idea.

@IgorEisberg
Copy link
Contributor Author

IgorEisberg commented Dec 16, 2024

The only way to safely remove that is to remove appt1 support, which may not be too crazy of an idea.

My man, I removed aapt1 support on our private fork years ago. It has been obsolete for so long already.
One can always use an older version of apktool if aapt1 is absolutely not optional.
If you want me to clean up aapt1 neatly, let me know and I'll make a pull request.

@iBotPeaches
Copy link
Owner

I'll release 2.11.x before end of year - then we can start 3.x and kill aapt1. I just want a smali release and might have to poke those guys so we can get a stable smali cut.

@IgorEisberg
Copy link
Contributor Author

I'll release 2.11.x before end of year - then we can start 3.x and kill aapt1. I just want a smali release and might have to poke those guys so we can get a stable smali cut.

Yeah, I have to fork smali cause the maintainers sure take their time...

@successor55

This comment was marked as spam.

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

3 participants