generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(SwissID): Add
Remove Google Play Integrity Integrity check
pat…
…ch (#3478) Co-authored-by: oSumAtrIX <[email protected]>
- Loading branch information
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
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
37 changes: 37 additions & 0 deletions
37
...main/kotlin/app/revanced/patches/swissid/integritycheck/RemoveGooglePlayIntegrityCheck.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,37 @@ | ||
package app.revanced.patches.swissid.integritycheck | ||
|
||
import app.revanced.patcher.data.BytecodeContext | ||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions | ||
import app.revanced.patcher.patch.BytecodePatch | ||
import app.revanced.patcher.patch.annotation.CompatiblePackage | ||
import app.revanced.patcher.patch.annotation.Patch | ||
import app.revanced.patches.swissid.integritycheck.fingerprints.CheckIntegrityFingerprint | ||
import app.revanced.util.resultOrThrow | ||
|
||
@Patch( | ||
name = "Remove Google Play Integrity Integrity check", | ||
description = "Removes the Google Play Integrity check. With this it's possible to use SwissID on custom ROMS." + | ||
"If the device is rooted, root permissions must be hidden from the app.", | ||
compatiblePackages = [CompatiblePackage("com.swisssign.swissid.mobile")], | ||
) | ||
@Suppress("unused") | ||
object RemoveGooglePlayIntegrityCheck : BytecodePatch( | ||
setOf(CheckIntegrityFingerprint), | ||
) { | ||
private const val RESULT_METHOD_REFERENCE = " Lcom/swisssign/deviceintegrity/" + | ||
"DeviceintegrityPlugin\$onMethodCall\$1;->\$result:" + | ||
"Lio/flutter/plugin/common/MethodChannel\$Result;" | ||
private const val SUCCESS_METHOD_REFERENCE = | ||
"Lio/flutter/plugin/common/MethodChannel\$Result;->success(Ljava/lang/Object;)V" | ||
|
||
override fun execute(context: BytecodeContext) = | ||
CheckIntegrityFingerprint.resultOrThrow().mutableMethod.addInstructions( | ||
0, | ||
""" | ||
iget-object p1, p0, $RESULT_METHOD_REFERENCE | ||
const-string v0, "VALID" | ||
invoke-interface {p1, v0}, $SUCCESS_METHOD_REFERENCE | ||
return-void | ||
""", | ||
) | ||
} |
11 changes: 11 additions & 0 deletions
11
...lin/app/revanced/patches/swissid/integritycheck/fingerprints/CheckIntegrityFingerprint.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,11 @@ | ||
package app.revanced.patches.swissid.integritycheck.fingerprints | ||
|
||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
import com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.Opcode | ||
|
||
internal object CheckIntegrityFingerprint : MethodFingerprint( | ||
returnType = "V", | ||
parameters = listOf("Lcom/swisssign/deviceintegrity/model/DeviceIntegrityResult;"), | ||
strings = listOf("it", "result") | ||
) |