mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-21 09:01:56 -07:00
Optifine Installer added
This commit is contained in:
parent
5cda342d21
commit
aabc278f05
5 changed files with 16 additions and 3 deletions
BIN
app_pojavlauncher/src/main/assets/components/OptiInst.jar
Normal file
BIN
app_pojavlauncher/src/main/assets/components/OptiInst.jar
Normal file
Binary file not shown.
|
|
@ -172,6 +172,9 @@ public class JavaGUILauncherActivity extends LoggableActivity {
|
|||
} else if (InstallerDetector.isFabric(installer)) {
|
||||
appendlnToLog("Detected Fabric Installer!");
|
||||
return new FabricInstaller(installer).install(this);
|
||||
}else if (InstallerDetector.isOptiFine(installer)) {
|
||||
appendlnToLog("Detected OptiFine Installer!");
|
||||
return new LegacyOptifineInstaller(installer).install(this);
|
||||
} else {
|
||||
appendlnToLog("No mod detected. Starting JVM");
|
||||
isLogAllow = false;
|
||||
|
|
|
|||
|
|
@ -332,6 +332,8 @@ public class PojavLoginActivity extends BaseActivity
|
|||
|
||||
Tools.copyAssetFile(this, "components/ForgeInstallerHeadless/forge-installer-headless-1.0.1.jar",
|
||||
Tools.DIR_GAME_NEW + "/config", "forge-installer-headless.jar", true);
|
||||
Tools.copyAssetFile(this, "components/OptiInst.jar",
|
||||
Tools.DIR_GAME_NEW + "/config", "OptiInst.jar", true);
|
||||
Tools.copyAssetFile(this, "components/security/pro-grade.jar", Tools.DIR_DATA, true);
|
||||
Tools.copyAssetFile(this, "components/security/java_sandbox.policy", Tools.DIR_DATA, true);
|
||||
Tools.copyAssetFile(this, "options.txt", Tools.DIR_GAME_NEW, false);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package net.kdt.pojavlaunch.installers;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.Enumeration;
|
||||
import java.util.zip.ZipEntry;
|
||||
|
||||
import com.google.gson.*;
|
||||
import net.kdt.pojavlaunch.value.*;
|
||||
|
||||
|
|
@ -9,7 +12,10 @@ public class InstallerDetector
|
|||
public static boolean isFabric(BaseInstaller installer) {
|
||||
return installer.mJarFile.getEntry("net/fabricmc/installer/Main.class") != null;
|
||||
}
|
||||
|
||||
public static boolean isOptiFine(BaseInstaller installer) {
|
||||
Enumeration e = installer.mJarFile.entries();
|
||||
return installer.mJarFile.getEntry("optifine/Installer.class") != null;
|
||||
}
|
||||
// Forge Legacy: for 1.12.1 and below
|
||||
public static boolean isForgeLegacy(BaseInstaller installer) throws IOException, JsonSyntaxException {
|
||||
ForgeInstallProfile profile = LegacyForgeInstaller.readInstallProfile(installer);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@ public class LegacyOptifineInstaller extends BaseInstaller {
|
|||
|
||||
@Override
|
||||
public int install(JavaGUILauncherActivity ctx) throws IOException {
|
||||
|
||||
return 0;
|
||||
mJarFile.close();
|
||||
ctx.appendlnToLog("Launching JVM");
|
||||
return ctx.launchJavaRuntime(null,
|
||||
"-jar "+Tools.DIR_GAME_NEW+"/config/OptiInst.jar " + mFile.getAbsolutePath() +" .");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue