2023-09-20 05:33:02 +02:00
|
|
|
package app.revanced.patches.youtube.interaction.copyvideourl
|
2022-12-31 18:48:40 +01:00
|
|
|
|
|
|
|
import app.revanced.patcher.data.ResourceContext
|
|
|
|
import app.revanced.patcher.patch.ResourcePatch
|
2023-09-20 05:33:02 +02:00
|
|
|
import app.revanced.patcher.patch.annotation.Patch
|
2024-01-27 02:34:01 +01:00
|
|
|
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
|
|
|
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
2023-09-20 05:33:02 +02:00
|
|
|
import app.revanced.patches.youtube.misc.playercontrols.BottomControlsResourcePatch
|
|
|
|
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
2023-12-02 22:35:13 +01:00
|
|
|
import app.revanced.util.ResourceGroup
|
|
|
|
import app.revanced.util.copyResources
|
2022-12-31 18:48:40 +01:00
|
|
|
|
2023-09-20 05:33:02 +02:00
|
|
|
@Patch(
|
|
|
|
dependencies = [
|
2023-09-26 00:46:35 +02:00
|
|
|
SettingsPatch::class,
|
2024-01-27 02:34:01 +01:00
|
|
|
BottomControlsResourcePatch::class,
|
|
|
|
AddResourcesPatch::class
|
2023-09-20 05:33:02 +02:00
|
|
|
]
|
|
|
|
)
|
2023-12-02 22:35:13 +01:00
|
|
|
internal object CopyVideoUrlResourcePatch : ResourcePatch() {
|
2023-08-27 21:40:49 +02:00
|
|
|
override fun execute(context: ResourceContext) {
|
2024-01-27 02:34:01 +01:00
|
|
|
AddResourcesPatch(this::class)
|
|
|
|
|
2024-03-02 08:27:05 +01:00
|
|
|
SettingsPatch.PreferenceScreen.PLAYER.addPreferences(
|
|
|
|
SwitchPreference("revanced_copy_video_url"),
|
|
|
|
SwitchPreference("revanced_copy_video_url_timestamp")
|
2022-12-31 18:48:40 +01:00
|
|
|
)
|
|
|
|
|
2023-12-18 20:06:20 +01:00
|
|
|
context.copyResources(
|
|
|
|
"copyvideourl", ResourceGroup(
|
|
|
|
resourceDirectoryName = "drawable",
|
|
|
|
"revanced_yt_copy.xml",
|
|
|
|
"revanced_yt_copy_timestamp.xml"
|
|
|
|
)
|
2023-12-02 22:35:13 +01:00
|
|
|
)
|
2022-12-31 18:48:40 +01:00
|
|
|
|
2023-12-18 20:06:20 +01:00
|
|
|
BottomControlsResourcePatch.addControls("copyvideourl")
|
2022-12-31 18:48:40 +01:00
|
|
|
}
|
|
|
|
}
|