Search code examples
multi-device-hybrid-apps

Sign APK using credentials from Windows crypto store?


Using Visual Studio 2013 Update 3 running on Win 8.1, I have successfully built a signed APK by specifying values for key.store, key.alias, etc., in the res/cert/android/ant.properties file. Now I want to sign the APK with credentials retrieved from the native Windows crypto store -- i.e., pass -storetype Windows-MY to the jarsigner tool. How do I do this using MDHA?


Solution

  • After doing more research, I've concluded that the only way to do what I've described within the scope of the Android ant build is to somehow redefine the -release-sign target in ${sdk.dir}/tools/ant/build.xml. I say "somehow" because I can't figure out how to inject my own rules into bld/Release/platforms/android/custom_rules.xml.

    On the other hand, I could write my own target in the MDHA project file to execute the jarsigner and zipalign tools. The downside of this approach is that it requires me to encode in the project file the locations of these tools and the target APK file.