mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 05:07:41 +02:00
feat(youtube): use better patch descriptions
This commit is contained in:
@ -86,7 +86,7 @@ class HideEndScreenOverlayPatch : BytecodePatch() {
|
||||
SettingsPatch.addPreference(
|
||||
arrayOf(
|
||||
"PREFERENCE: FULLSCREEN_SETTINGS",
|
||||
"SETTINGS: HIDE_ENDSCREEN_OVERLAY"
|
||||
"SETTINGS: HIDE_END_SCREEN_OVERLAY"
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -1,12 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout.general.snackbar.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
object HideSnackbarFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
access = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = listOf("L", "L"),
|
||||
customFingerprint = { it.definingClass == "Lcom/google/android/apps/youtube/app/common/ui/bottomui/BottomUiContainer;" }
|
||||
)
|
@ -1,59 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout.general.snackbar.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.extensions.instruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.shared.annotation.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.layout.general.snackbar.fingerprints.HideSnackbarFingerprint
|
||||
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.util.integrations.Constants.GENERAL
|
||||
|
||||
@Patch
|
||||
@Name("hide-snackbar")
|
||||
@Description("Hides the snackbar action popup.")
|
||||
@DependsOn([SettingsPatch::class])
|
||||
@YouTubeCompatibility
|
||||
@Version("0.0.1")
|
||||
class HideSnackbarPatch : BytecodePatch(
|
||||
listOf(
|
||||
HideSnackbarFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
|
||||
HideSnackbarFingerprint.result?.mutableMethod?.let {
|
||||
it.addInstructions(
|
||||
0, """
|
||||
invoke-static {}, $GENERAL->hideSnackbar()Z
|
||||
move-result v0
|
||||
if-eqz v0, :default
|
||||
return-void
|
||||
""", listOf(ExternalLabel("default", it.instruction(0)))
|
||||
)
|
||||
} ?: return HideSnackbarFingerprint.toErrorResult()
|
||||
|
||||
/*
|
||||
* Add settings
|
||||
*/
|
||||
SettingsPatch.addPreference(
|
||||
arrayOf(
|
||||
"PREFERENCE: GENERAL_SETTINGS",
|
||||
"SETTINGS: HIDE_SNACKBAR"
|
||||
)
|
||||
)
|
||||
|
||||
SettingsPatch.updatePatchStatus("hide-snackbar")
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
@ -72,7 +72,7 @@ class TabletMiniPlayerPatch : BytecodePatch(
|
||||
SettingsPatch.addPreference(
|
||||
arrayOf(
|
||||
"PREFERENCE: GENERAL_SETTINGS",
|
||||
"SETTINGS: ENABLE_TABLET_MINIPLAYER"
|
||||
"SETTINGS: ENABLE_TABLET_MINI_PLAYER"
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -61,7 +61,7 @@ class HideEndscreenCardsPatch : BytecodePatch(
|
||||
SettingsPatch.addPreference(
|
||||
arrayOf(
|
||||
"PREFERENCE: PLAYER_SETTINGS",
|
||||
"SETTINGS: HIDE_ENDSCREEN_CARDS"
|
||||
"SETTINGS: HIDE_END_SCREEN_CARDS"
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -9,7 +9,6 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.shared.annotation.YouTubeCompatibility
|
||||
import app.revanced.patches.shared.patch.options.PatchOptions
|
||||
import app.revanced.patches.shared.patch.settings.AbstractSettingsResourcePatch
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.resourceid.patch.SharedResourceIdPatch
|
||||
@ -32,7 +31,6 @@ import java.nio.file.Paths
|
||||
@DependsOn(
|
||||
[
|
||||
IntegrationsPatch::class,
|
||||
PatchOptions::class,
|
||||
SharedResourceIdPatch::class,
|
||||
SettingsBytecodePatch::class
|
||||
]
|
||||
|
Reference in New Issue
Block a user