Skip to content

Commit

Permalink
Revert "refactor: Deprecate pure opcode declarations" It's still usef…
Browse files Browse the repository at this point in the history
…ul to sometimes use only opcodes and declaring entirely as instruction() is a lot of boilerplate code.

This reverts commit f93f870.
  • Loading branch information
LisoUseInAIKyrios committed Jan 21, 2025
1 parent c74c1b8 commit 5885984
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 7 additions & 0 deletions docs/2_2_1_fingerprinting.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,13 @@ val hideAdsFingerprint by fingerprint {
same instruction. Such as:
`anyInstruction(string("string in early app target"), string("updated string in latest app target"))`

If a method cannot be uniquely identified using the built in filters, but a fixed
pattern of opcodes can identify the method, then the opcode pattern can be
defined using the fingerprint `opcodes()` declaration. Opcode patterns do not
allow variable spacing between each opcode, and all opcodes all must appear exactly as declared.
Opcode patterns should be avoided whenever possible due to their fragility and
possibility of matching completely unrelated code.

> [!TIP]
> A fingerprint should contain information about a method likely to remain stable across updates.
> Names of obfuscated classes and methods should not be used since they can change between app updates.
Expand Down
1 change: 0 additions & 1 deletion src/main/kotlin/app/revanced/patcher/Fingerprint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,6 @@ class FingerprintBuilder(val name: String) {
* @param opcodes An opcode pattern of instructions.
* Wildcard or unknown opcodes can be specified by `null`.
*/
@Deprecated("Instead use the more precise `instructions()` declarations")
fun opcodes(vararg opcodes: Opcode?) {
verifyNoFiltersSet()
this.instructionFilters = OpcodesFilter.listOfOpcodes(opcodes.toList())
Expand Down

0 comments on commit 5885984

Please sign in to comment.