From 5e8076b330cabe57130233adacdf84b56f010217 Mon Sep 17 00:00:00 2001 From: Temm Date: Sun, 1 Oct 2023 19:34:03 +0200 Subject: [PATCH] feat(Tumblr): Add `Disable in-app update` patch (#3058) Co-authored-by: oSumAtrIX --- .../inappupdate/DisableInAppUpdatePatch.kt | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/main/kotlin/app/revanced/patches/tumblr/annoyances/inappupdate/DisableInAppUpdatePatch.kt diff --git a/src/main/kotlin/app/revanced/patches/tumblr/annoyances/inappupdate/DisableInAppUpdatePatch.kt b/src/main/kotlin/app/revanced/patches/tumblr/annoyances/inappupdate/DisableInAppUpdatePatch.kt new file mode 100644 index 0000000000..574f5c383d --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/tumblr/annoyances/inappupdate/DisableInAppUpdatePatch.kt @@ -0,0 +1,22 @@ +package app.revanced.patches.tumblr.annoyances.inappupdate + +import app.revanced.patcher.data.BytecodeContext +import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patcher.patch.annotation.CompatiblePackage +import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.tumblr.featureflags.OverrideFeatureFlagsPatch + +@Patch( + name = "Disable in-app update", + description = "Disables the in-app update check and update prompt.", + dependencies = [OverrideFeatureFlagsPatch::class], + compatiblePackages = [CompatiblePackage("com.tumblr")] +) +@Suppress("unused") +object DisableInAppUpdatePatch : BytecodePatch() { + override fun execute(context: BytecodeContext) { + // Before checking for updates using Google Play core AppUpdateManager, the value of this feature flag is checked. + // If this flag is false or the last update check was today and no update check is performed. + OverrideFeatureFlagsPatch.addOverride("inAppUpdate", "false") + } +} \ No newline at end of file