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] Launch4j created Jadx-version does not show classes from contained DEX file(s) #949

Closed
jpstotz opened this issue Jun 10, 2020 · 3 comments
Labels
bug GUI Issues in jadx-gui module

Comments

@jpstotz
Copy link
Collaborator

jpstotz commented Jun 10, 2020

The current builds of Jadx-gui.exe created via gradlew clean createExe are defect (tested with the provided unstable exe version https://bintray.com/skylot/jadx/download_file?file_path=jadx-gui-1.1.0-b1301-65553c15.exe as well as self-compiled one).

If you use one of this versions it loads APK files fast but the class tree afterwards only contains the generated R class.

The shown log does not show any errors:

INFO : output directory: Amazon Kindle_v8.24.1.0_apkpure.com
INFO : loading ...
INFO : Can't find 'R' class in app package: com.amazon.kindle
INFO : App 'R' class not found, put all resources ids into : 'com.amazon.kindle.R'

jadx

@jpstotz jpstotz added bug Core Issues in jadx-core module labels Jun 10, 2020
@jpstotz
Copy link
Collaborator Author

jpstotz commented Jun 11, 2020

@skylot Thanks for fixing this problem. The new unstable version now correctly loads all classes again.

While playing around with the new unstable version I noticed something strange: On my Windows system the jadx-gui-dev.exe versions now ignore the configured maximum heap size. No matter what is configured in build.gradle Jadx ends up with 1GB maximum heap (on a system with 16GB RAM installed).

Only if I completely disable the heap configuration of Launch4j (results in 3.99GB max heap) or if I create a jadx-gui-dev.l4j.ini and override the max heap value using this config file I can get a maximum heap size that is different to 1GB.

When I start jadx-gui-dev.exe in debug mode using jadx-gui-dev.exe --l4j-debug I get the following log:

Version:	3.12
CmdLine:	C:\IntelliJ-projects\jadx\jadx-gui\build\launch4j\jadx-gui-dev.exe --l4j-debug
WOW64:		yes
Working dir:	C:\IntelliJ-projects\jadx\jadx-gui\build\launch4j\.
Java min ver:	1.008.000
Java max ver:	
Substitute:	JAVA_HOME = C:\Program Files\AdoptOpenJDK\jdk-11.0.7.10-hotspot\
Bundled JRE:	C:\Program Files\AdoptOpenJDK\jdk-11.0.7.10-hotspot\
Check launcher:	C:\Program Files\AdoptOpenJDK\jdk-11.0.7.10-hotspot\bin\javaw.exe (OK)
Heap -Xms:	Requested 0 MB / 5%, Available: 9723 MB, Heap size: 486 MB
Heap limit:	Reduced 6806 MB heap size to 32-bit maximum 1024 MB
Heap -Xmx:	Requested 4096 MB / 70%, Available: 9723 MB, Heap size: 1024 MB
Main class:	jadx.gui.JadxGUI
Add classpath:	lib\jadx-gui-dev-all.jar
Launcher:	C:\Program Files\AdoptOpenJDK\jdk-11.0.7.10-hotspot\bin\javaw.exe
Launcher args:	-Xms486m -Xmx1024m -Dawt.useSystemAAFontSettings=lcd -Dswing.aatext=true -XX:+UseG1GC -classpath "C:\IntelliJ-projects\jadx\jadx-gui\build\launch4j\jadx-gui-dev.exe;lib\jadx-gui-dev-all.jar" jadx.gui.JadxGUI
Args length:	207/32768 chars
Exit code:	0

It seems like for an unknown reason launch4j thinks that the used JRE is a 32bit one.

Looking at the available configuration options I found out that I can avoid this problem by adding the configuration option bundledJre64Bit = true. Afterwards the created Launch4j exe wrapper again applies the correct heap size (I will provide a PR for that).

After some more tests tests I identified commit c62039f as the problem source.

skylot added a commit that referenced this issue Jun 11, 2020
Signed-off-by: Skylot <skylot@gmail.com>
@skylot
Copy link
Owner

skylot commented Jun 11, 2020

@jpstotz I found a root cause of the issue: during shadow jar build plugins service files overwrite each other and only one plugin left to load. I fix this by the additional option to shadowJar plugin.

@jpstotz jpstotz added GUI Issues in jadx-gui module and removed Core Issues in jadx-core module labels Jun 11, 2020
@skylot
Copy link
Owner

skylot commented Jul 11, 2020

Looks like all issues fixed here, closing.

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

No branches or pull requests

2 participants