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

ui font and icons are crazy tiny on windows 10 #752

Closed
steelbytes opened this issue Sep 21, 2019 · 14 comments
Closed

ui font and icons are crazy tiny on windows 10 #752

steelbytes opened this issue Sep 21, 2019 · 14 comments

Comments

@steelbytes
Copy link

using the jre that is bundled with android studio 3.5 on windows 10 with a hidpi monitor the ui is ridiculously tiny and hence unusable.

@steelbytes steelbytes changed the title ui size is crazy tiny on windows 10 ui font and icons are crazy tiny on windows 10 Sep 21, 2019
@jpstotz
Copy link
Collaborator

jpstotz commented Sep 21, 2019

The Java Runtime that comes with Android Studio is Java 8. I don't have any experience with Java and high dpi monitors, but from what I have read about it newer Java versions seem to behave better on high dpi monitors. Therefore could you please test to use Java 11 instead (e.g. the installation package provided by AdoptOpenJDK)?

BTW: Which exact Windows version do you use? 1903, 1809 or 1803?

@steelbytes
Copy link
Author

ver 1903 and mixing and matching different java runtimes aint something I really want to try ... not to mention the security issues with maintaing multiple installations

@skylot
Copy link
Owner

skylot commented Sep 22, 2019

I agree with @jpstotz, in java versions from 9 you can add to java options "-Dsun.java2d.uiScale=2". This must be added in jadx-gui.bat to end of DEFAULT_JVM_OPTS like this:

set DEFAULT_JVM_OPTS="-Xms128M" "-Xmx4g" "-Dawt.useSystemAAFontSettings=lcd" "-Dswing.aatext=true" "-XX:+UseG1GC" "-Dsun.java2d.uiScale=2"

@steelbytes if you don't want to install another java version you can try jadx-gui-1.0.0-with-jre-windows.zip bundle which comes with java 11.

@steelbytes
Copy link
Author

@skylot sadly using the download with bundled jre is even worse. although the font size is better, the ui doesn't work: cant see java code when I click on a class in the tree, cant open the class or text search, cant open log viewer, .... completly broken.

yet all these ui things work with the other download but just have scaling issues

@jpstotz
Copy link
Collaborator

jpstotz commented Sep 25, 2019

@skylot Indeed this version does not work correctly just as steelbytes describes.
@steelbytes You can simply download Java 11 from AdoptOpenJDK and use the regular Jadx version. Regarding the Java security updates the situation is not as bad as it may look at a first glance, as long as you only use Java for desktop applications. Most of the discovered vulnerabilities lately in Java apply only if you use Java in an Applet, WebStart or J2EE server environment. Applets and WebStart are no longer available in Java 11, therefore those vulnerabilities are no longer relevant.

@skylot
Copy link
Owner

skylot commented Sep 26, 2019

I fix JRE bundle, looks like some java modules were missing, new bundle: jadx-gui-1.0.0-2-with-jre-windows.zip

@steelbytes
Copy link
Author

@skylot still doesn't work :-(

@jpstotz
Copy link
Collaborator

jpstotz commented Sep 27, 2019

@skylot jadx-gui-1.0.0-2-with-jre-windows.zip fails because it fails to load it's settings:

ERROR - Error load settings
java.lang.RuntimeException: Unable to invoke no-args constructor for class jadx.gui.settings.WindowLocation. Registering an InstanceCreator with Gson for this type may fix this problem.
        at com.google.gson.internal.ConstructorConstructor$14.construct(ConstructorConstructor.java:228)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:212)
        at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
        at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:187)
        at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:145)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)
        at com.google.gson.Gson.fromJson(Gson.java:927)
        at com.google.gson.Gson.fromJson(Gson.java:892)
        at com.google.gson.Gson.fromJson(Gson.java:841)
        at com.google.gson.Gson.fromJson(Gson.java:813)
        at jadx.gui.settings.JadxSettingsAdapter.fromString(JadxSettingsAdapter.java:88)
        at jadx.gui.settings.JadxSettingsAdapter.load(JadxSettingsAdapter.java:59)
        at jadx.gui.JadxGUI.main(JadxGUI.java:20)
Caused by: java.lang.UnsupportedOperationException: Cannot allocate class jadx.gui.settings.WindowLocation
        at com.google.gson.internal.UnsafeAllocator$4.newInstance(UnsafeAllocator.java:104)
        at com.google.gson.internal.ConstructorConstructor$14.construct(ConstructorConstructor.java:225)
        ... 13 common frames omitted

In the end this results in a NullPointerException with nearly every Jadx gui function:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at jadx.gui.ui.codearea.AbstractCodeArea.loadCommonSettings(AbstractCodeArea.java:105)
        at jadx.gui.ui.codearea.CodeArea.getDefaultArea(CodeArea.java:112)

@skylot
Copy link
Owner

skylot commented Sep 29, 2019

Another try: jadx-gui-1.0.0-3-with-jre-windows.zip.
This time I change code to add default constructors to classes serialized with GSON (check jre-bundle branch).

@steelbytes
Copy link
Author

@skylot much better, thank you :-)

now if only I can get fixes for some decompiler errors (see other recent git issues opened and commented on by me) .....

@rekire
Copy link

rekire commented Feb 8, 2020

Can we reopen this? It still doesn't work with Java 1.8, but with Java 11 it works.

@steelbytes
Copy link
Author

@rekire are you using the download with the bundled jre?

@rekire
Copy link

rekire commented Feb 11, 2020

No the classic one, with the batch files

@jpstotz
Copy link
Collaborator

jpstotz commented Feb 11, 2020

Java 1.8 has no high-dpi support and most likely will never have. Therefore your problems are not unexpected.

You have to use Java 11. The simplest way is to use the Jadx version with integrated JRE.

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

No branches or pull requests

4 participants