💪
qProtect
  • qProtect
  • Quick Start
  • Dependencies
  • Exclusions & Inclusions
  • Transformers
    • String Encryption
    • Flow Obfuscation
    • Reference Encryption
    • Field Reference Encryption
    • Number Encryption
    • SourceInfo Remover
    • LineNumber Transformer
    • AntiDebug Injector
Powered by GitBook
On this page

Was this helpful?

  1. Transformers

Field Reference Encryption

Encrypts all references to methods and their parameters.

// Given Input
package dev.sim0n.evaluator.test.impl.annotation;

import dev.sim0n.evaluator.Main;
import dev.sim0n.evaluator.test.Test;
import dev.sim0n.evaluator.test.impl.annotation.TestAnnotation;

@TestAnnotation(string="Test", doubleValue=0.36, intValue=36)
public class AnnotationTest
implements Test {
    public void handle() {
        Class<AnnotationTest> clazz = AnnotationTest.class;
        if (clazz.isAnnotationPresent(TestAnnotation.class)) {
            TestAnnotation annotation = (TestAnnotation)clazz.getAnnotation(TestAnnotation.class);
            String value = annotation.string();
            double doubleValue = annotation.doubleValue();
            int intValue = annotation.intValue();
            Main.LOG.println("Testing annotations");
            Main.LOG.println(String.format((String)"%s, %s, %d", (Object[])new Object[]{value, doubleValue, intValue}));
        }
    }
}
// Output
package dev.sim0n.evaluator.test.impl.annotation;

import dev.sim0n.evaluator.Main;
import dev.sim0n.evaluator.test.Test;
import dev.sim0n.evaluator.test.impl.annotation.TestAnnotation;

@TestAnnotation(string="Test", doubleValue=0.36, intValue=36)
public class AnnotationTest
implements Test {
    public void handle() {
        Class<AnnotationTest> clazz = AnnotationTest.class;
        if (clazz.isAnnotationPresent(TestAnnotation.class)) {
            TestAnnotation annotation = (TestAnnotation)clazz.getAnnotation(TestAnnotation.class);
            String value = annotation.string();
            double doubleValue = annotation.doubleValue();
            int intValue = annotation.intValue();
            Main.LOG.println("Testing annotations");
            Main.LOG.println(String.format((String)"%s, %s, %d", (Object[])new Object[]{value, doubleValue, intValue}));
        }
    }
}
PreviousReference EncryptionNextNumber Encryption

Last updated 2 years ago

Was this helpful?