- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {}
@Override public void transform() { ArrayList<ClassWrapper> classWrappers = new ArrayList<>(this.getClassWrappers()); for (int i = 0; i < 3; i++) { // Two extra injections helps with reliability of watermark to be extracted Stack<Character> watermark = cipheredWatermark(); while (!watermark.isEmpty()) { ClassWrapper classWrapper; int counter = 0; do { classWrapper = classWrappers.get(RandomUtils.getRandomInt(0, classWrappers.size())); counter++; if (counter > 20) throw new RuntimeException("Radon couldn't find any methods to embed a watermark in after " + counter + "tries."); } while (classWrapper.classNode.methods.size() != 0); MethodNode methodNode = classWrapper.classNode.methods.get(RandomUtils.getRandomInt(0, classWrapper.classNode.methods.size())); if (hasInstructions(methodNode)) { methodNode.instructions.insertBefore(methodNode.instructions.getFirst(), createInstructions(watermark, methodNode)); } } } LoggerUtils.stdOut("Successfully embedded watermark."); }