From edcb6cc94961aaebe2df884db3049b2afa79f38f Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 15 Jan 2023 05:01:22 +0100 Subject: [PATCH] feat(youtube): remove `fix-playback` patch --- .../youtube/ad/video/patch/VideoAdsPatch.kt | 3 +- .../annotations/FixPlaybackCompatibility.kt | 13 ----- .../fix/playback/patch/FixPlaybackPatch.kt | 52 ------------------- 3 files changed, 1 insertion(+), 67 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/annotations/FixPlaybackCompatibility.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/patch/FixPlaybackPatch.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/video/patch/VideoAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/video/patch/VideoAdsPatch.kt index 5e16901c1..10e14d39d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/video/patch/VideoAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/video/patch/VideoAdsPatch.kt @@ -16,12 +16,11 @@ import app.revanced.patches.shared.settings.preference.impl.StringResource import app.revanced.patches.shared.settings.preference.impl.SwitchPreference import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility import app.revanced.patches.youtube.ad.video.fingerprints.LoadVideoAdsFingerprint -import app.revanced.patches.youtube.misc.fix.playback.patch.FixPlaybackPatch import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch @Patch -@DependsOn([IntegrationsPatch::class, SettingsPatch::class, FixPlaybackPatch::class]) +@DependsOn([IntegrationsPatch::class, SettingsPatch::class]) @Name("video-ads") @Description("Removes ads in the video player.") @VideoAdsCompatibility diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/annotations/FixPlaybackCompatibility.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/annotations/FixPlaybackCompatibility.kt deleted file mode 100644 index 8a2bb4613..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/annotations/FixPlaybackCompatibility.kt +++ /dev/null @@ -1,13 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.annotations - -import app.revanced.patcher.annotation.Compatibility -import app.revanced.patcher.annotation.Package - -@Compatibility( - [Package( - "com.google.android.youtube", arrayOf("17.49.37") - )] -) -@Target(AnnotationTarget.CLASS) -@Retention(AnnotationRetention.RUNTIME) -internal annotation class FixPlaybackCompatibility diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/patch/FixPlaybackPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/patch/FixPlaybackPatch.kt deleted file mode 100644 index 148395672..000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/patch/FixPlaybackPatch.kt +++ /dev/null @@ -1,52 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.patch - -import app.revanced.patcher.annotation.Description -import app.revanced.patcher.annotation.Name -import app.revanced.patcher.annotation.Version -import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.PatchResult -import app.revanced.patcher.patch.PatchResultSuccess -import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotations.DependsOn -import app.revanced.patches.shared.settings.preference.impl.StringResource -import app.revanced.patches.shared.settings.preference.impl.SwitchPreference -import app.revanced.patches.youtube.misc.fix.playback.annotations.FixPlaybackCompatibility -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.video.information.patch.VideoInformationPatch -import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch - -@DependsOn([ - IntegrationsPatch::class, - VideoInformationPatch::class, // updates video length and adds method to seek in video, necessary for this patch - SettingsPatch::class, - VideoIdPatch::class -]) -@Name("fix-playback") -@Description("Fixes the issue with videos not playing when video ads are removed.") -@FixPlaybackCompatibility -@Version("0.0.1") -class FixPlaybackPatch : ResourcePatch { - override fun execute(context: ResourceContext): PatchResult { - SettingsPatch.PreferenceScreen.MISC.addPreferences( - SwitchPreference( - "revanced_fix_playback", - StringResource("revanced_fix_playback_title", "Fix video playback issues"), - false, - StringResource( - "revanced_fix_playback_summary_on", - "The fix is enabled" - ), - StringResource( - "revanced_fix_playback_summary_off", - "The fix is disabled" - ) - ) - ) - - // If a new video loads, fix the playback issue - VideoIdPatch.injectCall("Lapp/revanced/integrations/patches/FixPlaybackPatch;->newVideoLoaded(Ljava/lang/String;)V") - - return PatchResultSuccess() - } -}