I have finally created a 'final' keystore for my app. As my app is using Google Maps, I take I have to update all Layouts to use the new API Key resulting from the app as well..
Now I'm fully aware of the requirement to export a signed APK for release, but what after that? My thoughts are that for further development and testing, it would be easiest if I could configure Eclipse to use my final keystore instead of the debug keystore … but I found no way to do that? It only allows me to configure an 'alternative' debug key but I guess that's not the same.
Sorry if I am too confused if I have totally misunderstood something here.
In order for Eclipse to sign automatically for you when you deploy you need to set up a keystore which behaves like the debug keystore. This means there must be an 'androiddebugkey' and both the key and keystore password must be 'android'. Therefore, I'd recommend the following:
keystore
in the commands belowkeytool -storepasswd -keystore iap.keystore
android
as the new passwordandroid
as the passwordandroiddebugkey
(replaceOld_Key_Store_Name
with your current key name in the next command)keytool -changealias -keystore iap.keystore -alias Old_Key_Store_Name -destalias androiddebugkey
andorid
)Old_Key_Store_Name
password (this is whatever you previously had your key password set to)androiddebugkey
keytool -keypasswd -keystore iap.keystore -alias androiddebugkey
andorid
)androiddebugkey
password (this is whatever you previously had your key password set to)android
as the new key passwordandroid
as the key passwordNow when you launch/debug your project, it'll use the keystore we just set up to sign your project. This will allow things like IAP to work.
BEWARE: this is convenient, but of course if someone gets hold of your iap.keystore they will be able to sign things as you by using 'android' as the keystore/key password. Hopefully this is obviously from the steps listed above, but just take a second to appreciate what this means for yourself (or your company). Then based on that decide if the risks are acceptable, and if you need to carry out any extra measures to ensure the safety of this file.
Here there are the instructions to convert a regular keystore in a debug keystore: https://stackoverflow.com/a/15754187/917362
You can configure a custom keystore to use for your debug builds (the ones that happen when you click Run...) in Eclipse by going to Preferences -> Android -> Build and entering the file name in the "Custom debug keystore" option.
However, it has the caveat that it must follow the same rules as a traditional debug keystore, mainly:
Therefore, while it is possible to sign your apps in debug with the same keystore as you Export with, it requires your production keystore to look like a debug store, which makes it less secure if someone got ahold if the file (it would be easier to inspect and guess the passwords).
HTH
I was able to to use my Google Play release keystore as my custom debug keystore to help with debugging in-app purchase functionality. The same could no doubt be applied to debugging Google Maps stuff as well.
As Devunwired mentioned, there are caveats. But my solution was this:
You can enter both your debug and your release SHA1 for the same Google API key using the Google Developers Console (console.developers.google.com).
This way, you will have the same API key for both and will no longer have to change it in the AndroidManifest.xml.
We have the same problem some time ago at our office. Since we needed this quite often we wrote a simple script to make it easy to to convert release keystores to debug ones.
The script is available on https://github.com/IntellexApps/key2debug
We are using it for some time now, so should be quite stable.
cheers!