public StringPool getStringPool() { return (stringEncryptionEnabledCheckBox.isSelected() && stringPoolCheckBox.isSelected()) ? new StringPool(new StringEncryptionSetup(stringExclusions)) : null; }
AtomicInteger counter = new AtomicInteger(); getClassWrappers().parallelStream().filter(classWrapper -> !excluded(classWrapper)).forEach(classWrapper -> { ArrayList<String> strList = new ArrayList<>(); String methodName = randomString(4); String fieldName = randomString(4); classWrapper.methods.parallelStream().filter(methodWrapper -> !excluded(methodWrapper) && hasInstructions(methodWrapper.methodNode)).forEach(methodWrapper -> { MethodNode methodNode = methodWrapper.methodNode; String str = (String) cst; if (!excludedString(str)) { strList.add(str); classWrapper.classNode.methods.add(stringPool(classWrapper.classNode.name, methodName, fieldName, strList));
private List<StringEncryption> getStringEncryptionTransformers() { Object o = map.get(ConfigurationSettings.STRING_ENCRYPTION.getValue()); if (o == null) return null; if (!(o instanceof Map)) throw new IllegalConfigurationValueException(ConfigurationSettings.STRING_ENCRYPTION.getValue(), Map.class, o.getClass()); Map<String, Object> settings = (Map) o; if (!(boolean) settings.get("Enabled")) return null; String s = (String) settings.get("Mode"); if (!"Light".equals(s) && !"Normal".equals(s) && !"Heavy".equals(s)) throw new IllegalConfigurationValueException("Expected Light, Normal or Heavy as mode for string " + "encryption. Got " + s + " instead."); boolean pool = (boolean) settings.getOrDefault("StringPool", false); List<String> exclusions = (List) settings.getOrDefault("Exclusions", new ArrayList<String>()); ArrayList<StringEncryption> things = new ArrayList<>(); things.add(StringEncryption.getTransformerFromString(s, new StringEncryptionSetup(exclusions))); if (pool) things.add(new StringPool(new StringEncryptionSetup(exclusions))); return things; }