Compare commits

...

6 Commits

Author SHA1 Message Date
semantic-release-bot
90000fcaeb chore(release): 2.175.0-dev.3 [skip ci]
# [2.175.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.175.0-dev.2...v2.175.0-dev.3) (2023-05-25)

### Bug Fixes

* **youtube/hide-player-buttons:** fix previous/next button showing if previous video exists ([#2261](https://github.com/revanced/revanced-patches/issues/2261)) ([0301bfb](0301bfb176))
2023-05-25 17:36:21 +00:00
LisoUseInAIKyrios
0301bfb176 fix(youtube/hide-player-buttons): fix previous/next button showing if previous video exists (#2261) 2023-05-25 21:34:38 +04:00
semantic-release-bot
ba07fa967d chore(release): 2.175.0-dev.2 [skip ci]
# [2.175.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.175.0-dev.1...v2.175.0-dev.2) (2023-05-25)

### Bug Fixes

* **youtube/hide-info-cards:** fix hide-info-cards setting does not work ([#2246](https://github.com/revanced/revanced-patches/issues/2246)) ([e47be6f](e47be6f319))
2023-05-25 06:11:58 +00:00
LisoUseInAIKyrios
e47be6f319 fix(youtube/hide-info-cards): fix hide-info-cards setting does not work (#2246) 2023-05-25 10:10:16 +04:00
semantic-release-bot
1ae40a24a1 chore(release): 2.175.0-dev.1 [skip ci]
# [2.175.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.174.1-dev.1...v2.175.0-dev.1) (2023-05-24)

### Features

* **youtube/general-ads:** merge `hide-get-premium` patch into `general-ads` patch ([8252488](82524885bb))
2023-05-24 19:38:58 +00:00
oSumAtrIX
82524885bb feat(youtube/general-ads): merge hide-get-premium patch into general-ads patch 2023-05-24 21:37:00 +02:00
10 changed files with 61 additions and 28 deletions

View File

@@ -1,3 +1,24 @@
# [2.175.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.175.0-dev.2...v2.175.0-dev.3) (2023-05-25)
### Bug Fixes
* **youtube/hide-player-buttons:** fix previous/next button showing if previous video exists ([#2261](https://github.com/revanced/revanced-patches/issues/2261)) ([91d1aab](https://github.com/revanced/revanced-patches/commit/91d1aabd32be1607019bc443fb06284ca3343e9d))
# [2.175.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.175.0-dev.1...v2.175.0-dev.2) (2023-05-25)
### Bug Fixes
* **youtube/hide-info-cards:** fix hide-info-cards setting does not work ([#2246](https://github.com/revanced/revanced-patches/issues/2246)) ([72773ac](https://github.com/revanced/revanced-patches/commit/72773ac56987753fac6c0087d048b4378a3dd360))
# [2.175.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.174.1-dev.1...v2.175.0-dev.1) (2023-05-24)
### Features
* **youtube/general-ads:** merge `hide-get-premium` patch into `general-ads` patch ([5195dd8](https://github.com/revanced/revanced-patches/commit/5195dd8936d63c482dbcb2cd0e7e9aab3c75954e))
## [2.174.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.174.0...v2.174.1-dev.1) (2023-05-24)

View File

@@ -35,7 +35,6 @@ The official ReVanced Patches.
| `hide-endscreen-cards` | Hides the suggested video cards at the end of a video in fullscreen. | 18.19.35 |
| `hide-filter-bar` | Hides the filter bar in video feeds. | 18.19.35 |
| `hide-floating-microphone-button` | Hides the floating microphone button which appears in search. | 18.19.35 |
| `hide-get-premium` | Hides advertisement for YouTube Premium under the video player. | 18.19.35 |
| `hide-info-cards` | Hides info cards in videos. | 18.19.35 |
| `hide-load-more-button` | Hides the button under videos that loads similar videos. | 18.19.35 |
| `hide-player-buttons` | Adds the option to hide video player previous and next buttons. | 18.19.35 |

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official
version = 2.174.1-dev.1
version = 2.175.0-dev.3

File diff suppressed because one or more lines are too long

View File

@@ -14,13 +14,21 @@ import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.misc.fix.verticalscroll.patch.VerticalScrollPatch
import app.revanced.patches.youtube.ad.general.annotation.HideAdsCompatibility
import app.revanced.patches.youtube.ad.general.resource.patch.HideAdsResourcePatch
import app.revanced.patches.youtube.ad.getpremium.bytecode.patch.HideGetPremiumPatch
import app.revanced.patches.youtube.misc.fix.backtoexitgesture.patch.FixBackToExitGesturePatch
import org.jf.dexlib2.iface.instruction.formats.Instruction31i
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
@Patch
@DependsOn([HideAdsResourcePatch::class, VerticalScrollPatch::class, FixBackToExitGesturePatch::class])
@DependsOn(
[
HideGetPremiumPatch::class,
HideAdsResourcePatch::class,
VerticalScrollPatch::class,
FixBackToExitGesturePatch::class
]
)
@Name("hide-ads")
@Description("Removes general ads.")
@HideAdsCompatibility

View File

@@ -1,4 +1,4 @@
package app.revanced.patches.youtube.layout.hide.getpremium.annotations
package app.revanced.patches.youtube.ad.getpremium.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package

View File

@@ -1,4 +1,4 @@
package app.revanced.patches.youtube.layout.hide.getpremium.bytecode.fingerprints
package app.revanced.patches.youtube.ad.getpremium.bytecode.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.Opcode

View File

@@ -1,7 +1,6 @@
package app.revanced.patches.youtube.layout.hide.getpremium.bytecode.patch
package app.revanced.patches.youtube.ad.getpremium.bytecode.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
@@ -11,33 +10,35 @@ import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.layout.hide.getpremium.annotations.HideGetPremiumCompatibility
import app.revanced.patches.youtube.layout.hide.getpremium.bytecode.fingerprints.GetPremiumViewFingerprint
import app.revanced.patches.youtube.ad.getpremium.annotations.HideGetPremiumCompatibility
import app.revanced.patches.youtube.ad.getpremium.bytecode.fingerprints.GetPremiumViewFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
@Patch
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
@Name("hide-get-premium")
@Description("Hides advertisement for YouTube Premium under the video player.")
@HideGetPremiumCompatibility
@Version("0.0.1")
class HideGetPremiumPatch : BytecodePatch(
listOf(
GetPremiumViewFingerprint,
)
) {
class HideGetPremiumPatch : BytecodePatch(listOf(GetPremiumViewFingerprint,)) {
override fun execute(context: BytecodeContext): PatchResult {
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
SettingsPatch.PreferenceScreen.ADS.addPreferences(
SwitchPreference(
"revanced_hide_get_premium",
StringResource("revanced_hide_get_premium_title", "Hide YouTube Premium advertisement"),
StringResource("revanced_hide_get_premium_summary_on", "YouTube Premium advertisement are hidden"),
StringResource("revanced_hide_get_premium_summary_off", "YouTube Premium advertisement are shown")
StringResource(
"revanced_hide_get_premium_title",
"Hide YouTube Premium advertisement under video player"
),
StringResource(
"revanced_hide_get_premium_summary_on",
"YouTube Premium advertisement are hidden"
),
StringResource(
"revanced_hide_get_premium_summary_off",
"YouTube Premium advertisement are shown"
)
)
)

View File

@@ -31,6 +31,7 @@ class HidePlayerButtonsPatch : BytecodePatch(
) {
private object ParameterOffsets {
const val HAS_NEXT = 5
const val HAS_PREVIOUS = 6
}
override fun execute(context: BytecodeContext): PatchResult {
@@ -58,13 +59,16 @@ class HidePlayerButtonsPatch : BytecodePatch(
// overriding this parameter register hides the previous and next buttons
val hasNextParameterRegister = callInstruction.startRegister + ParameterOffsets.HAS_NEXT
val hasPreviousParameterRegister = callInstruction.startRegister + ParameterOffsets.HAS_PREVIOUS
mutableMethod.addInstructions(
callIndex,
"""
invoke-static { }, Lapp/revanced/integrations/patches/HidePlayerButtonsPatch;->hideButtons()Z
invoke-static { v$hasNextParameterRegister }, Lapp/revanced/integrations/patches/HidePlayerButtonsPatch;->previousOrNextButtonIsVisible(Z)Z
move-result v$hasNextParameterRegister
xor-int/lit8 v$hasNextParameterRegister, v$hasNextParameterRegister, 1
invoke-static { v$hasPreviousParameterRegister }, Lapp/revanced/integrations/patches/HidePlayerButtonsPatch;->previousOrNextButtonIsVisible(Z)Z
move-result v$hasPreviousParameterRegister
"""
)
} ?: return PlayerControlsVisibilityModelFingerprint.toErrorResult()

View File

@@ -23,10 +23,10 @@ class HideInfocardsResourcePatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult {
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
SwitchPreference(
"revanced_hide_infocards",
StringResource("revanced_hide_infocards_title", "Hide info cards"),
StringResource("revanced_hide_infocards_summary_on", "Info cards are hidden"),
StringResource("revanced_hide_infocards_summary_off", "Info cards are shown")
"revanced_hide_info_cards",
StringResource("revanced_hide_info_cards_title", "Hide info cards"),
StringResource("revanced_hide_info_cards_summary_on", "Info cards are hidden"),
StringResource("revanced_hide_info_cards_summary_off", "Info cards are shown")
)
)