Skip to content

Targets

Lenni0451 edited this page Dec 16, 2023 · 1 revision

Method Pattern

A method pattern allows matching one or multiple methods based on their name and/or descriptor.
The pattern allows the use of wildcards (*) to target multiple methods.

Examples:

Pattern Matches
* All methods
test All methods named test
*test All methods ending with test
test* All methods starting with test
*test* All methods containing test
test(Z)* All methods named test with a single int parameter
test(I)Z All methods named test with a single int parameter and a boolean return type
*(I)Z All methods with a single int parameter and a boolean return type

Method Target

A method target only allows matching a single method and requires the full owner, name and descriptor.

Examples:

  • Ljava/lang/String;toUpperCase()Ljava/lang/String;
  • java/lang/String.toUpperCase()Ljava/lang/String;

Field Target

A field target only allows matching a single field and requires the full owner, name and descriptor.

Examples:

  • Ljava/lang/Integer;MAX_VALUE#I
  • java/lang/Integer.MAX_VALUE#I