Skip to content

Example Application: Configuring signing with Java Key Store (JKS)

Notifications You must be signed in to change notification settings

fefong/android_signedapp

Repository files navigation

Android Application signing

Application Example: Set up a signature using Java Key Store (JKS).

Java Key Store

You can create your JKS or use a key generated by another company as a security requirement. You will need the alias and password to access the file.

SigningConfigs

  • storeFile: File storage path of your Java Key Store.
  • storePassword: Password of your JKS.
  • keyAlias: Name of the internal key.
  • keyPassword: Internal key password.

Important: Do not place the .JKS file within the application resources. Just reference the local file.

android {
    ...
    signingConfigs {
        yourKey {
            storeFile file("C:/.../your_JKS.jks")
            storePassword "password"
            keyAlias "alias"
            keyPassword "password"
        }
    }
   ...
}

BuildTypes | BuildVariant

Reference the key you created earlier in Android Build Variants.

android {
    ...
    buildTypes {
        release {
          ...
         signingConfig signingConfigs.yourKey
        }
        debug {
          ...
         signingConfig signingConfigs.yourKey
         debuggable true
        }
    }
 }

After the modifications will be necessary to synchronize the project with the IDE for the operation of this property. In some cases it becomes necessary to clean up the project cache and to verify in which build varients the project is being compiled.

Others

KeyStore Explorer - KeyStore Explorer is an open source GUI replacement for the Java command-line utilities keytool and jarsigner. KeyStore Explorer presents their functionality, and more, via an intuitive graphical user interface.

Some links for more in depth learning