public class ApkSigner extends Object
The signer preserves as much of the input APK as possible. For example, it preserves the order of APK entries and preserves their contents, including compressed form and alignment of data.
Use ApkSigner.SignerConfig.Builder
to obtain instances of this signer.
Modifier and Type | Class and Description |
---|---|
static class |
ApkSigner.Builder
Builder of
ApkSigner instances. |
static class |
ApkSigner.SignerConfig
Configuration of a signer.
|
Modifier and Type | Method and Description |
---|---|
void |
sign()
Signs the input APK and outputs the resulting signed APK.
|
public void sign() throws IOException, ApkFormatException, NoSuchAlgorithmException, InvalidKeyException, SignatureException, IllegalStateException
IOException
- if an I/O error is encountered while reading or writing the APKsApkFormatException
- if the input APK is malformedNoSuchAlgorithmException
- if the APK signatures cannot be produced or verified because
a required cryptographic algorithm implementation is missingInvalidKeyException
- if a signature could not be generated because a signing key is
not suitable for generating the signatureSignatureException
- if an error occurred while generating or verifying a signatureIllegalStateException
- if this signer's configuration is missing required information
or if the signing engine is in an invalid state.Copyright © 2016. All rights reserved.