public static class ApkVerifier.Builder extends Object
ApkVerifier
instances.
The resulting verifier by default checks whether the APK will verify on all platform
versions supported by the APK, as specified by android:minSdkVersion
attributes in
the APK's AndroidManifest.xml
. The range of platform versions can be customized using
setMinCheckedPlatformVersion(int)
and setMaxCheckedPlatformVersion(int)
.
Constructor and Description |
---|
Builder(DataSource apk)
Constructs a new
Builder for verifying the provided APK. |
Builder(File apk)
Constructs a new
Builder for verifying the provided APK file. |
Modifier and Type | Method and Description |
---|---|
ApkVerifier |
build()
Returns an
ApkVerifier initialized according to the configuration of this
builder. |
ApkVerifier.Builder |
setMaxCheckedPlatformVersion(int maxSdkVersion)
Sets the newest Android platform version for which the APK is verified.
|
ApkVerifier.Builder |
setMinCheckedPlatformVersion(int minSdkVersion)
Sets the oldest Android platform version for which the APK is verified.
|
public Builder(File apk)
Builder
for verifying the provided APK file.public Builder(DataSource apk)
Builder
for verifying the provided APK.public ApkVerifier.Builder setMinCheckedPlatformVersion(int minSdkVersion)
setMaxCheckedPlatformVersion(int)
.
This method is useful for overriding the default behavior which checks that the APK
will verify on all platform versions supported by the APK, as specified by
android:minSdkVersion
attributes in the APK's AndroidManifest.xml
. For
example, the default behavior refuses to handle APKs with codenames as values of
android:minSdkVersion
(e.g., "N").
minSdkVersion
- API Level of the oldest platform for which to verify the APKsetMinCheckedPlatformVersion(int)
public ApkVerifier.Builder setMaxCheckedPlatformVersion(int maxSdkVersion)
setMinCheckedPlatformVersion(int)
.maxSdkVersion
- API Level of the newest platform for which to verify the APKsetMinCheckedPlatformVersion(int)
public ApkVerifier build()
ApkVerifier
initialized according to the configuration of this
builder.Copyright © 2016. All rights reserved.