public class ApkVerifier extends Object
The verifier is designed to closely mimic the behavior of Android platforms. This is to enable the verifier to be used for checking whether an APK's signatures will verify on Android.
Use ApkVerifier.Builder
to obtain instances of this verifier.
Modifier and Type | Class and Description |
---|---|
static class |
ApkVerifier.Builder
Builder of
ApkVerifier instances. |
static class |
ApkVerifier.Issue
Error or warning encountered while verifying an APK's signatures.
|
static class |
ApkVerifier.IssueWithParams
ApkVerifier.Issue with associated parameters. |
static class |
ApkVerifier.Result
Result of verifying an APKs signatures.
|
Modifier and Type | Method and Description |
---|---|
ApkVerifier.Result |
verify()
Verifies the APK's signatures and returns the result of verification.
|
public ApkVerifier.Result verify() throws IOException, ApkFormatException, NoSuchAlgorithmException, IllegalStateException
ApkVerifier.Result.isVerified()
returns true
.
The verification result also includes errors, warnings, and information about signers.IOException
- if an I/O error is encountered while reading the APKApkFormatException
- if the APK is malformedNoSuchAlgorithmException
- if the APK's signatures cannot be verified because a
required cryptographic algorithm implementation is missingIllegalStateException
- if this verifier's configuration is missing required
information.Copyright © 2016. All rights reserved.