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 reference bugs #1361

Closed
xmhwws opened this issue Feb 2, 2022 · 5 comments
Closed

[GUI]Find reference bugs #1361

xmhwws opened this issue Feb 2, 2022 · 5 comments
Labels
bug Core Issues in jadx-core module

Comments

@xmhwws
Copy link

xmhwws commented Feb 2, 2022

jadx latest beta version
win10

apk link:https://drive.google.com/file/d/1wT9r9--VfqvsEghLLgiy0IDcfMSIYy2e/view?usp=sharing

When I drag in the apk, and the decompilation is finished, it gives me this message:

2022-02-02_11-13-17

Some class indexes have been skipped.
The task exceeded the 12800 ms time limit.
7 classes are not indexed and will not appear in the search results!

class:com.wrapper.proxyapplication.Util
Static member variable:versionname

The result of the search for references is only 2!
2022-02-02_11-21-15

In Jeb:

2022-02-02_11-28-31

@xmhwws xmhwws added bug Core Issues in jadx-core module labels Feb 2, 2022
@skylot
Copy link
Owner

skylot commented Feb 2, 2022

@xmhwws I can't reproduce issue with class skip. There are very few classes, so it decompiles quite fast for me:

INFO : Decompile task complete in 2936 ms (avg 18 ms per class), classes: 157, time limit:{ total: 12850ms, per cls: 50ms }

Does this issue happen every time?
Can you copy similar line from log (i.e. open apk, open search, copy line from log viewer)?

Also, issue with missing usage is not an issue, jadx just move field initialization from static constructor to field definition.
Original code was like:

    public static String versionname;
    static {
        ...
        versionname = "tosversion";
        ...
    }

@xmhwws
Copy link
Author

xmhwws commented Feb 4, 2022

When I use jadx-gui.bat, this message box appears every time, and the total memory available to jadx is 3.97GB.

2022-02-04_13-44-13

When I use jadx-gui-dev.exe, this error does not appear and the total memory available to jadx is 4.46GB.

2022-02-04_13-48-38

So this is an error due to insufficient memory available for jadx? But why are jadx-gui.bat and jadx-gui-dev.exe not using the same amount of memory?

Log of all levels of DEBUG when jadx-gui.bat decompile is completed: https://drive.google.com/file/d/1InBgg010xrpspSXUQtEWPv-1GAxegTdw/view?usp=sharing

BUG2:

Can lookup references support this? Otherwise, it's a bit annoying to jump to the declaration every time.

BUG3:

Parent class: com.wrapper.proxyapplication.WrapperProxyApplication
Subclasses: com.baidu.homework.MyWrapperProxyApplication
Methods:initProxyApplication

Searching for subclasses overriding the methods of the parent class, jadx lookup references are not supported?
2022-02-04_14-08-05
2022-02-04_14-07-27

@jpstotz
Copy link
Collaborator

jpstotz commented Feb 4, 2022

@xmhwws On of the disadvantages on Java is that it has it's own memory management system that works totally independent of the OS.

Especially old Java versions were very greedy regarding their RAM usage, they were often using large parts of the assigned RAM even if not necessary, just to save a few invocations of the garbage collector.

Therefore when starting a Java VM you have to specify the maximum Java heap size, which is done using the command-line -Xmx<max Heap size>. The batch file and the Exe file use different parameters for the maximum heap size.
How to change the maximum heap size is documented in our Wiki: https://github.com/skylot/jadx/wiki/Troubleshooting-Q&A#out-of-memory-problems

@skylot
Copy link
Owner

skylot commented Feb 4, 2022

@xmhwws

So this is an error due to insufficient memory available for jadx?

Definitely not. Actual memory usage is only 0.3 GB.

But why are jadx-gui.bat and jadx-gui-dev.exe not using the same amount of memory?

.bat version hard-coded to use 4G
.exe version uses launch4j config options for more flexible memory size detection

As for main issue, I found several flaws in current implementation:

  • current decompile task also include resources and classes indexing, and these tasks time count in total time limit of task (for me decompile took only 600ms of total 3s with indexing). I will split these task for correct execution time counting.
  • decompilation batches somehow submit more classes than original count (cause of negative -7 in skipped classes message).

I will try to fix these issues with top priority

BUG2:
Can lookup references support this? Otherwise, it's a bit annoying to jump to the declaration every time.

Yes it possible to add definition here, but this feature called Find usage and definition is not an actually a usage :)

BUG3:
Searching for subclasses overriding the methods of the parent class, jadx lookup references are not supported?

Very similar to previous question. I can add also definitions of related(overridden) methods. But for now I am not sure how to better show them, options are:

  • use separate tool window for that related methods list (also similar for fields, and hierarchy tree for classes)
  • rename Find usage to References and add collapsible sections for different types of reference like: definition, override, usage, inheritance (for classes)

Anyway, this is a lot of changes, maybe it is better to open separate issue for discussion 🤔

@skylot
Copy link
Owner

skylot commented Feb 6, 2022

@xmhwws I commit several fixes for correct time counting and skipped classes message. Please check.
For reference search suggestions, I will open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Core Issues in jadx-core module
Projects
None yet
Development

No branches or pull requests

3 participants