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

KnightLauncher does not allow JVM patching of the Steam version under Linux #46

Closed
DeinAlptraum opened this issue Nov 27, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@DeinAlptraum
Copy link

SpiralKnights can be run non-natively on Linux by changing the Steam settings: "Settings" -> "Compatibility" -> "Enable Steam Play for all other titles". This runs very well from my experience so far.
This runs Spiral Knights' Windows version through Steam's Proton compatibility layer. The game files are thus exactly the same and I was able to 64-bit patch the game by simply replacing the java_vm folder in the game files with the extracts of https://lucasallegri.b-cdn.net/knightlauncher/v2/java/windows/7u80/redist.zip. This has been running great without any trouble so far.

I would suggest changing LauncherApp.java line 226-227:

    // Currently Java VM patching is only supported on Windows systems.
    if(!SystemUtil.isWindows()) return false;

to

    // Currently Java VM patching is only supported on Windows systems and Linux installs through Steam.
    if(!SystemUtil.isWindows() && !(SystemUtil.isUnix() && Settings.gamePlatform.startsWith("Steam"))) return false;

to allow JVM patching on both Windows and Linux+Steam.

(sorry for no PR, I couldn't get KL to compile and I don't like to submit code I didn't test)

@lucasluqui lucasluqui self-assigned this Nov 27, 2023
@lucasluqui lucasluqui added the enhancement New feature or request label Nov 27, 2023
@lucasluqui
Copy link
Owner

lucasluqui commented Nov 27, 2023

Fixed in upcoming 2.0 release. I sadly don't have any Linux system available to test the changes but please let me know if things are solved.

@DeinAlptraum
Copy link
Author

As mentioned, KL wouldn't compile for me unfortunately, but I'll test once there's a release

@DeinAlptraum
Copy link
Author

DeinAlptraum commented Nov 27, 2023

I had only tested with 7u80 so far, and it seems that there's some trouble with 8u202 & 8u251: the game crashes with the following error in projectx.log

Exception in thread "main" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at com.lucasallegri.bootstrap.ProjectXBootstrap.main(ProjectXBootstrap.java:78)
Caused by: java.lang.ExceptionInInitializerError
	at javax.crypto.Cipher.getInstance(Cipher.java:518)
	at com.threerings.presents.b.d.a(SourceFile:89)
	at com.threerings.presents.b.d.a(SourceFile:202)
	at com.threerings.presents.client.Client.bG(SourceFile:236)
	at com.threerings.projectx.client.ProjectXApp.<init>(SourceFile:378)
	... 5 more
Caused by: java.lang.SecurityException: Can not initialize cryptographic mechanism
	at javax.crypto.JceSecurity.<clinit>(JceSecurity.java:93)
	... 10 more
Caused by: java.lang.SecurityException: The jurisdiction policy files are not signed by the expected signer! (Policy files are specific per major JDK release.Ensure the correct version is installed.)
	at javax.crypto.JarVerifier.verifyPolicySigned(JarVerifier.java:328)
	at javax.crypto.JceSecurity.loadPolicies(JceSecurity.java:378)
	at javax.crypto.JceSecurity.setupJurisdictionPolicies(JceSecurity.java:323)
	at javax.crypto.JceSecurity.access$000(JceSecurity.java:50)
	at javax.crypto.JceSecurity$1.run(JceSecurity.java:85)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.crypto.JceSecurity.<clinit>(JceSecurity.java:82)
	... 10 more

After uncommenting the line crypto.policy=unlimited on line 829 in java_vm/lib/security/java.security, I was able to start the game normally, for both 8u202 and 8u251
(I tested all of this with a fresh install of SK every time, on the 2.0-PRE1 release)

@lucasluqui lucasluqui reopened this Nov 27, 2023
@lucasluqui
Copy link
Owner

All Java VMs on KL's CDN have been updated to contain this patch, it might take a few hours until the cached versions are updated.

@DeinAlptraum
Copy link
Author

Tested and looks good 👍🏼

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

No branches or pull requests

2 participants