chore: merge branch dev to main (#156)

This commit is contained in:
oSumAtrIX 2023-02-10 05:26:43 +01:00 committed by GitHub
commit f1336f89e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 21 deletions

View file

@ -1,3 +1,10 @@
## [6.4.3-dev.1](https://github.com/revanced/revanced-patcher/compare/v6.4.2...v6.4.3-dev.1) (2023-02-10)
### Bug Fixes
* check `CONST_STRING_JUMP` instructions for matching string ([058d292](https://github.com/revanced/revanced-patcher/commit/058d292ad5e297f4c652ff543c13e77a39f7fb1b))
## [6.4.2](https://github.com/revanced/revanced-patcher/compare/v6.4.1...v6.4.2) (2023-01-17)

View file

@ -1,2 +1,2 @@
kotlin.code.style = official
version = 6.4.2
version = 6.4.3-dev.1

View file

@ -101,7 +101,7 @@ fun MutableMethod.removeInstruction(index: Int) = this.implementation!!.removeIn
fun MutableMethod.label(index: Int) = this.implementation!!.newLabelForIndex(index)
/**
* Get the instruction at given index in the method's implementation.
* Get the instruction at the given index in the method's implementation.
* @param index The index to get the instruction at.
* @return The instruction.
*/
@ -227,21 +227,4 @@ internal fun parametersEqual(
internal val nullOutputStream = object : OutputStream() {
override fun write(b: Int) {}
}
/**
* Should be used to parse a list of parameters represented by their first letter,
* or in the case of arrays prefixed with an unspecified amount of '[' character.
*/
internal fun String.parseParameters(): List<String> {
val parameters = mutableListOf<String>()
var parameter = ""
for (char in this.toCharArray()) {
parameter += char
if (char == '[') continue
parameters.add(parameter)
parameter = ""
}
return parameters
}

View file

@ -106,7 +106,10 @@ abstract class MethodFingerprint(
val stringsList = methodFingerprint.strings.toMutableList()
implementation.instructions.forEachIndexed { instructionIndex, instruction ->
if (instruction.opcode.ordinal != Opcode.CONST_STRING.ordinal) return@forEachIndexed
if (
instruction.opcode != Opcode.CONST_STRING &&
instruction.opcode != Opcode.CONST_STRING_JUMBO
) return@forEachIndexed
val string = ((instruction as ReferenceInstruction).reference as StringReference).string
val index = stringsList.indexOfFirst(string::contains)
@ -244,7 +247,7 @@ data class MethodFingerprintResult(
* The result of scanning strings on the [MethodFingerprint].
* @param matches The list of strings that were matched.
*/
data class StringsScanResult(val matches: List<StringMatch>){
data class StringsScanResult(val matches: List<StringMatch>) {
/**
* Represents a match for a string at an index.
* @param string The string that was matched.