Fix rumtime

This commit is contained in:
khanhduytran0 2020-11-30 19:31:02 +07:00
parent 4089fa270c
commit 2cef96b8fa
2 changed files with 5 additions and 5 deletions

View File

@ -26,7 +26,7 @@ jobs:
- name: Build APK without runtime - name: Build APK without runtime
run: | run: |
rm app/src/main/assets/components/jre/*.tar.xz rm -r app/src/main/assets/components/jre
./gradlew assembleDebug ./gradlew assembleDebug
mv app/build/outputs/apk/debug/app-debug.apk out/app-debug-noruntime.apk mv app/build/outputs/apk/debug/app-debug.apk out/app-debug-noruntime.apk

View File

@ -306,12 +306,12 @@ public class PojavLoginActivity extends BaseActivity
} }
private boolean isJavaRuntimeInstalled(AssetManager am) { private boolean isJavaRuntimeInstalled(AssetManager am) {
boolean prefValue = firstLaunchPrefs.getBoolean(PREF_IS_INSTALLED_JAVARUNTIME, false);
try { try {
return prefValue && Tools.read(new FileInputStream(Tools.homeJreDir+"/version")).equals(Tools.read(am.open("components/jre/version")));
return firstLaunchPrefs.getBoolean(PREF_IS_INSTALLED_JAVARUNTIME, false) && Tools.read(new FileInputStream(Tools.homeJreDir+"/version")).equals(Tools.read(am.open("components/jre/version"))); } catch(IOException e) {
}catch(IOException e) {
Log.e("JVMCtl","failed to read file",e); Log.e("JVMCtl","failed to read file",e);
return firstLaunchPrefs.getBoolean(PREF_IS_INSTALLED_JAVARUNTIME, false); return prefValue;
} }
} }