feat(youtube/general-ads): merge hide-get-premium
patch into general-ads
patch
This commit is contained in:
parent
acccfd9f92
commit
5195dd8936
|
@ -14,13 +14,21 @@ import app.revanced.patcher.patch.annotations.Patch
|
|||
import app.revanced.patches.shared.misc.fix.verticalscroll.patch.VerticalScrollPatch
|
||||
import app.revanced.patches.youtube.ad.general.annotation.HideAdsCompatibility
|
||||
import app.revanced.patches.youtube.ad.general.resource.patch.HideAdsResourcePatch
|
||||
import app.revanced.patches.youtube.ad.getpremium.bytecode.patch.HideGetPremiumPatch
|
||||
import app.revanced.patches.youtube.misc.fix.backtoexitgesture.patch.FixBackToExitGesturePatch
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction31i
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||
|
||||
|
||||
@Patch
|
||||
@DependsOn([HideAdsResourcePatch::class, VerticalScrollPatch::class, FixBackToExitGesturePatch::class])
|
||||
@DependsOn(
|
||||
[
|
||||
HideGetPremiumPatch::class,
|
||||
HideAdsResourcePatch::class,
|
||||
VerticalScrollPatch::class,
|
||||
FixBackToExitGesturePatch::class
|
||||
]
|
||||
)
|
||||
@Name("hide-ads")
|
||||
@Description("Removes general ads.")
|
||||
@HideAdsCompatibility
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package app.revanced.patches.youtube.layout.hide.getpremium.annotations
|
||||
package app.revanced.patches.youtube.ad.getpremium.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
|
@ -1,4 +1,4 @@
|
|||
package app.revanced.patches.youtube.layout.hide.getpremium.bytecode.fingerprints
|
||||
package app.revanced.patches.youtube.ad.getpremium.bytecode.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.Opcode
|
|
@ -1,7 +1,6 @@
|
|||
package app.revanced.patches.youtube.layout.hide.getpremium.bytecode.patch
|
||||
package app.revanced.patches.youtube.ad.getpremium.bytecode.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
|
||||
|
@ -11,33 +10,35 @@ 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.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.hide.getpremium.annotations.HideGetPremiumCompatibility
|
||||
import app.revanced.patches.youtube.layout.hide.getpremium.bytecode.fingerprints.GetPremiumViewFingerprint
|
||||
import app.revanced.patches.youtube.ad.getpremium.annotations.HideGetPremiumCompatibility
|
||||
import app.revanced.patches.youtube.ad.getpremium.bytecode.fingerprints.GetPremiumViewFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
|
||||
@Patch
|
||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
||||
@Name("hide-get-premium")
|
||||
@Description("Hides advertisement for YouTube Premium under the video player.")
|
||||
@HideGetPremiumCompatibility
|
||||
@Version("0.0.1")
|
||||
class HideGetPremiumPatch : BytecodePatch(
|
||||
listOf(
|
||||
GetPremiumViewFingerprint,
|
||||
)
|
||||
) {
|
||||
class HideGetPremiumPatch : BytecodePatch(listOf(GetPremiumViewFingerprint,)) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SettingsPatch.PreferenceScreen.ADS.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_get_premium",
|
||||
StringResource("revanced_hide_get_premium_title", "Hide YouTube Premium advertisement"),
|
||||
StringResource("revanced_hide_get_premium_summary_on", "YouTube Premium advertisement are hidden"),
|
||||
StringResource("revanced_hide_get_premium_summary_off", "YouTube Premium advertisement are shown")
|
||||
StringResource(
|
||||
"revanced_hide_get_premium_title",
|
||||
"Hide YouTube Premium advertisement under video player"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_get_premium_summary_on",
|
||||
"YouTube Premium advertisement are hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_get_premium_summary_off",
|
||||
"YouTube Premium advertisement are shown"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in a new issue