chore: Update patches information (#126)

* ci: workflow to ping Discord users when patches are released (#72)

* init: Workflow to notify discord users of releases

* Rename workflow

* chore (Background playback): Shorten description

* Revert "chore (Background playback): Shorten description"

This reverts commit 10661b870f.

* Change message contents

* chore: Update patches information

* feat: Apply code review suggestions

* feat: Apply code review suggestions

---------

Co-authored-by: KobeW50 <84587632+KobeW50@users.noreply.github.com>
Co-authored-by: inotia00 <108592928+inotia00@users.noreply.github.com>
This commit is contained in:
ILoveOpenSourceApplications
2025-01-18 16:30:06 +05:30
committed by GitHub
parent c1e0a74f16
commit 3283cf3e98
10 changed files with 51 additions and 50 deletions

View File

@ -1,4 +1,4 @@
package app.revanced.patches.youtube.misc.openlinksdirectly
package app.revanced.patches.youtube.misc.openlinks.directly
import app.revanced.util.fingerprint.legacyFingerprint
import app.revanced.util.or

View File

@ -1,11 +1,11 @@
package app.revanced.patches.youtube.misc.openlinksdirectly
package app.revanced.patches.youtube.misc.openlinks.directly
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE
import app.revanced.patches.youtube.utils.extension.Constants.MISC_PATH
import app.revanced.patches.youtube.utils.patch.PatchList.ENABLE_OPEN_LINKS_DIRECTLY
import app.revanced.patches.youtube.utils.patch.PatchList.BYPASS_URL_REDIRECTS
import app.revanced.patches.youtube.utils.settings.ResourceUtils.addPreference
import app.revanced.patches.youtube.utils.settings.settingsPatch
import app.revanced.util.fingerprint.methodOrThrow
@ -17,8 +17,8 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
@Suppress("unused")
val openLinksDirectlyPatch = bytecodePatch(
ENABLE_OPEN_LINKS_DIRECTLY.title,
ENABLE_OPEN_LINKS_DIRECTLY.summary,
BYPASS_URL_REDIRECTS.title,
BYPASS_URL_REDIRECTS.summary,
) {
compatibleWith(COMPATIBLE_PACKAGE)
@ -40,7 +40,7 @@ val openLinksDirectlyPatch = bytecodePatch(
replaceInstruction(
insertIndex,
"invoke-static {v$insertRegister}, $MISC_PATH/OpenLinksDirectlyPatch;->enableBypassRedirect(Ljava/lang/String;)Landroid/net/Uri;"
"invoke-static {v$insertRegister}, $MISC_PATH/OpenLinksDirectlyPatch;->parseRedirectUri(Ljava/lang/String;)Landroid/net/Uri;"
)
}
}
@ -49,9 +49,9 @@ val openLinksDirectlyPatch = bytecodePatch(
addPreference(
arrayOf(
"SETTINGS: ENABLE_OPEN_LINKS_DIRECTLY"
"SETTINGS: BYPASS_URL_REDIRECTS"
),
ENABLE_OPEN_LINKS_DIRECTLY
BYPASS_URL_REDIRECTS
)
// endregion

View File

@ -1,11 +1,11 @@
package app.revanced.patches.youtube.misc.externalbrowser
package app.revanced.patches.youtube.misc.openlinks.externally
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patches.shared.transformation.transformInstructionsPatch
import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE
import app.revanced.patches.youtube.utils.extension.Constants.MISC_PATH
import app.revanced.patches.youtube.utils.patch.PatchList.ENABLE_EXTERNAL_BROWSER
import app.revanced.patches.youtube.utils.patch.PatchList.OPEN_LINKS_EXTERNALLY
import app.revanced.patches.youtube.utils.settings.ResourceUtils.addPreference
import app.revanced.patches.youtube.utils.settings.settingsPatch
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@ -14,8 +14,8 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
@Suppress("unused")
val openLinksExternallyPatch = bytecodePatch(
ENABLE_EXTERNAL_BROWSER.title,
ENABLE_EXTERNAL_BROWSER.summary,
OPEN_LINKS_EXTERNALLY.title,
OPEN_LINKS_EXTERNALLY.summary,
) {
compatibleWith(COMPATIBLE_PACKAGE)
@ -36,7 +36,7 @@ val openLinksExternallyPatch = bytecodePatch(
mutableMethod.addInstructions(
intentStringIndex + 1,
"""
invoke-static {v$register}, $MISC_PATH/ExternalBrowserPatch;->enableExternalBrowser(Ljava/lang/String;)Ljava/lang/String;
invoke-static {v$register}, $MISC_PATH/OpenLinksExternallyPatch;->openLinksExternally(Ljava/lang/String;)Ljava/lang/String;
move-result-object v$register
""",
)
@ -51,9 +51,9 @@ val openLinksExternallyPatch = bytecodePatch(
addPreference(
arrayOf(
"SETTINGS: ENABLE_EXTERNAL_BROWSER"
"SETTINGS: OPEN_LINKS_EXTERNALLY"
),
ENABLE_EXTERNAL_BROWSER
OPEN_LINKS_EXTERNALLY
)
// endregion

View File

@ -17,9 +17,9 @@ internal enum class PatchList(
"Bypass image region restrictions",
"Adds an option to use a different host for static images, so that images blocked in some countries can be received."
),
ENABLE_OPEN_LINKS_DIRECTLY(
"Bypass link redirection",
"Adds an option to bypass redirection when opening external links."
BYPASS_URL_REDIRECTS(
"Bypass URL redirects",
"Adds an option to bypass URL redirects and open the original URL directly."
),
CHANGE_PLAYER_FLYOUT_MENU_TOGGLES(
"Change player flyout menu toggles",
@ -169,8 +169,8 @@ internal enum class PatchList(
"Navigation bar components",
"Adds options to hide or change components related to the navigation bar."
),
ENABLE_EXTERNAL_BROWSER(
"Open links in browser",
OPEN_LINKS_EXTERNALLY(
"Open links externally",
"Adds an option to always open links in your browser instead of in the in-app-browser."
),
OVERLAY_BUTTONS(