Skip to content

Commit

Permalink
[devel] wip java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
SolDev69 committed Apr 9, 2024
1 parent 838d9f5 commit 6d4ceb7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ jobs:
branch: buildjre8
name: jre8-pojav

- name: Get JRE17
- name: Get JRE21
uses: dawidd6/action-download-artifact@v2
with:
workflow: build.yml
path: app_solcraftlauncher/src/main/assets/components/jre-new
workflow_conclusion: success
repo: PojavLauncherTeam/android-openjdk-build-multiarch
branch: buildjre17
name: jre17-pojav
branch: buildjre21
name: jre21-pojav

- uses: gradle/gradle-build-action@v2
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

import java.io.IOException;

public class JRE17Util {
public static final String NEW_JRE_NAME = "Internal-17";
public class JRE21Util {
public static final String NEW_JRE_NAME = "Internal-21";
public static boolean checkInternalNewJre(AssetManager assetManager) {
String launcher_jre17_version;
String installed_jre17_version = MultiRTUtils.__internal__readBinpackVersion(NEW_JRE_NAME);
Expand All @@ -35,8 +35,8 @@ private static boolean unpackJre17(AssetManager assetManager, String rt_version)
MultiRTUtils.installRuntimeNamedBinpack(
assetManager.open("components/jre-new/universal.tar.xz"),
assetManager.open("components/jre-new/bin-" + archAsString(Tools.DEVICE_ARCHITECTURE) + ".tar.xz"),
"Internal-17", rt_version);
MultiRTUtils.postPrepare("Internal-17");
"Internal-21", rt_version);
MultiRTUtils.postPrepare("Internal-21");
return true;
}catch (IOException e) {
Log.e("JRE17Auto", "Internal JRE unpack failed", e);
Expand Down Expand Up @@ -67,18 +67,18 @@ public static boolean installNewJreIfNeeded(Activity activity, JMinecraftVersion

String appropriateRuntime = MultiRTUtils.getNearestJreName(versionInfo.javaVersion.majorVersion);
if (appropriateRuntime != null) {
if (JRE17Util.isInternalNewJRE(appropriateRuntime)) {
JRE17Util.checkInternalNewJre(activity.getAssets());
if (JRE21Util.isInternalNewJRE(appropriateRuntime)) {
JRE21Util.checkInternalNewJre(activity.getAssets());
}
minecraftProfile.javaDir = Tools.LAUNCHERPROFILES_RTPREFIX + appropriateRuntime;
LauncherProfiles.load();
} else {
if (versionInfo.javaVersion.majorVersion <= 17) { // there's a chance we have an internal one for this case
if (!JRE17Util.checkInternalNewJre(activity.getAssets())){
if (!JRE21Util.checkInternalNewJre(activity.getAssets())){
showRuntimeFail(activity, versionInfo);
return false;
} else {
minecraftProfile.javaDir = Tools.LAUNCHERPROFILES_RTPREFIX + JRE17Util.NEW_JRE_NAME;
minecraftProfile.javaDir = Tools.LAUNCHERPROFILES_RTPREFIX + JRE21Util.NEW_JRE_NAME;
LauncherProfiles.load();
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import net.kdt.pojavlaunch.JAssetInfo;
import net.kdt.pojavlaunch.JAssets;
import net.kdt.pojavlaunch.JMinecraftVersionList;
import net.kdt.pojavlaunch.JRE17Util;
import net.kdt.pojavlaunch.JRE21Util;
import net.kdt.pojavlaunch.R;
import net.kdt.pojavlaunch.Tools;
import net.kdt.pojavlaunch.mirrors.DownloadMirror;
Expand Down Expand Up @@ -203,7 +203,7 @@ private boolean downloadAndProcessMetadata(Activity activity, JMinecraftVersionL
throw new IOException("Unable to read Version JSON for version " + versionName);
}

if(activity != null && !JRE17Util.installNewJreIfNeeded(activity, verInfo)){
if(activity != null && !JRE21Util.installNewJreIfNeeded(activity, verInfo)){
return false;
}

Expand Down

0 comments on commit 6d4ceb7

Please sign in to comment.