Class AndroidSigningConfig
build.json with passwords that are never versioned.The build.json of iiziRun Developer and iiziRun Custom names the keystore, the alias and the keystore type of the android.debug and android.release blocks. The two passwords, storePassword and password, are read at build time from the credential file (~/.ssh/mindus-pwsh-hashtable.xml) through a lookup the caller supplies, and are written only into the transient copy the Cordova build reads. One key serves both passwords and both blocks: in both applications the store and the key password are the same, and so are the debug and the release block (measured 2026-09-30, CC-IIZIRUN-BLD05-KEYSTORE-CREDENTIALS).
Nothing here writes a password anywhere but into the file it completes. A failure names the file and the key, never a value; a JSON parse error is reported without its message, because org.json quotes the offending text, and the text may be a password.
There is no unsigned fallback: a build.json without an Android block, or with a block that names no keystore or no alias, fails the build instead of letting Cordova build an unsigned package with a warning.
- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the Cordova build configuration file in the app directory.Method Summary
Modifier and TypeMethodDescriptionstatic StringCompletes the Android blocks of abuild.jsontext with the passwords of a key.static voidCompletes abuild.jsonfile in place, seecomplete(String,String,String,Function).static booleanremoveFromAppDir(File appDir) Removes every file of an app directory that holds the signing passwords after a build: the completedbuild.jsonand the<buildType>-signing.propertiesfiles cordova-android wrote from it.
Field Details
BUILD_JSON
The name of the Cordova build configuration file in the app directory.- See Also:
Method Details
complete
public static String complete(String json, String fileName, String key, Function<String, String> passwords) throws IOExceptionCompletes the Android blocks of abuild.jsontext with the passwords of a key.Every block present of
android.debugandandroid.releasegetsstorePasswordandpasswordset to the password of the key, replacing any value already there. Nothing else changes: a block that is absent is not created, and theiosobject is left as it is.- Parameters:
json- The text of thebuild.json.fileName- The name of the file, for messages only.key- The bare credential key, e.g.iizirun-custom-android.passwords- The lookup of a password by bare key. It throws when the key is absent; its message must name the key and the credential file, never a value.- Returns:
- The completed text.
- Throws:
IOException- If the text is not a JSON object, has no Android block, has a block that names no keystore or no alias, or the key has no password. The message names the file and the key, never a value.
completeFile
public static void completeFile(File file, String key, Function<String, String> passwords) throws IOExceptionCompletes abuild.jsonfile in place, seecomplete(String,String,String,Function).- Parameters:
file- The file, typically the copy in the Cordova app directory.key- The bare credential key.passwords- The lookup of a password by bare key.- Throws:
IOException- If the file cannot be read or written, or cannot be completed. The message names the file and the key, never a value.
removeFromAppDir
Removes every file of an app directory that holds the signing passwords after a build: the completedbuild.jsonand the<buildType>-signing.propertiesfiles cordova-android wrote from it. Never throws: a file that cannot be deleted is logged by name.- Parameters:
appDir- The Cordova app directory.- Returns:
- true when none of the files is left, false when one could not be deleted.