From cc3ce9aaad4817a3c16c0fc14081547f332f1418 Mon Sep 17 00:00:00 2001 From: TheJeterLP Date: Thu, 14 Jul 2022 18:42:22 +0200 Subject: [PATCH] refactor: prepare for settings patch (#168) --- .../SwipeControlsBytecodePatch.kt} | 7 ++++--- .../SwipeControlsResourcePatch.kt} | 4 ++-- .../customplaybackspeed/patch/CustomPlaybackSpeedPatch.kt | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) rename src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/patch/{SwipeControlsPatch.kt => bytecode/SwipeControlsBytecodePatch.kt} (89%) rename src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/patch/{SwipeControlsResourcesPatch.kt => resource/SwipeControlsResourcePatch.kt} (94%) diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/patch/SwipeControlsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/patch/bytecode/SwipeControlsBytecodePatch.kt similarity index 89% rename from src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/patch/SwipeControlsPatch.kt rename to src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/patch/bytecode/SwipeControlsBytecodePatch.kt index dc517881..66516f3b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/patch/SwipeControlsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/patch/bytecode/SwipeControlsBytecodePatch.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.interaction.swipecontrols.patch +package app.revanced.patches.youtube.interaction.swipecontrols.patch.bytecode import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name @@ -12,6 +12,7 @@ import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.impl.BytecodePatch import app.revanced.patches.youtube.interaction.swipecontrols.annotation.SwipeControlsCompatibility import app.revanced.patches.youtube.interaction.swipecontrols.fingerprints.WatchWhileOnStartFingerprint +import app.revanced.patches.youtube.interaction.swipecontrols.patch.resource.SwipeControlsResourcePatch import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch import app.revanced.patches.youtube.misc.playeroverlay.patch.PlayerOverlaysHookPatch import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch @@ -26,10 +27,10 @@ import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch IntegrationsPatch::class, PlayerTypeHookPatch::class, PlayerOverlaysHookPatch::class, - SwipeControlsResourcesPatch::class + SwipeControlsResourcePatch::class ] ) -class SwipeControlsPatch : BytecodePatch( +class SwipeControlsBytecodePatch : BytecodePatch( listOf( WatchWhileOnStartFingerprint ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/patch/SwipeControlsResourcesPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/patch/resource/SwipeControlsResourcePatch.kt similarity index 94% rename from src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/patch/SwipeControlsResourcesPatch.kt rename to src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/patch/resource/SwipeControlsResourcePatch.kt index 318640f2..f719010c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/patch/SwipeControlsResourcesPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/patch/resource/SwipeControlsResourcePatch.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.interaction.swipecontrols.patch +package app.revanced.patches.youtube.interaction.swipecontrols.patch.resource import app.revanced.extensions.injectResources import app.revanced.patcher.annotation.Name @@ -12,7 +12,7 @@ import app.revanced.patches.youtube.interaction.swipecontrols.annotation.SwipeCo @Name("swipe-controls-resource-patch") @SwipeControlsCompatibility @Version("0.0.1") -class SwipeControlsResourcesPatch : ResourcePatch() { +class SwipeControlsResourcePatch : ResourcePatch() { override fun execute(data: ResourceData): PatchResult { val resourcesDir = "swipecontrols" diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/customplaybackspeed/patch/CustomPlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/customplaybackspeed/patch/CustomPlaybackSpeedPatch.kt index c09bf223..71b9302f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/customplaybackspeed/patch/CustomPlaybackSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/customplaybackspeed/patch/CustomPlaybackSpeedPatch.kt @@ -56,7 +56,7 @@ class CustomPlaybackSpeedPatch : BytecodePatch( val arrayLengthConstDestination = (arrayLengthConst as OneRegisterInstruction).registerA - val videoSpeedsArrayType = "Lapp/revanced/integrations/videoplayer/videosettings/VideoSpeed;->videoSpeeds:[F" + val videoSpeedsArrayType = "Lapp/revanced/integrations/patches/VideoSpeedPatch;->videoSpeeds:[F" arrayGenMethod.addInstructions( arrayLengthConstIndex + 1,