Skip to content

fix: check respectBytecodeAccModifiers before changing method access modifier in MarkMethodsForInline#2361

Merged
skylot merged 1 commit intoskylot:masterfrom
ewt45:fix-method-accmodifier
Dec 9, 2024
Merged

fix: check respectBytecodeAccModifiers before changing method access modifier in MarkMethodsForInline#2361
skylot merged 1 commit intoskylot:masterfrom
ewt45:fix-method-accmodifier

Conversation

@ewt45
Copy link
Copy Markdown
Contributor

@ewt45 ewt45 commented Dec 9, 2024

even when option "Respect bytecode access modifiers" is on, some method modifiers will still be changed.

    /* JADX INFO: Access modifiers changed from: private */
    public static String getPropertyNameOfSetter(String str) {
        if (str.startsWith("set")) {
            return str.substring(3);
        }
        return null;
    }

bugged dex: 1.zip

i found that Access modifiers changed from is from FixAccessModifiers.changeVisibility().

it's a static method, so cannot use the boolean variable in the same class. Instead, the caller of changeVisibility() should check the option by root.getArgs().isRespectBytecodeAccModifiers()

in the other place where changeVisibility() is called (ClassModifier.java), the options is checked, so here we should check it too.

Copy link
Copy Markdown
Owner

@skylot skylot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@skylot skylot merged commit 2fa7f84 into skylot:master Dec 9, 2024
@ewt45 ewt45 deleted the fix-method-accmodifier branch December 10, 2024 13:36
Repository owner deleted a comment from chanduBhai88 Jul 24, 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

Successfully merging this pull request may close these issues.

2 participants