feat(IdAustria - Remove device integrity check): Update patch to work with latest version (#6360)

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
Alex Katlein
2025-12-15 12:26:59 +01:00
committed by GitHub
parent 5d437b08dd
commit 0ea3491227
5 changed files with 60 additions and 47 deletions

View File

@@ -268,6 +268,10 @@ public final class app/revanced/patches/iconpackstudio/misc/pro/UnlockProPatchKt
public static final fun getUnlockProPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/idaustria/detection/deviceintegrity/RemoveDeviceIntegrityChecksPatchKt {
public static final fun getRemoveDeviceIntegrityChecksPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/idaustria/detection/root/RootDetectionPatchKt {
public static final fun getRootDetectionPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}

View File

@@ -0,0 +1,22 @@
package app.revanced.patches.idaustria.detection.deviceintegrity
import app.revanced.patcher.fingerprint
import com.android.tools.smali.dexlib2.AccessFlags
internal val isDeviceBootloaderOpenFingerprint = fingerprint {
accessFlags(AccessFlags.PUBLIC)
returns("Ljava/lang/Object;")
custom { method, classDef ->
method.name == "isDeviceBootloaderOpen" &&
classDef.endsWith("/DeviceIntegrityCheckProviderImpl;")
}
}
internal val isDeviceRootedFingerprint = fingerprint {
accessFlags(AccessFlags.PUBLIC)
returns("Z")
custom { method, classDef ->
method.name == "isDeviceRooted" &&
classDef.endsWith("/DeviceIntegrityCheckProviderImpl;")
}
}

View File

@@ -0,0 +1,30 @@
package app.revanced.patches.idaustria.detection.deviceintegrity
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.util.returnEarly
@Suppress("unused")
val removeDeviceIntegrityChecksPatch = bytecodePatch(
name = "Remove device integrity checks",
description = "Removes the check for root permissions and unlocked bootloader.",
) {
compatibleWith("at.gv.oe.app")
execute {
isDeviceRootedFingerprint.method.returnEarly(false)
isDeviceBootloaderOpenFingerprint.method.apply {
addInstructions(
0,
"""
const/4 v0, 0x0
invoke-static { v0 }, Lkotlin/coroutines/jvm/internal/Boxing;->boxBoolean(Z)Ljava/lang/Boolean;
move-result-object v0
return-object v0
"""
)
}
}
}

View File

@@ -1,31 +0,0 @@
package app.revanced.patches.idaustria.detection.root
import app.revanced.patcher.fingerprint
import com.android.tools.smali.dexlib2.AccessFlags
internal val attestationSupportedCheckFingerprint = fingerprint {
accessFlags(AccessFlags.PUBLIC)
returns("V")
custom { method, classDef ->
method.name == "attestationSupportCheck" &&
classDef.endsWith("/DeviceIntegrityCheck;")
}
}
internal val bootloaderCheckFingerprint = fingerprint {
accessFlags(AccessFlags.PUBLIC)
returns("Z")
custom { method, classDef ->
method.name == "bootloaderCheck" &&
classDef.endsWith("/DeviceIntegrityCheck;")
}
}
internal val rootCheckFingerprint = fingerprint {
accessFlags(AccessFlags.PUBLIC)
returns("V")
custom { method, classDef ->
method.name == "rootCheck" &&
classDef.endsWith("/DeviceIntegrityCheck;")
}
}

View File

@@ -1,22 +1,10 @@
package app.revanced.patches.idaustria.detection.root
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patches.shared.PATCH_DESCRIPTION_REMOVE_ROOT_DETECTION
import app.revanced.patches.shared.PATCH_NAME_REMOVE_ROOT_DETECTION
import app.revanced.util.returnEarly
import app.revanced.patches.idaustria.detection.deviceintegrity.removeDeviceIntegrityChecksPatch
@Deprecated("Patch was superseded", ReplaceWith("removeDeviceIntegrityChecksPatch"))
@Suppress("unused")
val rootDetectionPatch = bytecodePatch(
name = PATCH_NAME_REMOVE_ROOT_DETECTION,
description = PATCH_DESCRIPTION_REMOVE_ROOT_DETECTION
) {
compatibleWith("at.gv.oe.app")
execute {
setOf(
attestationSupportedCheckFingerprint,
bootloaderCheckFingerprint,
rootCheckFingerprint,
).forEach { it.method.returnEarly(true) }
}
val rootDetectionPatch = bytecodePatch {
dependsOn(removeDeviceIntegrityChecksPatch)
}