changes
This commit is contained in:
parent
ab727c993a
commit
975b37ddf1
6 changed files with 14 additions and 83 deletions
|
@ -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;
|
||||
|
|
|
@ -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<Setting<?>> settings = (List<Setting<?>>) ois.readObject();
|
||||
System.out.println("Settings loaded from " + filePath);
|
||||
return settings;
|
||||
} catch (IOException | ClassNotFoundException e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -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<Float> boostReduction = register(new NumberSetting<>("Boost Reduction", 0f, 0f, 1f));
|
||||
BooleanSetting boost = register(new BooleanSetting("Boost", true));
|
||||
NumberSetting<Float> boostReduction = register(new NumberSetting<>("Boost Reduction", 0f, 0f, 1f));
|
||||
|
||||
boolean slow = false;
|
||||
int jumps = 0;
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue