diff --git a/patches/src/main/kotlin/app/revanced/patches/all/misc/build/SpoofBuildInfoPatch.kt b/patches/src/main/kotlin/app/revanced/patches/all/misc/build/SpoofBuildInfoPatch.kt index 413b40a8c..e077cc4ed 100644 --- a/patches/src/main/kotlin/app/revanced/patches/all/misc/build/SpoofBuildInfoPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/all/misc/build/SpoofBuildInfoPatch.kt @@ -1,12 +1,11 @@ package app.revanced.patches.all.misc.build -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.longOption import app.revanced.patcher.patch.stringOption @Suppress("unused") -val spoofBuildInfoPatch = bytecodePatch( - name = "Spoof build info", +val `Spoof build info` by creatingBytecodePatch( description = "Spoofs the information about the current build.", use = false, ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/all/misc/connectivity/telephony/sim/spoof/SpoofSimCountryPatch.kt b/patches/src/main/kotlin/app/revanced/patches/all/misc/connectivity/telephony/sim/spoof/SpoofSimCountryPatch.kt index fe418b1ae..42149cc37 100644 --- a/patches/src/main/kotlin/app/revanced/patches/all/misc/connectivity/telephony/sim/spoof/SpoofSimCountryPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/all/misc/connectivity/telephony/sim/spoof/SpoofSimCountryPatch.kt @@ -2,8 +2,8 @@ package app.revanced.patches.all.misc.connectivity.telephony.sim.spoof import app.revanced.patcher.patch.bytecodePatch -@Deprecated("Patch was renamed", ReplaceWith("spoofSimProviderPatch")) +@Deprecated("Patch was renamed", ReplaceWith("`Spoof SIM provider`")) @Suppress("unused") val spoofSimCountryPatch = bytecodePatch { - dependsOn(spoofSimProviderPatch) + dependsOn(`Spoof SIM provider`) } \ No newline at end of file diff --git a/patches/src/main/kotlin/app/revanced/patches/all/misc/connectivity/telephony/sim/spoof/SpoofSimProviderPatch.kt b/patches/src/main/kotlin/app/revanced/patches/all/misc/connectivity/telephony/sim/spoof/SpoofSimProviderPatch.kt index 4961a86d0..26b9bf044 100644 --- a/patches/src/main/kotlin/app/revanced/patches/all/misc/connectivity/telephony/sim/spoof/SpoofSimProviderPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/all/misc/connectivity/telephony/sim/spoof/SpoofSimProviderPatch.kt @@ -2,7 +2,7 @@ package app.revanced.patches.all.misc.connectivity.telephony.sim.spoof import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.replaceInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.intOption import app.revanced.patcher.patch.stringOption import app.revanced.patches.all.misc.transformation.transformInstructionsPatch @@ -15,8 +15,7 @@ import com.android.tools.smali.dexlib2.util.MethodUtil import java.util.* @Suppress("unused") -val spoofSimProviderPatch = bytecodePatch( - name = "Spoof SIM provider", +val `Spoof SIM provider` by creatingBytecodePatch( description = "Spoofs information about the SIM card provider.", use = false, ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/all/misc/connectivity/wifi/spoof/SpoofWifiPatch.kt b/patches/src/main/kotlin/app/revanced/patches/all/misc/connectivity/wifi/spoof/SpoofWifiPatch.kt index 7abf5a473..09a79d441 100644 --- a/patches/src/main/kotlin/app/revanced/patches/all/misc/connectivity/wifi/spoof/SpoofWifiPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/all/misc/connectivity/wifi/spoof/SpoofWifiPatch.kt @@ -1,6 +1,6 @@ package app.revanced.patches.all.misc.connectivity.wifi.spoof -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.transformation.IMethodCall import app.revanced.patches.all.misc.transformation.filterMapInstruction35c import app.revanced.patches.all.misc.transformation.transformInstructionsPatch @@ -11,8 +11,7 @@ private const val EXTENSION_CLASS_DESCRIPTOR_PREFIX = private const val EXTENSION_CLASS_DESCRIPTOR = "$EXTENSION_CLASS_DESCRIPTOR_PREFIX;" @Suppress("unused") -val spoofWifiPatch = bytecodePatch( - name = "Spoof Wi-Fi connection", +val `Spoof Wi-Fi connection` by creatingBytecodePatch( description = "Spoofs an existing Wi-Fi connection.", use = false, ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/all/misc/customcertificates/CustomCertificatesPatch.kt b/patches/src/main/kotlin/app/revanced/patches/all/misc/customcertificates/CustomCertificatesPatch.kt index 69ce61ef8..abe9c2d04 100644 --- a/patches/src/main/kotlin/app/revanced/patches/all/misc/customcertificates/CustomCertificatesPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/all/misc/customcertificates/CustomCertificatesPatch.kt @@ -2,15 +2,14 @@ package app.revanced.patches.all.misc.customcertificates import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.booleanOption -import app.revanced.patcher.patch.resourcePatch +import app.revanced.patcher.patch.creatingResourcePatch import app.revanced.patcher.patch.stringsOption import app.revanced.util.Utils.trimIndentMultiline import app.revanced.util.getNode import org.w3c.dom.Element import java.io.File -val customNetworkSecurityPatch = resourcePatch( - name = "Custom network security", +val `Custom network security` = creatingResourcePatch( description = "Allows trusting custom certificate authorities for a specific domain.", use = false ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/all/misc/directory/documentsprovider/ExportInternalDataDocumentsProviderPatch.kt b/patches/src/main/kotlin/app/revanced/patches/all/misc/directory/documentsprovider/ExportInternalDataDocumentsProviderPatch.kt index 46fd56dae..7064eb63d 100644 --- a/patches/src/main/kotlin/app/revanced/patches/all/misc/directory/documentsprovider/ExportInternalDataDocumentsProviderPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/all/misc/directory/documentsprovider/ExportInternalDataDocumentsProviderPatch.kt @@ -1,15 +1,14 @@ package app.revanced.patches.all.misc.directory.documentsprovider import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patcher.patch.resourcePatch +import app.revanced.patcher.patch.creatingResourcePatch import app.revanced.util.asSequence import app.revanced.util.getNode @Suppress("unused") -val exportInternalDataDocumentsProviderPatch = resourcePatch( - name = "Export internal data documents provider", +val `Export internal data documents provider` = creatingResourcePatch( description = "Exports a documents provider that grants access to the internal data directory of this app " + - "to file managers and other apps that support the Storage Access Framework.", + "to file managers and other apps that support the Storage Access Framework.", use = false, ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/all/misc/hex/HexPatch.kt b/patches/src/main/kotlin/app/revanced/patches/all/misc/hex/HexPatch.kt index 7e879e7e0..bf8a088ff 100644 --- a/patches/src/main/kotlin/app/revanced/patches/all/misc/hex/HexPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/all/misc/hex/HexPatch.kt @@ -1,15 +1,14 @@ package app.revanced.patches.all.misc.hex import app.revanced.patcher.patch.PatchException -import app.revanced.patcher.patch.rawResourcePatch +import app.revanced.patcher.patch.creatingRawResourcePatch import app.revanced.patcher.patch.stringsOption import app.revanced.patches.shared.misc.hex.HexPatchBuilder import app.revanced.patches.shared.misc.hex.hexPatch import app.revanced.util.Utils.trimIndentMultiline @Suppress("unused") -val hexPatch = rawResourcePatch( - name = "Hex", +val Hex = creatingRawResourcePatch( description = "Replaces a hexadecimal patterns of bytes of files in an APK.", use = false, ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/all/misc/packagename/ChangePackageNamePatch.kt b/patches/src/main/kotlin/app/revanced/patches/all/misc/packagename/ChangePackageNamePatch.kt index 138d419f3..f25b46d3e 100644 --- a/patches/src/main/kotlin/app/revanced/patches/all/misc/packagename/ChangePackageNamePatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/all/misc/packagename/ChangePackageNamePatch.kt @@ -26,10 +26,9 @@ fun setOrGetFallbackPackageName(fallbackPackageName: String): String { } } -val changePackageNamePatch = resourcePatch( - name = "Change package name", +val `Change package name` = creatingResourcePatch( description = "Appends \".revanced\" to the package name by default. " + - "Changing the package name of the app can lead to unexpected issues.", + "Changing the package name of the app can lead to unexpected issues.", use = false, ) { packageNameOption = stringOption( @@ -46,14 +45,14 @@ val changePackageNamePatch = resourcePatch( default = false, name = "Update permissions", description = "Update compatibility receiver permissions. " + - "Enabling this can fix installation errors, but this can also break features in certain apps.", + "Enabling this can fix installation errors, but this can also break features in certain apps.", ) val updateProviders by booleanOption( default = false, name = "Update providers", description = "Update provider names declared by the app. " + - "Enabling this can fix installation errors, but this can also break features in certain apps.", + "Enabling this can fix installation errors, but this can also break features in certain apps.", ) afterDependents { diff --git a/patches/src/main/kotlin/app/revanced/patches/all/misc/playintegrity/DisablePlayIntegrity.kt b/patches/src/main/kotlin/app/revanced/patches/all/misc/playintegrity/DisablePlayIntegrity.kt index c7a41cb74..7a5ae5c3f 100644 --- a/patches/src/main/kotlin/app/revanced/patches/all/misc/playintegrity/DisablePlayIntegrity.kt +++ b/patches/src/main/kotlin/app/revanced/patches/all/misc/playintegrity/DisablePlayIntegrity.kt @@ -1,7 +1,7 @@ package app.revanced.patches.all.misc.playintegrity import app.revanced.patcher.extensions.replaceInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.transformation.transformInstructionsPatch import app.revanced.util.getReference import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c @@ -20,8 +20,7 @@ private val CONTEXT_BIND_SERVICE_METHOD_REFERENCE = ImmutableMethodReference( @Suppress("unused") -val disablePlayIntegrityPatch = bytecodePatch( - name = "Disable Play Integrity", +val `Disable Play Integrity` by creatingBytecodePatch( description = "Prevents apps from using Play Integrity by pretending it is not available.", use = false, ) { @@ -42,7 +41,8 @@ val disablePlayIntegrityPatch = bytecodePatch( transform = { method, entry -> val (instruction, index, parameterTypes) = entry val parameterString = parameterTypes.joinToString(separator = "") - val registerString = "v${instruction.registerC}, v${instruction.registerD}, v${instruction.registerE}, v${instruction.registerF}" + val registerString = + "v${instruction.registerC}, v${instruction.registerD}, v${instruction.registerE}, v${instruction.registerF}" method.replaceInstruction( index, diff --git a/patches/src/main/kotlin/app/revanced/patches/all/misc/shortcut/sharetargets/RemoveShareTargetsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/all/misc/shortcut/sharetargets/RemoveShareTargetsPatch.kt index 902b5c000..1f342b8e8 100644 --- a/patches/src/main/kotlin/app/revanced/patches/all/misc/shortcut/sharetargets/RemoveShareTargetsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/all/misc/shortcut/sharetargets/RemoveShareTargetsPatch.kt @@ -1,6 +1,6 @@ package app.revanced.patches.all.misc.shortcut.sharetargets -import app.revanced.patcher.patch.resourcePatch +import app.revanced.patcher.patch.creatingResourcePatch import app.revanced.util.asSequence import app.revanced.util.getNode import org.w3c.dom.Element @@ -8,8 +8,7 @@ import java.io.FileNotFoundException import java.util.logging.Logger @Suppress("unused") -val removeShareTargetsPatch = resourcePatch( - name = "Remove share targets", +val `Remove share targets` = creatingResourcePatch( description = "Removes share targets like directly sharing to a frequent contact.", use = false, ) { @@ -18,7 +17,8 @@ val removeShareTargetsPatch = resourcePatch( document("res/xml/shortcuts.xml") } catch (_: FileNotFoundException) { return@apply Logger.getLogger(this::class.java.name).warning( - "The app has no shortcuts. No changes applied.") + "The app has no shortcuts. No changes applied." + ) }.use { document -> val rootNode = document.getNode("shortcuts") as? Element ?: return@use diff --git a/patches/src/main/kotlin/app/revanced/patches/all/misc/spoof/EnableRomSignatureSpoofing.kt b/patches/src/main/kotlin/app/revanced/patches/all/misc/spoof/EnableRomSignatureSpoofing.kt index 5c9597e76..71792b2a4 100644 --- a/patches/src/main/kotlin/app/revanced/patches/all/misc/spoof/EnableRomSignatureSpoofing.kt +++ b/patches/src/main/kotlin/app/revanced/patches/all/misc/spoof/EnableRomSignatureSpoofing.kt @@ -1,11 +1,10 @@ package app.revanced.patches.all.misc.spoof -import app.revanced.patcher.patch.resourcePatch +import app.revanced.patcher.patch.creatingResourcePatch import app.revanced.patcher.patch.stringOption import app.revanced.util.getNode import com.android.apksig.ApkVerifier import com.android.apksig.apk.ApkFormatException -import org.w3c.dom.Element import java.io.File import java.io.IOException import java.nio.file.InvalidPathException @@ -15,8 +14,8 @@ import java.security.cert.CertificateFactory import java.util.* @Suppress("unused") -val enableRomSignatureSpoofing = resourcePatch( - name = "Enable ROM signature spoofing", +val `Enable ROM signature spoofing` = creatingResourcePatch( + name = "", description = "Spoofs the signature via the manifest meta-data \"fake-signature\". " + "This patch only works with ROMs that support signature spoofing.", use = false, diff --git a/patches/src/main/kotlin/app/revanced/patches/all/misc/targetSdk/SetTargetSdkVersion34.kt b/patches/src/main/kotlin/app/revanced/patches/all/misc/targetSdk/SetTargetSdkVersion34.kt index 820e98d64..ce181151b 100644 --- a/patches/src/main/kotlin/app/revanced/patches/all/misc/targetSdk/SetTargetSdkVersion34.kt +++ b/patches/src/main/kotlin/app/revanced/patches/all/misc/targetSdk/SetTargetSdkVersion34.kt @@ -1,13 +1,12 @@ package app.revanced.patches.all.misc.targetSdk -import app.revanced.patcher.patch.resourcePatch +import app.revanced.patcher.patch.creatingResourcePatch import app.revanced.util.getNode import org.w3c.dom.Element import java.util.logging.Logger @Suppress("unused") -val setTargetSdkVersion34 = resourcePatch( - name = "Set target SDK version 34", +val `Set target SDK version 34` = creatingResourcePatch( description = "Changes the target SDK to version 34 (Android 14). " + "For devices running Android 15+, this will disable edge-to-edge display.", use = false, diff --git a/patches/src/main/kotlin/app/revanced/patches/all/misc/versioncode/ChangeVersionCodePatch.kt b/patches/src/main/kotlin/app/revanced/patches/all/misc/versioncode/ChangeVersionCodePatch.kt index c36405e52..28ec9d547 100644 --- a/patches/src/main/kotlin/app/revanced/patches/all/misc/versioncode/ChangeVersionCodePatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/all/misc/versioncode/ChangeVersionCodePatch.kt @@ -1,13 +1,12 @@ package app.revanced.patches.all.misc.versioncode +import app.revanced.patcher.patch.creatingResourcePatch import app.revanced.patcher.patch.intOption -import app.revanced.patcher.patch.resourcePatch import app.revanced.util.getNode import org.w3c.dom.Element @Suppress("unused") -val changeVersionCodePatch = resourcePatch( - name = "Change version code", +val `Change version code` = creatingResourcePatch( description = "Changes the version code of the app. This will turn off app store updates " + "and allows downgrading an existing app install to an older app version.", use = false, diff --git a/patches/src/main/kotlin/app/revanced/patches/amazon/DeepLinkingPatch.kt b/patches/src/main/kotlin/app/revanced/patches/amazon/DeepLinkingPatch.kt index 786e93f2c..0581821d1 100644 --- a/patches/src/main/kotlin/app/revanced/patches/amazon/DeepLinkingPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/amazon/DeepLinkingPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.amazon -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -val deepLinkingPatch = bytecodePatch( - name = "Always allow deep-linking", +val `Always allow deep-linking` by creatingBytecodePatch( description = "Open Amazon links, even if the app is not set to handle Amazon links.", ) { compatibleWith("com.amazon.mShop.android.shopping") diff --git a/patches/src/main/kotlin/app/revanced/patches/angulus/ads/RemoveAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/angulus/ads/RemoveAdsPatch.kt index 843767c9b..bb8346cf0 100644 --- a/patches/src/main/kotlin/app/revanced/patches/angulus/ads/RemoveAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/angulus/ads/RemoveAdsPatch.kt @@ -1,14 +1,14 @@ package app.revanced.patches.angulus.ads -import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patches.shared.misc.pairip.license.disableLicenseCheckPatch +import app.revanced.patcher.patch.creatingBytecodePatch +import app.revanced.patches.shared.misc.pairip.license.`Disable Pairip license check` import app.revanced.util.returnEarly @Suppress("unused") -val angulusPatch = bytecodePatch(name = "Hide ads") { +val `Hide ads` by creatingBytecodePatch { compatibleWith("com.drinkplusplus.angulus") - dependsOn(disableLicenseCheckPatch) + dependsOn(`Disable Pairip license check`) apply { // Always return 0 as the daily measurement count. diff --git a/patches/src/main/kotlin/app/revanced/patches/bandcamp/limitations/RemovePlayLimitsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/bandcamp/limitations/RemovePlayLimitsPatch.kt index 6fda82ae4..8ba34a874 100644 --- a/patches/src/main/kotlin/app/revanced/patches/bandcamp/limitations/RemovePlayLimitsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/bandcamp/limitations/RemovePlayLimitsPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.bandcamp.limitations -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -val removePlayLimitsPatch = bytecodePatch( - name = "Remove play limits", +val `Remove play limits` by creatingBytecodePatch( description = "Disables purchase nagging and playback limits of not purchased tracks.", ) { compatibleWith("com.bandcamp.android") diff --git a/patches/src/main/kotlin/app/revanced/patches/cieid/restrictions/root/BypassRootChecksPatch.kt b/patches/src/main/kotlin/app/revanced/patches/cieid/restrictions/root/BypassRootChecksPatch.kt index fc8a3322b..2108cd946 100644 --- a/patches/src/main/kotlin/app/revanced/patches/cieid/restrictions/root/BypassRootChecksPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/cieid/restrictions/root/BypassRootChecksPatch.kt @@ -1,11 +1,11 @@ package app.revanced.patches.cieid.restrictions.root -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.extensions.addInstruction +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -val bypassRootChecksPatch = bytecodePatch( - name = "Bypass root checks", +val `Bypass root checks` by creatingBytecodePatch( description = "Removes the restriction to use the app with root permissions or on a custom ROM.", ) { compatibleWith("it.ipzs.cieid") diff --git a/patches/src/main/kotlin/app/revanced/patches/com/sbs/ondemand/tv/RemoveAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/com/sbs/ondemand/tv/RemoveAdsPatch.kt index 01da9829d..976c232e2 100644 --- a/patches/src/main/kotlin/app/revanced/patches/com/sbs/ondemand/tv/RemoveAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/com/sbs/ondemand/tv/RemoveAdsPatch.kt @@ -1,18 +1,17 @@ package app.revanced.patches.com.sbs.ondemand.tv import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patches.shared.misc.pairip.license.disableLicenseCheckPatch +import app.revanced.patcher.patch.creatingBytecodePatch +import app.revanced.patches.shared.misc.pairip.license.`Disable Pairip license check` import app.revanced.util.returnEarly @Suppress("unused") -val removeAdsPatch = bytecodePatch( - name = "Remove ads", +val `Remove ads` by creatingBytecodePatch( description = "Removes pre-roll, pause and on-demand advertisements from SBS On Demand TV.", ) { compatibleWith("com.sbs.ondemand.tv") - dependsOn(disableLicenseCheckPatch) + dependsOn(`Disable Pairip license check`) apply { shouldShowAdvertisingTVMethod.returnEarly(true) @@ -25,7 +24,7 @@ val removeAdsPatch = bytecodePatch( // 3. Exception triggers fallbackToAkamaiProvider() which loads actual content. // 4. This preserves the intended app flow: first try ads, then fail gracefully, then load content. requestAdStreamMethod.addInstructions( - 0, + 0, """ new-instance v0, Ljava/lang/RuntimeException; const-string v1, "Ad stream disabled" diff --git a/patches/src/main/kotlin/app/revanced/patches/cricbuzz/ads/DisableAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/cricbuzz/ads/DisableAdsPatch.kt index 4f46f01e6..90fe2590a 100644 --- a/patches/src/main/kotlin/app/revanced/patches/cricbuzz/ads/DisableAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/cricbuzz/ads/DisableAdsPatch.kt @@ -2,7 +2,7 @@ package app.revanced.patches.cricbuzz.ads import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.cricbuzz.misc.extension.sharedExtensionPatch import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow @@ -15,9 +15,7 @@ private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/cricbuzz/ads/HideAdsPatch;" @Suppress("unused") -val disableAdsPatch = bytecodePatch ( - name = "Hide ads", -) { +val `Hide ads` by creatingBytecodePatch { compatibleWith("com.cricbuzz.android"("6.24.01")) dependsOn(sharedExtensionPatch) @@ -28,12 +26,13 @@ val disableAdsPatch = bytecodePatch ( // Remove region-specific Cricbuzz11 elements. cb11ConstructorMethod.addInstruction(0, "const/4 p7, 0x0") getBottomBarMethod.apply { - val getIndex = indexOfFirstInstructionOrThrow() { + val getIndex = indexOfFirstInstructionOrThrow { opcode == Opcode.IGET_OBJECT && getReference()?.name == "bottomBar" } val getRegister = getInstruction(getIndex).registerA - addInstruction(getIndex + 1, + addInstruction( + getIndex + 1, "invoke-static { v$getRegister }, $EXTENSION_CLASS_DESCRIPTOR->filterCb11(Ljava/util/List;)V" ) } diff --git a/patches/src/main/kotlin/app/revanced/patches/crunchyroll/ads/HideAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/crunchyroll/ads/HideAdsPatch.kt index 1d39beafc..55602cd55 100644 --- a/patches/src/main/kotlin/app/revanced/patches/crunchyroll/ads/HideAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/crunchyroll/ads/HideAdsPatch.kt @@ -4,7 +4,7 @@ import app.revanced.patcher.classDef import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.instructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstruction import app.revanced.util.removeFlags @@ -14,9 +14,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.reference.FieldReference @Suppress("unused") -val hideAdsPatch = bytecodePatch( - name = "Hide ads" -) { +val `Hide ads` by creatingBytecodePatch { compatibleWith("com.crunchyroll.crunchyroid") apply { @@ -42,6 +40,7 @@ val hideAdsPatch = bytecodePatch( move-object/from16 v0, p0 const/4 v1, 0x0 iput-boolean v1, v0, $enableAdsField - """) + """ + ) } } \ No newline at end of file diff --git a/patches/src/main/kotlin/app/revanced/patches/disneyplus/SkipAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/disneyplus/SkipAdsPatch.kt index 864121ebc..def32190b 100644 --- a/patches/src/main/kotlin/app/revanced/patches/disneyplus/SkipAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/disneyplus/SkipAdsPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.disneyplus import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val skipAdsPatch = bytecodePatch( - name = "Skip ads", +val `Skip ads` by creatingBytecodePatch( description = "Automatically skips ads.", ) { compatibleWith("com.disney.disneyplus") @@ -13,8 +12,8 @@ val skipAdsPatch = bytecodePatch( apply { arrayOf(insertionGetPointsMethod, insertionGetRangesMethod).forEach { it.addInstructions( - 0, - """ + 0, + """ new-instance v0, Ljava/util/ArrayList; invoke-direct {v0}, Ljava/util/ArrayList;->()V return-object v0 diff --git a/patches/src/main/kotlin/app/revanced/patches/duolingo/ad/DisableAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/duolingo/ad/DisableAdsPatch.kt index 9c1bbe82c..f96985e15 100644 --- a/patches/src/main/kotlin/app/revanced/patches/duolingo/ad/DisableAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/duolingo/ad/DisableAdsPatch.kt @@ -3,13 +3,11 @@ package app.revanced.patches.duolingo.ad import app.revanced.patcher.classDef import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction @Suppress("unused") -val disableAdsPatch = bytecodePatch( - "Disable ads", -) { +val `Disable ads` by creatingBytecodePatch { // 6.55.3 and higher can show ads after each exercise. compatibleWith("com.duolingo"("6.54.5")) diff --git a/patches/src/main/kotlin/app/revanced/patches/duolingo/debug/EnableDebugMenuPatch.kt b/patches/src/main/kotlin/app/revanced/patches/duolingo/debug/EnableDebugMenuPatch.kt index 56892c0fb..27eecfb10 100644 --- a/patches/src/main/kotlin/app/revanced/patches/duolingo/debug/EnableDebugMenuPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/duolingo/debug/EnableDebugMenuPatch.kt @@ -3,13 +3,12 @@ package app.revanced.patches.duolingo.debug import app.revanced.patcher.classDef import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Suppress("unused") -val enableDebugMenuPatch = bytecodePatch( - name = "Enable debug menu", +val `Enable debug menu` by creatingBytecodePatch( use = false, ) { compatibleWith("com.duolingo") diff --git a/patches/src/main/kotlin/app/revanced/patches/duolingo/energy/SkipEnergyRechargeAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/duolingo/energy/SkipEnergyRechargeAdsPatch.kt index 915dd11ae..abc20a427 100644 --- a/patches/src/main/kotlin/app/revanced/patches/duolingo/energy/SkipEnergyRechargeAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/duolingo/energy/SkipEnergyRechargeAdsPatch.kt @@ -2,12 +2,11 @@ package app.revanced.patches.duolingo.energy import app.revanced.patcher.classDef import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.findFieldFromToString @Suppress("unused") -val skipEnergyRechargeAdsPatch = bytecodePatch( - name = "Skip energy recharge ads", +val `Skip energy recharge ads` by creatingBytecodePatch( description = "Skips watching ads to recharge energy." ) { compatibleWith("com.duolingo") diff --git a/patches/src/main/kotlin/app/revanced/patches/facebook/ads/mainfeed/HideSponsoredStoriesPatch.kt b/patches/src/main/kotlin/app/revanced/patches/facebook/ads/mainfeed/HideSponsoredStoriesPatch.kt index 9b9e6ad1d..5fa2d1072 100644 --- a/patches/src/main/kotlin/app/revanced/patches/facebook/ads/mainfeed/HideSponsoredStoriesPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/facebook/ads/mainfeed/HideSponsoredStoriesPatch.kt @@ -2,18 +2,16 @@ package app.revanced.patches.facebook.ads.mainfeed import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.addInstructionsWithLabels -import app.revanced.patcher.patch.bytecodePatch -import com.android.tools.smali.dexlib2.mutable.MutableMethod.Companion.toMutable +import app.revanced.patcher.patch.creatingBytecodePatch import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction31i import com.android.tools.smali.dexlib2.immutable.ImmutableMethod import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter +import com.android.tools.smali.dexlib2.mutable.MutableMethod.Companion.toMutable @Suppress("unused") -val hideSponsoredStoriesPatch = bytecodePatch( - name = "Hide 'Sponsored Stories'", -) { +val `Hide 'Sponsored Stories'` by creatingBytecodePatch { compatibleWith("com.facebook.katana"("490.0.0.63.82")) apply { diff --git a/patches/src/main/kotlin/app/revanced/patches/facebook/ads/story/HideStoryAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/facebook/ads/story/HideStoryAdsPatch.kt index 2f9af038c..832f1099e 100644 --- a/patches/src/main/kotlin/app/revanced/patches/facebook/ads/story/HideStoryAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/facebook/ads/story/HideStoryAdsPatch.kt @@ -1,12 +1,11 @@ package app.revanced.patches.facebook.ads.story -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly import com.android.tools.smali.dexlib2.mutable.MutableMethod @Suppress("unused") -val hideStoryAdsPatch = bytecodePatch( - name = "Hide story ads", +val `Hide story ads` by creatingBytecodePatch( description = "Hides the ads in the Facebook app stories.", ) { compatibleWith("com.facebook.katana") diff --git a/patches/src/main/kotlin/app/revanced/patches/finanzonline/detection/bootloader/BootloaderDetectionPatch.kt b/patches/src/main/kotlin/app/revanced/patches/finanzonline/detection/bootloader/BootloaderDetectionPatch.kt index 9a2ffae70..fa785d921 100644 --- a/patches/src/main/kotlin/app/revanced/patches/finanzonline/detection/bootloader/BootloaderDetectionPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/finanzonline/detection/bootloader/BootloaderDetectionPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.finanzonline.detection.bootloader -import app.revanced.patcher.patch.bytecodePatch import app.revanced.util.returnEarly +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val bootloaderDetectionPatch = bytecodePatch( - name = "Remove bootloader detection", +val `Remove bootloader detection` by creatingBytecodePatch( description = "Removes the check for an unlocked bootloader.", ) { compatibleWith("at.gv.bmf.bmf2go") diff --git a/patches/src/main/kotlin/app/revanced/patches/googlenews/customtabs/EnableCustomTabsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/googlenews/customtabs/EnableCustomTabsPatch.kt index e09afa967..470778dac 100644 --- a/patches/src/main/kotlin/app/revanced/patches/googlenews/customtabs/EnableCustomTabsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/googlenews/customtabs/EnableCustomTabsPatch.kt @@ -2,12 +2,11 @@ package app.revanced.patches.googlenews.customtabs import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.replaceInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Suppress("unused") -val enableCustomTabsPatch = bytecodePatch( - name = "Enable CustomTabs", +val `Enable CustomTabs` by creatingBytecodePatch( description = "Enables CustomTabs to open articles in your default browser.", ) { compatibleWith("com.google.android.apps.magazines") diff --git a/patches/src/main/kotlin/app/revanced/patches/googlephotos/misc/backup/EnableDCIMFoldersBackupControlPatch.kt b/patches/src/main/kotlin/app/revanced/patches/googlephotos/misc/backup/EnableDCIMFoldersBackupControlPatch.kt index 25da2d9b6..91419e140 100644 --- a/patches/src/main/kotlin/app/revanced/patches/googlephotos/misc/backup/EnableDCIMFoldersBackupControlPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/googlephotos/misc/backup/EnableDCIMFoldersBackupControlPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.googlephotos.misc.backup -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -val enableDCIMFoldersBackupControlPatch = bytecodePatch( - name = "Enable DCIM folders backup control", +val `Enable DCIM folders backup control` by creatingBytecodePatch( description = "Disables always on backup for the Camera and other DCIM folders, allowing you to control backup " + "for each folder individually. This will make the app default to having no folders backed up.", use = false, diff --git a/patches/src/main/kotlin/app/revanced/patches/googlephotos/misc/features/SpoofFeaturesPatch.kt b/patches/src/main/kotlin/app/revanced/patches/googlephotos/misc/features/SpoofFeaturesPatch.kt index 71046d14e..829da0c41 100644 --- a/patches/src/main/kotlin/app/revanced/patches/googlephotos/misc/features/SpoofFeaturesPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/googlephotos/misc/features/SpoofFeaturesPatch.kt @@ -2,7 +2,7 @@ package app.revanced.patches.googlephotos.misc.features import app.revanced.patcher.extensions.instructions import app.revanced.patcher.extensions.replaceInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.stringsOption import app.revanced.util.getReference import com.android.tools.smali.dexlib2.Opcode @@ -10,8 +10,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.reference.StringReference @Suppress("unused") -val spoofFeaturesPatch = bytecodePatch( - name = "Spoof features", +val `Spoof features` by creatingBytecodePatch( description = "Spoofs the device to enable Google Pixel exclusive features, including unlimited storage.", ) { compatibleWith("com.google.android.apps.photos") @@ -49,7 +48,7 @@ val spoofFeaturesPatch = bytecodePatch( ), name = "Features to disable", description = "Google Pixel exclusive features to disable." + - "Features after Pixel XL may have to be disabled for unlimited storage depending on the device.", + "Features after Pixel XL may have to be disabled for unlimited storage depending on the device.", required = true, ) diff --git a/patches/src/main/kotlin/app/revanced/patches/googlerecorder/restrictions/RemoveDeviceRestrictions.kt b/patches/src/main/kotlin/app/revanced/patches/googlerecorder/restrictions/RemoveDeviceRestrictions.kt index 24f54df64..0f9285474 100644 --- a/patches/src/main/kotlin/app/revanced/patches/googlerecorder/restrictions/RemoveDeviceRestrictions.kt +++ b/patches/src/main/kotlin/app/revanced/patches/googlerecorder/restrictions/RemoveDeviceRestrictions.kt @@ -3,12 +3,11 @@ package app.revanced.patches.googlerecorder.restrictions import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.removeInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Suppress("unused") -val removeDeviceRestrictionsPatch = bytecodePatch( - name = "Remove device restrictions", +val `Remove device restrictions` by creatingBytecodePatch( description = "Removes restrictions from using the app on any device. Requires mounting patched app over original.", ) { compatibleWith("com.google.android.apps.recorder") diff --git a/patches/src/main/kotlin/app/revanced/patches/hexeditor/ad/DisableAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/hexeditor/ad/DisableAdsPatch.kt index 3fa17fc60..53e2d5c27 100644 --- a/patches/src/main/kotlin/app/revanced/patches/hexeditor/ad/DisableAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/hexeditor/ad/DisableAdsPatch.kt @@ -1,12 +1,10 @@ package app.revanced.patches.hexeditor.ad -import app.revanced.patcher.patch.bytecodePatch import app.revanced.util.returnEarly +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val disableAdsPatch = bytecodePatch( - name = "Disable ads", -) { +val `Disable ads` by creatingBytecodePatch { compatibleWith("com.myprog.hexedit") apply { diff --git a/patches/src/main/kotlin/app/revanced/patches/iconpackstudio/misc/pro/UnlockProPatch.kt b/patches/src/main/kotlin/app/revanced/patches/iconpackstudio/misc/pro/UnlockProPatch.kt index 2fa0ddf89..cbdb8742d 100644 --- a/patches/src/main/kotlin/app/revanced/patches/iconpackstudio/misc/pro/UnlockProPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/iconpackstudio/misc/pro/UnlockProPatch.kt @@ -1,12 +1,10 @@ package app.revanced.patches.iconpackstudio.misc.pro import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val unlockProPatch = bytecodePatch( - name = "Unlock pro", -) { +val `Unlock pro` by creatingBytecodePatch { compatibleWith("ginlemon.iconpackstudio"("2.2 build 016")) apply { diff --git a/patches/src/main/kotlin/app/revanced/patches/idaustria/detection/deviceintegrity/RemoveDeviceIntegrityChecksPatch.kt b/patches/src/main/kotlin/app/revanced/patches/idaustria/detection/deviceintegrity/RemoveDeviceIntegrityChecksPatch.kt index 2b3b6b010..f74d18fe9 100644 --- a/patches/src/main/kotlin/app/revanced/patches/idaustria/detection/deviceintegrity/RemoveDeviceIntegrityChecksPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/idaustria/detection/deviceintegrity/RemoveDeviceIntegrityChecksPatch.kt @@ -1,12 +1,11 @@ package app.revanced.patches.idaustria.detection.deviceintegrity import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -val removeDeviceIntegrityChecksPatch = bytecodePatch( - name = "Remove device integrity checks", +val `Remove device integrity checks` by creatingBytecodePatch( description = "Removes the check for root permissions and unlocked bootloader.", ) { compatibleWith("at.gv.oe.app") diff --git a/patches/src/main/kotlin/app/revanced/patches/idaustria/detection/root/RootDetectionPatch.kt b/patches/src/main/kotlin/app/revanced/patches/idaustria/detection/root/RootDetectionPatch.kt index cfb7e8d68..7da7720eb 100644 --- a/patches/src/main/kotlin/app/revanced/patches/idaustria/detection/root/RootDetectionPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/idaustria/detection/root/RootDetectionPatch.kt @@ -1,10 +1,10 @@ package app.revanced.patches.idaustria.detection.root -import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patches.idaustria.detection.deviceintegrity.removeDeviceIntegrityChecksPatch +import app.revanced.patcher.patch.creatingBytecodePatch +import app.revanced.patches.idaustria.detection.deviceintegrity.`Remove device integrity checks` -@Deprecated("Patch was superseded", ReplaceWith("removeDeviceIntegrityChecksPatch")) +@Deprecated("Patch was superseded", ReplaceWith("`Remove device integrity checks`")) @Suppress("unused") -val rootDetectionPatch = bytecodePatch { - dependsOn(removeDeviceIntegrityChecksPatch) +val rootDetectionPatch by creatingBytecodePatch { + dependsOn(`Remove device integrity checks`) } diff --git a/patches/src/main/kotlin/app/revanced/patches/idaustria/detection/signature/SpoofSignaturePatch.kt b/patches/src/main/kotlin/app/revanced/patches/idaustria/detection/signature/SpoofSignaturePatch.kt index f25f35ed8..94474bd31 100644 --- a/patches/src/main/kotlin/app/revanced/patches/idaustria/detection/signature/SpoofSignaturePatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/idaustria/detection/signature/SpoofSignaturePatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.idaustria.detection.signature -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -val spoofSignaturePatch = bytecodePatch( - name = "Spoof signature", +val `Spoof signature` by creatingBytecodePatch( description = "Spoofs the signature of the app.", ) { compatibleWith("at.gv.oe.app") @@ -13,16 +12,16 @@ val spoofSignaturePatch = bytecodePatch( apply { val expectedSignature = "OpenSSLRSAPublicKey{modulus=ac3e6fd6050aa7e0d6010ae58190404cd89a56935b44f6fee" + - "067c149768320026e10b24799a1339e414605e448e3f264444a327b9ae292be2b62ad567dd1800dbed4a88f718a33dc6db6b" + - "f5178aa41aa0efff8a3409f5ca95dbfccd92c7b4298966df806ea7a0204a00f0e745f6d9f13bdf24f3df715d7b62c1600906" + - "15de1c8a956b9286764985a3b3c060963c435fb9481a5543aaf0671fc2dba6c5c2b17d1ef1d85137f14dc9bbdf3490288087" + - "324cd48341cce64fabf6a9b55d1a7bf23b2fcdff451fd85bf0c7feb0a5e884d7c5c078e413149566a12a686e6efa70ae5161" + - "a0201307692834cda336c55157fef125e67c01c1359886f94742105596b42a790404bbcda5dad6a65f115aaff5e45ef3c28b" + - "2316ff6cef07aa49a45aa58c07bf258051b13ef449ccb37a3679afd5cfb9132f70bb9d931a937897544f90c3bcc80ed012e9" + - "f6ba020b8cdc23f8c29ac092b88f0e370ff9434e4f0f359e614ae0868dc526fa41e4b7596533e8d10279b66e923ecd9f0b20" + - "0def55be2c1f6f9c72c92fb45d7e0a9ac571cb38f0a9a37bb33ea06f223fde8c7a92e8c47769e386f9799776e8f110c21df2" + - "77ef1be61b2c01ebdabddcbf53cc4b6fd9a3c445606ee77b3758162c80ad8f8137b3c6864e92db904807dcb2be9d7717dd21" + - "bf42c121d620ddfb7914f7a95c713d9e1c1b7bdb4a03d618e40cf7e9e235c0b5687e03b7ab3,publicExponent=10001}" + "067c149768320026e10b24799a1339e414605e448e3f264444a327b9ae292be2b62ad567dd1800dbed4a88f718a33dc6db6b" + + "f5178aa41aa0efff8a3409f5ca95dbfccd92c7b4298966df806ea7a0204a00f0e745f6d9f13bdf24f3df715d7b62c1600906" + + "15de1c8a956b9286764985a3b3c060963c435fb9481a5543aaf0671fc2dba6c5c2b17d1ef1d85137f14dc9bbdf3490288087" + + "324cd48341cce64fabf6a9b55d1a7bf23b2fcdff451fd85bf0c7feb0a5e884d7c5c078e413149566a12a686e6efa70ae5161" + + "a0201307692834cda336c55157fef125e67c01c1359886f94742105596b42a790404bbcda5dad6a65f115aaff5e45ef3c28b" + + "2316ff6cef07aa49a45aa58c07bf258051b13ef449ccb37a3679afd5cfb9132f70bb9d931a937897544f90c3bcc80ed012e9" + + "f6ba020b8cdc23f8c29ac092b88f0e370ff9434e4f0f359e614ae0868dc526fa41e4b7596533e8d10279b66e923ecd9f0b20" + + "0def55be2c1f6f9c72c92fb45d7e0a9ac571cb38f0a9a37bb33ea06f223fde8c7a92e8c47769e386f9799776e8f110c21df2" + + "77ef1be61b2c01ebdabddcbf53cc4b6fd9a3c445606ee77b3758162c80ad8f8137b3c6864e92db904807dcb2be9d7717dd21" + + "bf42c121d620ddfb7914f7a95c713d9e1c1b7bdb4a03d618e40cf7e9e235c0b5687e03b7ab3,publicExponent=10001}" spoofSignatureMethod.returnEarly(expectedSignature) } diff --git a/patches/src/main/kotlin/app/revanced/patches/inshorts/ad/InshortsAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/inshorts/ad/InshortsAdsPatch.kt index 087f270f2..3feea1a16 100644 --- a/patches/src/main/kotlin/app/revanced/patches/inshorts/ad/InshortsAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/inshorts/ad/InshortsAdsPatch.kt @@ -1,12 +1,10 @@ package app.revanced.patches.inshorts.ad -import app.revanced.patcher.patch.bytecodePatch import app.revanced.util.returnEarly +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val hideAdsPatch = bytecodePatch( - name = "Hide ads", -) { +val `Hide ads` by creatingBytecodePatch { compatibleWith("com.nis.app") apply { diff --git a/patches/src/main/kotlin/app/revanced/patches/instagram/ads/HideAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/instagram/ads/HideAdsPatch.kt index 77bf4da38..22bd02110 100644 --- a/patches/src/main/kotlin/app/revanced/patches/instagram/ads/HideAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/instagram/ads/HideAdsPatch.kt @@ -1,13 +1,11 @@ package app.revanced.patches.instagram.ads -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.meta.ads.adInjectorMethod import app.revanced.util.returnEarly @Suppress("unused") -val hideAdsPatch = bytecodePatch( - name = "Hide ads", -) { +val `Hide ads` by creatingBytecodePatch { compatibleWith("com.instagram.android") apply { diff --git a/patches/src/main/kotlin/app/revanced/patches/instagram/feed/LimitFeedToFollowedProfiles.kt b/patches/src/main/kotlin/app/revanced/patches/instagram/feed/LimitFeedToFollowedProfiles.kt index 8525c805d..df5d95eed 100644 --- a/patches/src/main/kotlin/app/revanced/patches/instagram/feed/LimitFeedToFollowedProfiles.kt +++ b/patches/src/main/kotlin/app/revanced/patches/instagram/feed/LimitFeedToFollowedProfiles.kt @@ -4,7 +4,7 @@ import app.revanced.patcher.classDef import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.fingerprint -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.instagram.misc.extension.sharedExtensionPatch import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow @@ -14,8 +14,7 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference internal const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/instagram/feed/LimitFeedToFollowedProfiles;" @Suppress("unused") -val limitFeedToFollowedProfiles = bytecodePatch( - name = "Limit feed to followed profiles", +val `Limit feed to followed profiles` by creatingBytecodePatch( description = "Filters the home feed to display only content from profiles you follow.", use = false, ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/instagram/ghost/story/AnonymousStoryViewingPatch.kt b/patches/src/main/kotlin/app/revanced/patches/instagram/ghost/story/AnonymousStoryViewingPatch.kt index 1fe029a98..7509aeb3e 100644 --- a/patches/src/main/kotlin/app/revanced/patches/instagram/ghost/story/AnonymousStoryViewingPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/instagram/ghost/story/AnonymousStoryViewingPatch.kt @@ -1,12 +1,11 @@ package app.revanced.patches.instagram.ghost.story -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.Utils.trimIndentMultiline import app.revanced.util.returnEarly @Suppress("unused") -val anonymousStoryViewingPatch = bytecodePatch( - name = "Anonymous story viewing", +val `Anonymous story viewing` by creatingBytecodePatch( description = """ View stories without sending any information to the server. Your view will not appear in the story viewers list. diff --git a/patches/src/main/kotlin/app/revanced/patches/instagram/hide/explore/HideExploreFeed.kt b/patches/src/main/kotlin/app/revanced/patches/instagram/hide/explore/HideExploreFeed.kt index b66f5856e..da5eb3b7d 100644 --- a/patches/src/main/kotlin/app/revanced/patches/instagram/hide/explore/HideExploreFeed.kt +++ b/patches/src/main/kotlin/app/revanced/patches/instagram/hide/explore/HideExploreFeed.kt @@ -4,7 +4,7 @@ import app.revanced.patcher.Fingerprint import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.replaceInstruction import app.revanced.patcher.patch.BytecodePatchContext -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction context(BytecodePatchContext) @@ -26,8 +26,7 @@ internal fun Fingerprint.replaceJsonFieldWithBogus( } @Suppress("unused") -val hideExploreFeedPatch = bytecodePatch( - name = "Hide explore feed", +val `Hide explore feed` by creatingBytecodePatch( description = "Hides posts and reels from the explore/search page.", use = false, ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/instagram/hide/stories/HideStories.kt b/patches/src/main/kotlin/app/revanced/patches/instagram/hide/stories/HideStories.kt index 14550a6a8..66af06e8a 100644 --- a/patches/src/main/kotlin/app/revanced/patches/instagram/hide/stories/HideStories.kt +++ b/patches/src/main/kotlin/app/revanced/patches/instagram/hide/stories/HideStories.kt @@ -1,10 +1,10 @@ package app.revanced.patches.instagram.hide.stories + import app.revanced.patcher.extensions.removeInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val hideStoriesPatch = bytecodePatch( - name = "Hide Stories from Home", +val `Hide Stories from Home` by creatingBytecodePatch( description = "Hides Stories from the main page, by removing the buttons.", use = false ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/instagram/hide/suggestions/HideSuggestedContent.kt b/patches/src/main/kotlin/app/revanced/patches/instagram/hide/suggestions/HideSuggestedContent.kt index d78aa00e1..f0970858a 100644 --- a/patches/src/main/kotlin/app/revanced/patches/instagram/hide/suggestions/HideSuggestedContent.kt +++ b/patches/src/main/kotlin/app/revanced/patches/instagram/hide/suggestions/HideSuggestedContent.kt @@ -1,11 +1,10 @@ package app.revanced.patches.instagram.hide.suggestions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.instagram.hide.explore.replaceJsonFieldWithBogus @Suppress("unused") -val hideSuggestedContent = bytecodePatch( - name = "Hide suggested content", +val `Hide suggested content` by creatingBytecodePatch( description = "Hides suggested stories, reels, threads and survey from feed (Suggested posts will still be shown).", use = false, ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/instagram/misc/devmenu/EnableDeveloperMenuPatch.kt b/patches/src/main/kotlin/app/revanced/patches/instagram/misc/devmenu/EnableDeveloperMenuPatch.kt index f582ca186..138b8be78 100644 --- a/patches/src/main/kotlin/app/revanced/patches/instagram/misc/devmenu/EnableDeveloperMenuPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/instagram/misc/devmenu/EnableDeveloperMenuPatch.kt @@ -1,6 +1,6 @@ package app.revanced.patches.instagram.misc.devmenu -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.Utils.trimIndentMultiline import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionReversedOrThrow @@ -9,8 +9,7 @@ import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.reference.MethodReference @Suppress("unused") -val enableDeveloperMenuPatch = bytecodePatch( - name = "Enable developer menu", +val `Enable developer menu` by creatingBytecodePatch( description = """ Enables the developer menu, which can be found at the bottom of settings menu with name 'Internal Settings'. diff --git a/patches/src/main/kotlin/app/revanced/patches/instagram/misc/links/OpenLinksExternallyPatch.kt b/patches/src/main/kotlin/app/revanced/patches/instagram/misc/links/OpenLinksExternallyPatch.kt index 4cb428bf7..5e4c8429b 100644 --- a/patches/src/main/kotlin/app/revanced/patches/instagram/misc/links/OpenLinksExternallyPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/instagram/misc/links/OpenLinksExternallyPatch.kt @@ -2,7 +2,7 @@ package app.revanced.patches.instagram.misc.links import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.instagram.misc.extension.sharedExtensionPatch import app.revanced.util.indexOfFirstInstructionOrThrow import com.android.tools.smali.dexlib2.Opcode @@ -11,8 +11,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/instagram/misc/links/OpenLinksExternallyPatch;" @Suppress("unused") -val openLinksExternallyPatch = bytecodePatch( - name = "Open links externally", +val `Open links externally` by creatingBytecodePatch( description = "Changes links to always open in your external browser, instead of the in-app browser.", use = false, ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/instagram/misc/share/domain/ChangeLinkSharingDomainPatch.kt b/patches/src/main/kotlin/app/revanced/patches/instagram/misc/share/domain/ChangeLinkSharingDomainPatch.kt index 090632bb8..e3b2abab5 100644 --- a/patches/src/main/kotlin/app/revanced/patches/instagram/misc/share/domain/ChangeLinkSharingDomainPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/instagram/misc/share/domain/ChangeLinkSharingDomainPatch.kt @@ -1,7 +1,7 @@ package app.revanced.patches.instagram.misc.share.domain import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.stringOption import app.revanced.patches.instagram.misc.extension.sharedExtensionPatch import app.revanced.patches.instagram.misc.share.editShareLinksPatch @@ -11,8 +11,7 @@ internal const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/instagram/misc/share/domain/ChangeLinkSharingDomainPatch;" @Suppress("unused") -val changeLinkSharingDomainPatch = bytecodePatch( - name = "Change link sharing domain", +val `Change link sharing domain` by creatingBytecodePatch( description = "Replaces the domain name of shared links.", use = false ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/instagram/misc/signature/SignatureCheckPatch.kt b/patches/src/main/kotlin/app/revanced/patches/instagram/misc/signature/SignatureCheckPatch.kt index b4f1e3fd5..507cfaae8 100644 --- a/patches/src/main/kotlin/app/revanced/patches/instagram/misc/signature/SignatureCheckPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/instagram/misc/signature/SignatureCheckPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.instagram.misc.signature -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -val signatureCheckPatch = bytecodePatch( - name = "Disable signature check", +val `Disable signature check` by creatingBytecodePatch( description = "Disables the signature check that can cause the app to crash on startup. " + "Using this patch may cause issues with sharing or opening external Instagram links.", use = false diff --git a/patches/src/main/kotlin/app/revanced/patches/instagram/reels/DisableReelsScrollingPatch.kt b/patches/src/main/kotlin/app/revanced/patches/instagram/reels/DisableReelsScrollingPatch.kt index 6cf89dc0e..eba583eb7 100644 --- a/patches/src/main/kotlin/app/revanced/patches/instagram/reels/DisableReelsScrollingPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/instagram/reels/DisableReelsScrollingPatch.kt @@ -2,12 +2,11 @@ package app.revanced.patches.instagram.reels import app.revanced.patcher.classDef import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -val disableReelsScrollingPatch = bytecodePatch( - name = "Disable Reels scrolling", +val `Disable Reels scrolling` by creatingBytecodePatch( description = "Disables the endless scrolling behavior in Instagram Reels, preventing swiping to the next Reel. " + "Note: On a clean install, the 'Tip' animation may appear but will stop on its own after a few seconds.", use = true diff --git a/patches/src/main/kotlin/app/revanced/patches/instagram/story/flipping/DisableStoryAutoFlippingPatch.kt b/patches/src/main/kotlin/app/revanced/patches/instagram/story/flipping/DisableStoryAutoFlippingPatch.kt index 59b9fb47d..495610b85 100644 --- a/patches/src/main/kotlin/app/revanced/patches/instagram/story/flipping/DisableStoryAutoFlippingPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/instagram/story/flipping/DisableStoryAutoFlippingPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.instagram.story.flipping -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -val disableStoryAutoFlippingPatch = bytecodePatch( - name = "Disable story auto flipping", +val `Disable story auto flipping` by creatingBytecodePatch( description = "Disable stories automatically flipping/skipping after some seconds.", use = false ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/irplus/ad/RemoveAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/irplus/ad/RemoveAdsPatch.kt index 9a5c9e940..ef98c850c 100644 --- a/patches/src/main/kotlin/app/revanced/patches/irplus/ad/RemoveAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/irplus/ad/RemoveAdsPatch.kt @@ -1,12 +1,10 @@ package app.revanced.patches.irplus.ad import app.revanced.patcher.extensions.addInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val removeAdsPatch = bytecodePatch( - name = "Remove ads", -) { +val `Remove ads` by creatingBytecodePatch { compatibleWith("net.binarymode.android.irplus") apply { diff --git a/patches/src/main/kotlin/app/revanced/patches/letterboxd/ads/HideAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/letterboxd/ads/HideAdsPatch.kt index 35f450acf..061e1c0df 100644 --- a/patches/src/main/kotlin/app/revanced/patches/letterboxd/ads/HideAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/letterboxd/ads/HideAdsPatch.kt @@ -1,13 +1,11 @@ package app.revanced.patches.letterboxd.ads import app.revanced.patcher.extensions.addInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -val hideAdsPatch = bytecodePatch( - name = "Hide ads", -) { +val `Hide ads` by creatingBytecodePatch { compatibleWith("com.letterboxd.letterboxd") apply { diff --git a/patches/src/main/kotlin/app/revanced/patches/letterboxd/unlock/unlockAppIcons/UnlockAppIconsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/letterboxd/unlock/unlockAppIcons/UnlockAppIconsPatch.kt index eb2d4f40f..2119405a3 100644 --- a/patches/src/main/kotlin/app/revanced/patches/letterboxd/unlock/unlockAppIcons/UnlockAppIconsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/letterboxd/unlock/unlockAppIcons/UnlockAppIconsPatch.kt @@ -1,12 +1,10 @@ package app.revanced.patches.letterboxd.unlock.unlockAppIcons -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -val unlockAppIconsPatch = bytecodePatch( - name = "Unlock app icons", -) { +val `Unlock app icons` by creatingBytecodePatch { compatibleWith("com.letterboxd.letterboxd") apply { diff --git a/patches/src/main/kotlin/app/revanced/patches/lightroom/misc/login/DisableMandatoryLoginPatch.kt b/patches/src/main/kotlin/app/revanced/patches/lightroom/misc/login/DisableMandatoryLoginPatch.kt index b4dcc7826..d6310d8c1 100644 --- a/patches/src/main/kotlin/app/revanced/patches/lightroom/misc/login/DisableMandatoryLoginPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/lightroom/misc/login/DisableMandatoryLoginPatch.kt @@ -2,12 +2,10 @@ package app.revanced.patches.lightroom.misc.login import app.revanced.patcher.extensions.instructions import app.revanced.patcher.extensions.replaceInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val disableMandatoryLoginPatch = bytecodePatch( - name = "Disable mandatory login", -) { +val `Disable mandatory login` by creatingBytecodePatch { compatibleWith("com.adobe.lrmobile"("9.3.0")) apply { diff --git a/patches/src/main/kotlin/app/revanced/patches/lightroom/misc/premium/UnlockPremiumPatch.kt b/patches/src/main/kotlin/app/revanced/patches/lightroom/misc/premium/UnlockPremiumPatch.kt index 66735ef92..e320519b7 100644 --- a/patches/src/main/kotlin/app/revanced/patches/lightroom/misc/premium/UnlockPremiumPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/lightroom/misc/premium/UnlockPremiumPatch.kt @@ -1,12 +1,10 @@ package app.revanced.patches.lightroom.misc.premium import app.revanced.patcher.extensions.replaceInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val unlockPremiumPatch = bytecodePatch( - name = "Unlock Premium", -) { +val `Unlock Premium` by creatingBytecodePatch { compatibleWith("com.adobe.lrmobile"("9.3.0")) apply { diff --git a/patches/src/main/kotlin/app/revanced/patches/memegenerator/misc/pro/UnlockProVersionPatch.kt b/patches/src/main/kotlin/app/revanced/patches/memegenerator/misc/pro/UnlockProVersionPatch.kt index c40b386d7..c097faac2 100644 --- a/patches/src/main/kotlin/app/revanced/patches/memegenerator/misc/pro/UnlockProVersionPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/memegenerator/misc/pro/UnlockProVersionPatch.kt @@ -1,14 +1,12 @@ package app.revanced.patches.memegenerator.misc.pro import app.revanced.patcher.extensions.replaceInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.memegenerator.detection.license.licenseValidationPatch import app.revanced.patches.memegenerator.detection.signature.signatureVerificationPatch @Suppress("unused") -val unlockProVersionPatch = bytecodePatch( - name = "Unlock pro", -) { +val `Unlock pro` by creatingBytecodePatch { dependsOn(signatureVerificationPatch, licenseValidationPatch) compatibleWith("com.zombodroid.MemeGenerator"("4.6364", "4.6370", "4.6375", "4.6377")) diff --git a/patches/src/main/kotlin/app/revanced/patches/messenger/inbox/HideInboxAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/messenger/inbox/HideInboxAdsPatch.kt index dd9994ae7..996a6408f 100644 --- a/patches/src/main/kotlin/app/revanced/patches/messenger/inbox/HideInboxAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/messenger/inbox/HideInboxAdsPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.messenger.inbox import app.revanced.patcher.extensions.replaceInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val hideInboxAdsPatch = bytecodePatch( - name = "Hide inbox ads", +val `Hide inbox ads` by creatingBytecodePatch( description = "Hides ads in inbox.", ) { compatibleWith("com.facebook.orca") diff --git a/patches/src/main/kotlin/app/revanced/patches/messenger/inbox/HideInboxSubtabsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/messenger/inbox/HideInboxSubtabsPatch.kt index cca30b51b..546a25ceb 100644 --- a/patches/src/main/kotlin/app/revanced/patches/messenger/inbox/HideInboxSubtabsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/messenger/inbox/HideInboxSubtabsPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.messenger.inbox import app.revanced.patcher.extensions.replaceInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val hideInboxSubtabsPatch = bytecodePatch( - name = "Hide inbox subtabs", +val `Hide inbox subtabs` by creatingBytecodePatch( description = "Hides Home and Channels tabs between active now tray and chats.", ) { compatibleWith("com.facebook.orca") diff --git a/patches/src/main/kotlin/app/revanced/patches/messenger/layout/HideFacebookButtonPatch.kt b/patches/src/main/kotlin/app/revanced/patches/messenger/layout/HideFacebookButtonPatch.kt index 7d65205f9..d148f0fdb 100644 --- a/patches/src/main/kotlin/app/revanced/patches/messenger/layout/HideFacebookButtonPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/messenger/layout/HideFacebookButtonPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.messenger.layout -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -val hideFacebookButtonPatch = bytecodePatch( - name = "Hide Facebook button", +val `Hide Facebook button` by creatingBytecodePatch( description = "Hides the Facebook button in the top toolbar." ) { compatibleWith("com.facebook.orca") diff --git a/patches/src/main/kotlin/app/revanced/patches/messenger/metaai/RemoveMetaAIPatch.kt b/patches/src/main/kotlin/app/revanced/patches/messenger/metaai/RemoveMetaAIPatch.kt index eb784acc9..4970eeb88 100644 --- a/patches/src/main/kotlin/app/revanced/patches/messenger/metaai/RemoveMetaAIPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/messenger/metaai/RemoveMetaAIPatch.kt @@ -4,7 +4,7 @@ import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.replaceInstruction import app.revanced.patcher.method -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.messenger.misc.extension.sharedExtensionPatch import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.WideLiteralInstruction @@ -13,8 +13,7 @@ internal const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/messeng internal const val EXTENSION_METHOD_NAME = "overrideBooleanFlag" @Suppress("unused") -val removeMetaAIPatch = bytecodePatch( - name = "Remove Meta AI", +val `Remove Meta AI` by creatingBytecodePatch( description = "Removes UI elements related to Meta AI." ) { compatibleWith("com.facebook.orca") diff --git a/patches/src/main/kotlin/app/revanced/patches/mifitness/misc/locale/ForceEnglishLocalePatch.kt b/patches/src/main/kotlin/app/revanced/patches/mifitness/misc/locale/ForceEnglishLocalePatch.kt index 36bd65314..7f32062fb 100644 --- a/patches/src/main/kotlin/app/revanced/patches/mifitness/misc/locale/ForceEnglishLocalePatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/mifitness/misc/locale/ForceEnglishLocalePatch.kt @@ -2,18 +2,17 @@ package app.revanced.patches.mifitness.misc.locale import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.replaceInstruction -import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patches.mifitness.misc.login.fixLoginPatch +import app.revanced.patcher.patch.creatingBytecodePatch +import app.revanced.patches.mifitness.misc.login.`Fix login` import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Suppress("unused") -val forceEnglishLocalePatch = bytecodePatch( - name = "Force English locale", +val `Force English locale` by creatingBytecodePatch( description = "Forces wearable devices to use the English locale.", ) { compatibleWith("com.xiaomi.wearable") - dependsOn(fixLoginPatch) + dependsOn(`Fix login`) apply { syncBluetoothLanguageMethod.apply { diff --git a/patches/src/main/kotlin/app/revanced/patches/mifitness/misc/login/FixLoginPatch.kt b/patches/src/main/kotlin/app/revanced/patches/mifitness/misc/login/FixLoginPatch.kt index 27e7e5f17..e7b40f62f 100644 --- a/patches/src/main/kotlin/app/revanced/patches/mifitness/misc/login/FixLoginPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/mifitness/misc/login/FixLoginPatch.kt @@ -1,10 +1,9 @@ package app.revanced.patches.mifitness.misc.login import app.revanced.patcher.extensions.addInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch -val fixLoginPatch = bytecodePatch( - name = "Fix login", +val `Fix login` by creatingBytecodePatch( description = "Fixes login for uncertified Mi Fitness app", ) { compatibleWith("com.xiaomi.wearable") diff --git a/patches/src/main/kotlin/app/revanced/patches/music/ad/video/HideVideoAds.kt b/patches/src/main/kotlin/app/revanced/patches/music/ad/video/HideVideoAds.kt index 37d2f02b5..b4457d728 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/ad/video/HideVideoAds.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/ad/video/HideVideoAds.kt @@ -1,7 +1,7 @@ package app.revanced.patches.music.ad.video import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.music.misc.extension.sharedExtensionPatch @@ -12,8 +12,7 @@ import app.revanced.patches.shared.misc.settings.preference.SwitchPreference private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/music/patches/HideVideoAdsPatch;" @Suppress("unused") -val hideVideoAdsPatch = bytecodePatch( - name = "Hide music video ads", +val `Hide music video ads` by creatingBytecodePatch( description = "Adds an option to hide ads that appear while listening to or streaming music videos, podcasts, or songs.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/music/audio/exclusiveaudio/EnableExclusiveAudioPlayback.kt b/patches/src/main/kotlin/app/revanced/patches/music/audio/exclusiveaudio/EnableExclusiveAudioPlayback.kt index fac17d7a7..1545a8695 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/audio/exclusiveaudio/EnableExclusiveAudioPlayback.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/audio/exclusiveaudio/EnableExclusiveAudioPlayback.kt @@ -1,13 +1,12 @@ package app.revanced.patches.music.audio.exclusiveaudio -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.music.misc.extension.sharedExtensionPatch import app.revanced.patches.music.misc.settings.settingsPatch import app.revanced.util.returnEarly @Suppress("unused") -val enableExclusiveAudioPlaybackPatch = bytecodePatch( - name = "Enable exclusive audio playback", +val `Enable exclusive audio playback` by creatingBytecodePatch( description = "Enables the option to play audio without video.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/music/interaction/permanentrepeat/PermanentRepeatPatch.kt b/patches/src/main/kotlin/app/revanced/patches/music/interaction/permanentrepeat/PermanentRepeatPatch.kt index bdcd2d3ab..e1b72706e 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/interaction/permanentrepeat/PermanentRepeatPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/interaction/permanentrepeat/PermanentRepeatPatch.kt @@ -3,7 +3,7 @@ package app.revanced.patches.music.interaction.permanentrepeat import app.revanced.patcher.extensions.ExternalLabel import app.revanced.patcher.extensions.addInstructionsWithLabels import app.revanced.patcher.extensions.instructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.music.misc.extension.sharedExtensionPatch @@ -15,8 +15,7 @@ import app.revanced.util.findFreeRegister private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/music/patches/PermanentRepeatPatch;" @Suppress("unused") -val permanentRepeatPatch = bytecodePatch( - name = "Permanent repeat", +val `Permanent repeat` by creatingBytecodePatch( description = "Adds an option to always repeat even if the playlist ends or another track is played." ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/music/layout/buttons/HideButtons.kt b/patches/src/main/kotlin/app/revanced/patches/music/layout/buttons/HideButtons.kt index 295066911..dd2d48fd4 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/layout/buttons/HideButtons.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/layout/buttons/HideButtons.kt @@ -3,7 +3,7 @@ package app.revanced.patches.music.layout.buttons import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.music.misc.extension.sharedExtensionPatch @@ -32,8 +32,7 @@ internal var topBarMenuItemImageView = -1L private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/music/patches/HideButtonsPatch;" @Suppress("unused") -val hideButtons = bytecodePatch( - name = "Hide buttons", +val `Hide buttons` by creatingBytecodePatch( description = "Adds options to hide the cast, history, notification, and search buttons.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/music/layout/compactheader/HideCategoryBar.kt b/patches/src/main/kotlin/app/revanced/patches/music/layout/compactheader/HideCategoryBar.kt index 4c1c4cb51..994572f9c 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/layout/compactheader/HideCategoryBar.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/layout/compactheader/HideCategoryBar.kt @@ -2,7 +2,7 @@ package app.revanced.patches.music.layout.compactheader import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.music.misc.extension.sharedExtensionPatch @@ -18,8 +18,7 @@ internal var chipCloud = -1L private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/music/patches/HideCategoryBarPatch;" @Suppress("unused") -val hideCategoryBar = bytecodePatch( - name = "Hide category bar", +val `Hide category bar` by creatingBytecodePatch( description = "Adds an option to hide the category bar at the top of the homepage.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/music/layout/miniplayercolor/ChangeMiniplayerColor.kt b/patches/src/main/kotlin/app/revanced/patches/music/layout/miniplayercolor/ChangeMiniplayerColor.kt index dc35ceedb..9d34c0671 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/layout/miniplayercolor/ChangeMiniplayerColor.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/layout/miniplayercolor/ChangeMiniplayerColor.kt @@ -3,7 +3,7 @@ package app.revanced.patches.music.layout.miniplayercolor import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.music.misc.extension.sharedExtensionPatch @@ -11,11 +11,7 @@ import app.revanced.patches.music.misc.settings.PreferenceScreen import app.revanced.patches.music.misc.settings.settingsPatch import app.revanced.patches.shared.misc.mapping.resourceMappingPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference -import app.revanced.util.addInstructionsAtControlFlowLabel -import app.revanced.util.findFreeRegister -import app.revanced.util.getReference -import app.revanced.util.indexOfFirstInstructionOrThrow -import app.revanced.util.indexOfFirstInstructionReversedOrThrow +import app.revanced.util.* import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction @@ -25,8 +21,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/music/patches/ChangeMiniplayerColorPatch;" @Suppress("unused") -val changeMiniplayerColor = bytecodePatch( - name = "Change miniplayer color", +val `Change miniplayer color` by creatingBytecodePatch( description = "Adds an option to change the miniplayer background color to match the fullscreen player." ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/music/layout/navigationbar/NavigationBarPatch.kt b/patches/src/main/kotlin/app/revanced/patches/music/layout/navigationbar/NavigationBarPatch.kt index 9e8b710e6..921cca757 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/layout/navigationbar/NavigationBarPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/layout/navigationbar/NavigationBarPatch.kt @@ -3,7 +3,7 @@ package app.revanced.patches.music.layout.navigationbar import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.patch.PatchException -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.resourcePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch @@ -27,8 +27,7 @@ internal var text1 = -1L private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/music/patches/NavigationBarPatch;" @Suppress("unused") -val navigationBarPatch = bytecodePatch( - name = "Navigation bar", +val `Navigation bar` by creatingBytecodePatch( description = "Adds options to hide navigation bar, labels and buttons.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/music/layout/premium/HideGetPremiumPatch.kt b/patches/src/main/kotlin/app/revanced/patches/music/layout/premium/HideGetPremiumPatch.kt index 4282b6591..8bb830ba8 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/layout/premium/HideGetPremiumPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/layout/premium/HideGetPremiumPatch.kt @@ -4,7 +4,7 @@ import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.addInstructionsWithLabels import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.replaceInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.music.misc.extension.sharedExtensionPatch @@ -16,8 +16,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/music/patches/HideGetPremiumPatch;" @Suppress("unused") -val hideGetPremiumPatch = bytecodePatch( - name = "Hide 'Get Music Premium'", +val `Hide 'Get Music Premium'` by creatingBytecodePatch( description = "Adds an option to hide the \"Get Music Premium\" label in the settings and account menu.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/music/misc/androidauto/BypassCertificateChecksPatch.kt b/patches/src/main/kotlin/app/revanced/patches/music/misc/androidauto/BypassCertificateChecksPatch.kt index 0c231653b..635293614 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/misc/androidauto/BypassCertificateChecksPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/misc/androidauto/BypassCertificateChecksPatch.kt @@ -1,13 +1,12 @@ package app.revanced.patches.music.misc.androidauto -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.music.misc.extension.sharedExtensionPatch import app.revanced.patches.music.misc.settings.settingsPatch import app.revanced.util.returnEarly @Suppress("unused") -val bypassCertificateChecksPatch = bytecodePatch( - name = "Bypass certificate checks", +val `Bypass certificate checks` by creatingBytecodePatch( description = "Bypasses certificate checks which prevent YouTube Music from working on Android Auto.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/music/misc/backgroundplayback/BackgroundPlaybackPatch.kt b/patches/src/main/kotlin/app/revanced/patches/music/misc/backgroundplayback/BackgroundPlaybackPatch.kt index 5b4fcdc1e..7c7b12ca9 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/misc/backgroundplayback/BackgroundPlaybackPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/misc/backgroundplayback/BackgroundPlaybackPatch.kt @@ -1,12 +1,11 @@ package app.revanced.patches.music.misc.backgroundplayback -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.music.misc.extension.sharedExtensionPatch import app.revanced.patches.music.misc.settings.settingsPatch import app.revanced.util.returnEarly -val backgroundPlaybackPatch = bytecodePatch( - name = "Remove background playback restrictions", +val `Remove background playback restrictions` by creatingBytecodePatch( description = "Removes restrictions on background playback, including playing kids videos in the background.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/piccomafr/misc/SpoofAndroidDeviceIdPatch.kt b/patches/src/main/kotlin/app/revanced/patches/piccomafr/misc/SpoofAndroidDeviceIdPatch.kt index 8137b1d96..89b0a3c02 100644 --- a/patches/src/main/kotlin/app/revanced/patches/piccomafr/misc/SpoofAndroidDeviceIdPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/piccomafr/misc/SpoofAndroidDeviceIdPatch.kt @@ -1,14 +1,13 @@ package app.revanced.patches.piccomafr.misc -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.stringOption import app.revanced.util.returnEarly @Suppress("unused") -val spoofAndroidDeviceIdPatch = bytecodePatch( - name = "Spoof Android device ID", +val `Spoof Android device ID` by creatingBytecodePatch( description = "Spoofs the Android device ID used by the app for account authentication." + - "This can be used to copy the account to another device.", + "This can be used to copy the account to another device.", use = false, ) { compatibleWith( diff --git a/patches/src/main/kotlin/app/revanced/patches/protonvpn/splittunneling/UnlockSplitTunneling.kt b/patches/src/main/kotlin/app/revanced/patches/protonvpn/splittunneling/UnlockSplitTunneling.kt index f06e50304..05fe3ac4d 100644 --- a/patches/src/main/kotlin/app/revanced/patches/protonvpn/splittunneling/UnlockSplitTunneling.kt +++ b/patches/src/main/kotlin/app/revanced/patches/protonvpn/splittunneling/UnlockSplitTunneling.kt @@ -3,32 +3,29 @@ package app.revanced.patches.protonvpn.splittunneling import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.removeInstruction import app.revanced.patcher.extensions.replaceInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.reference.MethodReference @Suppress("unused") -val unlockSplitTunnelingPatch = - bytecodePatch( - name = "Unlock split tunneling", - ) { - compatibleWith("ch.protonvpn.android") +val `Unlock split tunneling` by creatingBytecodePatch { + compatibleWith("ch.protonvpn.android") - apply { - val registerIndex = enableSplitTunnelingUiMethod.patternMatch!!.endIndex - 1 // TODO + apply { + val registerIndex = enableSplitTunnelingUiMethod.patternMatch!!.endIndex - 1 // TODO - enableSplitTunnelingUiMethod.apply { - val register = getInstruction(registerIndex).registerA - replaceInstruction(registerIndex, "const/4 v$register, 0x0") - } - - initializeSplitTunnelingSettingsUIMethod.apply { - val initSettingsIndex = indexOfFirstInstructionOrThrow { - getReference()?.name == "getSplitTunneling" - } - removeInstruction(initSettingsIndex - 1) + enableSplitTunnelingUiMethod.apply { + val register = getInstruction(registerIndex).registerA + replaceInstruction(registerIndex, "const/4 v$register, 0x0") + } + + initializeSplitTunnelingSettingsUIMethod.apply { + val initSettingsIndex = indexOfFirstInstructionOrThrow { + getReference()?.name == "getSplitTunneling" } + removeInstruction(initSettingsIndex - 1) } } +} diff --git a/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/SpoofClientPatch.kt b/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/SpoofClientPatch.kt index aeebd02a6..8306b362f 100644 --- a/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/SpoofClientPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/SpoofClientPatch.kt @@ -15,7 +15,7 @@ fun spoofClientPatch( redirectUri: String, block: BytecodePatchBuilder.(Option) -> Unit = {}, ) = bytecodePatch( - name = "Spoof client", + name = "Spoof client", // TODO description = "Restores functionality of the app by using custom client ID.", ) { block( diff --git a/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/ads/DisableAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/ads/DisableAdsPatch.kt index 8db9d168c..165a3432f 100644 --- a/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/ads/DisableAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/ads/DisableAdsPatch.kt @@ -1,12 +1,10 @@ package app.revanced.patches.reddit.customclients.sync.ads import app.revanced.patcher.patch.BytecodePatchBuilder -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly -fun disableAdsPatch(block: BytecodePatchBuilder.() -> Unit = {}) = bytecodePatch( - name = "Disable ads", -) { +fun `Disable ads`(block: BytecodePatchBuilder.() -> Unit = {}) = creatingBytecodePatch { apply { isAdsEnabledMethod.returnEarly(false) } diff --git a/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforlemmy/ads/DisableAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforlemmy/ads/DisableAdsPatch.kt index ca74997aa..4587bdec1 100644 --- a/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforlemmy/ads/DisableAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforlemmy/ads/DisableAdsPatch.kt @@ -1,10 +1,10 @@ package app.revanced.patches.reddit.customclients.sync.syncforlemmy.ads -import app.revanced.patches.reddit.customclients.sync.ads.disableAdsPatch +import app.revanced.patches.reddit.customclients.sync.ads.`Disable ads` import app.revanced.patches.reddit.customclients.sync.detection.piracy.disablePiracyDetectionPatch @Suppress("unused") -val disableAdsPatch = disableAdsPatch { +val disableAdsPatch = `Disable ads` { dependsOn(disablePiracyDetectionPatch) compatibleWith("com.laurencedawson.reddit_sync") diff --git a/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/ads/DisableAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/ads/DisableAdsPatch.kt index e50158cdd..dc25002c9 100644 --- a/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/ads/DisableAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/ads/DisableAdsPatch.kt @@ -1,8 +1,8 @@ package app.revanced.patches.reddit.customclients.sync.syncforreddit.ads -import app.revanced.patches.reddit.customclients.sync.ads.disableAdsPatch +import app.revanced.patches.reddit.customclients.sync.ads.`Disable ads` @Suppress("unused") -val disableAdsPatch = disableAdsPatch { +val disableAdsPatch = `Disable ads` { compatibleWith("io.syncapps.lemmy_sync") } diff --git a/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/annoyances/startup/DisableSyncForLemmyBottomSheetPatch.kt b/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/annoyances/startup/DisableSyncForLemmyBottomSheetPatch.kt index cd43c2374..c4bca5537 100644 --- a/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/annoyances/startup/DisableSyncForLemmyBottomSheetPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/annoyances/startup/DisableSyncForLemmyBottomSheetPatch.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.extensions.removeInstruction import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused", "ObjectPropertyName") -val `Disable Sync for Lemmy bottom sheet` = creatingBytecodePatch( +val `Disable Sync for Lemmy bottom sheet` by creatingBytecodePatch( description = "Disables the bottom sheet at the startup that asks you to signup to \"Sync for Lemmy\".", ) { compatibleWith( diff --git a/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/fix/user/UseUserEndpointPatch.kt b/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/fix/user/UseUserEndpointPatch.kt index a51b8e5a1..33e43c6b5 100644 --- a/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/fix/user/UseUserEndpointPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/fix/user/UseUserEndpointPatch.kt @@ -3,12 +3,11 @@ package app.revanced.patches.reddit.customclients.sync.syncforreddit.fix.user import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.replaceInstruction import app.revanced.patcher.extensions.stringReference -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @Suppress("unused") -val useUserEndpointPatch = bytecodePatch( - name = "Use /user/ endpoint", +val `Use /user/ endpoint` by creatingBytecodePatch( description = "Replaces the deprecated endpoint for viewing user profiles /u with /user, that used to fix a bug.", use = false, diff --git a/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/fix/video/FixVideoDownloadsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/fix/video/FixVideoDownloadsPatch.kt index aa0fe5389..cb2a86ae7 100644 --- a/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/fix/video/FixVideoDownloadsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/reddit/customclients/sync/syncforreddit/fix/video/FixVideoDownloadsPatch.kt @@ -2,7 +2,7 @@ package app.revanced.patches.reddit.customclients.sync.syncforreddit.fix.video import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.reddit.customclients.sync.syncforreddit.extension.sharedExtensionPatch import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c @@ -11,8 +11,7 @@ private const val EXTENSION_CLASS_DESCRIPTOR = private const val GET_LINKS_METHOD = "getLinks([B)[Ljava/lang/String;" @Suppress("unused") -val fixVideoDownloadsPatch = bytecodePatch( - name = "Fix video downloads", +val `Fix video downloads` by creatingBytecodePatch( description = "Fixes a bug in Sync's MPD parser resulting in only the audio-track being saved.", ) { dependsOn(sharedExtensionPatch) diff --git a/patches/src/main/kotlin/app/revanced/patches/samsung/radio/misc/fix/crash/FixCrashPatch.kt b/patches/src/main/kotlin/app/revanced/patches/samsung/radio/misc/fix/crash/FixCrashPatch.kt index 5abfeedb4..72b4e2a60 100644 --- a/patches/src/main/kotlin/app/revanced/patches/samsung/radio/misc/fix/crash/FixCrashPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/samsung/radio/misc/fix/crash/FixCrashPatch.kt @@ -4,7 +4,7 @@ package app.revanced.patches.samsung.radio.misc.fix.crash import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.samsung.radio.restrictions.device.`Bypass device checks` import app.revanced.util.findInstructionIndicesReversedOrThrow import app.revanced.util.indexOfFirstInstruction @@ -13,8 +13,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/samsung/radio/misc/fix/crash/FixCrashPatch;" -val fixCrashPatch = bytecodePatch( - name = "Fix crashes", description = "Prevents the app from crashing because of missing system permissions." +val `Fix crashes` by creatingBytecodePatch( + description = "Prevents the app from crashing because of missing system permissions." ) { dependsOn(addManifestPermissionsPatch, `Bypass device checks`) extendWith("extensions/samsung/radio.rve") diff --git a/patches/src/main/kotlin/app/revanced/patches/shared/misc/audio/ForceOriginalAudioPatch.kt b/patches/src/main/kotlin/app/revanced/patches/shared/misc/audio/ForceOriginalAudioPatch.kt index 8f62dd523..adcab55e1 100644 --- a/patches/src/main/kotlin/app/revanced/patches/shared/misc/audio/ForceOriginalAudioPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/shared/misc/audio/ForceOriginalAudioPatch.kt @@ -39,7 +39,7 @@ internal fun forceOriginalAudioPatch( subclassExtensionClassDescriptor: String, preferenceScreen: BasePreferenceScreen.Screen ) = bytecodePatch( - name = "Force original audio", + name = "Force original audio", // TODO description = "Adds an option to always use the original audio track.", ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/shared/misc/debugging/EnableDebuggingPatch.kt b/patches/src/main/kotlin/app/revanced/patches/shared/misc/debugging/EnableDebuggingPatch.kt index 878fd40d4..491e27927 100644 --- a/patches/src/main/kotlin/app/revanced/patches/shared/misc/debugging/EnableDebuggingPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/shared/misc/debugging/EnableDebuggingPatch.kt @@ -28,7 +28,7 @@ internal fun enableDebuggingPatch( preferenceScreen: BasePreferenceScreen.Screen, additionalDebugPreferences: List = emptyList() ) = bytecodePatch( - name = "Enable debugging", + name = "Enable debugging", // TODO description = "Adds options for debugging and exporting ReVanced logs to the clipboard.", ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/shared/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt b/patches/src/main/kotlin/app/revanced/patches/shared/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt index 29c93381a..5e78e40a5 100644 --- a/patches/src/main/kotlin/app/revanced/patches/shared/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/shared/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt @@ -18,7 +18,7 @@ internal fun checkWatchHistoryDomainNameResolutionPatch( executeBlock: BytecodePatchContext.() -> Unit = {}, getMainActivityMethod: BytecodePatchContext.() -> MutableMethod ) = bytecodePatch( - name = "Check watch history domain name resolution", + name = "Check watch history domain name resolution", // TODO description = "Checks if the device DNS server is preventing user watch history from being saved.", ) { block() diff --git a/patches/src/main/kotlin/app/revanced/patches/shared/misc/gms/GmsCoreSupportPatch.kt b/patches/src/main/kotlin/app/revanced/patches/shared/misc/gms/GmsCoreSupportPatch.kt index 8364cdf7a..f796b12d8 100644 --- a/patches/src/main/kotlin/app/revanced/patches/shared/misc/gms/GmsCoreSupportPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/shared/misc/gms/GmsCoreSupportPatch.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.extensions.instructions import app.revanced.patcher.extensions.replaceInstruction import app.revanced.patcher.patch.* import app.revanced.patcher.patch.BytecodePatchContext -import app.revanced.patches.all.misc.packagename.changePackageNamePatch +import app.revanced.patches.all.misc.packagename.`Change package name` import app.revanced.patches.all.misc.packagename.setOrGetFallbackPackageName import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch @@ -55,7 +55,7 @@ fun gmsCoreSupportPatch( executeBlock: BytecodePatchContext.() -> Unit = {}, block: BytecodePatchBuilder.() -> Unit = {}, ) = bytecodePatch( - name = "GmsCore support", + name = "GmsCore support", // TODO description = "Allows the app to work without root by using a different package name when patched " + "using a GmsCore instead of Google Play Services.", ) { @@ -71,7 +71,7 @@ fun gmsCoreSupportPatch( ) { it!!.matches(Regex(PACKAGE_NAME_REGEX_PATTERN)) } dependsOn( - changePackageNamePatch, + `Change package name`, gmsCoreSupportResourcePatchFactory(gmsCoreVendorGroupIdOption), extensionPatch, ) @@ -519,7 +519,7 @@ fun gmsCoreSupportResourcePatch( block: ResourcePatchBuilder.() -> Unit = {}, ) = resourcePatch { dependsOn( - changePackageNamePatch, + `Change package name`, addResourcesPatch, ) diff --git a/patches/src/main/kotlin/app/revanced/patches/shared/misc/pairip/license/DisableLicenseCheckPatch.kt b/patches/src/main/kotlin/app/revanced/patches/shared/misc/pairip/license/DisableLicenseCheckPatch.kt index 3e92c6432..0a2ad8026 100644 --- a/patches/src/main/kotlin/app/revanced/patches/shared/misc/pairip/license/DisableLicenseCheckPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/shared/misc/pairip/license/DisableLicenseCheckPatch.kt @@ -1,13 +1,12 @@ package app.revanced.patches.shared.misc.pairip.license import app.revanced.patcher.extensions.addInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly import java.util.logging.Logger @Suppress("unused") -val disableLicenseCheckPatch = bytecodePatch( - name = "Disable Pairip license check", +val `Disable Pairip license check` by creatingBytecodePatch( description = "Disables Play Integrity API (Pairip) client-side license check.", use = false ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/shared/misc/privacy/DisableSentryTelemetry.kt b/patches/src/main/kotlin/app/revanced/patches/shared/misc/privacy/DisableSentryTelemetry.kt index 8dbc7504c..1a9de70bb 100644 --- a/patches/src/main/kotlin/app/revanced/patches/shared/misc/privacy/DisableSentryTelemetry.kt +++ b/patches/src/main/kotlin/app/revanced/patches/shared/misc/privacy/DisableSentryTelemetry.kt @@ -1,13 +1,12 @@ package app.revanced.patches.shared.misc.privacy -import app.revanced.patcher.patch.resourcePatch +import app.revanced.patcher.patch.creatingResourcePatch import app.revanced.util.asSequence import app.revanced.util.getNode import org.w3c.dom.Element @Suppress("unused") -val disableSentryTelemetryPatch = resourcePatch( - name = "Disable Sentry telemetry", +val `Disable Sentry telemetry` = creatingResourcePatch( description = "Disables Sentry telemetry. See https://sentry.io/for/android/ for more information.", use = false, ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/shared/misc/privacy/SanitizeSharingLinksPatch.kt b/patches/src/main/kotlin/app/revanced/patches/shared/misc/privacy/SanitizeSharingLinksPatch.kt index 8083163d1..84ccc8b75 100644 --- a/patches/src/main/kotlin/app/revanced/patches/shared/misc/privacy/SanitizeSharingLinksPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/shared/misc/privacy/SanitizeSharingLinksPatch.kt @@ -28,7 +28,7 @@ internal fun sanitizeSharingLinksPatch( preferenceScreen: BasePreferenceScreen.Screen, replaceMusicLinksWithYouTube: Boolean = false, ) = bytecodePatch( - name = "Sanitize sharing links", + name = "Sanitize sharing links", // TODO description = "Removes the tracking query parameters from shared links.", ) { block() diff --git a/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/SpoofVideoStreamsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/SpoofVideoStreamsPatch.kt index ea274c5f7..abf3644c6 100644 --- a/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/SpoofVideoStreamsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/SpoofVideoStreamsPatch.kt @@ -36,7 +36,7 @@ internal fun spoofVideoStreamsPatch( block: BytecodePatchBuilder.() -> Unit, executeBlock: BytecodePatchContext.() -> Unit = {}, ) = bytecodePatch( - name = "Spoof video streams", + name = "Spoof video streams", // TODO description = "Adds options to spoof the client video streams to fix playback.", ) { block() diff --git a/patches/src/main/kotlin/app/revanced/patches/solidexplorer2/functionality/filesize/RemoveFileSizeLimitPatch.kt b/patches/src/main/kotlin/app/revanced/patches/solidexplorer2/functionality/filesize/RemoveFileSizeLimitPatch.kt index 778e2f071..b2287d4c8 100644 --- a/patches/src/main/kotlin/app/revanced/patches/solidexplorer2/functionality/filesize/RemoveFileSizeLimitPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/solidexplorer2/functionality/filesize/RemoveFileSizeLimitPatch.kt @@ -2,12 +2,11 @@ package app.revanced.patches.solidexplorer2.functionality.filesize import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.replaceInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import com.android.tools.smali.dexlib2.iface.instruction.ThreeRegisterInstruction @Suppress("unused") -val removeFileSizeLimitPatch = bytecodePatch( - name = "Remove file size limit", +val `Remove file size limit` by creatingBytecodePatch( description = "Allows opening files larger than 2 MB in the text editor.", ) { compatibleWith("pl.solidexplorer2") diff --git a/patches/src/main/kotlin/app/revanced/patches/songpal/badge/BadgeTabPatch.kt b/patches/src/main/kotlin/app/revanced/patches/songpal/badge/BadgeTabPatch.kt index f160d8391..8624e35ce 100644 --- a/patches/src/main/kotlin/app/revanced/patches/songpal/badge/BadgeTabPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/songpal/badge/BadgeTabPatch.kt @@ -2,13 +2,12 @@ package app.revanced.patches.songpal.badge import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.removeInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch internal const val ACTIVITY_TAB_DESCRIPTOR = "Ljp/co/sony/vim/framework/ui/yourheadphones/YhContract\$Tab;" @Suppress("unused") -val badgeTabPatch = bytecodePatch( - name = "Remove badge tab", +val `Remove badge tab` by creatingBytecodePatch( description = "Removes the badge tab from the activity tab.", ) { compatibleWith("com.sony.songpal.mdr") diff --git a/patches/src/main/kotlin/app/revanced/patches/songpal/badge/RemoveNotificationBadgePatch.kt b/patches/src/main/kotlin/app/revanced/patches/songpal/badge/RemoveNotificationBadgePatch.kt index f102c6bab..198e52ac7 100644 --- a/patches/src/main/kotlin/app/revanced/patches/songpal/badge/RemoveNotificationBadgePatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/songpal/badge/RemoveNotificationBadgePatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.songpal.badge import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val removeNotificationBadgePatch = bytecodePatch( - name = "Remove notification badge", +val `Remove notification badge` by creatingBytecodePatch( description = "Removes the red notification badge from the activity tab.", ) { compatibleWith("com.sony.songpal.mdr"("10.1.0")) diff --git a/patches/src/main/kotlin/app/revanced/patches/soundcloud/ad/HideAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/soundcloud/ad/HideAdsPatch.kt index d2d223f59..78b832e23 100644 --- a/patches/src/main/kotlin/app/revanced/patches/soundcloud/ad/HideAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/soundcloud/ad/HideAdsPatch.kt @@ -1,13 +1,11 @@ package app.revanced.patches.soundcloud.ad import app.revanced.patcher.extensions.* -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.soundcloud.shared.featureConstructorMethod @Suppress("unused") -val hideAdsPatch = bytecodePatch( - name = "Hide ads", -) { +val `Hide ads` by creatingBytecodePatch { compatibleWith("com.soundcloud.android"("2025.05.27-release")) apply { diff --git a/patches/src/main/kotlin/app/revanced/patches/soundcloud/analytics/DisableTelemetryPatch.kt b/patches/src/main/kotlin/app/revanced/patches/soundcloud/analytics/DisableTelemetryPatch.kt index b49837d6c..7b51c4b06 100644 --- a/patches/src/main/kotlin/app/revanced/patches/soundcloud/analytics/DisableTelemetryPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/soundcloud/analytics/DisableTelemetryPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.soundcloud.analytics import app.revanced.patcher.extensions.addInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val disableTelemetryPatch = bytecodePatch( - name = "Disable telemetry", +val `Disable telemetry` by creatingBytecodePatch( description = "Disables SoundCloud's telemetry system.", ) { compatibleWith("com.soundcloud.android"("2025.05.27-release")) diff --git a/patches/src/main/kotlin/app/revanced/patches/soundcloud/offlinesync/EnableOfflineSyncPatch.kt b/patches/src/main/kotlin/app/revanced/patches/soundcloud/offlinesync/EnableOfflineSyncPatch.kt index 3d5f119cf..8d51c4e2a 100644 --- a/patches/src/main/kotlin/app/revanced/patches/soundcloud/offlinesync/EnableOfflineSyncPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/soundcloud/offlinesync/EnableOfflineSyncPatch.kt @@ -1,7 +1,7 @@ package app.revanced.patches.soundcloud.offlinesync import app.revanced.patcher.extensions.* -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.soundcloud.shared.featureConstructorMethod import app.revanced.util.getReference import com.android.tools.smali.dexlib2.Opcode @@ -9,9 +9,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.reference.FieldReference @Suppress("unused") -val enableOfflineSync = bytecodePatch( - name = "Enable offline sync", -) { +val `Enable offline sync` by creatingBytecodePatch { compatibleWith("com.soundcloud.android"("2025.05.27-release")) apply { diff --git a/patches/src/main/kotlin/app/revanced/patches/spotify/misc/fix/login/FixFacebookLoginPatch.kt b/patches/src/main/kotlin/app/revanced/patches/spotify/misc/fix/login/FixFacebookLoginPatch.kt index d15ac40a7..d3c0157ee 100644 --- a/patches/src/main/kotlin/app/revanced/patches/spotify/misc/fix/login/FixFacebookLoginPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/spotify/misc/fix/login/FixFacebookLoginPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.spotify.misc.fix.login -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -val fixFacebookLoginPatch = bytecodePatch( - name = "Fix Facebook login", +val `Fix Facebook login` by creatingBytecodePatch( description = "Fix logging in with Facebook when the app is patched by always opening the login in a web browser window.", ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/spotify/misc/lyrics/ChangeLyricsProviderPatch.kt b/patches/src/main/kotlin/app/revanced/patches/spotify/misc/lyrics/ChangeLyricsProviderPatch.kt index d96d64dca..65fff9ca7 100644 --- a/patches/src/main/kotlin/app/revanced/patches/spotify/misc/lyrics/ChangeLyricsProviderPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/spotify/misc/lyrics/ChangeLyricsProviderPatch.kt @@ -4,9 +4,8 @@ import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.replaceInstruction import app.revanced.patcher.fingerprint -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.stringOption -import com.android.tools.smali.dexlib2.mutable.MutableMethod import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstruction import app.revanced.util.indexOfFirstInstructionOrThrow @@ -15,6 +14,7 @@ import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction35c import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.reference.MethodReference import com.android.tools.smali.dexlib2.immutable.reference.ImmutableMethodReference +import com.android.tools.smali.dexlib2.mutable.MutableMethod import java.net.InetAddress import java.net.URI import java.net.URISyntaxException @@ -22,8 +22,7 @@ import java.net.UnknownHostException import java.util.logging.Logger @Suppress("unused") -val changeLyricsProviderPatch = bytecodePatch( - name = "Change lyrics provider", +val `Change lyrics provider` by creatingBytecodePatch( description = "Changes the lyrics provider to a custom one.", use = false, ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/spotify/misc/widgets/FixThirdPartyLaunchersWidgets.kt b/patches/src/main/kotlin/app/revanced/patches/spotify/misc/widgets/FixThirdPartyLaunchersWidgets.kt index 626b9ac6f..b330fc794 100644 --- a/patches/src/main/kotlin/app/revanced/patches/spotify/misc/widgets/FixThirdPartyLaunchersWidgets.kt +++ b/patches/src/main/kotlin/app/revanced/patches/spotify/misc/widgets/FixThirdPartyLaunchersWidgets.kt @@ -1,11 +1,10 @@ package app.revanced.patches.spotify.misc.widgets -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -val fixThirdPartyLaunchersWidgets = bytecodePatch( - name = "Fix third party launchers widgets", +val `Fix third party launchers widgets` by creatingBytecodePatch( description = "Fixes Spotify widgets not working in third party launchers, like Nova Launcher.", ) { compatibleWith("com.spotify.music") diff --git a/patches/src/main/kotlin/app/revanced/patches/stocard/layout/HideOffersTabPatch.kt b/patches/src/main/kotlin/app/revanced/patches/stocard/layout/HideOffersTabPatch.kt index d7772b200..0b94833ed 100644 --- a/patches/src/main/kotlin/app/revanced/patches/stocard/layout/HideOffersTabPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/stocard/layout/HideOffersTabPatch.kt @@ -1,13 +1,11 @@ package app.revanced.patches.stocard.layout -import app.revanced.patcher.patch.resourcePatch +import app.revanced.patcher.patch.creatingResourcePatch import app.revanced.util.childElementsSequence import app.revanced.util.getNode @Suppress("unused") -val hideOffersTabPatch = resourcePatch( - name = "Hide offers tab", -) { +val `Hide offers tab` by creatingResourcePatch { compatibleWith("de.stocard.stocard") apply { diff --git a/patches/src/main/kotlin/app/revanced/patches/stocard/layout/HideStoryBubblesPatch.kt b/patches/src/main/kotlin/app/revanced/patches/stocard/layout/HideStoryBubblesPatch.kt index b4e86e9da..433c91f62 100644 --- a/patches/src/main/kotlin/app/revanced/patches/stocard/layout/HideStoryBubblesPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/stocard/layout/HideStoryBubblesPatch.kt @@ -1,12 +1,10 @@ package app.revanced.patches.stocard.layout -import app.revanced.patcher.patch.resourcePatch +import app.revanced.patcher.patch.creatingResourcePatch import app.revanced.util.getNode @Suppress("unused") -val hideStoryBubblesPatch = resourcePatch( - name = "Hide story bubbles", -) { +val `Hide story bubbles` by creatingResourcePatch { compatibleWith("de.stocard.stocard") apply { diff --git a/patches/src/main/kotlin/app/revanced/patches/strava/mediaupload/OverwriteMediaUploadParametersPatch.kt b/patches/src/main/kotlin/app/revanced/patches/strava/mediaupload/OverwriteMediaUploadParametersPatch.kt index 1d63d2739..d377e149f 100644 --- a/patches/src/main/kotlin/app/revanced/patches/strava/mediaupload/OverwriteMediaUploadParametersPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/strava/mediaupload/OverwriteMediaUploadParametersPatch.kt @@ -1,14 +1,13 @@ package app.revanced.patches.strava.mediaupload import app.revanced.patcher.firstClassDef -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.intOption import app.revanced.patcher.patch.longOption import app.revanced.util.returnEarly @Suppress("unused") -val overwriteMediaUploadParametersPatch = bytecodePatch( - name = "Overwrite media upload parameters", +val `Overwrite media upload parameters` by creatingBytecodePatch( description = "Overwrites the compression, resize and trim media (images and videos) parameters returned by Strava's server before upload.", ) { compatibleWith("com.strava") diff --git a/patches/src/main/kotlin/app/revanced/patches/strava/password/EnablePasswordLoginPatch.kt b/patches/src/main/kotlin/app/revanced/patches/strava/password/EnablePasswordLoginPatch.kt index 5dd30a4f0..9e63d499d 100644 --- a/patches/src/main/kotlin/app/revanced/patches/strava/password/EnablePasswordLoginPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/strava/password/EnablePasswordLoginPatch.kt @@ -1,12 +1,10 @@ package app.revanced.patches.strava.password -import app.revanced.patcher.Fingerprint -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -val enablePasswordLoginPatch = bytecodePatch( - name = "Enable password login", +val `Enable password login` by creatingBytecodePatch( description = "Re-enables password login after having used an OTP code.", ) { compatibleWith("com.strava") diff --git a/patches/src/main/kotlin/app/revanced/patches/strava/privacy/BlockSnowplowTrackingPatch.kt b/patches/src/main/kotlin/app/revanced/patches/strava/privacy/BlockSnowplowTrackingPatch.kt index 4387be357..f791c8eaa 100644 --- a/patches/src/main/kotlin/app/revanced/patches/strava/privacy/BlockSnowplowTrackingPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/strava/privacy/BlockSnowplowTrackingPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.strava.privacy -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -val blockSnowplowTrackingPatch = bytecodePatch( - name = "Block Snowplow tracking", +val `Block Snowplow tracking` by creatingBytecodePatch( description = "Blocks Snowplow analytics. See https://snowplow.io for more information.", ) { compatibleWith("com.strava") diff --git a/patches/src/main/kotlin/app/revanced/patches/strava/quickedit/DisableQuickEditPatch.kt b/patches/src/main/kotlin/app/revanced/patches/strava/quickedit/DisableQuickEditPatch.kt index f77b83b4d..a996a7814 100644 --- a/patches/src/main/kotlin/app/revanced/patches/strava/quickedit/DisableQuickEditPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/strava/quickedit/DisableQuickEditPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.strava.quickedit -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -val disableQuickEditPatch = bytecodePatch( - name = "Disable Quick Edit", +val `Disable Quick Edit` by creatingBytecodePatch( description = "Prevents the Quick Edit prompt from popping up.", ) { compatibleWith("com.strava") diff --git a/patches/src/main/kotlin/app/revanced/patches/strava/subscription/UnlockSubscriptionPatch.kt b/patches/src/main/kotlin/app/revanced/patches/strava/subscription/UnlockSubscriptionPatch.kt index 158a5904a..7b55475dd 100644 --- a/patches/src/main/kotlin/app/revanced/patches/strava/subscription/UnlockSubscriptionPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/strava/subscription/UnlockSubscriptionPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.strava.subscription -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -val unlockSubscriptionPatch = bytecodePatch( - name = "Unlock subscription features", +val `Unlock subscription features` by creatingBytecodePatch( description = "Unlocks \"Routes\", \"Matched Runs\" and \"Segment Efforts\".", ) { compatibleWith("com.strava") diff --git a/patches/src/main/kotlin/app/revanced/patches/strava/upselling/DisableSubscriptionSuggestionsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/strava/upselling/DisableSubscriptionSuggestionsPatch.kt index bcaa71f68..9a11a8741 100644 --- a/patches/src/main/kotlin/app/revanced/patches/strava/upselling/DisableSubscriptionSuggestionsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/strava/upselling/DisableSubscriptionSuggestionsPatch.kt @@ -2,16 +2,14 @@ package app.revanced.patches.strava.upselling import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.removeInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation import com.android.tools.smali.dexlib2.immutable.ImmutableMethod import com.android.tools.smali.dexlib2.mutable.MutableMethod.Companion.toMutable @Suppress("unused") -val disableSubscriptionSuggestionsPatch = bytecodePatch( - name = "Disable subscription suggestions", -) { +val `Disable subscription suggestions` by creatingBytecodePatch { compatibleWith("com.strava") apply { diff --git a/patches/src/main/kotlin/app/revanced/patches/swissid/integritycheck/RemoveGooglePlayIntegrityCheckPatch.kt b/patches/src/main/kotlin/app/revanced/patches/swissid/integritycheck/RemoveGooglePlayIntegrityCheckPatch.kt index ab4cb6b04..2c8f88319 100644 --- a/patches/src/main/kotlin/app/revanced/patches/swissid/integritycheck/RemoveGooglePlayIntegrityCheckPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/swissid/integritycheck/RemoveGooglePlayIntegrityCheckPatch.kt @@ -1,19 +1,18 @@ package app.revanced.patches.swissid.integritycheck import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch private const val RESULT_METHOD_REFERENCE = " Lcom/swisssign/deviceintegrity/DeviceintegrityPlugin\$onMethodCall\$1;->" + - "\$result:Lio/flutter/plugin/common/MethodChannel\$Result;" + "\$result:Lio/flutter/plugin/common/MethodChannel\$Result;" private const val SUCCESS_METHOD_REFERENCE = "Lio/flutter/plugin/common/MethodChannel\$Result;->success(Ljava/lang/Object;)V" @Suppress("unused") -val removeGooglePlayIntegrityCheckPatch = bytecodePatch( - name = "Remove Google Play Integrity check", +val `Remove Google Play Integrity check` by creatingBytecodePatch( description = "Removes the Google Play Integrity check. With this it's possible to use SwissID on custom ROMS." + - "If the device is rooted, root permissions must be hidden from the app.", + "If the device is rooted, root permissions must be hidden from the app.", ) { compatibleWith("com.swisssign.swissid.mobile"("5.2.9")) diff --git a/patches/src/main/kotlin/app/revanced/patches/threads/HideAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/threads/HideAdsPatch.kt index 33ece5e2e..c21847c08 100644 --- a/patches/src/main/kotlin/app/revanced/patches/threads/HideAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/threads/HideAdsPatch.kt @@ -1,13 +1,11 @@ package app.revanced.patches.threads -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.meta.ads.adInjectorMethod import app.revanced.util.returnEarly @Suppress("unused") -val hideAdsPatch = bytecodePatch( - name = "Hide ads", -) { +val `Hide ads` by creatingBytecodePatch { compatibleWith("com.instagram.barcelona"("382.0.0.51.85")) apply { diff --git a/patches/src/main/kotlin/app/revanced/patches/ticktick/misc/themeunlock/UnlockThemePatch.kt b/patches/src/main/kotlin/app/revanced/patches/ticktick/misc/themeunlock/UnlockThemePatch.kt index 462540430..22877d8b1 100644 --- a/patches/src/main/kotlin/app/revanced/patches/ticktick/misc/themeunlock/UnlockThemePatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/ticktick/misc/themeunlock/UnlockThemePatch.kt @@ -2,11 +2,10 @@ package app.revanced.patches.ticktick.misc.themeunlock import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.removeInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val unlockProPatch = bytecodePatch( - name = "Unlock themes", +val `Unlock themes` by creatingBytecodePatch( description = "Unlocks all themes that are inaccessible until a certain level is reached.", ) { compatibleWith("com.ticktick.task") diff --git a/patches/src/main/kotlin/app/revanced/patches/tiktok/feedfilter/FeedFilterPatch.kt b/patches/src/main/kotlin/app/revanced/patches/tiktok/feedfilter/FeedFilterPatch.kt index cad2b345d..bfdae9a53 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tiktok/feedfilter/FeedFilterPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tiktok/feedfilter/FeedFilterPatch.kt @@ -2,9 +2,9 @@ package app.revanced.patches.tiktok.feedfilter import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.instructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.tiktok.misc.extension.sharedExtensionPatch -import app.revanced.patches.tiktok.misc.settings.settingsPatch +import app.revanced.patches.tiktok.misc.settings.Settings import app.revanced.patches.tiktok.misc.settings.settingsStatusLoadFingerprint import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @@ -12,14 +12,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/tiktok/feedfilter/FeedItemsFilter;" @Suppress("unused") -val feedFilterPatch = bytecodePatch( - name = "Feed filter", +val `Feed filter` by creatingBytecodePatch( description = "Removes ads, livestreams, stories, image videos " + - "and videos with a specific amount of views or likes from the feed.", + "and videos with a specific amount of views or likes from the feed.", ) { dependsOn( sharedExtensionPatch, - settingsPatch, + Settings, ) compatibleWith( diff --git a/patches/src/main/kotlin/app/revanced/patches/tiktok/interaction/cleardisplay/RememberClearDisplayPatch.kt b/patches/src/main/kotlin/app/revanced/patches/tiktok/interaction/cleardisplay/RememberClearDisplayPatch.kt index ebdf1bd0f..517c897d1 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tiktok/interaction/cleardisplay/RememberClearDisplayPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tiktok/interaction/cleardisplay/RememberClearDisplayPatch.kt @@ -4,15 +4,14 @@ import app.revanced.patcher.extensions.ExternalLabel import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.addInstructionsWithLabels import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.tiktok.shared.onRenderFirstFrameFingerprint import app.revanced.util.indexOfFirstInstructionOrThrow import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction @Suppress("unused") -val rememberClearDisplayPatch = bytecodePatch( - name = "Remember clear display", +val `Remember clear display` by creatingBytecodePatch( description = "Remembers the clear display configurations in between videos.", ) { compatibleWith( @@ -30,7 +29,7 @@ val rememberClearDisplayPatch = bytecodePatch( addInstructions( isEnabledIndex, "invoke-static { v$isEnabledRegister }, " + - "Lapp/revanced/extension/tiktok/cleardisplay/RememberClearDisplayPatch;->rememberClearDisplayState(Z)V", + "Lapp/revanced/extension/tiktok/cleardisplay/RememberClearDisplayPatch;->rememberClearDisplayState(Z)V", ) // endregion diff --git a/patches/src/main/kotlin/app/revanced/patches/tiktok/interaction/downloads/DownloadsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/tiktok/interaction/downloads/DownloadsPatch.kt index d47d71767..ec040ebac 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tiktok/interaction/downloads/DownloadsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tiktok/interaction/downloads/DownloadsPatch.kt @@ -1,9 +1,9 @@ package app.revanced.patches.tiktok.interaction.downloads import app.revanced.patcher.extensions.* -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.tiktok.misc.extension.sharedExtensionPatch -import app.revanced.patches.tiktok.misc.settings.settingsPatch +import app.revanced.patches.tiktok.misc.settings.Settings import app.revanced.patches.tiktok.misc.settings.settingsStatusLoadFingerprint import app.revanced.util.findInstructionIndicesReversedOrThrow import app.revanced.util.getReference @@ -15,13 +15,12 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/tiktok/download/DownloadsPatch;" @Suppress("unused") -val downloadsPatch = bytecodePatch( - name = "Downloads", +val Downloads by creatingBytecodePatch( description = "Removes download restrictions and changes the default path to download to.", ) { dependsOn( sharedExtensionPatch, - settingsPatch, + Settings, ) compatibleWith( diff --git a/patches/src/main/kotlin/app/revanced/patches/tiktok/interaction/seekbar/ShowSeekbarPatch.kt b/patches/src/main/kotlin/app/revanced/patches/tiktok/interaction/seekbar/ShowSeekbarPatch.kt index 77ae54049..13b533e6e 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tiktok/interaction/seekbar/ShowSeekbarPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tiktok/interaction/seekbar/ShowSeekbarPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.tiktok.interaction.seekbar import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val showSeekbarPatch = bytecodePatch( - name = "Show seekbar", +val `Show seekbar` by creatingBytecodePatch( description = "Shows progress bar for all video.", ) { compatibleWith( diff --git a/patches/src/main/kotlin/app/revanced/patches/tiktok/interaction/speed/PlaybackSpeedPatch.kt b/patches/src/main/kotlin/app/revanced/patches/tiktok/interaction/speed/PlaybackSpeedPatch.kt index 4179a5e01..39d23df4e 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tiktok/interaction/speed/PlaybackSpeedPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tiktok/interaction/speed/PlaybackSpeedPatch.kt @@ -4,7 +4,7 @@ import app.revanced.patcher.classDef import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.tiktok.shared.getEnterFromFingerprint import app.revanced.patches.tiktok.shared.onRenderFirstFrameFingerprint import app.revanced.util.getReference @@ -13,10 +13,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction11x import com.android.tools.smali.dexlib2.iface.reference.MethodReference @Suppress("unused") -val playbackSpeedPatch = bytecodePatch( - name = "Playback speed", +val `Playback speed` by creatingBytecodePatch( description = "Enables the playback speed option for all videos and " + - "retains the speed configurations in between videos.", + "retains the speed configurations in between videos.", ) { compatibleWith( "com.ss.android.ugc.trill"("36.5.4"), diff --git a/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/login/disablerequirement/DisableLoginRequirementPatch.kt b/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/login/disablerequirement/DisableLoginRequirementPatch.kt index caab1234d..c20750973 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/login/disablerequirement/DisableLoginRequirementPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/login/disablerequirement/DisableLoginRequirementPatch.kt @@ -1,12 +1,10 @@ package app.revanced.patches.tiktok.misc.login.disablerequirement import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val disableLoginRequirementPatch = bytecodePatch( - name = "Disable login requirement", -) { +val `Disable login requirement` by creatingBytecodePatch { compatibleWith( "com.ss.android.ugc.trill", "com.zhiliaoapp.musically", diff --git a/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/login/fixgoogle/FixGoogleLoginPatch.kt b/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/login/fixgoogle/FixGoogleLoginPatch.kt index 4469b8df6..6f405791a 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/login/fixgoogle/FixGoogleLoginPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/login/fixgoogle/FixGoogleLoginPatch.kt @@ -1,12 +1,11 @@ package app.revanced.patches.tiktok.misc.login.fixgoogle -import app.revanced.patcher.patch.bytecodePatch import app.revanced.util.returnEarly import com.android.tools.smali.dexlib2.mutable.MutableMethod +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val fixGoogleLoginPatch = bytecodePatch( - name = "Fix Google login", +val `Fix Google login` by creatingBytecodePatch( description = "Allows logging in with a Google account.", ) { compatibleWith( diff --git a/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/settings/SettingsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/settings/SettingsPatch.kt index 55e88d95d..48b87ccb5 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/settings/SettingsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/settings/SettingsPatch.kt @@ -1,10 +1,10 @@ package app.revanced.patches.tiktok.misc.settings +import app.revanced.patcher.extensions.ExternalLabel import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.addInstructionsWithLabels import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patcher.extensions.ExternalLabel +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.shared.layout.branding.addBrandLicensePatch import app.revanced.patches.tiktok.misc.extension.sharedExtensionPatch import com.android.tools.smali.dexlib2.Opcode @@ -15,8 +15,7 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/tiktok/settings/TikTokActivityHook;" -val settingsPatch = bytecodePatch( - name = "Settings", +val Settings by creatingBytecodePatch( description = "Adds ReVanced settings to TikTok.", ) { dependsOn(sharedExtensionPatch, addBrandLicensePatch) @@ -29,14 +28,14 @@ val settingsPatch = bytecodePatch( apply { val initializeSettingsMethodDescriptor = "$EXTENSION_CLASS_DESCRIPTOR->initialize(" + - "Lcom/bytedance/ies/ugc/aweme/commercialize/compliance/personalization/AdPersonalizationActivity;" + - ")Z" + "Lcom/bytedance/ies/ugc/aweme/commercialize/compliance/personalization/AdPersonalizationActivity;" + + ")Z" val createSettingsEntryMethodDescriptor = "$EXTENSION_CLASS_DESCRIPTOR->createSettingsEntry(" + - "Ljava/lang/String;" + - "Ljava/lang/String;" + - ")Ljava/lang/Object;" + "Ljava/lang/String;" + + "Ljava/lang/String;" + + ")Ljava/lang/Object;" fun String.toClassName(): String = substring(1, this.length - 1).replace("/", ".") diff --git a/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/spoof/sim/SpoofSimPatch.kt b/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/spoof/sim/SpoofSimPatch.kt index a0f30417f..4cb0f943b 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/spoof/sim/SpoofSimPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tiktok/misc/spoof/sim/SpoofSimPatch.kt @@ -3,9 +3,9 @@ package app.revanced.patches.tiktok.misc.spoof.sim import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.tiktok.misc.extension.sharedExtensionPatch -import app.revanced.patches.tiktok.misc.settings.settingsPatch +import app.revanced.patches.tiktok.misc.settings.Settings import app.revanced.patches.tiktok.misc.settings.settingsStatusLoadFingerprint import app.revanced.util.findMutableMethodOf import com.android.tools.smali.dexlib2.Opcode @@ -14,14 +14,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c import com.android.tools.smali.dexlib2.iface.reference.MethodReference @Suppress("unused") -val spoofSimPatch = bytecodePatch( - name = "SIM spoof", +val `SIM spoof` by creatingBytecodePatch( description = "Spoofs the information which is retrieved from the SIM card.", use = false, ) { dependsOn( sharedExtensionPatch, - settingsPatch, + Settings, ) compatibleWith( diff --git a/patches/src/main/kotlin/app/revanced/patches/trakt/UnlockProPatch.kt b/patches/src/main/kotlin/app/revanced/patches/trakt/UnlockProPatch.kt index ddb10b2ad..31948de1c 100644 --- a/patches/src/main/kotlin/app/revanced/patches/trakt/UnlockProPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/trakt/UnlockProPatch.kt @@ -2,12 +2,10 @@ package app.revanced.patches.trakt import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.immutableClassDef -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val unlockProPatch = bytecodePatch( - name = "Unlock pro", -) { +val `Unlock pro` by creatingBytecodePatch { compatibleWith("tv.trakt.trakt"("1.1.1")) apply { diff --git a/patches/src/main/kotlin/app/revanced/patches/tudortmund/lockscreen/ShowOnLockscreenPatch.kt b/patches/src/main/kotlin/app/revanced/patches/tudortmund/lockscreen/ShowOnLockscreenPatch.kt index 5b8a93bd3..071ad2f42 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tudortmund/lockscreen/ShowOnLockscreenPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tudortmund/lockscreen/ShowOnLockscreenPatch.kt @@ -4,7 +4,7 @@ import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.instructions import app.revanced.patcher.extensions.replaceInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.tudortmund.misc.extension.sharedExtensionPatch import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction22c @@ -16,8 +16,7 @@ private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/tudortmund/lockscreen/ShowOnLockscreenPatch;" @Suppress("unused") -val showOnLockscreenPatch = bytecodePatch( - name = "Show on lockscreen", +val `Show on lockscreen` by creatingBytecodePatch( description = "Shows student id and student ticket on lockscreen.", ) { dependsOn(sharedExtensionPatch) @@ -62,10 +61,10 @@ val showOnLockscreenPatch = bytecodePatch( replaceInstruction( windowIndex, "invoke-static { v$activityRegister, v$brightnessRegister }, " + - "$EXTENSION_CLASS_DESCRIPTOR->" + - "getWindow" + - "(Landroidx/appcompat/app/AppCompatActivity;F)" + - "Landroid/view/Window;", + "$EXTENSION_CLASS_DESCRIPTOR->" + + "getWindow" + + "(Landroidx/appcompat/app/AppCompatActivity;F)" + + "Landroid/view/Window;", ) // Normally, the brightness is loaded into a register after the getWindow call. diff --git a/patches/src/main/kotlin/app/revanced/patches/tumblr/ads/DisableDashboardAds.kt b/patches/src/main/kotlin/app/revanced/patches/tumblr/ads/DisableDashboardAds.kt index c5310ea85..b6b54f038 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tumblr/ads/DisableDashboardAds.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tumblr/ads/DisableDashboardAds.kt @@ -1,12 +1,11 @@ package app.revanced.patches.tumblr.ads -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.tumblr.timelinefilter.addTimelineObjectTypeFilter import app.revanced.patches.tumblr.timelinefilter.filterTimelineObjectsPatch @Suppress("unused") -val disableDashboardAdsPatch = bytecodePatch( - name = "Disable dashboard ads", +val `Disable dashboard ads` by creatingBytecodePatch( description = "Disables ads in the dashboard.", ) { dependsOn(filterTimelineObjectsPatch) diff --git a/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/adfree/DisableAdFreeBannerPatch.kt b/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/adfree/DisableAdFreeBannerPatch.kt index 71bdda792..858de3318 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/adfree/DisableAdFreeBannerPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/adfree/DisableAdFreeBannerPatch.kt @@ -1,12 +1,11 @@ package app.revanced.patches.tumblr.annoyances.adfree -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.tumblr.featureflags.addFeatureFlagOverride import app.revanced.patches.tumblr.featureflags.overrideFeatureFlagsPatch @Suppress("unused") -val disableAdFreeBannerPatch = bytecodePatch( - name = "Disable Ad-Free Banner", +val `Disable Ad-Free Banner` by creatingBytecodePatch( description = "Disables the banner with a frog, prompting you to buy Tumblr Ad-Free.", ) { dependsOn(overrideFeatureFlagsPatch) diff --git a/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/inappupdate/DisableInAppUpdatePatch.kt b/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/inappupdate/DisableInAppUpdatePatch.kt index 0454cc9ef..308755f44 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/inappupdate/DisableInAppUpdatePatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/inappupdate/DisableInAppUpdatePatch.kt @@ -1,12 +1,11 @@ package app.revanced.patches.tumblr.annoyances.inappupdate -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.tumblr.featureflags.addFeatureFlagOverride import app.revanced.patches.tumblr.featureflags.overrideFeatureFlagsPatch @Suppress("unused") -val disableInAppUpdatePatch = bytecodePatch( - name = "Disable in-app update", +val `Disable in-app update` by creatingBytecodePatch( description = "Disables the in-app update check and update prompt.", ) { dependsOn(overrideFeatureFlagsPatch) diff --git a/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/notifications/DisableBlogNotificationReminderPatch.kt b/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/notifications/DisableBlogNotificationReminderPatch.kt index 1d0cee9c4..0992cd21b 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/notifications/DisableBlogNotificationReminderPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/notifications/DisableBlogNotificationReminderPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.tumblr.annoyances.notifications import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val disableBlogNotificationReminderPatch = bytecodePatch( - name = "Disable blog notification reminder", +val `Disable blog notification reminder` by creatingBytecodePatch( description = "Disables the reminder to enable notifications for blogs you visit.", ) { compatibleWith("com.tumblr") diff --git a/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/popups/DisableGiftMessagePopupPatch.kt b/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/popups/DisableGiftMessagePopupPatch.kt index c447c2a59..220480515 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/popups/DisableGiftMessagePopupPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/popups/DisableGiftMessagePopupPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.tumblr.annoyances.popups -import app.revanced.patcher.patch.bytecodePatch import app.revanced.util.returnEarly +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val disableGiftMessagePopupPatch = bytecodePatch( - name = "Disable gift message popup", +val `Disable gift message popup` by creatingBytecodePatch( description = "Disables the popup suggesting to buy TumblrMart items for other people.", ) { compatibleWith("com.tumblr") diff --git a/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/tv/DisableTumblrTvPatch.kt b/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/tv/DisableTumblrTvPatch.kt index 1ee007660..9b84a2b48 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/tv/DisableTumblrTvPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tumblr/annoyances/tv/DisableTumblrTvPatch.kt @@ -1,12 +1,11 @@ package app.revanced.patches.tumblr.annoyances.tv -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.tumblr.featureflags.addFeatureFlagOverride import app.revanced.patches.tumblr.featureflags.overrideFeatureFlagsPatch @Suppress("unused") -val disableTumblrTvPatch = bytecodePatch( - name = "Disable Tumblr TV", +val `Disable Tumblr TV` by creatingBytecodePatch( description = "Removes the Tumblr TV navigation button from the bottom navigation bar.", ) { dependsOn(overrideFeatureFlagsPatch) diff --git a/patches/src/main/kotlin/app/revanced/patches/tumblr/fixes/FixOldVersionsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/tumblr/fixes/FixOldVersionsPatch.kt index 45a33aa75..ba8c62a88 100644 --- a/patches/src/main/kotlin/app/revanced/patches/tumblr/fixes/FixOldVersionsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/tumblr/fixes/FixOldVersionsPatch.kt @@ -1,13 +1,12 @@ package app.revanced.patches.tumblr.fixes import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val fixOldVersionsPatch = bytecodePatch( - name = "Fix old versions", +val `Fix old versions` by creatingBytecodePatch( description = "Fixes old versions of the app (v33.2 and earlier) breaking due to Tumblr removing remnants of Tumblr" + - " Live from the API, which causes many requests to fail. This patch has no effect on newer versions of the app.", + " Live from the API, which causes many requests to fail. This patch has no effect on newer versions of the app.", use = false, ) { compatibleWith("com.tumblr") diff --git a/patches/src/main/kotlin/app/revanced/patches/twitch/ad/audio/AudioAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/twitch/ad/audio/AudioAdsPatch.kt index 7f336cadb..45d5e17f7 100644 --- a/patches/src/main/kotlin/app/revanced/patches/twitch/ad/audio/AudioAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/twitch/ad/audio/AudioAdsPatch.kt @@ -1,23 +1,22 @@ package app.revanced.patches.twitch.ad.audio +import app.revanced.patcher.extensions.ExternalLabel import app.revanced.patcher.extensions.addInstructionsWithLabels import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patcher.extensions.ExternalLabel +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference import app.revanced.patches.twitch.misc.extension.sharedExtensionPatch import app.revanced.patches.twitch.misc.settings.PreferenceScreen -import app.revanced.patches.twitch.misc.settings.settingsPatch +import app.revanced.patches.twitch.misc.settings.Settings -val audioAdsPatch = bytecodePatch( - name = "Block audio ads", +val `Block audio ads` by creatingBytecodePatch( description = "Blocks audio ads in streams and VODs.", ) { dependsOn( sharedExtensionPatch, - settingsPatch, + Settings, addResourcesPatch, ) diff --git a/patches/src/main/kotlin/app/revanced/patches/twitch/ad/embedded/EmbeddedAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/twitch/ad/embedded/EmbeddedAdsPatch.kt index d37f78d4a..4757e189f 100644 --- a/patches/src/main/kotlin/app/revanced/patches/twitch/ad/embedded/EmbeddedAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/twitch/ad/embedded/EmbeddedAdsPatch.kt @@ -1,22 +1,21 @@ package app.revanced.patches.twitch.ad.embedded import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.shared.misc.settings.preference.ListPreference -import app.revanced.patches.twitch.ad.video.videoAdsPatch +import app.revanced.patches.twitch.ad.video.`Block video ads` import app.revanced.patches.twitch.misc.extension.sharedExtensionPatch import app.revanced.patches.twitch.misc.settings.PreferenceScreen -import app.revanced.patches.twitch.misc.settings.settingsPatch +import app.revanced.patches.twitch.misc.settings.Settings -val embeddedAdsPatch = bytecodePatch( - name = "Block embedded ads", +val `Block embedded ads` by creatingBytecodePatch( description = "Blocks embedded stream ads using services like Luminous or PurpleAdBlocker.", ) { dependsOn( - videoAdsPatch, + `Block video ads`, sharedExtensionPatch, - settingsPatch, + Settings, ) compatibleWith("tv.twitch.android.app"("16.9.1", "25.3.0")) diff --git a/patches/src/main/kotlin/app/revanced/patches/twitch/ad/video/VideoAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/twitch/ad/video/VideoAdsPatch.kt index f1fcfe635..3ea81ce17 100644 --- a/patches/src/main/kotlin/app/revanced/patches/twitch/ad/video/VideoAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/twitch/ad/video/VideoAdsPatch.kt @@ -1,10 +1,10 @@ package app.revanced.patches.twitch.ad.video +import app.revanced.patcher.extensions.ExternalLabel import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.addInstructionsWithLabels import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patcher.extensions.ExternalLabel +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference @@ -12,10 +12,9 @@ import app.revanced.patches.twitch.ad.shared.util.ReturnMethod import app.revanced.patches.twitch.ad.shared.util.adPatch import app.revanced.patches.twitch.misc.extension.sharedExtensionPatch import app.revanced.patches.twitch.misc.settings.PreferenceScreen -import app.revanced.patches.twitch.misc.settings.settingsPatch +import app.revanced.patches.twitch.misc.settings.Settings -val videoAdsPatch = bytecodePatch( - name = "Block video ads", +val `Block video ads` by creatingBytecodePatch( description = "Blocks video ads in streams and VODs.", ) { val conditionCall = "Lapp/revanced/extension/twitch/patches/VideoAdsPatch;->shouldBlockVideoAds()Z" @@ -23,7 +22,7 @@ val videoAdsPatch = bytecodePatch( dependsOn( sharedExtensionPatch, - settingsPatch, + Settings, addResourcesPatch, adPatch(conditionCall, skipLabelName) { createConditionInstructions, blockMethods -> diff --git a/patches/src/main/kotlin/app/revanced/patches/twitch/chat/antidelete/ShowDeletedMessagesPatch.kt b/patches/src/main/kotlin/app/revanced/patches/twitch/chat/antidelete/ShowDeletedMessagesPatch.kt index 0954a5323..6b615c89f 100644 --- a/patches/src/main/kotlin/app/revanced/patches/twitch/chat/antidelete/ShowDeletedMessagesPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/twitch/chat/antidelete/ShowDeletedMessagesPatch.kt @@ -1,24 +1,23 @@ package app.revanced.patches.twitch.chat.antidelete +import app.revanced.patcher.extensions.ExternalLabel import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.addInstructionsWithLabels import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patcher.extensions.ExternalLabel +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.ListPreference import app.revanced.patches.twitch.misc.extension.sharedExtensionPatch import app.revanced.patches.twitch.misc.settings.PreferenceScreen -import app.revanced.patches.twitch.misc.settings.settingsPatch +import app.revanced.patches.twitch.misc.settings.Settings -val showDeletedMessagesPatch = bytecodePatch( - name = "Show deleted messages", +val `Show deleted messages` by creatingBytecodePatch( description = "Shows deleted chat messages behind a clickable spoiler.", ) { dependsOn( sharedExtensionPatch, - settingsPatch, + Settings, addResourcesPatch, ) diff --git a/patches/src/main/kotlin/app/revanced/patches/twitch/chat/autoclaim/AutoClaimChannelPointsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/twitch/chat/autoclaim/AutoClaimChannelPointsPatch.kt index 59534f0dc..c97c78aa5 100644 --- a/patches/src/main/kotlin/app/revanced/patches/twitch/chat/autoclaim/AutoClaimChannelPointsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/twitch/chat/autoclaim/AutoClaimChannelPointsPatch.kt @@ -4,19 +4,18 @@ import app.revanced.patcher.extensions.ExternalLabel import app.revanced.patcher.extensions.addInstructionsWithLabels import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.instructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference import app.revanced.patches.twitch.misc.settings.PreferenceScreen -import app.revanced.patches.twitch.misc.settings.settingsPatch +import app.revanced.patches.twitch.misc.settings.Settings -val autoClaimChannelPointsPatch = bytecodePatch( - name = "Auto claim channel points", +val `Auto claim channel points` by creatingBytecodePatch( description = "Automatically claim Channel Points.", ) { dependsOn( - settingsPatch, + Settings, addResourcesPatch, ) diff --git a/patches/src/main/kotlin/app/revanced/patches/twitch/debug/DebugModePatch.kt b/patches/src/main/kotlin/app/revanced/patches/twitch/debug/DebugModePatch.kt index f3ead1743..7f946d6be 100644 --- a/patches/src/main/kotlin/app/revanced/patches/twitch/debug/DebugModePatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/twitch/debug/DebugModePatch.kt @@ -1,22 +1,21 @@ package app.revanced.patches.twitch.debug import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference import app.revanced.patches.twitch.misc.extension.sharedExtensionPatch import app.revanced.patches.twitch.misc.settings.PreferenceScreen -import app.revanced.patches.twitch.misc.settings.settingsPatch +import app.revanced.patches.twitch.misc.settings.Settings -val debugModePatch = bytecodePatch( - name = "Debug mode", +val `Debug mode` by creatingBytecodePatch( description = "Enables Twitch's internal debugging mode.", use = false, ) { dependsOn( sharedExtensionPatch, - settingsPatch, + Settings, addResourcesPatch, ) diff --git a/patches/src/main/kotlin/app/revanced/patches/twitch/misc/settings/SettingsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/twitch/misc/settings/SettingsPatch.kt index 7fe6d21f5..c53c0f159 100644 --- a/patches/src/main/kotlin/app/revanced/patches/twitch/misc/settings/SettingsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/twitch/misc/settings/SettingsPatch.kt @@ -1,23 +1,19 @@ package app.revanced.patches.twitch.misc.settings import app.revanced.patcher.Fingerprint +import app.revanced.patcher.extensions.ExternalLabel import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.addInstructionsWithLabels import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch -import com.android.tools.smali.dexlib2.mutable.MutableField.Companion.toMutable -import app.revanced.patcher.extensions.ExternalLabel +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch -import app.revanced.patches.shared.misc.settings.preference.BasePreference -import app.revanced.patches.shared.misc.settings.preference.BasePreferenceScreen -import app.revanced.patches.shared.misc.settings.preference.NonInteractivePreference -import app.revanced.patches.shared.misc.settings.preference.PreferenceCategory -import app.revanced.patches.shared.misc.settings.preference.SwitchPreference +import app.revanced.patches.shared.misc.settings.preference.* import app.revanced.patches.shared.misc.settings.settingsPatch import app.revanced.patches.twitch.misc.extension.sharedExtensionPatch import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.immutable.ImmutableField +import com.android.tools.smali.dexlib2.mutable.MutableField.Companion.toMutable private const val REVANCED_SETTINGS_MENU_ITEM_NAME = "RevancedSettings" private const val REVANCED_SETTINGS_MENU_ITEM_ID = 0x7 @@ -38,8 +34,7 @@ fun addSettingPreference(screen: BasePreference) { preferences += screen } -val settingsPatch = bytecodePatch( - name = "Settings", +val Settings by creatingBytecodePatch( description = "Adds settings menu to Twitch.", ) { dependsOn( @@ -103,9 +98,9 @@ val settingsPatch = bytecodePatch( name, MENU_ITEM_ENUM_CLASS_DESCRIPTOR, AccessFlags.PUBLIC.value or - AccessFlags.FINAL.value or - AccessFlags.ENUM.value or - AccessFlags.STATIC.value, + AccessFlags.FINAL.value or + AccessFlags.ENUM.value or + AccessFlags.STATIC.value, null, null, null, diff --git a/patches/src/main/kotlin/app/revanced/patches/twitter/interaction/downloads/UnlockDownloadsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/twitter/interaction/downloads/UnlockDownloadsPatch.kt index 03bbc9f54..ee54e98bc 100644 --- a/patches/src/main/kotlin/app/revanced/patches/twitter/interaction/downloads/UnlockDownloadsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/twitter/interaction/downloads/UnlockDownloadsPatch.kt @@ -1,20 +1,14 @@ package app.revanced.patches.twitter.interaction.downloads import app.revanced.patcher.Fingerprint -import app.revanced.patcher.extensions.addInstruction -import app.revanced.patcher.extensions.addInstructionsWithLabels -import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.extensions.instructions -import app.revanced.patcher.extensions.removeInstruction -import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patcher.extensions.ExternalLabel +import app.revanced.patcher.extensions.* +import app.revanced.patcher.patch.creatingBytecodePatch import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction @Suppress("unused") -val unlockDownloadsPatch = bytecodePatch( - name = "Unlock downloads", +val `Unlock downloads` by creatingBytecodePatch( description = "Unlocks the ability to download any video. GIFs can be downloaded via the menu on long press.", ) { compatibleWith("com.twitter.android") diff --git a/patches/src/main/kotlin/app/revanced/patches/twitter/layout/viewcount/HideViewCountPatch.kt b/patches/src/main/kotlin/app/revanced/patches/twitter/layout/viewcount/HideViewCountPatch.kt index d95a340ab..621f56fda 100644 --- a/patches/src/main/kotlin/app/revanced/patches/twitter/layout/viewcount/HideViewCountPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/twitter/layout/viewcount/HideViewCountPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.twitter.layout.viewcount -import app.revanced.patcher.patch.bytecodePatch import app.revanced.util.returnEarly +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val hideViewCountPatch = bytecodePatch( - name = "Hide view count", +val `Hide view count` by creatingBytecodePatch( description = "Hides the view count of Posts.", use = false, ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/twitter/misc/dynamiccolor/DynamicColorPatch.kt b/patches/src/main/kotlin/app/revanced/patches/twitter/misc/dynamiccolor/DynamicColorPatch.kt index 2802c9caf..d7dbd9b80 100644 --- a/patches/src/main/kotlin/app/revanced/patches/twitter/misc/dynamiccolor/DynamicColorPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/twitter/misc/dynamiccolor/DynamicColorPatch.kt @@ -1,13 +1,12 @@ package app.revanced.patches.twitter.misc.dynamiccolor import app.revanced.patcher.patch.PatchException -import app.revanced.patcher.patch.resourcePatch +import app.revanced.patcher.patch.creatingResourcePatch import java.io.FileWriter import java.nio.file.Files @Suppress("unused") -val dynamicColorPatch = resourcePatch( - name = "Dynamic color", +val `Dynamic color` by creatingResourcePatch( description = "Replaces the default X (Formerly Twitter) Blue with the user's Material You palette.", ) { compatibleWith( diff --git a/patches/src/main/kotlin/app/revanced/patches/twitter/misc/hook/HookPatch.kt b/patches/src/main/kotlin/app/revanced/patches/twitter/misc/hook/HookPatch.kt index 837b12937..c545379b0 100644 --- a/patches/src/main/kotlin/app/revanced/patches/twitter/misc/hook/HookPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/twitter/misc/hook/HookPatch.kt @@ -8,7 +8,7 @@ import app.revanced.patches.twitter.misc.hook.json.jsonHookPatch fun hookPatch( name: String, hookClassDescriptor: String, -) = bytecodePatch(name) { +) = bytecodePatch(name) { // TODO: NAME dependsOn(jsonHookPatch) compatibleWith( diff --git a/patches/src/main/kotlin/app/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainPatch.kt b/patches/src/main/kotlin/app/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainPatch.kt index 4ece6e636..b29a77771 100644 --- a/patches/src/main/kotlin/app/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainPatch.kt @@ -3,7 +3,7 @@ package app.revanced.patches.twitter.misc.links import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.replaceInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.stringOption import app.revanced.patches.twitter.misc.extension.sharedExtensionPatch import app.revanced.util.indexOfFirstInstructionOrThrow @@ -59,8 +59,7 @@ internal val changeLinkSharingDomainResourcePatch = resourcePatch { */ @Suppress("unused") -val changeLinkSharingDomainPatch = bytecodePatch( - name = "Change link sharing domain", +val `Change link sharing domain` by creatingBytecodePatch( description = "Replaces the domain name of shared links. Using this patch can prevent making posts that quote other posts.", use = false ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/viber/ads/HideAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/viber/ads/HideAdsPatch.kt index 8559b5176..fa95d6ffe 100644 --- a/patches/src/main/kotlin/app/revanced/patches/viber/ads/HideAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/viber/ads/HideAdsPatch.kt @@ -2,7 +2,7 @@ package app.revanced.patches.viber.ads import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.fingerprint -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.indexOfFirstInstructionReversedOrThrow import app.revanced.util.returnEarly import com.android.tools.smali.dexlib2.Opcode @@ -10,20 +10,20 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.reference.TypeReference @Suppress("unused") -val hideAdsPatch = bytecodePatch( - name = "Hide Ads", +val `Hide Ads` by creatingBytecodePatch( description = "Hides ad banners between chats.", ) { compatibleWith("com.viber.voip"("25.9.2.0", "26.1.2.0")) apply { val method = findAdStringFingerprint.method - + // Find the ads free string index val stringIndex = findAdStringFingerprint.stringMatches.first().index // Search backwards from the string to find the `new-instance` (TypeReference) instruction - val typeRefIndex = method.indexOfFirstInstructionReversedOrThrow(stringIndex) { this.opcode == Opcode.NEW_INSTANCE } + val typeRefIndex = + method.indexOfFirstInstructionReversedOrThrow(stringIndex) { this.opcode == Opcode.NEW_INSTANCE } // Get the class name from the TypeReference val targetClass = method.getInstruction(typeRefIndex).reference as TypeReference diff --git a/patches/src/main/kotlin/app/revanced/patches/warnwetter/misc/promocode/PromoCodeUnlockPatch.kt b/patches/src/main/kotlin/app/revanced/patches/warnwetter/misc/promocode/PromoCodeUnlockPatch.kt index 6799691d4..5c97fa348 100644 --- a/patches/src/main/kotlin/app/revanced/patches/warnwetter/misc/promocode/PromoCodeUnlockPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/warnwetter/misc/promocode/PromoCodeUnlockPatch.kt @@ -1,12 +1,11 @@ package app.revanced.patches.warnwetter.misc.promocode import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.warnwetter.misc.firebasegetcert.firebaseGetCertPatch @Suppress("unused") -val promoCodeUnlockPatch = bytecodePatch( - name = "Promo code unlock", +val `Promo code unlock` by creatingBytecodePatch( description = "Disables the validation of promo code. Any code will work to unlock all features.", ) { dependsOn(firebaseGetCertPatch) diff --git a/patches/src/main/kotlin/app/revanced/patches/willhaben/ads/HideAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/willhaben/ads/HideAdsPatch.kt index ac8900c7c..663debd83 100644 --- a/patches/src/main/kotlin/app/revanced/patches/willhaben/ads/HideAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/willhaben/ads/HideAdsPatch.kt @@ -1,11 +1,10 @@ package app.revanced.patches.willhaben.ads -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.util.returnEarly @Suppress("unused") -internal val hideAdsPatch = bytecodePatch( - name = "Hide ads", +internal val `Hide ads` by creatingBytecodePatch( description = "Hides all in-app ads.", ) { compatibleWith("at.willhaben") diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt index 38aaa6599..1f552ca7d 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt @@ -4,7 +4,7 @@ import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.instructions import app.revanced.patcher.extensions.replaceInstruction import app.revanced.patcher.extensions.wideLiteral -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.resourcePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch @@ -62,8 +62,7 @@ private val hideAdsResourcePatch = resourcePatch { } @Suppress("unused") -val hideAdsPatch = bytecodePatch( - name = "Hide ads", +val `Hide ads` by creatingBytecodePatch( description = "Adds options to remove general ads.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt index 9621b567a..2353f276d 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt @@ -1,9 +1,9 @@ package app.revanced.patches.youtube.ad.video +import app.revanced.patcher.extensions.ExternalLabel import app.revanced.patcher.extensions.addInstructionsWithLabels import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patcher.extensions.ExternalLabel +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference @@ -11,8 +11,7 @@ import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch import app.revanced.patches.youtube.misc.settings.PreferenceScreen import app.revanced.patches.youtube.misc.settings.settingsPatch -val videoAdsPatch = bytecodePatch( - name = "Video ads", +val `Video ads` by creatingBytecodePatch( description = "Adds an option to remove ads in the video player.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlPatch.kt index f479d7330..6c35666dc 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlPatch.kt @@ -1,6 +1,6 @@ package app.revanced.patches.youtube.interaction.copyvideourl -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.resourcePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch @@ -41,8 +41,7 @@ private val copyVideoUrlResourcePatch = resourcePatch { } @Suppress("unused") -val copyVideoUrlPatch = bytecodePatch( - name = "Copy video URL", +val `Copy video URL` by creatingBytecodePatch( description = "Adds options to display buttons in the video player to copy video URLs.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt index 666e5fb8b..091b3fc81 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt @@ -2,7 +2,7 @@ package app.revanced.patches.youtube.interaction.dialog import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.replaceInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference @@ -11,12 +11,12 @@ import app.revanced.patches.youtube.misc.settings.PreferenceScreen import app.revanced.patches.youtube.misc.settings.settingsPatch import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction -private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/RemoveViewerDiscretionDialogPatch;" +private const val EXTENSION_CLASS_DESCRIPTOR = + "Lapp/revanced/extension/youtube/patches/RemoveViewerDiscretionDialogPatch;" -val removeViewerDiscretionDialogPatch = bytecodePatch( - name = "Remove viewer discretion dialog", +val `Remove viewer discretion dialog` by creatingBytecodePatch( description = "Adds an option to remove the dialog that appears when opening a video that has been age-restricted " + - "by accepting it automatically. This does not bypass the age restriction.", + "by accepting it automatically. This does not bypass the age restriction.", ) { dependsOn( sharedExtensionPatch, @@ -42,7 +42,7 @@ val removeViewerDiscretionDialogPatch = bytecodePatch( createDialogFingerprint.let { it.method.apply { - val showDialogIndex = it.instructionMatches.last().index + val showDialogIndex = it.instructionMatches.last().index // TODO val dialogRegister = getInstruction(showDialogIndex).registerC replaceInstructions( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/doubletap/DisableChapterSkipDoubleTapPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/doubletap/DisableChapterSkipDoubleTapPatch.kt index fd7f3b1f9..94d2c89ed 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/doubletap/DisableChapterSkipDoubleTapPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/doubletap/DisableChapterSkipDoubleTapPatch.kt @@ -2,7 +2,7 @@ package app.revanced.patches.youtube.interaction.doubletap import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.fingerprint -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference @@ -14,13 +14,13 @@ import app.revanced.patches.youtube.misc.settings.settingsPatch import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode import java.util.logging.Logger +import kotlin.jvm.java private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/DisableDoubleTapActionsPatch;" @Suppress("unused") -val disableDoubleTapActionsPatch = bytecodePatch( - name = "Disable double tap actions", +val `Disable double tap actions` by creatingBytecodePatch( description = "Adds an option to disable player double tap gestures.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt index 66c80fc4c..76347f082 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt @@ -2,7 +2,7 @@ package app.revanced.patches.youtube.interaction.downloads import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.addInstructionsWithLabels -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.resourcePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch @@ -60,10 +60,9 @@ private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/ internal const val BUTTON_DESCRIPTOR = "Lapp/revanced/extension/youtube/videoplayer/ExternalDownloadButton;" @Suppress("unused") -val downloadsPatch = bytecodePatch( - name = "Downloads", +val Downloads by creatingBytecodePatch( description = "Adds support to download videos with an external downloader app " + - "using the in-app download button or a video player action button.", + "using the in-app download button or a video player action button.", ) { dependsOn( downloadsResourcePatch, diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/SeekbarPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/SeekbarPatch.kt index 097adac58..49b8abc47 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/SeekbarPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/SeekbarPatch.kt @@ -1,10 +1,9 @@ package app.revanced.patches.youtube.interaction.seekbar -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch @Suppress("unused") -val seekbarPatch = bytecodePatch( - name = "Seekbar", +val Seekbar by creatingBytecodePatch( description = "Adds options to disable precise seeking when swiping up on the seekbar, " + "slide to seek instead of playing at 2x speed when pressing and holding, " + "tapping the player seekbar to seek, " + diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsPatch.kt index a251df4a2..ee648e693 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsPatch.kt @@ -1,8 +1,7 @@ package app.revanced.patches.youtube.interaction.swipecontrols -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.resourcePatch -import com.android.tools.smali.dexlib2.mutable.MutableMethod.Companion.toMutable import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.InputType @@ -21,8 +20,10 @@ import app.revanced.patches.youtube.shared.mainActivityConstructorFingerprint import app.revanced.util.* import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.immutable.ImmutableMethod +import com.android.tools.smali.dexlib2.mutable.MutableMethod.Companion.toMutable -internal const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/swipecontrols/SwipeControlsHostActivity;" +internal const val EXTENSION_CLASS_DESCRIPTOR = + "Lapp/revanced/extension/youtube/swipecontrols/SwipeControlsHostActivity;" private val swipeControlsResourcePatch = resourcePatch { dependsOn( @@ -52,12 +53,16 @@ private val swipeControlsResourcePatch = resourcePatch { SwitchPreference("revanced_swipe_lowest_value_enable_auto_brightness"), ListPreference("revanced_swipe_overlay_style"), TextPreference("revanced_swipe_overlay_background_opacity", inputType = InputType.NUMBER), - TextPreference("revanced_swipe_overlay_progress_brightness_color", + TextPreference( + "revanced_swipe_overlay_progress_brightness_color", tag = "app.revanced.extension.shared.settings.preference.ColorPickerWithOpacitySliderPreference", - inputType = InputType.TEXT_CAP_CHARACTERS), - TextPreference("revanced_swipe_overlay_progress_volume_color", + inputType = InputType.TEXT_CAP_CHARACTERS + ), + TextPreference( + "revanced_swipe_overlay_progress_volume_color", tag = "app.revanced.extension.shared.settings.preference.ColorPickerWithOpacitySliderPreference", - inputType = InputType.TEXT_CAP_CHARACTERS), + inputType = InputType.TEXT_CAP_CHARACTERS + ), TextPreference("revanced_swipe_text_overlay_size", inputType = InputType.NUMBER), TextPreference("revanced_swipe_overlay_timeout", inputType = InputType.NUMBER), TextPreference("revanced_swipe_threshold", inputType = InputType.NUMBER), @@ -83,8 +88,7 @@ private val swipeControlsResourcePatch = resourcePatch { } @Suppress("unused") -val swipeControlsPatch = bytecodePatch( - name = "Swipe controls", +val `Swipe controls` by creatingBytecodePatch( description = "Adds options to enable and configure volume and brightness swipe controls.", ) { dependsOn( @@ -132,7 +136,7 @@ val swipeControlsPatch = bytecodePatch( if (is_19_43_or_greater && !is_20_34_or_greater) { swipeChangeVideoFingerprint.let { it.method.insertLiteralOverride( - it.instructionMatches.last().index, + it.instructionMatches.last().index, // TODO "$EXTENSION_CLASS_DESCRIPTOR->allowSwipeChangeVideo(Z)Z" ) } diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt index 9964909e0..f6a240740 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt @@ -1,7 +1,7 @@ package app.revanced.patches.youtube.layout.autocaptions import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference @@ -12,8 +12,7 @@ import app.revanced.patches.youtube.misc.settings.settingsPatch private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/DisableAutoCaptionsPatch;" -val autoCaptionsPatch = bytecodePatch( - name = "Disable auto captions", +val `Disable auto captions` by creatingBytecodePatch( description = "Adds an option to disable captions from being automatically enabled.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/branding/header/ChangeHeaderPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/branding/header/ChangeHeaderPatch.kt index 97eb235c6..853230052 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/branding/header/ChangeHeaderPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/branding/header/ChangeHeaderPatch.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.wideLiteral import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patcher.patch.resourcePatch +import app.revanced.patcher.patch.creatingResourcePatch import app.revanced.patcher.patch.stringOption import app.revanced.patcher.util.Document import app.revanced.patches.all.misc.resources.addResources @@ -94,8 +94,7 @@ private val changeHeaderBytecodePatch = bytecodePatch { } @Suppress("unused") -val changeHeaderPatch = resourcePatch( - name = "Change header", +val `Change header` by creatingResourcePatch( description = "Adds an option to change the header logo in the top left corner of the app.", ) { dependsOn(addResourcesPatch, changeHeaderBytecodePatch) diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt index 3f52e5059..3972b3e2d 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt @@ -1,6 +1,6 @@ package app.revanced.patches.youtube.layout.buttons.action -import app.revanced.patcher.patch.resourcePatch +import app.revanced.patcher.patch.creatingResourcePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.mapping.resourceMappingPatch @@ -13,8 +13,7 @@ import app.revanced.patches.youtube.misc.playservice.versionCheckPatch import app.revanced.patches.youtube.misc.settings.PreferenceScreen import java.util.logging.Logger -val hideButtonsPatch = resourcePatch( - name = "Hide video action buttons", +val `Hide video action buttons` by creatingResourcePatch( description = "Adds options to hide action buttons (such as the Download button) under videos.", ) { dependsOn( @@ -41,7 +40,7 @@ val hideButtonsPatch = resourcePatch( SwitchPreference("revanced_hide_download_button"), SwitchPreference("revanced_hide_like_dislike_button"), SwitchPreference("revanced_hide_comments_button"), - SwitchPreference("revanced_hide_save_button"), + SwitchPreference("revanced_hide_save_button"), ) if (is_20_22_or_greater) { diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt index 62c8bea9a..f4b8c41b4 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt @@ -3,7 +3,7 @@ package app.revanced.patches.youtube.layout.buttons.navigation import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.PreferenceScreenPreference @@ -24,8 +24,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/NavigationButtonsPatch;" -val navigationButtonsPatch = bytecodePatch( - name = "Navigation buttons", +val `Navigation buttons` by creatingBytecodePatch( description = "Adds options to hide and change navigation buttons (such as the Shorts button).", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/overlay/HidePlayerOverlayButtonsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/overlay/HidePlayerOverlayButtonsPatch.kt index 2830e54a6..dd18b5c2b 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/overlay/HidePlayerOverlayButtonsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/overlay/HidePlayerOverlayButtonsPatch.kt @@ -1,11 +1,7 @@ package app.revanced.patches.youtube.layout.buttons.overlay -import app.revanced.patcher.extensions.addInstruction -import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.extensions.addInstructionsWithLabels -import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patcher.extensions.ExternalLabel +import app.revanced.patcher.extensions.* +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.mapping.resourceMappingPatch @@ -17,11 +13,7 @@ import app.revanced.patches.youtube.misc.settings.PreferenceScreen import app.revanced.patches.youtube.misc.settings.settingsPatch import app.revanced.patches.youtube.shared.layoutConstructorFingerprint import app.revanced.patches.youtube.shared.subtitleButtonControllerFingerprint -import app.revanced.util.findFreeRegister -import app.revanced.util.getReference -import app.revanced.util.indexOfFirstInstructionOrThrow -import app.revanced.util.indexOfFirstResourceIdOrThrow -import app.revanced.util.insertLiteralOverride +import app.revanced.util.* import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @@ -30,10 +22,9 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/HidePlayerOverlayButtonsPatch;" -val hidePlayerOverlayButtonsPatch = bytecodePatch( - name = "Hide player overlay buttons", +val `Hide player overlay buttons` by creatingBytecodePatch( description = "Adds options to hide the player Cast, Autoplay, Captions, Previous & Next buttons, and the player " + - "control buttons background.", + "control buttons background.", ) { dependsOn( sharedExtensionPatch, @@ -131,8 +122,8 @@ val hidePlayerOverlayButtonsPatch = bytecodePatch( val gotoIndex = indexOfFirstInstructionOrThrow(constIndex) { val parameterTypes = getReference()?.parameterTypes opcode == Opcode.INVOKE_VIRTUAL && - parameterTypes?.size == 2 && - parameterTypes.first() == "Landroid/view/ViewStub;" + parameterTypes?.size == 2 && + parameterTypes.first() == "Landroid/view/ViewStub;" } + 1 addInstructionsWithLabels( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/formfactor/ChangeFormFactorPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/formfactor/ChangeFormFactorPatch.kt index 44135b146..b9b2d1d34 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/formfactor/ChangeFormFactorPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/formfactor/ChangeFormFactorPatch.kt @@ -5,11 +5,12 @@ import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.fieldAccess import app.revanced.patcher.fingerprint -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.instructions +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.ListPreference -import app.revanced.patches.youtube.layout.buttons.navigation.navigationButtonsPatch +import app.revanced.patches.youtube.layout.buttons.navigation.`Navigation buttons` import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch import app.revanced.patches.youtube.misc.navigation.hookNavigationButtonCreated import app.revanced.patches.youtube.misc.settings.PreferenceScreen @@ -20,15 +21,14 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/ChangeFormFactorPatch;" @Suppress("unused") -val changeFormFactorPatch = bytecodePatch( - name = "Change form factor", +val `Change form factor` by creatingBytecodePatch( description = "Adds an option to change the UI appearance to a phone, tablet, or automotive device.", ) { dependsOn( sharedExtensionPatch, settingsPatch, addResourcesPatch, - navigationButtonsPatch + `Navigation buttons` ) compatibleWith( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndScreenCardsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndScreenCardsPatch.kt index 39c83c283..2aaa40977 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndScreenCardsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndScreenCardsPatch.kt @@ -3,7 +3,7 @@ package app.revanced.patches.youtube.layout.hide.endscreencards import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.addInstructionsWithLabels import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.resourcePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch @@ -50,8 +50,7 @@ private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/HideEndScreenCardsPatch;" @Suppress("unused") -val hideEndScreenCardsPatch = bytecodePatch( - name = "Hide end screen cards", +val `Hide end screen cards` by creatingBytecodePatch( description = "Adds an option to hide suggested video cards at the end of videos.", ) { dependsOn( @@ -76,7 +75,7 @@ val hideEndScreenCardsPatch = bytecodePatch( layoutVideoFingerprint, ).forEach { fingerprint -> fingerprint.method.apply { - val insertIndex = fingerprint.instructionMatches.last().index + 1 + val insertIndex = fingerprint.instructionMatches.last().index + 1 // TODO val viewRegister = getInstruction(insertIndex - 1).registerA addInstruction( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreensuggestion/HideEndScreenSuggestedVideoPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreensuggestion/HideEndScreenSuggestedVideoPatch.kt index befd222dd..1b7ac0091 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreensuggestion/HideEndScreenSuggestedVideoPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreensuggestion/HideEndScreenSuggestedVideoPatch.kt @@ -1,9 +1,9 @@ package app.revanced.patches.youtube.layout.hide.endscreensuggestion +import app.revanced.patcher.extensions.ExternalLabel import app.revanced.patcher.extensions.addInstructionsWithLabels import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patcher.extensions.ExternalLabel +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference @@ -20,8 +20,7 @@ private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/HideEndScreenSuggestedVideoPatch;" @Suppress("unused") -val hideEndScreenSuggestedVideoPatch = bytecodePatch( - name = "Hide end screen suggested video", +val `Hide end screen suggested video` by creatingBytecodePatch( description = "Adds an option to hide the suggested video at the end of videos.", ) { dependsOn( @@ -46,7 +45,7 @@ val hideEndScreenSuggestedVideoPatch = bytecodePatch( ) removeOnLayoutChangeListenerFingerprint.let { - val endScreenMethod = navigate(it.originalMethod).to(it.instructionMatches.last().index).stop() + val endScreenMethod = navigate(it.originalMethod).to(it.instructionMatches.last().index).stop() // TODO endScreenMethod.apply { val autoNavStatusMethodName = autoNavStatusFingerprint.match( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt index c5af0b303..b8fa62576 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt @@ -2,7 +2,7 @@ package app.revanced.patches.youtube.layout.hide.fullscreenambientmode import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference @@ -17,8 +17,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/DisableFullscreenAmbientModePatch;" -val disableFullscreenAmbientModePatch = bytecodePatch( - name = "Disable fullscreen ambient mode", +val `Disable fullscreen ambient mode` by creatingBytecodePatch( description = "Adds an option to disable the ambient mode when in fullscreen.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index ccf17875c..319678fc0 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -1,9 +1,8 @@ package app.revanced.patches.youtube.layout.hide.general import app.revanced.patcher.Fingerprint -import app.revanced.patcher.Match import app.revanced.patcher.extensions.* -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.resourcePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch @@ -81,11 +80,10 @@ private const val CUSTOM_FILTER_CLASS_NAME = private const val KEYWORD_FILTER_CLASS_NAME = "Lapp/revanced/extension/youtube/patches/components/KeywordContentFilter;" -val hideLayoutComponentsPatch = bytecodePatch( - name = "Hide layout components", +val `Hide layout components` by creatingBytecodePatch( description = "Adds options to hide general layout components.", -) { + ) { dependsOn( lithoFilterPatch, settingsPatch, @@ -315,7 +313,7 @@ val hideLayoutComponentsPatch = bytecodePatch( addInstruction( insertIndex, "invoke-static {v$objectRegister}, $LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR" + - "->hideCrowdfundingBox(Landroid/view/View;)V", + "->hideCrowdfundingBox(Landroid/view/View;)V", ) } } @@ -333,7 +331,7 @@ val hideLayoutComponentsPatch = bytecodePatch( addInstruction( insertIndex, "invoke-static { v$register }, $LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR" + - "->hideAlbumCard(Landroid/view/View;)V", + "->hideAlbumCard(Landroid/view/View;)V", ) } } @@ -448,7 +446,7 @@ val hideLayoutComponentsPatch = bytecodePatch( relatedChipCloudFingerprint.patch(1) { register -> "invoke-static { v$register }, " + - "$LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR->hideInRelatedVideos(Landroid/view/View;)V" + "$LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR->hideInRelatedVideos(Landroid/view/View;)V" } } } diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt index 3262bde67..e0e908702 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt @@ -4,7 +4,7 @@ import app.revanced.patcher.extensions.ExternalLabel import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.addInstructionsWithLabels import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.resourcePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch @@ -35,8 +35,7 @@ private val hideInfocardsResourcePatch = resourcePatch { } @Suppress("unused") -val hideInfoCardsPatch = bytecodePatch( - name = "Hide info cards", +val `Hide info cards` by creatingBytecodePatch( description = "Adds an option to hide info cards that creators add in the video player.", ) { dependsOn( @@ -67,13 +66,13 @@ val hideInfoCardsPatch = bytecodePatch( infocardsIncognitoFingerprint.match(infocardsIncognitoParentFingerprint.originalClassDef).method.apply { val invokeInstructionIndex = implementation!!.instructions.indexOfFirst { it.opcode.ordinal == Opcode.INVOKE_VIRTUAL.ordinal && - ((it as ReferenceInstruction).reference.toString() == "Landroid/view/View;->setVisibility(I)V") + ((it as ReferenceInstruction).reference.toString() == "Landroid/view/View;->setVisibility(I)V") } addInstruction( invokeInstructionIndex, "invoke-static {v${getInstruction(invokeInstructionIndex).registerC}}," + - " Lapp/revanced/extension/youtube/patches/HideInfoCardsPatch;->hideInfoCardsIncognito(Landroid/view/View;)V", + " Lapp/revanced/extension/youtube/patches/HideInfoCardsPatch;->hideInfoCardsIncognito(Landroid/view/View;)V", ) } diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt index 636597777..a033e9002 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt @@ -1,6 +1,6 @@ package app.revanced.patches.youtube.layout.hide.player.flyoutmenupanel -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.PreferenceScreenPreference @@ -11,8 +11,7 @@ import app.revanced.patches.youtube.misc.playertype.playerTypeHookPatch import app.revanced.patches.youtube.misc.settings.PreferenceScreen import app.revanced.patches.youtube.misc.settings.settingsPatch -val hidePlayerFlyoutMenuPatch = bytecodePatch( - name = "Hide player flyout menu items", +val `Hide player flyout menu items` by creatingBytecodePatch( description = "Adds options to hide menu items that appear when pressing the gear icon in the video player.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/relatedvideooverlay/HideRelatedVideoOverlayPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/relatedvideooverlay/HideRelatedVideoOverlayPatch.kt index 4d41c5e09..4692972e9 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/relatedvideooverlay/HideRelatedVideoOverlayPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/relatedvideooverlay/HideRelatedVideoOverlayPatch.kt @@ -1,9 +1,9 @@ package app.revanced.patches.youtube.layout.hide.relatedvideooverlay +import app.revanced.patcher.extensions.ExternalLabel import app.revanced.patcher.extensions.addInstructionsWithLabels import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patcher.extensions.ExternalLabel +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.mapping.resourceMappingPatch @@ -16,8 +16,7 @@ private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/HideRelatedVideoOverlayPatch;" @Suppress("unused") -val hideRelatedVideoOverlayPatch = bytecodePatch( - name = "Hide related video overlay", +val `Hide related video overlay` by creatingBytecodePatch( description = "Adds an option to hide the related video overlay shown when swiping up in fullscreen.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt index f7cd529a3..7a60fda27 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt @@ -1,10 +1,10 @@ package app.revanced.patches.youtube.layout.hide.rollingnumber +import app.revanced.patcher.extensions.ExternalLabel import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.addInstructionsWithLabels import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patcher.extensions.ExternalLabel +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference @@ -17,8 +17,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/DisableRollingNumberAnimationsPatch;" -val disableRollingNumberAnimationPatch = bytecodePatch( - name = "Disable rolling number animations", +val `Disable rolling number animations` by creatingBytecodePatch( description = "Adds an option to disable rolling number animations of video view count, user likes, and upload time.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt index 6717c1eb1..903e84734 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt @@ -155,8 +155,7 @@ private val hideShortsComponentsResourcePatch = resourcePatch { private const val FILTER_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/components/ShortsFilter;" @Suppress("unused") -val hideShortsComponentsPatch = bytecodePatch( - name = "Hide Shorts components", +val `Hide Shorts componentsby creatingBytecodePatch( description = "Adds options to hide components related to Shorts.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/signintotvpopup/DisableSignInToTvPatchPopup.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/signintotvpopup/DisableSignInToTvPatchPopup.kt index cf9a990eb..399b4d1a8 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/signintotvpopup/DisableSignInToTvPatchPopup.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/signintotvpopup/DisableSignInToTvPatchPopup.kt @@ -1,7 +1,7 @@ package app.revanced.patches.youtube.layout.hide.signintotvpopup import app.revanced.patcher.extensions.addInstructionsWithLabels -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.mapping.resourceMappingPatch @@ -13,8 +13,7 @@ import app.revanced.patches.youtube.misc.settings.settingsPatch private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/DisableSignInToTvPopupPatch;" -val disableSignInToTvPopupPatch = bytecodePatch( - name = "Disable sign in to TV popup", +val `Disable sign in to TV popup` by creatingBytecodePatch( description = "Adds an option to disable the popup asking to sign into a TV on the same local network.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt index 796c68488..fc3f88c32 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt @@ -1,7 +1,7 @@ package app.revanced.patches.youtube.layout.hide.time import app.revanced.patcher.extensions.addInstructionsWithLabels -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference @@ -11,8 +11,7 @@ import app.revanced.patches.youtube.misc.settings.settingsPatch private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/HideTimestampPatch;" -val hideTimestampPatch = bytecodePatch( - name = "Hide timestamp", +val `Hide timestamp` by creatingBytecodePatch( description = "Adds an option to hide the timestamp in the bottom left of the video player.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index dda8e165e..1a3ab1858 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -7,7 +7,7 @@ import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.replaceInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.resourcePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch @@ -70,8 +70,7 @@ private val miniplayerResourcePatch = resourcePatch { private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/MiniplayerPatch;" @Suppress("unused") -val miniplayerPatch = bytecodePatch( - name = "Miniplayer", +val Miniplayer by creatingBytecodePatch( description = "Adds options to change the in-app minimized player.", ) { dependsOn( @@ -438,7 +437,7 @@ val miniplayerPatch = bytecodePatch( ).method.addInstruction( 0, "invoke-static { p1 }, $EXTENSION_CLASS_DESCRIPTOR->" + - "hideMiniplayerSubTexts(Landroid/view/View;)V", + "hideMiniplayerSubTexts(Landroid/view/View;)V", ) // Modern 2 has a broken overlay subtitle view that is always present. diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt index 55c005154..bacae8c47 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt @@ -1,7 +1,7 @@ package app.revanced.patches.youtube.layout.panels.popup import app.revanced.patcher.extensions.addInstructionsWithLabels -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference @@ -11,8 +11,7 @@ import app.revanced.patches.youtube.misc.settings.settingsPatch private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/DisablePlayerPopupPanelsPatch;" -val playerPopupPanelsPatch = bytecodePatch( - name = "Disable player popup panels", +val `Disable player popup panels` by creatingBytecodePatch( description = "Adds an option to disable panels (such as live chat) from opening automatically.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/fullscreen/ExitFullscreenPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/fullscreen/ExitFullscreenPatch.kt index a9c4b836d..f43024157 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/fullscreen/ExitFullscreenPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/fullscreen/ExitFullscreenPatch.kt @@ -1,6 +1,6 @@ package app.revanced.patches.youtube.layout.player.fullscreen -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.ListPreference @@ -16,8 +16,7 @@ import app.revanced.util.indexOfFirstInstructionReversedOrThrow import com.android.tools.smali.dexlib2.Opcode @Suppress("unused") -internal val exitFullscreenPatch = bytecodePatch( - name = "Exit fullscreen mode", +internal val `Exit fullscreen mode` by creatingBytecodePatch( description = "Adds options to automatically exit fullscreen mode when a video reaches the end." ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/fullscreen/OpenVideosFullscreenHookPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/fullscreen/OpenVideosFullscreenHookPatch.kt index 57b51d1e5..45ed7b101 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/fullscreen/OpenVideosFullscreenHookPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/fullscreen/OpenVideosFullscreenHookPatch.kt @@ -15,7 +15,7 @@ internal const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/OpenVideosFullscreenHookPatch;" /** - * Used by both [openVideosFullscreenPatch] and [`Open Shorts in regular player`]. + * Used by both [`Open videos fullscreen`] and [`Open Shorts in regular player`]. */ internal val openVideosFullscreenHookPatch = bytecodePatch { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/fullscreen/OpenVideosFullscreenPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/fullscreen/OpenVideosFullscreenPatch.kt index 7864e353f..a97bc076c 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/fullscreen/OpenVideosFullscreenPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/fullscreen/OpenVideosFullscreenPatch.kt @@ -1,6 +1,6 @@ package app.revanced.patches.youtube.layout.player.fullscreen -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference @@ -9,8 +9,7 @@ import app.revanced.patches.youtube.misc.settings.settingsPatch import app.revanced.util.returnEarly @Suppress("unused") -val openVideosFullscreenPatch = bytecodePatch( - name = "Open videos fullscreen", +val `Open videos fullscreen` by creatingBytecodePatch( description = "Adds an option to open videos in full screen portrait mode.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/overlay/CustomPlayerOverlayOpacityPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/overlay/CustomPlayerOverlayOpacityPatch.kt index d4c3e1962..eb2fd8165 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/overlay/CustomPlayerOverlayOpacityPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/overlay/CustomPlayerOverlayOpacityPatch.kt @@ -2,7 +2,7 @@ package app.revanced.patches.youtube.layout.player.overlay import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.mapping.resourceMappingPatch @@ -16,11 +16,11 @@ private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/CustomPlayerOverlayOpacityPatch;" @Suppress("unused") -val customPlayerOverlayOpacityPatch = bytecodePatch( - name = "Custom player overlay opacity", +val `Custom player overlay opacity` by creatingBytecodePatch( description = "Adds an option to change the opacity of the video player background when player controls are visible.", ) { - dependsOn(settingsPatch, + dependsOn( + settingsPatch, resourceMappingPatch, addResourcesPatch, ) diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt index b906dfeba..12c12acc3 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt @@ -3,7 +3,7 @@ package app.revanced.patches.youtube.layout.returnyoutubedislike import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.patch.PatchException -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.NonInteractivePreference @@ -14,11 +14,7 @@ import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch import app.revanced.patches.youtube.misc.litho.filter.addLithoFilter import app.revanced.patches.youtube.misc.litho.filter.lithoFilterPatch import app.revanced.patches.youtube.misc.playertype.playerTypeHookPatch -import app.revanced.patches.youtube.misc.playservice.is_19_33_or_greater -import app.revanced.patches.youtube.misc.playservice.is_20_07_or_greater -import app.revanced.patches.youtube.misc.playservice.is_20_10_or_greater -import app.revanced.patches.youtube.misc.playservice.is_20_41_or_greater -import app.revanced.patches.youtube.misc.playservice.versionCheckPatch +import app.revanced.patches.youtube.misc.playservice.* import app.revanced.patches.youtube.misc.settings.PreferenceScreen import app.revanced.patches.youtube.misc.settings.settingsPatch import app.revanced.patches.youtube.shared.conversionContextFingerprintToString @@ -26,11 +22,7 @@ import app.revanced.patches.youtube.shared.rollingNumberTextViewAnimationUpdateF import app.revanced.patches.youtube.video.videoid.hookPlayerResponseVideoId import app.revanced.patches.youtube.video.videoid.hookVideoId import app.revanced.patches.youtube.video.videoid.videoIdPatch -import app.revanced.util.addInstructionsAtControlFlowLabel -import app.revanced.util.findFreeRegister -import app.revanced.util.getReference -import app.revanced.util.indexOfFirstInstructionOrThrow -import app.revanced.util.returnLate +import app.revanced.util.* import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @@ -40,6 +32,7 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference import com.android.tools.smali.dexlib2.iface.reference.MethodReference import com.android.tools.smali.dexlib2.iface.reference.TypeReference import java.util.logging.Logger +import kotlin.jvm.java private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/ReturnYouTubeDislikePatch;" @@ -47,8 +40,7 @@ private const val EXTENSION_CLASS_DESCRIPTOR = private const val FILTER_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/components/ReturnYouTubeDislikeFilter;" -val returnYouTubeDislikePatch = bytecodePatch( - name = "Return YouTube Dislike", +val `Return YouTube Dislike` by creatingBytecodePatch( description = "Adds an option to show the dislike count of videos with Return YouTube Dislike.", ) { dependsOn( @@ -157,7 +149,7 @@ val returnYouTubeDislikePatch = bytecodePatch( } else { insertIndex = indexOfFirstInstructionOrThrow { opcode == Opcode.NEW_INSTANCE && - getReference()?.type == textDataClassType + getReference()?.type == textDataClassType } val charSequenceIndex = indexOfFirstInstructionOrThrow(insertIndex) { diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt index a2908444a..96914e9a8 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt @@ -2,7 +2,7 @@ package app.revanced.patches.youtube.layout.searchbar import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.mapping.resourceMappingPatch @@ -24,8 +24,7 @@ import java.util.logging.Logger private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/WideSearchbarPatch;" -val wideSearchbarPatch = bytecodePatch( - name = "Wide search bar", +val `Wide search bar` by creatingBytecodePatch( description = "Adds an option to replace the search icon with a wide search bar. " + "This will hide the YouTube logo when active.", ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockPatch.kt index 25361cc65..84503108a 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockPatch.kt @@ -3,7 +3,7 @@ package app.revanced.patches.youtube.layout.sponsorblock import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patcher.patch.resourcePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch @@ -27,11 +27,7 @@ import app.revanced.patches.youtube.video.information.videoInformationPatch import app.revanced.patches.youtube.video.information.videoTimeHook import app.revanced.patches.youtube.video.videoid.hookBackgroundPlayVideoId import app.revanced.patches.youtube.video.videoid.videoIdPatch -import app.revanced.util.ResourceGroup -import app.revanced.util.addInstructionsAtControlFlowLabel -import app.revanced.util.copyResources -import app.revanced.util.getReference -import app.revanced.util.indexOfFirstInstructionReversedOrThrow +import app.revanced.util.* import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction @@ -114,8 +110,7 @@ private const val EXTENSION_SPONSORBLOCK_VIEW_CONTROLLER_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/sponsorblock/ui/SponsorBlockViewController;" @Suppress("unused") -val sponsorBlockPatch = bytecodePatch( - name = "SponsorBlock", +val SponsorBlock by creatingBytecodePatch( description = "Adds options to enable and configure SponsorBlock, which can skip undesired video segments such as sponsored content.", ) { dependsOn( @@ -148,7 +143,7 @@ val sponsorBlockPatch = bytecodePatch( hookBackgroundPlayVideoId( EXTENSION_SEGMENT_PLAYBACK_CONTROLLER_CLASS_DESCRIPTOR + - "->setCurrentVideoId(Ljava/lang/String;)V", + "->setCurrentVideoId(Ljava/lang/String;)V", ) // Set seekbar draw rectangle. diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt index 699c4b914..dcc32e37a 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt @@ -1,10 +1,10 @@ package app.revanced.patches.youtube.layout.spoofappversion +import app.revanced.patcher.extensions.ExternalLabel import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.addInstructionsWithLabels import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patcher.extensions.ExternalLabel +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.mapping.resourceMappingPatch @@ -23,8 +23,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/spoof/SpoofAppVersionPatch;" -val spoofAppVersionPatch = bytecodePatch( - name = "Spoof app version", +val `Spoof app version` by creatingBytecodePatch( description = "Adds an option to trick YouTube into thinking you are running an older version of the app. " + "This can be used to restore old UI elements and features." ) { diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt index 8a33bfaa9..feb2d4949 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt @@ -3,7 +3,7 @@ package app.revanced.patches.youtube.layout.startpage import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.ListPreference @@ -17,8 +17,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/ChangeStartPagePatch;" -val changeStartPagePatch = bytecodePatch( - name = "Change start page", +val `Change start page` by creatingBytecodePatch( description = "Adds an option to set which page the app opens in instead of the homepage.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt index 78badb380..9ac49c170 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt @@ -1,7 +1,7 @@ package app.revanced.patches.youtube.layout.startupshortsreset import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference @@ -21,8 +21,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/DisableResumingStartupShortsPlayerPatch;" -val disableResumingShortsOnStartupPatch = bytecodePatch( - name = "Disable resuming Shorts on startup", +val `Disable resuming Shorts on startup` by creatingBytecodePatch( description = "Adds an option to disable the Shorts player from resuming on app startup when Shorts were last being watched.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt index 46d1c3b42..6a6199580 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt @@ -1,6 +1,6 @@ package app.revanced.patches.youtube.layout.thumbnails -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.ListPreference @@ -19,8 +19,7 @@ import app.revanced.patches.youtube.misc.settings.settingsPatch private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/AlternativeThumbnailsPatch;" -val alternativeThumbnailsPatch = bytecodePatch( - name = "Alternative thumbnails", +val `Alternative thumbnails` by creatingBytecodePatch( description = "Adds options to replace video thumbnails using the DeArrow API or image captures from the video.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictionsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictionsPatch.kt index 709f75fc7..a5792fcef 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictionsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictionsPatch.kt @@ -1,6 +1,6 @@ package app.revanced.patches.youtube.layout.thumbnails -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference @@ -13,10 +13,9 @@ import app.revanced.patches.youtube.misc.settings.settingsPatch private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/BypassImageRegionRestrictionsPatch;" -val bypassImageRegionRestrictionsPatch = bytecodePatch( - name = "Bypass image region restrictions", +val `Bypass image region restrictions` by creatingBytecodePatch( description = "Adds an option to use a different host for user avatar and channel images " + - "and can fix missing images that are blocked in some countries.", + "and can fix missing images that are blocked in some countries.", ) { dependsOn( sharedExtensionPatch, diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt index 257c09ee3..638ec8399 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt @@ -2,7 +2,7 @@ package app.revanced.patches.youtube.misc.backgroundplayback import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.instructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.mapping.ResourceType @@ -26,8 +26,7 @@ internal var prefBackgroundAndOfflineCategoryId = -1L private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/BackgroundPlaybackPatch;" -val backgroundPlaybackPatch = bytecodePatch( - name = "Remove background playback restrictions", +val `Remove background playback restrictions` by creatingBytecodePatch( description = "Removes restrictions on background playback, including playing kids videos in the background.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt index eb4c1789a..1483a293b 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt @@ -1,7 +1,7 @@ package app.revanced.patches.youtube.misc.dimensions.spoof import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference @@ -12,8 +12,7 @@ import app.revanced.patches.youtube.misc.settings.settingsPatch private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/spoof/SpoofDeviceDimensionsPatch;" -val spoofDeviceDimensionsPatch = bytecodePatch( - name = "Spoof device dimensions", +val `Spoof device dimensions` by creatingBytecodePatch( description = "Adds an option to spoof the device dimensions which can unlock higher video qualities.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt index 7dbc2bbdb..e740689b2 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt @@ -8,7 +8,7 @@ import app.revanced.patches.shared.castContextFetchMethod import app.revanced.patches.shared.misc.gms.gmsCoreSupportPatch import app.revanced.patches.shared.misc.settings.preference.IntentPreference import app.revanced.patches.shared.primeMethod -import app.revanced.patches.youtube.layout.buttons.overlay.hidePlayerOverlayButtonsPatch +import app.revanced.patches.youtube.layout.buttons.overlay.`Hide player overlay buttons` import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch import app.revanced.patches.youtube.misc.gms.Constants.REVANCED_YOUTUBE_PACKAGE_NAME import app.revanced.patches.youtube.misc.gms.Constants.YOUTUBE_PACKAGE_NAME @@ -28,7 +28,7 @@ val gmsCoreSupportPatch = gmsCoreSupportPatch( gmsCoreSupportResourcePatchFactory = ::gmsCoreSupportResourcePatch, ) { dependsOn( - hidePlayerOverlayButtonsPatch, // Hide non-functional cast button. + `Hide player overlay buttons`, // Hide non-functional cast button. spoofVideoStreamsPatch, ) diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/hapticfeedback/DisableHapticFeedbackPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/hapticfeedback/DisableHapticFeedbackPatch.kt index 6d18c444e..e44569740 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/hapticfeedback/DisableHapticFeedbackPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/hapticfeedback/DisableHapticFeedbackPatch.kt @@ -1,9 +1,9 @@ package app.revanced.patches.youtube.misc.hapticfeedback +import app.revanced.patcher.extensions.ExternalLabel import app.revanced.patcher.extensions.addInstructionsWithLabels import app.revanced.patcher.extensions.getInstruction -import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patcher.extensions.ExternalLabel +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.PreferenceScreenPreference @@ -15,8 +15,7 @@ private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/DisableHapticFeedbackPatch;" @Suppress("unused") -val disableHapticFeedbackPatch = bytecodePatch( - name = "Disable haptic feedback", +val `Disable haptic feedback` by creatingBytecodePatch( description = "Adds an option to disable haptic feedback in the player for various actions.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt index 1c05cef48..0ba4b6886 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt @@ -2,7 +2,7 @@ package app.revanced.patches.youtube.misc.links import app.revanced.patcher.extensions.getInstruction import app.revanced.patcher.extensions.replaceInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference @@ -14,8 +14,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/BypassURLRedirectsPatch;" -val bypassURLRedirectsPatch = bytecodePatch( - name = "Bypass URL redirects", +val `Bypass URL redirects` by creatingBytecodePatch( description = "Adds an option to bypass URL redirects and open the original URL directly.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt index fd750035f..c048bca39 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt @@ -1,7 +1,7 @@ package app.revanced.patches.youtube.misc.links import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.transformation.transformInstructionsPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference @@ -10,8 +10,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.reference.StringReference -val openLinksExternallyPatch = bytecodePatch( - name = "Open links externally", +val `Open links externally` by creatingBytecodePatch( description = "Adds an option to always open links in your browser instead of the in-app browser.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/loopvideo/LoopVideoPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/loopvideo/LoopVideoPatch.kt index bbdd16645..add74ed22 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/loopvideo/LoopVideoPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/loopvideo/LoopVideoPatch.kt @@ -1,6 +1,6 @@ package app.revanced.patches.youtube.misc.loopvideo -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference @@ -15,8 +15,7 @@ import com.android.tools.smali.dexlib2.Opcode private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/LoopVideoPatch;" -val loopVideoPatch = bytecodePatch( - name = "Loop video", +val `Loop video` by creatingBytecodePatch( description = "Adds an option to loop videos and display loop video button in the video player.", ) { dependsOn( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/navigation/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/navigation/Fingerprints.kt index 50f56c208..b712bedcd 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/navigation/Fingerprints.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/navigation/Fingerprints.kt @@ -4,7 +4,7 @@ import app.revanced.patcher.* import app.revanced.patcher.InstructionLocation.MatchAfterImmediately import app.revanced.patcher.InstructionLocation.MatchAfterWithin import app.revanced.patches.shared.misc.mapping.ResourceType -import app.revanced.patches.youtube.layout.buttons.navigation.navigationButtonsPatch +import app.revanced.patches.youtube.layout.buttons.navigation.`Navigation buttons` import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/video/codecs/DisableVideoCodecsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/video/codecs/DisableVideoCodecsPatch.kt index ed76901a5..23337c7d8 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/video/codecs/DisableVideoCodecsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/video/codecs/DisableVideoCodecsPatch.kt @@ -2,7 +2,7 @@ package app.revanced.patches.youtube.video.codecs import app.revanced.patcher.extensions.addInstructionsWithLabels import app.revanced.patcher.extensions.replaceInstruction -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.all.misc.resources.addResources import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.all.misc.transformation.transformInstructionsPatch @@ -14,46 +14,36 @@ import app.revanced.util.getReference import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.reference.MethodReference -private const val EXTENSION_CLASS_DESCRIPTOR = - "Lapp/revanced/extension/youtube/patches/DisableVideoCodecsPatch;" +private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/youtube/patches/DisableVideoCodecsPatch;" @Suppress("unused") -val disableVideoCodecsPatch = bytecodePatch( - name = "Disable video codecs", +val `Disable video codecs` by creatingBytecodePatch( description = "Adds options to disable HDR and VP9 codecs.", ) { dependsOn( - sharedExtensionPatch, - settingsPatch, - addResourcesPatch, + sharedExtensionPatch, settingsPatch, addResourcesPatch, /** * Override all calls of `getSupportedHdrTypes`. */ - transformInstructionsPatch( - filterMap = filterMap@{ classDef, _, instruction, instructionIndex -> - if (classDef.type.startsWith("Lapp/revanced/")) { - return@filterMap null - } - - val reference = instruction.getReference() - if (reference?.definingClass =="Landroid/view/Display\$HdrCapabilities;" - && reference.name == "getSupportedHdrTypes") { - return@filterMap instruction to instructionIndex - } + transformInstructionsPatch(filterMap = filterMap@{ classDef, _, instruction, instructionIndex -> + if (classDef.type.startsWith("Lapp/revanced/")) { return@filterMap null - }, - transform = { method, entry -> - val (instruction, index) = entry - val register = (instruction as FiveRegisterInstruction).registerC - - method.replaceInstruction( - index, - "invoke-static/range { v$register .. v$register }, $EXTENSION_CLASS_DESCRIPTOR->" + - "disableHdrVideo(Landroid/view/Display\$HdrCapabilities;)[I", - ) } - ) - ) + + val reference = instruction.getReference() + if (reference?.definingClass == "Landroid/view/Display\$HdrCapabilities;" && reference.name == "getSupportedHdrTypes") { + return@filterMap instruction to instructionIndex + } + return@filterMap null + }, transform = { method, entry -> + val (instruction, index) = entry + val register = (instruction as FiveRegisterInstruction).registerC + + method.replaceInstruction( + index, + "invoke-static/range { v$register .. v$register }, $EXTENSION_CLASS_DESCRIPTOR->" + "disableHdrVideo(Landroid/view/Display\$HdrCapabilities;)[I", + ) + })) compatibleWith( "com.google.android.youtube"( @@ -68,13 +58,11 @@ val disableVideoCodecsPatch = bytecodePatch( addResources("youtube", "video.codecs.disableVideoCodecsPatch") PreferenceScreen.VIDEO.addPreferences( - SwitchPreference("revanced_disable_hdr_video"), - SwitchPreference("revanced_force_avc_codec") + SwitchPreference("revanced_disable_hdr_video"), SwitchPreference("revanced_force_avc_codec") ) vp9CapabilityFingerprint.method.addInstructionsWithLabels( - 0, - """ + 0, """ invoke-static {}, $EXTENSION_CLASS_DESCRIPTOR->allowVP9()Z move-result v0 if-nez v0, :default diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/video/quality/VideoQualityPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/video/quality/VideoQualityPatch.kt index 0b4f9138e..e4b0059dc 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/video/quality/VideoQualityPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/video/quality/VideoQualityPatch.kt @@ -1,6 +1,6 @@ package app.revanced.patches.youtube.video.quality -import app.revanced.patcher.patch.bytecodePatch +import app.revanced.patcher.patch.creatingBytecodePatch import app.revanced.patches.shared.misc.settings.preference.BasePreference import app.revanced.patches.shared.misc.settings.preference.PreferenceCategory import app.revanced.patches.shared.misc.settings.preference.PreferenceScreenPreference.Sorting @@ -12,8 +12,7 @@ import app.revanced.patches.youtube.misc.settings.PreferenceScreen internal val settingsMenuVideoQualityGroup = mutableSetOf() @Suppress("unused") -val videoQualityPatch = bytecodePatch( - name = "Video quality", +val `Video quality` by creatingBytecodePatch( description = "Adds options to set default video qualities and always use the advanced video quality menu." ) { dependsOn(