mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-18 09:07:48 -04:00
[DISABLED] Add experimental support for proguard.
This commit is contained in:
parent
a7fad6100c
commit
c2036a1886
11
app_pojavlauncher/proguard-rules.pro
vendored
11
app_pojavlauncher/proguard-rules.pro
vendored
@ -15,4 +15,13 @@
|
|||||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
# public *;
|
# public *;
|
||||||
#}
|
#}
|
||||||
-keep class !android.support.v7.internal.view.menu.**,android.support.** {*;}
|
|
||||||
|
# We use Reflection on the builder to avoid creating too many objects
|
||||||
|
-keep class net.objecthunter.exp4j.ExpressionBuilder**
|
||||||
|
-keepclassmembers class net.objecthunter.exp4j.ExpressionBuilder** {
|
||||||
|
*;
|
||||||
|
}
|
||||||
|
# Option screens
|
||||||
|
-keep class net.kdt.pojavlaunch.prefs.screens** {*;}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,10 +4,12 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.annotation.Keep;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
@Keep
|
||||||
public class ExitActivity extends AppCompatActivity {
|
public class ExitActivity extends AppCompatActivity {
|
||||||
public static void showExitMessage(Context ctx, int code) {
|
public static void showExitMessage(Context ctx, int code) {
|
||||||
Intent i = new Intent(ctx,ExitActivity.class);
|
Intent i = new Intent(ctx,ExitActivity.class);
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
package net.kdt.pojavlaunch;
|
package net.kdt.pojavlaunch;
|
||||||
|
|
||||||
|
import androidx.annotation.Keep;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import net.kdt.pojavlaunch.value.*;
|
import net.kdt.pojavlaunch.value.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
@Keep
|
||||||
public class JMinecraftVersionList {
|
public class JMinecraftVersionList {
|
||||||
public static final String TYPE_OLD_ALPHA = "old_alpha";
|
public static final String TYPE_OLD_ALPHA = "old_alpha";
|
||||||
public static final String TYPE_OLD_BETA = "old_beta";
|
public static final String TYPE_OLD_BETA = "old_beta";
|
||||||
@ -12,6 +15,7 @@ public class JMinecraftVersionList {
|
|||||||
public Map<String, String> latest;
|
public Map<String, String> latest;
|
||||||
public Version[] versions;
|
public Version[] versions;
|
||||||
|
|
||||||
|
@Keep
|
||||||
public static class Version {
|
public static class Version {
|
||||||
// Since 1.13, so it's one of ways to check
|
// Since 1.13, so it's one of ways to check
|
||||||
public Arguments arguments;
|
public Arguments arguments;
|
||||||
@ -34,15 +38,19 @@ public class JMinecraftVersionList {
|
|||||||
public String url;
|
public String url;
|
||||||
public String sha1;
|
public String sha1;
|
||||||
}
|
}
|
||||||
|
@Keep
|
||||||
public static class JavaVersionInfo {
|
public static class JavaVersionInfo {
|
||||||
public String component;
|
public String component;
|
||||||
public int majorVersion;
|
public int majorVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Since 1.13
|
// Since 1.13
|
||||||
|
@Keep
|
||||||
public static class Arguments {
|
public static class Arguments {
|
||||||
public Object[] game;
|
public Object[] game;
|
||||||
public Object[] jvm;
|
public Object[] jvm;
|
||||||
|
|
||||||
|
@Keep
|
||||||
public static class ArgValue {
|
public static class ArgValue {
|
||||||
public ArgRules[] rules;
|
public ArgRules[] rules;
|
||||||
public String value;
|
public String value;
|
||||||
@ -50,12 +58,14 @@ public class JMinecraftVersionList {
|
|||||||
// TLauncher styled argument...
|
// TLauncher styled argument...
|
||||||
public String[] values;
|
public String[] values;
|
||||||
|
|
||||||
|
@Keep
|
||||||
public static class ArgRules {
|
public static class ArgRules {
|
||||||
public String action;
|
public String action;
|
||||||
public String features;
|
public String features;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@Keep
|
||||||
public static class AssetIndex {
|
public static class AssetIndex {
|
||||||
public String id, sha1, url;
|
public String id, sha1, url;
|
||||||
public long size, totalSize;
|
public long size, totalSize;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package net.kdt.pojavlaunch;
|
package net.kdt.pojavlaunch;
|
||||||
|
|
||||||
|
import androidx.annotation.Keep;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
@ -8,6 +10,7 @@ import java.lang.ref.WeakReference;
|
|||||||
/** Singleton class made to log on one file
|
/** Singleton class made to log on one file
|
||||||
* The singleton part can be removed but will require more implementation from the end-dev
|
* The singleton part can be removed but will require more implementation from the end-dev
|
||||||
*/
|
*/
|
||||||
|
@Keep
|
||||||
public class Logger {
|
public class Logger {
|
||||||
private static Logger loggerSingleton = null;
|
private static Logger loggerSingleton = null;
|
||||||
|
|
||||||
|
@ -17,6 +17,11 @@ import org.lwjgl.glfw.*;
|
|||||||
import static net.kdt.pojavlaunch.LWJGLGLFWKeycode.GLFW_KEY_UNKNOWN;
|
import static net.kdt.pojavlaunch.LWJGLGLFWKeycode.GLFW_KEY_UNKNOWN;
|
||||||
import static org.lwjgl.glfw.CallbackBridge.sendKeyPress;
|
import static org.lwjgl.glfw.CallbackBridge.sendKeyPress;
|
||||||
|
|
||||||
|
import androidx.annotation.Keep;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
@Keep
|
||||||
public class ControlData {
|
public class ControlData {
|
||||||
|
|
||||||
public static final int SPECIALBTN_KEYBOARD = -1;
|
public static final int SPECIALBTN_KEYBOARD = -1;
|
||||||
@ -250,7 +255,9 @@ public class ControlData {
|
|||||||
expression = new WeakReference<>(builder.get().getClass().getDeclaredField("expression"));
|
expression = new WeakReference<>(builder.get().getClass().getDeclaredField("expression"));
|
||||||
expression.get().setAccessible(true);
|
expression.get().setAccessible(true);
|
||||||
expression.get().set(expression.get(), expression.get().getModifiers() & ~Modifier.FINAL);
|
expression.get().set(expression.get(), expression.get().getModifiers() & ~Modifier.FINAL);
|
||||||
}catch (Exception ignored){}
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,14 +10,16 @@ import static net.kdt.pojavlaunch.customcontrols.ControlDrawerData.Orientation.R
|
|||||||
import static net.kdt.pojavlaunch.customcontrols.ControlDrawerData.Orientation.UP;
|
import static net.kdt.pojavlaunch.customcontrols.ControlDrawerData.Orientation.UP;
|
||||||
import static net.kdt.pojavlaunch.customcontrols.ControlDrawerData.Orientation.FREE;
|
import static net.kdt.pojavlaunch.customcontrols.ControlDrawerData.Orientation.FREE;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.Keep;
|
||||||
|
|
||||||
|
@Keep
|
||||||
public class ControlDrawerData {
|
public class ControlDrawerData {
|
||||||
|
|
||||||
public ArrayList<ControlData> buttonProperties;
|
public ArrayList<ControlData> buttonProperties;
|
||||||
public ControlData properties;
|
public ControlData properties;
|
||||||
public Orientation orientation;
|
public Orientation orientation;
|
||||||
|
|
||||||
|
@Keep
|
||||||
public enum Orientation {
|
public enum Orientation {
|
||||||
DOWN,
|
DOWN,
|
||||||
LEFT,
|
LEFT,
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
package net.kdt.pojavlaunch.customcontrols;
|
package net.kdt.pojavlaunch.customcontrols;
|
||||||
import android.content.*;
|
import android.content.*;
|
||||||
|
|
||||||
|
import androidx.annotation.Keep;
|
||||||
|
|
||||||
import com.google.gson.*;
|
import com.google.gson.*;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -7,6 +10,7 @@ import java.util.*;
|
|||||||
import net.kdt.pojavlaunch.*;
|
import net.kdt.pojavlaunch.*;
|
||||||
import org.lwjgl.glfw.*;
|
import org.lwjgl.glfw.*;
|
||||||
|
|
||||||
|
@Keep
|
||||||
public class CustomControls {
|
public class CustomControls {
|
||||||
public int version = -1;
|
public int version = -1;
|
||||||
public float scaledAt;
|
public float scaledAt;
|
||||||
|
@ -47,10 +47,10 @@ public class RefreshVersionListTask extends AsyncTask<Void, Void, ArrayList<Stri
|
|||||||
mActivity.mVersionList.versions = versions.toArray(new JMinecraftVersionList.Version[versions.size()]);
|
mActivity.mVersionList.versions = versions.toArray(new JMinecraftVersionList.Version[versions.size()]);
|
||||||
Log.i("ExtVL","Final list size: " + mActivity.mVersionList.versions.length);
|
Log.i("ExtVL","Final list size: " + mActivity.mVersionList.versions.length);
|
||||||
}
|
}
|
||||||
ArrayList<String> versionStringList = filter(mActivity.mVersionList.versions, new File(Tools.DIR_HOME_VERSION).listFiles());
|
|
||||||
|
|
||||||
return versionStringList;
|
return filter(mActivity.mVersionList.versions, new File(Tools.DIR_HOME_VERSION).listFiles());
|
||||||
} catch (Exception e){
|
} catch (Exception e){
|
||||||
|
System.out.println("Refreshing version list failed !");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
package net.kdt.pojavlaunch.value;
|
package net.kdt.pojavlaunch.value;
|
||||||
|
|
||||||
|
import androidx.annotation.Keep;
|
||||||
|
|
||||||
|
@Keep
|
||||||
public class DependentLibrary {
|
public class DependentLibrary {
|
||||||
public String name;
|
public String name;
|
||||||
public LibraryDownloads downloads;
|
public LibraryDownloads downloads;
|
||||||
public String url;
|
public String url;
|
||||||
|
|
||||||
public static class LibraryDownloads
|
@Keep
|
||||||
{
|
public static class LibraryDownloads {
|
||||||
public MinecraftLibraryArtifact artifact;
|
public MinecraftLibraryArtifact artifact;
|
||||||
public LibraryDownloads(MinecraftLibraryArtifact artifact) {
|
public LibraryDownloads(MinecraftLibraryArtifact artifact) {
|
||||||
this.artifact = artifact;
|
this.artifact = artifact;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user