forked from ReVanced/revanced-patches-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Tumblr): Add
Disable in-app update
patch (ReVanced#3058)
Co-authored-by: oSumAtrIX <[email protected]>
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...main/kotlin/app/revanced/patches/tumblr/annoyances/inappupdate/DisableInAppUpdatePatch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") | ||
} | ||
} |