2023-09-20 05:33:02 +02:00
|
|
|
package app.revanced.patches.youtube.interaction.downloads
|
|
|
|
|
|
|
|
import app.revanced.patcher.data.BytecodeContext
|
|
|
|
import app.revanced.patcher.patch.BytecodePatch
|
|
|
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
|
|
|
import app.revanced.patcher.patch.annotation.Patch
|
|
|
|
import app.revanced.patches.youtube.misc.playercontrols.PlayerControlsBytecodePatch
|
|
|
|
import app.revanced.patches.youtube.video.information.VideoInformationPatch
|
|
|
|
|
|
|
|
@Patch(
|
|
|
|
name = "External downloads",
|
2024-01-01 16:30:04 +01:00
|
|
|
description = "Adds support to download and save YouTube videos using an external downloader app.",
|
2023-09-20 05:33:02 +02:00
|
|
|
dependencies = [
|
|
|
|
ExternalDownloadsResourcePatch::class,
|
|
|
|
PlayerControlsBytecodePatch::class,
|
2024-02-13 03:29:21 +01:00
|
|
|
VideoInformationPatch::class,
|
2023-09-20 05:33:02 +02:00
|
|
|
],
|
|
|
|
compatiblePackages = [
|
|
|
|
CompatiblePackage(
|
2024-02-13 03:29:21 +01:00
|
|
|
"com.google.android.youtube",
|
|
|
|
[
|
2024-01-16 19:54:06 +01:00
|
|
|
"18.48.39",
|
|
|
|
"18.49.37",
|
2024-01-17 21:24:55 +01:00
|
|
|
"19.01.34",
|
2024-01-24 14:19:02 +01:00
|
|
|
"19.02.39",
|
2024-02-04 18:38:19 +01:00
|
|
|
"19.03.35",
|
|
|
|
"19.03.36",
|
2024-02-13 03:29:21 +01:00
|
|
|
"19.04.37",
|
|
|
|
],
|
2023-09-20 05:33:02 +02:00
|
|
|
),
|
2024-02-13 03:29:21 +01:00
|
|
|
],
|
2023-09-20 05:33:02 +02:00
|
|
|
)
|
|
|
|
@Suppress("unused")
|
2024-02-13 03:29:21 +01:00
|
|
|
object ExternalDownloadsBytecodePatch : BytecodePatch(emptySet()) {
|
2024-01-01 16:33:07 +01:00
|
|
|
private const val BUTTON_DESCRIPTOR = "Lapp/revanced/integrations/youtube/videoplayer/ExternalDownloadButton;"
|
2023-09-20 05:33:02 +02:00
|
|
|
|
|
|
|
override fun execute(context: BytecodeContext) {
|
|
|
|
/*
|
|
|
|
initialize the control
|
|
|
|
*/
|
|
|
|
|
|
|
|
PlayerControlsBytecodePatch.initializeControl(
|
2024-02-13 03:29:21 +01:00
|
|
|
"$BUTTON_DESCRIPTOR->initializeButton(Landroid/view/View;)V",
|
|
|
|
)
|
2023-09-20 05:33:02 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
add code to change the visibility of the control
|
|
|
|
*/
|
|
|
|
|
|
|
|
PlayerControlsBytecodePatch.injectVisibilityCheckCall(
|
2024-02-13 03:29:21 +01:00
|
|
|
"$BUTTON_DESCRIPTOR->changeVisibility(Z)V",
|
|
|
|
)
|
2023-09-20 05:33:02 +02:00
|
|
|
}
|
2024-02-13 03:29:21 +01:00
|
|
|
}
|