Compare commits

...

8 Commits

Author SHA1 Message Date
semantic-release-bot
8ffa3b4746 chore(release): 2.85.1 [skip ci]
## [2.85.1](https://github.com/revanced/revanced-patches/compare/v2.85.0...v2.85.1) (2022-10-21)

### Bug Fixes

* **youtube/theme:** extend dark mode theming ([#827](https://github.com/revanced/revanced-patches/issues/827)) ([1e26d6a](1e6d0f7f62))
2022-10-21 13:16:26 +00:00
OxrxL
1e6d0f7f62 fix(youtube/theme): extend dark mode theming (#827) 2022-10-21 15:14:24 +02:00
semantic-release-bot
e73c5dfebd chore(release): 2.85.0 [skip ci]
# [2.85.0](https://github.com/revanced/revanced-patches/compare/v2.84.1...v2.85.0) (2022-10-20)

### Features

* **youtube:** `hide-captions-button` patch ([#770](https://github.com/revanced/revanced-patches/issues/770)) ([a13fdbd](32309ac007))
2022-10-20 20:07:51 +00:00
OxrxL
32309ac007 feat(youtube): hide-captions-button patch (#770)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-10-20 22:05:34 +02:00
semantic-release-bot
079800aa1a chore(release): 2.84.1 [skip ci]
## [2.84.1](https://github.com/revanced/revanced-patches/compare/v2.84.0...v2.84.1) (2022-10-20)

### Bug Fixes

* **youtube/hide-mix-playlists:** correct switch title, summary and defaults ([#821](https://github.com/revanced/revanced-patches/issues/821)) ([c37b8cd](06f0d05d19))
2022-10-20 18:31:56 +00:00
johnconner122
06f0d05d19 fix(youtube/hide-mix-playlists): correct switch title, summary and defaults (#821) 2022-10-20 20:29:41 +02:00
semantic-release-bot
c618a18851 chore(release): 2.84.0 [skip ci]
# [2.84.0](https://github.com/revanced/revanced-patches/compare/v2.83.3...v2.84.0) (2022-10-20)

### Features

* **youtube:** `hide-mix-playlists` patch  ([#816](https://github.com/revanced/revanced-patches/issues/816)) ([a5b5e78](1aac521af3))
2022-10-20 17:09:55 +00:00
johnconner122
1aac521af3 feat(youtube): hide-mix-playlists patch (#816) 2022-10-20 19:07:44 +02:00
10 changed files with 190 additions and 4 deletions

View File

@@ -1,3 +1,31 @@
## [2.85.1](https://github.com/revanced/revanced-patches/compare/v2.85.0...v2.85.1) (2022-10-21)
### Bug Fixes
* **youtube/theme:** extend dark mode theming ([#827](https://github.com/revanced/revanced-patches/issues/827)) ([6d803c5](https://github.com/revanced/revanced-patches/commit/6d803c5386e1f6f6fb6a7fa0a9f0bb81ee1022ac))
# [2.85.0](https://github.com/revanced/revanced-patches/compare/v2.84.1...v2.85.0) (2022-10-20)
### Features
* **youtube:** `hide-captions-button` patch ([#770](https://github.com/revanced/revanced-patches/issues/770)) ([478af6a](https://github.com/revanced/revanced-patches/commit/478af6ad54ffdf6f99abab35a84a4f50b59d28c8))
## [2.84.1](https://github.com/revanced/revanced-patches/compare/v2.84.0...v2.84.1) (2022-10-20)
### Bug Fixes
* **youtube/hide-mix-playlists:** correct switch title, summary and defaults ([#821](https://github.com/revanced/revanced-patches/issues/821)) ([f9eea33](https://github.com/revanced/revanced-patches/commit/f9eea332cea0b8c3d5c3dfff645b60861e925b5a))
# [2.84.0](https://github.com/revanced/revanced-patches/compare/v2.83.3...v2.84.0) (2022-10-20)
### Features
* **youtube:** `hide-mix-playlists` patch ([#816](https://github.com/revanced/revanced-patches/issues/816)) ([e76c73b](https://github.com/revanced/revanced-patches/commit/e76c73b455c65aa605e418f19d88b64e0e244901))
## [2.83.3](https://github.com/revanced/revanced-patches/compare/v2.83.2...v2.83.3) (2022-10-20)

View File

@@ -68,6 +68,7 @@ The official Patch bundle provided by ReVanced and the community.
| `hide-time-and-seekbar` | Hides progress bar and time counter on videos. | 17.36.37 |
| `hide-video-buttons` | Adds options to hide action buttons under a video. | 17.36.37 |
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 17.36.37 |
| `hide-captions-button` | Hides the captions button on video player. | 17.36.37 |
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 17.36.37 |
| `hide-create-button` | Hides the create button in the navigation bar. | 17.36.37 |
| `disable-startup-shorts-player` | Disables playing YouTube Shorts when launching YouTube. | 17.36.37 |
@@ -82,6 +83,7 @@ The official Patch bundle provided by ReVanced and the community.
| `hide-email-address` | Hides the email address in the account switcher. | 17.36.37 |
| `tablet-mini-player` | Enables the tablet mini player layout. | 17.36.37 |
| `hide-watermark` | Hides creator's watermarks on videos. | 17.36.37 |
| `hide-my-mix` | Removes mix playlists from the feed. | 17.40.41 |
| `custom-branding` | Changes the YouTube launcher icon and name to your choice (defaults to ReVanced). | all |
| `premium-heading` | Shows premium branding on the home screen. | all |
| `old-quality-layout` | Enables the original quality flyout menu. | 17.36.37 |

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official
version = 2.83.3
version = 2.85.1

File diff suppressed because one or more lines are too long

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34", "17.32.35", "17.33.42", "17.34.35", "17.34.36", "17.36.37")
"com.google.android.youtube", arrayOf("17.33.42", "17.34.35", "17.34.36", "17.36.37")
)]
)
@Target(AnnotationTarget.CLASS)

View File

@@ -0,0 +1,56 @@
package app.revanced.patches.youtube.layout.hidecaptionsbutton.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.addInstructions
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.youtube.layout.autocaptions.annotations.AutoCaptionsCompatibility
import app.revanced.patches.youtube.layout.autocaptions.fingerprints.SubtitleButtonControllerFingerprint
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.framework.components.impl.StringResource
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
import org.jf.dexlib2.Opcode
@Patch
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
@Name("hide-captions-button")
@Description("Hides the captions button on video player.")
@AutoCaptionsCompatibility
@Version("0.0.1")
class HideCaptionsButtonPatch : BytecodePatch(listOf(
SubtitleButtonControllerFingerprint,
)) {
override fun execute(context: BytecodeContext): PatchResult {
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
SwitchPreference(
"revanced_hide_captions_button",
StringResource("revanced_hide_captions_button_title", "Hide captions button"),
false,
StringResource("revanced_hide_captions_button_summary_on", "Captions button is hidden"),
StringResource("revanced_hide_captions_button_summary_off", "Captions button is shown")
)
)
val subtitleButtonControllerMethod = SubtitleButtonControllerFingerprint.result!!.mutableMethod
// Due to previously applied patches, scanResult index cannot be used in this context
val igetBooleanIndex = subtitleButtonControllerMethod.implementation!!.instructions.indexOfFirst {
it.opcode == Opcode.IGET_BOOLEAN
}
subtitleButtonControllerMethod.addInstructions(
igetBooleanIndex + 1, """
invoke-static {v0}, Lapp/revanced/integrations/patches/HideCaptionsButtonPatch;->hideCaptionsButton(Landroid/widget/ImageView;)V
"""
)
return PatchResultSuccess()
}
}

View File

@@ -0,0 +1,13 @@
package app.revanced.patches.youtube.layout.hidemixplaylists.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.google.android.youtube", arrayOf("17.32.39", "17.34.36", "17.36.37", "17.36.39", "17.37.35", "17.38.36", "17.39.35", "17.40.41")
)]
)
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class MixPlaylistsPatchCompatibility

View File

@@ -0,0 +1,31 @@
package app.revanced.patches.youtube.layout.hidemixplaylists.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.impl.MethodFingerprint
import app.revanced.patches.youtube.layout.hidemixplaylists.annotations.MixPlaylistsPatchCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@Name("mix-playlists-fingerprint")
@MixPlaylistsPatchCompatibility
@Version("0.0.1")
object MixPlaylistsPatchFingerprint : MethodFingerprint(
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L", "L", "L", "L", "L"), listOf(
Opcode.INVOKE_DIRECT,
Opcode.IPUT_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.IPUT_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.IPUT_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.IPUT_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.RETURN_VOID
)
)

View File

@@ -0,0 +1,55 @@
package app.revanced.patches.youtube.layout.hidemixplaylists.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.addInstruction
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.patcher.patch.BytecodePatch
import app.revanced.patches.youtube.layout.hidemixplaylists.annotations.MixPlaylistsPatchCompatibility
import app.revanced.patches.youtube.layout.hidemixplaylists.fingerprints.MixPlaylistsPatchFingerprint
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.framework.components.impl.StringResource
import app.revanced.patches.youtube.misc.settings.framework.components.impl.SwitchPreference
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Patch
@DependsOn([IntegrationsPatch::class])
@Name("hide-my-mix")
@Description("Removes mix playlists from the feed.")
@MixPlaylistsPatchCompatibility
@Version("0.0.1")
class MixPlaylistsPatch : BytecodePatch(
listOf(
MixPlaylistsPatchFingerprint
)
) {
override fun execute(context: BytecodeContext): PatchResult {
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
SwitchPreference(
"revanced_mix_playlists_hidden",
StringResource("revanced_mix_playlists_title", "Hide mix playlists"),
false,
StringResource("revanced_mix_playlists_summary_on", "Mix playlists are hidden"),
StringResource("revanced_mix_playlists_summary_off", "Mix playlists are shown")
)
)
val result = MixPlaylistsPatchFingerprint.result!!
val method = result.mutableMethod
val index = result.scanResult.patternScanResult!!.endIndex - 6
val register = (method.implementation!!.instructions[index] as OneRegisterInstruction).registerA
method.addInstruction(
index + 2,
"invoke-static {v$register}, Lapp/revanced/integrations/patches/HideMixPlaylistsPatch;->hideMixPlaylists(Landroid/view/View;)V"
)
return PatchResultSuccess()
}
}

View File

@@ -30,7 +30,8 @@ class ThemePatch : ResourcePatch {
node.textContent = when (node.getAttribute("name")) {
"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", "material_grey_100", "material_grey_50", "material_grey_600",
"material_grey_800", "material_grey_850", "material_grey_900", "material_grey_white_1000" -> darkThemeBackgroundColor
"yt_white1", "yt_white1_opacity95", "yt_white1_opacity98", "yt_white2", "yt_white3",
"yt_white4" -> lightThemeBackgroundColor