mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-04 00:24:34 +02:00
feat(YouTube Music - Hide ads): Changed the default value of Hide fullscreen ads
setting to off and added a warning to the setting
This commit is contained in:
parent
654368ffe2
commit
ac72748834
@ -0,0 +1,8 @@
|
|||||||
|
package app.revanced.extension.shared.patches;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public class PatchStatus {
|
||||||
|
public static boolean HideFullscreenAdsDefaultBoolean() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@ -3,6 +3,8 @@ package app.revanced.extension.shared.settings;
|
|||||||
import static java.lang.Boolean.FALSE;
|
import static java.lang.Boolean.FALSE;
|
||||||
import static java.lang.Boolean.TRUE;
|
import static java.lang.Boolean.TRUE;
|
||||||
|
|
||||||
|
import static app.revanced.extension.shared.patches.PatchStatus.HideFullscreenAdsDefaultBoolean;
|
||||||
|
|
||||||
import app.revanced.extension.shared.patches.ReturnYouTubeUsernamePatch.DisplayFormat;
|
import app.revanced.extension.shared.patches.ReturnYouTubeUsernamePatch.DisplayFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,7 +25,7 @@ public class BaseSettings {
|
|||||||
/**
|
/**
|
||||||
* These settings are used by YouTube and YouTube Music.
|
* These settings are used by YouTube and YouTube Music.
|
||||||
*/
|
*/
|
||||||
public static final BooleanSetting HIDE_FULLSCREEN_ADS = new BooleanSetting("revanced_hide_fullscreen_ads", TRUE, true);
|
public static final BooleanSetting HIDE_FULLSCREEN_ADS = new BooleanSetting("revanced_hide_fullscreen_ads", HideFullscreenAdsDefaultBoolean(), true);
|
||||||
public static final BooleanSetting HIDE_PROMOTION_ALERT_BANNER = new BooleanSetting("revanced_hide_promotion_alert_banner", TRUE);
|
public static final BooleanSetting HIDE_PROMOTION_ALERT_BANNER = new BooleanSetting("revanced_hide_promotion_alert_banner", TRUE);
|
||||||
|
|
||||||
public static final BooleanSetting DISABLE_AUTO_CAPTIONS = new BooleanSetting("revanced_disable_auto_captions", FALSE, true);
|
public static final BooleanSetting DISABLE_AUTO_CAPTIONS = new BooleanSetting("revanced_disable_auto_captions", FALSE, true);
|
||||||
|
@ -151,7 +151,7 @@ val adsPatch = bytecodePatch(
|
|||||||
addSwitchPreference(
|
addSwitchPreference(
|
||||||
CategoryType.ADS,
|
CategoryType.ADS,
|
||||||
"revanced_hide_fullscreen_ads",
|
"revanced_hide_fullscreen_ads",
|
||||||
"true"
|
"false"
|
||||||
)
|
)
|
||||||
addSwitchPreference(
|
addSwitchPreference(
|
||||||
CategoryType.ADS,
|
CategoryType.ADS,
|
||||||
|
@ -2,11 +2,13 @@ package app.revanced.patches.youtube.ads.general
|
|||||||
|
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.patch.bytecodePatch
|
import app.revanced.patcher.patch.bytecodePatch
|
||||||
import app.revanced.patcher.util.smali.ExternalLabel
|
import app.revanced.patcher.util.smali.ExternalLabel
|
||||||
import app.revanced.patches.shared.ads.baseAdsPatch
|
import app.revanced.patches.shared.ads.baseAdsPatch
|
||||||
import app.revanced.patches.shared.ads.hookLithoFullscreenAds
|
import app.revanced.patches.shared.ads.hookLithoFullscreenAds
|
||||||
import app.revanced.patches.shared.ads.hookNonLithoFullscreenAds
|
import app.revanced.patches.shared.ads.hookNonLithoFullscreenAds
|
||||||
|
import app.revanced.patches.shared.extension.Constants.PATCHES_PATH
|
||||||
import app.revanced.patches.shared.litho.addLithoFilter
|
import app.revanced.patches.shared.litho.addLithoFilter
|
||||||
import app.revanced.patches.shared.litho.lithoFilterPatch
|
import app.revanced.patches.shared.litho.lithoFilterPatch
|
||||||
import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE
|
import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE
|
||||||
@ -20,6 +22,7 @@ import app.revanced.patches.youtube.utils.resourceid.interstitialsContainer
|
|||||||
import app.revanced.patches.youtube.utils.resourceid.sharedResourceIdPatch
|
import app.revanced.patches.youtube.utils.resourceid.sharedResourceIdPatch
|
||||||
import app.revanced.patches.youtube.utils.settings.ResourceUtils.addPreference
|
import app.revanced.patches.youtube.utils.settings.ResourceUtils.addPreference
|
||||||
import app.revanced.patches.youtube.utils.settings.settingsPatch
|
import app.revanced.patches.youtube.utils.settings.settingsPatch
|
||||||
|
import app.revanced.util.findMethodOrThrow
|
||||||
import app.revanced.util.findMutableMethodOf
|
import app.revanced.util.findMutableMethodOf
|
||||||
import app.revanced.util.fingerprint.matchOrThrow
|
import app.revanced.util.fingerprint.matchOrThrow
|
||||||
import app.revanced.util.fingerprint.methodOrThrow
|
import app.revanced.util.fingerprint.methodOrThrow
|
||||||
@ -129,6 +132,13 @@ val adsPatch = bytecodePatch(
|
|||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
|
findMethodOrThrow("$PATCHES_PATH/PatchStatus;") {
|
||||||
|
name == "HideFullscreenAdsDefaultBoolean"
|
||||||
|
}.replaceInstruction(
|
||||||
|
0,
|
||||||
|
"const/4 v0, 0x1"
|
||||||
|
)
|
||||||
|
|
||||||
// region add settings
|
// region add settings
|
||||||
|
|
||||||
addPreference(
|
addPreference(
|
||||||
|
@ -58,7 +58,10 @@ Please download %2$s from the website."</string>
|
|||||||
<string name="revanced_preference_screen_ads_title">Ads</string>
|
<string name="revanced_preference_screen_ads_title">Ads</string>
|
||||||
|
|
||||||
<string name="revanced_hide_fullscreen_ads_title">Hide fullscreen ads</string>
|
<string name="revanced_hide_fullscreen_ads_title">Hide fullscreen ads</string>
|
||||||
<string name="revanced_hide_fullscreen_ads_summary">Hides fullscreen ads.</string>
|
<string name="revanced_hide_fullscreen_ads_summary">"Hides fullscreen ads.
|
||||||
|
|
||||||
|
Limitations:
|
||||||
|
• Sometimes you may see a blank black screen instead of the home feed."</string>
|
||||||
<string name="revanced_hide_general_ads_title">Hide general ads</string>
|
<string name="revanced_hide_general_ads_title">Hide general ads</string>
|
||||||
<string name="revanced_hide_general_ads_summary">Hides general ads.</string>
|
<string name="revanced_hide_general_ads_summary">Hides general ads.</string>
|
||||||
<string name="revanced_hide_music_ads_title">Hide media ads</string>
|
<string name="revanced_hide_music_ads_title">Hide media ads</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user