mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 15:48:26 -04:00
Revert to ac5888b6ff7b92dc03074b4f4007521085aaf35b
This commit is contained in:
parent
9e3fdedaff
commit
d5eb4b4388
@ -24,7 +24,7 @@ android {
|
|||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 156236
|
versionCode 156236
|
||||||
versionName "3.3.1b_6409b_20201218"
|
versionName "3.3.1b_6409b_20201210"
|
||||||
multiDexEnabled true //important
|
multiDexEnabled true //important
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,13 +60,14 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation 'javax.annotation:javax.annotation-api:1.3.2'
|
implementation 'javax.annotation:javax.annotation-api:1.3.2'
|
||||||
implementation 'commons-codec:commons-codec:1.14'
|
implementation 'commons-codec:commons-codec:1.14'
|
||||||
// implementation 'com.wu-man:android-bsf-api:3.1.3'
|
implementation 'com.wu-man:android-bsf-api:3.1.3'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation 'androidx.preference:preference:1.0.0'
|
implementation 'androidx.preference:preference:1.0.0'
|
||||||
implementation 'androidx.appcompat:appcompat:1.0.0'
|
implementation 'androidx.appcompat:appcompat:1.0.0'
|
||||||
implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
|
implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
|
||||||
implementation 'com.google.android.material:material:1.0.0'
|
implementation 'com.google.android.material:material:1.0.0'
|
||||||
implementation 'androidx.annotation:annotation:1.0.0'
|
implementation 'androidx.annotation:annotation:1.0.0'
|
||||||
|
// implementation 'androidx.browser:browser:1.0.0'
|
||||||
implementation 'androidx.browser:browser:1.0.0'
|
implementation 'androidx.browser:browser:1.0.0'
|
||||||
|
|
||||||
// implementation 'com.intuit.sdp:sdp-android:1.0.5'
|
// implementation 'com.intuit.sdp:sdp-android:1.0.5'
|
||||||
|
Binary file not shown.
BIN
app/src/main/assets/components/lwjgl3/lwjgl-glfw-classes.jar.z
Normal file
BIN
app/src/main/assets/components/lwjgl3/lwjgl-glfw-classes.jar.z
Normal file
Binary file not shown.
@ -1 +1 @@
|
|||||||
20201218:1
|
20201201:1
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// This file is important to protect you against viruses/malwares that could be come from unknown Java Programs (run on mod install) or a mod.
|
// This file is important to protect you against viruses/malwares that could be come from unknown Java Programs (run on mod install) or a mod.
|
||||||
|
|
||||||
grant {
|
grant {
|
||||||
permission java.io.FilePermission "${java.io.tmpdir}/*", "read, write, delete";
|
permission java.io.FilePermission "${pojav.path.cache}/*", "read, write, delete";
|
||||||
permission java.io.FilePermission "${pojav.path.minecraft}/*", "read, write, delete";
|
permission java.io.FilePermission "${pojav.path.minecraft}/*", "read, write, delete";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -99,7 +99,6 @@ public class BaseMainActivity extends LoggableActivity {
|
|||||||
private LinearLayout contentCanvas;
|
private LinearLayout contentCanvas;
|
||||||
private AWTSurfaceView contentCanvasView;
|
private AWTSurfaceView contentCanvasView;
|
||||||
*/
|
*/
|
||||||
private boolean resuming;
|
|
||||||
private boolean lastEnabled = false;
|
private boolean lastEnabled = false;
|
||||||
private boolean lastGrab = false;
|
private boolean lastGrab = false;
|
||||||
private boolean isExited = false;
|
private boolean isExited = false;
|
||||||
|
@ -298,17 +298,16 @@ public class PojavLoginActivity extends BaseActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initMain() throws Throwable {
|
private void initMain() throws Throwable {
|
||||||
mkdirs(Tools.DIR_ACCOUNT_NEW);
|
mkdirs(Tools.DIR_HOME_VERSION);
|
||||||
PojavMigrator.migrateAccountData(this);
|
mkdirs(Tools.DIR_HOME_LIBRARY);
|
||||||
|
|
||||||
if (!PojavMigrator.migrateGameDir()) {
|
|
||||||
mkdirs(Tools.DIR_GAME_NEW);
|
mkdirs(Tools.DIR_GAME_NEW);
|
||||||
mkdirs(Tools.DIR_GAME_NEW + "/config");
|
mkdirs(Tools.DIR_GAME_NEW + "/config");
|
||||||
mkdirs(Tools.DIR_GAME_NEW + "/lwjgl3");
|
mkdirs(Tools.DIR_GAME_NEW + "/lwjgl3");
|
||||||
mkdirs(Tools.DIR_GAME_NEW + "/mods");
|
mkdirs(Tools.DIR_GAME_NEW + "/mods");
|
||||||
mkdirs(Tools.DIR_HOME_VERSION);
|
|
||||||
mkdirs(Tools.DIR_HOME_LIBRARY);
|
PojavMigrator.migrateAccountData(this);
|
||||||
}
|
PojavMigrator.migrateGameDir();
|
||||||
|
|
||||||
File forgeSplashFile = new File(Tools.DIR_GAME_NEW, "config/splash.properties");
|
File forgeSplashFile = new File(Tools.DIR_GAME_NEW, "config/splash.properties");
|
||||||
String forgeSplashContent = "enabled=true";
|
String forgeSplashContent = "enabled=true";
|
||||||
@ -331,7 +330,7 @@ public class PojavLoginActivity extends BaseActivity
|
|||||||
|
|
||||||
Tools.copyAssetFile(this, "components/ForgeInstallerHeadless/forge-installer-headless-1.0.1.jar", Tools.DIR_GAME_NEW + "/config", "forge-installer-headless.jar", true);
|
Tools.copyAssetFile(this, "components/ForgeInstallerHeadless/forge-installer-headless-1.0.1.jar", Tools.DIR_GAME_NEW + "/config", "forge-installer-headless.jar", true);
|
||||||
Tools.copyAssetFile(this, "options.txt", Tools.DIR_GAME_NEW, false);
|
Tools.copyAssetFile(this, "options.txt", Tools.DIR_GAME_NEW, false);
|
||||||
Tools.copyAssetFile(this, "java_sandbox.policy", Tools.DIR_GAME_HOME, true);
|
Tools.copyAssetFile(this, "java_sandbox.policy", Tools.DIR_GAME_NEW, true);
|
||||||
// TODO: Remove after implement.
|
// TODO: Remove after implement.
|
||||||
Tools.copyAssetFile(this, "launcher_profiles.json", Tools.DIR_GAME_NEW, false);
|
Tools.copyAssetFile(this, "launcher_profiles.json", Tools.DIR_GAME_NEW, false);
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ public class PojavMigrator
|
|||||||
{
|
{
|
||||||
public static void migrateAccountData(Context ctx) {
|
public static void migrateAccountData(Context ctx) {
|
||||||
File oldAccDir = new File(Tools.DIR_ACCOUNT_OLD);
|
File oldAccDir = new File(Tools.DIR_ACCOUNT_OLD);
|
||||||
|
|
||||||
if (oldAccDir.exists() && oldAccDir.isDirectory()) {
|
if (oldAccDir.exists() && oldAccDir.isDirectory()) {
|
||||||
for (String account : oldAccDir.list()) {
|
for (String account : oldAccDir.list()) {
|
||||||
File oldAccFile = new File(oldAccDir, account);
|
File oldAccFile = new File(oldAccDir, account);
|
||||||
@ -31,42 +32,16 @@ public class PojavMigrator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean migrateGameDir() throws IOException, InterruptedException {
|
public static void migrateGameDir() throws IOException, InterruptedException {
|
||||||
File oldGameDir = new File(Tools.DIR_GAME_OLD);
|
File oldGameDir = new File(Tools.DIR_GAME_OLD);
|
||||||
|
if (oldGameDir.exists() && oldGameDir.isDirectory()) {
|
||||||
boolean moved = oldGameDir.exists() && oldGameDir.isDirectory();
|
|
||||||
if (!migrateBugFix20201217() && moved) {
|
|
||||||
command("mv " + Tools.DIR_GAME_OLD + " " + Tools.DIR_GAME_HOME + "/");
|
|
||||||
}
|
|
||||||
|
|
||||||
return moved;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean migrateBugFix20201217() throws IOException, InterruptedException {
|
|
||||||
File bugGameDir = new File(Tools.DIR_GAME_NEW + "/.minecraft");
|
|
||||||
File oldGameDir = new File(Tools.DIR_GAME_OLD);
|
|
||||||
boolean moved = bugGameDir.exists() && bugGameDir.isDirectory();
|
|
||||||
|
|
||||||
if (oldGameDir.exists() && oldGameDir.isDirectory() && moved) {
|
|
||||||
command("rm -rf " + oldGameDir.getAbsolutePath());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (moved) {
|
|
||||||
command("mv " + bugGameDir.getAbsolutePath() + " " + Tools.DIR_GAME_OLD);
|
|
||||||
command("rm -rf " + Tools.DIR_GAME_HOME);
|
|
||||||
command("mv " + Tools.DIR_GAME_OLD + " " + Tools.DIR_GAME_HOME + "/");
|
|
||||||
}
|
|
||||||
|
|
||||||
return moved;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void command(String cmd) throws IOException, InterruptedException {
|
|
||||||
Process p = Runtime.getRuntime().exec(
|
Process p = Runtime.getRuntime().exec(
|
||||||
new String[]{cmd});
|
new String[]{"mv", Tools.DIR_GAME_OLD, Tools.DIR_GAME_NEW});
|
||||||
int exitCode = p.waitFor();
|
int exitCode = p.waitFor();
|
||||||
if (exitCode != 0) {
|
if (exitCode != 0) {
|
||||||
throw new IOException("Exit code " + exitCode +
|
throw new IOException("Could not move game dir! Exit code " + exitCode +
|
||||||
", message:\n" + Tools.read(p.getErrorStream()));
|
", message:\n" + Tools.read(p.getErrorStream()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -35,10 +35,9 @@ public final class Tools
|
|||||||
public static String CURRENT_ARCHITECTURE;
|
public static String CURRENT_ARCHITECTURE;
|
||||||
|
|
||||||
// New since 3.3.1
|
// New since 3.3.1
|
||||||
public static String DIR_ACCOUNT_NEW;
|
|
||||||
public static String DIR_ACCOUNT_OLD;
|
public static String DIR_ACCOUNT_OLD;
|
||||||
public static final String DIR_GAME_HOME = Environment.getExternalStorageDirectory().getAbsolutePath() + "/games/PojavLauncher";
|
public static String DIR_ACCOUNT_NEW;
|
||||||
public static final String DIR_GAME_NEW = DIR_GAME_NEW + "/.minecraft";
|
public static final String DIR_GAME_NEW = Environment.getExternalStorageDirectory().getAbsolutePath() + "/games/PojavLauncher/.minecraft";
|
||||||
public static final String DIR_GAME_OLD = Environment.getExternalStorageDirectory().getAbsolutePath() + "/games/.minecraft";
|
public static final String DIR_GAME_OLD = Environment.getExternalStorageDirectory().getAbsolutePath() + "/games/.minecraft";
|
||||||
|
|
||||||
// New since 3.0.0
|
// New since 3.0.0
|
||||||
@ -85,6 +84,8 @@ public final class Tools
|
|||||||
overrideableArgList.add("-Duser.language=" + System.getProperty("user.language"));
|
overrideableArgList.add("-Duser.language=" + System.getProperty("user.language"));
|
||||||
// overrideableArgList.add("-Duser.timezone=GMT");
|
// overrideableArgList.add("-Duser.timezone=GMT");
|
||||||
|
|
||||||
|
// Should be compatible?
|
||||||
|
// overrideableArgList.add("-Dos.name=Android");
|
||||||
overrideableArgList.add("-Dos.name=Linux");
|
overrideableArgList.add("-Dos.name=Linux");
|
||||||
overrideableArgList.add("-Dos.version=Android-" + Build.VERSION.RELEASE);
|
overrideableArgList.add("-Dos.version=Android-" + Build.VERSION.RELEASE);
|
||||||
|
|
||||||
|
@ -196,11 +196,7 @@ public abstract class HandleView extends View implements ViewPositionListener, V
|
|||||||
if (mActionPopupShower == null) {
|
if (mActionPopupShower == null) {
|
||||||
mActionPopupShower = new Runnable() {
|
mActionPopupShower = new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
|
||||||
mActionPopupWindow.show();
|
mActionPopupWindow.show();
|
||||||
} catch (Throwable th) {
|
|
||||||
th.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* - Works with some bugs:
|
* - Works with some bugs:
|
||||||
* + Modded versions gives broken stuff..
|
* + Modded versions gives broken stuff..
|
||||||
*
|
*
|
||||||
*
|
* TODO:
|
||||||
* - Implements glfwSetCursorPos() to handle grab camera pos correctly.
|
* - Implements glfwSetCursorPos() to handle grab camera pos correctly.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -201,11 +201,12 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSetInputRead
|
|||||||
return isUseStackQueueCall;
|
return isUseStackQueueCall;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSetGrabbing(JNIEnv* env, jclass clazz, jboolean grabbing, jint xset, jint yset) {
|
JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSetGrabbing(JNIEnv* env, jclass clazz, jboolean grabbing) {
|
||||||
isGrabbing = grabbing;
|
isGrabbing = grabbing;
|
||||||
if (isGrabbing == JNI_TRUE) {
|
if (isGrabbing == JNI_TRUE) {
|
||||||
grabCursorX = xset; // savedWidth / 2;
|
// Center the cursor pointer
|
||||||
grabCursorY = yset; // savedHeight / 2;
|
grabCursorX = savedWidth / 2;
|
||||||
|
grabCursorY = savedHeight / 2;
|
||||||
isPrepareGrabPos = true;
|
isPrepareGrabPos = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user