mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-16 08:56:04 +01:00
Remove the extra slash while loading resources. (#893)
* Remove the extra slash * Update src/main/java/emu/grasscutter/Configuration.java Co-authored-by: HotaruYS <105128850+HotaruYS@users.noreply.github.com> * Update src/main/java/emu/grasscutter/Configuration.java Co-authored-by: HotaruYS <105128850+HotaruYS@users.noreply.github.com> * Update src/main/java/emu/grasscutter/Configuration.java Co-authored-by: HotaruYS <105128850+HotaruYS@users.noreply.github.com> * Import java.nio.file.Paths to use Paths.get * Mark fields as private to prevent use *FOLDER directly * Remove unnecessary slash Co-authored-by: HotaruYS <105128850+HotaruYS@users.noreply.github.com>
This commit is contained in:
@@ -20,11 +20,11 @@ public final class Crypto {
|
||||
public static byte[] ENCRYPT_SEED_BUFFER = new byte[0];
|
||||
|
||||
public static void loadKeys() {
|
||||
DISPATCH_KEY = FileUtils.read(KEYS_FOLDER + "/dispatchKey.bin");
|
||||
DISPATCH_SEED = FileUtils.read(KEYS_FOLDER + "/dispatchSeed.bin");
|
||||
DISPATCH_KEY = FileUtils.read(KEY("dispatchKey.bin"));
|
||||
DISPATCH_SEED = FileUtils.read(KEY("dispatchSeed.bin"));
|
||||
|
||||
ENCRYPT_KEY = FileUtils.read(KEYS_FOLDER + "/secretKey.bin");
|
||||
ENCRYPT_SEED_BUFFER = FileUtils.read(KEYS_FOLDER + "/secretKeyBuffer.bin");
|
||||
ENCRYPT_KEY = FileUtils.read(KEY("secretKey.bin"));
|
||||
ENCRYPT_SEED_BUFFER = FileUtils.read(KEY("secretKeyBuffer.bin"));
|
||||
}
|
||||
|
||||
public static void xor(byte[] packet, byte[] key) {
|
||||
@@ -40,7 +40,7 @@ public final class Crypto {
|
||||
public static void extractSecretKeyBuffer(byte[] data) {
|
||||
try {
|
||||
GetPlayerTokenRsp p = GetPlayerTokenRsp.parseFrom(data);
|
||||
FileUtils.write(KEYS_FOLDER + "/secretKeyBuffer.bin", p.getSecretKeyBytes().toByteArray());
|
||||
FileUtils.write(KEY("/secretKeyBuffer.bin"), p.getSecretKeyBytes().toByteArray());
|
||||
Grasscutter.getLogger().info("Secret Key: " + p.getSecretKey());
|
||||
} catch (Exception e) {
|
||||
Grasscutter.getLogger().error("Crypto error.", e);
|
||||
@@ -50,7 +50,7 @@ public final class Crypto {
|
||||
public static void extractDispatchSeed(String data) {
|
||||
try {
|
||||
QueryCurrRegionHttpRsp p = QueryCurrRegionHttpRsp.parseFrom(Base64.getDecoder().decode(data));
|
||||
FileUtils.write(KEYS_FOLDER + "/dispatchSeed.bin", p.getRegionInfo().getSecretKey().toByteArray());
|
||||
FileUtils.write(KEY("/dispatchSeed.bin"), p.getRegionInfo().getSecretKey().toByteArray());
|
||||
} catch (Exception e) {
|
||||
Grasscutter.getLogger().error("Crypto error.", e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user