From 30cabd25fda55ef921f307e6f9de3200be3592c1 Mon Sep 17 00:00:00 2001 From: Gravita Date: Tue, 11 May 2021 16:23:55 +0700 Subject: [PATCH] [FIX] Encrypted Runtime --- .../launchserver/binary/BuildContext.java | 47 ++++++++++++++++--- .../binary/tasks/MainBuildTask.java | 6 ++- 2 files changed, 45 insertions(+), 8 deletions(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/BuildContext.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/BuildContext.java index 46a0c75b..9184d2d5 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/BuildContext.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/BuildContext.java @@ -1,5 +1,6 @@ package pro.gravit.launchserver.binary; +import org.jetbrains.annotations.NotNull; import pro.gravit.launcher.Launcher; import pro.gravit.launcher.serialize.HOutput; import pro.gravit.launcher.serialize.stream.StreamObject; @@ -11,15 +12,18 @@ import javax.crypto.Cipher; import javax.crypto.CipherOutputStream; import javax.crypto.NoSuchPaddingException; +import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; import java.lang.reflect.Type; import java.net.URL; import java.nio.file.FileVisitResult; import java.nio.file.Path; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; +import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.util.HashSet; @@ -195,6 +199,7 @@ private final static class EncryptedRuntimeDirVisitor extends SimpleFileVisitor< private final Path sourceDir; private final String targetDir; private final SecretKeySpec sKeySpec; + private final IvParameterSpec iKeySpec; private EncryptedRuntimeDirVisitor(ZipOutputStream output, String aesKey, Map hashs, Path sourceDir, String targetDir) { this.output = output; @@ -204,7 +209,8 @@ private EncryptedRuntimeDirVisitor(ZipOutputStream output, String aesKey, Map