zb3 / freej2me

A free cross-platform desktop J2ME emulator with 3D support from J2ME-Loader
Other
13 stars 2 forks source link

game report not running on the phone #4

Open AveyondFly opened 2 months ago

AveyondFly commented 2 months ago

Hi,

Wish you have a good weekend. Today, when running a horror java game as following, I find the game reports it is not running on the phone. ss1.jar.txt

I observed the execption as following:

java.io.IOException: Class not found Error Adapting Class XMessage java.io.IOException: Class not found Error Adapting Class XConnection java.io.IOException: Class not found Error Adapting Class emulator.Emulator java.io.IOException: Class not found

It is very simple to reproduce the issue, just press 5 and issue can be reproduced. Meanwhile, the game can be started successfully with j2me-loader from android.

Thanks.

zixing131 commented 2 months ago

you can modify the jar /* renamed from: a */ public static boolean m240a() { boolean z = true; if (C0020at.f419j) { String appProperty = Main.self.getAppProperty("copyRight"); if (appProperty == null || !(appProperty == null || appProperty.equals("0"))) { if (Runtime.getRuntime().totalMemory() == 8000000) { z = false; } if (!m236b()) { z = false; } } } return z; }

this is the code where check phone runtime , you can make this function always return true. I will upload the modified jar after .

zixing131 commented 2 months ago

https://zixing.lanzouq.com/i0vAU1w7elyf

this is the modified jar . you can play it on freej2me .

AveyondFly commented 1 month ago

https://zixing.lanzouq.com/i0vAU1w7elyf

this is the modified jar . you can play it on freej2me .

Sorry, I missed the message. Yes, that works. But it would still be better if it can be supported natively as j2me-loader. Hope can be addressed simply from j2me side.

AveyondFly commented 1 month ago

you can modify the jar /* renamed from: a */ public static boolean m240a() { boolean z = true; if (C0020at.f419j) { String appProperty = Main.self.getAppProperty("copyRight"); if (appProperty == null || !(appProperty == null || appProperty.equals("0"))) { if (Runtime.getRuntime().totalMemory() == 8000000) { z = false; } if (!m236b()) { z = false; } } } return z; }

this is the code where check phone runtime , you can make this function always return true. I will upload the modified jar after .

From what you wrote here, I tried with "-ap copyRight=0" and it works. Thanks. But still pretty confused why j2me-loader works without such code.

Maybe C0020at.f419j can tell the truth.

zb3 commented 1 month ago

Apologies for not responding earlier, but github didn't send me any notifications.. :(

The game code probably attempts to check if it's running inside an emulator (and refuses to run if emulator detected) by detecting the presence of some classes. While these classes don't exist here (and they don't exist in J2ME-Loader too), the code should pass. But the problem was that FreeJ2ME is not throwing the ClassNotFoundException exception..

Now I'm not sure what to do, because throwing the exception could potentially break some games.. this one is unusual because it expects a class to not exist..

AveyondFly commented 3 weeks ago

Apologies for not responding earlier, but github didn't send me any notifications.. :(

The game code probably attempts to check if it's running inside an emulator (and refuses to run if emulator detected) by detecting the presence of some classes. While these classes don't exist here (and they don't exist in J2ME-Loader too), the code should pass. But the problem was that FreeJ2ME is not throwing the ClassNotFoundException exception..

Now I'm not sure what to do, because throwing the exception could potentially break some games.. this one is unusual because it expects a class to not exist..

Hi, thank you so much for the reply. I agree this would be very hard to debug. Meanwhile, FYI, I ported another freej2me to my retro-console and that one also passes the emulator checking. https://github.com/AveyondFly/freej2me-miyoomini