Skip to content

Commit c74c1b8

Browse files
rename parameter to be more clear
1 parent 955ceb6 commit c74c1b8

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

src/main/kotlin/app/revanced/patcher/Fingerprint.kt

+24-24
Original file line numberDiff line numberDiff line change
@@ -821,15 +821,15 @@ abstract class InstructionFilter(
821821
/**
822822
* If this filter matches the method instruction.
823823
*
824-
* @param method The enclosing method of [instruction].
824+
* @param enclosingMethod The method of that contains [instruction].
825825
* @param instruction The instruction to check for a match.
826-
* @param methodIndex The index of [instruction] in the enclosing [method].
826+
* @param methodIndex The index of [instruction] in the enclosing [enclosingMethod].
827827
* The index can be ignored unless a filter has an unusual reason,
828828
* such as matching only the last index of a method.
829829
*/
830830
abstract fun matches(
831831
context: BytecodePatchContext,
832-
method: Method,
832+
enclosingMethod: Method,
833833
instruction: Instruction,
834834
methodIndex: Int
835835
): Boolean
@@ -852,12 +852,12 @@ class AnyInstruction internal constructor(
852852

853853
override fun matches(
854854
context: BytecodePatchContext,
855-
method: Method,
855+
enclosingMethod: Method,
856856
instruction: Instruction,
857857
methodIndex: Int
858858
) : Boolean {
859859
return filters.any { filter ->
860-
filter.matches(context, method, instruction, methodIndex)
860+
filter.matches(context, enclosingMethod, instruction, methodIndex)
861861
}
862862
}
863863
}
@@ -879,7 +879,7 @@ open class OpcodeFilter(
879879

880880
override fun matches(
881881
context: BytecodePatchContext,
882-
method: Method,
882+
enclosingMethod: Method,
883883
instruction: Instruction,
884884
methodIndex: Int
885885
): Boolean {
@@ -914,7 +914,7 @@ open class OpcodesFilter private constructor(
914914

915915
override fun matches(
916916
context: BytecodePatchContext,
917-
method: Method,
917+
enclosingMethod: Method,
918918
instruction: Instruction,
919919
methodIndex: Int
920920
): Boolean {
@@ -963,11 +963,11 @@ class LiteralFilter internal constructor(
963963

964964
override fun matches(
965965
context: BytecodePatchContext,
966-
method: Method,
966+
enclosingMethod: Method,
967967
instruction: Instruction,
968968
methodIndex: Int
969969
): Boolean {
970-
if (!super.matches(context, method, instruction, methodIndex)) {
970+
if (!super.matches(context, enclosingMethod, instruction, methodIndex)) {
971971
return false
972972
}
973973

@@ -1030,11 +1030,11 @@ class StringFilter internal constructor(
10301030

10311031
override fun matches(
10321032
context: BytecodePatchContext,
1033-
method: Method,
1033+
enclosingMethod: Method,
10341034
instruction: Instruction,
10351035
methodIndex: Int
10361036
): Boolean {
1037-
if (!super.matches(context, method, instruction, methodIndex)) {
1037+
if (!super.matches(context, enclosingMethod, instruction, methodIndex)) {
10381038
return false
10391039
}
10401040

@@ -1088,11 +1088,11 @@ class MethodCallFilter internal constructor(
10881088

10891089
override fun matches(
10901090
context: BytecodePatchContext,
1091-
method: Method,
1091+
enclosingMethod: Method,
10921092
instruction: Instruction,
10931093
methodIndex: Int
10941094
): Boolean {
1095-
if (!super.matches(context, method, instruction, methodIndex)) {
1095+
if (!super.matches(context, enclosingMethod, instruction, methodIndex)) {
10961096
return false
10971097
}
10981098

@@ -1108,7 +1108,7 @@ class MethodCallFilter internal constructor(
11081108
// Would be nice if this also checked all super classes,
11091109
// but doing so requires iteratively checking all superclasses
11101110
// up to the root Object class since class defs are mere Strings.
1111-
if (!(definingClass == "this" && referenceClass == method.definingClass)) {
1111+
if (!(definingClass == "this" && referenceClass == enclosingMethod.definingClass)) {
11121112
return false
11131113
} // else, the method call is for 'this' class.
11141114
}
@@ -1376,11 +1376,11 @@ class FieldAccessFilter internal constructor(
13761376

13771377
override fun matches(
13781378
context: BytecodePatchContext,
1379-
method: Method,
1379+
enclosingMethod: Method,
13801380
instruction: Instruction,
13811381
methodIndex: Int
13821382
): Boolean {
1383-
if (!super.matches(context, method, instruction, methodIndex)) {
1383+
if (!super.matches(context, enclosingMethod, instruction, methodIndex)) {
13841384
return false
13851385
}
13861386

@@ -1392,7 +1392,7 @@ class FieldAccessFilter internal constructor(
13921392
val definingClass = definingClass(context)
13931393

13941394
if (!referenceClass.endsWith(definingClass)) {
1395-
if (!(definingClass == "this" && referenceClass == method.definingClass)) {
1395+
if (!(definingClass == "this" && referenceClass == enclosingMethod.definingClass)) {
13961396
return false
13971397
} // else, the method call is for 'this' class.
13981398
}
@@ -1562,11 +1562,11 @@ class NewInstanceFilter internal constructor (
15621562

15631563
override fun matches(
15641564
context: BytecodePatchContext,
1565-
method: Method,
1565+
enclosingMethod: Method,
15661566
instruction: Instruction,
15671567
methodIndex: Int
15681568
): Boolean {
1569-
if (!super.matches(context, method, instruction, methodIndex)) {
1569+
if (!super.matches(context, enclosingMethod, instruction, methodIndex)) {
15701570
return false
15711571
}
15721572

@@ -1607,11 +1607,11 @@ class CheckCastFilter internal constructor (
16071607

16081608
override fun matches(
16091609
context: BytecodePatchContext,
1610-
method: Method,
1610+
enclosingMethod: Method,
16111611
instruction: Instruction,
16121612
methodIndex: Int
16131613
): Boolean {
1614-
if (!super.matches(context, method, instruction, methodIndex)) {
1614+
if (!super.matches(context, enclosingMethod, instruction, methodIndex)) {
16151615
return false
16161616
}
16171617

@@ -1652,12 +1652,12 @@ class LastInstructionFilter internal constructor(
16521652

16531653
override fun matches(
16541654
context: BytecodePatchContext,
1655-
method: Method,
1655+
enclosingMethod: Method,
16561656
instruction: Instruction,
16571657
methodIndex: Int
16581658
): Boolean {
1659-
return methodIndex == method.instructions.count() - 1 && filter.matches(
1660-
context, method, instruction, methodIndex
1659+
return methodIndex == enclosingMethod.instructions.count() - 1 && filter.matches(
1660+
context, enclosingMethod, instruction, methodIndex
16611661
)
16621662
}
16631663
}

0 commit comments

Comments
 (0)