fix gui not showing in prod and implement micro-installer
This commit is contained in:
parent
3e92b1da37
commit
07cc11c13b
41 changed files with 220 additions and 211 deletions
|
@ -23,31 +23,22 @@ jobs:
|
|||
- name: Initialize Gradle
|
||||
uses: https://github.com/gradle/actions/setup-gradle@v3
|
||||
- name: Build
|
||||
run: |
|
||||
./gradlew Client:build Client:proguard
|
||||
bash mobf.sh Client/build/proguard/BaseBand-DSM.jar
|
||||
- name: Build Broadway
|
||||
run: ./gradlew Client:build
|
||||
- name: Obfuscate Broadway
|
||||
if: github.ref == 'refs/heads/release'
|
||||
run: |
|
||||
./gradlew Client:proguardRelease
|
||||
bash mobf.sh Client/build/proguard/BaseBand-Broadway.jar
|
||||
run: bash mobf.sh Client/build/libs/BaseBand-Broadway.jar
|
||||
|
||||
- name: Upload DSM
|
||||
uses: forgejo/upload-artifact@v4
|
||||
with:
|
||||
name: BaseBand-DSM.jar
|
||||
path: Client/build/libs/BaseBand-DSM.jar
|
||||
- name: Upload Obfuscated DSM
|
||||
uses: forgejo/upload-artifact@v4
|
||||
with:
|
||||
name: BaseBand-DSM-Standalone.jar
|
||||
path: Client/build/proguard/BaseBand-DSM.jar
|
||||
|
||||
- name: Upload Broadway
|
||||
if: github.ref == 'refs/heads/release'
|
||||
uses: forgejo/upload-artifact@v4
|
||||
with:
|
||||
name: BaseBand-Broadway.jar
|
||||
path: Client/build/proguard/BaseBand-Broadway.jar
|
||||
path: Client/build/libs/BaseBand-Broadway.jar
|
||||
- name: Release to server
|
||||
if: github.ref == 'refs/heads/release'
|
||||
env:
|
||||
|
@ -56,5 +47,5 @@ jobs:
|
|||
BB_HOST: ${{ vars.BB_HOST }}
|
||||
BB_PORT: ${{ vars.BB_PORT }}
|
||||
BB_PATH: ${{ vars.BB_PATH }}
|
||||
run: bash push_file.sh Client/build/proguard/BaseBand-Broadway.jar 3849
|
||||
run: bash push_file.sh Client/build/libs/BaseBand-Broadway.jar 3849
|
||||
|
||||
|
|
36
.forgejo/workflows/build-installer.yml
Normal file
36
.forgejo/workflows/build-installer.yml
Normal file
|
@ -0,0 +1,36 @@
|
|||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- ".forgejo/workflows/build-installer.yml"
|
||||
- "Installer/**"
|
||||
|
||||
|
||||
jobs:
|
||||
make:
|
||||
name: Build BaseBand Installer
|
||||
|
||||
runs-on: 'docker'
|
||||
|
||||
steps:
|
||||
- name: Setup Java
|
||||
uses: https://github.com/actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'adopt'
|
||||
java-version: 8
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Initialize Gradle
|
||||
uses: https://github.com/gradle/actions/setup-gradle@v3
|
||||
- name: Build
|
||||
# we cd into installer in order to skip the minecraft stuff
|
||||
run: |
|
||||
cd Installer
|
||||
../gradlew --no-daemon build
|
||||
cd ..
|
||||
bash mobf.sh Installer/build/libs/BaseBand-Installer.jar
|
||||
- name: Upload Installer
|
||||
uses: forgejo/upload-artifact@v4
|
||||
with:
|
||||
name: BaseBand-Installer.jar
|
||||
path: Installer/build/libs/BaseBand-Installer.jar
|
|
@ -28,11 +28,6 @@ jobs:
|
|||
./gradlew --no-daemon Loader:build Loader:proguard
|
||||
bash mobf.sh Loader/build/proguard/BaseBand-Loader.jar
|
||||
- name: Upload Loader
|
||||
uses: forgejo/upload-artifact@v4
|
||||
with:
|
||||
name: BaseBand-open.jar
|
||||
path: Loader/build/libs/BaseBand-Loader.jar
|
||||
- name: Upload Obfuscated Loader
|
||||
uses: forgejo/upload-artifact@v4
|
||||
with:
|
||||
name: BaseBand.jar
|
||||
|
|
|
@ -35,8 +35,7 @@
|
|||
<option name="taskNames">
|
||||
<list>
|
||||
<option value="build" />
|
||||
<option value="proguard" />
|
||||
<option value="proguardRelease" />
|
||||
<option value="Loader:proguard" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="vmOptions" />
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration default="false" name="mobf" type="ShConfigurationType">
|
||||
<option name="SCRIPT_TEXT" value="bash mobf.sh */build/proguard/BaseBand-*.jar" />
|
||||
<option name="SCRIPT_TEXT" value="bash mobf.sh Client/build/libs/BaseBand-Broadway.jar Loader/build/proguard/BaseBand-Loader.jar" />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/mobf.sh" />
|
||||
<option name="SCRIPT_OPTIONS" value="*/build/proguard/BaseBand-*.jar" />
|
||||
|
|
Binary file not shown.
|
@ -12,15 +12,15 @@
|
|||
-classobfuscationdictionary dictionary.txt
|
||||
-packageobfuscationdictionary dictionary.txt
|
||||
-repackageclasses com.baseband.prod
|
||||
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,*Annotation*,Synthetic,EnclosingMethod
|
||||
-keepattributes *
|
||||
-ignorewarnings
|
||||
-overloadaggressively
|
||||
#-overloadaggressively
|
||||
|
||||
-keep @interface ** { *; }
|
||||
|
||||
# keep things meant to exist in prod
|
||||
-keep class com.baseband.prod.** { *; }
|
||||
-keep class com.baseband.client.mixins.** { *; }
|
||||
-keep class com.baseband.client.mixin.** { *; }
|
||||
-keep class com.baseband.client.DevStub {
|
||||
public <methods>;
|
||||
}
|
||||
|
@ -46,7 +46,4 @@
|
|||
|
||||
# Also keep - Enumerations. Keep the special static methods that are required in
|
||||
# enumeration classes.
|
||||
-keepclassmembers enum * {
|
||||
public static **[] values();
|
||||
public static ** valueOf(java.lang.String);
|
||||
}
|
||||
-keepclassmembers enum ** { *; }
|
||||
|
|
|
@ -51,6 +51,7 @@ public class BaseBand {
|
|||
}
|
||||
|
||||
public static void onInit() {
|
||||
LOGGER.info("Initializing...");
|
||||
String[] banned = {"0836f9ee-4c5d-45e4-b39c-954880199acb", "18f87992-6459-43b8-8d26-6a4c74bee7ec", "f84e53c5-9143-4934-860c-ea44c9ad0e9f"};
|
||||
|
||||
if(Arrays.stream(banned).anyMatch(string -> string.equals(Minecraft.getMinecraft().getSession().getProfile().getId().toString()))) {
|
||||
|
@ -63,8 +64,12 @@ public class BaseBand {
|
|||
|
||||
mc.gameSettings.autoJump = false; //fuck autojump, disable it on startup
|
||||
|
||||
LOGGER.info("Generating features...");
|
||||
|
||||
Features.init();
|
||||
|
||||
LOGGER.info("Populating config...");
|
||||
|
||||
for (Updater updater : Configuration.updaters) {
|
||||
updater.populate();
|
||||
}
|
||||
|
@ -90,7 +95,7 @@ public class BaseBand {
|
|||
|
||||
|
||||
|
||||
LOGGER.info("Instantiated.");
|
||||
LOGGER.info("Initialized.");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.baseband.client.feature.chat;
|
|||
import com.baseband.client.event.events.PacketEvent;
|
||||
import com.baseband.client.feature.Feature;
|
||||
import com.baseband.client.feature.render.HUD;
|
||||
import com.baseband.client.mixins.ICPacketChat;
|
||||
import com.baseband.client.mixin.mixins.ICPacketChat;
|
||||
import com.baseband.client.registry.annotation.*;
|
||||
import com.baseband.client.util.adapt.FieldFinder;
|
||||
import com.baseband.client.util.adapt.Marker;
|
||||
|
|
|
@ -6,8 +6,8 @@ import com.baseband.client.feature.Feature;
|
|||
import com.baseband.client.feature.Features;
|
||||
import com.baseband.client.feature.category.Movement;
|
||||
import com.baseband.client.feature.client.Timer;
|
||||
import com.baseband.client.mixins.IMinecraft;
|
||||
import com.baseband.client.mixins.ITimer;
|
||||
import com.baseband.client.mixin.mixins.IMinecraft;
|
||||
import com.baseband.client.mixin.mixins.ITimer;
|
||||
import com.baseband.client.registry.annotation.Config;
|
||||
import com.baseband.client.util.interact.MotionUtil;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.baseband.client.feature.movement;
|
|||
import com.baseband.client.event.events.PacketEvent;
|
||||
import com.baseband.client.feature.Feature;
|
||||
import com.baseband.client.feature.category.Movement;
|
||||
import com.baseband.client.mixins.ISPacketExplosion;
|
||||
import com.baseband.client.mixin.mixins.ISPacketExplosion;
|
||||
import net.minecraft.network.play.server.SPacketEntityVelocity;
|
||||
import net.minecraft.network.play.server.SPacketExplosion;
|
||||
import net.minecraftforge.client.event.PlayerSPPushOutOfBlocksEvent;
|
||||
|
|
|
@ -2,8 +2,8 @@ package com.baseband.client.feature.render;
|
|||
|
||||
import com.baseband.client.feature.Feature;
|
||||
import com.baseband.client.feature.category.Render;
|
||||
import com.baseband.client.mixins.IMinecraft;
|
||||
import com.baseband.client.mixins.IRenderManager;
|
||||
import com.baseband.client.mixin.mixins.IMinecraft;
|
||||
import com.baseband.client.mixin.mixins.IRenderManager;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
|
|
|
@ -4,7 +4,7 @@ import com.baseband.client.event.events.BaritoneEvent;
|
|||
import com.baseband.client.event.events.PacketEvent;
|
||||
import com.baseband.client.feature.Feature;
|
||||
import com.baseband.client.feature.category.World;
|
||||
import com.baseband.client.mixins.IMinecraft;
|
||||
import com.baseband.client.mixin.mixins.IMinecraft;
|
||||
import com.baseband.client.registry.annotation.Config;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.baseband.client.feature.world;
|
|||
import com.baseband.client.event.events.DamageBlockEvent;
|
||||
import com.baseband.client.feature.Feature;
|
||||
import com.baseband.client.feature.category.World;
|
||||
import com.baseband.client.mixins.IPlayerControllerMP;
|
||||
import com.baseband.client.mixin.mixins.IPlayerControllerMP;
|
||||
import com.baseband.client.registry.annotation.Config;
|
||||
import net.minecraft.network.play.client.CPacketPlayerDigging;
|
||||
import net.minecraft.util.EnumHand;
|
||||
|
|
|
@ -38,7 +38,7 @@ public class GuiRewrite extends GuiScreen {
|
|||
return mc.player.timeInPortal != 0;
|
||||
}
|
||||
|
||||
// The initiator, this can, for some reason, not be in the constructor
|
||||
// The initiator; this can, for some reason, not be in the constructor
|
||||
public void initGui() {
|
||||
|
||||
// Minecraft wants this
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.baseband.client.mixins;
|
||||
package com.baseband.client.mixin;
|
||||
|
||||
import com.baseband.client.BaseBand;
|
||||
import com.baseband.client.event.events.DamageBlockEvent;
|
||||
|
@ -11,7 +11,6 @@ import com.baseband.client.feature.client.Client;
|
|||
import com.baseband.client.feature.render.NoRender;
|
||||
import com.baseband.client.feature.world.AutoSignText;
|
||||
import com.baseband.client.util.net.ScreenshotHelper;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.gui.ChatLine;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
|
@ -1,4 +1,4 @@
|
|||
package com.baseband.client.mixins;
|
||||
package com.baseband.client.mixin.mixins;
|
||||
|
||||
import net.minecraft.network.play.client.CPacketChatMessage;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
|
@ -1,4 +1,4 @@
|
|||
package com.baseband.client.mixins;
|
||||
package com.baseband.client.mixin.mixins;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.Timer;
|
|
@ -1,4 +1,4 @@
|
|||
package com.baseband.client.mixins;
|
||||
package com.baseband.client.mixin.mixins;
|
||||
|
||||
import net.minecraft.client.multiplayer.PlayerControllerMP;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
|
@ -1,4 +1,4 @@
|
|||
package com.baseband.client.mixins;
|
||||
package com.baseband.client.mixin.mixins;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.util.math.Vec3d;
|
|
@ -1,4 +1,4 @@
|
|||
package com.baseband.client.mixins;
|
||||
package com.baseband.client.mixin.mixins;
|
||||
|
||||
import net.minecraft.network.play.server.SPacketExplosion;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
|
@ -1,4 +1,4 @@
|
|||
package com.baseband.client.mixins;
|
||||
package com.baseband.client.mixin.mixins;
|
||||
|
||||
import net.minecraft.util.Timer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
|
@ -1,14 +1,13 @@
|
|||
package com.baseband.client.mixins;
|
||||
package com.baseband.client.mixin.mixins;
|
||||
|
||||
import com.baseband.client.mixin.MixinProxy;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
import net.minecraft.entity.MoverType;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
@ -1,5 +1,6 @@
|
|||
package com.baseband.client.mixins;
|
||||
package com.baseband.client.mixin.mixins;
|
||||
|
||||
import com.baseband.client.mixin.MixinProxy;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
|
@ -1,4 +1,4 @@
|
|||
package com.baseband.client.mixins;
|
||||
package com.baseband.client.mixin.mixins;
|
||||
|
||||
import com.baseband.client.BaseBand;
|
||||
import com.google.common.collect.Maps;
|
|
@ -1,5 +1,6 @@
|
|||
package com.baseband.client.mixins;
|
||||
package com.baseband.client.mixin.mixins;
|
||||
|
||||
import com.baseband.client.mixin.MixinProxy;
|
||||
import net.minecraft.client.gui.inventory.GuiEditSign;
|
||||
import net.minecraft.tileentity.TileEntitySign;
|
||||
import org.spongepowered.asm.mixin.Final;
|
|
@ -1,5 +1,6 @@
|
|||
package com.baseband.client.mixins;
|
||||
package com.baseband.client.mixin.mixins;
|
||||
|
||||
import com.baseband.client.mixin.MixinProxy;
|
||||
import net.minecraft.client.gui.ChatLine;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiNewChat;
|
|
@ -1,5 +1,6 @@
|
|||
package com.baseband.client.mixins;
|
||||
package com.baseband.client.mixin.mixins;
|
||||
|
||||
import com.baseband.client.mixin.MixinProxy;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
|
@ -1,5 +1,6 @@
|
|||
package com.baseband.client.mixins;
|
||||
package com.baseband.client.mixin.mixins;
|
||||
|
||||
import com.baseband.client.mixin.MixinProxy;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
|
@ -1,5 +1,6 @@
|
|||
package com.baseband.client.mixins;
|
||||
package com.baseband.client.mixin.mixins;
|
||||
|
||||
import com.baseband.client.mixin.MixinProxy;
|
||||
import net.minecraft.client.multiplayer.PlayerControllerMP;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
|
@ -1,6 +1,7 @@
|
|||
package com.baseband.client.mixins;
|
||||
package com.baseband.client.mixin.mixins;
|
||||
|
||||
|
||||
import com.baseband.client.mixin.MixinProxy;
|
||||
import net.minecraft.client.shader.Framebuffer;
|
||||
import net.minecraft.util.ScreenShotHelper;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"required": true,
|
||||
"compatibilityLevel": "JAVA_8",
|
||||
"package": "com.baseband.client.mixins",
|
||||
"package": "com.baseband.client.mixin.mixins",
|
||||
"minVersion": "0",
|
||||
"refmap": "mixins.baseband.refmap.json",
|
||||
"client": [
|
||||
|
|
|
@ -1,63 +1,17 @@
|
|||
import javax.swing.JOptionPane
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = 'SpongePowered'
|
||||
url = 'https://repo.spongepowered.org/maven'
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.4'
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
}
|
||||
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
|
||||
group 'org.baseband'
|
||||
|
||||
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = 'spongepowered-repo'
|
||||
url = 'https://repo.spongepowered.org/maven'
|
||||
}
|
||||
|
||||
maven {
|
||||
name = "jitpack.io"
|
||||
url = "https://jitpack.io"
|
||||
}
|
||||
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'org.json:json:20230227'
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
|
||||
dependencies {
|
||||
include(dependency('org.json:json:20220320'))
|
||||
}
|
||||
|
||||
baseName = "Installer"
|
||||
version = "1.0.0"
|
||||
jar {
|
||||
manifest {
|
||||
attributes(
|
||||
'Main-Class': 'org.baseband.installer.Installer'
|
||||
'Main-Class': 'com.baseband.installer.Main'
|
||||
)
|
||||
}
|
||||
|
||||
archiveFileName = "BaseBand-Installer.jar"
|
||||
}
|
||||
|
||||
build.dependsOn(shadowJar)
|
77
Installer/src/main/java/com/baseband/installer/Key.java
Normal file
77
Installer/src/main/java/com/baseband/installer/Key.java
Normal file
|
@ -0,0 +1,77 @@
|
|||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.baseband.installer;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.SecureRandom;
|
||||
|
||||
public class Key implements Cloneable {
|
||||
protected final String string;
|
||||
|
||||
public Key() {
|
||||
this(SecureRandom.getSeed(1024));
|
||||
}
|
||||
|
||||
public Key(String s) {
|
||||
this.string = s;
|
||||
}
|
||||
|
||||
public Key(byte[] bytes) {
|
||||
this.string = new String(bytes, StandardCharsets.ISO_8859_1);
|
||||
}
|
||||
|
||||
public boolean equals(Key other) {
|
||||
return this.string.equals(other.string);
|
||||
}
|
||||
|
||||
public byte[] toBytes() {
|
||||
return this.string.getBytes();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.string;
|
||||
}
|
||||
|
||||
public String encryptString(String s) {
|
||||
char[] bytes = s.toCharArray();
|
||||
char[] eb = this.string.toCharArray();
|
||||
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] += eb[j];
|
||||
}
|
||||
}
|
||||
|
||||
return new String(bytes);
|
||||
}
|
||||
|
||||
public String decryptString(String s) {
|
||||
char[] bytes = s.toCharArray();
|
||||
char[] eb = this.string.toCharArray();
|
||||
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] -= eb[j];
|
||||
}
|
||||
}
|
||||
|
||||
return new String(bytes);
|
||||
}
|
||||
|
||||
protected Key clone() {
|
||||
try {
|
||||
return (Key)super.clone();
|
||||
} catch (CloneNotSupportedException var2) {
|
||||
return new Key(this.string);
|
||||
}
|
||||
}
|
||||
}
|
7
Installer/src/main/java/com/baseband/installer/Main.java
Normal file
7
Installer/src/main/java/com/baseband/installer/Main.java
Normal file
|
@ -0,0 +1,7 @@
|
|||
package com.baseband.installer;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Not implemented. Ask a developer to help you install BaseBand.");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.baseband.login;
|
||||
|
||||
import com.baseband.installer.Key;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
public class LoginGenerator {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
System.out.println("NOT INTENDED FOR END-USER USE. THIS IS A FALLBACK TOOL.");
|
||||
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
|
||||
|
||||
System.out.print("Key: ");
|
||||
String key = reader.readLine();
|
||||
|
||||
System.out.print("Username: ");
|
||||
String username = reader.readLine();
|
||||
|
||||
System.out.print("Password: ");
|
||||
String password = reader.readLine();
|
||||
|
||||
Key k = new Key(key);
|
||||
FileOutputStream fos = new FileOutputStream("baseband.login");
|
||||
PrintWriter writer = new PrintWriter(fos);
|
||||
writer.println(k.encryptString(username));
|
||||
writer.println(k.encryptString(password));
|
||||
writer.println(k.encryptString("GENERATED USING " + LoginGenerator.class.getName() + "!!"));
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@
|
|||
package old.baseband.installer;
|
||||
|
||||
|
||||
import com.baseband.installer.Key;
|
||||
import old.baseband.installer.util.minecraft.MinecraftFiles;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
|
@ -27,7 +28,7 @@ public class InstallerApp {
|
|||
private JFrame installerFrame;
|
||||
public static String username;
|
||||
public static String password;
|
||||
public static old.baseband.installer.Key keyinstance;
|
||||
public static com.baseband.installer.Key keyinstance;
|
||||
|
||||
public InstallerApp() {
|
||||
try {
|
||||
|
@ -132,7 +133,7 @@ public class InstallerApp {
|
|||
|
||||
//We need this to make sure we're not being poked at
|
||||
String ticket = getRandomTicket();
|
||||
keyinstance = new old.baseband.installer.Key(ticket);
|
||||
keyinstance = new com.baseband.installer.Key(ticket);
|
||||
byte[] encryptedTicket = aesE.doFinal(ticket.getBytes());
|
||||
outputF.writeInt(encryptedTicket.length);
|
||||
outputF.write(encryptedTicket);
|
||||
|
@ -292,7 +293,7 @@ public class InstallerApp {
|
|||
|
||||
//We need this to make sure we're not being poked at
|
||||
String ticket = getRandomTicket();
|
||||
keyinstance = new old.baseband.installer.Key(ticket);
|
||||
keyinstance = new com.baseband.installer.Key(ticket);
|
||||
byte[] encryptedTicket = aesE.doFinal(ticket.getBytes());
|
||||
outputF.writeInt(encryptedTicket.length);
|
||||
outputF.write(encryptedTicket);
|
||||
|
@ -317,7 +318,7 @@ public class InstallerApp {
|
|||
int responseInt = inputF.readInt();
|
||||
|
||||
if (responseInt >= 0 || responseInt == -2) {
|
||||
PrintStream printStream = new PrintStream(System.getProperty("user.home")+File.separator+".baseband.auth");
|
||||
/*PrintStream printStream = new PrintStream(System.getProperty("user.home")+File.separator+".baseband.auth");
|
||||
byte[] random = SecureRandom.getSeed(64);
|
||||
printStream.println(new String(Base64.getEncoder().encode(random)));
|
||||
printStream.println(username);
|
||||
|
@ -350,7 +351,7 @@ public class InstallerApp {
|
|||
bos.close();
|
||||
fos.close();
|
||||
JOptionPane.showMessageDialog(loginFrame, "Installed!", "BaseBand Installer", JOptionPane.INFORMATION_MESSAGE);
|
||||
System.exit(0);
|
||||
System.exit(0);*/
|
||||
} else {
|
||||
System.exit(0);
|
||||
}
|
||||
|
|
|
@ -1,89 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
||||
*/
|
||||
|
||||
package old.baseband.installer;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class Key {
|
||||
//Daniella made the actual encryption,
|
||||
//Jess made the serialization/byte handling/randomTicket
|
||||
|
||||
protected final String string;
|
||||
|
||||
private boolean debug = false;
|
||||
/**
|
||||
* Generates a random Key
|
||||
*/
|
||||
public Key() {
|
||||
string = randomAlphanumericString(4096);
|
||||
}
|
||||
|
||||
public Key(byte[] key) {
|
||||
string = new String(key, StandardCharsets.ISO_8859_1);
|
||||
}
|
||||
|
||||
public Key(String key) {
|
||||
string = key;
|
||||
}
|
||||
|
||||
public void setDebug(boolean debug) {
|
||||
this.debug = debug;
|
||||
}
|
||||
|
||||
public static int random(int lower, int upper) {
|
||||
return (int) (Math.floor(Math.random() * (upper - lower)) + lower);
|
||||
}
|
||||
public static String randomString(int length, String pool) {
|
||||
StringBuilder r = new StringBuilder();
|
||||
|
||||
for (int i = 0; i < length; i++) {
|
||||
r.append(pool.charAt(random(0, pool.length())));
|
||||
}
|
||||
|
||||
return r.toString();
|
||||
}
|
||||
public static String randomAlphanumericString(int length) {
|
||||
String alphabet = "abcdefghijklmnopqrstuvwxyz";
|
||||
String pool = alphabet + alphabet.toUpperCase() + "0123456789";
|
||||
|
||||
return randomString(length, pool);
|
||||
}
|
||||
|
||||
public byte[] decryptByte(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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encrypts a string
|
||||
* @param s string to encrypt
|
||||
* @return encrypted string
|
||||
*/
|
||||
public String encryptString(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);
|
||||
}
|
||||
}
|
|
@ -173,7 +173,7 @@ public class CustomClassLoader extends ClassLoader implements Util {
|
|||
private byte[] getBytes(String name) {
|
||||
PermissionManager[] pm = new PermissionManager[1];
|
||||
parent.mixinPermissionManager.access(x -> pm[0] = x.getValue());
|
||||
if(!name.replace('/', '.').startsWith("com.baseband.client.mixins") || !pm[0].checkCaller(new MixinStrictness()))
|
||||
if(!name.replace('/', '.').startsWith("com.baseband.client.mixin") || !pm[0].checkCaller(new MixinStrictness()))
|
||||
return null;
|
||||
|
||||
final byte[][] bytes = {null};
|
||||
|
|
3
mobf.sh
3
mobf.sh
|
@ -1,8 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
# ignore. mobf currently breaks loading
|
||||
exit
|
||||
|
||||
curl https://data.tudbut.de/mobf.jar > mobf.jar
|
||||
for file in "$@" ; do
|
||||
echo "$file"
|
||||
|
|
|
@ -2,9 +2,13 @@
|
|||
|
||||
export SSH_PRIVATEKEY="$(cat ~/.ssh/upload_key)"
|
||||
export BB_HOST=baseband.lol
|
||||
export BB_PORT=22
|
||||
export BB_PATH="$PWD/Server/run"
|
||||
if [ "$BB_PORT" = '' ] ; then
|
||||
export BB_PORT=46338
|
||||
fi
|
||||
if [ "$BB_PATH" = '' ] ; then
|
||||
export BB_PATH="/root/baseband/rewrite"
|
||||
fi
|
||||
|
||||
bash push_file.sh Server/build/libs/BaseBand-Server.jar
|
||||
bash push_file.sh Client/build/proguard/BaseBand-Broadway.jar
|
||||
bash push_file.sh Client/build/libs/BaseBand-Broadway.jar
|
||||
bash push_file.sh Loader/build/proguard/BaseBand-Loader.jar
|
Loading…
Add table
Reference in a new issue