Class AndroidSigningConfig

java.lang.Object
com.iizix.run.AndroidSigningConfig

public final class AndroidSigningConfig extends Object
Completes the Android signing configuration of a Cordova 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 Details

    • BUILD_JSON

      public static final String 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 IOException
      Completes the Android blocks of a build.json text with the passwords of a key.

      Every block present of android.debug and android.release gets storePassword and password set to the password of the key, replacing any value already there. Nothing else changes: a block that is absent is not created, and the ios object is left as it is.

      Parameters:
      json - The text of the build.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 IOException
      Completes a build.json file in place, see complete(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

      public static boolean removeFromAppDir(File appDir)
      Removes every file of an app directory that holds the signing passwords after a build: the completed build.json and the <buildType>-signing.properties files 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.