diff --git a/common-files/src/main/resources/config.yml b/common-files/src/main/resources/config.yml index 72bb3b173..99faaa714 100644 --- a/common-files/src/main/resources/config.yml +++ b/common-files/src/main/resources/config.yml @@ -146,11 +146,14 @@ resource-pack: obfuscation: enable: false seed: 0 # 0 = random seed - # Determines the number and length of obfuscated namespaces. + # Determines the length of obfuscated overlay directories + overlay: + length: 4 # 0 = disable + # Determines the number and length of obfuscated namespaces namespace: amount: 32 # 0 = disable length: 2 - # Determines the depth of the obfuscated path. + # Determines the depth and length of the obfuscated path path: depth: 4 length: 2 diff --git a/core/src/main/java/net/momirealms/craftengine/core/plugin/config/Config.java b/core/src/main/java/net/momirealms/craftengine/core/plugin/config/Config.java index 1c1b0d093..643150355 100644 --- a/core/src/main/java/net/momirealms/craftengine/core/plugin/config/Config.java +++ b/core/src/main/java/net/momirealms/craftengine/core/plugin/config/Config.java @@ -90,6 +90,7 @@ public class Config { protected boolean resource_pack$protection$obfuscation$path$anti_unzip; protected boolean resource_pack$protection$incorrect_crc; protected boolean resource_pack$protection$fake_file_size; + protected NumberProvider resource_pack$protection$obfuscation$overlay$length; protected NumberProvider resource_pack$protection$obfuscation$namespace$length; protected int resource_pack$protection$obfuscation$namespace$amount; protected String resource_pack$protection$obfuscation$path$block_source; @@ -368,6 +369,7 @@ public class Config { resource_pack$protection$fake_file_size = config.getBoolean("resource-pack.protection.fake-file-size", false); resource_pack$protection$obfuscation$namespace$amount = config.getInt("resource-pack.protection.obfuscation.namespace.amount", 32); resource_pack$protection$obfuscation$namespace$length = NumberProviders.fromObject(config.get("resource-pack.protection.obfuscation.namespace.length", 2)); + resource_pack$protection$obfuscation$overlay$length = NumberProviders.fromObject(config.get("resource-pack.protection.obfuscation.overlay.length", 4)); resource_pack$protection$obfuscation$path$depth = NumberProviders.fromObject(config.get("resource-pack.protection.obfuscation.path.depth", 4)); resource_pack$protection$obfuscation$path$length = NumberProviders.fromObject(config.get("resource-pack.protection.obfuscation.path.length", 2)); resource_pack$protection$obfuscation$path$block_source = config.getString("resource-pack.protection.obfuscation.path.block-source", "obf_block"); @@ -890,6 +892,10 @@ public class Config { return instance.resource_pack$protection$obfuscation$path$length; } + public static NumberProvider overlayLength() { + return instance.resource_pack$protection$obfuscation$overlay$length; + } + public static boolean antiUnzip() { return instance.resource_pack$protection$obfuscation$path$anti_unzip; }