refactor: prepare for settings patch (#168)

This commit is contained in:
TheJeterLP 2022-07-14 18:42:22 +02:00 committed by GitHub
parent 93b66c7163
commit cc3ce9aaad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View File

@ -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.Description
import app.revanced.patcher.annotation.Name 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.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.interaction.swipecontrols.annotation.SwipeControlsCompatibility 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.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.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.playeroverlay.patch.PlayerOverlaysHookPatch import app.revanced.patches.youtube.misc.playeroverlay.patch.PlayerOverlaysHookPatch
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
@ -26,10 +27,10 @@ import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
IntegrationsPatch::class, IntegrationsPatch::class,
PlayerTypeHookPatch::class, PlayerTypeHookPatch::class,
PlayerOverlaysHookPatch::class, PlayerOverlaysHookPatch::class,
SwipeControlsResourcesPatch::class SwipeControlsResourcePatch::class
] ]
) )
class SwipeControlsPatch : BytecodePatch( class SwipeControlsBytecodePatch : BytecodePatch(
listOf( listOf(
WatchWhileOnStartFingerprint WatchWhileOnStartFingerprint
) )

View File

@ -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.extensions.injectResources
import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Name
@ -12,7 +12,7 @@ import app.revanced.patches.youtube.interaction.swipecontrols.annotation.SwipeCo
@Name("swipe-controls-resource-patch") @Name("swipe-controls-resource-patch")
@SwipeControlsCompatibility @SwipeControlsCompatibility
@Version("0.0.1") @Version("0.0.1")
class SwipeControlsResourcesPatch : ResourcePatch() { class SwipeControlsResourcePatch : ResourcePatch() {
override fun execute(data: ResourceData): PatchResult { override fun execute(data: ResourceData): PatchResult {
val resourcesDir = "swipecontrols" val resourcesDir = "swipecontrols"

View File

@ -56,7 +56,7 @@ class CustomPlaybackSpeedPatch : BytecodePatch(
val arrayLengthConstDestination = (arrayLengthConst as OneRegisterInstruction).registerA 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( arrayGenMethod.addInstructions(
arrayLengthConstIndex + 1, arrayLengthConstIndex + 1,