From a0231f978b75f633f8d58bcb796300f7b21ea723 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Sun, 13 Oct 2024 18:04:52 +0200 Subject: [PATCH] allow branch switching at will, remove HWID requirement --- .../java/de/com/baseband/launcher/Loader.java | 3 +++ .../de/com/baseband/server/LoaderHandler.java | 2 +- .../de/com/baseband/server/UserHandler.java | 17 ++++++++--------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Loader/src/main/java/de/com/baseband/launcher/Loader.java b/Loader/src/main/java/de/com/baseband/launcher/Loader.java index 4b3b0dd..5101472 100644 --- a/Loader/src/main/java/de/com/baseband/launcher/Loader.java +++ b/Loader/src/main/java/de/com/baseband/launcher/Loader.java @@ -222,6 +222,9 @@ public class Loader implements Util { .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("Set branch", x -> x.newScreen() + .option("release (Broadway)", x1 -> x1.back().data.set("branch", "release")) + .option("main (Iceland)", x1 -> x1.back().data.set("branch", "main"))) .option("Persist changes", x -> { try(FileOutputStream fos = new FileOutputStream("baseband_launch.json")) { fos.write(JSON.writeReadable(x.data).getBytes(StandardCharsets.UTF_8)); diff --git a/Server/src/main/java/de/com/baseband/server/LoaderHandler.java b/Server/src/main/java/de/com/baseband/server/LoaderHandler.java index fa03f55..1f16e66 100644 --- a/Server/src/main/java/de/com/baseband/server/LoaderHandler.java +++ b/Server/src/main/java/de/com/baseband/server/LoaderHandler.java @@ -29,7 +29,7 @@ public class LoaderHandler { sendClasses(Main.classesLoader, key, outputStream); } if(response.o == UserHandler.Response.OK.ordinal()) { - String userBranch = response.t.getString("branch"); + String userBranch = userData.getString("branch"); if(userData.getBoolean("release-only") == Boolean.TRUE) { userBranch = "release"; } diff --git a/Server/src/main/java/de/com/baseband/server/UserHandler.java b/Server/src/main/java/de/com/baseband/server/UserHandler.java index febe6d1..6058da2 100644 --- a/Server/src/main/java/de/com/baseband/server/UserHandler.java +++ b/Server/src/main/java/de/com/baseband/server/UserHandler.java @@ -36,15 +36,14 @@ public class UserHandler { } if(BCrypt.verifyer().verify(remotePassword.toCharArray(), localPassword.toCharArray()).verified) { - if (isReset) { - localTCN.set("hardware-id-reset", false); - localTCN.set("hardware-id", remoteHardwareID); - return new DoubleTypedObject<>(Response.RESET.ordinal(), localTCN); - } - - if(!localHardwareID.equals(remoteTCN.getString("hardware-id"))) { - return new DoubleTypedObject<>(Response.HWID_INVALID.ordinal(), localTCN); - } + //if (isReset) { + // localTCN.set("hardware-id-reset", false); + // localTCN.set("hardware-id", remoteHardwareID); + // return new DoubleTypedObject<>(Response.RESET.ordinal(), localTCN); + //} + //if(!localHardwareID.equals(remoteTCN.getString("hardware-id"))) { + // return new DoubleTypedObject<>(Response.HWID_INVALID.ordinal(), localTCN); + //} String remoteCommit = remoteTCN.getString("commit"); if("[dev]".equals(remoteCommit) || Main.loaderHash.equals(remoteCommit)) {