Skip to content

feat: replace constants in annotations of method arguments#2358

Merged
skylot merged 1 commit intoskylot:masterfrom
nitram84:replace_constants_in_annotations_of_method_args
Dec 4, 2024
Merged

feat: replace constants in annotations of method arguments#2358
skylot merged 1 commit intoskylot:masterfrom
nitram84:replace_constants_in_annotations_of_method_args

Conversation

@nitram84
Copy link
Copy Markdown
Contributor

@nitram84 nitram84 commented Dec 3, 2024

This PR replaces constants in annotation of method arguments. Example:

Having an annotation like

@Retention(RetentionPolicy.RUNTIME)
public @interface UsesAndroidResource {
	int value() default 0;
}

this class

public static class TestCls {
	public void test(@UsesAndroidResource(17039370 /* android.R.string.ok */) int i) {
	}
}

would be decompiled to

public static class TestCls {
	public void test(@UsesAndroidResource(R.string.ok) int i) {
	}
}

I need this fix to generate an issue with AGP > 8.0.0, I'd like to fix later.

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.

Nice fix! Thank you 👍

@skylot skylot merged commit 828cad3 into skylot:master Dec 4, 2024
@nitram84 nitram84 deleted the replace_constants_in_annotations_of_method_args branch May 5, 2025 09:40
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