mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-30 14:11:05 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52424bd6ab | ||
|
|
4c2d6466cc | ||
|
|
6bcae6ddeb | ||
|
|
65cee57493 |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,3 +1,17 @@
|
|||||||
|
## [2.81.2](https://github.com/revanced/revanced-patches/compare/v2.81.1...v2.81.2) (2022-10-08)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **theme:** include coloring the playlist action bar ([#742](https://github.com/revanced/revanced-patches/issues/742)) ([6766ec8](https://github.com/revanced/revanced-patches/commit/6766ec8f31da6dd71fff0ae4b7044af5ec4a5dfd))
|
||||||
|
|
||||||
|
## [2.81.1](https://github.com/revanced/revanced-patches/compare/v2.81.0...v2.81.1) (2022-10-07)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **video-ads:** block remaining video ads ([fbc83a2](https://github.com/revanced/revanced-patches/commit/fbc83a22d37012394311a87d27202b7cc86e047d))
|
||||||
|
|
||||||
# [2.81.0](https://github.com/revanced/revanced-patches/compare/v2.80.0...v2.81.0) (2022-10-06)
|
# [2.81.0](https://github.com/revanced/revanced-patches/compare/v2.80.0...v2.81.0) (2022-10-06)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.81.0
|
version = 2.81.2
|
||||||
|
|||||||
@@ -2,16 +2,17 @@ package app.revanced.patches.youtube.ad.video.fingerprints
|
|||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
|
|
||||||
@Name("show-video-ads-method-fingerprint")
|
@Name("load-ads-fingerprint")
|
||||||
|
|
||||||
@VideoAdsCompatibility
|
@VideoAdsCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object ShowVideoAdsFingerprint : MethodFingerprint(
|
object LoadAdsFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z")
|
strings = listOf("Unexpected playerAd type: "),
|
||||||
|
customFingerprint = { method ->
|
||||||
|
method.parameterTypes.size > 0 && method.parameterTypes.first() == "Ljava/lang/String;"
|
||||||
|
}
|
||||||
)
|
)
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.ad.video.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.extensions.or
|
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
|
|
||||||
@Name("show-video-ads-constructor-fingerprint")
|
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
|
||||||
@VideoAdsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object ShowVideoAdsConstructorFingerprint : MethodFingerprint(
|
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L"), listOf(
|
|
||||||
Opcode.INVOKE_DIRECT,
|
|
||||||
Opcode.NEW_INSTANCE,
|
|
||||||
Opcode.INVOKE_DIRECT,
|
|
||||||
Opcode.IPUT_OBJECT,
|
|
||||||
Opcode.NEW_INSTANCE,
|
|
||||||
null, // either CONST_4 or CONST_16
|
|
||||||
Opcode.INVOKE_DIRECT,
|
|
||||||
Opcode.IPUT_OBJECT,
|
|
||||||
Opcode.NEW_INSTANCE,
|
|
||||||
Opcode.INVOKE_DIRECT,
|
|
||||||
Opcode.IPUT_OBJECT,
|
|
||||||
Opcode.IPUT_OBJECT,
|
|
||||||
Opcode.IPUT_OBJECT,
|
|
||||||
Opcode.CONST_4,
|
|
||||||
Opcode.IPUT_BOOLEAN,
|
|
||||||
Opcode.RETURN_VOID
|
|
||||||
)
|
|
||||||
)
|
|
||||||
@@ -5,15 +5,15 @@ import app.revanced.patcher.annotation.Name
|
|||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.extensions.instruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.util.smali.ExternalLabel
|
||||||
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
||||||
import app.revanced.patches.youtube.ad.video.fingerprints.ShowVideoAdsConstructorFingerprint
|
import app.revanced.patches.youtube.ad.video.fingerprints.LoadAdsFingerprint
|
||||||
import app.revanced.patches.youtube.ad.video.fingerprints.ShowVideoAdsFingerprint
|
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||||
@@ -27,7 +27,7 @@ import app.revanced.patches.youtube.misc.settings.framework.components.impl.Swit
|
|||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class VideoAdsPatch : BytecodePatch(
|
class VideoAdsPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
ShowVideoAdsConstructorFingerprint
|
LoadAdsFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
@@ -41,17 +41,19 @@ class VideoAdsPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
ShowVideoAdsFingerprint.resolve(
|
LoadAdsFingerprint.result!!.mutableMethod.let { method ->
|
||||||
context, ShowVideoAdsConstructorFingerprint.result!!.classDef
|
method.addInstructions(
|
||||||
)
|
0,
|
||||||
|
"""
|
||||||
// Override the parameter by calling shouldShowAds and setting the parameter to the result
|
invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z
|
||||||
ShowVideoAdsFingerprint.result!!.mutableMethod.addInstructions(
|
move-result v1
|
||||||
0, """
|
if-nez v1, :show_video_ads
|
||||||
invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z
|
const/4 v1, 0x0
|
||||||
move-result v1
|
return-object v1
|
||||||
"""
|
""",
|
||||||
)
|
listOf(ExternalLabel("show_video_ads", method.instruction(0)))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ class ThemePatch : ResourcePatch {
|
|||||||
val node = resourcesNode.childNodes.item(i) as? Element ?: continue
|
val node = resourcesNode.childNodes.item(i) as? Element ?: continue
|
||||||
|
|
||||||
node.textContent = when (node.getAttribute("name")) {
|
node.textContent = when (node.getAttribute("name")) {
|
||||||
"yt_black1", "yt_black1_opacity95", "yt_black2", "yt_black3", "yt_black4",
|
"yt_black1", "yt_black1_opacity95", "yt_black1_opacity98", "yt_black2", "yt_black3", "yt_black4",
|
||||||
"yt_status_bar_background_dark" -> darkThemeBackgroundColor
|
"yt_status_bar_background_dark" -> darkThemeBackgroundColor
|
||||||
|
|
||||||
"yt_white1", "yt_white1_opacity95", "yt_white2", "yt_white3",
|
"yt_white1", "yt_white1_opacity95", "yt_white1_opacity98", "yt_white2", "yt_white3",
|
||||||
"yt_white4" -> lightThemeBackgroundColor
|
"yt_white4" -> lightThemeBackgroundColor
|
||||||
|
|
||||||
else -> continue
|
else -> continue
|
||||||
@@ -62,4 +62,4 @@ class ThemePatch : ResourcePatch {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user