Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29bd2c17 authored by Kevin Hufnagle's avatar Kevin Hufnagle Committed by android-build-merger
Browse files

Merge "cherrypick from mnc-docs docs: Updated APK Signature Scheme v2 doc."...

Merge "cherrypick from mnc-docs docs: Updated APK Signature Scheme v2 doc." into mnc-io-docs am: 24c29693
am: c34dee0c

* commit 'c34dee0c':
  cherrypick from mnc-docs docs: Updated APK Signature Scheme v2 doc.

Change-Id: If46bff14d2a8a461eda04b4e1d40bee06b10984c
parents b9bb8e88 c34dee0c
Loading
Loading
Loading
Loading
+40 −12
Original line number Diff line number Diff line
@@ -723,18 +723,46 @@ specify how user CAs should be trusted.</p>

<h2 id="apk_signature_v2">APK signature scheme v2</h2>

<p>The PackageManager class now supports verifying apps using the APK
signature scheme v2. The APK signature scheme v2 is a whole-file signature scheme
that significantly improves verification speed and strengthens integrity
  guarantees by detecting any unauthorized changes to APK files.</p>

<p>To maintain backward-compatibility, an APK must be signed with the v1 signature
scheme (JAR signature scheme) before being signed with the v2 signature scheme.
With the v2 signature scheme, verification fails if you sign the APK with an
  additional certificate after signing with the v2 scheme. </p>

<p>APK signature scheme v2 support will be available later in the N Developer
Preview.</p>
<p>
  Android N introduces APK Signature Scheme v2, a new app-signing scheme that
  offers faster app install times and better protection against unauthorized
  alterations to APK files. Android Studio 2.2 and Gradle provide built-in
  support for APK Signature Scheme v2.
</p>

<p>
  Although we recommend applying APK Signature Scheme v2 to your app, the new
  scheme is not mandatory. If your app doesn't build properly when using the
  APK Signature Scheme v2, you can use the traditional signing scheme—which
  uses JAR signing—instead. To use the traditional scheme, open the
  module-level <code>build.gradle</code> file and add the
  <code>v2SigningEnabled</code> parameter to your release signing
  configuration, setting this parameter's value to <code>false</code>:
</p>

<pre>
  android {
    ...
    defaultConfig { ... }
    signingConfigs {
      release {
        storeFile file("myreleasekey.keystore")
        storePassword "password"
        keyAlias "MyReleaseKey"
        keyPassword "password"
        <strong>v2SigningEnabled false</strong>
      }
    }
  }
</pre>

<p>
  For more information, see the following guides, which describe how to <a href=
  "{@docRoot}studio/tools/publishing/app-signing.html#release-mode"> sign an app
  in Android Studio</a> and how to <a href=
  "{@docRoot}studio/tools/building/configuring-gradle.html#signing"> configure
  the Gradle build file for signing apps</a>.
</p>

<h2 id="scoped_directory_access">Scoped directory access</h2>