feat(youtube/overlay-buttons): change to an appropriate description

This commit is contained in:
inotia00
2023-06-28 13:49:39 +09:00
parent 049e698999
commit 5dff2ac118
9 changed files with 60 additions and 58 deletions

View File

@ -1,4 +1,4 @@
package app.revanced.patches.youtube.overlaybutton.autorepeat.fingerprints
package app.revanced.patches.youtube.overlaybutton.alwaysrepeat.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint

View File

@ -1,4 +1,4 @@
package app.revanced.patches.youtube.overlaybutton.autorepeat.fingerprints
package app.revanced.patches.youtube.overlaybutton.alwaysrepeat.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint

View File

@ -1,4 +1,4 @@
package app.revanced.patches.youtube.overlaybutton.autorepeat.fingerprints
package app.revanced.patches.youtube.overlaybutton.alwaysrepeat.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint

View File

@ -1,4 +1,4 @@
package app.revanced.patches.youtube.overlaybutton.autorepeat.patch
package app.revanced.patches.youtube.overlaybutton.alwaysrepeat.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Name
@ -15,9 +15,9 @@ import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.youtube.overlaybutton.autorepeat.fingerprints.AutoNavInformerFingerprint
import app.revanced.patches.youtube.overlaybutton.autorepeat.fingerprints.VideoEndFingerprint
import app.revanced.patches.youtube.overlaybutton.autorepeat.fingerprints.VideoEndParentFingerprint
import app.revanced.patches.youtube.overlaybutton.alwaysrepeat.fingerprints.AutoNavInformerFingerprint
import app.revanced.patches.youtube.overlaybutton.alwaysrepeat.fingerprints.VideoEndFingerprint
import app.revanced.patches.youtube.overlaybutton.alwaysrepeat.fingerprints.VideoEndParentFingerprint
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.utils.fingerprints.PlayerPatchFingerprint
import app.revanced.util.integrations.Constants.INTEGRATIONS_PATH
@ -28,7 +28,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Name("always-repeat")
@YouTubeCompatibility
@Version("0.0.1")
class AutoRepeatPatch : BytecodePatch(
class AlwaysRepeatPatch : BytecodePatch(
listOf(
AutoNavInformerFingerprint,
PlayerPatchFingerprint,
@ -42,11 +42,11 @@ class AutoRepeatPatch : BytecodePatch(
addInstructionsWithLabels(
0, """
invoke-static {}, $UTILS_PATH/AlwaysRepeatPatch;->shouldRepeatAndPause()V
invoke-static {}, $VIDEO_PATH/VideoInformation;->shouldAutoRepeat()Z
invoke-static {}, $VIDEO_PATH/VideoInformation;->shouldAlwaysRepeat()Z
move-result v0
if-eqz v0, :notrepeat
if-eqz v0, :end
return-void
""", ExternalLabel("notrepeat", getInstruction(0))
""", ExternalLabel("end", getInstruction(0))
)
}
} ?: return VideoEndFingerprint.toErrorResult()

View File

@ -10,7 +10,7 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.youtube.overlaybutton.autorepeat.patch.AutoRepeatPatch
import app.revanced.patches.youtube.overlaybutton.alwaysrepeat.patch.AlwaysRepeatPatch
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
import app.revanced.patches.youtube.utils.overridespeed.patch.OverrideSpeedHookPatch
import app.revanced.patches.youtube.utils.playerbutton.patch.PlayerButtonHookPatch
@ -26,10 +26,10 @@ import org.w3c.dom.Element
@Patch
@Name("overlay-buttons")
@Description("Add overlay buttons to the player such as copy video link, auto-repeat, download and speed control.")
@Description("Add overlay buttons to the player.")
@DependsOn(
[
AutoRepeatPatch::class,
AlwaysRepeatPatch::class,
OverrideSpeedHookPatch::class,
PlayerButtonHookPatch::class,
PlayerControlsPatch::class,
@ -47,11 +47,11 @@ class OverlayButtonsPatch : ResourcePatch {
* Inject hook
*/
arrayOf(
"Download",
"AutoRepeat",
"CopyWithTimeStamp",
"Copy",
"Speed"
"AlwaysRepeat",
"CopyVideoUrl",
"CopyVideoUrlTimestamp",
"ExternalDownload",
"SpeedDialog"
).forEach {
PlayerControlsPatch.initializeControl("$BUTTON_PATH/$it;")
PlayerControlsPatch.injectVisibility("$BUTTON_PATH/$it;")
@ -111,7 +111,7 @@ class OverlayButtonsPatch : ResourcePatch {
// Change the relationship between buttons
it.getAttributeNode("yt:layout_constraintRight_toLeftOf")?.let { attribute ->
if (attribute.textContent == "@id/fullscreen_button") {
attribute.textContent = "@+id/speed_button"
attribute.textContent = "@+id/speed_dialog_button"
}
}