diff --git a/FCL/build.gradle b/FCL/build.gradle index 034e5b53..11de5ad1 100644 --- a/FCL/build.gradle +++ b/FCL/build.gradle @@ -4,12 +4,12 @@ plugins { android { namespace 'com.tungsten.fcl' - compileSdk 32 + compileSdk 33 defaultConfig { applicationId "com.tungsten.fcl" minSdk 26 - targetSdk 32 + targetSdk 33 versionCode 1 versionName "1.0.0" @@ -37,10 +37,10 @@ dependencies { implementation 'org.apache.commons:commons-compress:1.21' implementation 'org.tukaani:xz:1.8' implementation 'com.google.code.gson:gson:2.10' - implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.appcompat:appcompat:1.6.0' implementation 'com.google.android.material:material:1.7.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.4' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } \ No newline at end of file diff --git a/FCL/src/main/AndroidManifest.xml b/FCL/src/main/AndroidManifest.xml index 5cdfa618..fc3b4b1a 100644 --- a/FCL/src/main/AndroidManifest.xml +++ b/FCL/src/main/AndroidManifest.xml @@ -60,7 +60,7 @@ android:theme="@style/Theme.FoldCraftLauncher" android:extractNativeLibs="true" android:allowNativeHeapPointerTagging="false" - tools:targetApi="32"> + tools:targetApi="33"> { if (profile == Profiles.getSelectedProfile()) { List children = repository.getDisplayVersions() @@ -65,7 +64,6 @@ public class VersionList { return new VersionListItem(profile, version.getId(), libraries.toString(), repository.getVersionIconImage(version.getId())); }) .collect(Collectors.toList()); - children.forEach(VersionListItem::checkSelection); if (profile == Profiles.getSelectedProfile()) { Schedulers.androidUIThread().execute(() -> { VersionListAdapter adapter = new VersionListAdapter(context, (ArrayList) children); @@ -75,13 +73,7 @@ public class VersionList { progressBar.setVisibility(View.GONE); }); - profile.selectedVersionProperty().addListener(listenerHolder.weak((a, b, newValue) -> Schedulers.androidUIThread().execute(() -> { - children.forEach(it -> it.selectedProperty().set(false)); - children.stream() - .filter(it -> it.getVersion().equals(newValue)) - .findFirst() - .ifPresent(it -> it.selectedProperty().set(true)); - }))); + children.forEach(it -> it.selectedProperty().bind(Bindings.createBooleanBinding(() -> profile.selectedVersionProperty().get().equals(it.getVersion()), profile.selectedVersionProperty()))); } } }).start(); diff --git a/FCL/src/main/java/com/tungsten/fcl/ui/version/VersionListAdapter.java b/FCL/src/main/java/com/tungsten/fcl/ui/version/VersionListAdapter.java index 644dc9dc..7c59e618 100644 --- a/FCL/src/main/java/com/tungsten/fcl/ui/version/VersionListAdapter.java +++ b/FCL/src/main/java/com/tungsten/fcl/ui/version/VersionListAdapter.java @@ -59,7 +59,6 @@ public class VersionListAdapter extends FCLAdapter { viewHolder = (ViewHolder) view.getTag(); } VersionListItem versionListItem = list.get(i); - versionListItem.checkSelection(); viewHolder.radioButton.checkProperty().unbind(); viewHolder.radioButton.checkProperty().bind(versionListItem.selectedProperty()); viewHolder.icon.setBackground(versionListItem.getDrawable()); diff --git a/FCL/src/main/java/com/tungsten/fcl/ui/version/VersionListItem.java b/FCL/src/main/java/com/tungsten/fcl/ui/version/VersionListItem.java index bb00fc3c..a29c3379 100644 --- a/FCL/src/main/java/com/tungsten/fcl/ui/version/VersionListItem.java +++ b/FCL/src/main/java/com/tungsten/fcl/ui/version/VersionListItem.java @@ -45,10 +45,6 @@ public class VersionListItem { return selected; } - public void checkSelection() { - selected.set(version.equals(profile.getSelectedVersion())); - } - public boolean canUpdate() { return isModpack; } diff --git a/FCLCore/build.gradle b/FCLCore/build.gradle index 2d482c5d..ff520898 100644 --- a/FCLCore/build.gradle +++ b/FCLCore/build.gradle @@ -4,11 +4,11 @@ plugins { android { namespace 'com.tungsten.fclcore' - compileSdk 32 + compileSdk 33 defaultConfig { minSdk 26 - targetSdk 32 + targetSdk 33 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -38,9 +38,9 @@ dependencies { implementation 'com.moandjiezana.toml:toml4j:0.7.2' implementation 'org.jenkins-ci:constant-pool-scanner:1.2' implementation 'com.google.code.gson:gson:2.10' - implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.appcompat:appcompat:1.6.0' implementation 'com.google.android.material:material:1.7.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.4' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } \ No newline at end of file diff --git a/FCLCore/src/main/java/com/tungsten/fclcore/launch/DefaultLauncher.java b/FCLCore/src/main/java/com/tungsten/fclcore/launch/DefaultLauncher.java index ce3f2225..995f5d36 100644 --- a/FCLCore/src/main/java/com/tungsten/fclcore/launch/DefaultLauncher.java +++ b/FCLCore/src/main/java/com/tungsten/fclcore/launch/DefaultLauncher.java @@ -102,9 +102,9 @@ public class DefaultLauncher extends Launcher { res.addDefault("-Dfml.ignorePatchDiscrepancies=", "true"); // Enable LWJGL debug mode - res.addDefault("-Dorg.lwjgl.util.Debug=","true"); - res.addDefault("-Dorg.lwjgl.util.DebugLoader=","true"); - res.addDefault("-Dorg.lwjgl.util.DebugFunctions=","true"); + res.addDefault("-Dorg.lwjgl.util.Debug=", "true"); + res.addDefault("-Dorg.lwjgl.util.DebugLoader=", "true"); + res.addDefault("-Dorg.lwjgl.util.DebugFunctions=", "true"); // Fix RCE vulnerability of log4j2 res.addDefault("-Djava.rmi.server.useCodebaseOnly=", "true"); @@ -121,8 +121,8 @@ public class DefaultLauncher extends Launcher { res.addDefault("-Dlwjgl.platform=", "FCL"); res.addDefault("-Dorg.lwjgl.opengl.libname=", "${gl_lib_name}"); res.addDefault("-Dfml.earlyprogresswindow=", "false"); - res.addDefault("-Dlwjgl2.width=",options.getWidth()+""); - res.addDefault("-Dlwjgl2.height=",options.getHeight()+""); + res.addDefault("-Dlwjgl2.width=", options.getWidth() + ""); + res.addDefault("-Dlwjgl2.height=", options.getHeight() + ""); List classpath = repository.getClasspath(version); @@ -327,9 +327,6 @@ public class DefaultLauncher extends Launcher { String[] finalArgs = rawCommandLine.toArray(new String[0]); FCLConfig.Renderer renderer = options.getRenderer(); - if (version.getMinimumLauncherVersion() >= 21) { - renderer.setGlVersion("32"); - } FCLConfig config = new FCLConfig(context, FCLPath.LOG_DIR, options.getJava().getVersion() == 8 ? FCLPath.JAVA_8_PATH : FCLPath.JAVA_17_PATH, diff --git a/FCLLibrary/build.gradle b/FCLLibrary/build.gradle index 8dcdfb22..a16bcc9d 100644 --- a/FCLLibrary/build.gradle +++ b/FCLLibrary/build.gradle @@ -4,11 +4,11 @@ plugins { android { namespace 'com.tungsten.fcllibrary' - compileSdk 32 + compileSdk 33 defaultConfig { minSdk 26 - targetSdk 32 + targetSdk 33 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -30,10 +30,10 @@ dependencies { implementation project(path: ':FCLauncher') implementation project(path: ':FCLCore') implementation 'commons-io:commons-io:2.11.0' - implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.appcompat:appcompat:1.6.0' implementation 'com.google.android.material:material:1.7.0' implementation 'androidx.asynclayoutinflater:asynclayoutinflater:1.0.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.4' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } \ No newline at end of file diff --git a/FCLauncher/build.gradle b/FCLauncher/build.gradle index 4dae8e96..31839b65 100644 --- a/FCLauncher/build.gradle +++ b/FCLauncher/build.gradle @@ -4,11 +4,11 @@ plugins { android { namespace 'com.tungsten.fclauncher' - compileSdk 32 + compileSdk 33 defaultConfig { minSdk 26 - targetSdk 32 + targetSdk 33 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -35,9 +35,9 @@ android { dependencies { implementation 'com.jaredrummler:android-device-names:2.1.0' - implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.appcompat:appcompat:1.6.0' implementation 'com.google.android.material:material:1.7.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.4' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } \ No newline at end of file diff --git a/FCLauncher/src/main/java/com/tungsten/fclauncher/FCLauncher.java b/FCLauncher/src/main/java/com/tungsten/fclauncher/FCLauncher.java index 19d6529c..314e1306 100644 --- a/FCLauncher/src/main/java/com/tungsten/fclauncher/FCLauncher.java +++ b/FCLauncher/src/main/java/com/tungsten/fclauncher/FCLauncher.java @@ -134,7 +134,7 @@ public class FCLauncher { envMap.put("LIBGL_NAME", renderer.getGlLibName()); envMap.put("LIBEGL_NAME", renderer.getEglLibName()); if (renderer == FCLConfig.Renderer.RENDERER_GL4ES) { - envMap.put("LIBGL_ES","2"); + envMap.put("LIBGL_ES", "2"); envMap.put("LIBGL_MIPMAP", "3"); envMap.put("LIBGL_NORMALIZE", "1"); envMap.put("LIBGL_VSYNC", "1"); @@ -221,7 +221,7 @@ public class FCLauncher { } } - private static int launch(FCLConfig config, FCLBridge bridge, String task) throws IOException { + private static void launch(FCLConfig config, FCLBridge bridge, String task) throws IOException { printTaskTitle(bridge, task + " Arguments"); String[] args = rebaseArgs(config); for (String arg : args) { @@ -231,8 +231,7 @@ public class FCLauncher { bridge.setLdLibraryPath(getLibraryPath(config.getContext(), config.getJavaPath())); bridge.getCallback().onLog("Hook exit " + (bridge.setupExitTrap(bridge) == 0 ? "success" : "failed")); int exitCode = bridge.jliLaunch(args); - bridge.getCallback().onLog("OpenJDK exited with code : " + exitCode); - return exitCode; + bridge.onExit(exitCode); } public static FCLBridge launchMinecraft(FCLConfig config) { @@ -258,8 +257,7 @@ public class FCLauncher { bridge.chdir(config.getWorkingDir()); // launch game - int code = launch(config, bridge, "Minecraft"); - bridge.onExit(code); + launch(config, bridge, "Minecraft"); } catch (IOException e) { e.printStackTrace(); } @@ -295,8 +293,7 @@ public class FCLauncher { bridge.chdir(config.getWorkingDir()); // launch java gui - int code = launch(config, bridge, "Java GUI"); - bridge.onExit(code); + launch(config, bridge, "Java GUI"); } catch (IOException e) { e.printStackTrace(); } @@ -328,8 +325,7 @@ public class FCLauncher { bridge.chdir(config.getWorkingDir()); // launch api installer - int code = launch(config, bridge, "API Installer"); - bridge.onExit(code); + launch(config, bridge, "API Installer"); } catch (IOException e) { e.printStackTrace(); } diff --git a/FCLauncher/src/main/java/com/tungsten/fclauncher/bridge/FCLBridge.java b/FCLauncher/src/main/java/com/tungsten/fclauncher/bridge/FCLBridge.java index 7aed1eaf..2c0043dd 100644 --- a/FCLauncher/src/main/java/com/tungsten/fclauncher/bridge/FCLBridge.java +++ b/FCLauncher/src/main/java/com/tungsten/fclauncher/bridge/FCLBridge.java @@ -132,6 +132,7 @@ public class FCLBridge implements Serializable { // Loader function public void onExit(int code) { if (callback != null) { + callback.onLog("OpenJDK exited with code : " + code); callback.onExit(code); } }