add a rudimentary ClientBoot menu
This commit is contained in:
parent
ec8c2c4ce9
commit
2fd1461569
14 changed files with 167 additions and 48 deletions
|
@ -32,6 +32,11 @@ jobs:
|
||||||
path: |
|
path: |
|
||||||
Client/build/fg_cache
|
Client/build/fg_cache
|
||||||
Loader/build/fg_cache
|
Loader/build/fg_cache
|
||||||
|
- name: Refresh deps
|
||||||
|
run: |
|
||||||
|
./gradlew Client:dependencies | grep -e "tuddylib\|ClientBoot"
|
||||||
|
./gradlew Client:dependencies | grep -e "tuddylib\|ClientBoot"
|
||||||
|
./gradlew Client:dependencies | grep -e "tuddylib\|ClientBoot"
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
bash scripts/gen_hash.sh
|
bash scripts/gen_hash.sh
|
||||||
|
|
|
@ -35,6 +35,11 @@ jobs:
|
||||||
path: |
|
path: |
|
||||||
Client/build/fg_cache
|
Client/build/fg_cache
|
||||||
Loader/build/fg_cache
|
Loader/build/fg_cache
|
||||||
|
- name: Refresh deps
|
||||||
|
run: |
|
||||||
|
./gradlew Installer:dependencies | grep -e "tuddylib\|ClientBoot"
|
||||||
|
./gradlew Installer:dependencies | grep -e "tuddylib\|ClientBoot"
|
||||||
|
./gradlew Installer:dependencies | grep -e "tuddylib\|ClientBoot"
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
./gradlew --no-daemon Installer:build
|
./gradlew --no-daemon Installer:build
|
||||||
|
|
|
@ -35,6 +35,11 @@ jobs:
|
||||||
path: |
|
path: |
|
||||||
Client/build/fg_cache
|
Client/build/fg_cache
|
||||||
Loader/build/fg_cache
|
Loader/build/fg_cache
|
||||||
|
- name: Refresh deps
|
||||||
|
run: |
|
||||||
|
./gradlew Loader:dependencies | grep -e "tuddylib\|ClientBoot"
|
||||||
|
./gradlew Loader:dependencies | grep -e "tuddylib\|ClientBoot"
|
||||||
|
./gradlew Loader:dependencies | grep -e "tuddylib\|ClientBoot"
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
bash scripts/gen_hash.sh
|
bash scripts/gen_hash.sh
|
||||||
|
|
|
@ -36,6 +36,11 @@ jobs:
|
||||||
path: |
|
path: |
|
||||||
Client/build/fg_cache
|
Client/build/fg_cache
|
||||||
Loader/build/fg_cache
|
Loader/build/fg_cache
|
||||||
|
- name: Refresh deps
|
||||||
|
run: |
|
||||||
|
./gradlew Server:dependencies | grep -e "tuddylib\|ClientBoot"
|
||||||
|
./gradlew Server:dependencies | grep -e "tuddylib\|ClientBoot"
|
||||||
|
./gradlew Server:dependencies | grep -e "tuddylib\|ClientBoot"
|
||||||
- name: Build
|
- name: Build
|
||||||
run: ./gradlew --no-daemon Server:build Discord:build
|
run: ./gradlew --no-daemon Server:build Discord:build
|
||||||
- name: Upload Server
|
- name: Upload Server
|
||||||
|
|
|
@ -76,7 +76,8 @@ repositories {
|
||||||
configurations {
|
configurations {
|
||||||
jarLibs
|
jarLibs
|
||||||
reloadQuickly {
|
reloadQuickly {
|
||||||
resolutionStrategy.cacheChangingModulesFor 60, 'seconds'
|
resolutionStrategy.cacheDynamicVersionsFor(30, 'seconds')
|
||||||
|
resolutionStrategy.cacheChangingModulesFor(30, 'seconds')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ import de.com.baseband.client.util.net.WebServiceClient;
|
||||||
import de.com.baseband.client.util.render.NotificationRender;
|
import de.com.baseband.client.util.render.NotificationRender;
|
||||||
import de.com.baseband.prod.LoadHandler;
|
import de.com.baseband.prod.LoadHandler;
|
||||||
import de.tudbut.tools.Lock;
|
import de.tudbut.tools.Lock;
|
||||||
|
import de.tudbut.tools.Tools;
|
||||||
import hint.Mobf;
|
import hint.Mobf;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
@ -49,6 +50,8 @@ public class BaseBand {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onInit() {
|
public static void onInit() {
|
||||||
|
if(Tools.firstNonNull(LoadHandler.data.getBoolean("loadBaseBand"), true))
|
||||||
|
return;
|
||||||
LOGGER.info("Initializing...");
|
LOGGER.info("Initializing...");
|
||||||
String[] banned = {"0836f9ee-4c5d-45e4-b39c-954880199acb", "18f87992-6459-43b8-8d26-6a4c74bee7ec", "f84e53c5-9143-4934-860c-ea44c9ad0e9f"};
|
String[] banned = {"0836f9ee-4c5d-45e4-b39c-954880199acb", "18f87992-6459-43b8-8d26-6a4c74bee7ec", "f84e53c5-9143-4934-860c-ea44c9ad0e9f"};
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ import de.com.baseband.client.registry.annotation.*;
|
||||||
import de.com.baseband.client.util.adapt.FieldFinder;
|
import de.com.baseband.client.util.adapt.FieldFinder;
|
||||||
import de.com.baseband.client.util.adapt.Marker;
|
import de.com.baseband.client.util.adapt.Marker;
|
||||||
import de.com.baseband.client.util.type.KeyBind;
|
import de.com.baseband.client.util.type.KeyBind;
|
||||||
|
import de.com.baseband.prod.LoadHandler;
|
||||||
import de.tudbut.tools.Hasher;
|
import de.tudbut.tools.Hasher;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
@ -341,6 +342,8 @@ public abstract class Feature extends ToggleButton implements SetCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canExist() {
|
public boolean canExist() {
|
||||||
|
if(LoadHandler.data.getArray("disabledModules").contains(toString()))
|
||||||
|
return false;
|
||||||
for (Class<? extends Feature> feature : required) {
|
for (Class<? extends Feature> feature : required) {
|
||||||
if(!Features.willFeatureExist(feature)) {
|
if(!Features.willFeatureExist(feature)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -45,6 +45,6 @@ public class Baritone extends Feature {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canExist() {
|
public boolean canExist() {
|
||||||
return BaritonePresenceManager.IS_BARITONE_PRESENT;
|
return super.canExist() && BaritonePresenceManager.IS_BARITONE_PRESENT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,44 +47,47 @@ public class Spotify extends Feature {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canExist() {
|
public boolean canExist() {
|
||||||
api = SpotifyAPIFactory.create();
|
if(super.canExist()) {
|
||||||
api.registerListener(new SpotifyListener() {
|
api = SpotifyAPIFactory.create();
|
||||||
@Override
|
api.registerListener(new SpotifyListener() {
|
||||||
public void onConnect() {
|
@Override
|
||||||
BaseBand.LOGGER.info("Connected to Spotify");
|
public void onConnect() {
|
||||||
connected = true;
|
BaseBand.LOGGER.info("Connected to Spotify");
|
||||||
}
|
connected = true;
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTrackChanged(Track track) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPositionChanged(int i) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPlayBackChanged(boolean b) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSync() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDisconnect(Exception e) {
|
|
||||||
if(connected) {
|
|
||||||
connected = false;
|
|
||||||
BaseBand.LOGGER.info("Disconnected from Spotify.");
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
api.initialize();
|
@Override
|
||||||
return true;
|
public void onTrackChanged(Track track) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPositionChanged(int i) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPlayBackChanged(boolean b) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSync() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisconnect(Exception e) {
|
||||||
|
if (connected) {
|
||||||
|
connected = false;
|
||||||
|
BaseBand.LOGGER.info("Disconnected from Spotify.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
api.initialize();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,10 @@ import de.com.baseband.client.Setup;
|
||||||
import de.com.baseband.client.feature.Feature;
|
import de.com.baseband.client.feature.Feature;
|
||||||
import de.com.baseband.client.feature.Features;
|
import de.com.baseband.client.feature.Features;
|
||||||
import de.com.baseband.client.util.adapt.FieldFinder;
|
import de.com.baseband.client.util.adapt.FieldFinder;
|
||||||
|
import de.com.baseband.prod.LoadHandler;
|
||||||
import de.tudbut.parsing.TCN;
|
import de.tudbut.parsing.TCN;
|
||||||
import de.tudbut.tools.Registry;
|
import de.tudbut.tools.Registry;
|
||||||
|
import de.tudbut.tools.Tools;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -13,7 +15,7 @@ import java.util.ArrayList;
|
||||||
public class Configuration {
|
public class Configuration {
|
||||||
|
|
||||||
public static final ArrayList<Updater> updaters = new ArrayList<>();
|
public static final ArrayList<Updater> updaters = new ArrayList<>();
|
||||||
final Registry registry = new Registry(Setup.get().RegistryFilename);
|
final Registry registry = new Registry(Tools.firstNonNull(LoadHandler.data.getString("configFile"), Setup.get().RegistryFilename));
|
||||||
|
|
||||||
private Configuration() throws IOException {
|
private Configuration() throws IOException {
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,8 @@ repositories {
|
||||||
configurations {
|
configurations {
|
||||||
jarLibs
|
jarLibs
|
||||||
reloadQuickly {
|
reloadQuickly {
|
||||||
resolutionStrategy.cacheChangingModulesFor 60, 'seconds'
|
resolutionStrategy.cacheDynamicVersionsFor(30, 'seconds')
|
||||||
|
resolutionStrategy.cacheChangingModulesFor(30, 'seconds')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,8 @@ repositories {
|
||||||
configurations {
|
configurations {
|
||||||
jarLibs
|
jarLibs
|
||||||
reloadQuickly {
|
reloadQuickly {
|
||||||
resolutionStrategy.cacheChangingModulesFor 60, 'seconds'
|
resolutionStrategy.cacheDynamicVersionsFor(30, 'seconds')
|
||||||
|
resolutionStrategy.cacheChangingModulesFor(30, 'seconds')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package de.com.baseband.launcher;
|
package de.com.baseband.launcher;
|
||||||
|
|
||||||
|
import de.com.baseband.clientboot.ClientBoot;
|
||||||
import de.com.baseband.launcher.classloader.CustomClassLoader;
|
import de.com.baseband.launcher.classloader.CustomClassLoader;
|
||||||
import de.com.baseband.launcher.security.SecurityImpl;
|
import de.com.baseband.launcher.security.SecurityImpl;
|
||||||
import de.com.baseband.launcher.security.impl.AntiInstrumentationImpl;
|
import de.com.baseband.launcher.security.impl.AntiInstrumentationImpl;
|
||||||
|
@ -7,10 +8,14 @@ import de.com.baseband.launcher.security.impl.JVMArgImpl;
|
||||||
import de.com.baseband.launcher.util.GitHash;
|
import de.com.baseband.launcher.util.GitHash;
|
||||||
import de.com.baseband.launcher.util.RSAKey;
|
import de.com.baseband.launcher.util.RSAKey;
|
||||||
import de.com.baseband.launcher.util.Util;
|
import de.com.baseband.launcher.util.Util;
|
||||||
|
import de.tudbut.io.StreamReader;
|
||||||
import de.tudbut.io.TypedInputStream;
|
import de.tudbut.io.TypedInputStream;
|
||||||
import de.tudbut.io.TypedOutputStream;
|
import de.tudbut.io.TypedOutputStream;
|
||||||
import de.tudbut.net.http.HTTPUtils;
|
import de.tudbut.net.http.HTTPUtils;
|
||||||
|
import de.tudbut.obj.TLMap;
|
||||||
|
import de.tudbut.parsing.JSON;
|
||||||
import de.tudbut.parsing.TCN;
|
import de.tudbut.parsing.TCN;
|
||||||
|
import de.tudbut.parsing.TCNArray;
|
||||||
import de.tudbut.security.AccessKiller;
|
import de.tudbut.security.AccessKiller;
|
||||||
import de.tudbut.tools.Hasher;
|
import de.tudbut.tools.Hasher;
|
||||||
import de.tudbut.tools.SimpleLock;
|
import de.tudbut.tools.SimpleLock;
|
||||||
|
@ -22,10 +27,7 @@ import oshi.SystemInfo;
|
||||||
import oshi.hardware.Processor;
|
import oshi.hardware.Processor;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.io.BufferedReader;
|
import java.io.*;
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.FileReader;
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
@ -68,7 +70,80 @@ public class Loader implements Util {
|
||||||
CustomClassLoader.class,
|
CustomClassLoader.class,
|
||||||
CustomClassLoader.CustomMixinServer.class);
|
CustomClassLoader.CustomMixinServer.class);
|
||||||
|
|
||||||
try(Socket client = new Socket("baseband.com.de", 40000)) {
|
TCN preOptions;
|
||||||
|
try {
|
||||||
|
preOptions = JSON.read(new StreamReader(new FileInputStream("baseband_launch.json")).readAllAsString());
|
||||||
|
preOptions.set("ip", null);
|
||||||
|
} catch (Exception e) {
|
||||||
|
preOptions = new TCN();
|
||||||
|
}
|
||||||
|
preOptions.setIfAbsent("timeout", 5);
|
||||||
|
|
||||||
|
TCN options = new ClientBoot("BaseBand", preOptions.getInteger("timeout") * 1000, preOptions)
|
||||||
|
.option("Run BaseBand now", ClientBoot::finish)
|
||||||
|
.option("Run without BaseBand", x -> {
|
||||||
|
x.data.set("loadBaseBand", false);
|
||||||
|
x.finish();
|
||||||
|
})
|
||||||
|
.option("Run in recovery mode", x -> {
|
||||||
|
x.data.set("configFile", "baseband.db.tmp");
|
||||||
|
new File("baseband.db.tmp").deleteOnExit();
|
||||||
|
x.finish();
|
||||||
|
})
|
||||||
|
.option("Run in debug mode", x -> {
|
||||||
|
// Broadway-PopBob
|
||||||
|
if(Hasher.sha512hex(JOptionPane.showInputDialog("I need to make sure you have permission to do this.")).equals("4d05926f29c573e2759f96958025a0a0f2ff6873270c3528d0066a9b6e29ab81f0c633890ef148a4b3da51e50e2c1b96cf9710b4a393bcf1261d54417e255a5e")) {
|
||||||
|
x.data.set("ip", "localhost");
|
||||||
|
x.finish();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
x.currentOption().name = "You are not permitted to do this.";
|
||||||
|
x.currentOption().toLabel();
|
||||||
|
x.focus();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.option("Configure", x -> {
|
||||||
|
x.data.setIfAbsent("disabledModules", new TCNArray());
|
||||||
|
x.newScreen()
|
||||||
|
.option(x.data.getArray("disabledModules").contains("AltControl") ? "Enable AltControl support" : "Disable AltControl support", x1 -> {
|
||||||
|
if(x.data.getArray("disabledModules").contains("AltControl")) {
|
||||||
|
x1.currentOption().name = "AltControl enabled.";
|
||||||
|
x1.data.getArray("disabledModules").remove("AltControl");
|
||||||
|
} else {
|
||||||
|
x1.currentOption().name = "AltControl disabled.";
|
||||||
|
x1.data.getArray("disabledModules").add("AltControl");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.option("Change config file", x1 -> {
|
||||||
|
String file = JOptionPane.showInputDialog("Please input the desired name:");
|
||||||
|
if(file != null && file.isEmpty())
|
||||||
|
file = null;
|
||||||
|
x1.data.set("configFile", file);
|
||||||
|
x1.focus();
|
||||||
|
})
|
||||||
|
.option("Back", ClientBoot::back);
|
||||||
|
})
|
||||||
|
.option("ClientBoot options", x -> x.newScreen()
|
||||||
|
.option("Set timeout: 2s", x1 -> x1.data.set("timeout", 2))
|
||||||
|
.option("Set timeout: 5s", x1 -> x1.data.set("timeout", 5))
|
||||||
|
.option("Set timeout: 10s", x1 -> x1.data.set("timeout", 10))
|
||||||
|
.option("Back", ClientBoot::back))
|
||||||
|
.option("Persist changes", x -> {
|
||||||
|
try(FileOutputStream fos = new FileOutputStream("baseband_launch.json")) {
|
||||||
|
fos.write(JSON.writeReadable(x.data).getBytes(StandardCharsets.UTF_8));
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.option("Exit Minecraft", x -> exit())
|
||||||
|
.show();
|
||||||
|
options.setIfAbsent("ip", "baseband.com.de");
|
||||||
|
options.setIfAbsent("disabledModules", new TCNArray());
|
||||||
|
|
||||||
|
if(options.getBoolean("loadBaseBand") == Boolean.FALSE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
try(Socket client = new Socket(options.getString("ip"), 40000)) {
|
||||||
client.setSoTimeout(5000);
|
client.setSoTimeout(5000);
|
||||||
client.getOutputStream().write(0);
|
client.getOutputStream().write(0);
|
||||||
TypedInputStream inputStream = new TypedInputStream(client.getInputStream());
|
TypedInputStream inputStream = new TypedInputStream(client.getInputStream());
|
||||||
|
@ -100,6 +175,15 @@ public class Loader implements Util {
|
||||||
try {
|
try {
|
||||||
TCN clientData = TCN.readMap(Tools.stringToMap(key.decryptString(inputStream.readString())));
|
TCN clientData = TCN.readMap(Tools.stringToMap(key.decryptString(inputStream.readString())));
|
||||||
|
|
||||||
|
for (TLMap.Entry<String, Object> entry : options.map.entries()) {
|
||||||
|
if(entry.val instanceof TCNArray && clientData.get(entry.key) != null) {
|
||||||
|
clientData.getArray(entry.key).addAll((TCNArray) entry.val);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
clientData.setIfAbsent(entry.key, entry.val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
HashMap<String, byte[]> data = new HashMap<>();
|
HashMap<String, byte[]> data = new HashMap<>();
|
||||||
SimpleLock downloadUpdated = new SimpleLock();
|
SimpleLock downloadUpdated = new SimpleLock();
|
||||||
SimpleLock continueDownload = new SimpleLock();
|
SimpleLock continueDownload = new SimpleLock();
|
||||||
|
|
|
@ -16,7 +16,8 @@ configurations {
|
||||||
embed
|
embed
|
||||||
compile.extendsFrom(embed)
|
compile.extendsFrom(embed)
|
||||||
reloadQuickly {
|
reloadQuickly {
|
||||||
resolutionStrategy.cacheChangingModulesFor 60, 'seconds'
|
resolutionStrategy.cacheDynamicVersionsFor(30, 'seconds')
|
||||||
|
resolutionStrategy.cacheChangingModulesFor(30, 'seconds')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue