Skip to content

Commit

Permalink
fix nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Oct 27, 2024
1 parent 8e93c76 commit b0bd428
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions docs/2_2_1_fingerprinting.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ val patch = bytecodePatch {
>
> ```kt
> fingerprint(fuzzyPatternScanThreshhold = 2) {
> opcodes(
> Opcode.ICONST_0,
> null,
> Opcode.ICONST_1,
> Opcode.IRETURN,
> opcodes(
> Opcode.ICONST_0,
> null,
> Opcode.ICONST_1,
> Opcode.IRETURN,
> )
>}
> ```
Expand Down Expand Up @@ -225,11 +225,11 @@ You can match a fingerprint the following ways:
you can match the fingerprint on the list of classes:

```kt
execute { context ->
val match = showAdsFingerprint.apply {
match(context, context.classes)
}.match ?: throw PatchException("No match found")
}
execute { context ->
val match = showAdsFingerprint.apply {
match(context, context.classes)
}.match ?: throw PatchException("No match found")
}
```

- In a **single class**, if the fingerprint can match in a single known class
Expand All @@ -238,11 +238,11 @@ you can match the fingerprint on the list of classes:

```kt
execute { context ->
val adsLoaderClass = context.classes.single { it.name == "Lcom/some/app/ads/Loader;" }
val adsLoaderClass = context.classes.single { it.name == "Lcom/some/app/ads/Loader;" }

val match = showAdsFingerprint.apply {
match(context, adsLoaderClass)
}.match ?: throw PatchException("No match found")
val match = showAdsFingerprint.apply {
match(context, adsLoaderClass)
}.match ?: throw PatchException("No match found")
}
```

Expand All @@ -254,17 +254,17 @@ or the indices of the instructions with certain string references.

```kt
execute { context ->
val proStringsFingerprint = fingerprint {
strings("free", "trial")
}
val proStringsFingerprint = fingerprint {
strings("free", "trial")
}

proStringsFingerprint.apply {
match(context, adsFingerprintMatch.method)
}.match?.let { match ->
match.stringMatches.forEach { match ->
println("The index of the string '${match.string}' is ${match.index}")
}
} ?: throw PatchException("No match found")
proStringsFingerprint.apply {
match(context, adsFingerprintMatch.method)
}.match?.let { match ->
match.stringMatches.forEach { match ->
println("The index of the string '${match.string}' is ${match.index}")
}
} ?: throw PatchException("No match found")
}
```

Expand Down

0 comments on commit b0bd428

Please sign in to comment.