Skip to content

method in converted class has illegal modifiers: 0xA #23

@stephentalley

Description

@stephentalley

dex2jar successfully converts the classes in my apk to a jar file.

However, while attempting to inspect those classes in a desktop application with Class.forName(name, false) (note the initialize = false arg), I see this error:

error: unable to process AboutBottomSheet.kt: Method $jacocoInit in class androidx/lifecycle/HasDefaultViewModelProviderFactory has illegal modifiers: 0xA

After some investigating, I'm guessing this corresponds to a default modifier in the HasDefaultViewModelProviderFactory interface (defined by Android):

default CreationExtras getDefaultViewModelCreationExtras() {
    return CreationExtras.Empty.INSTANCE;
}

This modifier was introduced in Java 8 (52), but the Android classes are for Java 6 (50).

So I believe the error results from a newer modifier in an older class version where it was not supported.

Can someone with greater knowledge confirm this suspicion, or comment on what else might be going on?

Incidentally, I tried converting that class to level 52 with d2j-class-version-switch.sh, but the problem remains.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions