Skip to content
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

[gui] Find usage of public field of interface in all classes #1801

Closed
zzzzfeng opened this issue Mar 15, 2023 · 4 comments
Closed

[gui] Find usage of public field of interface in all classes #1801

zzzzfeng opened this issue Mar 15, 2023 · 4 comments
Assignees
Labels
Milestone

Comments

@zzzzfeng
Copy link

When I use find Usage(x) on a public static field of a interface class, there is no result.
But I do found the field used by other class, and can be redirected to the field by double-click

@skylot
Copy link
Owner

skylot commented Mar 15, 2023

@zzzzfeng please share a sample and class/field name, otherwise I can't reproduce and fix this issue.

@skylot skylot changed the title [feature] find usage of public field of interface in all classes [gui] Find usage of public field of interface in all classes Mar 15, 2023
@skylot skylot added bug GUI Issues in jadx-gui module no-sample waiting for reply and removed new feature labels Mar 15, 2023
@zzzzfeng
Copy link
Author

zzzzfeng commented Mar 16, 2023

Sample jar: zframework.z.jar.zip Just remove the zip extension

When I set the language to Chinese, it happens. But not for English
image

the field DESCRIPTOR has many usage in ohos.bundle.BundleManager

@skylot skylot self-assigned this Mar 16, 2023
@skylot skylot added this to the TBD milestone Mar 16, 2023
@skylot
Copy link
Owner

skylot commented Mar 16, 2023

Oh, I see! This field actually not used in bytecode because it is replaced by compiler to its string value. But during decompilation jadx tries to replace string back to field usage. So as result if you open only IBundleManager class you will see 0 usages, but after also opening BundleManager new use places will be added from that class, so next time usage list will not be empty.
As workaround for now, you can disable Replace constants option in preferences, so strings will be not replaced by fields.
Another workaround is to force decompilation of all classes by searching some not used string to see complete results (maybe I should add Decompile All button 🙂)

@skylot
Copy link
Owner

skylot commented Mar 16, 2023

@zzzzfeng I commit a fix. It is not the best solution, but it should resolve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants