Skip to content

Commit 3380080

Browse files
KillTrotoSumAtrIX
andauthored
feat(SwissID): Add Remove Google Play Integrity Integrity check patch (#3478)
Co-authored-by: oSumAtrIX <[email protected]>
1 parent 62c4766 commit 3380080

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

api/revanced-patches.api

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,12 @@ public final class app/revanced/patches/strava/upselling/DisableSubscriptionSugg
11781178
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
11791179
}
11801180

1181+
public final class app/revanced/patches/swissid/integritycheck/RemoveGooglePlayIntegrityCheck : app/revanced/patcher/patch/BytecodePatch {
1182+
public static final field INSTANCE Lapp/revanced/patches/swissid/integritycheck/RemoveGooglePlayIntegrityCheck;
1183+
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
1184+
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
1185+
}
1186+
11811187
public final class app/revanced/patches/ticktick/misc/themeunlock/UnlockProPatch : app/revanced/patcher/patch/BytecodePatch {
11821188
public static final field INSTANCE Lapp/revanced/patches/ticktick/misc/themeunlock/UnlockProPatch;
11831189
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package app.revanced.patches.swissid.integritycheck
2+
3+
import app.revanced.patcher.data.BytecodeContext
4+
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
5+
import app.revanced.patcher.patch.BytecodePatch
6+
import app.revanced.patcher.patch.annotation.CompatiblePackage
7+
import app.revanced.patcher.patch.annotation.Patch
8+
import app.revanced.patches.swissid.integritycheck.fingerprints.CheckIntegrityFingerprint
9+
import app.revanced.util.resultOrThrow
10+
11+
@Patch(
12+
name = "Remove Google Play Integrity Integrity check",
13+
description = "Removes the Google Play Integrity check. With this it's possible to use SwissID on custom ROMS." +
14+
"If the device is rooted, root permissions must be hidden from the app.",
15+
compatiblePackages = [CompatiblePackage("com.swisssign.swissid.mobile")],
16+
)
17+
@Suppress("unused")
18+
object RemoveGooglePlayIntegrityCheck : BytecodePatch(
19+
setOf(CheckIntegrityFingerprint),
20+
) {
21+
private const val RESULT_METHOD_REFERENCE = " Lcom/swisssign/deviceintegrity/" +
22+
"DeviceintegrityPlugin\$onMethodCall\$1;->\$result:" +
23+
"Lio/flutter/plugin/common/MethodChannel\$Result;"
24+
private const val SUCCESS_METHOD_REFERENCE =
25+
"Lio/flutter/plugin/common/MethodChannel\$Result;->success(Ljava/lang/Object;)V"
26+
27+
override fun execute(context: BytecodeContext) =
28+
CheckIntegrityFingerprint.resultOrThrow().mutableMethod.addInstructions(
29+
0,
30+
"""
31+
iget-object p1, p0, $RESULT_METHOD_REFERENCE
32+
const-string v0, "VALID"
33+
invoke-interface {p1, v0}, $SUCCESS_METHOD_REFERENCE
34+
return-void
35+
""",
36+
)
37+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package app.revanced.patches.swissid.integritycheck.fingerprints
2+
3+
import app.revanced.patcher.fingerprint.MethodFingerprint
4+
import com.android.tools.smali.dexlib2.AccessFlags
5+
import com.android.tools.smali.dexlib2.Opcode
6+
7+
internal object CheckIntegrityFingerprint : MethodFingerprint(
8+
returnType = "V",
9+
parameters = listOf("Lcom/swisssign/deviceintegrity/model/DeviceIntegrityResult;"),
10+
strings = listOf("it", "result")
11+
)

0 commit comments

Comments
 (0)