When using the range of services available through our ANEs you will undoubtably come across
the situation where you are using a service that verifies an application by it's signature
or fingerprint.
The signature of an application is determined by the certificate that is used to sign the
application, i.e. your p12
certificate.
However, when you are debugging your application your IDE will probably use a "debugging
certificate", in place of your release certificate, so that you don't have to enter your
certificates password for eash debug build, but this will change your applications
signature and cause your services to fail to register.
In order to get around this, we can force Flash Builder to use your release certificate
for debug builds by following the process below. It's quite involved but simple enough
once you work through the details.
Create a 'Custom Target'
Go to 'Properties' for your project
- Select ActionScript Build Packaging > Google Android
- Next to Targets, click 'Create Custom...' (copy target values from 'device')
- After you finish creating your custom target, make sure it's selected in the dropdown
- Click 'Customize Launch...'
- Set 'keystore' to the path to your release certificate,
p12
file
- Set 'storetype' to PKCS12
- Set 'storepass' to the password for your cert
Setup a debug configuration
- Back under Properties, go to Run/Debug Settings, and select your Android debug configuration.
- Make sure 'Build Target' is set to your custom build target.
Now Flash Builder will automatically set "<Value cannot be displayed>" after entering the storepass value.
Flash Builder will not save the value of your storepass so every time you launch Flash Builder, before launching the debug configuration
you will need to enter the password. You do this by going to:
- "Debug Configurations" / "Customize Launch"
- Scroll Down to "Modified Parameters" and enter your password directly.
Checks
Determine your certificate fingerprint
You can get the fingerprint of your certificate by using the following command,
replacing 'certificate.p12' with your certificate file and 'PASSWORD' with
your certificates password:
keytool -list -v -keystore certificate.p12 -storetype PKCS12 -storepass PASSWORD
The output will list the certificate fingerprints, and you will most likely be interested
in the SHA1 fingerprint.
Determine the fingerprint of an APK
Determining the fingerprint of the certificate that was used to sign an packaged
application (APK) is a simple process as well. You just need to unpack the APK and
then inspect a particular file in the package using the keytool
program.
unzip APPLICATION.apk
keytool -printcert -file META-INF/CERT.RSA