mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-13 14:51:51 -04:00
Build: Add @Keep directives to allow build with proguard
This commit is contained in:
parent
fb86444f50
commit
7f46c6d7bd
@ -1,5 +1,8 @@
|
|||||||
package net.kdt.pojavlaunch;
|
package net.kdt.pojavlaunch;
|
||||||
|
|
||||||
|
import androidx.annotation.Keep;
|
||||||
|
|
||||||
|
@Keep
|
||||||
public class JAssetInfo
|
public class JAssetInfo
|
||||||
{
|
{
|
||||||
public String hash;
|
public String hash;
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
package net.kdt.pojavlaunch;
|
package net.kdt.pojavlaunch;
|
||||||
|
|
||||||
|
import androidx.annotation.Keep;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Keep
|
||||||
public class JAssets {
|
public class JAssets {
|
||||||
@SerializedName("map_to_resources") public boolean mapToResources;
|
@SerializedName("map_to_resources") public boolean mapToResources;
|
||||||
public Map<String, JAssetInfo> objects;
|
public Map<String, JAssetInfo> objects;
|
||||||
|
@ -75,6 +75,7 @@ public class JMinecraftVersionList {
|
|||||||
public String features;
|
public String features;
|
||||||
public ArgOS os;
|
public ArgOS os;
|
||||||
|
|
||||||
|
@Keep
|
||||||
public static class ArgOS {
|
public static class ArgOS {
|
||||||
public String name;
|
public String name;
|
||||||
public String version;
|
public String version;
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
package net.kdt.pojavlaunch.value;
|
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.graphics.BitmapFactory;
|
|
||||||
import android.util.Base64;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Map;
|
|
||||||
import net.kdt.pojavlaunch.Tools;
|
|
||||||
import net.kdt.pojavlaunch.utils.DownloadUtils;
|
|
||||||
|
|
||||||
public class AccountSkin {
|
|
||||||
public static Bitmap getSkin(String uuid) throws IOException {
|
|
||||||
Profile p = Tools.GLOBAL_GSON.fromJson(DownloadUtils.downloadString("https://sessionserver.mojang.com/session/minecraft/profile/" + uuid), Profile.class);
|
|
||||||
for (Property property : p.properties) {
|
|
||||||
if (property.name.equals("textures")) {
|
|
||||||
return getSkinFromProperty(Tools.GLOBAL_GSON.fromJson(new String(Base64.decode(property.value, Base64.DEFAULT), "UTF-8"), SkinProperty.class));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Bitmap getSkinFromProperty(SkinProperty p) throws IOException {
|
|
||||||
for (Map.Entry<String, Texture> texture : p.textures.entrySet()) {
|
|
||||||
if (texture.getKey().equals("SKIN")) {
|
|
||||||
String skinFile = File.createTempFile("skin", ".png", new File(Tools.DIR_DATA, "cache")).getAbsolutePath();
|
|
||||||
Tools.downloadFile(texture.getValue().url.replace("http://","https://"), skinFile);
|
|
||||||
return BitmapFactory.decodeFile(skinFile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Texture {
|
|
||||||
public String url;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class SkinProperty {
|
|
||||||
public Map<String, Texture> textures;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Property {
|
|
||||||
public String name, value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Profile {
|
|
||||||
public Property[] properties;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
|||||||
package net.kdt.pojavlaunch.value;
|
package net.kdt.pojavlaunch.value;
|
||||||
|
|
||||||
|
import androidx.annotation.Keep;
|
||||||
|
|
||||||
import net.kdt.pojavlaunch.*;
|
import net.kdt.pojavlaunch.*;
|
||||||
|
|
||||||
|
@Keep
|
||||||
public class ForgeInstallProfile {
|
public class ForgeInstallProfile {
|
||||||
// ----- < 1.12.2 Forge Install Profile -----
|
// ----- < 1.12.2 Forge Install Profile -----
|
||||||
public ForgeInstallProperties install;
|
public ForgeInstallProperties install;
|
||||||
public JMinecraftVersionList.Version versionInfo;
|
public JMinecraftVersionList.Version versionInfo;
|
||||||
|
|
||||||
|
@Keep
|
||||||
public static class ForgeInstallProperties {
|
public static class ForgeInstallProperties {
|
||||||
public String profileName;
|
public String profileName;
|
||||||
public String target;
|
public String target;
|
||||||
|
@ -9,10 +9,13 @@ import java.io.*;
|
|||||||
import com.google.gson.*;
|
import com.google.gson.*;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.util.Base64;
|
import android.util.Base64;
|
||||||
|
|
||||||
|
import androidx.annotation.Keep;
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
|
|
||||||
public class MinecraftAccount
|
@Keep
|
||||||
{
|
public class MinecraftAccount {
|
||||||
public String accessToken = "0"; // access token
|
public String accessToken = "0"; // access token
|
||||||
public String clientToken = "0"; // clientID: refresh and invalidate
|
public String clientToken = "0"; // clientID: refresh and invalidate
|
||||||
public String profileId = "00000000-0000-0000-0000-000000000000"; // profile UUID, for obtaining skin
|
public String profileId = "00000000-0000-0000-0000-000000000000"; // profile UUID, for obtaining skin
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package net.kdt.pojavlaunch.value;
|
package net.kdt.pojavlaunch.value;
|
||||||
|
|
||||||
public class MinecraftClientInfo
|
import androidx.annotation.Keep;
|
||||||
{
|
|
||||||
|
@Keep
|
||||||
|
public class MinecraftClientInfo {
|
||||||
public String sha1;
|
public String sha1;
|
||||||
public int size;
|
public int size;
|
||||||
public String url;
|
public String url;
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package net.kdt.pojavlaunch.value;
|
package net.kdt.pojavlaunch.value;
|
||||||
|
|
||||||
public class MinecraftLibraryArtifact extends MinecraftClientInfo
|
import androidx.annotation.Keep;
|
||||||
{
|
|
||||||
|
@Keep
|
||||||
|
public class MinecraftLibraryArtifact extends MinecraftClientInfo {
|
||||||
public String path;
|
public String path;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package net.kdt.pojavlaunch.value;
|
package net.kdt.pojavlaunch.value;
|
||||||
|
|
||||||
|
import androidx.annotation.Keep;
|
||||||
|
|
||||||
import com.google.gson.JsonSyntaxException;
|
import com.google.gson.JsonSyntaxException;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
@ -10,6 +12,7 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
@Keep
|
||||||
public class PerVersionConfig {
|
public class PerVersionConfig {
|
||||||
static File pvcFile;
|
static File pvcFile;
|
||||||
public static HashMap<String,VersionConfig> configMap;
|
public static HashMap<String,VersionConfig> configMap;
|
||||||
@ -37,6 +40,8 @@ public class PerVersionConfig {
|
|||||||
public static boolean exists() {
|
public static boolean exists() {
|
||||||
return new File(Tools.DIR_GAME_HOME,"per-version-config.json").exists();
|
return new File(Tools.DIR_GAME_HOME,"per-version-config.json").exists();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Keep
|
||||||
public static class VersionConfig {
|
public static class VersionConfig {
|
||||||
public String jvmArgs;
|
public String jvmArgs;
|
||||||
public String gamePath;
|
public String gamePath;
|
||||||
|
@ -3,8 +3,7 @@ import com.google.gson.*;
|
|||||||
import net.kdt.pojavlaunch.*;
|
import net.kdt.pojavlaunch.*;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
public class LauncherProfiles
|
public class LauncherProfiles {
|
||||||
{
|
|
||||||
public static MinecraftLauncherProfiles mainProfileJson;
|
public static MinecraftLauncherProfiles mainProfileJson;
|
||||||
public static File launcherProfilesFile = new File(Tools.DIR_GAME_NEW + "/launcher_profiles.json");
|
public static File launcherProfilesFile = new File(Tools.DIR_GAME_NEW + "/launcher_profiles.json");
|
||||||
public static MinecraftLauncherProfiles update() {
|
public static MinecraftLauncherProfiles update() {
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package net.kdt.pojavlaunch.value.launcherprofiles;
|
package net.kdt.pojavlaunch.value.launcherprofiles;
|
||||||
|
|
||||||
public class MinecraftAuthenticationDatabase
|
import androidx.annotation.Keep;
|
||||||
{
|
|
||||||
|
@Keep
|
||||||
|
public class MinecraftAuthenticationDatabase {
|
||||||
public String accessToken;
|
public String accessToken;
|
||||||
public String displayName;
|
public String displayName;
|
||||||
public String username;
|
public String username;
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
package net.kdt.pojavlaunch.value.launcherprofiles;
|
package net.kdt.pojavlaunch.value.launcherprofiles;
|
||||||
|
import androidx.annotation.Keep;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import net.kdt.pojavlaunch.*;
|
import net.kdt.pojavlaunch.*;
|
||||||
|
|
||||||
public class MinecraftLauncherProfiles
|
@Keep
|
||||||
{
|
public class MinecraftLauncherProfiles {
|
||||||
public Map<String, MinecraftProfile> profiles = new HashMap<>();
|
public Map<String, MinecraftProfile> profiles = new HashMap<>();
|
||||||
public boolean profilesWereMigrated;
|
public boolean profilesWereMigrated;
|
||||||
public String clientToken;
|
public String clientToken;
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package net.kdt.pojavlaunch.value.launcherprofiles;
|
package net.kdt.pojavlaunch.value.launcherprofiles;
|
||||||
|
|
||||||
public class MinecraftLauncherSettings
|
import androidx.annotation.Keep;
|
||||||
{
|
|
||||||
|
@Keep
|
||||||
|
public class MinecraftLauncherSettings {
|
||||||
public boolean enableSnapshots;
|
public boolean enableSnapshots;
|
||||||
public boolean enableAdvanced;
|
public boolean enableAdvanced;
|
||||||
public boolean keepLauncherOpen;
|
public boolean keepLauncherOpen;
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package net.kdt.pojavlaunch.value.launcherprofiles;
|
package net.kdt.pojavlaunch.value.launcherprofiles;
|
||||||
|
|
||||||
public class MinecraftProfile
|
import androidx.annotation.Keep;
|
||||||
{
|
|
||||||
|
@Keep
|
||||||
|
public class MinecraftProfile {
|
||||||
public String name;
|
public String name;
|
||||||
public String type;
|
public String type;
|
||||||
public String created;
|
public String created;
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package net.kdt.pojavlaunch.value.launcherprofiles;
|
package net.kdt.pojavlaunch.value.launcherprofiles;
|
||||||
|
|
||||||
public class MinecraftResolution
|
import androidx.annotation.Keep;
|
||||||
{
|
|
||||||
|
@Keep
|
||||||
|
public class MinecraftResolution {
|
||||||
public int width;
|
public int width;
|
||||||
public int height;
|
public int height;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package net.kdt.pojavlaunch.value.launcherprofiles;
|
package net.kdt.pojavlaunch.value.launcherprofiles;
|
||||||
|
|
||||||
public class MinecraftSelectedUser
|
import androidx.annotation.Keep;
|
||||||
{
|
|
||||||
|
@Keep
|
||||||
|
public class MinecraftSelectedUser {
|
||||||
public String account;
|
public String account;
|
||||||
public String profile;
|
public String profile;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user