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

Add com.mojang.Minecraft #160

Closed
wants to merge 9 commits into from

Conversation

@Kekun
Copy link

commented Nov 23, 2017

This should hopefully work but I didn't manage to test it via installation, etc.

"sources": [
{
"type": "git",
"url": "git://anongit.freedesktop.org/xorg/app/xrandr"

This comment has been minimized.

Copy link
@TingPing

TingPing Nov 24, 2017

Member

Don't build from git.

{
/* GTK+ is needed by JavaFX. */
"app-id": "com.mojang.Minecraft",
"runtime": "org.freedesktop.Sdk.Extension.openjdk9",

This comment has been minimized.

Copy link
@TingPing

TingPing Nov 24, 2017

Member

This should be in "sdk-extensions" not set as the runtime.

This comment has been minimized.

"--socket=pulseaudio",
/* Network access */
"--share=network",
"--extra-data=Minecraft.jar:e8d90b2637b141b556670d8460d317aadb6e4f2e644e519995c428800b25f212:280212:280212:http://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar"

This comment has been minimized.

Copy link
@TingPing

TingPing Nov 24, 2017

Member

If you have a recent flatpak there is a new source type that cleans this up. https://github.com/flathub/com.discordapp.Discord/blob/master/com.discordapp.Discord.json#L33-L39

@Kekun Kekun force-pushed the Kekun:com.mojang.Minecraft branch from c452bad to 8e1313e Nov 25, 2017

@Kekun

This comment has been minimized.

Copy link
Author

commented Nov 25, 2017

Thanks! I applied all the fixes you suggested, used the GNOME SDK/Platform and simplified the indentation.

Again, it builds but I didn't run it: having a way to run flatpak-builder --run with the extra data would help.

@Kekun

This comment has been minimized.

Copy link
Author

commented Nov 25, 2017

The Minecraft launcher prints thins in both the terminal and its window:

Bootstrap (v5)
Current time is Nov 25, 2017, 12:42:12 PM
System.getProperty('os.name') == 'Linux'
System.getProperty('os.version') == '4.13.10-1-default'
System.getProperty('os.arch') == 'amd64'
System.getProperty('java.version') == '9'
System.getProperty('java.vendor') == 'Oracle Corporation'
System.getProperty('sun.arch.data.model') == '64'

Downloading: https://s3.amazonaws.com/Minecraft.Download/launcher/launcher.pack.lzma
Exception: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
Downloading: https://s3.amazonaws.com/Minecraft.Download/launcher/launcher.pack.lzma (try 2/10)
Exception: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
Downloading: https://s3.amazonaws.com/Minecraft.Download/launcher/launcher.pack.lzma (try 3/10)
Exception: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
Downloading: https://s3.amazonaws.com/Minecraft.Download/launcher/launcher.pack.lzma (try 4/10)
Exception: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
Downloading: https://s3.amazonaws.com/Minecraft.Download/launcher/launcher.pack.lzma (try 5/10)
Exception: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
Downloading: https://s3.amazonaws.com/Minecraft.Download/launcher/launcher.pack.lzma (try 6/10)
Exception: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
Downloading: https://s3.amazonaws.com/Minecraft.Download/launcher/launcher.pack.lzma (try 7/10)
Exception: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
Downloading: https://s3.amazonaws.com/Minecraft.Download/launcher/launcher.pack.lzma (try 8/10)
Exception: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
Downloading: https://s3.amazonaws.com/Minecraft.Download/launcher/launcher.pack.lzma (try 9/10)
Exception: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
Downloading: https://s3.amazonaws.com/Minecraft.Download/launcher/launcher.pack.lzma (try 10/10)
Exception: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
Unable to download remote file. Check your internet connection/proxy settings.
FATAL ERROR: net.minecraft.bootstrap.FatalBootstrapError: Unable to download while being forced
	at net.minecraft.bootstrap.Bootstrap.execute(Bootstrap.java:95)
	at net.minecraft.bootstrap.Bootstrap.main(Bootstrap.java:381)


Please fix the error and restart.

But if I run it out of the sandbox and then in the sanbox it works. I suppose it is because it downloads the required files in ~/.minecraft and then is fine. Removing ~/.minecraft and starting in the sandbox fails anew.

@Kekun

This comment has been minimized.

Copy link
Author

commented Nov 25, 2017

Here is the output out of the sandbox, for comparison:

Bootstrap (v5)
Current time is Nov 25, 2017 1:51:53 PM
System.getProperty('os.name') == 'Linux'
System.getProperty('os.version') == '4.13.10-1-default'
System.getProperty('os.arch') == 'amd64'
System.getProperty('java.version') == '1.8.0_144'
System.getProperty('java.vendor') == 'Oracle Corporation'
System.getProperty('sun.arch.data.model') == '64'

Downloading: https://s3.amazonaws.com/Minecraft.Download/launcher/launcher.pack.lzma
Got reply in: 411ms
Downloaded 1077,2kb in 0s at 1388,3kb/s
Renaming /home/kekun/.minecraft/launcher.pack.lzma.new to /home/kekun/.minecraft/launcher.pack.lzma
Renamed successfully.
Reversing LZMA on /home/kekun/.minecraft/launcher.pack.lzma to /home/kekun/.minecraft/launcher.pack
Unpacking /home/kekun/.minecraft/launcher.pack to /home/kekun/.minecraft/launcher.jar
Cleaning up /home/kekun/.minecraft/launcher.pack
Starting launcher.
[13:51:57 INFO]: Minecraft Launcher 1.6.84-j (through bootstrap 5) started on linux...
[13:51:57 INFO]: Current time is Nov 25, 2017 1:51:57 PM
[13:51:57 INFO]: System.getProperty('os.name') == 'Linux'
[13:51:57 INFO]: System.getProperty('os.version') == '4.13.10-1-default'
[13:51:57 INFO]: System.getProperty('os.arch') == 'amd64'
[13:51:57 INFO]: System.getProperty('java.version') == '1.8.0_144'
[13:51:57 INFO]: System.getProperty('java.vendor') == 'Oracle Corporation'
[13:51:57 INFO]: System.getProperty('sun.arch.data.model') == '64'
[13:51:57 INFO]: proxy == DIRECT
[13:51:57 INFO]: Refreshing local version list...
[13:51:57 INFO]: Refreshing remote version list...
[13:51:57 INFO]: Refresh complete.
[13:51:57 INFO]: Loaded 0 profile(s); selected '(Default)'
@Kekun

This comment has been minimized.

Copy link
Author

commented Nov 25, 2017

Also, font are ugly, any idea how to fix that? I remember that one between the proprietary and the free JREs work well regarding font, but I dont' remember which one.
capture d ecran de 2017-11-25 13-53-53

@Kekun

This comment has been minimized.

Copy link
Author

commented Nov 25, 2017

The network just doesn't seem to work in the sandbox (I pre-downloaded the launcher out of the sanbox, then ran it in the sandbox and got this when trying to log in):
capture d ecran de 2017-11-25 13-56-20

</screenshot>
</screenshots>
<project_license>LicenseRef-proprietary</project_license>
<developer_name>Mojang AB</developer_name>

This comment has been minimized.

Copy link
@nedrichards

nedrichards Nov 27, 2017

Member

We're encouraging people to add OARS metadata, it's really easy!

This comment has been minimized.

Copy link
@Kekun

Kekun Nov 27, 2017

Author

Thanks, I added them, I also put a proper description.

@nedrichards

This comment has been minimized.

Copy link
Member

commented Nov 27, 2017

The network issue is SSL related I think.

@Kekun Kekun force-pushed the Kekun:com.mojang.Minecraft branch from 8e1313e to 9be5ffa Nov 27, 2017

@nedrichards

This comment has been minimized.

Copy link
Member

commented Nov 28, 2017

bot, build com.mojang.Minecraft

@Kekun Kekun force-pushed the Kekun:com.mojang.Minecraft branch from 9be5ffa to 253d6a4 Nov 28, 2017

@Kekun

This comment has been minimized.

Copy link
Author

commented Nov 28, 2017

@nedrichards

This comment has been minimized.

Copy link
Member

commented Nov 28, 2017

bot, build com.mojang.Minecraft

@Kekun

This comment has been minimized.

Copy link
Author

commented Nov 28, 2017

Great! :) Now all we need is to understand why network doesn't work (I don't understand what you meant by mentioning SSL).

@nedrichards

This comment has been minimized.

Copy link
Member

commented Nov 28, 2017

@Kekun that error message is talking about trustAnchors and invalid algorithms, which is all 'SSL talk' and a bit of idle googling around that suggests something about java's CA certificates (I think java has a different trust store to the main OS).

@Kekun

This comment has been minimized.

Copy link
Author

commented Nov 28, 2017

I tried adding this to the finish-args, it didn't work:

"--env=JAVA_HOME=/app/jre",
"--env=JAVA_BINDIR=/app/jre/bin",
"--env=JAVA_ROOT=/app/jre"
@AsciiWolf

This comment has been minimized.

Copy link
Contributor

commented Dec 10, 2017

It looks like that the OpenJDK trust store is missing or empty.
I have tried adding -Djavax.net.ssl.trustStore=/app/jre/jvm/openjdk-9/lib/security/cacerts to the Minecraft launch command, but unfortunately, no luck.
I believe Debian has ca-certificates-java package for this, so maybe we could use it.

@nedrichards

This comment has been minimized.

Copy link
Member

commented Dec 11, 2017

@AsciiWolf That sounds like the sort of thing every app would need. Should that be part of the JDK package?

@AsciiWolf

This comment has been minimized.

Copy link
Contributor

commented Dec 11, 2017

@nedrichards Yep, I think so. Unfortunately, I don't have that much experience with Java and was not able to fix this.

@Tids

This comment has been minimized.

Copy link

commented Feb 4, 2018

@Kekun

required files in ~/.minecraft and then is fine. Removing ~/.minecraft

You can use

_JAVA_OPTIONS="-Duser.home=${XDG_DATA_HOME}/java"

Minecraft respects this and will download the files to given directory. But still will still create a ".minecraft" folder in it. So minecraft directory in this case would be: ${XDG_DATA_HOME}/java/.minecraft

@nedrichards

This comment has been minimized.

Copy link
Member

commented Feb 5, 2018

bot, build com.mojang.Minecraft

@AsciiWolf

This comment has been minimized.

Copy link
Contributor

commented Oct 25, 2018

I have tried to debug the issue with the game hanging on quit. It looks like that it's the launcher hanging, not the game itself. And it doesn't happen every time. Here are some strace logs, unfortunately not a much relevant information in them:

minecraft_launcher.bad.log (when the game hangs)
minecraft_launcher.good.log (when the game exits correctly)

The only interesting thing in them is this:

wait4(-1, 0x7ffebd5bb900, 0, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) // when the game hangs

wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 2892 // when the game exits correctly

@Kekun Any idea?

@AsciiWolf

This comment has been minimized.

Copy link
Contributor

commented Oct 27, 2018

Maybe this is a bug in Electron itself.

@AsciiWolf

This comment has been minimized.

Copy link
Contributor

commented Dec 27, 2018

@Kekun Any progress?

@Kekun

This comment has been minimized.

Copy link
Author

commented Dec 29, 2018

@AsciiWolf Not from my side, I didn't touch this since ages because the encountered problems go way beyond my understanding of Java and networking. :x I'm happy to leave that to whoever wants to take it over.

@AsciiWolf

This comment has been minimized.

Copy link
Contributor

commented Dec 29, 2018

@Kekun The network issues are already fixed an everything in the game is fully working. :-) The only remaining issue is that the game process hangs on exit for some reason.

