From 7f85bb12d2c3d14ee8721e93ddb6090a3000523b Mon Sep 17 00:00:00 2001 From: Andrew Solovay Date: Wed, 6 Jan 2016 17:25:12 -0800 Subject: [PATCH] docs: Fixed TOC typo and other formatting problems TOC link was missing a needed #. While I had the file open I fixed other formatting issues (overlong lines, code snippets that shouldn't have been pretty-printed). No changes to the page content. I'll build and stage (see first comment for staged doc location) but if it looks good I'll +2 and submit it myself. bug: 26191770 Change-Id: I3c15ed3dfaa0762729f8d778d4aa828710c0eefa --- docs/html/tools/publishing/app-signing.jd | 45 +++++++++++++---------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/docs/html/tools/publishing/app-signing.jd b/docs/html/tools/publishing/app-signing.jd index af5b77129c91a..8f68ff72e6127 100644 --- a/docs/html/tools/publishing/app-signing.jd +++ b/docs/html/tools/publishing/app-signing.jd @@ -16,7 +16,7 @@ page.title=Signing Your Applications
  • Signing Your App in Android Studio
      -
    1. Automatically Signing Your App
    2. +
    3. Automatically Signing Your App
  • Signing Your App with Android Studio
  • @@ -65,9 +65,9 @@ mode.

    By default, the debug configuration uses a debug keystore, with a known password and a default key with a known password. -The debug keystore is located in $HOME/.android/debug.keystore, and is created if not present. - -The debug build type is set to use this debug SigningConfig automatically.

    +The debug keystore is located in $HOME/.android/debug.keystore, and +is created if not present. +The debug build type is set to use this debug SigningConfig automatically.

    For more information about how to build and run apps in debug mode, see Building and Running.

    @@ -82,7 +82,8 @@ set of private keys. You must keep your keystore in a safe and secure place.Create a private key. A private key represents the entity to be identified with the app, such as a person or a company.
  • Add the signing configuration to the build file for the app module:

    -

    +
    +
     ...
     android {
         ...
    @@ -103,12 +104,13 @@ android {
         }
     }
     ...
    -

    +
  • Invoke the assembleRelease build task from Android Studio.
  • -

    The package in app/build/apk/app-release.apk is now signed with your release key.

    +

    The package in app/build/apk/app-release.apk is now signed with your release +key.

    Note: Including the passwords for your release key and keystore inside the build file is not a good security practice. Alternatively, you can configure the build @@ -156,17 +158,19 @@ For more information on packaging and signing Android Wear apps, see

    1. On the menu bar, click Build > Generate Signed APK.
    2. -
    3. On the Generate Signed APK Wizard window, click Create new to create -a new keystore.

      If you already have a keystore, go to step 4.

    4. +
    5. On the Generate Signed APK Wizard window, click Create new to +create a new keystore.

      +

      If you already have a keystore, go to step 4.

    6. On the New Key Store window, provide the required information as shown -in figure 1.

      Your key should be valid for at least 25 years, so you can sign app updates +in figure 1.

      +

      Your key should be valid for at least 25 years, so you can sign app updates with the same key through the lifespan of your app.

      Figure 1. Create a new keystore in Android Studio.

    7. -
    8. On the Generate Signed APK Wizard window, select a keystore, a private key, and enter -the passwords for both. Then click Next.

      +
    9. On the Generate Signed APK Wizard window, select a keystore, a private key, and +enter the passwords for both. Then click Next.

      Figure 2. Select a private key in Android Studio.

      @@ -193,14 +197,16 @@ Settings.
    10. more than one), and enter the required information.

      -

      Figure 4. Create a signing configuration in Android Studio.

      +

      Figure 4. Create a signing configuration in Android +Studio.

    11. Click on the Build Types tab.
    12. Select the release build.
    13. Under Signing Config, select the signing configuration you just created.

      -

      Figure 5. Select a signing configuration in Android Studio.

      +

      Figure 5. Select a signing configuration in Android +Studio.

    14. Click OK.
    @@ -299,9 +305,10 @@ an app in release mode from the command line:

    1. Generate a private key using - keytool. + keytool. For example:

      -
      +
       $ keytool -genkey -v -keystore my-release-key.keystore
       -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
       
      @@ -317,7 +324,7 @@ $ keytool -genkey -v -keystore my-release-key.keystore

      Sign your app with your private key using jarsigner:

      -
      +
       $ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1
       -keystore my-release-key.keystore my_application.apk alias_name
       
      @@ -326,14 +333,14 @@ $ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1
    2. Verify that your APK is signed. For example:

      -
      +
       $ jarsigner -verify -verbose -certs my_application.apk
       
    3. Align the final APK package using zipalign.

      -
      +
       $ zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk
       

      zipalign ensures that all uncompressed data starts with a particular byte