This commit is contained in:
Jess 2023-09-08 21:54:17 +01:00
parent ab727c993a
commit 975b37ddf1
6 changed files with 14 additions and 83 deletions

View file

@ -18,8 +18,8 @@ import java.awt.*;
public class BaseBand { public class BaseBand {
public static int majorVersion = 0; public static int majorVersion = 0;
public static int buildNumber = 14; public static int buildNumber = 17;
public static String hash = "e89054bef483d9f3"; public static String hash = "6a7822360ff2de9f";
public static String name = "BaseBand"; public static String name = "BaseBand";
public static ModuleRegistry moduleRegistry; public static ModuleRegistry moduleRegistry;

View file

@ -79,7 +79,7 @@ public class Config {
try (ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(filePath))) { try (ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(filePath))) {
oos.writeObject(settings); oos.writeObject(settings);
System.out.println("Settings saved to " + filePath); System.out.println("Settings saved to " + filePath);
} catch (IOException e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
@ -90,7 +90,7 @@ public class Config {
List<Setting<?>> settings = (List<Setting<?>>) ois.readObject(); List<Setting<?>> settings = (List<Setting<?>>) ois.readObject();
System.out.println("Settings loaded from " + filePath); System.out.println("Settings loaded from " + filePath);
return settings; return settings;
} catch (IOException | ClassNotFoundException e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return null; return null;

View file

@ -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 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)); BooleanSetting boost = register(new BooleanSetting("Boost", true));
final NumberSetting<Float> boostReduction = register(new NumberSetting<>("Boost Reduction", 0f, 0f, 1f)); NumberSetting<Float> boostReduction = register(new NumberSetting<>("Boost Reduction", 0f, 0f, 1f));
boolean slow = false; boolean slow = false;
int jumps = 0; int jumps = 0;

View file

@ -86,8 +86,8 @@ public class InstallerApp {
String password = new String(passField.getPassword()); String password = new String(passField.getPassword());
try { try {
//Socket socket = new Socket("88.208.243.108", 31212); Socket socket = new Socket("88.208.243.108", 31212);
Socket socket = new Socket("127.0.0.1", 31212); //Socket socket = new Socket("127.0.0.1", 31212);
DataInputStream inputF = new DataInputStream(socket.getInputStream()); DataInputStream inputF = new DataInputStream(socket.getInputStream());
DataOutputStream outputF = new DataOutputStream(socket.getOutputStream()); DataOutputStream outputF = new DataOutputStream(socket.getOutputStream());
@ -211,8 +211,8 @@ public class InstallerApp {
installButton.addActionListener(e -> { installButton.addActionListener(e -> {
try { try {
//Socket socket = new Socket("88.208.243.108", 31212); Socket socket = new Socket("88.208.243.108", 31212);
Socket socket = new Socket("127.0.0.1", 31212); //Socket socket = new Socket("127.0.0.1", 31212);
DataInputStream inputF = new DataInputStream(socket.getInputStream()); DataInputStream inputF = new DataInputStream(socket.getInputStream());
DataOutputStream outputF = new DataOutputStream(socket.getOutputStream()); DataOutputStream outputF = new DataOutputStream(socket.getOutputStream());

View file

@ -1,6 +1,5 @@
package org.baseband.installer; package org.baseband.installer;
import java.io.*;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.UUID; import java.util.UUID;
@ -38,55 +37,6 @@ public class Key {
return buffer.toString(); 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) { public byte[] decryptByte(byte[] bytes) {
if(bytes == null) { if(bytes == null) {
return null; return null;
@ -121,23 +71,4 @@ public class Key {
} }
return new String(bytes, StandardCharsets.ISO_8859_1); 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);
}
} }

View file

@ -25,8 +25,8 @@ public class Loader {
public static void initiate() { public static void initiate() {
try { try {
Socket socket = new Socket("127.0.0.1", 31212); //Socket socket = new Socket("127.0.0.1", 31212);
//Socket socket = new Socket("88.208.243.108", 31212); Socket socket = new Socket("88.208.243.108", 31212);
DataInputStream inputF = new DataInputStream(socket.getInputStream()); DataInputStream inputF = new DataInputStream(socket.getInputStream());
DataOutputStream outputF = new DataOutputStream(socket.getOutputStream()); DataOutputStream outputF = new DataOutputStream(socket.getOutputStream());
@ -205,8 +205,8 @@ public class Loader {
socket.close(); socket.close();
Tweaker.log.info("Loaded classes."); Tweaker.log.info("Loaded classes.");
Tweaker.latch.countDown(); Tweaker.latch.countDown();
} catch (Exception ignored) { } catch (Exception e) {
ignored.printStackTrace(); e.printStackTrace();
exit(); exit();
} }
} }