@TLATER

This comment has been minimized.

Copy link

commented Dec 31, 2018

@AsciiWolf Could this possibly be merged with that bug? There would more eyes on the issue that way, and it seems relatively minor.

@AsciiWolf

This comment has been minimized.

Copy link
Contributor

commented Dec 31, 2018

@TLATER I don't think it is a good idea to merge this with the bug. It could seem like a minor issue, but the fact that almost every Minecraft instance keeps running on background forever seems like a big problem to me because it can cause slowdowns, crashes and other issues.

@yodatak

This comment has been minimized.

Copy link

commented Jan 2, 2019

I try to find something on their bug tracker maybe i can be interesting to talk to them by twitter or by their bug tracker ?
https://bugs.mojang.com/browse/MC-114835?jql=text%20~%20%22exit%22

And also:
http://hopper.minecraft.net/help/exit-code/

@AsciiWolf

This comment has been minimized.

Copy link
Contributor

commented Apr 30, 2019

New update:

diff --git a/com.mojang.Minecraft.json b/com.mojang.Minecraft.json
index 1dd10d0..76abba1 100644
--- a/com.mojang.Minecraft.json
+++ b/com.mojang.Minecraft.json
@@ -61,22 +61,21 @@
           "type": "extra-data",
           "filename": "Minecraft.tar.gz",
           "url": "https://launcher.mojang.com/download/Minecraft.tar.gz",
