Shielding Tool rules example
  • 22 Jan 2025
  • 1 Minute à lire
  • Sombre
    Lumière
  • PDF

Shielding Tool rules example

  • Sombre
    Lumière
  • PDF

The content is currently unavailable in French. You are viewing the default English version.
Résumé de l’article

Example: Class rules

No bindings in MyClass

unbind class com.example.MyClass;

No bindings for any class in com.example. *.

unbind class com.example.*;

No bindings for any class that implements MyInterface

unbind class * implements com.example.MyInterface;

No bindings for any class that extends MyBaseClass

unbind class * extends com.example.MyBaseClass;

Exclude myField field in MyClass class from binding

match class com.example.MyClass {
 unbind java.lang.String myField;
}

Obfuscate MyClass.myMethod(), preserve (no obfuscation) mySecondMethod(), and untouchable (no bindings) on all methods, but locally scramble strings in mySecondMethod().

match com.example.MyClass {
  obfuscate myMethod();
  preserve mySecondMethod();
  untouchable <methods>;
  scrambleStrings mySecondMethod();
}

Obfuscate class name but none of the members

# Obfuscate MyClass but none of its members (empty body)
obfuscate com.example.MyClass { }

- - - - OR - - - -

# Obfuscate MyClass but preserve its members
obfuscate com.example.MyClass {
  preserve <members>;

}

- - - - OR - - - -

# Obfuscate everything, but preserve <members> in MyClass
obfuscate *;
match com.example.MyClass {
  preserve <members>;

}

Preserve class name and all members

# Obfuscate everything, but preserve class name
obfuscate *;
preserve class com.example.MyExampleClass;

- - - - OR - - - -

obfuscate *;
preserve class com.example.MyExampleClass {
  preserve <members>;
}

No bindings in any static constructor (clinit)

match * {
unbind method <clinit>;
}

No bindings in any constructor.

match * {
	unbind <init>;
	unbind <clinit>(...);
}

No bindings in any constructor, but encode strings.

match * {
 unbind scrambleStrings <init>;
 unbind scrambleStrings <clinit>(...);
}


Cet article vous a-t-il été utile ?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Ozzy, facilitant la découverte de connaissances grâce à l’intelligence conversationnelle