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) ## [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 kotlin.code.style = official
version = 2.111.2 version = 2.111.3

View File

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