Skip to content

Commit

Permalink
Fix[storage]: fix previous commit not starting the game
Browse files Browse the repository at this point in the history
  • Loading branch information
artdeell committed Jan 15, 2025
1 parent f446e11 commit 5067dba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.concurrent.TimeUnit;

import net.kdt.pojavlaunch.lifecycle.ContextExecutor;
import net.kdt.pojavlaunch.prefs.LauncherPreferences;
import net.kdt.pojavlaunch.tasks.AsyncAssetManager;
import net.kdt.pojavlaunch.utils.*;
import net.kdt.pojavlaunch.utils.FileUtils;
Expand Down Expand Up @@ -57,7 +58,15 @@ public void onCreate() {

try {
super.onCreate();
Tools.initEarlyConstants(this);
if(Tools.checkStorageRoot(this)){
// Implicitly initializes early constants and storage constants.
// Required to run the main activity properly.
LauncherPreferences.loadPreferences(this);
} else {
// In other cases, only initialize enough for the basicmost basics to work
// and not explode.
Tools.initEarlyConstants(this);
}
Tools.DEVICE_ARCHITECTURE = Architecture.getDeviceArchitecture();
//Force x86 lib directory for Asus x86 based zenfones
if(Architecture.isx86Device() && Architecture.is32BitsDevice()){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

import net.kdt.pojavlaunch.prefs.LauncherPreferences;
import net.kdt.pojavlaunch.tasks.AsyncAssetManager;

public class TestStorageActivity extends Activity {
Expand Down Expand Up @@ -60,8 +61,8 @@ private void exit() {
startActivity(new Intent(this, MissingStorageActivity.class));
return;
}
//Initialize constants after we confirm that we have storage.
Tools.initStorageConstants(getApplicationContext());
//Initialize constants (implicitly) and preferences after we confirm that we have storage.
LauncherPreferences.loadPreferences(this);
AsyncAssetManager.unpackComponents(this);
AsyncAssetManager.unpackSingleFiles(this);

Expand Down

0 comments on commit 5067dba

Please sign in to comment.