Skip to content

Static_replacements

Cregrant edited this page Jun 10, 2023 · 1 revision

Static replacements

If you need to apply a rule to some files from AndroidManifest.xml, it is convenient to use ready-made keywords instead of finding the path manually. To use it, AndroidManifest.xml must be decompiled.

Supported replacements for the Open Camera example:

[APPLICATION] - <application> from the manifest:
The rule will change smali/net/sourceforge/opencamera/OpenCameraApplication.smali

[ACTIVITIES] - all <activity> in the manifest:
The rule will change smali/net/sourceforge/opencamera/MainActivity.smali
The rule will change smali/net/sourceforge/opencamera/remotecontrol/DeviceScanner.smali The rule will change smali/net/sourceforge/opencamera/TakePhoto.smali`

[LAUNCHER_ACTIVITIES] - all <activity> in the manifest with android.intent.category.LAUNCHER (start from the launcher):
The rule will change smali/net/sourceforge/opencamera/MainActivity.smali

Examples

[MATCH_REPLACE]
TARGET:
[APPLICATION]
MATCH:
 hi 
REGEX:
true
REPLACE:
 hello 
[/MATCH_REPLACE]

Clone this wiki locally