mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 23:59:21 -04:00
Modify MultiRTUtils to use the new helper method
This commit is contained in:
parent
f724fb4d4f
commit
03c2a53403
@ -167,12 +167,9 @@ public class MultiRTUtils {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
String content = Tools.read(release.getAbsolutePath());
|
String content = Tools.read(release.getAbsolutePath());
|
||||||
int javaVersionIndex = content.indexOf(JAVA_VERSION_STR);
|
String javaVersion = Tools.extractUntilCharacter(content, JAVA_VERSION_STR, '"');
|
||||||
int osArchIndex = content.indexOf(OS_ARCH_STR);
|
String osArch = Tools.extractUntilCharacter(content, OS_ARCH_STR, '"');
|
||||||
if(javaVersionIndex != -1 && osArchIndex != -1) {
|
if(javaVersion != null && osArch != null) {
|
||||||
javaVersionIndex += JAVA_VERSION_STR.length();
|
|
||||||
osArchIndex += OS_ARCH_STR.length();
|
|
||||||
String javaVersion = content.substring(javaVersionIndex,content.indexOf('"', javaVersionIndex));
|
|
||||||
String[] javaVersionSplit = javaVersion.split("\\.");
|
String[] javaVersionSplit = javaVersion.split("\\.");
|
||||||
int javaVersionInt;
|
int javaVersionInt;
|
||||||
if (javaVersionSplit[0].equals("1")) {
|
if (javaVersionSplit[0].equals("1")) {
|
||||||
@ -181,7 +178,7 @@ public class MultiRTUtils {
|
|||||||
javaVersionInt = Integer.parseInt(javaVersionSplit[0]);
|
javaVersionInt = Integer.parseInt(javaVersionSplit[0]);
|
||||||
}
|
}
|
||||||
Runtime runtime = new Runtime(name);
|
Runtime runtime = new Runtime(name);
|
||||||
runtime.arch = content.substring(osArchIndex,content.indexOf('"', osArchIndex));
|
runtime.arch = osArch;
|
||||||
runtime.javaVersion = javaVersionInt;
|
runtime.javaVersion = javaVersionInt;
|
||||||
runtime.versionString = javaVersion;
|
runtime.versionString = javaVersion;
|
||||||
returnRuntime = runtime;
|
returnRuntime = runtime;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user