Skip to content

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

@IgorEisberg

Description

@IgorEisberg

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:

if (mSdkVersion > 0 && mSdkVersion >= getNaturalSdkVersionRequirement()) {
sb.append("-v").append(mSdkVersion);
}

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions