refactor: simplify use of dependencies field in Dependencies annotations

This commit is contained in:
oSumAtrIX 2022-07-16 17:32:03 +02:00
parent e01915cdee
commit 69490d7e83
No known key found for this signature in database
GPG key ID: A9B3094ACDB604B4
21 changed files with 23 additions and 33 deletions

View file

@ -38,9 +38,7 @@ import org.jf.dexlib2.iface.reference.StringReference
import org.jf.dexlib2.immutable.reference.ImmutableMethodReference
@Patch
@Dependencies(
dependencies = [ResourceIdMappingProviderResourcePatch::class, IntegrationsPatch::class]
)
@Dependencies([ResourceIdMappingProviderResourcePatch::class, IntegrationsPatch::class])
@Name("general-ads")
@Description("Removes general ads in bytecode.")
@GeneralAdsCompatibility

View file

@ -21,7 +21,7 @@ import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
@Patch
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
@Name("hide-infocard-suggestions")
@Description("Hides infocards in videos.")
@HideInfocardSuggestionsCompatibility

View file

@ -17,7 +17,7 @@ import app.revanced.patches.youtube.ad.video.fingerprints.ShowVideoAdsFingerprin
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
@Patch
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
@Name("video-ads")
@Description("Removes ads in the YouTube video player.")
@VideoAdsCompatibility

View file

@ -22,7 +22,7 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction11n
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
@Patch
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
@Name("seekbar-tapping")
@Description("Enables tapping on the seekbar of the YouTube player.")
@SeekbarTappingCompatibility

View file

