Home | History | Annotate | only in /tools/apksig
Up to higher level directory
NameDateSize
Android.bp21-Aug-20181.2K
android_plugin_for_gradle.gradle21-Aug-2018583
apksig.iml21-Aug-2018433
BUILD21-Aug-20181.2K
build.gradle21-Aug-2018162
etc/21-Aug-2018
LICENSE21-Aug-201811.6K
OWNERS21-Aug-201841
README.md21-Aug-20182.7K
src/21-Aug-2018

README.md

      1 # apksig
      2 
      3 apksig is a project which aims to simplify APK signing and checking whether APK signatures are
      4 expected to verify on Android. apksig supports
      5 [JAR signing](https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html#Signed_JAR_File)
      6 (used by Android since day one) and
      7 [APK Signature Scheme v2](https://source.android.com/security/apksigning/v2.html) (supported since
      8 Android Nougat, API Level 24). apksig is meant to be used outside of Android devices.
      9 
     10 The key feature of apksig is that it knows about differences in APK signature verification logic
     11 between different versions of the Android platform. apksig thus thoroughly checks whether an APK's
     12 signature is expected to verify on all Android platform versions supported by the APK. When signing
     13 an APK, apksig chooses the most appropriate cryptographic algorithms based on the Android platform
     14 versions supported by the APK being signed.
     15 
     16 The project consists of two subprojects:
     17 
     18   * apksig -- a pure Java library, and
     19   * apksigner -- a pure Java command-line tool based on the apksig library.
     20 
     21 
     22 ## apksig library
     23 
     24 apksig library offers three primitives:
     25 
     26   * `ApkSigner` which signs the provided APK so that it verifies on all Android platform versions
     27     supported by the APK. The range of platform versions can be customized.
     28   * `ApkVerifier` which checks whether the provided APK is expected to verify on all Android
     29     platform versions supported by the APK. The range of platform versions can be customized.
     30   * `(Default)ApkSignerEngine` which abstracts away signing APKs from parsing and building APKs.
     31     This is useful in optimized APK building pipelines, such as in Android Plugin for Gradle,
     32     which need to perform signing while building an APK, instead of after. For simpler use cases
     33     where the APK to be signed is available upfront, the `ApkSigner` above is easier to use.
     34 
     35 _NOTE: Some public classes of the library are in packages having the word "internal" in their name.
     36 These are not public API of the library. Do not use \*.internal.\* classes directly because these
     37 classes may change any time without regard to existing clients outside of `apksig` and `apksigner`._
     38 
     39 
     40 ## apksigner command-line tool
     41 
     42 apksigner command-line tool offers two operations:
     43 
     44   * sign the provided APK so that it verifies on all Android platforms supported by the APK. Run
     45     `apksigner sign` for usage information.
     46   * check whether the provided APK's signatures are expected to verify on all Android platforms
     47     supported by the APK. Run `apksigner verify` for usage information.
     48 
     49 The tool determines the range of Android platform versions (API Levels) supported by the APK by
     50 inspecting the APK's AndroidManifest.xml. This behavior can be overridden by specifying the range
     51 of platform versions on the command-line.
     52