Skip to content

Commit

Permalink
MobilePlatform: Handle JADs that don't have a valid URI for jars
Browse files Browse the repository at this point in the history
In those cases, we'll revert to loading the jar from the same
directory as the jad. FreeJ2ME shouldn't go looking around for this
on the user's PC for a myriad of reasons.
  • Loading branch information
AShiningRay committed Dec 2, 2024
1 parent 8fed7eb commit 0440d49
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/org/recompile/mobile/MobilePlatform.java
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ public boolean load(String fileName)

String jarUrl = descriptorProperties.getOrDefault("MIDlet-Jar-URL", preparedFileName.replace(".jad", ".jar"));

// We will not support downloading jars from the internet on the fly, unless there is a very good reason to do so.
if (jarUrl.toLowerCase().contains("http:") || jarUrl.toLowerCase().contains("https:"))
{ jarUrl = fileName.replace(".jad", ".jar"); }
// We will not support downloading jars from the internet on the fly, unless there is a very good reason to do so. Also, unless the jad has a URI for loading the jar, ignore the path as well
if (jarUrl.toLowerCase().contains("http:") || jarUrl.toLowerCase().contains("https:") || !jarUrl.toLowerCase().contains("file:"))
{ jarUrl = fileName.replace(".jad", ".jar"); } // Just try getting the jar in the same directory as the jad in those cases.

fileName = jarUrl;
}
Expand Down

0 comments on commit 0440d49

Please sign in to comment.