mirror of
https://github.com/xoo0524tw/OpenArcadeGames.git
synced 2026-12-06 02:46:01 +02:00
Deobfuscate remaining method and field names across common, latest, and legacy
This commit is contained in:
1 parent
fbed884ad9
commit
5f4da43c5b
538 files changed
+9039
-9039
No files matched your search
@@ -20,7 +20,7 @@ public final class SharedCompression {
|
||||
private SharedCompression() {
|
||||
}
|
||||
|
||||
public static byte[] a(String text) {
|
||||
public static byte[] compressString(String text) {
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
try (GZIPOutputStream var2 = new GZIPOutputStream(byteArrayOutputStream)) {
|
||||
var2.write(text.getBytes(StandardCharsets.UTF_8));
|
||||
@@ -29,7 +29,7 @@ public final class SharedCompression {
|
||||
return byteArrayOutputStream.toByteArray();
|
||||
}
|
||||
|
||||
public static String a(byte[] byteVals) {
|
||||
public static String decompressString(byte[] byteVals) {
|
||||
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteVals);
|
||||
try (GZIPInputStream var2 = new GZIPInputStream(byteArrayInputStream)) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
@@ -47,7 +47,7 @@ public final class SharedCompression {
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> T a(Gson gson, byte[] byteVals, Class<T> clazz) {
|
||||
public static <T> T decompressJson(Gson gson, byte[] byteVals, Class<T> clazz) {
|
||||
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteVals);
|
||||
try (GZIPInputStream var4 = new GZIPInputStream(byteArrayInputStream)) {
|
||||
return (T) gson.fromJson(new InputStreamReader(var4, StandardCharsets.UTF_8), clazz);
|
||||
@@ -56,30 +56,30 @@ public final class SharedCompression {
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] a(ConfigManager configManager, GameTemplate<?> gameTemplate) throws IOException {
|
||||
public static byte[] serializeTemplate(ConfigManager configManager, GameTemplate<?> gameTemplate) throws IOException {
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
try {
|
||||
byte[] byteVals = a(re$saveToString(configManager, gameTemplate.getMap()));
|
||||
byte[] byteVals = compressString(re$saveToString(configManager, gameTemplate.getMap()));
|
||||
byteArrayOutputStream.write(ByteBuffer.allocate(4).putInt(byteVals.length).array());
|
||||
byteArrayOutputStream.write(byteVals);
|
||||
} catch (InvalidConfigException ex) {
|
||||
throw new IOException("Error saving template: " + ex.getMessage(), ex);
|
||||
}
|
||||
byteArrayOutputStream.write(ByteBuffer.allocate(4).putInt(gameTemplate.c().length).array());
|
||||
byteArrayOutputStream.write(gameTemplate.c());
|
||||
byteArrayOutputStream.write(ByteBuffer.allocate(4).putInt(gameTemplate.getWorldData().length).array());
|
||||
byteArrayOutputStream.write(gameTemplate.getWorldData());
|
||||
return byteArrayOutputStream.toByteArray();
|
||||
}
|
||||
|
||||
public static void a(ConfigManager configManager, byte[] byteVals, GameTemplate<?> gameTemplate) throws IOException {
|
||||
public static void deserializeTemplate(ConfigManager configManager, byte[] byteVals, GameTemplate<?> gameTemplate) throws IOException {
|
||||
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteVals);
|
||||
try {
|
||||
int index = ByteBuffer.wrap(byteArrayInputStream.readNBytes(4)).getInt();
|
||||
re$loadFromString(configManager, gameTemplate.getMap(), a(byteArrayInputStream.readNBytes(index)));
|
||||
re$loadFromString(configManager, gameTemplate.getMap(), decompressString(byteArrayInputStream.readNBytes(index)));
|
||||
} catch (InvalidConfigException ex) {
|
||||
throw new IOException("Error loading template: " + ex.getMessage(), ex);
|
||||
}
|
||||
int index2 = ByteBuffer.wrap(byteArrayInputStream.readNBytes(4)).getInt();
|
||||
gameTemplate.a(byteArrayInputStream.readNBytes(index2));
|
||||
gameTemplate.setWorldData(byteArrayInputStream.readNBytes(index2));
|
||||
}
|
||||
|
||||
private static String re$saveToString(ConfigManager configManager, ro.fr33styler.arcade.api.engine.config.serialize.Configuration configuration) throws InvalidConfigException {
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ import java.lang.reflect.Method;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
public class ClassPatternMatcher {
|
||||
public static boolean a(Class<?> clazz, Predicate<Method> predicate) {
|
||||
public static boolean hasMatchingMethod(Class<?> clazz, Predicate<Method> predicate) {
|
||||
for (Method method : clazz.getDeclaredMethods()) {
|
||||
if (predicate.test(method)) {
|
||||
return true;
|
||||
@@ -16,7 +16,7 @@ public class ClassPatternMatcher {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean a(InputStream inputStream, int[] indexs) {
|
||||
public static boolean containsByteSequence(InputStream inputStream, int[] indexs) {
|
||||
try {
|
||||
int index = 0;
|
||||
|
||||
|
||||
+4
-4
@@ -4,20 +4,20 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class ClassResourceReader {
|
||||
public static String a(Class<?> clazz) {
|
||||
public static String getClassResourcePath(Class<?> clazz) {
|
||||
return clazz.getCanonicalName().replace('.', '/') + ".class";
|
||||
}
|
||||
|
||||
public static int a(InputStream inputStream) {
|
||||
public static int readLeadingIntSafe(InputStream inputStream) {
|
||||
try {
|
||||
return b(inputStream);
|
||||
return readLeadingInt(inputStream);
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
private static int b(InputStream inputStream) throws IOException {
|
||||
private static int readLeadingInt(InputStream inputStream) throws IOException {
|
||||
int index = 0;
|
||||
boolean flag = false;
|
||||
|
||||
|
||||
+4
-4
@@ -3,11 +3,11 @@ package ro.fr33styler.arcade.internal.compatibility.marker;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class LeakMarkerProbe {
|
||||
private static boolean a;
|
||||
private static boolean b;
|
||||
private static final int[] c = new int[]{76, 101, 97, 107};
|
||||
private static boolean detected;
|
||||
private static boolean checked;
|
||||
private static final int[] MARKER_BYTES = new int[]{76, 101, 97, 107};
|
||||
|
||||
public static boolean a(Plugin plugin) {
|
||||
public static boolean probe(Plugin plugin) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -3,15 +3,15 @@ package ro.fr33styler.arcade.internal.compatibility.marker;
|
||||
import ro.fr33styler.arcade.internal.compatibility.classfile.ClassPatternMatcher;
|
||||
|
||||
public class MethodSuffixProbe {
|
||||
private static boolean a;
|
||||
private static boolean b;
|
||||
private static boolean detected;
|
||||
private static boolean checked;
|
||||
|
||||
public static boolean a(Class<?> clazz) {
|
||||
if (!b) {
|
||||
b = true;
|
||||
a = ClassPatternMatcher.a(clazz, method -> method.getName().endsWith("g0"));
|
||||
public static boolean hasTargetMethodSuffix(Class<?> clazz) {
|
||||
if (!checked) {
|
||||
checked = true;
|
||||
detected = ClassPatternMatcher.hasMatchingMethod(clazz, method -> method.getName().endsWith("g0"));
|
||||
}
|
||||
|
||||
return a;
|
||||
return detected;
|
||||
}
|
||||
}
|
||||
+12
-12
@@ -9,14 +9,14 @@ import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class RemoteMarkerRegistry {
|
||||
private static boolean a;
|
||||
private static Set<String> set;
|
||||
private static boolean initialized;
|
||||
private static Set<String> markers;
|
||||
|
||||
public static Set<String> getSet() {
|
||||
return set;
|
||||
public static Set<String> getMarkers() {
|
||||
return markers;
|
||||
}
|
||||
|
||||
private static Set<String> a(InputStream inputStream) {
|
||||
private static Set<String> readLines(InputStream inputStream) {
|
||||
HashSet set2 = new HashSet();
|
||||
Scanner scanner = new Scanner(inputStream);
|
||||
|
||||
@@ -28,17 +28,17 @@ public class RemoteMarkerRegistry {
|
||||
return set2;
|
||||
}
|
||||
|
||||
private static void b(String text, String text2, String text3) {
|
||||
InputStream inputStream = EngineUtils.a(text, text2, text3, 5000);
|
||||
private static void fetchMarkers(String text, String text2, String text3) {
|
||||
InputStream inputStream = EngineUtils.openStream(text, text2, text3, 5000);
|
||||
if (inputStream != null) {
|
||||
set = a(inputStream);
|
||||
markers = readLines(inputStream);
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(String text, String text2, String text3) {
|
||||
if (!a) {
|
||||
a = true;
|
||||
CompletableFuture.runAsync(() -> b(text, text2, text3));
|
||||
public static void initAsync(String text, String text2, String text3) {
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
CompletableFuture.runAsync(() -> fetchMarkers(text, text2, text3));
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -3,12 +3,12 @@ package ro.fr33styler.arcade.internal.compatibility.marker;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class UserNonceMarkerProbe {
|
||||
private static boolean a;
|
||||
private static boolean b;
|
||||
private static final int[] c = new int[]{117, 115, 101, 114, 95, 105, 100, 61};
|
||||
private static final int[] d = new int[]{110, 111, 110, 99, 101, 61};
|
||||
private static boolean detected;
|
||||
private static boolean checked;
|
||||
private static final int[] USER_ID_BYTES = new int[]{117, 115, 101, 114, 95, 105, 100, 61};
|
||||
private static final int[] NONCE_BYTES = new int[]{110, 111, 110, 99, 101, 61};
|
||||
|
||||
public static boolean a(Plugin plugin) {
|
||||
public static boolean probe(Plugin plugin) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -3,14 +3,14 @@ package ro.fr33styler.arcade.internal.compatibility.marker;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class VendorMarkerProbe {
|
||||
private static boolean a;
|
||||
private static boolean b;
|
||||
private static final int[] c = new int[]{115, 112, 105, 103, 111, 116, 109, 99, 46};
|
||||
private static final int[] d = new int[]{118, 111, 120, 101, 108, 46, 115, 104, 111, 112};
|
||||
private static final int[] e = new int[]{117, 115, 101, 114, 95, 105, 100, 61};
|
||||
private static final int[] f = new int[]{110, 111, 110, 99, 101, 61};
|
||||
private static boolean detected;
|
||||
private static boolean checked;
|
||||
private static final int[] SPIGOT_BYTES = new int[]{115, 112, 105, 103, 111, 116, 109, 99, 46};
|
||||
private static final int[] VOXEL_BYTES = new int[]{118, 111, 120, 101, 108, 46, 115, 104, 111, 112};
|
||||
private static final int[] USER_ID_BYTES = new int[]{117, 115, 101, 114, 95, 105, 100, 61};
|
||||
private static final int[] NONCE_BYTES = new int[]{110, 111, 110, 99, 101, 61};
|
||||
|
||||
public static boolean a(Plugin plugin) {
|
||||
public static boolean probe(Plugin plugin) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user