From a08457e406f4b2e37458a4835c11d370a02d2ce6 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 1 Jan 2024 16:33:07 +0100 Subject: [PATCH] refactor: Fix package and code structure (#2541) BREAKING CHANGE: Various public APIs have changed names and packages or were removed entirely --- api/revanced-patches.api | 28 +++--- .../connectivity/wifi/spoof/SpoofWifiPatch.kt | 2 +- .../RemoveCaptureRestrictionPatch.kt | 2 +- .../RemoveScreenshotRestrictionPatch.kt | 2 +- .../patches/reddit/ad/general/HideAdsPatch.kt | 2 +- .../integrations/AbstractIntegrationsPatch.kt | 28 ++++-- .../settings/AbstractSettingsResourcePatch.kt | 3 + .../preference/DefaultBasePreference.kt | 32 ------- .../preference/impl/ListPreference.kt | 12 ++- .../preference/impl/SwitchPreference.kt | 8 +- .../preference/impl/TextPreference.kt | 8 +- .../tiktok/feedfilter/FeedFilterPatch.kt | 4 +- .../cleardisplay/RememberClearModePatch.kt | 4 +- .../interaction/downloads/DownloadsPatch.kt | 8 +- .../misc/integrations/IntegrationsPatch.kt | 1 - .../tiktok/misc/settings/SettingsPatch.kt | 4 +- .../SettingsStatusLoadFingerprint.kt | 2 +- .../tiktok/misc/spoof/sim/SpoofSimPatch.kt | 4 +- .../lockscreen/patch/ShowOnLockscreenPatch.kt | 2 +- .../timelinefilter/TimelineFilterPatch.kt | 2 +- .../patches/twitch/ad/audio/AudioAdsPatch.kt | 5 +- .../twitch/ad/embedded/EmbeddedAdsPatch.kt | 5 +- .../patches/twitch/ad/video/VideoAdsPatch.kt | 5 +- .../antidelete/ShowDeletedMessagesPatch.kt | 7 +- .../autoclaim/AutoClaimChannelPointsPatch.kt | 5 +- .../patches/twitch/debug/DebugModePatch.kt | 19 ++-- .../misc/integrations/IntegrationsPatch.kt | 3 +- .../twitch/misc/settings/SettingsPatch.kt | 48 +++++----- .../twitter/misc/hook/json/JsonHookPatch.kt | 2 +- .../misc/hook/patch/ads/HideAdsPatch.kt | 2 +- .../HideRecommendedUsersPatch.kt | 2 +- .../youtube/ad/general/HideAdsPatch.kt | 2 +- .../ad/general/HideAdsResourcePatch.kt | 2 +- .../ad/getpremium/HideGetPremiumPatch.kt | 2 +- .../patches/youtube/ad/video/VideoAdsPatch.kt | 2 +- .../copyvideourl/CopyVideoUrlBytecodePatch.kt | 2 +- .../RemoveViewerDiscretionDialogPatch.kt | 2 +- .../ExternalDownloadsBytecodePatch.kt | 2 +- .../DisablePreciseSeekingGesturePatch.kt | 2 +- .../seekbar/EnableSeekbarTappingPatch.kt | 2 +- .../seekbar/EnableSlideToSeekPatch.kt | 2 +- .../SwipeControlsHostActivityFingerprint.kt | 2 +- .../layout/autocaptions/AutoCaptionsPatch.kt | 6 +- .../layout/buttons/action/HideButtonsPatch.kt | 2 +- .../autoplay/HideAutoplayButtonPatch.kt | 2 +- .../captions/HideCaptionsButtonPatch.kt | 2 +- .../buttons/cast/HideCastButtonPatch.kt | 2 +- .../navigation/NavigationButtonsPatch.kt | 2 +- .../player/hide/HidePlayerButtonsPatch.kt | 4 +- .../layout/hide/albumcards/AlbumCardsPatch.kt | 2 +- .../hide/breakingnews/BreakingNewsPatch.kt | 2 +- .../layout/hide/comments/CommentsPatch.kt | 2 +- .../crowdfundingbox/CrowdfundingBoxPatch.kt | 2 +- .../endscreencards/HideEndscreenCardsPatch.kt | 2 +- .../hide/filterbar/HideFilterBarPatch.kt | 2 +- .../HideFloatingMicrophoneButtonPatch.kt | 2 +- .../DisableFullscreenAmbientModePatch.kt | 2 +- .../hide/general/HideLayoutComponentsPatch.kt | 4 +- .../hide/infocards/HideInfoCardsPatch.kt | 6 +- .../loadmorebutton/HideLoadMoreButtonPatch.kt | 2 +- .../HideEmailAddressPatch.kt | 2 +- .../HidePlayerFlyoutMenuPatch.kt | 2 +- .../DisableRollingNumberAnimationPatch.kt | 2 +- .../layout/hide/seekbar/HideSeekbarPatch.kt | 2 +- .../hide/shorts/HideShortsComponentsPatch.kt | 2 +- .../DisableSuggestedVideoEndScreenPatch.kt | 2 +- .../layout/hide/time/HideTimestampPatch.kt | 2 +- .../panels/popup/PlayerPopupPanelsPatch.kt | 2 +- .../CustomPlayerOverlayOpacityPatch.kt | 2 +- .../ReturnYouTubeDislikePatch.kt | 4 +- .../layout/searchbar/WideSearchbarPatch.kt | 2 +- .../RestoreOldSeekbarThumbnailsPatch.kt | 3 +- .../seekbar/SeekbarColorBytecodePatch.kt | 2 +- .../seekbar/SeekbarColorResourcePatch.kt | 2 +- .../sponsorblock/SponsorBlockBytecodePatch.kt | 8 +- .../spoofappversion/SpoofAppVersionPatch.kt | 2 +- .../layout/startpage/ChangeStartPagePatch.kt | 5 +- .../DisableResumingShortsOnStartupPatch.kt | 2 +- .../layout/tablet/EnableTabletLayoutPatch.kt | 2 +- .../tabletminiplayer/TabletMiniPlayerPatch.kt | 2 +- .../layout/theme/ThemeBytecodePatch.kt | 2 +- .../thumbnails/AlternativeThumbnailsPatch.kt | 6 +- .../misc/announcements/AnnouncementsPatch.kt | 8 +- .../misc/autorepeat/AutoRepeatPatch.kt | 4 +- .../spoof/SpoofDeviceDimensionsPatch.kt | 2 +- .../FixBackToExitGesturePatch.kt | 2 +- .../misc/fix/playback/SpoofSignaturePatch.kt | 2 +- .../youtube/misc/gms/GmsCoreSupportPatch.kt | 2 +- .../misc/integrations/IntegrationsPatch.kt | 1 - .../misc/links/BypassURLRedirectsPatch.kt | 2 +- .../misc/links/OpenLinksExternallyPatch.kt | 2 +- .../misc/litho/filter/LithoFilterPatch.kt | 2 +- .../MinimizedPlaybackPatch.kt | 2 +- .../playeroverlay/PlayerOverlaysHookPatch.kt | 2 +- .../misc/playertype/PlayerTypeHookPatch.kt | 2 +- .../RemoveTrackingQueryParameterPatch.kt | 2 +- .../youtube/misc/settings/SettingsPatch.kt | 87 ++++++++----------- .../misc/settings/SettingsResourcePatch.kt | 4 +- ... => LicenseActivityOnCreateFingerprint.kt} | 2 +- .../misc/zoomhaptics/ZoomHapticsPatch.kt | 2 +- .../video/hdrbrightness/HDRBrightnessPatch.kt | 2 +- .../information/VideoInformationPatch.kt | 2 +- .../quality/RememberVideoQualityPatch.kt | 2 +- .../speed/custom/CustomPlaybackSpeedPatch.kt | 4 +- .../remember/RememberPlaybackSpeedPatch.kt | 2 +- .../RestoreOldVideoQualityMenuPatch.kt | 4 +- .../settings/host/values/strings.xml | 3 + .../layout/inline_sponsor_overlay.xml | 6 +- 108 files changed, 249 insertions(+), 297 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/shared/settings/preference/DefaultBasePreference.kt rename src/main/kotlin/app/revanced/patches/youtube/misc/settings/fingerprints/{LicenseActivityFingerprint.kt => LicenseActivityOnCreateFingerprint.kt} (86%) diff --git a/api/revanced-patches.api b/api/revanced-patches.api index 9a086a78..4832ac31 100644 --- a/api/revanced-patches.api +++ b/api/revanced-patches.api @@ -525,6 +525,7 @@ public final class app/revanced/patches/shared/fingerprints/HomeActivityFingerpr public abstract class app/revanced/patches/shared/integrations/AbstractIntegrationsPatch : app/revanced/patcher/patch/BytecodePatch { public fun (Ljava/lang/String;Ljava/util/Set;)V + public fun (Ljava/util/Set;)V public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V } @@ -616,13 +617,6 @@ public abstract class app/revanced/patches/shared/settings/preference/BaseResour public static synthetic fun serialize$default (Lapp/revanced/patches/shared/settings/preference/BaseResource;Lorg/w3c/dom/Document;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lorg/w3c/dom/Element; } -public abstract class app/revanced/patches/shared/settings/preference/DefaultBasePreference : app/revanced/patches/shared/settings/preference/BasePreference { - public fun (Ljava/lang/String;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Ljava/lang/String;Ljava/lang/Object;)V - public synthetic fun (Ljava/lang/String;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Ljava/lang/String;Ljava/lang/Object;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun getDefault ()Ljava/lang/Object; - public fun serialize (Lorg/w3c/dom/Document;Lkotlin/jvm/functions/Function1;)Lorg/w3c/dom/Element; -} - public final class app/revanced/patches/shared/settings/preference/SummaryType : java/lang/Enum { public static final field DEFAULT Lapp/revanced/patches/shared/settings/preference/SummaryType; public static final field OFF Lapp/revanced/patches/shared/settings/preference/SummaryType; @@ -650,11 +644,9 @@ public final class app/revanced/patches/shared/settings/preference/impl/InputTyp public static fun values ()[Lapp/revanced/patches/shared/settings/preference/impl/InputType; } -public final class app/revanced/patches/shared/settings/preference/impl/ListPreference : app/revanced/patches/shared/settings/preference/DefaultBasePreference { - public fun (Ljava/lang/String;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/ArrayResource;Lapp/revanced/patches/shared/settings/preference/impl/ArrayResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Ljava/lang/String;)V - public synthetic fun (Ljava/lang/String;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/ArrayResource;Lapp/revanced/patches/shared/settings/preference/impl/ArrayResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V - public final fun getEntries ()Lapp/revanced/patches/shared/settings/preference/impl/ArrayResource; - public final fun getEntryValues ()Lapp/revanced/patches/shared/settings/preference/impl/ArrayResource; +public final class app/revanced/patches/shared/settings/preference/impl/ListPreference : app/revanced/patches/shared/settings/preference/BasePreference { + public fun (Ljava/lang/String;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/ArrayResource;Lapp/revanced/patches/shared/settings/preference/impl/ArrayResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;)V + public synthetic fun (Ljava/lang/String;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/ArrayResource;Lapp/revanced/patches/shared/settings/preference/impl/ArrayResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public fun serialize (Lorg/w3c/dom/Document;Lkotlin/jvm/functions/Function1;)Lorg/w3c/dom/Element; } @@ -700,18 +692,18 @@ public final class app/revanced/patches/shared/settings/preference/impl/StringRe public fun serialize (Lorg/w3c/dom/Document;Lkotlin/jvm/functions/Function1;)Lorg/w3c/dom/Element; } -public final class app/revanced/patches/shared/settings/preference/impl/SwitchPreference : app/revanced/patches/shared/settings/preference/DefaultBasePreference { - public fun (Ljava/lang/String;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Z)V - public synthetic fun (Ljava/lang/String;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V +public final class app/revanced/patches/shared/settings/preference/impl/SwitchPreference : app/revanced/patches/shared/settings/preference/BasePreference { + public fun (Ljava/lang/String;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;)V + public synthetic fun (Ljava/lang/String;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun getSummaryOff ()Lapp/revanced/patches/shared/settings/preference/impl/StringResource; public final fun getSummaryOn ()Lapp/revanced/patches/shared/settings/preference/impl/StringResource; public final fun getUserDialogMessage ()Lapp/revanced/patches/shared/settings/preference/impl/StringResource; public fun serialize (Lorg/w3c/dom/Document;Lkotlin/jvm/functions/Function1;)Lorg/w3c/dom/Element; } -public final class app/revanced/patches/shared/settings/preference/impl/TextPreference : app/revanced/patches/shared/settings/preference/DefaultBasePreference { - public fun (Ljava/lang/String;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/InputType;Ljava/lang/String;Ljava/lang/String;)V - public synthetic fun (Ljava/lang/String;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/InputType;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V +public final class app/revanced/patches/shared/settings/preference/impl/TextPreference : app/revanced/patches/shared/settings/preference/BasePreference { + public fun (Ljava/lang/String;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/InputType;Ljava/lang/String;)V + public synthetic fun (Ljava/lang/String;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/StringResource;Lapp/revanced/patches/shared/settings/preference/impl/InputType;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun getInputType ()Lapp/revanced/patches/shared/settings/preference/impl/InputType; public fun serialize (Lorg/w3c/dom/Document;Lkotlin/jvm/functions/Function1;)Lorg/w3c/dom/Element; } diff --git a/src/main/kotlin/app/revanced/patches/all/connectivity/wifi/spoof/SpoofWifiPatch.kt b/src/main/kotlin/app/revanced/patches/all/connectivity/wifi/spoof/SpoofWifiPatch.kt index c25f8030..5871749a 100644 --- a/src/main/kotlin/app/revanced/patches/all/connectivity/wifi/spoof/SpoofWifiPatch.kt +++ b/src/main/kotlin/app/revanced/patches/all/connectivity/wifi/spoof/SpoofWifiPatch.kt @@ -18,7 +18,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.Instruction ) @Suppress("unused") object SpoofWifiPatch : AbstractTransformInstructionsPatch() { - private const val INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX = "Lapp/revanced/all/connectivity/wifi/spoof/SpoofWifiPatch" + private const val INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX = "Lapp/revanced/integrations/all/connectivity/wifi/spoof/SpoofWifiPatch" private const val INTEGRATIONS_CLASS_DESCRIPTOR = "$INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX;" override fun filterMap( diff --git a/src/main/kotlin/app/revanced/patches/all/screencapture/removerestriction/RemoveCaptureRestrictionPatch.kt b/src/main/kotlin/app/revanced/patches/all/screencapture/removerestriction/RemoveCaptureRestrictionPatch.kt index 4815f523..3bc82166 100644 --- a/src/main/kotlin/app/revanced/patches/all/screencapture/removerestriction/RemoveCaptureRestrictionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/all/screencapture/removerestriction/RemoveCaptureRestrictionPatch.kt @@ -20,7 +20,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.Instruction @Suppress("unused") object RemoveCaptureRestrictionPatch : AbstractTransformInstructionsPatch() { private const val INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX = - "Lapp/revanced/all/screencapture/removerestriction/RemoveScreencaptureRestrictionPatch" + "Lapp/revanced/integrations/all/screencapture/removerestriction/RemoveScreencaptureRestrictionPatch" private const val INTEGRATIONS_CLASS_DESCRIPTOR = "$INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX;" // Information about method calls we want to replace enum class MethodCall( diff --git a/src/main/kotlin/app/revanced/patches/all/screenshot/removerestriction/RemoveScreenshotRestrictionPatch.kt b/src/main/kotlin/app/revanced/patches/all/screenshot/removerestriction/RemoveScreenshotRestrictionPatch.kt index 4f1db9ef..12006f65 100644 --- a/src/main/kotlin/app/revanced/patches/all/screenshot/removerestriction/RemoveScreenshotRestrictionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/all/screenshot/removerestriction/RemoveScreenshotRestrictionPatch.kt @@ -24,7 +24,7 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference @Suppress("unused") object RemoveScreenshotRestrictionPatch : AbstractTransformInstructionsPatch() { private const val INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX = - "Lapp/revanced/all/screenshot/removerestriction/RemoveScreenshotRestrictionPatch" + "Lapp/revanced/integrations/all/screenshot/removerestriction/RemoveScreenshotRestrictionPatch" private const val INTEGRATIONS_CLASS_DESCRIPTOR = "$INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX;" override fun execute(context: BytecodeContext) { diff --git a/src/main/kotlin/app/revanced/patches/reddit/ad/general/HideAdsPatch.kt b/src/main/kotlin/app/revanced/patches/reddit/ad/general/HideAdsPatch.kt index 23a1c69e..02465c90 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/ad/general/HideAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/ad/general/HideAdsPatch.kt @@ -26,7 +26,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference @Suppress("unused") object HideAdsPatch : BytecodePatch(setOf(AdPostFingerprint, NewAdPostFingerprint)) { private const val FILTER_METHOD_DESCRIPTOR = - "Lapp/revanced/reddit/patches/FilterPromotedLinksPatch;" + + "Lapp/revanced/integrations/reddit/patches/FilterPromotedLinksPatch;" + "->filterChildren(Ljava/lang/Iterable;)Ljava/util/List;" override fun execute(context: BytecodeContext) { diff --git a/src/main/kotlin/app/revanced/patches/shared/integrations/AbstractIntegrationsPatch.kt b/src/main/kotlin/app/revanced/patches/shared/integrations/AbstractIntegrationsPatch.kt index d9d051fa..9b75a18a 100644 --- a/src/main/kotlin/app/revanced/patches/shared/integrations/AbstractIntegrationsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/integrations/AbstractIntegrationsPatch.kt @@ -11,9 +11,27 @@ import com.android.tools.smali.dexlib2.iface.ClassDef import com.android.tools.smali.dexlib2.iface.Method abstract class AbstractIntegrationsPatch( - private val integrationsDescriptor: String, private val hooks: Set ) : BytecodePatch(hooks) { + + @Deprecated( + "Use the constructor without the integrationsDescriptor parameter", + ReplaceWith("AbstractIntegrationsPatch(hooks)") + ) + @Suppress("UNUSED_PARAMETER") + constructor( + integrationsDescriptor: String, + hooks: Set + ) : this(hooks) + + override fun execute(context: BytecodeContext) { + if (context.findClass(INTEGRATIONS_CLASS_DESCRIPTOR) == null) throw PatchException( + "Integrations have not been merged yet. This patch can not succeed without merging the integrations." + ) + + for (hook in hooks) hook.invoke(INTEGRATIONS_CLASS_DESCRIPTOR) + } + /** * [MethodFingerprint] for integrations. * @@ -53,11 +71,7 @@ abstract class AbstractIntegrationsPatch( } } - override fun execute(context: BytecodeContext) { - if (context.findClass(integrationsDescriptor) == null) throw PatchException( - "Integrations have not been merged yet. This patch can not succeed without merging the integrations." - ) - - for (hook in hooks) hook.invoke(integrationsDescriptor) + private companion object { + private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/shared/Utils;" } } \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/shared/settings/AbstractSettingsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/shared/settings/AbstractSettingsResourcePatch.kt index 4935370d..c5fb9a23 100644 --- a/src/main/kotlin/app/revanced/patches/shared/settings/AbstractSettingsResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/settings/AbstractSettingsResourcePatch.kt @@ -11,6 +11,7 @@ import app.revanced.patches.shared.settings.preference.impl.ArrayResource import app.revanced.patches.shared.settings.preference.impl.StringResource import app.revanced.util.ResourceGroup import app.revanced.util.copyResources +import app.revanced.util.mergeStrings import org.w3c.dom.Node import java.io.Closeable @@ -37,6 +38,8 @@ abstract class AbstractSettingsResourcePatch( stringsEditor = context.xmlEditor["res/values/strings.xml"] arraysEditor = context.xmlEditor["res/values/arrays.xml"] revancedPreferencesEditor = context.xmlEditor["res/xml/$preferenceFileName.xml"] + + context.mergeStrings("settings/host/values/strings.xml") } internal companion object { diff --git a/src/main/kotlin/app/revanced/patches/shared/settings/preference/DefaultBasePreference.kt b/src/main/kotlin/app/revanced/patches/shared/settings/preference/DefaultBasePreference.kt deleted file mode 100644 index 9371d48f..00000000 --- a/src/main/kotlin/app/revanced/patches/shared/settings/preference/DefaultBasePreference.kt +++ /dev/null @@ -1,32 +0,0 @@ -package app.revanced.patches.shared.settings.preference - -import app.revanced.patches.shared.settings.preference.impl.StringResource -import org.w3c.dom.Document - -/** - * Base preference class that also has a default value. - * - * @param key The key of the preference. - * @param title The title of the preference. - * @param tag The tag of the preference. - * @param summary The summary of the preference. - * @param default The default value of the preference. - */ -abstract class DefaultBasePreference( - key: String?, - title: StringResource, - summary: StringResource? = null, - tag: String, - val default: T? = null, -) : BasePreference(key, title, summary, tag) { - - /** - * Serialize preference element to XML. - * Overriding methods should invoke super and operate on its return value. - * @param ownerDocument Target document to create elements from. - * @param resourceCallback Called when a resource has been processed. - * @return The serialized element. - */ - override fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit) = - super.serialize(ownerDocument, resourceCallback).apply { addDefault(default) } -} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/shared/settings/preference/impl/ListPreference.kt b/src/main/kotlin/app/revanced/patches/shared/settings/preference/impl/ListPreference.kt index 37181267..7d849d72 100644 --- a/src/main/kotlin/app/revanced/patches/shared/settings/preference/impl/ListPreference.kt +++ b/src/main/kotlin/app/revanced/patches/shared/settings/preference/impl/ListPreference.kt @@ -1,7 +1,7 @@ package app.revanced.patches.shared.settings.preference.impl +import app.revanced.patches.shared.settings.preference.BasePreference import app.revanced.patches.shared.settings.preference.BaseResource -import app.revanced.patches.shared.settings.preference.DefaultBasePreference import app.revanced.patches.shared.settings.preference.addSummary import org.w3c.dom.Document @@ -13,16 +13,14 @@ import org.w3c.dom.Document * @param entries The human-readable entries of the list preference. * @param entryValues The entry values of the list preference. * @param summary The summary of the list preference. - * @param default The default entry value of the list preference. */ class ListPreference( key: String, title: StringResource, - val entries: ArrayResource, - val entryValues: ArrayResource, - summary: StringResource? = null, - default: String? = null, -) : DefaultBasePreference(key, title, summary, "ListPreference", default) { + private val entries: ArrayResource, + private val entryValues: ArrayResource, + summary: StringResource? = null +) : BasePreference(key, title, summary, "ListPreference") { override fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit) = super.serialize(ownerDocument, resourceCallback).apply { setAttribute("android:entries", "@array/${entries.also { resourceCallback.invoke(it) }.name}") diff --git a/src/main/kotlin/app/revanced/patches/shared/settings/preference/impl/SwitchPreference.kt b/src/main/kotlin/app/revanced/patches/shared/settings/preference/impl/SwitchPreference.kt index 6623c3bf..b8e30c3e 100644 --- a/src/main/kotlin/app/revanced/patches/shared/settings/preference/impl/SwitchPreference.kt +++ b/src/main/kotlin/app/revanced/patches/shared/settings/preference/impl/SwitchPreference.kt @@ -1,10 +1,10 @@ package app.revanced.patches.shared.settings.preference.impl +import app.revanced.patches.shared.settings.AbstractSettingsResourcePatch.Companion.include +import app.revanced.patches.shared.settings.preference.BasePreference import app.revanced.patches.shared.settings.preference.BaseResource -import app.revanced.patches.shared.settings.preference.DefaultBasePreference import app.revanced.patches.shared.settings.preference.SummaryType import app.revanced.patches.shared.settings.preference.addSummary -import app.revanced.patches.shared.settings.AbstractSettingsResourcePatch.Companion.include import org.w3c.dom.Document import org.w3c.dom.Element @@ -16,15 +16,13 @@ import org.w3c.dom.Element * @param summaryOn The summary to show when the preference is enabled. * @param summaryOff The summary to show when the preference is disabled. * @param userDialogMessage The message to show in a dialog when the user toggles the preference. - * @param default The default value of the switch. */ class SwitchPreference( key: String, title: StringResource, val summaryOn: StringResource, val summaryOff: StringResource, val userDialogMessage: StringResource? = null, - default: Boolean = false, -) : DefaultBasePreference( key, title, null, "SwitchPreference", default) { +) : BasePreference(key, title, null, "SwitchPreference") { override fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit): Element { userDialogMessage?.include() diff --git a/src/main/kotlin/app/revanced/patches/shared/settings/preference/impl/TextPreference.kt b/src/main/kotlin/app/revanced/patches/shared/settings/preference/impl/TextPreference.kt index aaac8c5c..1eea68db 100644 --- a/src/main/kotlin/app/revanced/patches/shared/settings/preference/impl/TextPreference.kt +++ b/src/main/kotlin/app/revanced/patches/shared/settings/preference/impl/TextPreference.kt @@ -1,7 +1,7 @@ package app.revanced.patches.shared.settings.preference.impl +import app.revanced.patches.shared.settings.preference.BasePreference import app.revanced.patches.shared.settings.preference.BaseResource -import app.revanced.patches.shared.settings.preference.DefaultBasePreference import org.w3c.dom.Document /** @@ -11,16 +11,14 @@ import org.w3c.dom.Document * @param title The title of the text preference. * @param inputType The input type of the text preference. * @param summary The summary of the text preference. - * @param default The default value of the text preference. */ class TextPreference( key: String?, title: StringResource, summary: StringResource?, val inputType: InputType = InputType.TEXT, - default: String? = null, - tag: String = "app.revanced.integrations.settingsmenu.ResettableEditTextPreference" -) : DefaultBasePreference(key, title, summary, tag, default) { + tag: String = "app.revanced.integrations.shared.settings.preference.ResettableEditTextPreference" +) : BasePreference(key, title, summary, tag) { override fun serialize(ownerDocument: Document, resourceCallback: (BaseResource) -> Unit) = super.serialize(ownerDocument, resourceCallback).apply { diff --git a/src/main/kotlin/app/revanced/patches/tiktok/feedfilter/FeedFilterPatch.kt b/src/main/kotlin/app/revanced/patches/tiktok/feedfilter/FeedFilterPatch.kt index 01f7c2f8..35a6f77f 100644 --- a/src/main/kotlin/app/revanced/patches/tiktok/feedfilter/FeedFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/tiktok/feedfilter/FeedFilterPatch.kt @@ -36,13 +36,13 @@ object FeedFilterPatch : BytecodePatch( addInstruction( returnFeedItemInstruction.location.index, "invoke-static { v$feedItemsRegister }, " + - "Lapp/revanced/tiktok/feedfilter/FeedItemsFilter;->filter(Lcom/ss/android/ugc/aweme/feed/model/FeedItemList;)V" + "Lapp/revanced/integrations/tiktok/feedfilter/FeedItemsFilter;->filter(Lcom/ss/android/ugc/aweme/feed/model/FeedItemList;)V" ) } ?: throw FeedApiServiceLIZFingerprint.exception SettingsStatusLoadFingerprint.result?.mutableMethod?.addInstruction( 0, - "invoke-static {}, Lapp/revanced/tiktok/settingsmenu/SettingsStatus;->enableFeedFilter()V" + "invoke-static {}, Lapp/revanced/integrations/tiktok/settings/SettingsStatus;->enableFeedFilter()V" ) ?: throw SettingsStatusLoadFingerprint.exception } } diff --git a/src/main/kotlin/app/revanced/patches/tiktok/interaction/cleardisplay/RememberClearModePatch.kt b/src/main/kotlin/app/revanced/patches/tiktok/interaction/cleardisplay/RememberClearModePatch.kt index 7cf98bec..7399e0b5 100644 --- a/src/main/kotlin/app/revanced/patches/tiktok/interaction/cleardisplay/RememberClearModePatch.kt +++ b/src/main/kotlin/app/revanced/patches/tiktok/interaction/cleardisplay/RememberClearModePatch.kt @@ -40,7 +40,7 @@ object RememberClearDisplayPatch : BytecodePatch( it.addInstructions( isEnabledIndex, "invoke-static { v$isEnabledRegister }, " + - "Lapp/revanced/tiktok/cleardisplay/RememberClearDisplayPatch;->rememberClearDisplayState(Z)V" + "Lapp/revanced/integrations/tiktok/cleardisplay/RememberClearDisplayPatch;->rememberClearDisplayState(Z)V" ) // endregion @@ -55,7 +55,7 @@ object RememberClearDisplayPatch : BytecodePatch( # Create a new clearDisplayEvent and post it to the EventBus (https://github.com/greenrobot/EventBus) # The state of clear display. - invoke-static { }, Lapp/revanced/tiktok/cleardisplay/RememberClearDisplayPatch;->getClearDisplayState()Z + invoke-static { }, Lapp/revanced/integrations/tiktok/cleardisplay/RememberClearDisplayPatch;->getClearDisplayState()Z move-result v3 if-eqz v3, :clear_display_disabled diff --git a/src/main/kotlin/app/revanced/patches/tiktok/interaction/downloads/DownloadsPatch.kt b/src/main/kotlin/app/revanced/patches/tiktok/interaction/downloads/DownloadsPatch.kt index afb08892..59b08b0f 100644 --- a/src/main/kotlin/app/revanced/patches/tiktok/interaction/downloads/DownloadsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/tiktok/interaction/downloads/DownloadsPatch.kt @@ -69,7 +69,7 @@ object DownloadsPatch : BytecodePatch( addInstructionsWithLabels( 0, """ - invoke-static {}, Lapp/revanced/tiktok/download/DownloadsPatch;->shouldRemoveWatermark()Z + invoke-static {}, Lapp/revanced/integrations/tiktok/download/DownloadsPatch;->shouldRemoveWatermark()Z move-result v0 if-eqz v0, :noremovewatermark const/4 v0, 0x1 @@ -99,7 +99,7 @@ object DownloadsPatch : BytecodePatch( downloadUriMethod.addInstructions( secondIndex, """ - invoke-static {}, Lapp/revanced/tiktok/download/DownloadsPatch;->getDownloadPath()Ljava/lang/String; + invoke-static {}, Lapp/revanced/integrations/tiktok/download/DownloadsPatch;->getDownloadPath()Ljava/lang/String; move-result-object v0 """ ) @@ -107,7 +107,7 @@ object DownloadsPatch : BytecodePatch( downloadUriMethod.addInstructions( firstIndex, """ - invoke-static {}, Lapp/revanced/tiktok/download/DownloadsPatch;->getDownloadPath()Ljava/lang/String; + invoke-static {}, Lapp/revanced/integrations/tiktok/download/DownloadsPatch;->getDownloadPath()Ljava/lang/String; move-result-object v0 """ ) @@ -115,7 +115,7 @@ object DownloadsPatch : BytecodePatch( SettingsStatusLoadFingerprint to { addInstruction( 0, - "invoke-static {}, Lapp/revanced/tiktok/settingsmenu/SettingsStatus;->enableDownload()V" + "invoke-static {}, Lapp/revanced/integrations/tiktok/settings/SettingsStatus;->enableDownload()V" ) } ).forEach { (fingerprint, patch) -> diff --git a/src/main/kotlin/app/revanced/patches/tiktok/misc/integrations/IntegrationsPatch.kt b/src/main/kotlin/app/revanced/patches/tiktok/misc/integrations/IntegrationsPatch.kt index b13321c0..824e5df8 100644 --- a/src/main/kotlin/app/revanced/patches/tiktok/misc/integrations/IntegrationsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/tiktok/misc/integrations/IntegrationsPatch.kt @@ -6,6 +6,5 @@ import app.revanced.patches.tiktok.misc.integrations.fingerprints.InitFingerprin @Patch(requiresIntegrations = true) object IntegrationsPatch : AbstractIntegrationsPatch( - "Lapp/revanced/tiktok/utils/ReVancedUtils;", setOf(InitFingerprint) ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/tiktok/misc/settings/SettingsPatch.kt b/src/main/kotlin/app/revanced/patches/tiktok/misc/settings/SettingsPatch.kt index d5980924..f3d5a2b0 100644 --- a/src/main/kotlin/app/revanced/patches/tiktok/misc/settings/SettingsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/tiktok/misc/settings/SettingsPatch.kt @@ -37,10 +37,10 @@ object SettingsPatch : BytecodePatch( ) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/tiktok/settingsmenu/SettingsMenu;" + "Lapp/revanced/integrations/tiktok/settings/AdPersonalizationActivityHook;" private const val INITIALIZE_SETTINGS_METHOD_DESCRIPTOR = - "$INTEGRATIONS_CLASS_DESCRIPTOR->initializeSettings(" + + "$INTEGRATIONS_CLASS_DESCRIPTOR->initialize(" + "Lcom/bytedance/ies/ugc/aweme/commercialize/compliance/personalization/AdPersonalizationActivity;" + ")Z" diff --git a/src/main/kotlin/app/revanced/patches/tiktok/misc/settings/fingerprints/SettingsStatusLoadFingerprint.kt b/src/main/kotlin/app/revanced/patches/tiktok/misc/settings/fingerprints/SettingsStatusLoadFingerprint.kt index 2f390f23..b689e785 100644 --- a/src/main/kotlin/app/revanced/patches/tiktok/misc/settings/fingerprints/SettingsStatusLoadFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/tiktok/misc/settings/fingerprints/SettingsStatusLoadFingerprint.kt @@ -4,7 +4,7 @@ import app.revanced.patcher.fingerprint.MethodFingerprint internal object SettingsStatusLoadFingerprint : MethodFingerprint( customFingerprint = { methodDef, _ -> - methodDef.definingClass.endsWith("Lapp/revanced/tiktok/settingsmenu/SettingsStatus;") && + methodDef.definingClass.endsWith("Lapp/revanced/integrations/tiktok/settings/SettingsStatus;") && methodDef.name == "load" } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/tiktok/misc/spoof/sim/SpoofSimPatch.kt b/src/main/kotlin/app/revanced/patches/tiktok/misc/spoof/sim/SpoofSimPatch.kt index 137347aa..39d412d2 100644 --- a/src/main/kotlin/app/revanced/patches/tiktok/misc/spoof/sim/SpoofSimPatch.kt +++ b/src/main/kotlin/app/revanced/patches/tiktok/misc/spoof/sim/SpoofSimPatch.kt @@ -85,7 +85,7 @@ object SpoofSimPatch : BytecodePatch() { with(SettingsStatusLoadFingerprint.result!!.mutableMethod) { addInstruction( 0, - "invoke-static {}, Lapp/revanced/tiktok/settingsmenu/SettingsStatus;->enableSimSpoof()V" + "invoke-static {}, Lapp/revanced/integrations/tiktok/settings/SettingsStatus;->enableSimSpoof()V" ) } } @@ -97,7 +97,7 @@ object SpoofSimPatch : BytecodePatch() { addInstructions( index + 2, """ - invoke-static {v$resultReg}, Lapp/revanced/tiktok/spoof/sim/SpoofSimPatch;->$replacement(Ljava/lang/String;)Ljava/lang/String; + invoke-static {v$resultReg}, Lapp/revanced/integrations/tiktok/spoof/sim/SpoofSimPatch;->$replacement(Ljava/lang/String;)Ljava/lang/String; move-result-object v$resultReg """ ) diff --git a/src/main/kotlin/app/revanced/patches/tudortmund/lockscreen/patch/ShowOnLockscreenPatch.kt b/src/main/kotlin/app/revanced/patches/tudortmund/lockscreen/patch/ShowOnLockscreenPatch.kt index 9e335aef..368879cf 100644 --- a/src/main/kotlin/app/revanced/patches/tudortmund/lockscreen/patch/ShowOnLockscreenPatch.kt +++ b/src/main/kotlin/app/revanced/patches/tudortmund/lockscreen/patch/ShowOnLockscreenPatch.kt @@ -25,7 +25,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference object ShowOnLockscreenPatch : BytecodePatch( setOf(BrightnessFingerprint) ) { - private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/tudortmund/lockscreen/ShowOnLockscreenPatch;" + private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/tudortmund/lockscreen/ShowOnLockscreenPatch;" override fun execute(context: BytecodeContext) { BrightnessFingerprint.result?.mutableMethod?.apply { diff --git a/src/main/kotlin/app/revanced/patches/tumblr/timelinefilter/TimelineFilterPatch.kt b/src/main/kotlin/app/revanced/patches/tumblr/timelinefilter/TimelineFilterPatch.kt index 6b47bc1e..4c418050 100644 --- a/src/main/kotlin/app/revanced/patches/tumblr/timelinefilter/TimelineFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/tumblr/timelinefilter/TimelineFilterPatch.kt @@ -60,7 +60,7 @@ object TimelineFilterPatch : BytecodePatch( fingerprint.result?.mutableMethod?.addInstructions( 0, "invoke-static {p$timelineObjectsRegister}, " + - "Lapp/revanced/tumblr/patches/TimelineFilterPatch;->" + + "Lapp/revanced/integrations/tumblr/patches/TimelineFilterPatch;->" + "filterTimeline(Ljava/util/List;)V" ) ?: throw fingerprint.exception } diff --git a/src/main/kotlin/app/revanced/patches/twitch/ad/audio/AudioAdsPatch.kt b/src/main/kotlin/app/revanced/patches/twitch/ad/audio/AudioAdsPatch.kt index bd25a2cb..44f0215a 100644 --- a/src/main/kotlin/app/revanced/patches/twitch/ad/audio/AudioAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/twitch/ad/audio/AudioAdsPatch.kt @@ -29,7 +29,7 @@ object AudioAdsPatch : BytecodePatch( mutableMethod.addInstructionsWithLabels( 0, """ - invoke-static { }, Lapp/revanced/twitch/patches/AudioAdsPatch;->shouldBlockAudioAds()Z + invoke-static { }, Lapp/revanced/integrations/twitch/patches/AudioAdsPatch;->shouldBlockAudioAds()Z move-result v0 if-eqz v0, :show_audio_ads return-void @@ -52,8 +52,7 @@ object AudioAdsPatch : BytecodePatch( StringResource( "revanced_block_audio_ads_off", "Audio ads are unblocked" - ), - default = true, + ) ) ) } diff --git a/src/main/kotlin/app/revanced/patches/twitch/ad/embedded/EmbeddedAdsPatch.kt b/src/main/kotlin/app/revanced/patches/twitch/ad/embedded/EmbeddedAdsPatch.kt index 5b7f6d8d..c1ee8f1e 100644 --- a/src/main/kotlin/app/revanced/patches/twitch/ad/embedded/EmbeddedAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/twitch/ad/embedded/EmbeddedAdsPatch.kt @@ -31,7 +31,7 @@ object EmbeddedAdsPatch : BytecodePatch( result.mutableMethod.addInstructions( 3, """ - invoke-static {}, Lapp/revanced/twitch/patches/EmbeddedAdsPatch;->createRequestInterceptor()Lapp/revanced/twitch/api/RequestInterceptor; + invoke-static {}, Lapp/revanced/integrations/twitch/patches/EmbeddedAdsPatch;->createRequestInterceptor()Lapp/revanced/integrations/twitch/api/RequestInterceptor; move-result-object v2 invoke-virtual {v0, v2}, Lokhttp3/OkHttpClient${"$"}Builder;->addInterceptor(Lokhttp3/Interceptor;)Lokhttp3/OkHttpClient${"$"}Builder; """ @@ -59,8 +59,7 @@ object EmbeddedAdsPatch : BytecodePatch( StringResource("key_revanced_proxy_luminous", "luminous"), StringResource("key_revanced_proxy_purpleadblock", "purpleadblock") ) - ), - default = "luminous" + ) ) ) diff --git a/src/main/kotlin/app/revanced/patches/twitch/ad/video/VideoAdsPatch.kt b/src/main/kotlin/app/revanced/patches/twitch/ad/video/VideoAdsPatch.kt index 00b13477..562ad6a9 100644 --- a/src/main/kotlin/app/revanced/patches/twitch/ad/video/VideoAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/twitch/ad/video/VideoAdsPatch.kt @@ -24,7 +24,7 @@ import app.revanced.patches.twitch.misc.settings.SettingsPatch compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "16.9.1"])] ) object VideoAdsPatch : AbstractAdPatch( - "Lapp/revanced/twitch/patches/VideoAdsPatch;->shouldBlockVideoAds()Z", + "Lapp/revanced/integrations/twitch/patches/VideoAdsPatch;->shouldBlockVideoAds()Z", "show_video_ads", setOf( ContentConfigShowAdsFingerprint, @@ -135,8 +135,7 @@ object VideoAdsPatch : AbstractAdPatch( StringResource( "revanced_block_video_ads_off", "Video ads are unblocked" - ), - default = true + ) ) ) } diff --git a/src/main/kotlin/app/revanced/patches/twitch/chat/antidelete/ShowDeletedMessagesPatch.kt b/src/main/kotlin/app/revanced/patches/twitch/chat/antidelete/ShowDeletedMessagesPatch.kt index d5224f60..5e316a4c 100644 --- a/src/main/kotlin/app/revanced/patches/twitch/chat/antidelete/ShowDeletedMessagesPatch.kt +++ b/src/main/kotlin/app/revanced/patches/twitch/chat/antidelete/ShowDeletedMessagesPatch.kt @@ -33,7 +33,7 @@ object ShowDeletedMessagesPatch : BytecodePatch( ) ) { private fun createSpoilerConditionInstructions(register: String = "v0") = """ - invoke-static {}, Lapp/revanced/twitch/patches/ShowDeletedMessagesPatch;->shouldUseSpoiler()Z + invoke-static {}, Lapp/revanced/integrations/twitch/patches/ShowDeletedMessagesPatch;->shouldUseSpoiler()Z move-result $register if-eqz $register, :no_spoiler """ @@ -61,7 +61,7 @@ object ShowDeletedMessagesPatch : BytecodePatch( addInstructionsWithLabels( 0, """ - invoke-static {p2}, Lapp/revanced/twitch/patches/ShowDeletedMessagesPatch;->reformatDeletedMessage(Landroid/text/Spanned;)Landroid/text/Spanned; + invoke-static {p2}, Lapp/revanced/integrations/twitch/patches/ShowDeletedMessagesPatch;->reformatDeletedMessage(Landroid/text/Spanned;)Landroid/text/Spanned; move-result-object v0 if-eqz v0, :no_reformat return-object v0 @@ -92,8 +92,7 @@ object ShowDeletedMessagesPatch : BytecodePatch( StringResource("key_revanced_deleted_messages_spoiler", "spoiler"), StringResource("key_revanced_deleted_messages_cross_out", "cross-out") ) - ), - default = "cross-out" + ) ) ) diff --git a/src/main/kotlin/app/revanced/patches/twitch/chat/autoclaim/AutoClaimChannelPointsPatch.kt b/src/main/kotlin/app/revanced/patches/twitch/chat/autoclaim/AutoClaimChannelPointsPatch.kt index a1196696..3883265e 100644 --- a/src/main/kotlin/app/revanced/patches/twitch/chat/autoclaim/AutoClaimChannelPointsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/twitch/chat/autoclaim/AutoClaimChannelPointsPatch.kt @@ -38,8 +38,7 @@ object AutoClaimChannelPointPatch : BytecodePatch( StringResource( "revanced_auto_claim_channel_points_off", "Channel Points are not claimed automatically" - ), - default = true + ) ) ) @@ -48,7 +47,7 @@ object AutoClaimChannelPointPatch : BytecodePatch( addInstructionsWithLabels( lastIndex, // place in front of return-void """ - invoke-static {}, Lapp/revanced/twitch/patches/AutoClaimChannelPointsPatch;->shouldAutoClaim()Z + invoke-static {}, Lapp/revanced/integrations/twitch/patches/AutoClaimChannelPointsPatch;->shouldAutoClaim()Z move-result v0 if-eqz v0, :auto_claim diff --git a/src/main/kotlin/app/revanced/patches/twitch/debug/DebugModePatch.kt b/src/main/kotlin/app/revanced/patches/twitch/debug/DebugModePatch.kt index ac07bdc5..a81fc17f 100644 --- a/src/main/kotlin/app/revanced/patches/twitch/debug/DebugModePatch.kt +++ b/src/main/kotlin/app/revanced/patches/twitch/debug/DebugModePatch.kt @@ -39,7 +39,7 @@ object DebugModePatch : BytecodePatch( addInstructions( 0, """ - invoke-static {}, Lapp/revanced/twitch/patches/DebugModePatch;->isDebugModeEnabled()Z + invoke-static {}, Lapp/revanced/integrations/twitch/patches/DebugModePatch;->isDebugModeEnabled()Z move-result v0 return v0 """ @@ -49,20 +49,19 @@ object DebugModePatch : BytecodePatch( SettingsPatch.PreferenceScreen.MISC.OTHER.addPreferences( SwitchPreference( - "revanced_debug_mode", + "revanced_twitch_debug_mode", StringResource( - "revanced_debug_mode_enable", - "Enable debug mode" + "revanced_twitch_debug_mode_title", + "Enable Twitch debug mode" ), StringResource( - "revanced_debug_mode_on", - "Debug mode is enabled (not recommended)" + "revanced_twitch_debug_mode_summary_on", + "Twitch debug mode is enabled (not recommended)" ), StringResource( - "revanced_debug_mode_off", - "Debug mode is disabled" - ), - default = false, + "revanced_twitch_debug_mode_summary_off", + "Twitch debug mode is disabled" + ) ) ) } diff --git a/src/main/kotlin/app/revanced/patches/twitch/misc/integrations/IntegrationsPatch.kt b/src/main/kotlin/app/revanced/patches/twitch/misc/integrations/IntegrationsPatch.kt index 66f6b035..6e0dd245 100644 --- a/src/main/kotlin/app/revanced/patches/twitch/misc/integrations/IntegrationsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/twitch/misc/integrations/IntegrationsPatch.kt @@ -6,6 +6,5 @@ import app.revanced.patches.twitch.misc.integrations.fingerprints.InitFingerprin @Patch(requiresIntegrations = true) object IntegrationsPatch : AbstractIntegrationsPatch( - "Lapp/revanced/twitch/utils/ReVancedUtils;", setOf(InitFingerprint) -) \ No newline at end of file +) diff --git a/src/main/kotlin/app/revanced/patches/twitch/misc/settings/SettingsPatch.kt b/src/main/kotlin/app/revanced/patches/twitch/misc/settings/SettingsPatch.kt index 36245a25..f1e59c6f 100644 --- a/src/main/kotlin/app/revanced/patches/twitch/misc/settings/SettingsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/twitch/misc/settings/SettingsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.twitch.misc.settings -import app.revanced.util.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels @@ -14,12 +13,14 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableField.Companion.toMut import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.shared.settings.preference.impl.PreferenceCategory import app.revanced.patches.shared.settings.preference.impl.StringResource +import app.revanced.patches.shared.settings.preference.impl.SwitchPreference import app.revanced.patches.shared.settings.util.AbstractPreferenceScreen import app.revanced.patches.twitch.misc.integrations.IntegrationsPatch import app.revanced.patches.twitch.misc.settings.fingerprints.MenuGroupsOnClickFingerprint import app.revanced.patches.twitch.misc.settings.fingerprints.MenuGroupsUpdatedFingerprint import app.revanced.patches.twitch.misc.settings.fingerprints.SettingsActivityOnCreateFingerprint import app.revanced.patches.twitch.misc.settings.fingerprints.SettingsMenuItemEnumFingerprint +import app.revanced.util.exception import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.immutable.ImmutableField import java.io.Closeable @@ -46,12 +47,12 @@ object SettingsPatch : BytecodePatch( private const val REVANCED_SETTINGS_MENU_ITEM_TITLE_RES = "revanced_settings" private const val REVANCED_SETTINGS_MENU_ITEM_ICON_RES = "ic_settings" - private const val MENU_ITEM_ENUM_CLASS = "Ltv/twitch/android/feature/settings/menu/SettingsMenuItem;" - private const val MENU_DISMISS_EVENT_CLASS = "Ltv/twitch/android/feature/settings/menu/SettingsMenuViewDelegate\$Event\$OnDismissClicked;" + private const val MENU_ITEM_ENUM_CLASS_DESCRIPTOR = "Ltv/twitch/android/feature/settings/menu/SettingsMenuItem;" + private const val MENU_DISMISS_EVENT_CLASS_DESCRIPTOR = "Ltv/twitch/android/feature/settings/menu/SettingsMenuViewDelegate\$Event\$OnDismissClicked;" - private const val INTEGRATIONS_PACKAGE = "app/revanced/twitch" - private const val SETTINGS_HOOKS_CLASS = "L$INTEGRATIONS_PACKAGE/settingsmenu/SettingsHooks;" - private const val REVANCED_UTILS_CLASS = "L$INTEGRATIONS_PACKAGE/utils/ReVancedUtils;" + private const val INTEGRATIONS_PACKAGE = "app/revanced/integrations/twitch" + private const val ACTIVITY_HOOKS_CLASS_DESCRIPTOR = "L$INTEGRATIONS_PACKAGE/settings/AppCompatActivityHook;" + private const val UTILS_CLASS_DESCRIPTOR = "L$INTEGRATIONS_PACKAGE/Utils;" override fun execute(context: BytecodeContext) { // Hook onCreate to handle fragment creation @@ -60,7 +61,7 @@ object SettingsPatch : BytecodePatch( mutableMethod.addInstructionsWithLabels( insertIndex, """ - invoke-static {p0}, $SETTINGS_HOOKS_CLASS->handleSettingsCreation(Landroidx/appcompat/app/AppCompatActivity;)Z + invoke-static {p0}, $ACTIVITY_HOOKS_CLASS_DESCRIPTOR->handleSettingsCreation(Landroidx/appcompat/app/AppCompatActivity;)Z move-result v0 if-eqz v0, :no_rv_settings_init return-void @@ -84,8 +85,8 @@ object SettingsPatch : BytecodePatch( mutableMethod.addInstructions( 0, """ - sget-object v0, $MENU_ITEM_ENUM_CLASS->$REVANCED_SETTINGS_MENU_ITEM_NAME:$MENU_ITEM_ENUM_CLASS - invoke-static {p1, v0}, $SETTINGS_HOOKS_CLASS->handleSettingMenuCreation(Ljava/util/List;Ljava/lang/Object;)Ljava/util/List; + sget-object v0, $MENU_ITEM_ENUM_CLASS_DESCRIPTOR->$REVANCED_SETTINGS_MENU_ITEM_NAME:$MENU_ITEM_ENUM_CLASS_DESCRIPTOR + invoke-static {p1, v0}, $ACTIVITY_HOOKS_CLASS_DESCRIPTOR->handleSettingMenuCreation(Ljava/util/List;Ljava/lang/Object;)Ljava/util/List; move-result-object p1 """ ) @@ -97,10 +98,10 @@ object SettingsPatch : BytecodePatch( mutableMethod.addInstructionsWithLabels( insertIndex, """ - invoke-static {p1}, $SETTINGS_HOOKS_CLASS->handleSettingMenuOnClick(Ljava/lang/Enum;)Z + invoke-static {p1}, $ACTIVITY_HOOKS_CLASS_DESCRIPTOR->handleSettingMenuOnClick(Ljava/lang/Enum;)Z move-result p2 if-eqz p2, :no_rv_settings_onclick - sget-object p1, $MENU_DISMISS_EVENT_CLASS->INSTANCE:$MENU_DISMISS_EVENT_CLASS + sget-object p1, $MENU_DISMISS_EVENT_CLASS_DESCRIPTOR->INSTANCE:$MENU_DISMISS_EVENT_CLASS_DESCRIPTOR invoke-virtual {p0, p1}, Ltv/twitch/android/core/mvp/viewdelegate/RxViewDelegate;->pushEvent(Ltv/twitch/android/core/mvp/viewdelegate/ViewDelegateEvent;)V return-void """, @@ -109,8 +110,15 @@ object SettingsPatch : BytecodePatch( } ?: throw MenuGroupsOnClickFingerprint.exception addString("revanced_settings", "ReVanced Settings", false) - addString("revanced_reboot_message", "Twitch needs to restart to apply your changes. Restart now?", false) - addString("revanced_reboot", "Restart", false) + + PreferenceScreen.MISC.OTHER.addPreferences( + SwitchPreference( + "revanced_debug", + StringResource("revanced_debug_title", "Debug logging"), + StringResource("revanced_debug_summary_on", "Debug logs are enabled"), + StringResource("revanced_debug_summary_off", "Debug logs are disabled") + ), + ) } fun addString(identifier: String, value: String, formatted: Boolean = true) = @@ -130,7 +138,7 @@ object SettingsPatch : BytecodePatch( ImmutableField( mutableMethod.definingClass, name, - MENU_ITEM_ENUM_CLASS, + MENU_ITEM_ENUM_CLASS_DESCRIPTOR, AccessFlags.PUBLIC or AccessFlags.FINAL or AccessFlags.ENUM or AccessFlags.STATIC, null, null, @@ -142,17 +150,17 @@ object SettingsPatch : BytecodePatch( mutableMethod.addInstructions( mutableMethod.implementation!!.instructions.size - 4, """ - new-instance v0, $MENU_ITEM_ENUM_CLASS + new-instance v0, $MENU_ITEM_ENUM_CLASS_DESCRIPTOR const-string v1, "$titleResourceName" - invoke-static {v1}, $REVANCED_UTILS_CLASS->getStringId(Ljava/lang/String;)I + invoke-static {v1}, $UTILS_CLASS_DESCRIPTOR->getStringId(Ljava/lang/String;)I move-result v1 const-string v3, "$iconResourceName" - invoke-static {v3}, $REVANCED_UTILS_CLASS->getDrawableId(Ljava/lang/String;)I + invoke-static {v3}, $UTILS_CLASS_DESCRIPTOR->getDrawableId(Ljava/lang/String;)I move-result v3 const-string v4, "$name" const/4 v5, $value - invoke-direct {v0, v4, v5, v1, v3}, $MENU_ITEM_ENUM_CLASS->(Ljava/lang/String;III)V - sput-object v0, $MENU_ITEM_ENUM_CLASS->$name:$MENU_ITEM_ENUM_CLASS + invoke-direct {v0, v4, v5, v1, v3}, $MENU_ITEM_ENUM_CLASS_DESCRIPTOR->(Ljava/lang/String;III)V + sput-object v0, $MENU_ITEM_ENUM_CLASS_DESCRIPTOR->$name:$MENU_ITEM_ENUM_CLASS_DESCRIPTOR """ ) } @@ -179,7 +187,7 @@ object SettingsPatch : BytecodePatch( key, StringResource("${key}_title", title), preferences.sortedBy { it.title.value }, - "app.revanced.twitch.settingsmenu.preference.CustomPreferenceCategory" + "app.revanced.integrations.twitch.settings.preference.CustomPreferenceCategory" ) } } diff --git a/src/main/kotlin/app/revanced/patches/twitter/misc/hook/json/JsonHookPatch.kt b/src/main/kotlin/app/revanced/patches/twitter/misc/hook/json/JsonHookPatch.kt index 847a6770..d7e3687c 100644 --- a/src/main/kotlin/app/revanced/patches/twitter/misc/hook/json/JsonHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/twitter/misc/hook/json/JsonHookPatch.kt @@ -20,7 +20,7 @@ import java.io.InvalidClassException object JsonHookPatch : BytecodePatch( setOf(LoganSquareFingerprint) ), Closeable { - private const val JSON_HOOK_CLASS_NAMESPACE = "app/revanced/twitter/patches/hook/json" + private const val JSON_HOOK_CLASS_NAMESPACE = "app/revanced/integrations/twitter/patches/hook/json" private const val JSON_HOOK_PATCH_CLASS_DESCRIPTOR = "L$JSON_HOOK_CLASS_NAMESPACE/JsonHookPatch;" private const val BASE_PATCH_CLASS_NAME = "BaseJsonHook" private const val JSON_HOOK_CLASS_DESCRIPTOR = "L$JSON_HOOK_CLASS_NAMESPACE/$BASE_PATCH_CLASS_NAME;" diff --git a/src/main/kotlin/app/revanced/patches/twitter/misc/hook/patch/ads/HideAdsPatch.kt b/src/main/kotlin/app/revanced/patches/twitter/misc/hook/patch/ads/HideAdsPatch.kt index 40ff710b..15a8f3b2 100644 --- a/src/main/kotlin/app/revanced/patches/twitter/misc/hook/patch/ads/HideAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/twitter/misc/hook/patch/ads/HideAdsPatch.kt @@ -12,4 +12,4 @@ import app.revanced.patches.twitter.misc.hook.patch.BaseHookPatchPatch compatiblePackages = [CompatiblePackage("com.twitter.android")] ) @Suppress("unused") -object HideAdsPatch : BaseHookPatchPatch("Lapp/revanced/twitter/patches/hook/patch/ads/AdsHook;") \ No newline at end of file +object HideAdsPatch : BaseHookPatchPatch("Lapp/revanced/integrations/twitter/patches/hook/patch/ads/AdsHook;") \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/twitter/misc/hook/patch/recommendation/HideRecommendedUsersPatch.kt b/src/main/kotlin/app/revanced/patches/twitter/misc/hook/patch/recommendation/HideRecommendedUsersPatch.kt index d510df7d..211e0f7c 100644 --- a/src/main/kotlin/app/revanced/patches/twitter/misc/hook/patch/recommendation/HideRecommendedUsersPatch.kt +++ b/src/main/kotlin/app/revanced/patches/twitter/misc/hook/patch/recommendation/HideRecommendedUsersPatch.kt @@ -12,5 +12,5 @@ import app.revanced.patches.twitter.misc.hook.patch.BaseHookPatchPatch ) @Suppress("unused") object HideRecommendedUsersPatch : BaseHookPatchPatch( - "Lapp/revanced/twitter/patches/hook/patch/recommendation/RecommendedUsersHook;" + "Lapp/revanced/integrations/twitter/patches/hook/patch/recommendation/RecommendedUsersHook;" ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt index d7d81558..84167225 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt @@ -65,7 +65,7 @@ object HideAdsPatch : BytecodePatch() { .injectHideViewCall( insertIndex, viewRegister, - "Lapp/revanced/integrations/patches/components/AdsFilter;", + "Lapp/revanced/integrations/youtube/patches/components/AdsFilter;", "hideAdAttributionView" ) } diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsResourcePatch.kt index d7c0ac13..94c53bc9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsResourcePatch.kt @@ -19,7 +19,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch.PreferenceScreen ) object HideAdsResourcePatch : ResourcePatch() { private const val FILTER_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/components/AdsFilter;" + "Lapp/revanced/integrations/youtube/patches/components/AdsFilter;" internal var adAttributionId: Long = -1 diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt index e337874a..9ec7fa8c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt @@ -33,7 +33,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction ) object HideGetPremiumPatch : BytecodePatch(setOf(GetPremiumViewFingerprint)) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/HideGetPremiumPatch;" + "Lapp/revanced/integrations/youtube/patches/HideGetPremiumPatch;" override fun execute(context: BytecodeContext) { SettingsPatch.PreferenceScreen.ADS.addPreferences( diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt index 5211b80f..370e9957 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt @@ -53,7 +53,7 @@ object VideoAdsPatch : BytecodePatch( loadVideoAdsFingerprintMethod.addInstructionsWithLabels( 0, """ - invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z + invoke-static { }, Lapp/revanced/integrations/youtube/patches/VideoAdsPatch;->shouldShowAds()Z move-result v0 if-nez v0, :show_video_ads return-void diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt index c9e86b90..659b2ff1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt @@ -32,7 +32,7 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch ) @Suppress("unused") object CopyVideoUrlBytecodePatch : BytecodePatch() { - private const val INTEGRATIONS_PLAYER_PACKAGE = "Lapp/revanced/integrations/videoplayer" + private const val INTEGRATIONS_PLAYER_PACKAGE = "Lapp/revanced/integrations/youtube/videoplayer" private val BUTTONS_DESCRIPTORS = listOf( "$INTEGRATIONS_PLAYER_PACKAGE/CopyVideoUrlButton;", "$INTEGRATIONS_PLAYER_PACKAGE/CopyVideoUrlTimestampButton;" diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt index 14de79c0..40bd6e3f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt @@ -30,7 +30,7 @@ object RemoveViewerDiscretionDialogPatch : BytecodePatch( setOf(CreateDialogFingerprint) ) { private const val INTEGRATIONS_METHOD_DESCRIPTOR = - "Lapp/revanced/integrations/patches/RemoveViewerDiscretionDialogPatch;->" + + "Lapp/revanced/integrations/youtube/patches/RemoveViewerDiscretionDialogPatch;->" + "confirmDialog(Landroid/app/AlertDialog;)V" override fun execute(context: BytecodeContext) { diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/ExternalDownloadsBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/ExternalDownloadsBytecodePatch.kt index 25042570..015aeba1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/ExternalDownloadsBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/ExternalDownloadsBytecodePatch.kt @@ -32,7 +32,7 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch ) @Suppress("unused") object ExternalDownloadsBytecodePatch : BytecodePatch() { - private const val BUTTON_DESCRIPTOR = "Lapp/revanced/integrations/videoplayer/ExternalDownloadButton;" + private const val BUTTON_DESCRIPTOR = "Lapp/revanced/integrations/youtube/videoplayer/ExternalDownloadButton;" override fun execute(context: BytecodeContext) { /* diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt index e02b65c8..df776163 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt @@ -38,7 +38,7 @@ object DisablePreciseSeekingGesturePatch : BytecodePatch( setOf(IsSwipingUpFingerprint) ) { private const val INTEGRATIONS_METHOD_DESCRIPTOR = - "Lapp/revanced/integrations/patches/DisablePreciseSeekingGesturePatch;->" + + "Lapp/revanced/integrations/youtube/patches/DisablePreciseSeekingGesturePatch;->" + "disableGesture(Landroid/view/VelocityTracker;Landroid/view/MotionEvent;)V" override fun execute(context: BytecodeContext) { diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt index 1451da2d..5d0816a6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt @@ -85,7 +85,7 @@ object EnableSeekbarTappingPatch : BytecodePatch( addInstructionsWithLabels( insertIndex, """ - invoke-static { }, Lapp/revanced/integrations/patches/SeekbarTappingPatch;->seekbarTappingEnabled()Z + invoke-static { }, Lapp/revanced/integrations/youtube/patches/SeekbarTappingPatch;->seekbarTappingEnabled()Z move-result v$freeRegister if-eqz v$freeRegister, :disabled ${oMethod.toInvokeInstructionString()} diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt index 42bd8727..d597625c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt @@ -38,7 +38,7 @@ object EnableSlideToSeekPatch : BytecodePatch( DoubleSpeedSeekNoticeFingerprint ) ) { - private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/SlideToSeekPatch;" + private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/SlideToSeekPatch;" override fun execute(context: BytecodeContext) { SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences( diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/fingerprints/SwipeControlsHostActivityFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/fingerprints/SwipeControlsHostActivityFingerprint.kt index 14bdfb9b..a4b6100a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/fingerprints/SwipeControlsHostActivityFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/fingerprints/SwipeControlsHostActivityFingerprint.kt @@ -8,6 +8,6 @@ internal object SwipeControlsHostActivityFingerprint : MethodFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, parameters = listOf(), customFingerprint = { methodDef, _ -> - methodDef.definingClass == "Lapp/revanced/integrations/swipecontrols/SwipeControlsHostActivity;" + methodDef.definingClass == "Lapp/revanced/integrations/youtube/swipecontrols/SwipeControlsHostActivity;" } ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt index 4af37c85..dec88bf0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt @@ -57,7 +57,7 @@ object AutoCaptionsPatch : BytecodePatch( 0, """ const/4 v0, 0x$enabled - sput-boolean v0, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->captionsButtonDisabled:Z + sput-boolean v0, Lapp/revanced/integrations/youtube/patches/DisableAutoCaptionsPatch;->captionsButtonDisabled:Z """ ) ?: throw fingerprint.exception } @@ -65,10 +65,10 @@ object AutoCaptionsPatch : BytecodePatch( SubtitleTrackFingerprint.result?.mutableMethod?.addInstructionsWithLabels( 0, """ - invoke-static {}, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->autoCaptionsEnabled()Z + invoke-static {}, Lapp/revanced/integrations/youtube/patches/DisableAutoCaptionsPatch;->autoCaptionsEnabled()Z move-result v0 if-eqz v0, :auto_captions_enabled - sget-boolean v0, Lapp/revanced/integrations/patches/DisableAutoCaptionsPatch;->captionsButtonDisabled:Z + sget-boolean v0, Lapp/revanced/integrations/youtube/patches/DisableAutoCaptionsPatch;->captionsButtonDisabled:Z if-nez v0, :auto_captions_enabled const/4 v0, 0x1 return v0 diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt index 4e905b25..7f88b2b7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt @@ -36,7 +36,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch @Suppress("unused") object HideButtonsPatch : ResourcePatch() { private const val FILTER_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/components/ButtonsFilter;" + "Lapp/revanced/integrations/youtube/patches/components/ButtonsFilter;" override fun execute(context: ResourceContext) { SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt index b7ac4be4..4e3ab1d1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt @@ -78,7 +78,7 @@ object HideAutoplayButtonPatch : BytecodePatch( addInstructionsWithLabels( insertIndex, """ - invoke-static {}, Lapp/revanced/integrations/patches/HideAutoplayButtonPatch;->isButtonShown()Z + invoke-static {}, Lapp/revanced/integrations/youtube/patches/HideAutoplayButtonPatch;->isButtonShown()Z move-result v$clobberRegister if-eqz v$clobberRegister, :hidden """, diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt index 1ce3e7ee..a3114d60 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt @@ -58,7 +58,7 @@ object HideCaptionsButtonPatch : BytecodePatch( subtitleButtonControllerMethod.addInstruction( insertIndex, """ - invoke-static {v0}, Lapp/revanced/integrations/patches/HideCaptionsButtonPatch;->hideCaptionsButton(Landroid/widget/ImageView;)V + invoke-static {v0}, Lapp/revanced/integrations/youtube/patches/HideCaptionsButtonPatch;->hideCaptionsButton(Landroid/widget/ImageView;)V """ ) } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/cast/HideCastButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/cast/HideCastButtonPatch.kt index 394d7623..89cb368f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/cast/HideCastButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/cast/HideCastButtonPatch.kt @@ -40,7 +40,7 @@ object HideCastButtonPatch : BytecodePatch() { addInstructions( 0, """ - invoke-static {p1}, Lapp/revanced/integrations/patches/HideCastButtonPatch;->getCastButtonOverrideV2(I)I + invoke-static {p1}, Lapp/revanced/integrations/youtube/patches/HideCastButtonPatch;->getCastButtonOverrideV2(I)I move-result p1 """ ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt index 524ebca8..ceb78d6c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt @@ -45,7 +45,7 @@ object NavigationButtonsPatch : BytecodePatch( setOf(AddCreateButtonViewFingerprint) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/NavigationButtonsPatch;" + "Lapp/revanced/integrations/youtube/patches/NavigationButtonsPatch;" override fun execute(context: BytecodeContext) { SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt index c03b210a..dc64b939 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt @@ -72,10 +72,10 @@ object HidePlayerButtonsPatch : BytecodePatch( mutableMethod.addInstructions( callIndex, """ - invoke-static { v$hasNextParameterRegister }, Lapp/revanced/integrations/patches/HidePlayerButtonsPatch;->previousOrNextButtonIsVisible(Z)Z + invoke-static { v$hasNextParameterRegister }, Lapp/revanced/integrations/youtube/patches/HidePlayerButtonsPatch;->previousOrNextButtonIsVisible(Z)Z move-result v$hasNextParameterRegister - invoke-static { v$hasPreviousParameterRegister }, Lapp/revanced/integrations/patches/HidePlayerButtonsPatch;->previousOrNextButtonIsVisible(Z)Z + invoke-static { v$hasPreviousParameterRegister }, Lapp/revanced/integrations/youtube/patches/HidePlayerButtonsPatch;->previousOrNextButtonIsVisible(Z)Z move-result v$hasPreviousParameterRegister """ ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt index 22fb37d7..ae2d3c40 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt @@ -48,7 +48,7 @@ object AlbumCardsPatch : BytecodePatch( addInstruction( insertIndex, "invoke-static {v$albumCardViewRegister}, " + - "Lapp/revanced/integrations/patches/HideAlbumCardsPatch;" + + "Lapp/revanced/integrations/youtube/patches/HideAlbumCardsPatch;" + "->" + "hideAlbumCard(Landroid/view/View;)V" ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/breakingnews/BreakingNewsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/breakingnews/BreakingNewsPatch.kt index 9b988c61..7fb2202f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/breakingnews/BreakingNewsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/breakingnews/BreakingNewsPatch.kt @@ -50,7 +50,7 @@ object BreakingNewsPatch : BytecodePatch( insertIndex, """ invoke-static {v$breakingNewsViewRegister}, - Lapp/revanced/integrations/patches/HideBreakingNewsPatch; + Lapp/revanced/integrations/youtube/patches/HideBreakingNewsPatch; -> hideBreakingNews(Landroid/view/View;)V """ diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt index 5036a5a5..dd81aa19 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt @@ -35,7 +35,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch @Suppress("unused") object CommentsPatch : ResourcePatch() { private const val FILTER_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/components/CommentsFilter;" + "Lapp/revanced/integrations/youtube/patches/components/CommentsFilter;" override fun execute(context: ResourceContext) { LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt index d818f0de..f01894d0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt @@ -38,7 +38,7 @@ object CrowdfundingBoxPatch : BytecodePatch( setOf(CrowdfundingBoxFingerprint) ) { private const val INTEGRATIONS_METHOD_DESCRIPTOR = - "Lapp/revanced/integrations/patches/HideCrowdfundingBoxPatch;->hideCrowdfundingBox(Landroid/view/View;)V" + "Lapp/revanced/integrations/youtube/patches/HideCrowdfundingBoxPatch;->hideCrowdfundingBox(Landroid/view/View;)V" override fun execute(context: BytecodeContext) { CrowdfundingBoxFingerprint.result?.let { diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt index 47cf5955..c85e6380 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt @@ -53,7 +53,7 @@ object HideEndscreenCardsPatch : BytecodePatch( addInstruction( insertIndex, - "invoke-static { v$viewRegister }, Lapp/revanced/integrations/patches/HideEndscreenCardsPatch;->hideEndscreen(Landroid/view/View;)V" + "invoke-static { v$viewRegister }, Lapp/revanced/integrations/youtube/patches/HideEndscreenCardsPatch;->hideEndscreen(Landroid/view/View;)V" ) } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt index 83f79fc3..940cb4ca 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt @@ -42,7 +42,7 @@ object HideFilterBarPatch : BytecodePatch( ) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/HideFilterBarPatch;" + "Lapp/revanced/integrations/youtube/patches/HideFilterBarPatch;" override fun execute(context: BytecodeContext) { FilterBarHeightFingerprint.patch { register -> diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt index 7e0ce5ab..dd98a8ae 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt @@ -34,7 +34,7 @@ object HideFloatingMicrophoneButtonPatch : BytecodePatch( setOf(ShowFloatingMicrophoneButtonFingerprint) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/HideFloatingMicrophoneButtonPatch;" + "Lapp/revanced/integrations/youtube/patches/HideFloatingMicrophoneButtonPatch;" override fun execute(context: BytecodeContext) { ShowFloatingMicrophoneButtonFingerprint.result?.let { result -> diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt index e563d23a..60a2264d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt @@ -34,7 +34,7 @@ object DisableFullscreenAmbientModePatch : BytecodePatch( setOf(InitializeAmbientModeFingerprint) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/DisableFullscreenAmbientModePatch;" + "Lapp/revanced/integrations/youtube/patches/DisableFullscreenAmbientModePatch;" override fun execute(context: BytecodeContext) { SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index be721d5c..244c90da 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -48,9 +48,9 @@ object HideLayoutComponentsPatch : BytecodePatch( setOf(ParseElementFromBufferFingerprint, PlayerOverlayFingerprint) ) { private const val LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/components/LayoutComponentsFilter;" + "Lapp/revanced/integrations/youtube/patches/components/LayoutComponentsFilter;" private const val DESCRIPTION_COMPONENTS_FILTER_CLASS_NAME = - "Lapp/revanced/integrations/patches/components/DescriptionComponentsFilter;" + "Lapp/revanced/integrations/youtube/patches/components/DescriptionComponentsFilter;" override fun execute(context: BytecodeContext) { PreferenceScreen.LAYOUT.addPreferences( diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt index 3cab5a89..d49c32e4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt @@ -48,7 +48,7 @@ object HideInfoCardsPatch : BytecodePatch( ) ) { private const val FILTER_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/components/HideInfoCardsFilterPatch;" + "Lapp/revanced/integrations/youtube/patches/components/HideInfoCardsFilterPatch;" override fun execute(context: BytecodeContext) { InfocardsIncognitoFingerprint.also { @@ -62,7 +62,7 @@ object HideInfoCardsPatch : BytecodePatch( addInstruction( invokeInstructionIndex, "invoke-static {v${getInstruction(invokeInstructionIndex).registerC}}," + - " Lapp/revanced/integrations/patches/HideInfoCardsPatch;->hideInfoCardsIncognito(Landroid/view/View;)V" + " Lapp/revanced/integrations/youtube/patches/HideInfoCardsPatch;->hideInfoCardsIncognito(Landroid/view/View;)V" ) } @@ -75,7 +75,7 @@ object HideInfoCardsPatch : BytecodePatch( hideInfoCardsCallMethod.addInstructionsWithLabels( invokeInterfaceIndex, """ - invoke-static {}, Lapp/revanced/integrations/patches/HideInfoCardsPatch;->hideInfoCardsMethodCall()Z + invoke-static {}, Lapp/revanced/integrations/youtube/patches/HideInfoCardsPatch;->hideInfoCardsMethodCall()Z move-result v$toggleRegister if-nez v$toggleRegister, :hide_info_cards """, diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/loadmorebutton/HideLoadMoreButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/loadmorebutton/HideLoadMoreButtonPatch.kt index 1e4538b3..fdd2fc1e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/loadmorebutton/HideLoadMoreButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/loadmorebutton/HideLoadMoreButtonPatch.kt @@ -34,7 +34,7 @@ object HideLoadMoreButtonPatch : BytecodePatch( setOf(HideLoadMoreButtonFingerprint) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/HideLoadMoreButtonPatch;" + "Lapp/revanced/integrations/youtube/patches/HideLoadMoreButtonPatch;" override fun execute(context: BytecodeContext) { HideLoadMoreButtonFingerprint.result?.let { diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/personalinformation/HideEmailAddressPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/personalinformation/HideEmailAddressPatch.kt index 011ec9df..d505f2c9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/personalinformation/HideEmailAddressPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/personalinformation/HideEmailAddressPatch.kt @@ -44,7 +44,7 @@ object HideEmailAddressPatch : BytecodePatch( addInstructions( setVisibilityConstIndex, """ - invoke-static {v$setVisibilityConstRegister}, Lapp/revanced/integrations/patches/HideEmailAddressPatch;->hideEmailAddress(I)I + invoke-static {v$setVisibilityConstRegister}, Lapp/revanced/integrations/youtube/patches/HideEmailAddressPatch;->hideEmailAddress(I)I move-result v$setVisibilityConstRegister """ ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt index 7e8dc69e..df8387a9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt @@ -36,7 +36,7 @@ object HidePlayerFlyoutMenuPatch : ResourcePatch() { private const val KEY = "revanced_hide_player_flyout" private const val FILTER_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/components/PlayerFlyoutMenuItemsFilter;" + "Lapp/revanced/integrations/youtube/patches/components/PlayerFlyoutMenuItemsFilter;" override fun execute(context: ResourceContext) { SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt index 76c9cbe4..169741ca 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt @@ -38,7 +38,7 @@ object DisableRollingNumberAnimationPatch : BytecodePatch( ) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/DisableRollingNumberAnimationsPatch;" + "Lapp/revanced/integrations/youtube/patches/DisableRollingNumberAnimationsPatch;" override fun execute(context: BytecodeContext) { SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt index 99e05677..ef8853b3 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt @@ -63,7 +63,7 @@ object HideSeekbarPatch : BytecodePatch( 0, """ const/4 v0, 0x0 - invoke-static { }, Lapp/revanced/integrations/patches/HideSeekbarPatch;->hideSeekbar()Z + invoke-static { }, Lapp/revanced/integrations/youtube/patches/HideSeekbarPatch;->hideSeekbar()Z move-result v0 if-eqz v0, :hide_seekbar return-void diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt index e3438a81..ddd7c735 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt @@ -51,7 +51,7 @@ object HideShortsComponentsPatch : BytecodePatch( SetPivotBarVisibilityParentFingerprint ) ) { - private const val FILTER_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/components/ShortsFilter;" + private const val FILTER_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/components/ShortsFilter;" override fun execute(context: BytecodeContext) { // region Hide the Shorts shelf. diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt index 156e22ef..0715c65c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt @@ -33,7 +33,7 @@ object DisableSuggestedVideoEndScreenPatch : BytecodePatch( setOf(CreateEndScreenViewFingerprint) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/DisableSuggestedVideoEndScreenPatch;" + "Lapp/revanced/integrations/youtube/patches/DisableSuggestedVideoEndScreenPatch;" override fun execute(context: BytecodeContext) { CreateEndScreenViewFingerprint.result?.let { diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt index c979fd3a..39e1f6ff 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt @@ -48,7 +48,7 @@ object HideTimestampPatch : BytecodePatch( mutableMethod.addInstructionsWithLabels( 0, """ - invoke-static { }, Lapp/revanced/integrations/patches/HideTimestampPatch;->hideTimestamp()Z + invoke-static { }, Lapp/revanced/integrations/youtube/patches/HideTimestampPatch;->hideTimestamp()Z move-result v0 if-eqz v0, :hide_time return-void diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt index c1ef985a..602bf6a3 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt @@ -50,7 +50,7 @@ object PlayerPopupPanelsPatch : BytecodePatch( engagementPanelControllerMethod.addInstructionsWithLabels( 0, """ - invoke-static { }, Lapp/revanced/integrations/patches/DisablePlayerPopupPanelsPatch;->disablePlayerPopupPanels()Z + invoke-static { }, Lapp/revanced/integrations/youtube/patches/DisablePlayerPopupPanelsPatch;->disablePlayerPopupPanels()Z move-result v0 if-eqz v0, :player_popup_panels if-eqz p4, :player_popup_panels diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/player/overlay/CustomPlayerOverlayOpacityPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/player/overlay/CustomPlayerOverlayOpacityPatch.kt index e0f767b0..fd00bf39 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/player/overlay/CustomPlayerOverlayOpacityPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/player/overlay/CustomPlayerOverlayOpacityPatch.kt @@ -21,7 +21,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction ) @Suppress("unused") object CustomPlayerOverlayOpacityPatch : BytecodePatch(setOf(CreatePlayerOverviewFingerprint)) { - private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/CustomPlayerOverlayOpacityPatch;" + private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/CustomPlayerOverlayOpacityPatch;" override fun execute(context: BytecodeContext) { CreatePlayerOverviewFingerprint.result?.let { result -> diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt index f35e863d..0af09a95 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt @@ -62,10 +62,10 @@ object ReturnYouTubeDislikePatch : BytecodePatch( ) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/ReturnYouTubeDislikePatch;" + "Lapp/revanced/integrations/youtube/patches/ReturnYouTubeDislikePatch;" private const val FILTER_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/components/ReturnYouTubeDislikeFilterPatch;" + "Lapp/revanced/integrations/youtube/patches/components/ReturnYouTubeDislikeFilterPatch;" override fun execute(context: BytecodeContext) { // region Inject newVideoLoaded event handler to update dislikes when a new video is loaded. diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt index 2a81f45a..3bbe66fa 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt @@ -80,7 +80,7 @@ object WideSearchbarPatch : BytecodePatch( addInstructions( implementation!!.instructions.size - 1, """ - invoke-static {}, Lapp/revanced/integrations/patches/WideSearchbarPatch;->enableWideSearchbar()Z + invoke-static {}, Lapp/revanced/integrations/youtube/patches/WideSearchbarPatch;->enableWideSearchbar()Z move-result p0 """ ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt index a95ca861..1df0b139 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt @@ -11,7 +11,6 @@ import app.revanced.patches.shared.settings.preference.impl.StringResource import app.revanced.patches.shared.settings.preference.impl.SwitchPreference import app.revanced.patches.youtube.layout.seekbar.fingerprints.FullscreenSeekbarThumbnailsFingerprint import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch -import app.revanced.patches.youtube.misc.settings.SettingsPatch @Patch( name = "Restore old seekbar thumbnails", @@ -35,7 +34,7 @@ object RestoreOldSeekbarThumbnailsPatch : BytecodePatch( setOf(FullscreenSeekbarThumbnailsFingerprint) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/RestoreOldSeekbarThumbnailsPatch;" + "Lapp/revanced/integrations/youtube/patches/RestoreOldSeekbarThumbnailsPatch;" override fun execute(context: BytecodeContext) { SeekbarPreferencesPatch.addPreferences( diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt index 84aae5b8..98acf716 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt @@ -26,7 +26,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction internal object SeekbarColorBytecodePatch : BytecodePatch( setOf(PlayerSeekbarColorFingerprint, ShortsSeekbarColorFingerprint, SetSeekbarClickedColorFingerprint) ) { - private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/theme/SeekbarColorPatch;" + private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/theme/SeekbarColorPatch;" override fun execute(context: BytecodeContext) { fun MutableMethod.addColorChangeInstructions(resourceId: Long) { diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorResourcePatch.kt index ae968743..9f774a60 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorResourcePatch.kt @@ -38,7 +38,7 @@ internal object SeekbarColorResourcePatch : ResourcePatch(){ val scaleNode = progressNode.getElementsByTagName("scale").item(0) as Element val shapeNode = scaleNode.getElementsByTagName("shape").item(0) as Element val replacementNode = editor.file.createElement( - "app.revanced.integrations.patches.theme.ProgressBarDrawable") + "app.revanced.integrations.youtube.patches.theme.ProgressBarDrawable") scaleNode.replaceChild(replacementNode, shapeNode) } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt index f4adedbb..6199e007 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt @@ -69,13 +69,13 @@ object SponsorBlockBytecodePatch : BytecodePatch( ) ) { private const val INTEGRATIONS_SEGMENT_PLAYBACK_CONTROLLER_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/sponsorblock/SegmentPlaybackController;" + "Lapp/revanced/integrations/youtube/sponsorblock/SegmentPlaybackController;" private const val INTEGRATIONS_CREATE_SEGMENT_BUTTON_CONTROLLER_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/sponsorblock/ui/CreateSegmentButtonController;" + "Lapp/revanced/integrations/youtube/sponsorblock/ui/CreateSegmentButtonController;" private const val INTEGRATIONS_VOTING_BUTTON_CONTROLLER_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/sponsorblock/ui/VotingButtonController;" + "Lapp/revanced/integrations/youtube/sponsorblock/ui/VotingButtonController;" private const val INTEGRATIONS_SPONSORBLOCK_VIEW_CONTROLLER_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/sponsorblock/ui/SponsorBlockViewController;" + "Lapp/revanced/integrations/youtube/sponsorblock/ui/SponsorBlockViewController;" override fun execute(context: BytecodeContext) { LayoutConstructorFingerprint.result?.let { diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt index f9dd4ea9..bcd23e80 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt @@ -38,7 +38,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction object SpoofAppVersionPatch : BytecodePatch( setOf(SpoofAppVersionFingerprint) ) { - private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/spoof/SpoofAppVersionPatch;" + private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/spoof/SpoofAppVersionPatch;" override fun execute(context: BytecodeContext) { SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt index 80d1ee6e..64047aaa 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt @@ -29,7 +29,7 @@ object ChangeStartPagePatch : BytecodePatch( setOf(HomeActivityFingerprint) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/ChangeStartPagePatch;" + "Lapp/revanced/integrations/youtube/patches/ChangeStartPagePatch;" override fun execute(context: BytecodeContext) { SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( @@ -60,8 +60,7 @@ object ChangeStartPagePatch : BytecodePatch( StringResource("revanced_start_page_explore_value_4", "open.explore"), StringResource("revanced_start_page_shorts_value_5", "open.shorts"), ) - ), - default = "" + ) ) ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt index 523e1c6a..9518cc55 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt @@ -36,7 +36,7 @@ object DisableResumingShortsOnStartupPatch : BytecodePatch( ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/DisableResumingStartupShortsPlayerPatch;" + "Lapp/revanced/integrations/youtube/patches/DisableResumingStartupShortsPlayerPatch;" override fun execute(context: BytecodeContext) { SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt index 38fb7953..60521497 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt @@ -44,7 +44,7 @@ object EnableTabletLayoutPatch : BytecodePatch( addInstructionsWithLabels( 0, """ - invoke-static { }, Lapp/revanced/integrations/patches/EnableTabletLayoutPatch;->enableTabletLayout()Z + invoke-static { }, Lapp/revanced/integrations/youtube/patches/EnableTabletLayoutPatch;->enableTabletLayout()Z move-result v0 # Free register if-nez v0, :is_large_form_factor """, diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/tabletminiplayer/TabletMiniPlayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/tabletminiplayer/TabletMiniPlayerPatch.kt index 7e0318f3..e85cd940 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/tabletminiplayer/TabletMiniPlayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/tabletminiplayer/TabletMiniPlayerPatch.kt @@ -120,7 +120,7 @@ object TabletMiniPlayerPatch : BytecodePatch( this.addInstructions( index, """ - invoke-static {v$overrideRegister}, Lapp/revanced/integrations/patches/TabletMiniPlayerOverridePatch;->getTabletMiniPlayerOverride(Z)Z + invoke-static {v$overrideRegister}, Lapp/revanced/integrations/youtube/patches/TabletMiniPlayerOverridePatch;->getTabletMiniPlayerOverride(Z)Z move-result v$overrideRegister """ ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt index a78093b3..afd6e6cb 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt @@ -46,7 +46,7 @@ object ThemeBytecodePatch : BytecodePatch( setOf(UseGradientLoadingScreenFingerprint) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/theme/ThemePatch;" + "Lapp/revanced/integrations/youtube/patches/theme/ThemePatch;" internal const val GRADIENT_LOADING_SCREEN_AB_CONSTANT = 45412406L diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt index 15fbe4de..70b9ba1b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt @@ -55,7 +55,7 @@ object AlternativeThumbnailsPatch : BytecodePatch( ) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/AlternativeThumbnailsPatch;" + "Lapp/revanced/integrations/youtube/patches/AlternativeThumbnailsPatch;" private lateinit var loadImageUrlMethod: MutableMethod private var loadImageUrlIndex = 0 @@ -115,7 +115,7 @@ object AlternativeThumbnailsPatch : BytecodePatch( NonInteractivePreference( StringResource("revanced_alt_thumbnail_about_title", "Thumbnails in use"), null, // Summary is dynamically updated based on the current settings. - tag = "app.revanced.integrations.settingsmenu.AlternativeThumbnailsStatusPreference" + tag = "app.revanced.integrations.youtube.settings.preference.AlternativeThumbnailsStatusPreference" ), SwitchPreference( "revanced_alt_thumbnail_dearrow", @@ -154,7 +154,7 @@ object AlternativeThumbnailsPatch : BytecodePatch( + "\\n\\nTap here to learn more about DeArrow" ), // Custom about preference with link to the DeArrow website. - tag = "app.revanced.integrations.settingsmenu.AlternativeThumbnailsAboutDeArrowPreference", + tag = "app.revanced.integrations.youtube.settings.preference.AlternativeThumbnailsAboutDeArrowPreference", selectable = true ), SwitchPreference( diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/announcements/AnnouncementsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/announcements/AnnouncementsPatch.kt index aeced767..0e0c8b5a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/announcements/AnnouncementsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/announcements/AnnouncementsPatch.kt @@ -24,7 +24,7 @@ object AnnouncementsPatch : BytecodePatch( setOf(WatchWhileActivityFingerprint) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/announcements/AnnouncementsPatch;" + "Lapp/revanced/integrations/youtube/patches/announcements/AnnouncementsPatch;" override fun execute(context: BytecodeContext) { val onCreateMethod = WatchWhileActivityFingerprint.result?.let { @@ -48,10 +48,12 @@ object AnnouncementsPatch : BytecodePatch( StringResource( "revanced_announcements_summary_on", "Announcements are shown on startup" - ), StringResource( + ), + StringResource( "revanced_announcements_summary_off", "Announcements are not shown on startup" - ), StringResource( + ), + StringResource( "revanced_announcements_enabled_summary", "Show announcements on startup" ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt index 9e3ab04b..86f38ec8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt @@ -52,7 +52,7 @@ object AutoRepeatPatch : BytecodePatch( val parentResult = AutoRepeatParentFingerprint.result ?: throw PatchException("ParentFingerprint did not resolve.") - //this one needs to be called when app/revanced/integrations/patches/AutoRepeatPatch;->shouldAutoRepeat() returns true + //this one needs to be called when app/revanced/integrations/youtube/patches/AutoRepeatPatch;->shouldAutoRepeat() returns true val playMethod = parentResult.mutableMethod AutoRepeatFingerprint.resolve(context, parentResult.classDef) //String is: Laamp;->E()V @@ -65,7 +65,7 @@ object AutoRepeatPatch : BytecodePatch( //Instructions to add to the smali code val instructions = """ - invoke-static {}, Lapp/revanced/integrations/patches/AutoRepeatPatch;->shouldAutoRepeat()Z + invoke-static {}, Lapp/revanced/integrations/youtube/patches/AutoRepeatPatch;->shouldAutoRepeat()Z move-result v0 if-eqz v0, :noautorepeat invoke-virtual {p0}, $methodToCall diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt index 7bfc795a..9bada899 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt @@ -33,7 +33,7 @@ object SpoofDeviceDimensionsPatch : BytecodePatch( setOf(DeviceDimensionsModelToStringFingerprint) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/spoof/SpoofDeviceDimensionsPatch;" + "Lapp/revanced/integrations/youtube/patches/spoof/SpoofDeviceDimensionsPatch;" override fun execute(context: BytecodeContext) { SettingsPatch.PreferenceScreen.MISC.addPreferences( diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/backtoexitgesture/FixBackToExitGesturePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/backtoexitgesture/FixBackToExitGesturePatch.kt index e5c73683..663299b9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/backtoexitgesture/FixBackToExitGesturePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/backtoexitgesture/FixBackToExitGesturePatch.kt @@ -64,6 +64,6 @@ internal object FixBackToExitGesturePatch : BytecodePatch( val register: String = "", val methodName: String, val parameterTypes: String = "" ) { override fun toString() = - "invoke-static {$register}, Lapp/revanced/integrations/patches/FixBackToExitGesturePatch;->$methodName($parameterTypes)V" + "invoke-static {$register}, Lapp/revanced/integrations/youtube/patches/FixBackToExitGesturePatch;->$methodName($parameterTypes)V" } } \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignaturePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignaturePatch.kt index fda87848..7b9512d4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignaturePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignaturePatch.kt @@ -43,7 +43,7 @@ object SpoofSignaturePatch : BytecodePatch( ) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/spoof/SpoofSignaturePatch;" + "Lapp/revanced/integrations/youtube/patches/spoof/SpoofSignaturePatch;" override fun execute(context: BytecodeContext) { SettingsPatch.PreferenceScreen.MISC.addPreferences( diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt index 7d1a11e3..d7d344cc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt @@ -59,7 +59,7 @@ object GmsCoreSupportPatch : AbstractGmsCoreSupportPatch( // Check the availability of GmsCore. HomeActivityFingerprint.result?.mutableMethod?.addInstruction( 0, - "invoke-static {}, Lapp/revanced/integrations/patches/GmsCoreSupport;->checkAvailability()V" + "invoke-static {}, Lapp/revanced/integrations/youtube/patches/GmsCoreSupport;->checkAvailability()V" ) ?: throw HomeActivityFingerprint.exception super.execute(context) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/IntegrationsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/IntegrationsPatch.kt index aa21e110..7a1d842d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/IntegrationsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/IntegrationsPatch.kt @@ -6,7 +6,6 @@ import app.revanced.patches.youtube.misc.integrations.fingerprints.* @Patch(requiresIntegrations = true) object IntegrationsPatch : AbstractIntegrationsPatch( - "Lapp/revanced/integrations/utils/ReVancedUtils;", setOf( ApplicationInitFingerprint, StandalonePlayerActivityFingerprint, diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt index 4c612bae..38bb6353 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt @@ -57,7 +57,7 @@ object BypassURLRedirectsPatch : BytecodePatch( replaceInstruction( insertIndex, "invoke-static {v$uriStringRegister}," + - "Lapp/revanced/integrations/patches/BypassURLRedirectsPatch;" + + "Lapp/revanced/integrations/youtube/patches/BypassURLRedirectsPatch;" + "->" + "parseRedirectUri(Ljava/lang/String;)Landroid/net/Uri;" ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt index 44a43506..4aae45df 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt @@ -55,7 +55,7 @@ object OpenLinksExternallyPatch : AbstractTransformInstructionsPatchgetIntent(Ljava/lang/String;)Ljava/lang/String; + invoke-static {v$register}, Lapp/revanced/integrations/youtube/patches/OpenLinksExternallyPatch;->getIntent(Ljava/lang/String;)Ljava/lang/String; move-result-object v$register """ ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt index b19466aa..e85f11c4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt @@ -37,7 +37,7 @@ object LithoFilterPatch : BytecodePatch( private val Instruction.descriptor get() = (this as ReferenceInstruction).reference.toString() - private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/components/LithoFilterPatch;" + private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/components/LithoFilterPatch;" internal lateinit var addFilter: (String) -> Unit private set diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/MinimizedPlaybackPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/MinimizedPlaybackPatch.kt index 9f19871e..a4cbad51 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/MinimizedPlaybackPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/minimizedplayback/MinimizedPlaybackPatch.kt @@ -53,7 +53,7 @@ object MinimizedPlaybackPatch : BytecodePatch( KidsMinimizedPlaybackPolicyControllerFingerprint ) ) { - private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/MinimizedPlaybackPatch;" + private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/MinimizedPlaybackPatch;" override fun execute(context: BytecodeContext) { // TODO: remove this empty preference sometime after mid 2023 diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playeroverlay/PlayerOverlaysHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playeroverlay/PlayerOverlaysHookPatch.kt index d4a7083b..a48cc48c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/playeroverlay/PlayerOverlaysHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playeroverlay/PlayerOverlaysHookPatch.kt @@ -26,7 +26,7 @@ object PlayerOverlaysHookPatch : BytecodePatch( // TODO: delete this unused outd val method = PlayerOverlaysOnFinishInflateFingerprint.result!!.mutableMethod method.addInstruction( method.implementation!!.instructions.size - 2, - "invoke-static { p0 }, Lapp/revanced/integrations/patches/PlayerOverlaysHookPatch;->YouTubePlayerOverlaysLayout_onFinishInflateHook(Ljava/lang/Object;)V" + "invoke-static { p0 }, Lapp/revanced/integrations/youtube/patches/PlayerOverlaysHookPatch;->YouTubePlayerOverlaysLayout_onFinishInflateHook(Ljava/lang/Object;)V" ) } } \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playertype/PlayerTypeHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playertype/PlayerTypeHookPatch.kt index 186e3b11..0e239e8d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/playertype/PlayerTypeHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playertype/PlayerTypeHookPatch.kt @@ -20,7 +20,7 @@ object PlayerTypeHookPatch : BytecodePatch( setOf(PlayerTypeFingerprint, VideoStateFingerprint) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/PlayerTypeHookPatch;" + "Lapp/revanced/integrations/youtube/patches/PlayerTypeHookPatch;" override fun execute(context: BytecodeContext) { PlayerTypeFingerprint.result?.mutableMethod?.addInstruction( diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt index 5d3d1ac5..53cd733d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt @@ -40,7 +40,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction object RemoveTrackingQueryParameterPatch : BytecodePatch( setOf(CopyTextFingerprint, SystemShareSheetFingerprint, YouTubeShareSheetFingerprint) ) { - private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/RemoveTrackingQueryParameterPatch;" + private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/RemoveTrackingQueryParameterPatch;" override fun execute(context: BytecodeContext) { SettingsPatch.PreferenceScreen.MISC.addPreferences( diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsPatch.kt index 67ad2c00..d3eb504b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.misc.settings -import app.revanced.util.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -11,8 +10,9 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.shared.settings.preference.impl.Preference import app.revanced.patches.shared.settings.util.AbstractPreferenceScreen import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch -import app.revanced.patches.youtube.misc.settings.fingerprints.LicenseActivityFingerprint +import app.revanced.patches.youtube.misc.settings.fingerprints.LicenseActivityOnCreateFingerprint import app.revanced.patches.youtube.misc.settings.fingerprints.SetThemeFingerprint +import app.revanced.util.exception import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.util.MethodUtil @@ -23,72 +23,53 @@ import java.io.Closeable dependencies = [IntegrationsPatch::class, SettingsResourcePatch::class] ) object SettingsPatch : BytecodePatch( - setOf(LicenseActivityFingerprint, SetThemeFingerprint) + setOf(LicenseActivityOnCreateFingerprint, SetThemeFingerprint) ), Closeable { - private const val INTEGRATIONS_PACKAGE = "app/revanced/integrations" - private const val SETTINGS_ACTIVITY_DESCRIPTOR = "L$INTEGRATIONS_PACKAGE/settingsmenu/ReVancedSettingActivity;" - private const val THEME_HELPER_DESCRIPTOR = "L$INTEGRATIONS_PACKAGE/utils/ThemeHelper;" - private const val SET_THEME_METHOD_NAME = "setTheme" + private const val INTEGRATIONS_PACKAGE = "app/revanced/integrations/youtube" + private const val ACTIVITY_HOOK_CLASS_DESCRIPTOR = "L$INTEGRATIONS_PACKAGE/settings/LicenseActivityHook;" + + private const val THEME_HELPER_DESCRIPTOR = "L$INTEGRATIONS_PACKAGE/ThemeHelper;" + private const val SET_THEME_METHOD_NAME: String = "setTheme" override fun execute(context: BytecodeContext) { - // TODO: Remove this when it is only required at one place. - fun getSetThemeInstructionString( - registers: String = "v0", - classDescriptor: String = THEME_HELPER_DESCRIPTOR, - methodName: String = SET_THEME_METHOD_NAME, - parameters: String = "Ljava/lang/Object;" - ) = "invoke-static { $registers }, $classDescriptor->$methodName($parameters)V" - SetThemeFingerprint.result?.mutableMethod?.let { setThemeMethod -> setThemeMethod.implementation!!.instructions.mapIndexedNotNull { i, instruction -> - if (instruction.opcode == Opcode.RETURN_OBJECT) i else null - } - .asReversed() // Prevent index shifting. - .forEach { returnIndex -> - // The following strategy is to replace the return instruction with the setTheme instruction, - // then add a return instruction after the setTheme instruction. - // This is done because the return instruction is a target of another instruction. + if (instruction.opcode == Opcode.RETURN_OBJECT) i else null + }.asReversed().forEach { returnIndex -> + // The following strategy is to replace the return instruction with the setTheme instruction, + // then add a return instruction after the setTheme instruction. + // This is done because the return instruction is a target of another instruction. - setThemeMethod.apply { - // This register is returned by the setTheme method. - val register = getInstruction(returnIndex).registerA - - val setThemeInstruction = getSetThemeInstructionString("v$register") - replaceInstruction(returnIndex, setThemeInstruction) - addInstruction(returnIndex + 1, "return-object v0") - } + setThemeMethod.apply { + // This register is returned by the setTheme method. + val register = getInstruction(returnIndex).registerA + replaceInstruction( + returnIndex, + "invoke-static { v$register }, " + + "$THEME_HELPER_DESCRIPTOR->$SET_THEME_METHOD_NAME(Ljava/lang/Object;)V" + ) + addInstruction(returnIndex + 1, "return-object v$register") } + } } ?: throw SetThemeFingerprint.exception - // Modify the license activity and remove all existing layout code. // Must modify an existing activity and cannot add a new activity to the manifest, // as that fails for root installations. - LicenseActivityFingerprint.result!!.apply licenseActivity@{ - mutableMethod.apply { - fun buildSettingsActivityInvokeString( - registers: String = "p0", - classDescriptor: String = SETTINGS_ACTIVITY_DESCRIPTOR, - methodName: String = "initializeSettings", - parameters: String = "Landroid/app/Activity;" - ) = getSetThemeInstructionString(registers, classDescriptor, methodName, parameters) + LicenseActivityOnCreateFingerprint.result?.let { result -> + result.mutableMethod.addInstructions( + 1, + """ + invoke-static { p0 }, $ACTIVITY_HOOK_CLASS_DESCRIPTOR->initialize(Landroid/app/Activity;)V + return-void + """ + ) - // initialize the settings - addInstructions( - 1, - """ - ${buildSettingsActivityInvokeString()} - return-void - """ - ) - } - - // remove method overrides - mutableClass.apply { + // Remove other methods as they will break as the onCreate method is modified above. + result.mutableClass.apply { methods.removeIf { it.name != "onCreate" && !MethodUtil.isConstructor(it) } } - } - + } ?: throw LicenseActivityOnCreateFingerprint.exception } fun addString(identifier: String, value: String, formatted: Boolean = true) = diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt index a95eb31a..a4a5243c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt @@ -96,11 +96,9 @@ object SettingsResourcePatch : AbstractSettingsResourcePatch( title = StringResource("revanced_pref_import_export_title", "Import / Export"), summary = StringResource("revanced_pref_import_export_summary", "Import / Export ReVanced settings"), inputType = InputType.TEXT_MULTI_LINE, - tag = "app.revanced.integrations.settingsmenu.ImportExportPreference" + tag = "app.revanced.integrations.shared.settings.preference.ImportExportPreference" ) ) - - context.mergeStrings("settings/host/values/strings.xml") } override fun close() { diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/fingerprints/LicenseActivityFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/fingerprints/LicenseActivityOnCreateFingerprint.kt similarity index 86% rename from src/main/kotlin/app/revanced/patches/youtube/misc/settings/fingerprints/LicenseActivityFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/misc/settings/fingerprints/LicenseActivityOnCreateFingerprint.kt index 87534b58..ce3a4a7b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/fingerprints/LicenseActivityFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/fingerprints/LicenseActivityOnCreateFingerprint.kt @@ -4,7 +4,7 @@ import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.MethodFingerprint import com.android.tools.smali.dexlib2.AccessFlags -internal object LicenseActivityFingerprint : MethodFingerprint( +internal object LicenseActivityOnCreateFingerprint : MethodFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, returnType = "V", parameters = listOf("L"), diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/zoomhaptics/ZoomHapticsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/zoomhaptics/ZoomHapticsPatch.kt index f54a716b..458b6f25 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/zoomhaptics/ZoomHapticsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/zoomhaptics/ZoomHapticsPatch.kt @@ -37,7 +37,7 @@ object ZoomHapticsPatch : BytecodePatch( zoomHapticsFingerprintMethod.addInstructionsWithLabels( 0, """ - invoke-static { }, Lapp/revanced/integrations/patches/ZoomHapticsPatch;->shouldVibrate()Z + invoke-static { }, Lapp/revanced/integrations/youtube/patches/ZoomHapticsPatch;->shouldVibrate()Z move-result v0 if-nez v0, :vibrate return-void diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/hdrbrightness/HDRBrightnessPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/hdrbrightness/HDRBrightnessPatch.kt index 5429cb4e..8d94373b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/hdrbrightness/HDRBrightnessPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/hdrbrightness/HDRBrightnessPatch.kt @@ -59,7 +59,7 @@ object HDRBrightnessPatch : BytecodePatch( method.addInstructions( insertIndex, """ - invoke-static {v$register}, Lapp/revanced/integrations/patches/HDRAutoBrightnessPatch;->getHDRBrightness(F)F + invoke-static {v$register}, Lapp/revanced/integrations/youtube/patches/HDRAutoBrightnessPatch;->getHDRBrightness(F)F move-result v$register """ ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/information/VideoInformationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/information/VideoInformationPatch.kt index 1de0f90a..353edcbd 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/information/VideoInformationPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/information/VideoInformationPatch.kt @@ -37,7 +37,7 @@ object VideoInformationPatch : BytecodePatch( OnPlaybackSpeedItemClickFingerprint ) ) { - private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/VideoInformation;" + private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/VideoInformation;" private lateinit var playerInitMethod: MutableMethod private var playerInitInsertIndex = 4 diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt index f8377a7f..49a578e9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt @@ -51,7 +51,7 @@ object RememberVideoQualityPatch : BytecodePatch( ) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/playback/quality/RememberVideoQualityPatch;" + "Lapp/revanced/integrations/youtube/patches/playback/quality/RememberVideoQualityPatch;" override fun execute(context: BytecodeContext) { // This is bloated as each value has it's own String key/value diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt index 4c572ffa..2e5afea5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt @@ -40,10 +40,10 @@ object CustomPlaybackSpeedPatch : BytecodePatch( ) ) { private const val FILTER_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/components/PlaybackSpeedMenuFilterPatch;" + "Lapp/revanced/integrations/youtube/patches/components/PlaybackSpeedMenuFilterPatch;" private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/playback/speed/CustomPlaybackSpeedPatch;" + "Lapp/revanced/integrations/youtube/patches/playback/speed/CustomPlaybackSpeedPatch;" override fun execute(context: BytecodeContext) { SettingsPatch.PreferenceScreen.VIDEO.addPreferences( diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/remember/RememberPlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/remember/RememberPlaybackSpeedPatch.kt index c37c7792..f53105fc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/remember/RememberPlaybackSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/remember/RememberPlaybackSpeedPatch.kt @@ -25,7 +25,7 @@ object RememberPlaybackSpeedPatch : BytecodePatch( setOf(InitializePlaybackSpeedValuesFingerprint) ){ private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/playback/speed/RememberPlaybackSpeedPatch;" + "Lapp/revanced/integrations/youtube/patches/playback/speed/RememberPlaybackSpeedPatch;" override fun execute(context: BytecodeContext) { SettingsPatch.PreferenceScreen.VIDEO.addPreferences( diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt index 1dac2a7a..86f7db13 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt @@ -41,10 +41,10 @@ object RestoreOldVideoQualityMenuPatch : BytecodePatch( setOf(VideoQualityMenuViewInflateFingerprint) ) { private const val FILTER_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/components/VideoQualityMenuFilterPatch;" + "Lapp/revanced/integrations/youtube/patches/components/VideoQualityMenuFilterPatch;" private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/patches/playback/quality/RestoreOldVideoQualityMenuPatch;" + "Lapp/revanced/integrations/youtube/patches/playback/quality/RestoreOldVideoQualityMenuPatch;" override fun execute(context: BytecodeContext) { // region Patch for the old type of the video quality menu. diff --git a/src/main/resources/settings/host/values/strings.xml b/src/main/resources/settings/host/values/strings.xml index 75802473..a897f37a 100644 --- a/src/main/resources/settings/host/values/strings.xml +++ b/src/main/resources/settings/host/values/strings.xml @@ -4,6 +4,9 @@ Do you wish to proceed? Reset + Refresh and restart + Restart + Import Copy ReVanced settings reset to default diff --git a/src/main/resources/sponsorblock/layout/inline_sponsor_overlay.xml b/src/main/resources/sponsorblock/layout/inline_sponsor_overlay.xml index 2c038554..2e2270a3 100644 --- a/src/main/resources/sponsorblock/layout/inline_sponsor_overlay.xml +++ b/src/main/resources/sponsorblock/layout/inline_sponsor_overlay.xml @@ -1,7 +1,7 @@ - - -