Compare commits

...

2 Commits

Author SHA1 Message Date
semantic-release-bot
bfe3876cea chore(release): 2.111.3 [skip ci]
## [2.111.3](https://github.com/revanced/revanced-patches/compare/v2.111.2...v2.111.3) (2022-11-18)

### Bug Fixes

* **youtube/litho-filter:** use correct type for switch case ([#1068](https://github.com/revanced/revanced-patches/issues/1068)) ([c0123af](3ad2c42a53))
2022-11-18 19:16:21 +00:00
Canny
3ad2c42a53 fix(youtube/litho-filter): use correct type for switch case (#1068)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-11-18 20:13:09 +01:00
4 changed files with 25 additions and 26 deletions

View File

@@ -1,3 +1,10 @@
## [2.111.3](https://github.com/revanced/revanced-patches/compare/v2.111.2...v2.111.3) (2022-11-18)
### Bug Fixes
* **youtube/litho-filter:** use correct type for switch case ([#1068](https://github.com/revanced/revanced-patches/issues/1068)) ([ab03511](https://github.com/revanced/revanced-patches/commit/ab03511e23d07c7c40b58eae5791fb2a798289de))
## [2.111.2](https://github.com/revanced/revanced-patches/compare/v2.111.1...v2.111.2) (2022-11-18)

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official
version = 2.111.2
version = 2.111.3

View File

@@ -47,15 +47,15 @@ class LithoFilterPatch : BytecodePatch(
addInstructions(
insertHookIndex, // right after setting the component.pathBuilder field,
"""
invoke-static {v5, v2}, Lapp/revanced/integrations/patches/LithoFilterPatch;->filter(Ljava/lang/StringBuilder;Ljava/lang/String;)Z
move-result v$clobberedRegister
if-eqz v$clobberedRegister, :not_an_ad
move-object/from16 v2, p1
invoke-static {v2}, $builderMethodDescriptor
move-result-object v0
iget-object v0, v0, $emptyComponentFieldDescriptor
return-object v0
""",
invoke-static {v5, v2}, Lapp/revanced/integrations/patches/LithoFilterPatch;->filter(Ljava/lang/StringBuilder;Ljava/lang/String;)Z
move-result v$clobberedRegister
if-eqz v$clobberedRegister, :not_an_ad
move-object/from16 v2, p1
invoke-static {v2}, $builderMethodDescriptor
move-result-object v0
iget-object v0, v0, $emptyComponentFieldDescriptor
return-object v0
""",
listOf(ExternalLabel("not_an_ad", instruction(insertHookIndex)))
)
}
@@ -65,22 +65,14 @@ class LithoFilterPatch : BytecodePatch(
}
private companion object {
fun Instruction.toDescriptor() = when (val reference = (this as ReferenceInstruction).reference) {
MethodReference::class -> {
val methodReference = reference as MethodReference
"${methodReference.definingClass}->${methodReference.name}(${
methodReference.parameterTypes.joinToString(
""
) { it }
})${methodReference.returnType}"
}
FieldReference::class -> {
val fieldReference = reference as FieldReference
"${fieldReference.definingClass}->${fieldReference.name}:${fieldReference.type}"
}
fun Instruction.toDescriptor() = when (val reference = (this as? ReferenceInstruction)?.reference) {
is MethodReference -> "${reference.definingClass}->${reference.name}(${
reference.parameterTypes.joinToString(
""
) { it }
})${reference.returnType}"
is FieldReference -> "${reference.definingClass}->${reference.name}:${reference.type}"
else -> throw PatchResultError("Unsupported reference type")
}
}
}
}