summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java11
-rw-r--r--src/main/java/com/aizistral/nochatreports/config/NCRConfig.java8
-rw-r--r--src/main/java/com/aizistral/nochatreports/config/NCRConfigClient.java2
-rw-r--r--src/main/java/com/aizistral/nochatreports/config/NCRConfigEncryption.java197
-rw-r--r--src/main/java/com/aizistral/nochatreports/core/EncryptionUtil.java78
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/AESCFB8Encryption.java40
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/AESCFB8Encryptor.java58
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/AESECBEncryption.java25
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/AESECBEncryptor.java33
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/AESEncryption.java96
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/AESEncryptor.java121
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/AESGCMEncryption.java25
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/AESGCMEncryptor.java38
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/CaesarEncryption.java56
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/CaesarEncryptor.java74
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/Encryption.java60
-rw-r--r--src/main/java/com/aizistral/nochatreports/encryption/Encryptor.java186
-rw-r--r--src/main/java/com/aizistral/nochatreports/gui/EncryptionButton.java46
-rw-r--r--src/main/java/com/aizistral/nochatreports/gui/EncryptionConfigScreen.java302
-rw-r--r--src/main/java/com/aizistral/nochatreports/gui/EncryptionWarningScreen.java59
-rw-r--r--src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatComponent.java84
-rw-r--r--src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatListener.java8
-rw-r--r--src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatScreen.java60
-rw-r--r--src/main/java/com/aizistral/nochatreports/mixins/client/MixinGuiMessageTagIcon.java47
-rw-r--r--src/main/resources/assets/nochatreports/lang/en_us.json30
-rw-r--r--src/main/resources/assets/nochatreports/lang/et_ee.json30
-rw-r--r--src/main/resources/assets/nochatreports/lang/ko_kr.json30
-rw-r--r--src/main/resources/assets/nochatreports/lang/pl_pl.json23
-rw-r--r--src/main/resources/assets/nochatreports/lang/pt_br.json30
-rw-r--r--src/main/resources/assets/nochatreports/lang/th_th.json27
-rw-r--r--src/main/resources/assets/nochatreports/textures/gui/encrypted_tag.pngbin207 -> 0 bytes
-rw-r--r--src/main/resources/assets/nochatreports/textures/gui/encryption_gui_icons.pngbin1242 -> 0 bytes
-rw-r--r--src/main/resources/assets/nochatreports/textures/gui/encryption_toggle_button.pngbin1539 -> 0 bytes
-rw-r--r--src/main/resources/nochatreports.mixins.json2
34 files changed, 0 insertions, 1886 deletions
diff --git a/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java b/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java
index 8139fca..6020a6b 100644
--- a/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java
+++ b/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java
@@ -203,17 +203,6 @@ public final class ModMenuIntegration implements ModMenuApi {
.setSaveConsumer(newValue -> NCRConfig.getClient().signingCheckDelaySeconds = newValue)
.build());
- // Warning for showEncryptionButton
- technical.addEntry(entryBuilder.startTextDescription(Component.translatable("gui.NoChatReports.showEncryptionButtonWarning"))
- .build());
-
- // Set an option for showEncryptionButton
- technical.addEntry(entryBuilder.startBooleanToggle(Component.translatable("option.NoChatReports.showEncryptionButton"), NCRConfig.getEncryption().showEncryptionButton)
- .setDefaultValue(true)
- .setTooltip(this.makeTooltip("option.NoChatReports.showEncryptionButton.tooltip"))
- .setSaveConsumer(newValue -> NCRConfig.getEncryption().showEncryptionButton = newValue)
- .build());
-
// Instructions for adding servers
whitelistedServers.addEntry(entryBuilder.startTextDescription(Component.translatable("option.NoChatReports.whitelistedServers.instructions"))
.build());
diff --git a/src/main/java/com/aizistral/nochatreports/config/NCRConfig.java b/src/main/java/com/aizistral/nochatreports/config/NCRConfig.java
index 5122741..c18be5d 100644
--- a/src/main/java/com/aizistral/nochatreports/config/NCRConfig.java
+++ b/src/main/java/com/aizistral/nochatreports/config/NCRConfig.java
@@ -19,7 +19,6 @@ public final class NCRConfig {
private static NCRConfigCommon common = null;
private static NCRConfigClient client = null;
private static NCRServerWhitelist whitelist = null;
- private static NCRConfigEncryption encryption = null;
private NCRConfig() {
throw new IllegalStateException("Can't touch this");
@@ -39,11 +38,6 @@ public final class NCRConfig {
return checkLoaded(() -> whitelist);
}
- @Environment(EnvType.CLIENT)
- public static NCRConfigEncryption getEncryption() {
- return checkLoaded(() -> encryption);
- }
-
private static <T extends JSONConfig> T checkLoaded(Supplier<T> config) {
if (config.get() == null) {
load();
@@ -58,7 +52,6 @@ public final class NCRConfig {
if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT) {
client = JSONConfig.loadConfig(NCRConfigClient.class, NCRConfigClient::new, NCRConfigClient.FILE_NAME);
whitelist = JSONConfig.loadConfig(NCRServerWhitelist.class, NCRServerWhitelist::new, NCRServerWhitelist.FILE_NAME);
- encryption = JSONConfig.loadConfig(NCRConfigEncryption.class, NCRConfigEncryption::new, NCRConfigEncryption.FILE_NAME);
}
save();
@@ -70,7 +63,6 @@ public final class NCRConfig {
if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT) {
checkLoaded(() -> client).saveFile();
checkLoaded(() -> whitelist).saveFile();
- checkLoaded(() -> encryption).saveFile();
}
Path readme = JSONConfig.CONFIG_DIR.resolve("NoChatReports/README.md");
diff --git a/src/main/java/com/aizistral/nochatreports/config/NCRConfigClient.java b/src/main/java/com/aizistral/nochatreports/config/NCRConfigClient.java
index 09496b1..e13f273 100644
--- a/src/main/java/com/aizistral/nochatreports/config/NCRConfigClient.java
+++ b/src/main/java/com/aizistral/nochatreports/config/NCRConfigClient.java
@@ -9,8 +9,6 @@ import java.util.Map;
import java.util.Optional;
import com.aizistral.nochatreports.core.ServerSafetyLevel;
-import com.aizistral.nochatreports.encryption.AESCFB8Encryptor;
-import com.aizistral.nochatreports.encryption.Encryptor;
import com.aizistral.nochatreports.gui.UnsafeServerScreen;
import com.aizistral.nochatreports.mixins.client.MixinChatListener;
import com.aizistral.nochatreports.mixins.client.MixinToastComponent;
diff --git a/src/main/java/com/aizistral/nochatreports/config/NCRConfigEncryption.java b/src/main/java/com/aizistral/nochatreports/config/NCRConfigEncryption.java
deleted file mode 100644
index 9cf7671..0000000
--- a/src/main/java/com/aizistral/nochatreports/config/NCRConfigEncryption.java
+++ /dev/null
@@ -1,197 +0,0 @@
-package com.aizistral.nochatreports.config;
-
-import java.nio.charset.StandardCharsets;
-import java.security.InvalidKeyException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Optional;
-
-import com.aizistral.nochatreports.encryption.AESCFB8Encryptor;
-import com.aizistral.nochatreports.encryption.Encryption;
-import com.aizistral.nochatreports.encryption.Encryptor;
-import com.aizistral.nochatreports.gui.UnsafeServerScreen;
-
-import net.minecraft.client.multiplayer.resolver.ServerAddress;
-import net.minecraft.network.chat.Component;
-import net.minecraft.util.StringUtil;
-
-public class NCRConfigEncryption extends JSONConfig {
- protected static final String FILE_NAME = "NoChatReports/NCR-Encryption.json";
- protected boolean skipWarning = false, enableEncryption = false, encryptPublic = true,
- showEncryptionButton = true, showEncryptionIndicators = true;
- protected String encryptionKey = Encryption.AES_CFB8.getDefaultKey(), encryptionPassphrase = "",
- algorithmName = Encryption.AES_CFB8.getName();
- protected List<String> encryptableCommands = List.of("msg:1", "w:1", "whisper:1", "tell:1", "r:0", "dm:1",
- "me:0", "m:1", "t:1", "pm:1", "emsg:1", "epm:1", "etell:1", "ewhisper:1");
- private transient Encryption algorithm;
- private transient boolean isValid = false;
- private transient String lastMessage = "???";
-
- protected NCRConfigEncryption() {
- super(FILE_NAME);
- }
-
- @Override
- public NCRConfigEncryption getDefault() {
- return new NCRConfigEncryption();
- }
-
- @Override
- protected void uponLoad() {
- this.algorithm = Encryption.getRegistered().stream().filter(e -> e.getName().equals(this.algorithmName))
- .findFirst().orElse(Encryption.AES_CFB8);
- this.validate();
- }
-
- private void validate() {
- this.isValid = this.algorithm.validateKey(this.encryptionKey);
- }
-
- public void toggleEncryption() {
- this.enableEncryption = !this.enableEncryption;
- this.saveFile();
- }
-
- public void setAlgorithm(Encryption encryption) {
- this.algorithm = encryption;
- this.algorithmName = encryption.getName();
- this.validate();
- this.saveFile();
- }
-
- public void setEncryptionKey(String key) {
- this.encryptionKey = key;
- this.validate();
- this.saveFile();
- }
-
- public void setEncryptionPassphrase(String pass) {
- this.encryptionPassphrase = pass;
- this.saveFile();
- }
-
- public void setEncryptPublic(boolean encryptPublic) {
- this.encryptPublic = encryptPublic;
- this.saveFile();
- }
-
- public void disableWarning() {
- this.skipWarning = true;
- }
-
- public boolean isWarningDisabled() {
- return this.skipWarning;
- }
-
- public boolean isEnabled() {
- return this.enableEncryption;
- }
-
- public String getEncryptionKey() {
- return this.encryptionKey;
- }
-
- public String getEncryptionPassphrase() {
- return this.encryptionPassphrase;
- }
-
- public boolean isValid() {
- return this.isValid;
- }
-
- public boolean shouldEncryptPublic() {
- return this.encryptPublic;
- }
-
- public boolean showEncryptionIndicators() {
- return this.showEncryptionIndicators;
- }
-
- public boolean isEnabledAndValid() {
- return this.isEnabled() && this.isValid();
- }
-
- public Encryption getAlgorithm() {
- return this.algorithm;
- }
-
- public boolean shouldEncrypt(String message) {
- return this.isEnabledAndValid() && this.getEncryptionStartIndex(message) != -1;
- }
-
- public boolean showEncryptionButton() {
- return this.showEncryptionButton;
- }
-
- public int getEncryptionStartIndex(String message) {
- if (!message.startsWith("/"))
- return this.encryptPublic ? 0 : -1;
- else {
- for (String rule : this.encryptableCommands) {
- String[] splat = rule.split(":");
-
- if (splat.length != 2)
- throw new IllegalArgumentException("Invalid encryptable command definition: " + rule
- + ", in file: " + FILE_NAME);
-
- String cmd = splat[0];
- String args = splat[1];
- int argnum = 0;
-
- try {
- argnum = Integer.valueOf(args);
- } catch (NumberFormatException ex) {
- throw new IllegalArgumentException("Invalid encryptable command definition: " + rule
- + ", in file: " + FILE_NAME);
- }
-
- String prefix = "/(" + cmd + "|.*:" + cmd + ") .*";
- if (message.matches(prefix)) {
- splat = message.split(" ", 2);
- char[] array = splat[1].toCharArray();
-
- for (int i = 0; i < array.length; i++) {
- char ch = array[i];
- if (argnum > 0) {
- if (ch == ' ') {
- argnum--;
- }
- continue;
- } else {
- int index = i + splat[0].length() + 1;
- return index < message.length() ? index : -1;
- }
- }
- } else {
- continue;
- }
- }
-
- return -1;
- }
- }
-
- public void setLastMessage(String lastMessage) {
- this.lastMessage = lastMessage;
- }
-
- public String getLastMessage() {
- return this.lastMessage;
- }
-
- /**
- * @return Chat encryptor, if encryption is enabled and user specified valid key in config.
- */
-
- public Optional<Encryptor<?>> getEncryptor() {
- if (!this.isEnabledAndValid())
- return Optional.empty();
-
- try {
- return Optional.of(this.algorithm.getProcessor(this.encryptionKey));
- } catch (InvalidKeyException ex) {
- throw new RuntimeException(ex); // shouldn't happen due to prior validation
- }
- }
-
-}
diff --git a/src/main/java/com/aizistral/nochatreports/core/EncryptionUtil.java b/src/main/java/com/aizistral/nochatreports/core/EncryptionUtil.java
deleted file mode 100644
index f0bcf4d..0000000
--- a/src/main/java/com/aizistral/nochatreports/core/EncryptionUtil.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package com.aizistral.nochatreports.core;
-
-import java.util.Optional;
-
-import javax.annotation.Nullable;
-
-import com.aizistral.nochatreports.config.NCRConfig;
-import com.aizistral.nochatreports.encryption.Encryptor;
-
-import net.minecraft.network.chat.Component;
-import net.minecraft.network.chat.ComponentContents;
-import net.minecraft.network.chat.MutableComponent;
-import net.minecraft.network.chat.contents.LiteralContents;
-import net.minecraft.network.chat.contents.TranslatableContents;
-
-public class EncryptionUtil {
-
- public static Optional<Component> tryDecrypt(Component component) {
- var optional = NCRConfig.getEncryption().getEncryptor();
- if (optional.isEmpty())
- return Optional.empty();
-
- Encryptor<?> encryption = optional.get();
- Component copy = recreate(component);
- ComponentContents contents = copy.getContents();
-
- return Optional.ofNullable(tryDecrypt(copy, encryption) ? copy : null);
- }
-
- public static boolean tryDecrypt(Component component, Encryptor<?> encryptor) {
- boolean decryptedSiblings = false;
- for (Component sibling : component.getSiblings()) {
- if (tryDecrypt(sibling, encryptor)) {
- decryptedSiblings = true;
- }
- }
-
- if (component.getContents() instanceof LiteralContents literal) {
- var decrypted = tryDecrypt(literal.text(), encryptor);
-
- if (decrypted.isPresent()) {
- ((MutableComponent)component).contents = new LiteralContents(decrypted.get());
- return true;
- }
- } else if (component.getContents() instanceof TranslatableContents translatable) {
- for (Object arg : translatable.args) {
- if (arg instanceof MutableComponent mutable) {
- if (tryDecrypt(mutable, encryptor)) {
- decryptedSiblings = true;
- }
- }
- }
- }
-
- return decryptedSiblings;
- }
-
- public static Optional<String> tryDecrypt(String message, Encryptor<?> encryptor) {
- try {
- String[] splat = message.contains(" ") ? message.split(" ") : new String[] { message };
- String decryptable = splat[splat.length-1];
-
- String decrypted = encryptor.decrypt(decryptable);
-
- if (decrypted.startsWith("#%"))
- return Optional.of(message.substring(0, message.length() - decryptable.length()) + decrypted.substring(2, decrypted.length()));
- else
- return Optional.empty();
- } catch (Exception ex) {
- return Optional.empty();
- }
- }
-
- public static Component recreate(Component component) {
- return Component.Serializer.fromJson(Component.Serializer.toStableJson(component));
- }
-
-}
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/AESCFB8Encryption.java b/src/main/java/com/aizistral/nochatreports/encryption/AESCFB8Encryption.java
deleted file mode 100644
index 77adf4c..0000000
--- a/src/main/java/com/aizistral/nochatreports/encryption/AESCFB8Encryption.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.aizistral.nochatreports.encryption;
-
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.KeySpec;
-import java.util.Random;
-
-import javax.crypto.Cipher;
-import javax.crypto.KeyGenerator;
-import javax.crypto.SecretKey;
-import javax.crypto.SecretKeyFactory;
-import javax.crypto.spec.IvParameterSpec;
-import javax.crypto.spec.PBEKeySpec;
-import javax.crypto.spec.SecretKeySpec;
-
-import net.minecraft.util.StringUtil;
-
-public class AESCFB8Encryption extends AESEncryption {
-
- protected AESCFB8Encryption() {
- super("CFB8", "NoPadding", true);
- }
-
- @Override
- public AESCFB8Encryptor getProcessor(String key) throws InvalidKeyException {
- return new AESCFB8Encryptor(key);
- }
-
- @Override
- public AESCFB8Encryptor getRandomProcessor() {
- try {
- return this.getProcessor(this.getRandomKey());
- } catch (InvalidKeyException ex) {
- throw new RuntimeException(ex);
- }
- }
-
-} \ No newline at end of file
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/AESCFB8Encryptor.java b/src/main/java/com/aizistral/nochatreports/encryption/AESCFB8Encryptor.java
deleted file mode 100644
index 5b32891..0000000
--- a/src/main/java/com/aizistral/nochatreports/encryption/AESCFB8Encryptor.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package com.aizistral.nochatreports.encryption;
-
-import java.nio.ByteBuffer;
-import java.nio.charset.StandardCharsets;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.security.spec.AlgorithmParameterSpec;
-import java.util.Base64;
-import java.util.Random;
-
-import javax.crypto.AEADBadTagException;
-import javax.crypto.BadPaddingException;
-import javax.crypto.Cipher;
-import javax.crypto.IllegalBlockSizeException;
-import javax.crypto.KeyGenerator;
-import javax.crypto.NoSuchPaddingException;
-import javax.crypto.SecretKey;
-import javax.crypto.spec.IvParameterSpec;
-import javax.crypto.spec.SecretKeySpec;
-
-import net.minecraft.server.network.ServerLoginPacketListenerImpl;
-import net.minecraft.util.Tuple;
-
-import static com.aizistral.nochatreports.encryption.Encryption.*;
-import static javax.crypto.Cipher.*;
-
-public class AESCFB8Encryptor extends AESEncryptor<AESCFB8Encryption> {
-
- protected AESCFB8Encryptor(String key) throws InvalidKeyException {
- super(key, Encryption.AES_CFB8);
- }
-
- protected AESCFB8Encryptor(SecretKey key, String mode, String padding, boolean iv) throws InvalidKeyException {
- super(key, Encryption.AES_CFB8);
- }
-
- @Override
- protected Tuple<AlgorithmParameterSpec, byte[]> generateIV() throws UnsupportedOperationException {
- long nonce = RANDOM.nextLong();
- byte[] iv = new byte[16];
- new Random(nonce).nextBytes(iv);
- return new Tuple<>(new IvParameterSpec(iv), ByteBuffer.allocate(8).putLong(nonce).array());
- }
-
- @Override
- protected Tuple<AlgorithmParameterSpec, byte[]> splitIV(byte[] message) throws UnsupportedOperationException {
- ByteBuffer buffer = ByteBuffer.wrap(message);
- int size = buffer.capacity();
- long nonce = buffer.getLong();
- byte[] encrypted = new byte[size - 8];
- buffer.get(encrypted);
- byte[] iv = new byte[16];
- new Random(nonce).nextBytes(iv);
- return new Tuple<>(new IvParameterSpec(iv), encrypted);
- }
-
-}
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/AESECBEncryption.java b/src/main/java/com/aizistral/nochatreports/encryption/AESECBEncryption.java
deleted file mode 100644
index 359d509..0000000
--- a/src/main/java/com/aizistral/nochatreports/encryption/AESECBEncryption.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.aizistral.nochatreports.encryption;
-
-import java.security.InvalidKeyException;
-
-public class AESECBEncryption extends AESEncryption {
-
- protected AESECBEncryption() {
- super("ECB", "PKCS5Padding", false);
- }
-
- @Override
- public AESECBEncryptor getProcessor(String key) throws InvalidKeyException {
- return new AESECBEncryptor(key);
- }
-
- @Override
- public AESECBEncryptor getRandomProcessor() {
- try {
- return this.getProcessor(this.getRandomKey());
- } catch (InvalidKeyException ex) {
- throw new RuntimeException(ex);
- }
- }
-
-}
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/AESECBEncryptor.java b/src/main/java/com/aizistral/nochatreports/encryption/AESECBEncryptor.java
deleted file mode 100644
index bffc960..0000000
--- a/src/main/java/com/aizistral/nochatreports/encryption/AESECBEncryptor.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.aizistral.nochatreports.encryption;
-
-import java.nio.ByteBuffer;
-import java.security.InvalidKeyException;
-import java.security.spec.AlgorithmParameterSpec;
-import java.util.Random;
-
-import javax.crypto.SecretKey;
-import javax.crypto.spec.IvParameterSpec;
-
-import net.minecraft.util.Tuple;
-
-public class AESECBEncryptor extends AESEncryptor<AESECBEncryption> {
-
- protected AESECBEncryptor(String key) throws InvalidKeyException {
- super(key, Encryption.AES_ECB);
- }
-
- protected AESECBEncryptor(SecretKey key, String mode, String padding, boolean iv) throws InvalidKeyException {
- super(key, Encryption.AES_ECB);
- }
-
- @Override
- protected Tuple<AlgorithmParameterSpec, byte[]> generateIV() throws UnsupportedOperationException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected Tuple<AlgorithmParameterSpec, byte[]> splitIV(byte[] message) throws UnsupportedOperationException {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/AESEncryption.java b/src/main/java/com/aizistral/nochatreports/encryption/AESEncryption.java
deleted file mode 100644
index f7c53cd..0000000
--- a/src/main/java/com/aizistral/nochatreports/encryption/AESEncryption.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package com.aizistral.nochatreports.encryption;
-
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.KeySpec;
-import java.util.Optional;
-import java.util.Random;
-
-import javax.crypto.KeyGenerator;
-import javax.crypto.SecretKey;
-import javax.crypto.SecretKeyFactory;
-import javax.crypto.spec.IvParameterSpec;
-import javax.crypto.spec.PBEKeySpec;
-import javax.crypto.spec.SecretKeySpec;
-
-import net.minecraft.util.StringUtil;
-import net.minecraft.util.Tuple;
-
-public abstract class AESEncryption extends Encryption {
- private final String mode, padding;
- private final boolean requiresIV;
-
- protected AESEncryption(String mode, String padding, boolean requiresIV) {
- super("aes_" + mode.toLowerCase() + "_base64", "AES/" + mode + "+Base64");
- this.mode = mode;
- this.padding = padding;
- this.requiresIV = requiresIV;
- }
-
- @Override
- public String getRandomKey() {
- try {
- KeyGenerator keyGenerator = KeyGenerator.getInstance("AES");
- keyGenerator.init(128);
- SecretKey key = keyGenerator.generateKey();
-
- return BASE64_ENCODER.encodeToString(key.getEncoded());
- } catch (NoSuchAlgorithmException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- @Override
- public String getDefaultKey() {
- return "blfrngArk3chG6wzncOZ5A==";
- }
-
- @Override
- public boolean supportsPassphrases() {
- return true;
- }
-
- @Override
- public String getPassphraseKey(String passphrase) {
- try {
- byte[] salt = new byte[16];
- new Random(1738389128127L).nextBytes(salt);
-
- KeySpec spec = new PBEKeySpec(passphrase.toCharArray(), salt, 65536, 128); // AES-128
- SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
- byte[] key = factory.generateSecret(spec).getEncoded();
-
- return BASE64_ENCODER.encodeToString(new SecretKeySpec(key, "AES").getEncoded());
- } catch (NoSuchAlgorithmException | InvalidKeySpecException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- @Override
- public boolean validateKey(String key) {
- if (StringUtil.isNullOrEmpty(key))
- return false;
-
- try {
- this.getProcessor(key);
- } catch (InvalidKeyException ex) {
- return false;
- }
-
- return true;
- }
-
- public String getMode() {
- return this.mode;
- }
-
- public String getPadding() {
- return this.padding;
- }
-
- public boolean requiresIV() {
- return this.requiresIV;
- }
-
-}
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/AESEncryptor.java b/src/main/java/com/aizistral/nochatreports/encryption/AESEncryptor.java
deleted file mode 100644
index d7ec841..0000000
--- a/src/main/java/com/aizistral/nochatreports/encryption/AESEncryptor.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package com.aizistral.nochatreports.encryption;
-
-import static com.aizistral.nochatreports.encryption.Encryption.AES_CFB8;
-import static com.aizistral.nochatreports.encryption.Encryption.BASE64_DECODER;
-import static com.aizistral.nochatreports.encryption.Encryption.BASE64_ENCODER;
-import static javax.crypto.Cipher.DECRYPT_MODE;
-import static javax.crypto.Cipher.ENCRYPT_MODE;
-
-import java.nio.ByteBuffer;
-import java.nio.charset.StandardCharsets;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.security.spec.AlgorithmParameterSpec;
-import java.util.Random;
-
-import javax.annotation.Nullable;
-import javax.crypto.AEADBadTagException;
-import javax.crypto.BadPaddingException;
-import javax.crypto.Cipher;
-import javax.crypto.IllegalBlockSizeException;
-import javax.crypto.NoSuchPaddingException;
-import javax.crypto.SecretKey;
-import javax.crypto.spec.IvParameterSpec;
-import javax.crypto.spec.SecretKeySpec;
-
-import net.minecraft.SharedConstants;
-import net.minecraft.util.Tuple;
-
-public abstract class AESEncryptor<T extends AESEncryption> extends Encryptor<T> {
- private final T encryption;
- private final SecretKey key;
- private final Cipher encryptor, decryptor;
- private final boolean useIV;
-
- protected AESEncryptor(String key, T encryption) throws InvalidKeyException {
- this(new SecretKeySpec(decodeBinaryKey(key), "AES"), encryption);
- }
-
- protected AESEncryptor(SecretKey key, T encryption) throws InvalidKeyException {
- this.encryption = encryption;
- this.useIV = encryption.requiresIV();
- String mode = encryption.getMode();
- String padding = encryption.getPadding();
-
- try {
- this.key = key;
-
- Cipher encryptor = Cipher.getInstance(this.key.getAlgorithm() + "/" + mode + "/" + padding);
- if (this.useIV) {
- encryptor.init(ENCRYPT_MODE, this.key, this.generateIV().getA());
- } else {
- encryptor.init(ENCRYPT_MODE, this.key);
-
- }
- this.encryptor = encryptor;
-
- Cipher decryptor = Cipher.getInstance(this.key.getAlgorithm() + "/" + mode + "/" + padding);
- if (this.useIV) {
- decryptor.init(DECRYPT_MODE, this.key, this.generateIV().getA());
- } else {
- decryptor.init(DECRYPT_MODE, this.key);
- }
- this.decryptor = decryptor;
- } catch (NoSuchAlgorithmException | NoSuchPaddingException ex) {
- throw new RuntimeException(ex);
- } catch (InvalidAlgorithmParameterException ex) {
- throw new InvalidKeyException(ex);
- }
- }
-
- @Override
- public String encrypt(String message) {
- try {
- if (this.useIV) {
- var tuple = this.generateIV();
-
- this.encryptor.init(ENCRYPT_MODE, this.key, tuple.getA());
- byte[] encrypted = this.encryptor.doFinal(toBytes(message));
-
- return encodeBase64R(ByteBuffer.allocate(encrypted.length + tuple.getB().length).put(tuple.getB())
- .put(encrypted).array());
- } else
- return encodeBase64R(this.encryptor.doFinal(toBytes(message)));
- } catch (IllegalBlockSizeException | BadPaddingException | InvalidKeyException | InvalidAlgorithmParameterException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- @Override
- public String decrypt(String message) {
- try {
- if (this.useIV) {
- var tuple = this.splitIV(decodeBase64RBytes(message));
-
- this.decryptor.init(DECRYPT_MODE, this.key, tuple.getA());
- return fromBytes(this.decryptor.doFinal(tuple.getB()));
- } else
- return fromBytes(this.decryptor.doFinal(decodeBase64RBytes(message)));
- } catch (AEADBadTagException ex) {
- return "???";
- } catch (IllegalBlockSizeException | BadPaddingException | InvalidKeyException | InvalidAlgorithmParameterException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- @Override
- public String getKey() {
- return encodeBinaryKey(this.key.getEncoded());
- }
-
- @Override
- public T getAlgorithm() {
- return this.encryption;
- }
-
- protected abstract Tuple<AlgorithmParameterSpec, byte[]> generateIV() throws UnsupportedOperationException;
-
- protected abstract Tuple<AlgorithmParameterSpec, byte[]> splitIV(byte[] message) throws UnsupportedOperationException;
-
-}
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/AESGCMEncryption.java b/src/main/java/com/aizistral/nochatreports/encryption/AESGCMEncryption.java
deleted file mode 100644
index f50ec85..0000000
--- a/src/main/java/com/aizistral/nochatreports/encryption/AESGCMEncryption.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.aizistral.nochatreports.encryption;
-
-import java.security.InvalidKeyException;
-
-public class AESGCMEncryption extends AESEncryption {
-
- protected AESGCMEncryption() {
- super("GCM", "NoPadding", true);
- }
-
- @Override
- public AESGCMEncryptor getProcessor(String key) throws InvalidKeyException {
- return new AESGCMEncryptor(key);
- }
-
- @Override
- public AESGCMEncryptor getRandomProcessor() {
- try {
- return this.getProcessor(this.getRandomKey());
- } catch (InvalidKeyException ex) {
- throw new RuntimeException(ex);
- }
- }
-
-}
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/AESGCMEncryptor.java b/src/main/java/com/aizistral/nochatreports/encryption/AESGCMEncryptor.java
deleted file mode 100644
index 3d11a36..0000000
--- a/src/main/java/com/aizistral/nochatreports/encryption/AESGCMEncryptor.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.aizistral.nochatreports.encryption;
-
-import java.nio.ByteBuffer;
-import java.security.InvalidKeyException;
-import java.security.spec.AlgorithmParameterSpec;
-
-import javax.crypto.SecretKey;
-import javax.crypto.spec.GCMParameterSpec;
-import javax.crypto.spec.IvParameterSpec;
-
-import net.minecraft.util.Tuple;
-
-public class AESGCMEncryptor extends AESEncryptor<AESGCMEncryption> {
-
- protected AESGCMEncryptor(String key) throws InvalidKeyException {
- super(key, Encryption.AES_GCM);
- }
-
- protected AESGCMEncryptor(SecretKey key) throws InvalidKeyException {
- super(key, Encryption.AES_GCM);
- }
-
- @Override
- protected Tuple<AlgorithmParameterSpec, byte[]> generateIV() throws UnsupportedOperationException {
- byte[] iv = new byte[12];
- RANDOM.nextBytes(iv);
- return new Tuple<>(new GCMParameterSpec(96, iv), iv);
- }
-
- @Override
- protected Tuple<AlgorithmParameterSpec, byte[]> splitIV(byte[] message) throws UnsupportedOperationException {
- byte[] iv = new byte[12];
- byte[] msg = new byte[message.length - 12];
- ByteBuffer.wrap(message).get(iv).get(msg);
- return new Tuple<>(new GCMParameterSpec(96, iv), msg);
- }
-
-}
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/CaesarEncryption.java b/src/main/java/com/aizistral/nochatreports/encryption/CaesarEncryption.java
deleted file mode 100644
index 16536bc..0000000
--- a/src/main/java/com/aizistral/nochatreports/encryption/CaesarEncryption.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package com.aizistral.nochatreports.encryption;
-
-import java.security.InvalidKeyException;
-import java.security.SecureRandom;
-
-public class CaesarEncryption extends Encryption {
-
- protected CaesarEncryption() {
- super("caesar", "Caesar");
- }
-
- @Override
- public String getRandomKey() {
- return String.valueOf(1 + new SecureRandom().nextInt(1024));
- }
-
- @Override
- public String getDefaultKey() {
- return "3";
- }
-
- @Override
- public boolean supportsPassphrases() {
- return false;
- }
-
- @Override
- public String getPassphraseKey(String passphrase) throws UnsupportedOperationException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean validateKey(String key) {
- try {
- int value = Integer.valueOf(key);
- return value > 0 && value < 1025;
- } catch (NumberFormatException ex) {
- return false;
- }
- }
-
- @Override
- public CaesarEncryptor getProcessor(String key) throws InvalidKeyException {
- return new CaesarEncryptor(key);
- }
-
- @Override
- public CaesarEncryptor getRandomProcessor() {
- try {
- return this.getProcessor(this.getRandomKey());
- } catch (InvalidKeyException ex) {
- throw new RuntimeException(ex);
- }
- }
-
-}
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/CaesarEncryptor.java b/src/main/java/com/aizistral/nochatreports/encryption/CaesarEncryptor.java
deleted file mode 100644
index 8ed8cfe..0000000
--- a/src/main/java/com/aizistral/nochatreports/encryption/CaesarEncryptor.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.aizistral.nochatreports.encryption;
-
-import java.security.InvalidKeyException;
-
-import com.aizistral.nochatreports.NoChatReports;
-
-import net.minecraft.SharedConstants;
-
-public class CaesarEncryptor extends Encryptor<CaesarEncryption> {
- private static final char PARAGRAPH = '\u00a7', PARAGRAPH_PLACEHOLDER = '\uffef',
- DELETE = '\u007f', DELETE_PLACEHOLDER = '\ufff0';
- private final int shift;
-
- protected CaesarEncryptor(int shift) throws InvalidKeyException {
- if (!Encryption.CAESAR.validateKey(String.valueOf(shift)))
- throw new InvalidKeyException();
- this.shift = shift;
- }
-
- protected CaesarEncryptor(String key) throws InvalidKeyException {
- this.shift = fromString(key);
- }
-
- @Override
- public String encrypt(String message) {
- char[] chars = ensureUTF8(message).toCharArray();
-
- for (int i = 0; i < chars.length; i++) {
- chars[i] = (char) (chars[i] + this.shift);
-
- if (chars[i] == PARAGRAPH) {
- chars[i] = PARAGRAPH_PLACEHOLDER;
- } else if (chars[i] == DELETE) {
- chars[i] = DELETE_PLACEHOLDER;
- }
- }
-
- return new String(chars);
- }
-
- @Override
- public String decrypt(String message) {
- char[] chars = ensureUTF8(message).toCharArray();
-
- for (int i = 0; i < chars.length; i++) {
- if (chars[i] == PARAGRAPH_PLACEHOLDER) {
- chars[i] = PARAGRAPH;
- } else if (chars[i] == DELETE_PLACEHOLDER) {
- chars[i] = DELETE;
- }
-
- chars[i] = (char) (chars[i] - this.shift);
- }
-
- return new String(chars);
- }
-
- @Override
- public CaesarEncryption getAlgorithm() {
- return Encryption.CAESAR;
- }
-
- @Override
- public String getKey() {
- return String.valueOf(this.shift);
- }
-
- private static int fromString(String key) throws InvalidKeyException {
- if (!Encryption.CAESAR.validateKey(key))
- throw new InvalidKeyException(key);
- return Integer.valueOf(key);
- }
-
-}
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/Encryption.java b/src/main/java/com/aizistral/nochatreports/encryption/Encryption.java
deleted file mode 100644
index 826f521..0000000
--- a/src/main/java/com/aizistral/nochatreports/encryption/Encryption.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package com.aizistral.nochatreports.encryption;
-
-import java.nio.ByteBuffer;
-import java.security.InvalidKeyException;
-import java.util.ArrayList;
-import java.util.Base64;
-import java.util.Collections;
-import java.util.List;
-
-public abstract class Encryption {
- private static final List<Encryption> REGISTERED = new ArrayList<>();
- protected static final Base64.Encoder BASE64_ENCODER = Base64.getEncoder();
- protected static final Base64.Decoder BASE64_DECODER = Base64.getDecoder();
-
- public static final AESCFB8Encryption AES_CFB8 = new AESCFB8Encryption();
- public static final AESGCMEncryption AES_GCM = new AESGCMEncryption();
- public static final AESECBEncryption AES_ECB = new AESECBEncryption();
- public static final CaesarEncryption CAESAR = new CaesarEncryption();
-
- private final String id, name;
-
- protected Encryption(String id, String name) {
- this.id = id;
- this.name = name;
-
- if (REGISTERED.stream().filter(e -> e.getID().equals(id) || e.getName().equals(name))
- .findAny().isPresent())
- throw new IllegalStateException("Duplicate encryption algorithm registered! ID: " + this.getID() +
- ", Name: " + this.getName());
-
- REGISTERED.add(this);
- }
-
- public String getID() {
- return this.id;
- }
-
- public String getName() {
- return this.name;
- }
-
- public abstract String getRandomKey();
-
- public abstract String getDefaultKey();
-
- public abstract boolean supportsPassphrases();
-
- public abstract String getPassphraseKey(String passphrase) throws UnsupportedOperationException;
-
- public abstract boolean validateKey(String key);
-
- public abstract Encryptor<?> getProcessor(String key) throws InvalidKeyException;
-
- public abstract Encryptor<?> getRandomProcessor();
-
- public static List<Encryption> getRegistered() {
- return Collections.unmodifiableList(REGISTERED);
- }
-
-}
diff --git a/src/main/java/com/aizistral/nochatreports/encryption/Encryptor.java b/src/main/java/com/aizistral/nochatreports/encryption/Encryptor.java
deleted file mode 100644
index 220874d..0000000
--- a/src/main/java/com/aizistral/nochatreports/encryption/Encryptor.java
+++ /dev/null
@@ -1,186 +0,0 @@
-package com.aizistral.nochatreports.encryption;
-
-import java.nio.ByteBuffer;
-import java.nio.charset.StandardCharsets;
-import java.security.InvalidKeyException;
-import java.security.SecureRandom;
-import java.util.Arrays;
-import java.util.Base64;
-import java.util.List;
-import java.util.Map;
-
-import it.unimi.dsi.fastutil.chars.Char2CharArrayMap;
-import it.unimi.dsi.fastutil.chars.Char2CharMap;
-import it.unimi.dsi.fastutil.chars.Char2CharMaps;
-
-public abstract class Encryptor<T extends Encryption> {
- protected static final SecureRandom RANDOM = new SecureRandom();
- protected static final Char2CharMap BASE64R_SHIFTS = createBase64RShifts();
- protected static final Char2CharMap BASE64R_SHIFTS_REVERSE = createBase64RShiftsReverse();
-
- protected Encryptor() {
- // NO-OP
- }
-
- public abstract String encrypt(String message);
-
- public abstract String decrypt(String message);
-
- public abstract T getAlgorithm();
-
- public abstract String getKey();
-
- protected static String shiftBase64R(String string) {
- char[] chars = ensureUTF8(string).toCharArray();
-
- for (int i = 0; i < chars.length; i++) {
- chars[i] = BASE64R_SHIFTS.get(chars[i]);
- }
-
- return new String(chars);
- }
-
- protected static String unshiftBase64R(String string) {
- char[] chars = ensureUTF8(string).toCharArray();
-
- for (int i = 0; i < chars.length; i++) {
- chars[i] = BASE64R_SHIFTS_REVERSE.get(chars[i]);
- }
-
- return new String(chars);
- }
-
- protected static byte[] toBytes(String string) {
- return string.getBytes(StandardCharsets.UTF_8);
- }
-
- protected static String fromBytes(byte[] bytes) {
- return new String(bytes, StandardCharsets.UTF_8);
- }
-
- protected static String ensureUTF8(String string) {
- return fromBytes(toBytes(string));
- }
-
- protected static String encodeBase64R(String string) {
- return encodeBase64R(toBytes(string));
- }
-
- protected static String encodeBase64R(byte[] bytes) {
- return shiftBase64R(fromBytes(Encryption.BASE64_ENCODER.encode(bytes)));
- }
-
- protected static byte[] encodeBase64RBytes(String string) {
- return toBytes(encodeBase64R(toBytes(string)));
- }
-
- protected static String decodeBase64R(String string) {
- return fromBytes(decodeBase64RBytes(string));
- }
-
- protected static byte[] decodeBase64RBytes(String string) {
- return Encryption.BASE64_DECODER.decode(toBytes(unshiftBase64R(string)));
- }
-
- protected static String encodeBinaryKey(byte[] key) {
- return fromBytes(Encryption.BASE64_ENCODER.encode(key));
- }
-
- protected static byte[] decodeBinaryKey(String key) throws InvalidKeyException {
- try {
- return Encryption.BASE64_DECODER.decode(toBytes(key));
- } catch (Exception ex) {
- throw new InvalidKeyException(ex);
- }
- }
-
- protected static byte[] mergeBytes(byte[] array1, byte[] array2) {
- byte[] result = Arrays.copyOf(array1, array1.length + array2.length);
- System.arraycopy(array2, 0, result, array1.length, array2.length);
- return result;
- }
-
- private static Char2CharMap createBase64RShiftsReverse() {
- Char2CharMap map = createBase64RShifts();
- Char2CharMap reverse = new Char2CharArrayMap(64);
-
- for (char ch : map.keySet()) {
- reverse.put(map.get(ch), ch);
- }
-
- return Char2CharMaps.unmodifiable(reverse);
- }
-
- private static Char2CharMap createBase64RShifts() {
- Char2CharMap map = new Char2CharArrayMap(64);
-
- map.put('A', '!');
- map.put('B', '"');
- map.put('C', '#');
- map.put('D', '$');
- map.put('E', '%');
- map.put('F', '¼');
- map.put('G', '\'');
- map.put('H', '(');
- map.put('I', ')');
- map.put('J', ',');
- map.put('K', '-');
- map.put('L', '.');
- map.put('M', ':');
- map.put('N', ';');
- map.put('O', '<');
- map.put('P', '=');
- map.put('Q', '>');
- map.put('R', '?');
- map.put('S', '@');
- map.put('T', '[');
- map.put('U', '\\');
- map.put('V', ']');
- map.put('W', '^');
- map.put('X', '_');
- map.put('Y', '`');
- map.put('Z', '{');
- map.put('a', '|');
- map.put('b', '}');
- map.put('c', '~');
- map.put('d', '¡');
- map.put('e', '¢');
- map.put('f', '£');
- map.put('g', '¤');
- map.put('h', '¥');
- map.put('i', '¦');
- map.put('j', '¨');
- map.put('k', '©');
- map.put('l', 'ª');
- map.put('m', '«');
- map.put('n', '¬');
- map.put('o', '®');
- map.put('p', '¯');
- map.put('q', '°');
- map.put('r', '±');
- map.put('s', '²');
- map.put('t', '³');
- map.put('u', 'µ');
- map.put('v', '¶');
- map.put('w', '·');
- map.put('x', '¸');
- map.put('y', '¹');
- map.put('z', 'º');
- map.put('0', '0');
- map.put('1', '1');
- map.put('2', '2');
- map.put('3', '3');
- map.put('4', '4');
- map.put('5', '5');
- map.put('6', '6');
- map.put('7', '7');
- map.put('8', '8');
- map.put('9', '9');
- map.put('+', '+');
- map.put('/', '»');
- map.put('=', '¿');
-
- return Char2CharMaps.unmodifiable(map);
- }
-
-}
diff --git a/src/main/java/com/aizistral/nochatreports/gui/EncryptionButton.java b/src/main/java/com/aizistral/nochatreports/gui/EncryptionButton.java
deleted file mode 100644
index 5620a6b..0000000
--- a/src/main/java/com/aizistral/nochatreports/gui/EncryptionButton.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.aizistral.nochatreports.gui;
-
-import com.aizistral.nochatreports.config.NCRConfig;
-import com.aizistral.nochatreports.mixins.client.MixinChatScreen;
-
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.components.ImageButton;
-import net.minecraft.client.gui.screens.Screen;
-import net.minecraft.network.chat.Component;
-import net.minecraft.resources.ResourceLocation;
-
-public class EncryptionButton extends ImageButton {
- private final Screen parent;
-
- public EncryptionButton(int x, int y, int xSize, int ySize, int xTexStart, int yTexStart, int yStateDiff,
- ResourceLocation texture, int textureWidth, int textureHeight, OnPress onPress, OnTooltip onTooltip,
- Component name, Screen parent) {
- super(x, y, xSize, ySize, xTexStart, yTexStart, yStateDiff, texture, textureWidth, textureHeight, onPress,
- onTooltip, name);
- this.parent = parent;
- }
-
- @Override
- public boolean mouseClicked(double x, double y, int i) {
- if (!this.active || !this.visible)
- return false;
-
- if (i == 1 && this.clicked(x, y)) {
- this.playDownSound(Minecraft.getInstance().getSoundManager());
- this.openEncryptionConfig();
- return true;
- }
-
- return super.mouseClicked(x, y, i);
- }
-
- public void openEncryptionConfig() {
- if (!EncryptionWarningScreen.seenOnThisSession() && !NCRConfig.getEncryption().isWarningDisabled()
- && !NCRConfig.getEncryption().isEnabledAndValid()) {
- Minecraft.getInstance().setScreen(new EncryptionWarningScreen(this.parent));
- } else {
- Minecraft.getInstance().setScreen(new EncryptionConfigScreen(this.parent));
- }
- }
-
-}
diff --git a/src/main/java/com/aizistral/nochatreports/gui/EncryptionConfigScreen.java b/src/main/java/com/aizistral/nochatreports/gui/EncryptionConfigScreen.java
deleted file mode 100644
index 173a4a1..0000000
--- a/src/main/java/com/aizistral/nochatreports/gui/EncryptionConfigScreen.java
+++ /dev/null
@@ -1,302 +0,0 @@
-package com.aizistral.nochatreports.gui;
-
-import java.util.List;
-
-import org.spongepowered.include.com.google.common.base.Objects;
-
-import com.aizistral.nochatreports.config.NCRConfig;
-import com.aizistral.nochatreports.config.NCRConfigEncryption;
-import com.aizistral.nochatreports.encryption.Encryption;
-import com.mojang.blaze3d.platform.InputConstants;
-import com.mojang.blaze3d.systems.RenderSystem;
-import com.mojang.blaze3d.vertex.PoseStack;
-
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
-import net.minecraft.ChatFormatting;
-import net.minecraft.client.gui.Font;
-import net.minecraft.client.gui.components.Button;
-import net.minecraft.client.gui.components.Checkbox;
-import net.minecraft.client.gui.components.CycleButton;
-import net.minecraft.client.gui.components.EditBox;
-import net.minecraft.client.gui.components.ImageButton;
-import net.minecraft.client.gui.components.MultiLineLabel;
-import net.minecraft.client.gui.components.TooltipAccessor;
-import net.minecraft.client.gui.screens.Screen;
-import net.minecraft.client.gui.screens.inventory.AbstractCommandBlockEditScreen;
-import net.minecraft.client.gui.screens.inventory.CommandBlockEditScreen;
-import net.minecraft.network.chat.CommonComponents;
-import net.minecraft.network.chat.Component;
-import net.minecraft.network.chat.FormattedText;
-import net.minecraft.network.chat.MutableComponent;
-import net.minecraft.resources.ResourceLocation;
-import net.minecraft.util.FormattedCharSequence;
-import net.minecraft.util.StringUtil;
-import net.minecraft.world.level.BaseCommandBlock;
-import net.minecraft.world.level.block.entity.CommandBlockEntity;
-
-@Environment(EnvType.CLIENT)
-public class EncryptionConfigScreen extends Screen {
- private static final ResourceLocation ENCRYPTION_ICONS = new ResourceLocation("nochatreports", "textures/gui/encryption_gui_icons.png");
- private static final Component HEADER = Component.translatable("gui.nochatreports.encryption_config.header");
- private static final Component KEY_DESC = Component.translatable("gui.nochatreports.encryption_config.key_desc");
- private static final Component PASS_DESC = Component.translatable("gui.nochatreports.encryption_config.passphrase_desc");
- private static final Component VALIDATION_OK = Component.translatable("gui.nochatreports.encryption_config.validation_ok");
- private static final Component VALIDATION_FAILED = Component.translatable("gui.nochatreports.encryption_config.validation_failed");
- private static final Component DICE_TOOLTIP = Component.translatable("gui.nochatreports.encryption_config.dice_tooltip");
- private static final Component PASS_NOT_ALLOWED = Component.translatable("gui.nochatreports.encryption_config.pass_not_allowed");
- private static final Component ENCRYPT_PUBLIC = Component.translatable("gui.nochatreports.encryption_config.encrypt_public");
-
- private static final int FIELDS_Y_START = 45;
- private final Screen previous;
- private CustomEditBox keyField, passField;
- private ImageButton validationIcon;
- private CycleButton<Encryption> algorithmButton;
- private MultiLineLabel keyDesc = MultiLineLabel.EMPTY, passDesc = MultiLineLabel.EMPTY;
- protected Checkbox encryptPublicCheck;
- private boolean settingPassKey = false;
-
- public EncryptionConfigScreen(Screen previous) {
- super(CommonComponents.EMPTY);
- this.previous = previous;
- }
-
- private NCRConfigEncryption getConfig() {
- return NCRConfig.getEncryption();
- }
-
- @Override
- protected void init() {
- this.minecraft.keyboardHandler.setSendRepeatsToGui(true);
- this.clearWidgets();
- super.init();
-
- int w = (int) (this.width * (this.hugeGUI() ? 0.9 : 0.7));
-
- this.keyDesc = MultiLineLabel.create(this.font, KEY_DESC, w - 5);
- int keyDescSpace = (this.keyDesc.getLineCount() + 1) * this.getLineHeight();
-
- this.passDesc = MultiLineLabel.create(this.font, PASS_DESC, w - 5);
- int passDescSpace = (this.passDesc.getLineCount() + 1) * this.getLineHeight();
-
- w -= 52;
-
- this.keyField = new CustomEditBox(this.font, (this.width - w)/2 - 2, (this.hugeGUI() ? 25 : FIELDS_Y_START) + keyDescSpace - 15,
- w, 18, CommonComponents.EMPTY);
- this.keyField.setMaxLength(512);
- this.keyField.setResponder(this::onKeyUpdate);
- this.addWidget(this.keyField);
-
- var button = new ImageButton(this.keyField.x + this.keyField.getWidth() - 15, this.keyField.y + 3, 12,
- 12, 0, 0, 0, ENCRYPTION_ICONS, 64, 64, btn -> {}, (btn, poseStack, i, j) ->
- this.renderTooltip(poseStack, this.minecraft.font.split(this.validationIcon.yTexStart == 0
- ? VALIDATION_OK : VALIDATION_FAILED, 250), i, j), Component.empty());
- button.active = false;
- button.visible = true;
-
- this.addRenderableOnly(this.validationIcon = button);
-
- button = new ImageButton(this.keyField.x - 22, this.keyField.y - 0, 18, 18, 0,
- 28, 0, ENCRYPTION_ICONS, 64, 64, btn -> {}, (btn, poseStack, i, j) ->
- this.renderTooltip(poseStack, this.minecraft.font.split(CommonComponents.EMPTY, 250), i, j),
- Component.empty());
- button.active = false;
- button.visible = true;
-
- this.addRenderableOnly(button);
-
- button = new ImageButton(this.keyField.x + this.keyField.getWidth() + 4, this.keyField.y - 1, 23, 20, 41,
- 24, 20, ENCRYPTION_ICONS, 64, 64, btn -> {
- this.unfocusFields();
- this.keyField.setValue(this.algorithmButton.getValue().getRandomKey());
- }, (btn, poseStack, i, j) ->
- this.renderTooltip(poseStack, this.minecraft.font.split(DICE_TOOLTIP, 250), i, j),
- Component.empty());
- button.active = true;
- button.visible = true;
-
- this.addRenderableWidget(button);
-
- w += 25;
-
- this.passField = new CustomEditBox(this.font, (this.width - w)/2 + 11, this.keyField.y +
- this.keyField.getHeight() + passDescSpace + (this.hugeGUI() ? -3 : 13), w, 18, CommonComponents.EMPTY);
- this.passField.setMaxLength(512);
- this.passField.setResponder(this::onPassphraseUpdate);
- this.addWidget(this.passField);
-
- button = new ImageButton(this.passField.x - 22, this.passField.y - 0, 18, 18, 0,
- 46, 0, ENCRYPTION_ICONS, 64, 64, btn -> {}, (btn, poseStack, i, j) ->
- this.renderTooltip(poseStack, this.minecraft.font.split(CommonComponents.EMPTY, 250), i, j),
- Component.empty());
- button.active = false;
- button.visible = true;
-
- this.addRenderableOnly(button);
-
- int checkWidth = this.font.width(ENCRYPT_PUBLIC);
- this.encryptPublicCheck = new Checkbox(this.width / 2 - checkWidth / 2 - 8, this.passField.y + 24, checkWidth + 24, 20,
- ENCRYPT_PUBLIC, NCRConfig.getEncryption().shouldEncryptPublic());
- this.addRenderableWidget(this.encryptPublicCheck);
-
- this.addRenderableWidget(new Button(this.width / 2 + 4, this.passField.y + 48, 219, 20,
- CommonComponents.GUI_DONE, btn -> {
- this.onDone();
- this.onClose();
- }));
-
- CycleButton<Encryption> cycle = CycleButton.<Encryption>builder(value -> {
- return Component.translatable("gui.nochatreports.encryption_config.algorithm",
- Component.translatable("algorithm.nochatreports." + value.getID() + ".name"));
- }).withValues(Encryption.getRegistered()).displayOnlyValue().withInitialValue(this.getConfig()
- .getAlgorithm()).withTooltip(value -> this.minecraft.font.split(
- Component.translatable("algorithm.nochatreports." + value.getID()), 250))
- .create(this.width / 2 - 4 - 218, this.passField.y + 48, 218, 20, CommonComponents.EMPTY,
- (cycleButton, value) -> {
- this.unfocusFields();
- this.onAlgorithmUpdate(value);
- });
-
- this.addRenderableWidget(this.algorithmButton = cycle);
-
- this.onAlgorithmUpdate(this.algorithmButton.getValue());
-
- if (!StringUtil.isNullOrEmpty(this.getConfig().getEncryptionPassphrase())) {
- this.passField.setValue(this.getConfig().getEncryptionPassphrase());
- } else if (!StringUtil.isNullOrEmpty(this.getConfig().getEncryptionKey())) {
- if (!Objects.equal(this.getConfig().getEncryptionKey(), this.algorithmButton.getValue()
- .getDefaultKey())) {
- this.keyField.setValue(this.getConfig().getEncryptionKey());
- } else {
- this.keyField.setValue("");
- }
- }
- }
-
- @Override
- public void render(PoseStack poseStack, int i, int j, float f) {
- if (!this.passField.isActive()) {
- if (this.passField.isFocused()) {
- this.passField.setFocused(false);
- }
- this.passField.setEditable(false);
- }
-
- this.renderBackground(poseStack);
- Screen.drawCenteredString(poseStack, this.font, HEADER, this.width / 2, this.hugeGUI() ? 8 : 16, 0xFFFFFF);
-
- this.keyDesc.renderLeftAligned(poseStack, this.keyField.x - 20, (this.hugeGUI() ? 25 : FIELDS_Y_START), this.getLineHeight(), 0xFFFFFF);
-
- this.keyField.render(poseStack, i, j, f);
-
- this.passDesc.renderLeftAligned(poseStack, this.passField.x - 20, this.keyField.y + this.keyField.getHeight() + (this.hugeGUI() ? 12 : 28),
- this.getLineHeight(), 0xFFFFFF);
-
- this.passField.render(poseStack, i, j, f);
-
- if (this.algorithmButton != null && this.algorithmButton.isMouseOver(i, j)) {
- this.renderTooltip(poseStack, this.algorithmButton.getTooltip(), i, j);
- }
-
- super.render(poseStack, i, j, f);
-
- if (StringUtil.isNullOrEmpty(this.keyField.getValue()) && !this.keyField.isFocused()) {
- Screen.drawString(poseStack, this.font,
- Component.translatable("gui.nochatreports.encryption_config.default_key",
- this.algorithmButton.getValue().getDefaultKey()), this.keyField.x + 4,
- this.keyField.y + 5, 0x999999);
- }
-
- if (!this.passField.active) {
- Screen.drawString(poseStack, this.font, PASS_NOT_ALLOWED, this.passField.x + 4,
- this.passField.y + 5, 0x999999);
- RenderSystem.setShaderTexture(0, ENCRYPTION_ICONS);
- RenderSystem.enableDepthTest();
- blit(poseStack, this.passField.x - 20, this.passField.y + 3, 50, 0, 14, 13, 64, 64);
- }
- }
-
- private int getLineHeight() {
- if (this.hugeGUI())
- return (int) (this.minecraft.font.lineHeight * 1.5) + 1;
- else
- return this.minecraft.font.lineHeight * 2;
- }
-
- @Override
- public void tick() {
- this.keyField.tick();
- }
-
- private void onKeyUpdate(String key) {
- if (!this.settingPassKey) {
- this.passField.setValue("");
- }
-
- if (!StringUtil.isNullOrEmpty(key)) {
- this.validationIcon.yTexStart = this.algorithmButton.getValue().validateKey(key) ? 0 : 12;
- } else {
- this.validationIcon.yTexStart = 0;
- }
- }
-
- private void onPassphraseUpdate(String pass) {
- Encryption encryption = this.algorithmButton.getValue();
-
- this.settingPassKey = true;
- if (!StringUtil.isNullOrEmpty(pass)) {
- if (encryption.supportsPassphrases()) {
- this.keyField.setValue(encryption.getPassphraseKey(pass));
- }
- } else {
- this.onKeyUpdate(this.keyField.getValue());
- }
- this.settingPassKey = false;
- }
-
- private void onAlgorithmUpdate(Encryption encryption) {
- if (!encryption.supportsPassphrases()) {
- this.passField.setFocused(false);
- this.passField.setEditable(this.passField.active = false);
- this.onKeyUpdate(this.keyField.getValue());
- } else {
- this.passField.setEditable(this.passField.active = true);
- this.onPassphraseUpdate(this.passField.getValue());
- }
- }
-
- private void unfocusFields() {
- this.keyField.setFocused(false);
- this.passField.setFocused(false);
- }
-
- private void onDone() {
- var config = NCRConfig.getEncryption();
- var encryption = this.algorithmButton.getValue();
- config.setAlgorithm(encryption);
- config.setEncryptionKey(!StringUtil.isNullOrEmpty(this.keyField.getValue()) ? this.keyField.getValue()
- : encryption.getDefaultKey());
- config.setEncryptPublic(this.encryptPublicCheck.selected());
- }
-
- private boolean hugeGUI() {
- return this.height <= 1080 / 4;
- }
-
- @Override
- public void onClose() {
- this.minecraft.setScreen(this.previous);
- }
-
- private static class CustomEditBox extends EditBox {
- public CustomEditBox(Font font, int i, int j, int k, int l, Component component) {
- super(font, i, j, k, l, component);
- }
-
- @Override
- public void setFocused(boolean bl) {
- super.setFocused(bl);
- }
- }
-
-}
diff --git a/src/main/java/com/aizistral/nochatreports/gui/EncryptionWarningScreen.java b/src/main/java/com/aizistral/nochatreports/gui/EncryptionWarningScreen.java
deleted file mode 100644
index f2c459e..0000000
--- a/src/main/java/com/aizistral/nochatreports/gui/EncryptionWarningScreen.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package com.aizistral.nochatreports.gui;
-
-import org.jetbrains.annotations.Nullable;
-
-import com.aizistral.nochatreports.NoChatReportsClient;
-import com.aizistral.nochatreports.config.NCRConfig;
-import com.aizistral.nochatreports.core.ServerSafetyState;
-import com.mojang.blaze3d.vertex.PoseStack;
-
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
-import net.minecraft.ChatFormatting;
-import net.minecraft.Util;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.components.Button;
-import net.minecraft.client.gui.components.Checkbox;
-import net.minecraft.client.gui.components.MultiLineLabel;
-import net.minecraft.client.gui.screens.ConfirmLinkScreen;
-import net.minecraft.client.gui.screens.Screen;
-import net.minecraft.client.gui.screens.TitleScreen;
-import net.minecraft.client.gui.screens.inventory.CommandBlockEditScreen;
-import net.minecraft.client.gui.screens.multiplayer.WarningScreen;
-import net.minecraft.client.multiplayer.resolver.ServerAddress;
-import net.minecraft.network.chat.CommonComponents;
-import net.minecraft.network.chat.Component;
-import net.minecraft.network.chat.FormattedText;
-
-@Environment(EnvType.CLIENT)
-public class EncryptionWarningScreen extends ExtendedWarningScreen {
- private static final Component TITLE = Component.translatable("gui.nochatreports.encryption_warning.header").withStyle(ChatFormatting.BOLD);
- private static final Component CONTENT = Component.translatable("gui.nochatreports.encryption_warning.contents");
- private static final Component CHECK = Component.translatable("gui.nochatreports.encryption_warning.check");
- private static final String WIKI_LINK = "https://github.com/Aizistral-Studios/No-Chat-Reports/wiki/To-Encrypt-or-Not-to-Encrypt";
- private static boolean sessionSeen = false;
-
- public EncryptionWarningScreen(Screen previous) {
- super(TITLE, CONTENT, CHECK, WIKI_LINK, previous);
- }
-
- @Override
- protected void onProceed(Button button) {
- this.minecraft.setScreen(new EncryptionConfigScreen(this.previous));
- if (this.stopShowing.selected()) {
- NCRConfig.getEncryption().disableWarning();
- }
-
- sessionSeen = true;
- }
-
- @Override
- protected void onBack(Button button) {
- this.minecraft.setScreen(this.previous);
- }
-
- public static boolean seenOnThisSession() {
- return sessionSeen;
- }
-
-}
diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatComponent.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatComponent.java
deleted file mode 100644
index cad93cd..0000000
--- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatComponent.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package com.aizistral.nochatreports.mixins.client;
-
-import javax.annotation.Nullable;
-
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.ModifyArg;
-import org.spongepowered.asm.mixin.injection.ModifyArgs;
-import org.spongepowered.asm.mixin.injection.ModifyVariable;
-import org.spongepowered.asm.mixin.injection.At.Shift;
-
-import com.aizistral.nochatreports.NoChatReports;
-import com.aizistral.nochatreports.config.NCRConfig;
-import com.aizistral.nochatreports.config.NCRConfigClient;
-import com.aizistral.nochatreports.core.EncryptionUtil;
-import com.aizistral.nochatreports.encryption.Encryptor;
-
-import net.minecraft.ChatFormatting;
-import net.minecraft.client.GuiMessage;
-import net.minecraft.client.GuiMessageTag;
-import net.minecraft.client.gui.components.ChatComponent;
-import net.minecraft.network.chat.CommonComponents;
-import net.minecraft.network.chat.Component;
-import net.minecraft.network.chat.ComponentContents;
-import net.minecraft.network.chat.FormattedText;
-import net.minecraft.network.chat.MutableComponent;
-import net.minecraft.network.chat.contents.LiteralContents;
-import net.minecraft.network.chat.contents.TranslatableContents;
-
-@Mixin(ChatComponent.class)
-public class MixinChatComponent {
- private static final GuiMessageTag.Icon ENCRYPTED_ICON = GuiMessageTag.Icon.valueOf("CHAT_NCR_ENCRYPTED");
- private boolean lastMessageEncrypted;
- private Component lastMessageOriginal;
-
- @ModifyVariable(method = "addRecentChat", at = @At("HEAD"), argsOnly = true)
- private String onAddRecentChat(String message) {
- if (NCRConfig.getEncryption().isEnabledAndValid())
- return NCRConfig.getEncryption().getLastMessage();
- else
- return message;
- }
-
- @ModifyVariable(method = "addMessage(Lnet/minecraft/network/chat/Component;"
- + "Lnet/minecraft/network/chat/MessageSignature;ILnet/minecraft/client/GuiMessageTag;Z)V",
- at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/components/ComponentRenderUtils;"
- + "wrapComponents(Lnet/minecraft/network/chat/FormattedText;ILnet/minecraft/client/gui/Font;"
- + ")Ljava/util/List;", ordinal = 0, shift = Shift.AFTER), argsOnly = true)
- private synchronized GuiMessageTag modifyGUITag(GuiMessageTag tag) {
- if (!NCRConfig.getEncryption().showEncryptionIndicators() || !this.lastMessageEncrypted)
- return tag;
-
- this.lastMessageEncrypted = false;
- Component tooltip = Component.empty().append(Component.translatable("tag.nochatreports.encrypted",
- Component.literal(NCRConfig.getEncryption().getAlgorithm().getName())
- .withStyle(ChatFormatting.BOLD))).append(CommonComponents.NEW_LINE).append(
- Component.translatable("tag.nochatreports.encrypted_original",
- this.lastMessageOriginal));
-
- return new GuiMessageTag(0x8B3EC7, ENCRYPTED_ICON, tooltip, "Encrypted");
- }
-
- @ModifyArg(index = 0, method = "addMessage(Lnet/minecraft/network/chat/Component;"
- + "Lnet/minecraft/network/chat/MessageSignature;ILnet/minecraft/client/GuiMessageTag;Z)V",
- at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/components/ComponentRenderUtils;"
- + "wrapComponents(Lnet/minecraft/network/chat/FormattedText;I"
- + "Lnet/minecraft/client/gui/Font;)Ljava/util/List;", ordinal = 0))
- private FormattedText modifyGUIMessage(FormattedText msg) {
- if (NCRConfig.getCommon().enableDebugLog()) {
- NoChatReports.LOGGER.info("Adding chat message, structure: " +
- Component.Serializer.toStableJson((Component) msg));
- }
-
- var decrypted = EncryptionUtil.tryDecrypt((Component) msg);
-
- decrypted.ifPresentOrElse(component -> {
- this.lastMessageOriginal = EncryptionUtil.recreate((Component) msg);
- this.lastMessageEncrypted = true;
- }, () -> this.lastMessageEncrypted = false);
-
- return this.lastMessageEncrypted ? decrypted.get() : msg;
- }
-
-}
diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatListener.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatListener.java
index 3cbd89a..9fdcfe4 100644
--- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatListener.java
+++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatListener.java
@@ -8,13 +8,11 @@ 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.ModifyVariable;
import org.spongepowered.asm.mixin.injection.At.Shift;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import com.aizistral.nochatreports.NoChatReports;
import com.aizistral.nochatreports.config.NCRConfig;
-import com.aizistral.nochatreports.core.EncryptionUtil;
import net.minecraft.client.GuiMessageTag;
import net.minecraft.client.multiplayer.PlayerInfo;
@@ -69,10 +67,4 @@ public class MixinChatListener {
}
}
- @ModifyVariable(method = "narrateChatMessage(Lnet/minecraft/network/chat/ChatType$Bound;"
- + "Lnet/minecraft/network/chat/Component;)V", at = @At("HEAD"), argsOnly = true)
- private Component decryptNarratedMessage(Component msg) {
- return EncryptionUtil.tryDecrypt(msg).orElse(msg);
- }
-
}
diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatScreen.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatScreen.java
index 7b69957..6d11d92 100644
--- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatScreen.java
+++ b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinChatScreen.java
@@ -7,15 +7,11 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import com.aizistral.nochatreports.config.NCRConfig;
import com.aizistral.nochatreports.config.NCRConfigClient;
import com.aizistral.nochatreports.core.ServerSafetyLevel;
import com.aizistral.nochatreports.core.ServerSafetyState;
-import com.aizistral.nochatreports.gui.EncryptionButton;
-import com.aizistral.nochatreports.gui.EncryptionConfigScreen;
-import com.aizistral.nochatreports.gui.EncryptionWarningScreen;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.BufferBuilder;
import com.mojang.blaze3d.vertex.BufferUploader;
@@ -25,14 +21,12 @@ import com.mojang.blaze3d.vertex.Tesselator;
import com.mojang.blaze3d.vertex.VertexFormat;
import com.mojang.math.Matrix4f;
-import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.components.ImageButton;
import net.minecraft.client.gui.screens.ChatScreen;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.renderer.MultiBufferSource;
-import net.minecraft.locale.Language;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.FormattedCharSequence;
@@ -45,31 +39,12 @@ import net.minecraft.util.FormattedCharSequence;
@Mixin(ChatScreen.class)
public abstract class MixinChatScreen extends Screen {
private static final ResourceLocation CHAT_STATUS_ICONS = new ResourceLocation("nochatreports", "textures/gui/chat_status_icons_extended.png");
- private static final ResourceLocation ENCRYPTION_BUTTON = new ResourceLocation("nochatreports", "textures/gui/encryption_toggle_button.png");
protected MixinChatScreen() {
super(null);
throw new IllegalStateException("Can't touch this");
}
- @Inject(method = "normalizeChatMessage", at = @At("RETURN"), cancellable = true)
- public void onBeforeMessage(String original, CallbackInfoReturnable<String> info) {
- String message = info.getReturnValue();
- NCRConfig.getEncryption().setLastMessage(message);
-
- if (!message.isEmpty() && !Screen.hasControlDown() && NCRConfig.getEncryption().shouldEncrypt(message)) {
- NCRConfig.getEncryption().getEncryptor().ifPresent(e -> {
- int index = NCRConfig.getEncryption().getEncryptionStartIndex(message);
- String noencrypt = message.substring(0, index);
- String encrypt = message.substring(index, message.length());
-
- if (encrypt.length() > 0) {
- info.setReturnValue(noencrypt + e.encrypt("#%" + encrypt));
- }
- });
- }
- }
-
@Inject(method = "init", at = @At("HEAD"))
private void onInit(CallbackInfo info) {
int buttonX = this.width - 23;
@@ -87,41 +62,6 @@ public abstract class MixinChatScreen extends Screen {
this.addRenderableOnly(button);
buttonX -= 25;
}
-
- if (!NCRConfig.getEncryption().showEncryptionButton())
- return;
-
- int xStart = !NCRConfig.getEncryption().isValid() ? 40 : (NCRConfig.getEncryption().isEnabled() ? 0 : 20);
-
- var button = new EncryptionButton(buttonX, this.height - 37, 20, 20, xStart,
- 0, 20, ENCRYPTION_BUTTON, 64, 64, btn -> {
- if (!EncryptionWarningScreen.seenOnThisSession() && !NCRConfig.getEncryption().isWarningDisabled()
- && !NCRConfig.getEncryption().isEnabled()) {
- Minecraft.getInstance().setScreen(new EncryptionWarningScreen(this));
- } else if (NCRConfig.getEncryption().isValid()) {
- NCRConfig.getEncryption().toggleEncryption();
- ((EncryptionButton)btn).xTexStart = NCRConfig.getEncryption().isEnabledAndValid() ? 0 : 20;
- } else {
- ((EncryptionButton)btn).openEncryptionConfig();
- }
- }, (btn, poseStack, i, j) -> {
- if (NCRConfig.getEncryption().isValid()) {
- this.renderTooltip(poseStack, this.minecraft.font.split(
- Component.translatable("gui.nochatreports.encryption_tooltip", Language.getInstance()
- .getOrDefault("gui.nochatreports.encryption_state_" + (NCRConfig.getEncryption()
- .isEnabledAndValid() ? "on" : "off")), 250), 250), i, j);
- } else {
- this.renderTooltip(poseStack, this.minecraft.font.split(
- Component.translatable("gui.nochatreports.encryption_tooltip_invalid", Language.getInstance()
- .getOrDefault("gui.nochatreports.encryption_state_" + (NCRConfig.getEncryption()
- .isEnabledAndValid() ? "on" : "off")), 250), 250), i, j);
-
- }
- }, Component.empty(), this);
- button.active = true;
- button.visible = true;
-
- this.addRenderableWidget(button);
}
private int getXOffset(ServerSafetyLevel level) {
diff --git a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinGuiMessageTagIcon.java b/src/main/java/com/aizistral/nochatreports/mixins/client/MixinGuiMessageTagIcon.java
deleted file mode 100644
index 6ef1488..0000000
--- a/src/main/java/com/aizistral/nochatreports/mixins/client/MixinGuiMessageTagIcon.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.aizistral.nochatreports.mixins.client;
-
-import java.util.Arrays;
-
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Mutable;
-import org.spongepowered.asm.mixin.Shadow;
-import org.spongepowered.asm.mixin.gen.Invoker;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
-
-import com.mojang.blaze3d.systems.RenderSystem;
-import com.mojang.blaze3d.vertex.PoseStack;
-
-import net.minecraft.client.GuiMessageTag;
-import net.minecraft.client.GuiMessageTag.Icon;
-import net.minecraft.client.gui.GuiComponent;
-import net.minecraft.resources.ResourceLocation;
-
-@Mixin(GuiMessageTag.Icon.class)
-public abstract class MixinGuiMessageTagIcon {
- private static final ResourceLocation TEXTURE_NCR = new ResourceLocation("nochatreports", "textures/gui/encrypted_tag.png");
- @Shadow(aliases = "field_39768") @Mutable static Icon[] $VALUES;
-
- @Invoker("<init>")
- static Icon create(String name, int ordinal, int u, int v, int width, int height) {
- throw new IllegalStateException("Invoker transformation failed");
- }
-
- @Inject(method = "draw", at = @At("HEAD"), cancellable = true)
- public void onDraw(PoseStack stack, int x, int y, CallbackInfo info) {
- if (((Icon)(Object)this).name().equals("CHAT_NCR_ENCRYPTED")) {
- RenderSystem.setShaderTexture(0, TEXTURE_NCR);
- GuiComponent.blit(stack, x, y, 0, 0, 9, 9, 9, 9);
- info.cancel();
- }
- }
-
- static {
- var ordinal = $VALUES.length;
- var values = Arrays.copyOf($VALUES, ordinal + 1);
- values[ordinal] = create("CHAT_NCR_ENCRYPTED", ordinal, 9, 0, 9, 9);
- $VALUES = values;
- }
-
-}
diff --git a/src/main/resources/assets/nochatreports/lang/en_us.json b/src/main/resources/assets/nochatreports/lang/en_us.json
index 776abb4..b9dc821 100644
--- a/src/main/resources/assets/nochatreports/lang/en_us.json
+++ b/src/main/resources/assets/nochatreports/lang/en_us.json
@@ -18,41 +18,13 @@
"gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r %1$s\nDisable or enable most of the mod's client-sided functionality. You may have to do this to join some Paper/Velocity servers, as they are known for causing issues with NCR.\nCertain networking-unrelated things, such as encryption, chat trust status tweaks and removal of vanilla's \"Chat messages can't be verified\" toast will still work; they can be disabled in config individually.",
"gui.nochatreports.ncr_state_on": "§a§lEnabled§r",
"gui.nochatreports.ncr_state_off": "§c§lDisabled§r",
- "tag.nochatreports.encrypted": "Encrypted using: %1$s",
- "tag.nochatreports.encrypted_original": "Non-decrypted: %1$s",
- "gui.nochatreports.encryption_tooltip": "§lEncryption:§r %1$s\nRight-click to configure.\n\nWhile encryption is enabled, you can prevent it from being applied to the message by holding §n§lCtrl§r when sending it.",
- "gui.nochatreports.encryption_tooltip_invalid": "§lEncryption:§r %1$s\n§cInvalid configuration. Click to configure.",
- "gui.nochatreports.encryption_state_on": "§a§lEnabled§r",
- "gui.nochatreports.encryption_state_off": "§c§lDisabled§r",
- "gui.nochatreports.encryption_warning.header": "About Encryption",
- "gui.nochatreports.encryption_warning.contents": "You can encrypt your messages using a secret key. Only people who know this key will be able to decrypt them. No Chat Reports will automatically decrypt all encrypted messages when suitable key is provided and feature is enabled.\nHowever, be aware that encryption is not a \"magic wand\" kind of solution. Moderators on third-party servers can mute or ban you for sending what will appear to them as garbled mess in chat. Futhermore, it is recommended that you generate custom encryption key, and communicate it to other people only via secure channels. Click \"Learn More\" to learn more about how and when you should use encryption.",
- "gui.nochatreports.encryption_warning.check": "Don't show again",
"gui.nochatreports.encryption_warning.learn_more": "Learn More",
- "gui.nochatreports.encryption_config.header": "Encryption Settings",
- "gui.nochatreports.encryption_config.key_desc": "§lEncryption Key§r\nKey that will be used to encrypt and decrypt your messages. It's format depends on algorithm; for AES it will be 128 bits of Base64-encoded binary data.",
- "gui.nochatreports.encryption_config.passphrase_desc": "§lEncryption Passphrase§r\nInstead of generating random key, you can derive one from passphrase of your choice. If you use this - choose a strong one. Not all algorithms support passphrases.",
- "gui.nochatreports.encryption_config.validation_ok": "Key Validation: §a§lPassed",
- "gui.nochatreports.encryption_config.validation_failed": "Key Validation: §c§lFailed",
- "gui.nochatreports.encryption_config.dice_tooltip": "Generate new random key with respect to selected encryption algorithm.",
- "gui.nochatreports.encryption_config.pass_not_allowed": "<not supported>",
- "gui.nochatreports.encryption_config.algorithm": "Algorithm: %1$s",
- "gui.nochatreports.encryption_config.default_key": "<default: %1$s>",
- "gui.nochatreports.encryption_config.encrypt_public": "Encrypt public messages",
- "algorithm.nochatreports.aes_cfb8_base64.name": "AES/CFB8+Base64R",
- "algorithm.nochatreports.aes_cfb8_base64": "§lAES/CFB8+Base64R§r\nStandard symmetric encryption algorithm. Uses 128 bit keys, output is encoded in special version of Base64 to permit transfer via Minecraft's chat. As a downside - messages will gain roughly 30% increase in length, and server might truncate them if they exceed size limit.",
- "algorithm.nochatreports.aes_gcm_base64.name": "AES/GCM+Base64R",
- "algorithm.nochatreports.aes_gcm_base64": "§lAES/GCM+Base64R§r\nMore security in exchange for severe increase in message size (12 bytes for initialization vector and 12 for authentication tag, Base64 encoding on top). Choose if you value security over anything else.",
- "algorithm.nochatreports.aes_ecb_base64.name": "AES/ECB+Base64R",
- "algorithm.nochatreports.aes_ecb_base64": "§lAES/ECB+Base64R§r\nConsiderably less secure than CFB mode, but saves you some bytes by not requiring initialization vector. Still beats Caesar.",
- "algorithm.nochatreports.caesar.name": "Caesar",
- "algorithm.nochatreports.caesar": "§lCaesar§r\nMeme cipher. With this you're basically hoping that people will give up without even trying to decrypt your messages. That might be true in many cases, so viability of using it depends on your threat model.\nKey should be integer from 1 to 1024. Shift is done by character code instead of alphabetically, to ensure compatibility with any language.",
"nochatreports.connect.nokey_rejected": "Server rejected connection without chat signing key.",
"nochatreports.connect.await": "Awaiting reconnection: %1$s seconds...",
"gui.nochatreports.realms_warning.header": "Caution: Realms",
"gui.nochatreports.realms_warning.contents": "Realms servers are not private. Realm owners cannot disable chat reporting, and Mojang applies additional chat monitoring to identify potential \"online harms\" and escalate them to human review. If you are then found to violate Minecraft's Community Standards - even if chat participants did not get offended - you will be banned, temporarily or permanently, from all multiplayer services. Use of encryption is highly advised.",
"gui.nochatreports.realms_warning.check": "Don't show again",
"gui.nochatreports.realms_warning.learn_more": "Learn More",
- "gui.NoChatReports.showEncryptionButtonWarning": "§cBelow does not disable encryption, it only hides the button!",
"configuration.NoChatReports.config": "No Chat Reports",
@@ -102,8 +74,6 @@
"option.NoChatReports.signingCheckDelaySeconds.tooltip": "Delay for checking whether whitelisted servers still enforce chat signing, in seconds. Setting this to 0 will cause check to be performed on every login attempt, similar to non-whitelisted servers.",
"option.NoChatReports.serverSigningChecks": "Server signing checks",
"option.NoChatReports.serverSigningChecks.tooltip": "Map of whitelisted servers to last signing enforcement check times, in epoch seconds. This typically does not have to be edited manually.",
- "option.NoChatReports.showEncryptionButton": "Show encryption button",
- "option.NoChatReports.showEncryptionButton.tooltip": "Setting this to false will simply prevent encryption button from being displayed in the chat screen. Be aware that encryption itself will not be automatically disabled along with the button.",
"configuration.NoChatReports.category.whitelistedServers": "Whitelisted Servers",
diff --git a/src/main/resources/assets/nochatreports/lang/et_ee.json b/src/main/resources/assets/nochatreports/lang/et_ee.json
index fa0a011..b28cabf 100644
--- a/src/main/resources/assets/nochatreports/lang/et_ee.json
+++ b/src/main/resources/assets/nochatreports/lang/et_ee.json
@@ -18,41 +18,13 @@
"gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r %1$s\nKeela või luba enamus modi kliendipoolsest funktsionaalsusest. See võib olla vajalik teatud Paper/Velocity serveritega ühendumiseks, kuna need on teadaolevalt NCRiga probleeme põhjustanud.\nTeatud võrguga mitteseonduvad asjad, nagu serveri turvataseme kuvamine ning vanilli \"Vestlussõnumeid ei saa kinnitada\" hüpiku eemaldus töötavad siiski; neid saab seadistustes individuaalselt lülitada.",
"gui.nochatreports.ncr_state_on": "§a§llubatud§r",
"gui.nochatreports.ncr_state_off": "§c§lkeelatud§r",
- "tag.nochatreports.encrypted": "Krüpteeritud algoritmiga: %1$s",
- "tag.nochatreports.encrypted_original": "Mitte-dekrüpteeritud: %1$s",
- "gui.nochatreports.encryption_tooltip": "§lKrüpteering:§r %1$s\nSeadistamiseks paremklõpsa.\n\nKrüpteeringu lubamisel saad sa selle rakendamist ajutiselt vältida, hoides sõnumi saatmise ajal klahvi §n§lCtrl§r all.",
- "gui.nochatreports.encryption_tooltip_invalid": "§lKrüpteering:§r %1$s\n§cSobimatu seadistus. Seadistamiseks klõpsa.",
- "gui.nochatreports.encryption_state_on": "§a§llubatud§r",
- "gui.nochatreports.encryption_state_off": "§c§lkeelatud§r",
- "gui.nochatreports.encryption_warning.header": "Krüpteeringust",
- "gui.nochatreports.encryption_warning.contents": "Sa saad salajase võtme abil oma sõnumeid krüpteerida. Ainult need inimesed, kes seda võtit teavad, saavad neid dekrüpteerida. No Chat Reports dekrüpteerib automaatselt kõik krüpteeritud sõnumid, kui funktsioon on lubatud ning antud on vastav võti.\nOle siiski teadlik, et krüpteerimine ei ole mingi \"võlulahendus\". Kolmanda osapoole serverite moderaatorid võivad sind vaigistada või blokeerida, kui sa saadad vestlussõnumeid, mis neile tunduvad kui segapuder. Lisaks sellele on soovitatav luua kohandatud krüpteerimisvõti ja edastada see teistele inimestele ainult turvaliste kanalite kaudu. Klõpsa \"Lisateave\", et saada rohkem teavet selle kohta, kuidas ja millal peaksid krüpteerimist kasutama.",
- "gui.nochatreports.encryption_warning.check": "Ära kuva uuesti",
"gui.nochatreports.encryption_warning.learn_more": "Lisateave",
- "gui.nochatreports.encryption_config.header": "Krüpteeringu seaded",
- "gui.nochatreports.encryption_config.key_desc": "§lKrüpteerimisvõti§r\nVõti, mida kasutatakse sinu sõnumite krüpteerimiseks ja dekrüpteerimiseks. Selle vorming sõltub algoritmist; AES puhul on see 128 bitti Base64-kodeeritud binaarandmeid.",
- "gui.nochatreports.encryption_config.passphrase_desc": "§lKrüpteeringu paroolfraas§r\nJuhusliku võtme genereerimise asemel saad selle tuletada oma valitud paroolist. Seda kasutades veendu paroolfraasi tugevuses. Kõik algoritmid ei toeta paroolfraase.",
- "gui.nochatreports.encryption_config.validation_ok": "Võtmekinnitus: §a§lläbitud",
- "gui.nochatreports.encryption_config.validation_failed": "Võtmekinnitus: §c§lebaõnnestus",
- "gui.nochatreports.encryption_config.dice_tooltip": "Genereeri uus juhuslik võti genereerimine valitud krüpteerimisalgoritmiga.",
- "gui.nochatreports.encryption_config.pass_not_allowed": "<pole toetatud>",
- "gui.nochatreports.encryption_config.algorithm": "Algoritm: %1$s",
- "gui.nochatreports.encryption_config.default_key": "<vaikimisi: %1$s>",
- "gui.nochatreports.encryption_config.encrypt_public": "Krüpteeri avalikud sõnumid",
- "algorithm.nochatreports.aes_cfb8_base64.name": "AES/CFB8+Base64R",
- "algorithm.nochatreports.aes_cfb8_base64": "§lAES/CFB8+Base64R§r\nStandardne sümmeetriline krüpteerimisalgoritm. Kasutab 128-bitiseid võtmeid, väljund on Base64-kodeeritud, et võimaldada edastamist Minecrafti vestluse kaudu. Miinusena - sõnumite pikkus suureneb umbes 30% ja server võib neid kärpida, kui need ületavad suuruspiirangut.",
- "algorithm.nochatreports.aes_gcm_base64.name": "AES/GCM+Base64R",
- "algorithm.nochatreports.aes_gcm_base64": "§lAES/GCM+Base64R§r\nSuurem turvalisus vastukaaluks sõnumi suuruse tõsisele suurenemisele (12 baiti initsialiseerimisvektorile ja 12 baiti autentimissildile, lisaks Base64-kodeering). Vali, kui sulle on turvalisus tähtsam kui miski muu.",
- "algorithm.nochatreports.aes_ecb_base64.name": "AES/ECB+Base64R",
- "algorithm.nochatreports.aes_ecb_base64": "§lAES/ECB+Base64R§r\nOluliselt vähem turvaline kui CFB-režiim, kuid säästab mõned baidid, kuna ei nõua initsialiseerimisvektorit. Siiski on see parem kui Caesar.",
- "algorithm.nochatreports.caesar.name": "Caesar",
- "algorithm.nochatreports.caesar": "§lCaesar§r\nNaljašiffer. Sellega põhimõtteliselt loodad, et inimesed ei üritagi sinu sõnumeid dekrüpteerida. See võib paljudel juhtudel tõsi olla, seega sõltub selle kasutamise otstarbekus sinu ohumudelist.\nVõti peaks olema täisarv vahemikus 1-1024. Nihutamine toimub tähestiku asemel tähemärkide kaupa, et tagada ühilduvus mistahes keelega.",
"nochatreports.connect.nokey_rejected": "Server lükkas vestluse signeerimise võtmeta ühenduse tagasi.",
"nochatreports.connect.await": "Taasühendamise ootamine: %1$s sekundit...",
"gui.nochatreports.realms_warning.header": "Hoiatus: Realms",
"gui.nochatreports.realms_warning.contents": "Realms-serverid ei ole privaatsed. Realmide omanikud ei saa vestlusest teatamist keelata ning Mojang rakendab täiendavat vestlusseiret, et tuvastada võimalikud \"võrgukäitumise rikkumised\" ning saata need edasi inimkontrolli. Kui leitakse, et sa rikud Minecrafti Kogukonnastandardeid - isegi kui vestluses osalejad ei solvunud, blokeeritakse sind, ajutiselt või jäädavalt kõikidest mitmikmänguteenustest. Vestluse krüpteerimine on tungivalt soovitatav.",
"gui.nochatreports.realms_warning.check": "Ära kuva uuesti",
"gui.nochatreports.realms_warning.learn_more": "Lisateave",
- "gui.NoChatReports.showEncryptionButtonWarning": "§cAllolev ei keela krüpteerimist, see vaid peidab nupu!",
"configuration.NoChatReports.config": "No Chat Reports",
@@ -102,8 +74,6 @@
"option.NoChatReports.signingCheckDelaySeconds.tooltip": "Viivitus sekundites kontrollimaks, kas lubamisloendis olevad serverid jõustavad endiselt vestluse allkirjastamist. Selle väärtuse 0-ks määramine põhjustab kontrollimist iga sisselogimiskatse korral, sarnaselt serveritega, mis ei ole lubamisloendis.",
"option.NoChatReports.serverSigningChecks": "Serveri allkirjastamise kontrollid",
"option.NoChatReports.serverSigningChecks.tooltip": "Lubamisloendisse kantud serverite vastendus viimaste allkirjajõustamise kontrollimise aegade kohta, epohhisekundites. Seda ei pea tavaliselt käsitsi muutma.",
- "option.NoChatReports.showEncryptionButton": "Kuva krüpteerimisnupp",
- "option.NoChatReports.showEncryptionButton.tooltip": "Selle keelamisel peidetakse vaid vestluskuvalt vaid krüpteerimisnupp. Pane tähele, et krüpteerimist ennast ei keelata automaatselt koos nupuga.",
"configuration.NoChatReports.category.whitelistedServers": "Lubamisloendis serverid",
diff --git a/src/main/resources/assets/nochatreports/lang/ko_kr.json b/src/main/resources/assets/nochatreports/lang/ko_kr.json
index a10a53e..fba5fb4 100644
--- a/src/main/resources/assets/nochatreports/lang/ko_kr.json
+++ b/src/main/resources/assets/nochatreports/lang/ko_kr.json
@@ -18,41 +18,13 @@
"gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r %1$s\n모드의 대부분의 클라이언트 기능들을 활성화하거나 비활성화합니다. No Chat Reports와 문제를 일으키는 것으로 알려진 일부 Paper/Velocity 서버에 접속하기 위해 모드를 비활성화해야할 수 있습니다.\n암호화, 대화 신뢰 상태 조정 및 바닐라의 \"대화 메세지가 검증될 수 없습니다.\" 알림 제거 등 네트워킹과 관련이 없는 기능은 작동하며 모드 설정에서 개별적으로 비활성화할 수 있습니다.",
"gui.nochatreports.ncr_state_on": "§a§l활성화됨§r",
"gui.nochatreports.ncr_state_off": "§c§l비활성화됨§r",
- "tag.nochatreports.encrypted": "사용된 알고리즘: %1$s",
- "tag.nochatreports.encrypted_original": "복호화되지 않은 메시지: %1$s",
- "gui.nochatreports.encryption_tooltip": "§l암호화:§r %1$s\n오른쪽 클릭하여 설정.\n\n암호화가 활성화되어 있을 때, 메시지를 보낼 때 §n§lCtrl§r을 눌러 암호화가 적용되지 않도록 할 수 있습니다.",
- "gui.nochatreports.encryption_tooltip_invalid": "§l암호화:§r %1$s\n§c잘못된 설정입니다. 오른쪽 클릭하여 설정.",
- "gui.nochatreports.encryption_state_on": "§a§l활성화됨§r",
- "gui.nochatreports.encryption_state_off": "§c§l비활성화됨§r",
- "gui.nochatreports.encryption_warning.header": "암호화에 대하여",
- "gui.nochatreports.encryption_warning.contents": "비공개 키를 사용하여 메시지를 암호화합니다. 이 키를 아는 사람들만 메시지를 복호화할 수 있습니다. No Chat Reports는 적절한 키가 제공되고 기능이 활성화된 경우 모든 암호화된 메시지를 자동으로 복호화합니다.\n그러나 암호화는 \"마법 지팡이\" 해결책이 아닙니다. 제 3자 서버의 관리자들은 그들에게 알아들을 수 없는 스팸처럼 보이는 대화를 보내는 것에 대해 당신을 서버에서 음소거하거나 차단할 수 있습니다. 또한, 사용자 지정 암호화 키를 생성하고 이를 보안 채널만 사용하여 전달하는 것이 추천됩니다. 암호화를 언제 어떻게 사용해야 하는지 알아보려면 \"더 알아보기\"를 클릭하세요.",
- "gui.nochatreports.encryption_warning.check": "다시 표시하지 않기",
"gui.nochatreports.encryption_warning.learn_more": "더 알아보기",
- "gui.nochatreports.encryption_config.header": "암호화 설정",
- "gui.nochatreports.encryption_config.key_desc": "§l암호화 키§r\n메시지를 암호화하고 복호화하는데 사용할 키입니다. 이것의 형식은 알고리즘에 따라 다릅니다. AES의 경우 128비트의 Base64로 인코딩된 이진 데이터입니다.",
- "gui.nochatreports.encryption_config.passphrase_desc": "§l암호화 비밀구절§r\n임의의 키를 생성하지 않고 비밀구절 중에서 하나를 사용할 수 있습니다. 이것을 사용한다면 강력한 것을 고르세요. 모든 알고리즘이 비밀구절을 지원하는 것은 아닙니다.",
- "gui.nochatreports.encryption_config.validation_ok": "키 검증: §a§l성공",
- "gui.nochatreports.encryption_config.validation_failed": "키 검증: §c§l실패",
- "gui.nochatreports.encryption_config.dice_tooltip": "선택한 알고리즘에 따라 새로운 임의의 키를 생성합니다.",
- "gui.nochatreports.encryption_config.pass_not_allowed": "<지원되지 않음>",
- "gui.nochatreports.encryption_config.algorithm": "알고리즘: %1$s",
- "gui.nochatreports.encryption_config.default_key": "<기본: %1$s>",
- "gui.nochatreports.encryption_config.encrypt_public": "공개 메시지 암호화",
- "algorithm.nochatreports.aes_cfb8_base64.name": "AES/CFB8+Base64R",
- "algorithm.nochatreports.aes_cfb8_base64": "§lAES/CFB8+Base64R§r\n표준 대칭 키 암호화 알고리즘. 128비트 키를 사용하며, 출력은 Minecraft의 대화로 전송될 수 있도록 특수한 버전의 Base64로 인코딩됩니다. 메시지가 약 30% 길어지고 길이 제한을 초과하면 서버가 메시지를 자를 수 있습니다.",
- "algorithm.nochatreports.aes_gcm_base64.name": "AES/GCM+Base64R",
- "algorithm.nochatreports.aes_gcm_base64": "§lAES/GCM+Base64R§r\n더 안전하지만 메시지가 더 길어집니다 (초기화 벡터에 12바이트, 인증 태그에 12바이트, Base64 인코딩). 보안을 무엇보다 중요하게 여긴다면 사용하십시오.",
- "algorithm.nochatreports.aes_ecb_base64.name": "AES/ECB+Base64R",
- "algorithm.nochatreports.aes_ecb_base64": "§lAES/ECB+Base64R§r\nCFB 모드보다 훨씬 덜 안전하지만 초기화 벡터가 필요하지 않아 몇 바이트를 절약할 수 있습니다. 여전히 카이사르 암호보다 낫습니다.",
- "algorithm.nochatreports.caesar.name": "카이사르 암호",
- "algorithm.nochatreports.caesar": "§l카이사르 암호§r\n밈 암호. 기본적으로 사람들이 메시지를 해독하려 시도하지도 않기를 바라는 것입니다. 이는 실제로 많은 상황에서 사실일 수 있으므로 사용할 수 있을지는 당신의 위협 모델에 따라 다릅니다.\n키는 1과 1024 사이의 정수여야 하며 시프트는 모든 언어와의 호환성을 보장하기 위해 알파벳이 아닌 문자 코드를 기준으로 합니다.",
"nochatreports.connect.nokey_rejected": "서버가 대화 서명 키 없는 연결을 거부했습니다.",
"nochatreports.connect.await": "재연결 대기 중: %1$s 초...",
"gui.nochatreports.realms_warning.header": "경고: Realms",
"gui.nochatreports.realms_warning.contents": "Realms 서버는 비공개가 아닙니다. Realm의 주인은 대화 신고를 비활성화할 수 없고 Mojang은 추가적인 대화 모니터링으로 잠재적인 \"온라인 괴롭힘\"을 식별하여 사람의 검토를 위해 보냅니다. Minecraft의 커뮤니티 표준을 위반한 것으로 확인되면 대화 참가자의 의사와 상관없이 일시적으로 또는 영구적으로 모든 멀티플레이어 서비스에서 차단될 것입니다. 암호화를 사용하는 것이 강력히 권장됩니다",
"gui.nochatreports.realms_warning.check": "다시 표시하지 않음",
"gui.nochatreports.realms_warning.learn_more": "더 알아보기",
- "gui.NoChatReports.showEncryptionButtonWarning": "§c아래의 설정은 암호화를 비활성화하지 않고 버튼만 숨깁니다!",
"configuration.NoChatReports.config": "No Chat Reports",
@@ -102,8 +74,6 @@
"option.NoChatReports.signingCheckDelaySeconds.tooltip": "화이트리스트된 서버가 여전히 대화 서명을 요구하는지 확인하는 것에 대한 대기 시간입니다. 이것을 0으로 설정하면 화이트리스트되지 않은 서버와 비슷하게 로그인을 시도할때마다 확인합니다.",
"option.NoChatReports.serverSigningChecks": "서버 서명 확인",
"option.NoChatReports.serverSigningChecks.tooltip": "화이트리스트된 서버들의 마지막 서명 확인 시간(UNIX 시간). 일반적으로 이것은 직접 수정할 필요가 없습니다.",
- "option.NoChatReports.showEncryptionButton": "암호화 버튼 표시",
- "option.NoChatReports.showEncryptionButton.tooltip": "이 옵션을 비활성화하면 대화 화면에서 암호화 버튼을 표시하지 않습니다. 암호화 자체는 버튼과 함께 비활성화되지 않습니다.",
"configuration.NoChatReports.category.whitelistedServers": "서버 화이트리스트",
diff --git a/src/main/resources/assets/nochatreports/lang/pl_pl.json b/src/main/resources/assets/nochatreports/lang/pl_pl.json
index a1afeda..543413d 100644
--- a/src/main/resources/assets/nochatreports/lang/pl_pl.json
+++ b/src/main/resources/assets/nochatreports/lang/pl_pl.json
@@ -16,30 +16,7 @@
"gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r %1$s\nWyłącz lub włącz większość funkcji po stronie klienta moda. Być może będziesz musiał to zrobić, aby dołączyć do niektórych serwerów Paper/Velocity, ponieważ są one znane z powodowania problemów z NCR.\nNiektóre rzeczy niezwiązane z siecią, takie jak szyfrowanie, poprawianie stanu zaufania czatu i usuwanie wanilii „Wiadomości na czacie nie mogą być zweryfikowane\" toasty nadal będą działać; można je wyłączyć w konfiguracji indywidualnie.",
"gui.nochatreports.ncr_state_on": "§a§lWłączony§r",
"gui.nochatreports.ncr_state_off": "§c§lWyłączony§r",
- "tag.nochatreports.encrypted": "Zaszyfrowany używając: %1$s",
- "tag.nochatreports.encrypted_original": "Nieodszyfrowane: %1$s",
- "gui.nochatreports.encryption_tooltip": "§lSzyfrowanie:§r %1$s\nKliknij prawym przyciskiem, aby skonfigurować.",
- "gui.nochatreports.encryption_tooltip_invalid": "§lSzyfrowanie:§r %1$s\n§cNie prawidłowa konfiguracja. Kliknij, aby skonfigurować.",
- "gui.nochatreports.encryption_state_on": "§a§lWłączone§r",
- "gui.nochatreports.encryption_state_off": "§c§lWyłączone§r",
- "gui.nochatreports.encryption_warning.header": "O Szyfrowaniu",
- "gui.nochatreports.encryption_warning.contents": "Możesz zaszyfrować swoje wiadomości za pomocą tajnego klucza. Tylko osoby znające ten klucz będą mogły je odszyfrować. No Chat Reports automatycznie odszyfruje wszystkie zaszyfrowane wiadomości po podaniu odpowiedniego klucza i włączeniu funkcji.\nJednakże należy pamiętać, że szyfrowanie nie jest rozwiązaniem typu „magicznej różdżki”. Moderatorzy na serwerach stron trzecich mogą wyciszyć lub zablokować Cię za wysyłanie tego, co będzie im się wydawać zniekształconym bałaganem na czacie. Ponadto zaleca się wygenerowanie niestandardowego klucza szyfrowania i przekazywanie go innym osobom wyłącznie za pośrednictwem bezpiecznych kanałów. Kliknij „Więcej informacji”, aby dowiedzieć się więcej o tym, jak i kiedy należy używać szyfrowania.",
- "gui.nochatreports.encryption_warning.check": "Nie pokazuj ponownie",
"gui.nochatreports.encryption_warning.learn_more": "Dowiedz się więcej",
- "gui.nochatreports.encryption_config.header": "Ustawienia Szyfrowania",
- "gui.nochatreports.encryption_config.key_desc": "§lKlucz szyfrowania§r\nKlucz, który będzie używany do szyfrowania i odszyfrowywania wiadomości. Jego format zależy od algorytmu; dla AES będzie to 128 bitów danych binarnych zakodowanych w Base64.",
- "gui.nochatreports.encryption_config.passphrase_desc": "§lHasło szyfrowania§r\nZamiast generować losowy klucz, możesz go wyprowadzić z wybranego hasła. Jeśli używasz tego - wybierz mocny. Nie wszystkie algorytmy obsługują hasła.",
- "gui.nochatreports.encryption_config.validation_ok": "Walidacja klucza: §a§lPomyślna",
- "gui.nochatreports.encryption_config.validation_failed": "Walidacja klucza: §c§lBłąd",
- "gui.nochatreports.encryption_config.dice_tooltip": "Wygeneruj nowy losowy klucz z uwzględnieniem wybranego algorytmu szyfrowania.",
- "gui.nochatreports.encryption_config.pass_not_allowed": "<nieobsługiwane>",
- "gui.nochatreports.encryption_config.algorithm": "Algorytm: %1$s",
- "gui.nochatreports.encryption_config.default_key": "<domyślny: %1$s>",
- "gui.nochatreports.encryption_config.encrypt_public": "Szyfruj wiadomości publiczne",
- "algorithm.nochatreports.aes_cfb8_base64": "§lAES/CFB8+Base64R§r\nStandardowy algorytm szyfrowania symetrycznego. Używa 128-bitowych kluczy, dane wyjściowe są zakodowane w Base64, aby umożliwić przesyłanie za pośrednictwem czatu Minecrafta. Wadą - wiadomości zyskają około 30% długości, a serwer może je skrócić, jeśli przekroczą limit rozmiaru.",
- "algorithm.nochatreports.aes_gcm_base64": "§lAES/GCM+Base64R§r\nWiększe bezpieczeństwo w zamian za znaczny wzrost rozmiaru wiadomości (12 bajtów na wektor inicjujący i 12 na znacznik uwierzytelniania, kodowanie Base64 na górze). Wybierz, jeśli cenisz bezpieczeństwo ponad wszystko inne.",
- "algorithm.nochatreports.aes_ecb_base64": "§lAES/ECB+Base64R§r\nZnacznie mniej bezpieczny niż tryb CFB, ale oszczędza kilka bajtów, ponieważ nie wymaga wektora inicjalizacji. Wciąż lepsze od Cezara.",
- "algorithm.nochatreports.caesar": "§lCezar§r\nSzyfr dla memu. Dzięki temu masz zasadniczo nadzieję, że ludzie zrezygnują, nawet nie próbując odszyfrować twoich wiadomości. Może to być prawdą w wielu przypadkach, więc opłacalność jego użycia zależy od modelu zagrożenia.\nKlucz powinien być liczbą całkowitą od 1 do 1024. Przesunięcie odbywa się za pomocą kodu znakowego, a nie alfabetycznego, aby zapewnić zgodność z dowolnym językiem.",
"configuration.NoChatReports.config": "No Chat Reports",
diff --git a/src/main/resources/assets/nochatreports/lang/pt_br.json b/src/main/resources/assets/nochatreports/lang/pt_br.json
index b85a632..d66dbae 100644
--- a/src/main/resources/assets/nochatreports/lang/pt_br.json
+++ b/src/main/resources/assets/nochatreports/lang/pt_br.json
@@ -18,41 +18,13 @@
"gui.nochatreports.ncr_toggle_tooltip": "§lSem relatórios de bate-papo:§r %1$s\nDesative ou habilite a maioria da funcionalidade do lado do cliente do MOD.Você pode ter que fazer isso para ingressar em alguns servidores de papel/velocidade, pois eles são conhecidos por causar problemas com a NCR.\nCerta networking-unrelated things, como criptografia, ajustes de status de confiança de bate-papo e remoção de vanilla \"As mensagens de bate-papo não podem ser verificadas\" A torrada ainda funcionará;Eles podem ser desativados na configuração individualmente.",
"gui.nochatreports.ncr_state_on": "§a§lHabilitada§r",
"gui.nochatreports.ncr_state_off": "§c§lDesabilitada§r",
- "tag.nochatreports.encrypted": "Criptografado usando: %1$s",
- "tag.nochatreports.encrypted_original": "Não concretizado: %1$s",
- "gui.nochatreports.encryption_tooltip": "§lCriptografia:§r %1$s\nClique com o botão direito do mouse para configurar.\n\nEnquanto a criptografia está ativada, você pode impedir que ela seja aplicada à mensagem segurando §n§lCtrl§r Ao enviá-lo.",
- "gui.nochatreports.encryption_tooltip_invalid": "§lEcriptografia:§r %1$s\n§cConfiguração inválida.Clique para configurar.",
- "gui.nochatreports.encryption_state_on": "§a§lHabilitada§r",
- "gui.nochatreports.encryption_state_off": "§c§lDesabilitada§r",
- "gui.nochatreports.encryption_warning.header": "Sobre criptografia",
- "gui.nochatreports.encryption_warning.contents": "Você pode criptografar suas mensagens usando uma chave secreta.Somente as pessoas que sabem que essa chave poderão descriptografá-las.Nenhum relatório de bate-papo descriptografará automaticamente todas as mensagens criptografadas quando a chave adequada for fornecida e o recurso é ativado.\nNo entanto, esteja ciente de que a criptografia não é um \"varinha mágica\" tipo de solução.Os moderadores em servidores de terceiros podem silenciar ou bani-lo por enviar o que aparecerá para eles como bagunça ilegal no bate-papo.ALÉM DISSO, é recomendável que você gere a chave de criptografia personalizada e a comunique a outras pessoas apenas por meio de canais seguros.Clique \"Saber mais\" Para saber mais sobre como e quando você deve usar a criptografia.",
- "gui.nochatreports.encryption_warning.check": "Não mostre de novo",
"gui.nochatreports.encryption_warning.learn_more": "Saber mais",
- "gui.nochatreports.encryption_config.header": "Configurações de criptografia",
- "gui.nochatreports.encryption_config.key_desc": "§lChave de encriptação§r\nChave que será usada para criptografar e descriptografar suas mensagens.Seu formato depende do algoritmo;Para o AES, serão 128 bits de dados binários codificados pela base64.",
- "gui.nochatreports.encryption_config.passphrase_desc": "§lSenha de criptografia§r\nEm vez de gerar chave aleatória, você pode derivar uma da senha de sua escolha.Se você usar isso - escolha um forte.Nem todos os algoritmos suportam as sessões.",
- "gui.nochatreports.encryption_config.validation_ok": "Validação-chave: §a§lPassou",
- "gui.nochatreports.encryption_config.validation_failed": "Validação-chave: §c§lFracassou",
- "gui.nochatreports.encryption_config.dice_tooltip": "Gerar nova chave aleatória em relação ao algoritmo de criptografia selecionado.",
- "gui.nochatreports.encryption_config.pass_not_allowed": "<não suportado>",
- "gui.nochatreports.encryption_config.algorithm": "Algoritmo: %1$s",
- "gui.nochatreports.encryption_config.default_key": "<predefinição: %1$s>",
- "gui.nochatreports.encryption_config.encrypt_public": "Criptografar mensagens públicas",
- "algorithm.nochatreports.aes_cfb8_base64.name": "AES/CFB8+Base64R",
- "algorithm.nochatreports.aes_cfb8_base64": "§lAES/CFB8+Base64R§r\nAlgoritmo de criptografia simétrica padrão.Usa as teclas de 128 bits, a saída é codificada na versão especial da base64 para permitir a transferência por meio do bate-papo do Minecraft.Como uma desvantagem - as mensagens ganharão um aumento de cerca de 30% no comprimento, e o servidor poderá truncá -las se exceder o limite de tamanho.",
- "algorithm.nochatreports.aes_gcm_base64.name": "AES/GCM+Base64R",
- "algorithm.nochatreports.aes_gcm_base64": "§lAES/GCM+Base64R§r\nMais segurança em troca de um aumento grave no tamanho da mensagem (12 bytes para vetor de inicialização e 12 para tag de autenticação, codificação base64 na parte superior).Escolha se você valoriza a segurança em vez de qualquer outra coisa.",
- "algorithm.nochatreports.aes_ecb_base64.name": "AES/ECB+Base64R",
- "algorithm.nochatreports.aes_ecb_base64": "§lAES/ECB+Base64R§r\nConsideravelmente menos seguro que o modo CFB, mas economiza alguns bytes por não exigir o vetor de inicialização.Ainda vence César.",
- "algorithm.nochatreports.caesar.name": "Caesar",
- "algorithm.nochatreports.caesar": "§lCaesar§r\nMeme Cipher.Com isso, você basicamente espera que as pessoas desista sem sequer tentar descriptografar suas mensagens.Isso pode ser verdade em muitos casos; portanto, a viabilidade de usá -lo depende do seu modelo de ameaça.\nA chave deve ser inteira de 1 a 1024. A mudança é feita pelo código do caractere, em vez de alfabeticamente, para garantir a compatibilidade com qualquer idioma.",
"nochatreports.connect.nokey_rejected": "Conexão rejeitada por servidor sem chave de assinatura de bate-papo.",
"nochatreports.connect.await": "Aguardando reconexão: %1$s ssegundas..",
"gui.nochatreports.realms_warning.header": "Cuidado: Realms",
"gui.nochatreports.realms_warning.contents": "Os servidores da Realms não são privados.Os proprietários de imóveis não podem desativar os relatórios de bate-papo, e Mojang aplica monitoramento adicional de bate-papo para identificar potencial \"danos online\" e escalá-los para a revisão humana.Se você for encontrado para violar os padrões da comunidade da Minecraft - mesmo que os participantes do bate-papo não se ofendessem - você será banido, temporária ou permanentemente, de todos os serviços multiplayer.O uso da criptografia é altamente recomendável.",
"gui.nochatreports.realms_warning.check": "Não mostre de novo",
"gui.nochatreports.realms_warning.learn_more": "Saber mais",
- "gui.NoChatReports.showEncryptionButtonWarning": "§cAbaixo não desative a criptografia, ela apenas esconde o botão!",
"configuration.NoChatReports.config": "Sem relatórios de bate-papo",
@@ -102,8 +74,6 @@
"option.NoChatReports.signingCheckDelaySeconds.tooltip": "Atraso para verificar se os servidores de Whitelisted ainda aplicam a assinatura do bate-papo, em segundos.Configurar isso para 0 fará com que a verificação seja executada em todas as tentativas de login, semelhantes a servidores não brancos.",
"option.NoChatReports.serverSigningChecks": "Verificações de assinatura do servidor",
"option.NoChatReports.serverSigningChecks.tooltip": "Mapa de servidores de permissões para último assinar os tempos de verificação da aplicação, em segundos de época.Isso normalmente não precisa ser editado manualmente.",
- "option.NoChatReports.showEncryptionButton": "Mostrar botão de criptografia",
- "option.NoChatReports.showEncryptionButton.tooltip": "Definir isso como false simplesmente impedirá que o botão de criptografia seja exibido na tela de bate-papo.Esteja ciente de que a própria criptografia não será desativada automaticamente junto com o botão.",
"configuration.NoChatReports.category.whitelistedServers": "Servidores de permissões na lista de permissões",
diff --git a/src/main/resources/assets/nochatreports/lang/th_th.json b/src/main/resources/assets/nochatreports/lang/th_th.json
index 9650526..486ee6e 100644
--- a/src/main/resources/assets/nochatreports/lang/th_th.json
+++ b/src/main/resources/assets/nochatreports/lang/th_th.json
@@ -17,34 +17,7 @@
"gui.nochatreports.ncr_toggle_tooltip": "§lNo Chat Reports:§r %1$s\nปิดหรือเปิดฟังก์ชันต่าง ๆ ของม็อดฝั่งไคลเอนต์ ซึ่งคุณอาจจำเป็นต้องเปิดหรือปิดตัวเลือกนี้เพื่อให้สามารถเข้าเล่นเซิร์ฟเวอร์ของ Paper หรือ Velocity บางเซิร์ฟเวอร์ได้, เนื่องมาจากเซิร์ฟเวอร์เหล่านี้มักมีปัญหากับม็อดนี้.\nฟีเจอร์บางอย่างที่ไม่เกี่ยวข้องกับเครือข่าย เช่น การเข้ารหัส การปรับปรุงสถานะความน่าเชื่อถือของแช็ต และการนำโทสต์ \"ไม่สามารถยืนยันข้อความแช็ตได้\" ออก จะยังคงใช้งานได้ตามปกติ ฟีเจอร์เหล่านี้สามารถปิดแยกแต่ละฟีเจอร์ได้",
"gui.nochatreports.ncr_state_on": "§a§lเปิด§r",
"gui.nochatreports.ncr_state_off": "§c§lปิด§r",
- "tag.nochatreports.encrypted": "เข้ารหัสโดยใช้: %1$s",
- "tag.nochatreports.encrypted_original": "ไม่ถอดรหัส: %1$s",
- "gui.nochatreports.encryption_tooltip": "§lการเข้ารหัส:§r %1$s\nคลิกขวาเพื่อต้้งค่า",
- "gui.nochatreports.encryption_tooltip_invalid": "§lการเข้ารหัส:§r %1$s\n§cการตั้งค่าไม่ถูกต้อง คลิกเพื่อตั้งค่า",
- "gui.nochatreports.encryption_state_on": "§a§lเปิด§r",
- "gui.nochatreports.encryption_state_off": "§c§lปิด§r",
- "gui.nochatreports.encryption_warning.header": "เกี่ยวกับการเข้ารหัส",
- "gui.nochatreports.encryption_warning.contents": "คุณสามารถเข้ารหัสข้อความของคุณได้โดยใช้คีย์ลับ มีเพียงคนที่รู้คีย์ดังกล่าวที่จะสามารถถอดรหัสได้ โดยตัวม็อด No Chat Reports จะถอดรหัสทุกข้อความที่เข้ารหัสมาแล้วให้เมื่อมีการป้อนคีย์ที่เหมาะสมให้และมีฟีเจอร์ดังกล่าวเปิดการใช้งานอยู่\nอย่างไรก็ตาม ก็ต้องระวังไว้ด้วยว่าการเข้ารหัสนั้นไม่ใช่ \"คฑาวิเศษ\" ที่สามารถชี้ไปทางไหนก็แก้ปัญหาได้มากขนาดนั้น ผู้ดูแลในเซิร์ฟเวอร์มือที่สามยังสามารถปิดเสียง (ไม่ให้พูดคุย) หรือแบนคุณได้อยู่จากการส่งข้อความที่พวกเขาเห็นเป็นเพียงข้อความต่างดาวที่อ่านไม่ออกในแช็ต นอกจากนี้ แนะนำว่าให้คุณสร้างคีย์เข้ารหัสขึ้นมาเอง และใช้สื่อสารมันกับคนอื่น ๆ ผ่านช่องทางที่ปลอดภัยจะเป็นการดีกว่า คลิก \"เรียนรู้เพิ่มเติม\" เพื่อเรียนรู้เพิ่มเติมว่าการเข้ารหัสต้องใช้อย่างไร และต้องใช้เมื่อไร",
- "gui.nochatreports.encryption_warning.check": "ไม่ต้องแสดงอีก",
"gui.nochatreports.encryption_warning.learn_more": "เรียนรู้เพิ่มเติม",
- "gui.nochatreports.encryption_config.header": "การตั้งค่าการเข้ารหัส",
- "gui.nochatreports.encryption_config.key_desc": "§lคีย์การเข้ารหัส§r\nเป็นคีย์ที่ใช้ในการเข้าหรือถอดรหัสข้อความของคุณเอง โดยรูปแบบของคีย์นั้นขึ้นอยู่กับวิธีการที่ใช้ หากเป็น AES ตัวคีย์จะเป็นข้อมูลตัวเลขฐานสองแบบ Base64-encoded 128 บิต",
- "gui.nochatreports.encryption_config.passphrase_desc": "§ข้อความรหัสผ่านของการเข้ารหัส§r\nจะเป็นการรับรหัสจากข้อความรหัสผ่านที่คุณเลือกเอง แทนการสร้างคีย์ขึ้นมาสุ่ม ๆ ถ้าคุณใช้ตัวเลือกนี้ โปรดเลือกรหัสที่มีความแข็งแรง คาดเดาได้ยาก มีบางอัลกอริทึมที่ไม่สามารถใช้ข้อความรหัสผ่านได้",
- "gui.nochatreports.encryption_config.validation_ok": "การตรวจสอบคีย์: §a§lผ่าน",
- "gui.nochatreports.encryption_config.validation_failed": "การตรวจสอบคีย์: §c§lไม่ผ่าน",
- "gui.nochatreports.encryption_config.dice_tooltip": "สร้างคีย์ใหม่ขึ้นมาแบบสุ่มตามอัลกอริทึมการเข้ารหัสที่ได้เลือกไว้",
- "gui.nochatreports.encryption_config.pass_not_allowed": "<ไม่ได้รับการสนับสนุน>",
- "gui.nochatreports.encryption_config.algorithm": "อัลกอริทึม: %1$s",
- "gui.nochatreports.encryption_config.default_key": "<ค่าเริ่มต้น: %1$s>",
- "gui.nochatreports.encryption_config.encrypt_public": "เข้ารหัสข้อความสาธารณะ",
- "algorithm.nochatreports.aes_cfb8_base64.name": "AES/CFB8+Base64R",
- "algorithm.nochatreports.aes_cfb8_base64": "§lAES/CFB8+Base64R§r\nอัลกอริทึมการเข้ารหัสแบบสมมาตรปกติ ใช้คีย์แบบ 128 บิต ข้อมูลส่งออกจะเป็นลักษณะการเข้ารหัสแบบ Base64 (Base64-encoded) เพื่อให้อนุญาตการถ่ายโอนข้อมูลผ่านระบบแช็ตของ Minecraft มีข้อเสียได้แก่ ข้อความจะมีความยาวมากขึ้นราว ๆ 30% และเซิร์ฟเวอร์อาจจะตัดข้อความเหล่านั้นหากมีขนาดที่มากเกินไปช",
- "algorithm.nochatreports.aes_gcm_base64.name": "AES/GCM+Base64R",
- "algorithm.nochatreports.aes_gcm_base64": "§lAES/GCM+Base64R§r\nมีความปลอดภัยมากกว่า แลกมากับขนาดของข้อความที่เพิ่มมากขึ้นเป็นจำนวนมาก (ต้องใช้พื้นที่ 12 ไบต์ สำหรับเส้นสมมติเริ่มต้น และอีก 12 ไบต์ สำหรับแท็กการรับรอง ตบท้ายด้วยการเข้ารหัสแบบ Base64) แนะนำให้เลือกตัวเลือกนี้หากคุณต้องการให้ความสำคัญกับความปลอดภัยเป็นที่หนึ่ง",
- "algorithm.nochatreports.aes_ecb_base64.name": "AES/ECB+Base64R",
- "algorithm.nochatreports.aes_ecb_base64": "§lAES/ECB+Base64R§r\nมีความปลอดภัยน้อยกว่าแบบ CFB เป็นอย่างมาก แต่ช่วยประหยัดพื้นที่ได้โดยไม่มีการสร้างเส้นสมมติเริ่มต้นขึ้นมา ยังคงดีกว่าแบบ Caesar อยู่",
- "algorithm.nochatreports.caesar.name": "Caesar",
- "algorithm.nochatreports.caesar": "§lCaesar§r\nตั้งตามนามของ Meme cipher. หากปรับเป็นโหมดนี้ คุณอาจหวังได้แค่ว่าคนอื่นจะยอมไม่ถอดรหัสข้อความของคุณ ซึ่งอาจจะเกิดขึ้นจริงก็ได้ในหลาย ๆ กรณี เพราะฉะนั้นการที่มันทำงานได้ดีหรือไม่นั้นขึ้นอยู่กับโมเดลแบบอย่างของผู้ไม่ประสงค์ดี\nคีย์มักจะเป็นตัวเลขจำนวนเต็มตั้งแต่ 1 ถึง 1024 การเลื่อนนั้นทำได้โดยใช้รหัสอักขระแทนตัวอักษร เพื่อให้แน่ใจว่าจะสามารถใช้งานร่วมกับภาษาอื่น ๆ ได้",
"nochatreports.connect.nokey_rejected": "เซิร์ฟเวอร์ปฏิเสธการเชื่อมต่อที่ไม่มีคีย์การลงนามแช็ต",
"nochatreports.connect.await": "กำลังรอการเชื่อมต่อใหม่อีกครั้ง: %1$s วินาที...",
diff --git a/src/main/resources/assets/nochatreports/textures/gui/encrypted_tag.png b/src/main/resources/assets/nochatreports/textures/gui/encrypted_tag.png
deleted file mode 100644
index 858a330..0000000
--- a/src/main/resources/assets/nochatreports/textures/gui/encrypted_tag.png
+++ /dev/null
Binary files differ
diff --git a/src/main/resources/assets/nochatreports/textures/gui/encryption_gui_icons.png b/src/main/resources/assets/nochatreports/textures/gui/encryption_gui_icons.png
deleted file mode 100644
index 812c6ec..0000000
--- a/src/main/resources/assets/nochatreports/textures/gui/encryption_gui_icons.png
+++ /dev/null
Binary files differ
diff --git a/src/main/resources/assets/nochatreports/textures/gui/encryption_toggle_button.png b/src/main/resources/assets/nochatreports/textures/gui/encryption_toggle_button.png
deleted file mode 100644
index 951413e..0000000
--- a/src/main/resources/assets/nochatreports/textures/gui/encryption_toggle_button.png
+++ /dev/null
Binary files differ
diff --git a/src/main/resources/nochatreports.mixins.json b/src/main/resources/nochatreports.mixins.json
index 9432498..ae1f7be 100644
--- a/src/main/resources/nochatreports.mixins.json
+++ b/src/main/resources/nochatreports.mixins.json
@@ -31,8 +31,6 @@
"client.MixinServerData",
"client.MixinServerStatusPinger$1",
"client.MixinOnlineServerEntry",
- "client.MixinChatComponent",
- "client.MixinGuiMessageTagIcon",
"client.MixinTitleScreen"
],
"server": [