Some changes

- Fix crashing if custom_env.txt not exists.
- Update README.md
This commit is contained in:
khanhduytran0 2020-10-12 12:36:49 +07:00
parent ec97d37783
commit 6494950dc1
2 changed files with 11 additions and 7 deletions

View File

@ -1,4 +1,5 @@
[![Android CI](https://github.com/PojavLauncherTeam/PojavLauncher/workflows/Android%20CI/badge.svg)](https://github.com/PojavLauncherTeam/PojavLauncher/actions)
[![Crowdin](https://badges.crowdin.net/pojavlauncher/localized.svg)](https://crowdin.com/project/pojavlauncher)
# PojavLauncher
A Minecraft: Java Edition launcher for Android based from Boardwalk. This branch is intended to support 1.13+

View File

@ -123,14 +123,17 @@ public class JREUtils
setEnvironment(launchType, "AWTSTUB_WIDTH", Integer.toString(CallbackBridge.windowWidth));
setEnvironment(launchType, "AWTSTUB_HEIGHT", Integer.toString(CallbackBridge.windowHeight));
BufferedReader reader = new BufferedReader(new FileReader(new File(Tools.MAIN_PATH, "custom_env.txt")));
String line;
while ((line = reader.readLine()) != null) {
// Not use split() as only split first one
int index = line.indexOf("=");
setEnvironment(launchType, line.substring(0, index), line.substring(index + 1));
File customEnvFile = new File(Tools.MAIN_PATH, "custom_env.txt");
if (customEnvFile.exists() && customEnvFile.isFile()) {
BufferedReader reader = new BufferedReader(new FileReader(customEnvFile));
String line;
while ((line = reader.readLine()) != null) {
// Not use split() as only split first one
int index = line.indexOf("=");
setEnvironment(launchType, line.substring(0, index), line.substring(index + 1));
}
reader.close();
}
reader.close();
// REGAL_GL_EXTENSIONS