-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use param names in annotations #1256
Conversation
@@ -23,9 +22,7 @@ public static AnnotationsAttr pack(List<IAnnotation> annotationList) { | |||
} | |||
Map<String, IAnnotation> annMap = new HashMap<>(annotationList.size()); | |||
for (IAnnotation ann : annotationList) { | |||
if (ann.getVisibility() != AnnotationVisibility.SYSTEM) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this change break many tests :(
private List<String> extractParamNamesFromAnnotation() { | ||
AnnotationsAttr annotationList = mth.get(JadxAttrType.ANNOTATION_LIST); | ||
if (annotationList != null) { | ||
JadxAnnotation annotation = (JadxAnnotation) annotationList.get("Ldalvik/annotation/MethodParameters;"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As soon as jadx now trying to decompile java bytecode and not only dex, dalvik specific annotations should be parsed in jadx-dex-input
plugin and data class for common representation of such attribute should be placed in jadx-plugins-api
.
@DanielFi thank you for your work, but there are some issues which stops me from merging your PR. |
So, no reply :( |
Hi @skylot, sorry for commenting a closed PR. I recently found a real example that uses the MethodParameters-annotation: https://apkpure.com/de/js-run-javascript-editor-and-runner/com.mia.jsrun e.g. com.mia.jsrun.MainActivity.findTokenEnd() |
@nitram84 thank you for a nice sample! Indeed, names from that annotation can be very useful! |
Use the values in MethodParameters annotations as parameter names when available.