mcbegamerxx954 / draco-injector

Automatic minecraft apk patcher
15 stars 2 forks source link

Not consistent behaviour among all devices #7

Open AkemiFurukawa91 opened 1 month ago

AkemiFurukawa91 commented 1 month ago

Patched apk file produced by draco injector is behaving differently in different devices, here are a few I can list:

  1. On Redmi note 12 4g (6/128, Snapdragon 685, Adreno 610, Android 14) it works usably, even external storage doesn't cause issues. Sometimes terrain shading or entity shading gets messed up but it's fixed after putting Minecraft in background and reopening it.
  2. On Oppo A12 (3/32, Mediatek Helio P35, PowerVR GE8320, Android 9) it works but not consistent behaviour, external storage is causing issues which is fixed by keeping to application storage and never switching. Also that same shading issue happens here as well, with same fix.
  3. Other people whom I have contacted over discord said that, for some it keeps crashing, for some shader doesn't even load no matter what.

Please fix these issues asap. Also are there any social media platforms developers can be contacted directly?

atashi764 commented 1 month ago

I mixed up some mods so can't tell my experience right away... i will test one Redmi 8A (A14), Redmi 8 (A13) and realme c11 (A10) and let you know the results.

atashi764 commented 1 month ago

doesn't request storage permission on A13. had to grant it in app info

mcbegamerxx954 commented 1 month ago

Patched apk file produced by draco injector is behaving differently in different devices, here are a few I can list:

  1. On Redmi note 12 4g (6/128, Snapdragon 685, Adreno 610, Android 14) it works usably, even external storage doesn't cause issues. Sometimes terrain shading or entity shading gets messed up but it's fixed after putting Minecraft in background and reopening it.
  2. On Oppo A12 (3/32, Mediatek Helio P35, PowerVR GE8320, Android 9) it works but not consistent behaviour, external storage is causing issues which is fixed by keeping to application storage and never switching. Also that same shading issue happens here as well, with same fix.
  3. Other people whom I have contacted over discord said that, for some it keeps crashing, for some shader doesn't even load no matter what.

Please fix these issues asap. Also are there any social media platforms developers can be contacted directly?

mcbegamerxx954 commented 1 month ago

Ty for reporting For those 3 issues: 1- that needs debugging, seems like mc always saves pack data after loading, maybe slowing down mc loading will help 2- Bugfix is almost done 3- I think i know what causes it maybe i should switch to shadowhook

atashi764 commented 1 month ago

that;s so nice of you @mcbegamerxx954

AkemiFurukawa91 commented 1 month ago

Thanks! Also for context, when (1) happens, it loads vanilla terrain and/or vanilla entity shading.

Also are there any social media platforms developers can be contacted directly?

Is there a discord server or something? Your repo was first mentioned in "Newb community" discord server, and as an admin of "Aerith Gray's Creations" server I also made a thorough step by step patching guide with screen recordings. So I guess contacting via discord may help popularizing this repo.

mcbegamerxx954 commented 1 month ago

Ok so issue n2 is fixed (tested with vphonegaga and main phone), would like someone testing it on a real device with this bug

mcbegamerxx954 commented 1 month ago

Issue 1 is very hard to fix, redirector is near instant so maybe its just because mc did not load the resource, the redirector forced it to, so mc did not prepare the new material bin to load, on ny device i never get empty terrain tho

atashi764 commented 1 month ago

Redmi 8 A13 SD439 draco works, doesn't request storage permission when external is selected. Redmi 8A A14 SD439 draco works, doesn't request storage permission when external is selected.

Realme C11 A10 MTK G35 draco doesn't work, requests storage permission when external is selected. Realme C3 A10 MTK G70 draco doesn't work, requests storage permission when external is selected.

FydeOS w/ A9 Intel Celeron J4005 draco works, didn't check if permission is requested

keep in mind i am using a modified apk that stores External files in /storage/emulated/0/games instead of the Android folder. so it would be better for you to follow the getExternalStoragePath instead of providing fixed destinations. keep in mind this also makes draco not work in work profiles/multi user profiles.

mcbegamerxx954 commented 1 month ago

Redmi 8 A13 SD439 draco works, doesn't request storage permission when external is selected. Redmi 8A A14 SD439 draco works, doesn't request storage permission when external is selected.

Realme C11 A10 MTK G35 draco doesn't work, requests storage permission when external is selected. Realme C3 A10 MTK G70 draco doesn't work, requests storage permission when external is selected.

FydeOS w/ A9 Intel Celeron J4005 draco works, didn't check if permission is requested

keep in mind i am using a modified apk that stores External files in /storage/emulated/0/games instead of the Android folder. so it would be better for you to follow the getExternalStoragePath instead of providing fixed destinations. keep in mind this also makes draco not work in work profiles/multi user profiles.

using GetExternalStoragePath might be possible at the cost of needing to add code to dex files to allow for jni (that function needs android context, which is tricky and unreliable to get without getting it from java), multi user profiles are handled by the path system without jni usage

AkemiFurukawa91 commented 1 month ago

keep in mind i am using a modified apk that stores External files in /storage/emulated/0/games instead of the Android folder. so it would be better for you to follow the getExternalStoragePath instead of providing fixed destinations. keep in mind this also makes draco not work in work profiles/multi user profiles.

How do you do that? Tbh that would be very helpful since accessing Android/data folder is not something I want to do everytime I need to access game files.

atashi764 commented 1 month ago

keep in mind i am using a modified apk that stores External files in /storage/emulated/0/games instead of the Android folder. so it would be better for you to follow the getExternalStoragePath instead of providing fixed destinations. keep in mind this also makes draco not work in work profiles/multi user profiles.

