Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified app_pojavlauncher/libs/MobileGlues-release.aar
Binary file not shown.
10 changes: 8 additions & 2 deletions app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Tools.java
Original file line number Diff line number Diff line change
Expand Up @@ -885,10 +885,16 @@ public static String generateLaunchClasspath(JMinecraftVersionList.Version info,
String internalLwjglVersion = iLwjglVersion >= 341 ? "3.4.1" : "3.3.3";
File lwjgl3Folder = new File(Tools.DIR_GAME_HOME, "lwjgl3/"+internalLwjglVersion);
String lwjglCore = lwjgl3Folder.getAbsolutePath() + "/lwjgl.jar";
String lwjglMerged = lwjgl3Folder.getAbsolutePath() + "/lwjgl-"+internalLwjglVersion+"-merged-modules";
String lwjglMerged = lwjgl3Folder.getAbsolutePath() + "/lwjgl-"+internalLwjglVersion+"-merged-modules.jar";
String lwjglxFile = lwjgl3Folder + "/lwjgl-lwjglx.jar";


if (!new File(lwjglCore).exists() || !new File(lwjglMerged).exists() || !new File(lwjglxFile).exists()) {
try { // Delete the folder so on restart will re-extract them.
if (lwjgl3Folder.exists())
org.apache.commons.io.FileUtils.deleteDirectory(lwjgl3Folder);
} catch (IOException ignored) {}
throw new RuntimeException("LWJGL jars incomplete, restart the app to reextract them.");
}
launchClasspath.append(lwjglCore).append(":");
// 2nd in priority in case we need to merge lwjgl.jar again for testing
launchClasspath.append(lwjglMerged).append(":");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@

public class NotificationDownloadListener implements ModloaderDownloadListener {
private final Context mContext;
private final Intent mIntent;
private final ModLoader mModLoader;

public NotificationDownloadListener(Context context, ModLoader modLoader) {
mModLoader = modLoader;
mContext = context.getApplicationContext();
mIntent = new Intent(mContext, LauncherActivity.class);
}

@Override
public void onDownloadFinished(File downloadedFile) {
if(mModLoader.requiresGuiInstallation()) {
ModloaderInstallTracker.saveModLoader(mContext, mModLoader, downloadedFile);
Intent mainActivityIntent = new Intent(mContext, LauncherActivity.class);
sendIntentNotification(mainActivityIntent, R.string.modpack_install_notification_success);
sendIntentNotification(R.string.modpack_install_notification_success);
}
}

Expand All @@ -40,11 +41,11 @@ public void onDownloadError(Exception e) {
Tools.showErrorRemote(mContext, R.string.modpack_install_modloader_download_failed, e);
}

private void sendIntentNotification(Intent intent, int localeString) {
private void sendIntentNotification(int localeString) {
Tools.runOnUiThread(() -> NotificationUtils.sendBasicNotification(mContext,
R.string.modpack_install_notification_title,
localeString,
intent,
mIntent,
NotificationUtils.PENDINGINTENT_CODE_DOWNLOAD_SERVICE,
NotificationUtils.NOTIFICATION_ID_DOWNLOAD_LISTENER
));
Expand All @@ -54,7 +55,7 @@ private void sendEmptyNotification(int localeString) {
Tools.runOnUiThread(()->NotificationUtils.sendBasicNotification(mContext,
R.string.modpack_install_notification_title,
localeString,
null,
mIntent,
NotificationUtils.PENDINGINTENT_CODE_DOWNLOAD_SERVICE,
NotificationUtils.NOTIFICATION_ID_DOWNLOAD_LISTENER
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public static void loadPreferences(Context ctx) {
PREF_MOUSESPEED = ((float)DEFAULT_PREF.getInt("mousespeed",100))/100f;
PREF_IGNORE_NOTCH = DEFAULT_PREF.getBoolean("ignoreNotch", false);
PREF_LONGPRESS_TRIGGER = DEFAULT_PREF.getInt("timeLongPressTrigger", 300);
PREF_DEFAULTCTRL_PATH = DEFAULT_PREF.getString("defaultCtrl", Tools.CTRLDEF_FILE);
PREF_FORCE_ENGLISH = DEFAULT_PREF.getBoolean("force_english", false);
PREF_CHECK_LIBRARY_SHA = DEFAULT_PREF.getBoolean("checkLibraries",true);
PREF_DISABLE_GESTURES = DEFAULT_PREF.getBoolean("disableGestures",false);
Expand Down Expand Up @@ -124,6 +123,10 @@ public static void loadPreferences(Context ctx) {
PREF_MOUSE_GRAB_FORCE = DEFAULT_PREF.getBoolean("always_grab_mouse", false);
PREF_KEYBOARD_PANNING = DEFAULT_PREF.getBoolean("keyboardPanning", true);

// User may have deleted their default control
String userDefCtrl = DEFAULT_PREF.getString("defaultCtrl", Tools.CTRLDEF_FILE);
PREF_DEFAULTCTRL_PATH = FileUtils.exists(userDefCtrl) ? userDefCtrl : Tools.CTRLDEF_FILE;

String argLwjglLibname = "-Dorg.lwjgl.opengl.libname=";
for (String arg : JREUtils.parseJavaArguments(PREF_CUSTOM_JAVA_ARGS)) {
if (arg.startsWith(argLwjglLibname)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ public static void relocateLibPath(Runtime runtime, String jreHome) {
.append("/vendor/").append(libName).append("/hw:")
.append(NATIVE_LIB_DIR);
// FIXME: Freetype is shipped inside lwjgl. We should ship it outside and use lwjgl native jars instead.
ldLibraryPath.append(String.format(":%s/lwjgl-3.3.3-natives/%s", Tools.DIR_DATA, archAsStringAndroid(getDeviceArchitecture())));
String lwjglVer = Tools.sLwjglVersion == null ? "3.3.3" : Tools.sLwjglVersion;
ldLibraryPath.append(String.format(":%s/lwjgl-%s-natives/%s", Tools.DIR_DATA, lwjglVer, archAsStringAndroid(getDeviceArchitecture())));
LD_LIBRARY_PATH = ldLibraryPath.toString();
}

Expand Down
Loading