Compare commits

...

23 Commits

Author SHA1 Message Date
semantic-release-bot
0715e4c723 chore(release): 2.200.0-dev.3 [skip ci]
# [2.200.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v2.200.0-dev.2...v2.200.0-dev.3) (2023-11-21)

### Bug Fixes

* **YouTube - Remove tracking query parameter:** Sanitize shared URLs in remaining places ([51ab7a6](51ab7a65a0))
2023-11-21 22:22:03 +00:00
oSumAtrIX
51ab7a65a0 fix(YouTube - Remove tracking query parameter): Sanitize shared URLs in remaining places 2023-11-21 23:09:57 +01:00
semantic-release-bot
2757572442 chore(release): 2.200.0-dev.2 [skip ci]
# [2.200.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v2.200.0-dev.1...v2.200.0-dev.2) (2023-11-21)

### Bug Fixes

* **Spotify - Custom theme:** Add more background surfaces coloring options ([#3285](https://github.com/ReVanced/revanced-patches/issues/3285)) ([521d3a0](521d3a08c8))
2023-11-21 20:16:11 +00:00
Advyte
521d3a08c8 fix(Spotify - Custom theme): Add more background surfaces coloring options (#3285)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-11-21 21:13:58 +01:00
semantic-release-bot
5282ccf4f3 chore(release): 2.200.0-dev.1 [skip ci]
# [2.200.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.199.0...v2.200.0-dev.1) (2023-11-21)

### Features

* **Twitch:** Constrain patches to versions known to work ([54b23da](54b23da0b4))
* **Twitch:** Support version `16.9.1` ([e74f7d9](e74f7d96d7))
2023-11-21 20:08:05 +00:00
oSumAtrIX
e74f7d96d7 feat(Twitch): Support version 16.9.1 2023-11-21 21:05:23 +01:00
oSumAtrIX
54b23da0b4 feat(Twitch): Constrain patches to versions known to work 2023-11-21 21:05:22 +01:00
semantic-release-bot
368b4a56f4 chore(release): 2.199.0 [skip ci]
# [2.199.0](https://github.com/ReVanced/revanced-patches/compare/v2.198.0...v2.199.0) (2023-11-20)

### Bug Fixes

* **Twitch - Settings:** Constrain to last working version ([d9e902d](d9e902d07a))
* **YouTube - Settings:** Remove unnecessary punctuation ([#3301](https://github.com/ReVanced/revanced-patches/issues/3301)) ([97bb4d5](97bb4d55e6))
* **Yuka - Unlock premium:** Constrain to last working version ([529eef6](529eef6efd))

### Features

* **YouTube:** Add `Disable rolling number animations` patch ([#3298](https://github.com/ReVanced/revanced-patches/issues/3298)) ([a9fdeb1](a9fdeb152d))
2023-11-20 17:58:38 +00:00
oSumAtrIX
56b0a6295f chore: Merge branch dev to main (#3302) 2023-11-20 18:56:25 +01:00
semantic-release-bot
3eb1d66716 chore(release): 2.198.1-dev.2 [skip ci]
## [2.198.1-dev.2](https://github.com/ReVanced/revanced-patches/compare/v2.198.1-dev.1...v2.198.1-dev.2) (2023-11-19)

### Bug Fixes

* **Twitch - Settings:** Constrain to last working version ([1138d23](1138d2392e))
* **Yuka - Unlock premium:** Constrain to last working version ([3ec52b5](3ec52b51dd))
2023-11-20 18:40:59 +01:00
oSumAtrIX
529eef6efd fix(Yuka - Unlock premium): Constrain to last working version 2023-11-20 18:40:59 +01:00
oSumAtrIX
d9e902d07a fix(Twitch - Settings): Constrain to last working version 2023-11-20 18:40:58 +01:00
LisoUseInAIKyrios
a9fdeb152d feat(YouTube): Add Disable rolling number animations patch (#3298) 2023-11-20 18:40:48 +01:00
semantic-release-bot
114378db68 chore(release): 2.198.1-dev.1 [skip ci]
## [2.198.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.198.0...v2.198.1-dev.1) (2023-11-19)

### Bug Fixes

* **YouTube - Settings:** Remove unnecessary punctuation ([#3301](https://github.com/ReVanced/revanced-patches/issues/3301)) ([97bb4d5](97bb4d55e6))
2023-11-19 04:05:30 +00:00
KobeW50
97bb4d55e6 fix(YouTube - Settings): Remove unnecessary punctuation (#3301) 2023-11-19 05:03:23 +01:00
semantic-release-bot
4d04e954a6 chore(release): 2.198.0 [skip ci]
# [2.198.0](https://github.com/ReVanced/revanced-patches/compare/v2.197.0...v2.198.0) (2023-11-19)

### Bug Fixes

* **YouTube - ReturnYouTubeDislike:** Fix text alignment on videos that don't use rolling number animations ([85aed52](85aed52c25))
* **YouTube - ReturnYouTubeDislike:** Improve layout padding ([#3291](https://github.com/ReVanced/revanced-patches/issues/3291)) ([2c58817](2c5881771e))

### Features

* **YouTube - Custom branding:** Add "YT ReVanced" to the default app name options ([#3300](https://github.com/ReVanced/revanced-patches/issues/3300)) ([f87e5db](f87e5db3f6))
2023-11-19 04:02:15 +00:00
oSumAtrIX
4ae80c2c59 chore: Merge branch dev to main (#3295) 2023-11-19 05:00:04 +01:00
semantic-release-bot
705614a9df chore(release): 2.198.0-dev.1 [skip ci]
# [2.198.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.197.1-dev.2...v2.198.0-dev.1) (2023-11-19)

### Features

* **YouTube - Custom branding:** Add "YT ReVanced" to the default app name options ([#3300](https://github.com/ReVanced/revanced-patches/issues/3300)) ([f87e5db](f87e5db3f6))
2023-11-19 02:34:17 +00:00
KobeW50
f87e5db3f6 feat(YouTube - Custom branding): Add "YT ReVanced" to the default app name options (#3300) 2023-11-19 03:32:08 +01:00
semantic-release-bot
4e17b78ba0 chore(release): 2.197.1-dev.2 [skip ci]
## [2.197.1-dev.2](https://github.com/ReVanced/revanced-patches/compare/v2.197.1-dev.1...v2.197.1-dev.2) (2023-11-18)

### Bug Fixes

* **YouTube - ReturnYouTubeDislike:** Fix text alignment on videos that don't use rolling number animations ([85aed52](85aed52c25))
2023-11-18 22:24:16 +00:00
LisoUseInAIKyrios
85aed52c25 fix(YouTube - ReturnYouTubeDislike): Fix text alignment on videos that don't use rolling number animations 2023-11-19 00:21:36 +02:00
semantic-release-bot
3cf76488c0 chore(release): 2.197.1-dev.1 [skip ci]
## [2.197.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.197.0...v2.197.1-dev.1) (2023-11-18)

### Bug Fixes

* **YouTube - ReturnYouTubeDislike:** Improve layout padding ([#3291](https://github.com/ReVanced/revanced-patches/issues/3291)) ([2c58817](2c5881771e))
2023-11-18 19:13:11 +00:00
LisoUseInAIKyrios
2c5881771e fix(YouTube - ReturnYouTubeDislike): Improve layout padding (#3291) 2023-11-18 21:10:43 +02:00
33 changed files with 421 additions and 53 deletions

View File

@@ -1,3 +1,88 @@
# [2.200.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v2.200.0-dev.2...v2.200.0-dev.3) (2023-11-21)
### Bug Fixes
* **YouTube - Remove tracking query parameter:** Sanitize shared URLs in remaining places ([2442902](https://github.com/ReVanced/revanced-patches/commit/2442902dacc25f2c932a6689e9788e5a02fdff6b))
# [2.200.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v2.200.0-dev.1...v2.200.0-dev.2) (2023-11-21)
### Bug Fixes
* **Spotify - Custom theme:** Add more background surfaces coloring options ([#3285](https://github.com/ReVanced/revanced-patches/issues/3285)) ([869ec26](https://github.com/ReVanced/revanced-patches/commit/869ec26966f7750c45355ac0acc18b81a2abce87))
# [2.200.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.199.0...v2.200.0-dev.1) (2023-11-21)
### Features
* **Twitch:** Constrain patches to versions known to work ([65b55a5](https://github.com/ReVanced/revanced-patches/commit/65b55a5189df52dc7e99b7e9c68b908fbca92434))
* **Twitch:** Support version `16.9.1` ([c70e4a6](https://github.com/ReVanced/revanced-patches/commit/c70e4a66bd65b42db88dcabd412ec985226bd1e7))
# [2.199.0](https://github.com/ReVanced/revanced-patches/compare/v2.198.0...v2.199.0) (2023-11-20)
### Bug Fixes
* **Twitch - Settings:** Constrain to last working version ([941c1dd](https://github.com/ReVanced/revanced-patches/commit/941c1dd5cf9f43b4f6d023eacd6cfb31d87c2cd3))
* **YouTube - Settings:** Remove unnecessary punctuation ([#3301](https://github.com/ReVanced/revanced-patches/issues/3301)) ([c50ee82](https://github.com/ReVanced/revanced-patches/commit/c50ee8281f2b90a2721839047bdc8cd59c4c913a))
* **Yuka - Unlock premium:** Constrain to last working version ([81900fb](https://github.com/ReVanced/revanced-patches/commit/81900fb8db79284f57b5fd9e9ee0fe97cc0e7451))
### Features
* **YouTube:** Add `Disable rolling number animations` patch ([#3298](https://github.com/ReVanced/revanced-patches/issues/3298)) ([a0121ae](https://github.com/ReVanced/revanced-patches/commit/a0121ae7b60de88f0f2113ad0cefdb538f370780))
## [2.198.1-dev.2](https://github.com/ReVanced/revanced-patches/compare/v2.198.1-dev.1...v2.198.1-dev.2) (2023-11-19)
### Bug Fixes
* **Twitch - Settings:** Constrain to last working version ([a3e275b](https://github.com/ReVanced/revanced-patches/commit/a3e275b79adcba1ed85f359e0905759e466e8b0c))
* **Yuka - Unlock premium:** Constrain to last working version ([9b855f0](https://github.com/ReVanced/revanced-patches/commit/9b855f0b78d6c10190a433901841a7c0d9391f93))
## [2.198.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.198.0...v2.198.1-dev.1) (2023-11-19)
### Bug Fixes
* **YouTube - Settings:** Remove unnecessary punctuation ([#3301](https://github.com/ReVanced/revanced-patches/issues/3301)) ([c50ee82](https://github.com/ReVanced/revanced-patches/commit/c50ee8281f2b90a2721839047bdc8cd59c4c913a))
# [2.198.0](https://github.com/ReVanced/revanced-patches/compare/v2.197.0...v2.198.0) (2023-11-19)
### Bug Fixes
* **YouTube - ReturnYouTubeDislike:** Fix text alignment on videos that don't use rolling number animations ([8fe9df7](https://github.com/ReVanced/revanced-patches/commit/8fe9df75efa59faa9586eda8462d97f81b9f8ed0))
* **YouTube - ReturnYouTubeDislike:** Improve layout padding ([#3291](https://github.com/ReVanced/revanced-patches/issues/3291)) ([630b067](https://github.com/ReVanced/revanced-patches/commit/630b067b1828476708fd019e84153b0fb5e25d1c))
### Features
* **YouTube - Custom branding:** Add "YT ReVanced" to the default app name options ([#3300](https://github.com/ReVanced/revanced-patches/issues/3300)) ([b86bac7](https://github.com/ReVanced/revanced-patches/commit/b86bac759ebad62173b644d4a74e7bed5f252d42))
# [2.198.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.197.1-dev.2...v2.198.0-dev.1) (2023-11-19)
### Features
* **YouTube - Custom branding:** Add "YT ReVanced" to the default app name options ([#3300](https://github.com/ReVanced/revanced-patches/issues/3300)) ([b86bac7](https://github.com/ReVanced/revanced-patches/commit/b86bac759ebad62173b644d4a74e7bed5f252d42))
## [2.197.1-dev.2](https://github.com/ReVanced/revanced-patches/compare/v2.197.1-dev.1...v2.197.1-dev.2) (2023-11-18)
### Bug Fixes
* **YouTube - ReturnYouTubeDislike:** Fix text alignment on videos that don't use rolling number animations ([8fe9df7](https://github.com/ReVanced/revanced-patches/commit/8fe9df75efa59faa9586eda8462d97f81b9f8ed0))
## [2.197.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.197.0...v2.197.1-dev.1) (2023-11-18)
### Bug Fixes
* **YouTube - ReturnYouTubeDislike:** Improve layout padding ([#3291](https://github.com/ReVanced/revanced-patches/issues/3291)) ([630b067](https://github.com/ReVanced/revanced-patches/commit/630b067b1828476708fd019e84153b0fb5e25d1c))
# [2.197.0](https://github.com/ReVanced/revanced-patches/compare/v2.196.0...v2.197.0) (2023-11-18)

View File

@@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
kotlin.code.style = official
version = 2.197.0
version = 2.200.0-dev.3

File diff suppressed because one or more lines are too long

View File

@@ -17,25 +17,42 @@ object CustomThemePatch : ResourcePatch() {
private var backgroundColor by stringPatchOption(
key = "backgroundColor",
default = "@android:color/black",
title = "Background color",
title = "Primary background color",
description = "The background color. Can be a hex color or a resource reference.",
required = true
)
private var backgroundColorSecondary by stringPatchOption(
key = "backgroundColorSecondary",
default = "#ff282828",
title = "Secondary background color",
description = "The secondary background color. Can be a hex color or a resource reference.",
required = true
)
private var accentColor by stringPatchOption(
key = "accentColor",
default = "#ff1ed760",
title = "Accent color",
description = "The accent color ('spotify green' by default). Can be a hex color or a resource reference.",
description = "The accent color ('Spotify green' by default). Can be a hex color or a resource reference.",
required = true
)
private var accentPressedColor by stringPatchOption(
key = "accentPressedColor",
private var accentColorPressed by stringPatchOption(
key = "accentColorPressed",
default = "#ff169c46",
title = "Pressed accent for the dark theme",
description = "The color when accented buttons are pressed, by default slightly darker than accent. Can be a hex color or a resource reference."
title = "Pressed dark theme accent color",
description = "The color when accented buttons are pressed, by default slightly darker than accent. "
+ "Can be a hex color or a resource reference.",
required = true
)
override fun execute(context: ResourceContext) {
val backgroundColor = backgroundColor!!
val backgroundColorSecondary = backgroundColorSecondary!!
val accentColor = accentColor!!
val accentColorPressed = accentColorPressed!!
context.xmlEditor["res/values/colors.xml"].use { editor ->
val resourcesNode = editor.file.getElementsByTagName("resources").item(0) as Element
@@ -43,12 +60,18 @@ object CustomThemePatch : ResourcePatch() {
val node = resourcesNode.childNodes.item(i) as? Element ?: continue
node.textContent = when (node.getAttribute("name")) {
"gray_7" -> backgroundColor!!
"dark_brightaccent_background_base", "dark_base_text_brightaccent", "green_light" -> accentColor!!
"dark_brightaccent_background_press" -> accentPressedColor!!
"dark_base_background_elevated_base", "design_dark_default_color_background",
"design_dark_default_color_surface", "gray_7", "gray_background", "gray_layer",
"sthlm_blk" -> backgroundColor
"gray_15" -> backgroundColorSecondary
"dark_brightaccent_background_base", "dark_base_text_brightaccent", "green_light" -> accentColor
"dark_brightaccent_background_press" -> accentColorPressed
else -> continue
}
}
}
}
}
}

View File

@@ -17,7 +17,7 @@ import app.revanced.patches.twitch.misc.settings.SettingsPatch
name = "Block audio ads",
description = "Blocks audio ads in streams and VODs.",
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "17.0.0", "17.1.0"])],
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "16.9.1"])],
)
@Suppress("unused")
object AudioAdsPatch : BytecodePatch(

View File

@@ -18,7 +18,7 @@ import app.revanced.patches.twitch.misc.settings.SettingsPatch
name = "Block embedded ads",
description = "Blocks embedded stream ads using services like Luminous or PurpleAdBlocker.",
dependencies = [VideoAdsPatch::class, IntegrationsPatch::class, SettingsPatch::class],
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "17.0.0", "17.1.0"])]
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "16.9.1"])]
)
@Suppress("unused")
object EmbeddedAdsPatch : BytecodePatch(

View File

@@ -21,7 +21,7 @@ import app.revanced.patches.twitch.misc.settings.SettingsPatch
name = "Block video ads",
description = "Blocks video ads in streams and VODs.",
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "17.0.0", "17.1.0"])]
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "16.9.1"])]
)
object VideoAdsPatch : AbstractAdPatch(
"Lapp/revanced/twitch/patches/VideoAdsPatch;->shouldBlockVideoAds()Z",

View File

@@ -22,7 +22,7 @@ import app.revanced.patches.twitch.misc.settings.SettingsPatch
name = "Show deleted messages",
description = "Shows deleted chat messages behind a clickable spoiler.",
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "17.0.0", "17.1.0"])]
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "16.9.1"])]
)
@Suppress("unused")
object ShowDeletedMessagesPatch : BytecodePatch(

View File

@@ -17,7 +17,7 @@ import app.revanced.patches.twitch.misc.settings.SettingsPatch
name = "Auto claim channel points",
description = "Automatically claim Channel Points.",
dependencies = [SettingsPatch::class],
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "17.0.0", "17.1.0"])]
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "16.9.1"])]
)
@Suppress("unused")
object AutoClaimChannelPointPatch : BytecodePatch(

View File

@@ -30,7 +30,7 @@ import java.io.Closeable
description = "Adds settings menu to Twitch.",
dependencies = [IntegrationsPatch::class, SettingsResourcePatch::class],
compatiblePackages = [
CompatiblePackage("tv.twitch.android.app")
CompatiblePackage("tv.twitch.android.app", ["16.9.1"])
]
)
object SettingsPatch : BytecodePatch(

View File

@@ -7,10 +7,10 @@ import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable
import app.revanced.patches.shared.fingerprints.WatchWhileActivityFingerprint
import app.revanced.patches.youtube.interaction.swipecontrols.fingerprints.SwipeControlsHostActivityFingerprint
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
import app.revanced.patches.youtube.shared.fingerprints.WatchWhileActivityFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.immutable.ImmutableMethod

View File

@@ -43,6 +43,7 @@ object CustomBrandingPatch : ResourcePatch() {
default = APP_NAME,
values = mapOf(
"YouTube ReVanced" to APP_NAME,
"YT ReVanced" to "YT ReVanced",
"YT" to "YT",
"YouTube" to "YouTube",
),

View File

@@ -9,12 +9,12 @@ import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.fingerprints.LayoutConstructorFingerprint
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.SettingsPatch
import app.revanced.patches.youtube.shared.fingerprints.LayoutConstructorFingerprint
import com.android.tools.smali.dexlib2.iface.instruction.Instruction
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction

View File

@@ -0,0 +1,78 @@
package app.revanced.patches.youtube.layout.hide.rollingnumber
import app.revanced.extensions.exception
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.SettingsPatch
import app.revanced.patches.youtube.shared.fingerprints.RollingNumberTextViewAnimationUpdateFingerprint
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@Patch(
name = "Disable rolling number animations",
description = "Disables rolling number animations of video view count, upload time, and user likes",
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
compatiblePackages = [
CompatiblePackage(
"com.google.android.youtube", [
"18.43.45",
"18.44.41",
"18.45.41"
]
)
]
)
@Suppress("unused")
object DisableRollingNumberAnimationPatch : BytecodePatch(
setOf(
RollingNumberTextViewAnimationUpdateFingerprint
)
) {
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
"Lapp/revanced/integrations/patches/DisableRollingNumberAnimationsPatch;"
override fun execute(context: BytecodeContext) {
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
SwitchPreference(
"revanced_disable_rolling_number_animations",
StringResource("revanced_disable_rolling_number_animations_title", "Disable rolling number animations"),
StringResource("revanced_disable_rolling_number_animations_summary_on", "Rolling numbers are not animated"),
StringResource("revanced_disable_rolling_number_animations_summary_off", "Rolling numbers are animated")
)
)
// Animations are disabled by preventing an Image from being applied to the text span,
// which prevents the animations from appearing.
RollingNumberTextViewAnimationUpdateFingerprint.result?.apply {
val patternScanResult = scanResult.patternScanResult!!
val blockStartIndex = patternScanResult.startIndex
val blockEndIndex = patternScanResult.endIndex + 1
mutableMethod.apply {
val freeRegister = getInstruction<OneRegisterInstruction>(blockStartIndex).registerA
// ReturnYouTubeDislike also makes changes to this same method,
// and must add control flow label to a noop instruction to
// ensure RYD patch adds it's changes after the control flow label.
addInstructions(blockEndIndex, "nop")
addInstructionsWithLabels(
blockStartIndex,
"""
invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->disableRollingNumberAnimations()Z
move-result v$freeRegister
if-nez v$freeRegister, :disable_animations
""",
ExternalLabel("disable_animations", getInstruction(blockEndIndex))
)
}
} ?: throw RollingNumberTextViewAnimationUpdateFingerprint.exception
}
}

View File

@@ -5,14 +5,14 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWith
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.youtube.shared.fingerprints.SeekbarFingerprint
import app.revanced.patches.shared.fingerprints.SeekbarOnDrawFingerprint
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.layout.seekbar.SeekbarColorBytecodePatch
import app.revanced.patches.youtube.layout.seekbar.SeekbarPreferencesPatch
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.SettingsPatch
import app.revanced.patches.youtube.shared.fingerprints.SeekbarFingerprint
import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint
@Patch(
name = "Hide seekbar",

View File

@@ -11,13 +11,13 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints.*
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
import app.revanced.patches.youtube.shared.fingerprints.RollingNumberTextViewAnimationUpdateFingerprint
import app.revanced.patches.youtube.video.videoid.VideoIdPatch
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@@ -55,7 +55,9 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
DislikeFingerprint,
RemoveLikeFingerprint,
RollingNumberSetterFingerprint,
RollingNumberTextViewFingerprint
RollingNumberMeasureTextParentFingerprint,
RollingNumberTextViewFingerprint,
RollingNumberTextViewAnimationUpdateFingerprint
)
) {
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
@@ -181,6 +183,51 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
}
} ?: throw RollingNumberSetterFingerprint.exception
// Rolling Number text views use the measured width of the raw string for layout.
// Modify the measure text calculation to include the left drawable separator if needed.
RollingNumberMeasureAnimatedTextFingerprint.also {
if (!it.resolve(context, RollingNumberMeasureTextParentFingerprint.result!!.classDef))
throw it.exception
}.result?.also {
it.mutableMethod.apply {
val returnInstructionIndex = it.scanResult.patternScanResult!!.endIndex
val measuredTextWidthRegister =
getInstruction<OneRegisterInstruction>(returnInstructionIndex).registerA
replaceInstruction( // Replace instruction to preserve control flow label.
returnInstructionIndex,
"invoke-static {p1, v$measuredTextWidthRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->onRollingNumberMeasured(Ljava/lang/String;F)F"
)
addInstructions(
returnInstructionIndex + 1,
"""
move-result v$measuredTextWidthRegister
return v$measuredTextWidthRegister
"""
)
}
} ?: throw RollingNumberMeasureAnimatedTextFingerprint.exception
// Additional text measurement method. Used if YouTube decides not to animate the likes count
// and sometimes used for initial video load.
RollingNumberMeasureStaticLabelFingerprint.also {
if (!it.resolve(context, RollingNumberMeasureTextParentFingerprint.result!!.classDef))
throw it.exception
}.result?.also {
it.mutableMethod.apply {
val measureTextIndex = it.scanResult.patternScanResult!!.startIndex + 1
val freeRegister = getInstruction<TwoRegisterInstruction>(0).registerA
addInstructions(
measureTextIndex + 1,
"""
move-result v$freeRegister
invoke-static {p1, v$freeRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->onRollingNumberMeasured(Ljava/lang/String;F)F
"""
)
}
} ?: throw RollingNumberMeasureStaticLabelFingerprint.exception
// The rolling number Span is missing styling since it's initially set as a String.
// Modify the UI text view and use the styled like/dislike Span.
RollingNumberTextViewFingerprint.result?.let {
@@ -189,9 +236,9 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
// Videos less than 24 hours after uploaded, like counts will be updated in real time.
// Whenever like counts are updated, TextView is set in this method.
val realTimeUpdateTextViewMethod = it.mutableClass.methods.find { method ->
method.parameterTypes.first() == "Landroid/graphics/Bitmap;"
} ?: throw PatchException("Failed to find realTimeUpdateTextViewMethod")
val realTimeUpdateTextViewMethod =
RollingNumberTextViewAnimationUpdateFingerprint.result?.mutableMethod
?: throw RollingNumberTextViewAnimationUpdateFingerprint.exception
arrayOf(
initiallyCreatedTextViewMethod,

View File

@@ -0,0 +1,23 @@
package app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
/**
* Resolves to class found in [RollingNumberMeasureTextParentFingerprint].
*/
object RollingNumberMeasureAnimatedTextFingerprint : MethodFingerprint(
returnType = "F",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("Ljava/lang/String;"),
opcodes = listOf(
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.ADD_FLOAT_2ADDR,
Opcode.ADD_INT_LIT8,
Opcode.GOTO,
Opcode.RETURN
)
)

View File

@@ -0,0 +1,21 @@
package app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
/**
* Resolves to class found in [RollingNumberMeasureTextParentFingerprint].
*/
object RollingNumberMeasureStaticLabelFingerprint : MethodFingerprint(
returnType = "F",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("Ljava/lang/String;"),
opcodes = listOf(
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.RETURN
)
)

View File

@@ -0,0 +1,12 @@
package app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
object RollingNumberMeasureTextParentFingerprint : MethodFingerprint(
returnType = "Ljava/lang/String;",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf(),
strings = listOf("RollingNumberFontProperties{paint=")
)

View File

@@ -17,7 +17,7 @@ object RollingNumberTextViewFingerprint : MethodFingerprint(
Opcode.INVOKE_VIRTUAL,
Opcode.RETURN_VOID
),
customFingerprint = custom@{ _, classDef ->
customFingerprint = { _, classDef ->
classDef.superclass == "Landroid/support/v7/widget/AppCompatTextView;"
}
)

View File

@@ -26,7 +26,7 @@ object SeekbarPreferencesPatch : ResourcePatch(), Closeable {
seekbarPreferences,
StringResource(
"revanced_seekbar_preference_screen_summary",
"Settings for the seekbar."
"Settings for the seekbar"
)
)
)

View File

@@ -11,8 +11,6 @@ import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.shared.fingerprints.LayoutConstructorFingerprint
import app.revanced.patches.shared.fingerprints.SeekbarOnDrawFingerprint
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
import app.revanced.patches.youtube.layout.sponsorblock.fingerprints.AppendTimeFingerprint
import app.revanced.patches.youtube.layout.sponsorblock.fingerprints.ControlsOverlayFingerprint
@@ -22,7 +20,9 @@ import app.revanced.patches.youtube.misc.autorepeat.fingerprints.AutoRepeatParen
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
import app.revanced.patches.youtube.misc.playercontrols.PlayerControlsBytecodePatch
import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
import app.revanced.patches.youtube.shared.fingerprints.LayoutConstructorFingerprint
import app.revanced.patches.youtube.shared.fingerprints.SeekbarFingerprint
import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint
import app.revanced.patches.youtube.video.information.VideoInformationPatch
import app.revanced.patches.youtube.video.videoid.VideoIdPatch
import com.android.tools.smali.dexlib2.Opcode

View File

@@ -7,10 +7,10 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.shared.fingerprints.WatchWhileActivityFingerprint
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.misc.settings.SettingsPatch
import app.revanced.patches.youtube.shared.fingerprints.WatchWhileActivityFingerprint
import com.android.tools.smali.dexlib2.Opcode
@Patch(

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.all.misc.packagename.ChangePackageNamePatch
import app.revanced.patches.shared.fingerprints.WatchWhileActivityFingerprint
import app.revanced.patches.youtube.shared.fingerprints.WatchWhileActivityFingerprint
import app.revanced.patches.youtube.layout.buttons.cast.HideCastButtonPatch
import app.revanced.patches.youtube.misc.fix.playback.ClientSpoofPatch
import app.revanced.patches.youtube.misc.microg.fingerprints.*

View File

@@ -6,7 +6,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.fingerprint.MethodFingerprintResult
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.shared.fingerprints.LayoutConstructorFingerprint
import app.revanced.patches.youtube.shared.fingerprints.LayoutConstructorFingerprint
import app.revanced.patches.youtube.misc.playercontrols.fingerprints.BottomControlsInflateFingerprint
import app.revanced.patches.youtube.misc.playercontrols.fingerprints.PlayerControlsVisibilityFingerprint
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction

View File

@@ -1,16 +1,23 @@
package app.revanced.patches.youtube.misc.privacy
import app.revanced.extensions.exception
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprintResult.MethodFingerprintScanResult.PatternScanResult
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
import app.revanced.patches.youtube.misc.privacy.fingerprints.CopyTextFingerprint
import app.revanced.patches.youtube.misc.privacy.fingerprints.SystemShareSheetFingerprint
import app.revanced.patches.youtube.misc.privacy.fingerprints.YouTubeShareSheetFingerprint
import app.revanced.patches.youtube.misc.settings.SettingsPatch
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
@Patch(
@@ -30,7 +37,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
)
@Suppress("unused")
object RemoveTrackingQueryParameterPatch : BytecodePatch(
setOf(CopyTextFingerprint)
setOf(CopyTextFingerprint, SystemShareSheetFingerprint, YouTubeShareSheetFingerprint)
) {
const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/RemoveTrackingQueryParameterPatch;"
@@ -53,21 +60,31 @@ object RemoveTrackingQueryParameterPatch : BytecodePatch(
)
)
CopyTextFingerprint.result?.let {
val insertIndex = it.scanResult.patternScanResult!!.startIndex + 2
fun MethodFingerprint.hook(
getInsertIndex: PatternScanResult.() -> Int,
getUrlRegister: MutableMethod.(insertIndex: Int) -> Int
) = result?.let {
val insertIndex = it.scanResult.patternScanResult!!.getInsertIndex()
val urlRegister = it.mutableMethod.getUrlRegister(insertIndex)
it.mutableMethod.apply {
val urlRegister = getInstruction<TwoRegisterInstruction>(insertIndex - 2).registerA
it.mutableMethod.addInstructions(
insertIndex,
"""
invoke-static {v$urlRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->sanitize(Ljava/lang/String;)Ljava/lang/String;
move-result-object v$urlRegister
"""
)
} ?: throw exception
addInstructions(
insertIndex,
"""
invoke-static {v$urlRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->sanitize(Ljava/lang/String;)Ljava/lang/String;
move-result-object v$urlRegister
"""
)
}
// Native YouTube share sheet.
YouTubeShareSheetFingerprint.hook(getInsertIndex = { startIndex + 1 })
{ insertIndex -> getInstruction<OneRegisterInstruction>(insertIndex - 1).registerA }
}
// Native system share sheet.
SystemShareSheetFingerprint.hook(getInsertIndex = { endIndex })
{ insertIndex -> getInstruction<OneRegisterInstruction>(insertIndex - 1).registerA }
CopyTextFingerprint.hook(getInsertIndex = { startIndex + 2 })
{ insertIndex -> getInstruction<TwoRegisterInstruction>(insertIndex - 2).registerA }
}
}

View File

@@ -0,0 +1,14 @@
package app.revanced.patches.youtube.misc.privacy.fingerprints
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.Opcode
object SystemShareSheetFingerprint : MethodFingerprint(
returnType = "V",
parameters = listOf("L", "Ljava/util/Map;"),
opcodes = listOf(
Opcode.CHECK_CAST,
Opcode.GOTO
),
strings = listOf("YTShare_Logging_Share_Intent_Endpoint_Byte_Array")
)

View File

@@ -0,0 +1,18 @@
package app.revanced.patches.youtube.misc.privacy.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
object YouTubeShareSheetFingerprint : MethodFingerprint(
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("L", "Ljava/util/Map;"),
opcodes = listOf(
Opcode.CHECK_CAST,
Opcode.GOTO,
Opcode.MOVE_OBJECT,
Opcode.INVOKE_VIRTUAL,
)
)

View File

@@ -1,4 +1,4 @@
package app.revanced.patches.shared.fingerprints
package app.revanced.patches.youtube.shared.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.MethodFingerprint

View File

@@ -0,0 +1,30 @@
package app.revanced.patches.youtube.shared.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
object RollingNumberTextViewAnimationUpdateFingerprint : MethodFingerprint(
returnType = "V",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("Landroid/graphics/Bitmap;"),
opcodes = listOf(
Opcode.NEW_INSTANCE, // bitmap ImageSpan
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.CONST_4,
Opcode.INVOKE_DIRECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.CONST_16,
Opcode.INVOKE_VIRTUAL,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.INT_TO_FLOAT,
Opcode.INVOKE_VIRTUAL, // set textview padding using bitmap width
),
customFingerprint = { _, classDef ->
classDef.superclass == "Landroid/support/v7/widget/AppCompatTextView;"
}
)

View File

@@ -1,5 +1,4 @@
package app.revanced.patches.shared.fingerprints
package app.revanced.patches.youtube.shared.fingerprints
import app.revanced.patcher.fingerprint.MethodFingerprint

View File

@@ -1,4 +1,4 @@
package app.revanced.patches.shared.fingerprints
package app.revanced.patches.youtube.shared.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.MethodFingerprint

View File

@@ -10,7 +10,7 @@ import app.revanced.patches.yuka.misc.unlockpremium.fingerprints.YukaUserConstru
@Patch(
name = "Unlock premium",
compatiblePackages = [CompatiblePackage("io.yuka.android")]
compatiblePackages = [CompatiblePackage("io.yuka.android", ["4.29"])]
)
@Suppress("unused")
object UnlockPremiumPatch : BytecodePatch(