Last active
November 23, 2022 22:41
-
-
Save obfusk/0556054222ff01a5d1185ac37a54174a to your computer and use it in GitHub Desktop.
jpype apksigner PoC
This file contains hidden or 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
| import sys | |
| import jpype | |
| import jpype.imports | |
| jpype.startJVM(classpath=["/usr/share/java/org.jpype.jar", "/usr/share/java/apksigner.jar"]) | |
| from com.android.apksig import ApkVerifier | |
| from java.io import File | |
| builder = ApkVerifier.Builder(File(sys.argv[1])) | |
| verifier = builder.build() | |
| result = verifier.verify() | |
| if result.isVerified(): | |
| if result.isVerifiedUsingV1Scheme(): | |
| print("v1 verified") | |
| if result.isVerifiedUsingV2Scheme(): | |
| print("v2 verified") | |
| if result.isVerifiedUsingV3Scheme(): | |
| print("v3 verified") | |
| else: | |
| print("not verified") | |
| for error in result.getErrors(): | |
| print("ERROR:", error) | |
| sys.exit(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment