- 22 Jan 2025
- 1 Minute à lire
- SombreLumière
- PDF
Shielding Tool rules example
- Mis à jour le 22 Jan 2025
- 1 Minute à lire
- SombreLumière
- PDF
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>(...);
}