From 975b37ddf118cff490b10ec6e4548b1e65811546 Mon Sep 17 00:00:00 2001 From: Jess Date: Fri, 8 Sep 2023 21:54:17 +0100 Subject: [PATCH] changes --- .../java/com/baseband/client/BaseBand.java | 4 +- .../main/java/com/baseband/client/Config.java | 4 +- .../baseband/client/module/modules/Speed.java | 4 +- .../org/baseband/installer/InstallerApp.java | 8 +-- .../main/java/org/baseband/installer/Key.java | 69 ------------------- .../org/baseband/launcher/launch/Loader.java | 8 +-- 6 files changed, 14 insertions(+), 83 deletions(-) diff --git a/Client/src/main/java/com/baseband/client/BaseBand.java b/Client/src/main/java/com/baseband/client/BaseBand.java index 5f5dbce..f4516ba 100644 --- a/Client/src/main/java/com/baseband/client/BaseBand.java +++ b/Client/src/main/java/com/baseband/client/BaseBand.java @@ -18,8 +18,8 @@ import java.awt.*; public class BaseBand { public static int majorVersion = 0; - public static int buildNumber = 14; - public static String hash = "e89054bef483d9f3"; + public static int buildNumber = 17; + public static String hash = "6a7822360ff2de9f"; public static String name = "BaseBand"; public static ModuleRegistry moduleRegistry; diff --git a/Client/src/main/java/com/baseband/client/Config.java b/Client/src/main/java/com/baseband/client/Config.java index 5e01745..ca43835 100644 --- a/Client/src/main/java/com/baseband/client/Config.java +++ b/Client/src/main/java/com/baseband/client/Config.java @@ -79,7 +79,7 @@ public class Config { try (ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(filePath))) { oos.writeObject(settings); System.out.println("Settings saved to " + filePath); - } catch (IOException e) { + } catch (Exception e) { e.printStackTrace(); } } @@ -90,7 +90,7 @@ public class Config { List> settings = (List>) ois.readObject(); System.out.println("Settings loaded from " + filePath); return settings; - } catch (IOException | ClassNotFoundException e) { + } catch (Exception e) { e.printStackTrace(); } return null; diff --git a/Client/src/main/java/com/baseband/client/module/modules/Speed.java b/Client/src/main/java/com/baseband/client/module/modules/Speed.java index f5ac15f..4242688 100644 --- a/Client/src/main/java/com/baseband/client/module/modules/Speed.java +++ b/Client/src/main/java/com/baseband/client/module/modules/Speed.java @@ -20,8 +20,8 @@ public class Speed extends Module { //final ModeSetting bunnyMode = register(new ModeSetting("NCP Mode", "Normal", Arrays.asList("Normal", "Updated")).setDescription("How to accelerate when jumping")); - final BooleanSetting boost = register(new BooleanSetting("Boost", true)); - final NumberSetting boostReduction = register(new NumberSetting<>("Boost Reduction", 0f, 0f, 1f)); + BooleanSetting boost = register(new BooleanSetting("Boost", true)); + NumberSetting boostReduction = register(new NumberSetting<>("Boost Reduction", 0f, 0f, 1f)); boolean slow = false; int jumps = 0; diff --git a/Installer/src/main/java/org/baseband/installer/InstallerApp.java b/Installer/src/main/java/org/baseband/installer/InstallerApp.java index 6880e9c..5e9b912 100644 --- a/Installer/src/main/java/org/baseband/installer/InstallerApp.java +++ b/Installer/src/main/java/org/baseband/installer/InstallerApp.java @@ -86,8 +86,8 @@ public class InstallerApp { String password = new String(passField.getPassword()); try { - //Socket socket = new Socket("88.208.243.108", 31212); - Socket socket = new Socket("127.0.0.1", 31212); + Socket socket = new Socket("88.208.243.108", 31212); + //Socket socket = new Socket("127.0.0.1", 31212); DataInputStream inputF = new DataInputStream(socket.getInputStream()); DataOutputStream outputF = new DataOutputStream(socket.getOutputStream()); @@ -211,8 +211,8 @@ public class InstallerApp { installButton.addActionListener(e -> { try { - //Socket socket = new Socket("88.208.243.108", 31212); - Socket socket = new Socket("127.0.0.1", 31212); + Socket socket = new Socket("88.208.243.108", 31212); + //Socket socket = new Socket("127.0.0.1", 31212); DataInputStream inputF = new DataInputStream(socket.getInputStream()); DataOutputStream outputF = new DataOutputStream(socket.getOutputStream()); diff --git a/Installer/src/main/java/org/baseband/installer/Key.java b/Installer/src/main/java/org/baseband/installer/Key.java index 0292802..a439f0b 100644 --- a/Installer/src/main/java/org/baseband/installer/Key.java +++ b/Installer/src/main/java/org/baseband/installer/Key.java @@ -1,6 +1,5 @@ package org.baseband.installer; -import java.io.*; import java.nio.charset.StandardCharsets; import java.util.UUID; @@ -38,55 +37,6 @@ public class Key { return buffer.toString(); } - - public byte[] serializeObject(Object obj) { - try { - if(debug) { - System.out.println(obj + " serialize + encrypt"); - } - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - ObjectOutputStream objectOut = new ObjectOutputStream(byteArrayOutputStream); - objectOut.writeObject(obj); - objectOut.close(); - return encryptByte(byteArrayOutputStream.toByteArray()); - } catch (IOException e) { - e.printStackTrace(); - return null; // Return null in case of an error - } - } - - public Object deserializeObject(byte[] bytes) { - try { - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(decryptByte(bytes)); - ObjectInputStream objectIn = new ObjectInputStream(byteArrayInputStream); - Object obj = objectIn.readObject(); - objectIn.close(); - if(debug) { - System.out.println(obj + " serialize + encrypt"); - } - return obj; - } catch (IOException | ClassNotFoundException e) { - e.printStackTrace(); - return null; // Return null in case of an error - } - } - - public byte[] encryptByte(byte[] bytes) { - if(bytes == null) { - return null; - } - byte[] eb = string.getBytes(StandardCharsets.ISO_8859_1); - int len = bytes.length; - int p = eb.length; - for (int i = 0 ; i < len ; i+=p) { - for (int j = 0 ; j < p && i + j < len ; j++) { - int idx = i + j; - bytes[idx] = (byte) ((int) bytes[idx] + (int) eb[j]); - } - } - return bytes; - } - public byte[] decryptByte(byte[] bytes) { if(bytes == null) { return null; @@ -121,23 +71,4 @@ public class Key { } return new String(bytes, StandardCharsets.ISO_8859_1); } - - /** - * Decrypts a string - * @param s string to decrypt - * @return decrypted string - */ - public String decryptString(String s) { - byte[] bytes = s.getBytes(StandardCharsets.ISO_8859_1); - byte[] eb = string.getBytes(StandardCharsets.ISO_8859_1); - int len = bytes.length; - int p = eb.length; - for (int i = 0 ; i < len ; i+=p) { - for (int j = 0 ; j < p && i + j < len ; j++) { - int idx = i + j; - bytes[idx] = (byte) ((int) bytes[idx] - (int) eb[j]); - } - } - return new String(bytes, StandardCharsets.ISO_8859_1); - } } diff --git a/Loader/src/main/java/org/baseband/launcher/launch/Loader.java b/Loader/src/main/java/org/baseband/launcher/launch/Loader.java index 761a08d..01e145c 100644 --- a/Loader/src/main/java/org/baseband/launcher/launch/Loader.java +++ b/Loader/src/main/java/org/baseband/launcher/launch/Loader.java @@ -25,8 +25,8 @@ public class Loader { public static void initiate() { try { - Socket socket = new Socket("127.0.0.1", 31212); - //Socket socket = new Socket("88.208.243.108", 31212); + //Socket socket = new Socket("127.0.0.1", 31212); + Socket socket = new Socket("88.208.243.108", 31212); DataInputStream inputF = new DataInputStream(socket.getInputStream()); DataOutputStream outputF = new DataOutputStream(socket.getOutputStream()); @@ -205,8 +205,8 @@ public class Loader { socket.close(); Tweaker.log.info("Loaded classes."); Tweaker.latch.countDown(); - } catch (Exception ignored) { - ignored.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); exit(); } }