allow branch switching at will, remove HWID requirement
Some checks failed
/ Build BaseBand Loader (push) Has been cancelled

This commit is contained in:
Daniella / Tove 2024-10-13 18:04:52 +02:00
parent 66b9298f61
commit a0231f978b
Signed by: TudbuT
GPG key ID: B3CF345217F202D3
3 changed files with 12 additions and 10 deletions

View file

@ -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));

View file

@ -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";
}

View file

@ -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)) {