Skip to content

Bug: "ParserException: Unexpected chunk Type: 0x206"  #1

@AndroidDeveloperLB

Description

@AndroidDeveloperLB

I got this on the sample on Pixel 6 with Android 12.1 beta 3 :

can't parse apk for "android" in: "/system/framework/framework-res.apk" - exception:net.dongliu.apk.parser.exception.ParserException: Unexpected chunk Type: 0x206 isSystemApp?true

There are some similar issues on the original repository that were fixed:
https://github.com/hsiafan/apk-parser/issues?q=Unexpected+chunk+Type

Meaning:

hsiafan/apk-parser#52
hsiafan/apk-parser#54
hsiafan/apk-parser#40
hsiafan/apk-parser#49
hsiafan/apk-parser#66
hsiafan/apk-parser#89
hsiafan/apk-parser#111

It seems the original author told me to ignore some chunk types, such as 0x0204 :
hsiafan/apk-parser#96 (comment)
And that it was ignored by treating it in ChunkType class, treating it as NullHeader in ResourceTableParser class.

The proper solution might be related to looking here:
https://android.googlesource.com/platform/frameworks/base/+/master/libs/androidfw/include/androidfw/ResourceTypes.h

Of course, we could ignore this too. I just hope it won't cause an issue.

Attached the sample APK that is problematic, giving this error:

framework-res.zip

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