-          "sha256": "b0026863e8a7d41d328d831aa223fdb198a96a6bcf980969a7dc065ed29a4f06",
-          "size": 57840610
+          "sha256": "06e7649f702b782fd606361a18ce133e108cc33a11a800abea0ba5f4caba2fe6",
+          "size": 58188591
         },
         {
           "type": "script",
           "dest-filename": "apply_extra",
           "commands": [
               "tar -xf Minecraft.tar.gz",
-              "rm -f Minecraft.tar.gz",
-              "mv minecraft-launcher-* minecraft-launcher"
+              "rm -f Minecraft.tar.gz"
           ]
         },
         {
           "type": "script",
           "commands": [
-            "/app/extra/minecraft-launcher/minecraft-launcher.sh"
+            "/app/extra/minecraft-launcher/minecraft-launcher"
           ],
           "dest-filename": "minecraft"
         },

And I have fantastic news! Minecraft no longer hangs on exit! I have been playing it for last hour and everything seems to work perfectly. Both singleplayer and multiplayer. And no hang when I exit the game. :-) That means that the Minecraft Flatpak is no longer blocked from being published on Flathub.

@LeandroStanger

This comment has been minimized.

Copy link

commented Apr 30, 2019

bot, build com.mojang.Minecraft

@flathubbot

