Skip to content

Instantly share code, notes, and snippets.

@manifestinteractive
Last active July 6, 2016 05:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manifestinteractive/a0d0b2af3e017db8ae17 to your computer and use it in GitHub Desktop.
Save manifestinteractive/a0d0b2af3e017db8ae17 to your computer and use it in GitHub Desktop.
Keystore Instructions

Creating a Keystore File

To create a Keystore file, you will need to hop in terminal and run a few commands.

cd /path/to/keystore/folder
keytool -genkey -v -keystore projectname.keystore -alias ProjectName -keyalg RSA -keysize 2048 -validity 10000
Enter keystore password: **********
Re-enter new password: **********

What is your first and last name?
  [Unknown]:  Peter Schmalfeldt

What is the name of your organizational unit?
  [Unknown]:  Mobile Development

What is the name of your organization?
  [Unknown]:  Manifest Interactive, LLC.

What is the name of your City or Locality?
  [Unknown]:  St. Petersburg

What is the name of your State or Province?
  [Unknown]:  Florida

What is the two-letter country code for this unit?
  [Unknown]:  US

Is CN=Peter Schmalfeldt, OU="Mobile Development", O="Manifest Interactive, LLC.", L=St. Petersburg, ST=Florida, C=US correct?
  [no]:  yes

Enter key password for <PanicPress>
	(RETURN if same as keystore password):  PRESS RETURN

Adding Keystore to your Project

To add your newly created Keystore to your Android Project, do the following:

cd /path/to/android/project
nano ant.properties

Add the following to ant.properties:

key.store=/path/to/keystore/folder/projectname.keystore
key.store.password=**********
key.alias=ProjectName
key.alias.password=**********

Using for Android Builds

Make sure you are updating the path and project names correctly. keystore-name as used below denotes the alias you used when creating your projectname.keystore file.

cd /path/to/cordova/project
cordova build android --release
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore /path/to/keystore/folder/projectname.keystore platforms/android/build/outputs/apk/android-release-unsigned.apk keystore-name
/path/to/andoid/sdk/build-tools/22.0.1/zipalign -v 4 platforms/android/build/outputs/apk/android-release-unsigned.apk platforms/android/build/outputs/apk/project-v1.0.0.apk
open platforms/android/build/outputs/apk/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment