-
Notifications
You must be signed in to change notification settings - Fork 2
MATCH_ASSIGN
Cregrant edited this page Jun 11, 2023
·
4 revisions
Saves the text you found as a variable for other rules.
- NAME: the name of the rule (optional)
- TARGET: the path to the text file to search. Supports Variables, Glob pattern and Static replacements. If you use the search pattern, the search will end when the first matching path is found (i.e., the extensive smali/*.smali will stop at the first file)
- MATCH: the text to be searched in the file
- REGEX: always
true - ASSIGN: sets the name and value of a variable, for example,
p1=${GROUP1}. If there are multiple variables, each one must start on a new line
You shouldn't separate the variable name and its value with spaces, e.g., p1 = ${GROUP1}. Spaces around the edges of the ${GROUP1} value will also be removed.
Load text from smali/p.smali and remove it from all .smali files:
[MATCH_ASSIGN]
TARGET:
smali/p.smali
MATCH:
The text is (.+)
REGEX:
true
ASSIGN:
text=${GROUP1}
[/MATCH_ASSIGN]
[MATCH_REPLACE]
TARGET:
smali*/*.smali
MATCH:
${text}
REGEX:
true
REPLACE:
[/MATCH_REPLACE]

