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:
inotia00
2024-12-08 15:44:50 +09:00
parent 654368ffe2
commit ac72748834
5 changed files with 26 additions and 3 deletions

View File

@ -151,7 +151,7 @@ val adsPatch = bytecodePatch(
addSwitchPreference(
CategoryType.ADS,
"revanced_hide_fullscreen_ads",
"true"
"false"
)
addSwitchPreference(
CategoryType.ADS,

View File

@ -2,11 +2,13 @@ package app.revanced.patches.youtube.ads.general
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.ads.baseAdsPatch
import app.revanced.patches.shared.ads.hookLithoFullscreenAds
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.lithoFilterPatch
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.settings.ResourceUtils.addPreference
import app.revanced.patches.youtube.utils.settings.settingsPatch
import app.revanced.util.findMethodOrThrow
import app.revanced.util.findMutableMethodOf
import app.revanced.util.fingerprint.matchOrThrow
import app.revanced.util.fingerprint.methodOrThrow
@ -129,6 +132,13 @@ val adsPatch = bytecodePatch(
// endregion
findMethodOrThrow("$PATCHES_PATH/PatchStatus;") {
name == "HideFullscreenAdsDefaultBoolean"
}.replaceInstruction(
0,
"const/4 v0, 0x1"
)
// region add settings
addPreference(