Introduce new package
command to cordova-cli
Use existing <preference />
tag to specify code signing specific parameters (certificate path, certificate storage, etc.)
<!-- Windows 8 -->
<preference name="CodeSignCertificate" value="cert/windows/build-release.pfx" />
<!-- Android -->
<preference name="CodeSignCertificateStore" value="cert/android/build-release.keystore" />
<preference name="CodeSignCertificate" value="build-release" />
<!-- iOS -->
<preference name="CodeSignIdentity" value="build-release" />
Store apps no need to be signed (http://stackoverflow.com/questions/19816197/wp8-app-signing-does-not-always-work)
- Replace default certificate file in platform root folder with one specified in config.xml
- Build release configuration
Quirks
- Default certificate will be replaced with release one. This may be potential risky. Need to discuss.
- Certificate publisher should be same as app publisher, specified in .appxmanifest file.
- Windows certificate generation
- Provide certificate options (keystore, alias, passwords) via
ant.properties
file and specify-sign-release
target for ant. (Options also can be provided via ant's command-line args)
Quirks
Generating certificate for Android
- Specify
CODE_SIGN_IDENTITY = <IDENTITY>
in .xcconfig file at the patform root and then execbuild --relese
Quirks
- User should retrieve developer certificate from Apple and install it into keychain manually.
- Signing at PhoneGap Build
- code signing parameters in .xcconfig
Here's a suggestion: Use the platform element.
Ex:
The package-id, package-name, and package-version values would be optional and are there to deal with issues where a particular store requires different values.
Windows and Windows Phone 8.1 need different values for these since the stores are separate at the moment. Perhaps this is an option for the unified platform implementation:
The phone-* preferences could then be optional overrides for phone.