This comment has been minimized.

Copy link

commented Apr 30, 2019

Queued test build for com.mojang.Minecraft.

@flathubbot

This comment has been minimized.

Copy link

commented Apr 30, 2019

Started test build 2919

@flathubbot

This comment has been minimized.

Copy link

commented Apr 30, 2019

Build 2919 successful
To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/2791/com.mojang.Minecraft.flatpakref

@nedrichards nedrichards removed the blocked label Apr 30, 2019

@nedrichards

This comment has been minimized.

Copy link
Member

commented Apr 30, 2019

@AsciiWolf great news! let's get that in there and tested ASAP.

@AsciiWolf

This comment has been minimized.

Copy link
Contributor

commented Apr 30, 2019

@nedrichards Thanks! Don't forget to apply the patch that I provided in my previous comment. :-)

@nedrichards

This comment has been minimized.

Copy link
Member

commented Apr 30, 2019

Indeed. I'll try and take a look at it tomorrow.

@nedrichards

This comment has been minimized.

Copy link
Member

commented May 1, 2019

bot, build com.mojang.Minecraft

@flathubbot

This comment has been minimized.

Copy link

commented May 1, 2019

Queued test build for com.mojang.Minecraft.

@flathubbot

This comment has been minimized.

Copy link

commented May 1, 2019

Started test build 2941

@flathubbot

This comment has been minimized.

Copy link

commented May 1, 2019

Build 2941 successful
To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/2813/com.mojang.Minecraft.flatpakref
@nedrichards

This comment has been minimized.

Copy link
Member

commented May 1, 2019

bot, build com.mojang.Minecraft

@flathubbot

This comment has been minimized.

Copy link

commented May 1, 2019

Queued test build for com.mojang.Minecraft.

@flathubbot

This comment has been minimized.

Copy link

commented May 1, 2019

Started test build 2942

@flathubbot

This comment has been minimized.

Copy link

commented May 1, 2019

Build 2942 successful
To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/2814/com.mojang.Minecraft.flatpakref
@nedrichards

This comment has been minimized.

Copy link
Member

commented May 1, 2019

@nedrichards nedrichards closed this May 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.