mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-29 21:30:19 +02:00
fix(Change version code): change to a universal patch, and changed the patch description
This commit is contained in:
parent
2d670c2d36
commit
9ac5d9a055
@ -1,23 +1,24 @@
|
|||||||
package app.revanced.patches.reddit.misc.versioncode
|
package app.revanced.patches.all.misc.versioncode
|
||||||
|
|
||||||
import app.revanced.patcher.data.ResourceContext
|
import app.revanced.patcher.data.ResourceContext
|
||||||
import app.revanced.patcher.patch.PatchException
|
import app.revanced.patcher.patch.PatchException
|
||||||
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
|
import app.revanced.patcher.patch.annotation.Patch
|
||||||
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.booleanPatchOption
|
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.booleanPatchOption
|
||||||
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption
|
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption
|
||||||
import app.revanced.patches.reddit.utils.compatibility.Constants.COMPATIBLE_PACKAGE
|
|
||||||
import app.revanced.util.patch.BaseResourcePatch
|
|
||||||
import app.revanced.util.valueOrThrow
|
import app.revanced.util.valueOrThrow
|
||||||
import org.w3c.dom.Element
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
@Suppress("unused")
|
@Patch(
|
||||||
object ChangeVersionCodePatch : BaseResourcePatch(
|
|
||||||
name = "Change version code",
|
name = "Change version code",
|
||||||
description = "Changes the version code of the app. By default the highest version code is set. " +
|
description = "Changes the version code of the app. By default the highest version code is set. " +
|
||||||
"This allows older versions of an app to be installed " +
|
"This allows older versions of an app to be installed " +
|
||||||
"if their version code is set to the same or a higher value and can stop app stores to update the app.",
|
"if their version code is set to the same or a higher value and can stop app stores to update the app. " +
|
||||||
compatiblePackages = COMPATIBLE_PACKAGE,
|
"This does not apply when installing with root install (mount).",
|
||||||
use = false
|
use = false,
|
||||||
) {
|
)
|
||||||
|
@Suppress("unused")
|
||||||
|
object ChangeVersionCodePatch : ResourcePatch() {
|
||||||
private const val MAX_VALUE = Int.MAX_VALUE.toString()
|
private const val MAX_VALUE = Int.MAX_VALUE.toString()
|
||||||
|
|
||||||
private val ChangeVersionCode by booleanPatchOption(
|
private val ChangeVersionCode by booleanPatchOption(
|
||||||
@ -66,4 +67,4 @@ object ChangeVersionCodePatch : BaseResourcePatch(
|
|||||||
"Invalid versionCode: $versionCodeString, " +
|
"Invalid versionCode: $versionCodeString, " +
|
||||||
"Version code should be larger than 1 and smaller than $MAX_VALUE."
|
"Version code should be larger than 1 and smaller than $MAX_VALUE."
|
||||||
)
|
)
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user