-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Run indexJob before rename #910
Conversation
@bet4it looks like your change fixes the issue, but I don't think that decompile all classes to just get dependencies is a good idea. It is better to just reload code for all currently decompiled classes and as I remember that was a goal @S-trace tried to achieve. |
I don't think we really need to decompile classes to get usage information. This should be possible via parsing raw DEX code, just like simple @skylot What do you think about this approach? |
@S-trace I agree. Actually, right now I am working on my own dex parsing library which will allow fast traversing through instructions and decode only interesting ones (which contains references to other classes/methods/fields) so we can collect dependencies before decompilation. |
@skylot Great! How do you think, should I try to implement dependencies collection for current dx-based implementation, or just wait for your new DEX parser? We don't need full search index for renaming, we just need the list of classes having references to the class which has the renamed entity (class/method/field), so I think this can be implemented using a So, the reverse dependencies lookup it will be possible without complete classes traversal, just by Map.get(DexID<<32 + ClassID), and storage will be very compact and fast because it will be based on int arrays, not Objects. This Map can be filled using temporary What do you think about this way to store deps for renaming functionality? UPD2: Thank you. |
I don't want to implement the same thing twice, so there is no point in doing it right now.
Currently, such tracking implemented in DependencyCollector but it works on high-level instruction objects which require to load all method instructions, so now it runs as a visitor in class decompilation. Also, I want to mention that dependencies info will be used not only for rename feature but to resolve other issues like:
|
Ok, so I think this pull request resolves the issue for now. Attached rebased over #935 patch from this pull request. But I have one question about the visual part: Thank you. |
I didn't change the size of the dialog, jadx uses the size of the dialog at last time. |
The
Rename
function needsusageInfo
to change all the references of the name changed. We need to make sureindexJob
has completed beforeRename
.Fix #907.