diff --git a/src/main/kotlin/app/revanced/patches/youtube/ads/general/resource/patch/GeneralAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ads/general/resource/patch/GeneralAdsPatch.kt index daa36858f..43d5f4452 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ads/general/resource/patch/GeneralAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ads/general/resource/patch/GeneralAdsPatch.kt @@ -13,6 +13,7 @@ import app.revanced.patcher.patch.annotations.DependsOn import app.revanced.patcher.patch.annotations.Patch import app.revanced.patches.shared.annotation.YouTubeCompatibility import app.revanced.patches.youtube.ads.general.bytecode.patch.GeneralAdsBytecodePatch +import app.revanced.patches.youtube.ads.getpremium.patch.HideGetPremiumPatch import app.revanced.patches.youtube.misc.litho.patch.LithoFilterPatch import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch import org.w3c.dom.Element @@ -22,6 +23,7 @@ import org.w3c.dom.Element @Description("Removes general ads.") @DependsOn( [ + HideGetPremiumPatch::class, GeneralAdsBytecodePatch::class, LithoFilterPatch::class, SettingsPatch::class diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/general/getpremium/fingerprints/CompactYpcOfferModuleViewFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/ads/getpremium/fingerprints/CompactYpcOfferModuleViewFingerprint.kt similarity index 84% rename from src/main/kotlin/app/revanced/patches/youtube/layout/general/getpremium/fingerprints/CompactYpcOfferModuleViewFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/ads/getpremium/fingerprints/CompactYpcOfferModuleViewFingerprint.kt index 0394d335e..81d83a9ae 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/general/getpremium/fingerprints/CompactYpcOfferModuleViewFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ads/getpremium/fingerprints/CompactYpcOfferModuleViewFingerprint.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.layout.general.getpremium.fingerprints +package app.revanced.patches.youtube.ads.getpremium.fingerprints import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import org.jf.dexlib2.Opcode diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/general/getpremium/patch/HideGetPremiumPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ads/getpremium/patch/HideGetPremiumPatch.kt similarity index 63% rename from src/main/kotlin/app/revanced/patches/youtube/layout/general/getpremium/patch/HideGetPremiumPatch.kt rename to src/main/kotlin/app/revanced/patches/youtube/ads/getpremium/patch/HideGetPremiumPatch.kt index cd18d48f6..bd984ded2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/general/getpremium/patch/HideGetPremiumPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ads/getpremium/patch/HideGetPremiumPatch.kt @@ -1,7 +1,6 @@ -package app.revanced.patches.youtube.layout.general.getpremium.patch +package app.revanced.patches.youtube.ads.getpremium.patch import app.revanced.extensions.toErrorResult -import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version import app.revanced.patcher.data.BytecodeContext @@ -10,20 +9,12 @@ import app.revanced.patcher.extensions.instruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess -import app.revanced.patcher.patch.annotations.DependsOn -import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.util.smali.ExternalLabel -import app.revanced.patches.shared.annotation.YouTubeCompatibility -import app.revanced.patches.youtube.layout.general.getpremium.fingerprints.CompactYpcOfferModuleViewFingerprint -import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch -import app.revanced.util.integrations.Constants.GENERAL +import app.revanced.patches.youtube.ads.getpremium.fingerprints.CompactYpcOfferModuleViewFingerprint +import app.revanced.util.integrations.Constants.PATCHES_PATH import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction -@Patch @Name("hide-get-premium") -@Description("Hides the YouTube Premium promotion banner between the player and video description.") -@DependsOn([SettingsPatch::class]) -@YouTubeCompatibility @Version("0.0.1") class HideGetPremiumPatch : BytecodePatch( listOf( @@ -42,7 +33,7 @@ class HideGetPremiumPatch : BytecodePatch( addInstructions( startIndex + 2, """ - invoke-static {}, $GENERAL->hideGetPremium()Z + invoke-static {}, $PATCHES_PATH/ads/GeneralAdsPatch;->hideGetPremium()Z move-result v$tempRegister if-eqz v$tempRegister, :show const/4 v$measuredWidthRegister, 0x0 @@ -52,18 +43,6 @@ class HideGetPremiumPatch : BytecodePatch( } } ?: return CompactYpcOfferModuleViewFingerprint.toErrorResult() - /* - * Add settings - */ - SettingsPatch.addPreference( - arrayOf( - "PREFERENCE: GENERAL_SETTINGS", - "SETTINGS: HIDE_GET_PREMIUM" - ) - ) - - SettingsPatch.updatePatchStatus("hide-get-premium") - return PatchResultSuccess() } } diff --git a/src/main/resources/youtube/settings/host/values/strings.xml b/src/main/resources/youtube/settings/host/values/strings.xml index 667ae979d..48a4b2e3a 100644 --- a/src/main/resources/youtube/settings/host/values/strings.xml +++ b/src/main/resources/youtube/settings/host/values/strings.xml @@ -14,6 +14,9 @@ General ads are shown General ads are hidden Hide general ads + YouTube Premium promotion are shown + YouTube Premium promotion are hidden + Hide YouTube Premium promotion Paid promotion label is shown Paid promotion label is hidden Hide paid promotion @@ -292,9 +295,6 @@ Please do not report any issues you encounter while using this feature."Fullscreen panels are shown Fullscreen panels are hidden Hide fullscreen panels - YouTube Premium promotion are shown - YouTube Premium promotion are hidden - Hide YouTube Premium promotion Home button is shown Home button is hidden Hide home button diff --git a/src/main/resources/youtube/settings/xml/revanced_prefs.xml b/src/main/resources/youtube/settings/xml/revanced_prefs.xml index cda265b31..ed20fac40 100644 --- a/src/main/resources/youtube/settings/xml/revanced_prefs.xml +++ b/src/main/resources/youtube/settings/xml/revanced_prefs.xml @@ -14,6 +14,7 @@ + SETTINGS: HIDE_GENERAL_ADS --> @@ -95,9 +96,6 @@ - - @@ -475,7 +473,6 @@ -