How do you do that? Tbh that would be very helpful since accessing Android/data folder is not something I want to do everytime I need to access game files.

use apk from here. it does absolutely what you want but kinda buggy implementation

https://bbk.endyun.ltd/od/1.21.0

image

you may want to use a translator.

mcbegamerxx954 commented 1 month ago

Redmi 8 A13 SD439 draco works, doesn't request storage permission when external is selected. Redmi 8A A14 SD439 draco works, doesn't request storage permission when external is selected.

Realme C11 A10 MTK G35 draco doesn't work, requests storage permission when external is selected. Realme C3 A10 MTK G70 draco doesn't work, requests storage permission when external is selected.

FydeOS w/ A9 Intel Celeron J4005 draco works, didn't check if permission is requested

keep in mind i am using a modified apk that stores External files in /storage/emulated/0/games instead of the Android folder. so it would be better for you to follow the getExternalStoragePath instead of providing fixed destinations. keep in mind this also makes draco not work in work profiles/multi user profiles.

Implemented, but please check if non working devices have valid_known_packs.json in minecraftpe folder on data (private) or files (normal external path)

CallMeSoumya2063 commented 1 month ago

use apk from here. it does absolutely what you want but kinda buggy implementation

https://bbk.endyun.ltd/od/1.21.0

image

you may want to use a translator.

I did find another way, it's not buggy implementation but still it doesn't change the fact that Draco can't load shaders from old storage path. [Didn't try patching with latest changes in Draco yet idk if it works now] My way involves editing two lines in MainActivity.smali and adding storage permission in AndroidManifest.xml. Still doesn't ask for storage permission on startup but it's how far I've done yet. I don't think this last one is draco's fault though, as same thing happens with apk patched by materialbinloader.

atashi764 commented 1 month ago

@CallMeSoumya2063 can you share more details on what exactly you change?

CallMeSoumya2063 commented 1 month ago

@CallMeSoumya2063 can you share more details on what exactly you change?

20240619_174431

20240619_173942

I found this method originally here, had to figure out how to edit since lines were not the same in the example shown there. Mrwang also helped in this. He suggested to set Target SDK version to 29 (Android 10) also. Side note: @Mrwang2408 is now on GitHub.

I used ApkTool M on mobile to edit, but the process is same while using ApkTool on PC

atashi764 commented 1 month ago

Implemented, but please check if non working devices have valid_known_packs.json in minecraftpe folder on data (private) or files (normal external path)

@mcbegamerxx954 tried x86_64 on chromeos. didn't use path modifier apk (means data goes to android/data/) it did request external storage perm on selecting external. but shaders dont work.

when application is selected it does work.

one thing: is this happening because i modified dex to load lib?

and yeah valid_known_packs.json is in Android/data/com.mojang.minecraftpe/files/minecraftpe

mcbegamerxx954 commented 3 weeks ago

I have finally made some progress, I would like someone to test the new dex method to see if that APK works in those devices with issues, the injector can't do dex injection yet because it's a hard task

atashi764 commented 3 weeks ago

@mcbegamerxx954 tried on realme c11 a10.

found some issues

running the game normally, switching to external, closing the game, importing newb directly and activating it does nothing. have to restart at least once after external is already selected ingame.

running the game with external storage permission given before first launch doesn't load shader no matter how many times you restart the game.

and as always application works fine. will try on chromeos soon.

other than that, when external storage is manually selected.... it doesn't load shader after launching the game after switching. but launching again fixes it.

mcbegamerxx954 commented 3 weeks ago

@mcbegamerxx954 tried on realme c11 a10.

found some issues

running the game normally, switching to external, closing the game, importing newb directly and activating it does nothing. have to restart at least once after external is already selected ingame.

running the game with external storage permission given before first launch doesn't load shader no matter how many times you restart the game.

and as always application works fine. will try on chromeos soon.

other than that, when external storage is manually selected.... it doesn't load shader after launching the game after switching. but launching again fixes it.

If this was first start then it makes sense, but after that it should be fine..? welp, atleast its better to have that bug than have it not load anything at all, going to check if anything needs a restart to work in the code

atashi764 commented 3 weeks ago

yup, it works fine after with some random crashes at initial world rendering.

and just a reminder. draco-injector gives error probably because you overhauled mcber

mcbegamerxx954 commented 3 weeks ago

yup, it works fine after with some random crashes at initial world rendering.

and just a reminder. draco-injector gives error probably because you overhauled mcber

About the patcher error, not really, its a change bedrock devs made to their .so builds that is breaking patching, but i might need a injector overhaul too to support dex (needed for compatible storage support but its not going to be done soon since the only good library to read/write dex and smali is in java)

atashi764 commented 3 weeks ago

kinda off topic: why do devs not update source code for mbinloader and brd properly?

like mbinloader supports 1.21+ but they haven't update their source.

mcbegamerxx954 commented 3 weeks ago

kinda off topic: why do devs not update source code for mbinloader and brd properly?

like mbinloader supports 1.21+ but they haven't update their source.

Perhaps lazyness, I honestly don't know, now that i think about it, draco would work pretty well if i was able to port it to windows (its just a single storage location), but I don't have bedrock for windows to make it

atashi764 commented 3 weeks ago

draco would work pretty well if i was able to port it to windows

so you're telling it's possible? if yes, what kind of modification will it be? on ram or modifying files (should persist unless updated)

i may be able to test for you if you want

mcbegamerxx954 commented 3 weeks ago

draco would work pretty well if i was able to port it to windows

so you're telling it's possible? if yes, what kind of modification will it be? on ram or modifying files (should persist unless updated)

i may be able to test for you if you want

something like the betterdragon injection, also thank you, but testing is not the issue, I need to know some details about bedrock on windows before I'm even able to make a prototype