@ -23,7 +23,7 @@ import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
@SwipeControlsCompatibility
@Version("0.0.2")
@Dependencies(
dependencies = [
[
IntegrationsPatch::class,
PlayerTypeHookPatch::class,
PlayerOverlaysHookPatch::class,

View file

@ -15,11 +15,7 @@ import org.w3c.dom.Element
import java.io.File
@Patch
@Dependencies(
dependencies = [
FixLocaleConfigErrorPatch::class
]
)
@Dependencies([FixLocaleConfigErrorPatch::class])
@Name("amoled")
@Description("Enables pure black theme.")
@AmoledCompatibility

View file

@ -18,7 +18,7 @@ import app.revanced.patches.youtube.misc.mapping.patch.ResourceIdMappingProvider
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
@Patch
@Dependencies(dependencies = [ResourceIdMappingProviderResourcePatch::class])
@Dependencies([ResourceIdMappingProviderResourcePatch::class])
@Name("hide-autoplay-button")
@Description("Disables the autoplay button.")
@AutoplayButtonCompatibility

View file

@ -17,9 +17,7 @@ import java.nio.file.StandardCopyOption
import kotlin.io.path.exists
@Patch
@Dependencies(
dependencies = [FixLocaleConfigErrorPatch::class]
)
@Dependencies([FixLocaleConfigErrorPatch::class])
@Name("premium-heading")
@Description("Shows premium branding on the YouTube home screen.")
@PremiumHeadingCompatibility
@ -34,7 +32,7 @@ class PremiumHeadingPatch : ResourcePatch() {
arrayOf("xxxhdpi", "xxhdpi", "xhdpi", "hdpi", "mdpi").forEach { size ->
val headingDirectory = resDirectory.resolve("drawable-$size")
modes.forEach {mode ->
modes.forEach { mode ->
val fromPath = headingDirectory.resolve("${original}_$mode.png").toPath()
val toPath = headingDirectory.resolve("${replacement}_$mode.png").toPath()

View file

@ -15,9 +15,7 @@ import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatc
import java.nio.file.Files
@Patch
@Dependencies(
dependencies = [FixLocaleConfigErrorPatch::class]
)
@Dependencies([FixLocaleConfigErrorPatch::class])
@Name("custom-branding")
@Description("Changes the branding of YouTube.")
@CustomBrandingCompatibility

View file

@ -14,7 +14,7 @@ import app.revanced.patches.youtube.layout.castbutton.annotations.CastButtonComp
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
@Patch
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
@Name("hide-cast-button")
@Description("Hides the cast button.")
@CastButtonCompatibility

View file

@ -22,7 +22,7 @@ import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
import org.jf.dexlib2.iface.reference.MethodReference
@Patch
@Dependencies(dependencies = [IntegrationsPatch::class, ResourceIdMappingProviderResourcePatch::class])
@Dependencies([IntegrationsPatch::class, ResourceIdMappingProviderResourcePatch::class])
@Name("disable-create-button")
@Description("Disables the create button.")
@CreateButtonCompatibility

View file

@ -20,7 +20,7 @@ import org.jf.dexlib2.Opcode
import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
@Patch
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
@Name("old-quality-layout")
@Description("Enables the original quality flyout menu.")
@OldQualityLayoutCompatibility

View file

@ -17,7 +17,7 @@ import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Patch
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
@Name("hide-shorts-button")
@Description("Hides the shorts button.")
@ShortsButtonCompatibility

View file

@ -19,7 +19,7 @@ import app.revanced.patches.youtube.layout.watermark.fingerprints.HideWatermarkF
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
@Patch
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
@Name("hide-watermark")
@Description("Hides the creator's watermark on videos.")
@HideWatermarkCompatibility

View file

@ -21,7 +21,7 @@ import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.WideSearch
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
@Patch(include = false)
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
@Name("enable-wide-searchbar")
@Description("Replaces the search icon with a wide search bar. This will hide the YouTube logo when active.")
@WideSearchbarCompatibility

View file

@ -19,7 +19,7 @@ import app.revanced.patches.youtube.misc.autorepeat.fingerprints.AutoRepeatParen
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
@Patch(include = false)
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
@Name("autorepeat-by-default")
@Description("Enables auto repeating of videos by default.")
@AutoRepeatCompatibility
@ -61,7 +61,7 @@ class AutoRepeatPatch : BytecodePatch(
//Since addInstructions needs an index which starts counting at 0 and size starts counting at 1,
//we have to remove 1 to get the latest instruction
val index = implementation.instructions.size-1
val index = implementation.instructions.size - 1
//remove last instruction which is return-void

View file

@ -25,7 +25,7 @@ import org.jf.dexlib2.iface.reference.MethodReference
@Patch
@Name("custom-playback-speed")
@Description("Allows to change the default playback speed options.")
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
@CustomPlaybackSpeedCompatibility
@Version("0.0.1")
class CustomPlaybackSpeedPatch : BytecodePatch(

View file

@ -30,7 +30,7 @@ import org.jf.dexlib2.immutable.reference.ImmutableStringReference
@Patch
@Dependencies(
dependencies = [
[
MicroGResourcePatch::class,
HideCastButtonPatch::class,
FixLocaleConfigErrorPatch::class

View file

@ -17,7 +17,7 @@ import app.revanced.patches.youtube.misc.playeroverlay.fingerprint.PlayerOverlay
@Description("hook for adding custom overlays to the video player.")
@PlayerOverlaysHookCompatibility
@Version("0.0.1")
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
class PlayerOverlaysHookPatch : BytecodePatch(
listOf(
PlayerOverlaysOnFinishInflateFingerprint

View file

@ -17,7 +17,7 @@ import app.revanced.patches.youtube.misc.playertype.fingerprint.UpdatePlayerType
@Description("hook to get the current player type of WatchWhileActivity")
@PlayerTypeHookCompatibility
@Version("0.0.1")
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
class PlayerTypeHookPatch : BytecodePatch(
listOf(
UpdatePlayerTypeFingerprint

View file

@ -18,7 +18,7 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction11x
@Description("hook to detect when the video id changes")
@VideoIdCompatibility
@Version("0.0.1")
@Dependencies(dependencies = [IntegrationsPatch::class])
@Dependencies([IntegrationsPatch::class])
class VideoIdPatch : BytecodePatch(
listOf(
VideoIdFingerprint