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

Working around new GL loading method in v1.18.3x #687

Closed
jasta opened this issue May 10, 2022 · 16 comments
Closed

Working around new GL loading method in v1.18.3x #687

jasta opened this issue May 10, 2022 · 16 comments
Labels
enhancement New feature or request

Comments

@jasta
Copy link

jasta commented May 10, 2022

Looks like v1.18.3x (specifically I'm looking at v1.18.30.04 and v1.18.32.02) are no longer using a GLAD generated shim to load GL. This appears to be creating problems that show manifest as:

00:28:17 Error [MinecraftUtils] Failed to load Minecraft: dlopen failed: cannot locate symbol "glGetIntegerv" referenced by "/home/jasta/.local/share/mcpelauncher/versions/1.18.32.02/lib/x86_64/libminecraftpe.so"...

Full context here: https://gist.github.com/jasta/f3aeee7b83620f576c5d01fd7ac32d11

This error can only be realized after applying patches to get further along in the loading process, specifically:

minecraft-linux/minecraft-imported-symbols#1
minecraft-linux/libc-shim#11

Looks like this should be a solveable problem but I'm not quite sure how to proceed or what the methodology has been up to this point. I do see that libGLESv1_CM and v2 are loaded, which should contain these symbols, so I'm at a loss for why things aren't working or why they worked before when the glad loader was there.

Any help would be greatly appreciated, happy to do the legwork myself just need a bit of a clue where to get started.

@jasta jasta added the enhancement New feature or request label May 10, 2022
@jasta
Copy link
Author

jasta commented May 10, 2022

Actually, looks like we just have to undo this: minecraft-linux/mcpelauncher-core@d73cac9. Definitely gets further along but then crashes.

@ChristopherHX
Copy link
Member

ChristopherHX commented May 10, 2022

Definitely gets further along but then crashes.

Exactly like this early snapshot
https://github.com/minecraft-linux/mcpelauncher-manifest/tree/snapshot/renderdragon

...I know how to get rid of the blackscreen and crash on Linux, but since macOS still has a blackscreen after my changes I haven't disclosed it yet. I'm careful, since someone modifed this launcher to open unlicensed copies of the game including distributing them without contributing meaningful work

Things I had to do

  • implement missing c symbols ( More like stubs )
  • reenable providing libGLESv2.so symbols, breaks glcore patch
  • disable direct keyboard input via symbols, crashs in 1.19 after pressing enter / no keys are recognized
  • Implement fake java MainActivity.GetScreen/WindowWith/Height, to make bgfx initialize the fake egl and itself, it skips init for a resulution of 0x0 px. Found that with gdb / bgfx sources.
  • fix some fakeegl return values
  • make main thread graphics ctx non current. I forget that before, which lead to an black screen without crashs or init loop
  • make render thread graphics ctx current, while fake egl is initialized by bgfx

@jasta
Copy link
Author

jasta commented May 10, 2022

Interesting, I'll take a look there. I was wondering when looking at all this in a more modern light if it perhaps makes sense to switch back to libhybris which appears to have overall more comprehensive EGL/GL support and a more active community, especially around the graphics layer. I am not sure why it was dropped originally but at least it could be worth a shot to re-examine. Might also make the project a bit easier to update in the future.

Regarding the copyright issue, I'm honestly not so sure that you should be directly concerned about this as your work is totally orthogonal to the copyright issues at play. The main intent clearly is to just be able to play the game on other platforms and technically speaking it's much more like a highly specialized version of Wine which stubs out Windows APIs instead of Android ones to play games. Wine is obviously wildly successful and even embraced by Valve as the main engine behind Steam Linux (aka Proton), despite that it can be used in much the same way as your project to illegally pirate games.

It's obviously your call in the end, but secrecy around your work has made it harder for people like me at least to respond to the community and takeover fixing new issues.

@jasta
Copy link
Author

jasta commented May 10, 2022

Oh one thing I wanted to ask separately as well is what your workflow looks like and if you're willing to document that somewhere so folks like me can more easily follow in your footsteps going forward. I'm somewhat familiar with reverse engineering stuff but mostly in the context of other languages / tools so it's a steep learning curve to first reverse engineer from your commits what it is you're doing then try to reverse engineer Minecraft itself next :)

For example, how did you discover these APIs were in play: minecraft-linux/mcpelauncher-client@1e44372...3647bc5#diff-ab896ce8079e4678dcf81da008fe347e079ae2c7e680e70c439285c45fc84573 ?

@jasta
Copy link
Author

jasta commented May 10, 2022

Hmm, I still get the black screen and the same behaviour I saw before with my local hacks using
https://github.com/minecraft-linux/mcpelauncher-manifest/tree/snapshot/renderdragon. This is on Ubuntu 20.04. It would be super helpful at this stage to know more about your process so I can dig further myself.

@ChristopherHX
Copy link
Member

ChristopherHX commented May 10, 2022

switch back to libhybris which appears to have overall more comprehensive EGL/GL support

I think it has missing upsteam macOS support and this is the platform with all EGL issues of this launcher.

I'm honestly not so sure that you should be directly concerned

I'm concerned to see my github username / repository to be mentioned by users who redistribute the game. The first google search results about this launcher, were how to use this launcher to pirate the game. This launcher disables the license check of the android game, this fact was abused.

secrecy around your work

