Signing in Release Mode
In release mode, you sign your app with your own certificate:
- Create a keystore. A keystore is a binary file that contains a 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 {
- ...
- defaultConfig { ... }
- signingConfigs {
- release {
- storeFile file("myreleasekey.keystore")
- storePassword "password"
- keyAlias "MyReleaseKey"
- keyPassword "password"
- }
- }
- buildTypes {
- release {
- ...
- signingConfig signingConfigs.release
- }
- }
- }
- …
Example : ant.properties
# Turn on or off logging.
config.logging=true
#
# Set the keystore properties for signing the application.
#
key.store=santosh.keystore
key.alias=santoshshinde
key.store.password=santosh
key.alias.password=santosh
C:\Users\Admin>keytool -genkey -v -keystore santosh.keystore -alias Myappname -keyalg RSA -keysize 2048 -validity 10000
Enter keystore password: santosh
Re-enter new password: santosh
What is your first and last name?
[Unknown]: Santosh
What is the name of your organizational unit?
[Unknown]: Student
What is the name of your organization?
[Unknown]: Student
What is the name of your City or Locality?
[Unknown]: Pune
What is the name of your State or Province?
[Unknown]: Maharashtra
What is the two-letter country code for this unit?
[Unknown]: 91
Is CN=Santosh, OU=Student, O=Student, L=Pune, ST=
Maharashtra, C=91 correct?
[no]: yes
Generating 2,048 bit RSA key pair and self-signed certificate (SHA256withRSA)
with a validity of 10,000 days
for: CN=Santosh, OU=Student, O=Student, L=Pune, ST=
Maharashtra, C=91
Enter key password for <Myappname>
(RETURN if same as keystore password):
[Storing my-release-key.keystore]
Comments
Post a Comment