fix(Check environment): Use another (also more suitable) API to circumvent a bug
This commit is contained in:
parent
380be33fed
commit
393700f74a
2 changed files with 5 additions and 4 deletions
|
|
@ -29,7 +29,7 @@ fun checkEnvironmentPatch(
|
||||||
) = bytecodePatch(
|
) = bytecodePatch(
|
||||||
description = "Checks, if the application was patched by, otherwise warns the user.",
|
description = "Checks, if the application was patched by, otherwise warns the user.",
|
||||||
) {
|
) {
|
||||||
compatibleWith(*compatiblePackages)
|
compatibleWith(packages = compatiblePackages)
|
||||||
|
|
||||||
dependsOn(
|
dependsOn(
|
||||||
extensionPatch,
|
extensionPatch,
|
||||||
|
|
@ -41,7 +41,7 @@ fun checkEnvironmentPatch(
|
||||||
|
|
||||||
fun setPatchInfo() {
|
fun setPatchInfo() {
|
||||||
fun <T : MutableEncodedValue> MutableClassDef.setClassFields(vararg fieldNameValues: Pair<String, T>) {
|
fun <T : MutableEncodedValue> MutableClassDef.setClassFields(vararg fieldNameValues: Pair<String, T>) {
|
||||||
val fieldNameValueMap = mapOf(*fieldNameValues)
|
val fieldNameValueMap = mapOf(pairs = fieldNameValues)
|
||||||
|
|
||||||
fields.forEach { field ->
|
fields.forEach { field ->
|
||||||
field.initialValue = fieldNameValueMap[field.name] ?: return@forEach
|
field.initialValue = fieldNameValueMap[field.name] ?: return@forEach
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
package app.revanced.patches.shared.misc.checks
|
package app.revanced.patches.shared.misc.checks
|
||||||
|
|
||||||
|
import app.revanced.patcher.gettingFirstClassDef
|
||||||
import app.revanced.patcher.gettingFirstClassDefDeclaratively
|
import app.revanced.patcher.gettingFirstClassDefDeclaratively
|
||||||
import app.revanced.patcher.patch.BytecodePatchContext
|
import app.revanced.patcher.patch.BytecodePatchContext
|
||||||
|
|
||||||
internal val BytecodePatchContext.patchInfoClassDef by gettingFirstClassDefDeclaratively(
|
internal val BytecodePatchContext.patchInfoClassDef by gettingFirstClassDef(
|
||||||
"Lapp/revanced/extension/shared/checks/PatchInfo;"
|
"Lapp/revanced/extension/shared/checks/PatchInfo;"
|
||||||
)
|
)
|
||||||
|
|
||||||
internal val BytecodePatchContext.patchInfoBuildClassDef by gettingFirstClassDefDeclaratively(
|
internal val BytecodePatchContext.patchInfoBuildClassDef by gettingFirstClassDef(
|
||||||
$$"Lapp/revanced/extension/shared/checks/PatchInfo$Build;"
|
$$"Lapp/revanced/extension/shared/checks/PatchInfo$Build;"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue