- Home /
Publishing Settings (keystore password) not saving
Everytime I quit and restart Unity, the keystore password needs to be entered into Publishing Settings again or I cannot build to Android. Isn't there some way to save it?
Answer by yukelzon · May 18, 2015 at 03:28 PM
If you want to "presign" your application, create or choose the key you intend to use so that it is saved as the project default key (and select the desired alias for the sake of being thorough), then add a new cs script in the Editor folder and replace the default content (replacing the capitalized words with the values for your specific project) with:
Code (CSharp):
using UnityEngine;
using UnityEditor;
using System.IO;
[InitializeOnLoad]
public class PreloadSigningAlias
{
static PreloadSigningAlias ()
{
PlayerSettings.Android.keystorePass = "KEYSTORE_PASS";
PlayerSettings.Android.keyaliasName = "ALIAS_NAME";
PlayerSettings.Android.keyaliasPass = "ALIAS_PASSWORD";
}
}
@yukelzon This looks very helpfull, but can you elaborate? I'm on $$anonymous$$ac, where is the Editor folder? do you mean ~/Applications/Unity?
Thanks!
he means Editor folder in your Project's directory. You have to create it if it doesn't exist
But this will compiled in your apk and can be easily reverse engineered?
It is set in the player settings and should not be compiled into the apps
you can create an Editor folder in the assets folder as well...
// place the keystore file in root of project and not in the assets folder...
// you will have ~/Assets, ~/Library, ~/Project, ~/Temp, ~/my$$anonymous$$ey.keystore ... etc
PlayerSettings.Android.keystoreName = "my$$anonymous$$ey.keystore";
PlayerSettings.Android.keystorePass = "my$$anonymous$$eyPassword";
PlayerSettings.Android.keyaliasName = "my$$anonymous$$eyAliasName";
PlayerSettings.Android.keyaliasPass = "my$$anonymous$$eyAliasPassword";