Compare commits

...

2 Commits

Author SHA1 Message Date
semantic-release-bot
a13e294978 chore(release): 2.81.6 [skip ci]
## [2.81.6](https://github.com/revanced/revanced-patches/compare/v2.81.5...v2.81.6) (2022-10-10)

### Bug Fixes

* **video-ads:** return empty list in correct method ([ef095b1](a3548ed524))
2022-10-10 13:53:46 +00:00
oSumAtrIX
a3548ed524 fix(video-ads): return empty list in correct method 2022-10-10 15:51:32 +02:00
4 changed files with 25 additions and 16 deletions

View File

@@ -1,3 +1,10 @@
## [2.81.6](https://github.com/revanced/revanced-patches/compare/v2.81.5...v2.81.6) (2022-10-10)
### Bug Fixes
* **video-ads:** return empty list in correct method ([bbcf050](https://github.com/revanced/revanced-patches/commit/bbcf0501d4be0c43eddb7a9b3c32394222efc8f0))
## [2.81.5](https://github.com/revanced/revanced-patches/compare/v2.81.4...v2.81.5) (2022-10-10)

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official
version = 2.81.5
version = 2.81.6

View File

@@ -5,14 +5,15 @@ import app.revanced.patcher.annotation.Version
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
import org.jf.dexlib2.Opcode
@Name("load-ads-fingerprint")
@VideoAdsCompatibility
@Version("0.0.1")
object LoadAdsFingerprint : MethodFingerprint(
strings = listOf("Unexpected playerAd type: "),
opcodes = listOf(Opcode.INVOKE_INTERFACE_RANGE),
customFingerprint = { method ->
method.parameterTypes.size > 0 && method.parameterTypes.first() == "Ljava/lang/String;"
method.parameterTypes.size > 0 && method.parameterTypes.first().endsWith("InstreamAdBreak;")
}
)

View File

@@ -41,19 +41,20 @@ class VideoAdsPatch : BytecodePatch(
)
)
LoadAdsFingerprint.result!!.mutableMethod.let { method ->
method.addInstructions(
0,
"""
invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z
move-result v1
if-nez v1, :show_video_ads
new-instance v3, Ljava/util/ArrayList;
invoke-direct { v3 }, Ljava/util/ArrayList;-><init>()V
return-object v3
""",
listOf(ExternalLabel("show_video_ads", method.instruction(0)))
)
with(LoadAdsFingerprint.result!!) {
val insertIndex = scanResult.patternScanResult!!.startIndex
with(mutableMethod) {
addInstructions(
insertIndex,
"""
invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z
move-result v4
if-nez v4, :show_video_ads
return-object v3
""",
listOf(ExternalLabel("show_video_ads", instruction(insertIndex)))
)
}
}
return PatchResultSuccess()