I'm not someone who writes documentation for fun. This is real secrecy minecraft-linux/minecraft-symbols@1385ebf do you know were the addresses are from? I have no idea. I forked the launcher in 2019, deleted a bunch of code and debugged the game week for week until I saw the home screen.

Oh one thing I wanted to ask separately as well is what your workflow looks like

Sorry I can't describe that, It's literally hours of trial and error especially for the recent change. I was lucky enough to get something barely working.
I barely documented something here
https://mcpelauncher.readthedocs.io/en/latest/jni.html. I even thought to never find a way to get rid of the black screen.

For example, how did you discover these APIs were in play:

This was just my current working directory before pushing the unfinished branch. I was trying to fix the marketplace, but got nowhere. You can decompile the classes*.dex files with jd-gui. The java native interface is my own library built to make this launcher less dependent of deleted debugging symbols.

I still get the black screen and the same behaviour I saw before with my local hacks using
https://github.com/minecraft-linux/mcpelauncher-manifest/tree/snapshot/renderdragon

That's expected, the version of the launcher with the fix is not publicy available.

There are a lot of different broken things like marketplace / skins not loading, which don't require 1.18.30 to test.

@jasta
Copy link
Author

jasta commented May 11, 2022

Thanks for the responses.

I'm concerned to see my github username / repository to be mentioned by users who redistribute the game. The first google search results about this launcher, were how to use this launcher to pirate the game. This launcher disables the license check of the android game, this fact was abused.

I hadn't considered the play store authenticity checks, yeah, that definitely puts the project in a tough spot as even Wine for example doesn't touch the Minecraft Windows Bedrock edition for this reason it seems (it's distributed through the Microsoft store and they don't have a way to comply with the authenticity checks there). I do wonder what would be required to not fake those checks but actually comply with them, the same way an emulator can. I'm actually an Android developer and know the implementation fairly well, especially that it's not "truly" secure and should be implementable by third party projects like this one, though I do wonder if it's worth it. Does seem like something libhybris may be interested in though.

I still get the black screen and the same behaviour I saw before with my local hacks using
https://github.com/minecraft-linux/mcpelauncher-manifest/tree/snapshot/renderdragon

That's expected, the version of the launcher with the fix is not publicy available.

Not sure I understand, I used the renderdragon branch but got the same results as with my random crappier hacks. Did you mean you haven't published even to that branch yet the fix to the black screen? I am motivated to try to fix some of these issues, but I'm feeling a bit stuck now since I don't even know how to uncover what the next round of issues are. I can't help, sadly, with Mac OS X support though as I don't have any Mac machines and know almost nothing about their software anyway.

@ChristopherHX
Copy link
Member

Did you mean you haven't published even to that branch yet the fix to the black screen?

Yes, it isn't published. You can DM me on discord, to gain access of prerelease content hosted somewhere else. I haven't got anything working in the release week.

@xorik
Copy link

xorik commented May 15, 2022

Hey, @ChristopherHX. Is it possible to support your work?

Maybe you can open patreon or github sponsorship? Or maybe you need help with testing/debugging? I think lot of people, who use this launcher are ready to support you (including myself).

Also I can try helping with code or maybe with documentation, but I work mostly work with web (but I have some c/c++ knowledge).

It's shitty, that your code is used to pirate the game, but it's not your fault.

I use the launcher to play with my daughter. She has an iPad, and when minecraft is updated on iPad, we can't play together anymore.

@wertie3020
Copy link

yes i wood like to support to
do you have a monero address?

@cKerenskySE
Copy link

I'd be willing to support a Patreon. I've got a steam deck, and bought a copy of the android version to run.
It's unfortunately people are willing to encourage illegal copies of a game, ruins it for everyone.

@jempiere
Copy link

Me as well! I can see that a lot of work and passion has gone into this project, and I would love to help support you financially seeing as I'm not a huge help in this field of programming.

All of us appreciate the work you're doing!

@CarJem
Copy link

CarJem commented May 25, 2022

P.S. This is just my opinion, I'm not trying to start an argument.

A Patreon would be great... but in truth... that could end up becoming a legal problem in itself.

While I have seen great things come from this launcher, I believe this should be the breaking point for the silence. We have been asking for 4 long years for Mojang to do what does not appear to be a task that should have had to take that long. I understand that Mojang has its priorities but the fact that the game runs on macOS through the education edition should be enough proof that there isn't an overly complicated reason why Bedrock doesn't officially come to OSX and Linux.

5171 votes have been submitted to the tried and tested feedback site's biggest suggestion on this issue... and countless more have been made on similar suggestions.

And Besides that, when was legitimately the last time Minecraft came to a new platform? The Nintendo Switch?
I personally say that we need to start speaking louder... #BedrockOnUnixOrBust

@imatallginger
Copy link

Sorry to keep poking at this thread, but is there any possible ETA until a release that supports 1.18.3? Been wanting to get this to play with friends, but not going to make the purchase until a confirmed release is on the way or has arrived.

@CarJem
Copy link

CarJem commented May 26, 2022

Sorry to keep poking at this thread, but is there any possible ETA until a release that supports 1.18.3? Been wanting to get this to play with friends, but not going to make the purchase until a confirmed release is on the way or has arrived.

Sadly, development on this launcher was recently (more or less) indefinitely stalled and it's future is uncertain

@ChristopherHX
Copy link
Member

Fixed for linux and crashs in external dependencies on macOS.

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

8 participants