- 22 Jan 2025
- 1 Minute à lire
- SombreLumière
- PDF
Shielding rules syntax: specification
- Mis à jour le 22 Jan 2025
- 1 Minute à lire
- SombreLumière
- PDF
Specification
Comments are prefixed with #, everything after will be ignored.
# Comment
Most rules are defined using a class syntax.
class_op+ [[!]@annotation] [[!]access] [[!]flag]* [[!]class_spec] class_name [[!]extension class_name] (; | {
[member_op]* [[!]@annotation] [[!]access] [[!]flag]* [member_type]
[return_type] member_name [(class_name, ...)];
})
You can specify as many rules as needed, and the rules are matched from top to bottom.
For the rules, most class specifiers can be negated by adding an exclamation mark in front of them.
class_name, return_type, argument_type and name can use wild cards.
Wildcards can be used as follows:
* matches zero or more characters.
+ matches one or more characters.
? matches exactly one character.
*Test matches MyTestOne and Test but not TestTwo.
obfuscate class com.example.app.*; # Obfuscate all classes within com.example.app package.
You can specify as many rules as you desire, and the rules are matched from top to bottom. Later rules have priority over initial rules.
# comment
obfuscate class *;
frameworkjar "/path/to/library.jar";
verify regex;
include "/path/to/rules-file.cfg";
include builtin:default-unobfuscate.cfg;