Class V4IiziRunShim

java.lang.Object
com.iizix.server.devel.V4IiziRunShim

public final class V4IiziRunShim extends Object
V4-SHIM (temporary, remove before the public v5 build).

Lets the iiziRun launchers of IIZI version 4 that are in the stores - BIG ACE 4.6.0 and ICU 4.6.0 (iiziRun Customized) and iiziRun Developer 4.x - launch their application on a server of IIZI version 5, so that the demo server can take the applications over on their real names before the version 5 apps are published (order CC-V4-IIZIRUN-SHIM, the owner's plan of 2026-10-31). The shim never reaches a customer: this class, its test V4IiziRunShimTest and the two hook lines in ExternalBrowserPagesImpl (each marked // V4-SHIM) are removed in ONE commit before the public v5 build.

What a launcher of version 4 needs. Such a launcher bundles no IIZI client. It asks the server for /iizi/iiziRun/pkey.json (the server's Diffie-Hellman key, for the password it encrypts) and then for /iizi/iiziRun/app.json (the client files to load), and loads the client the reply lists from the server - this server's client, of version 5, which then connects over the WebSocket with the protocol of version 5 (pv=5, no key, no password). The launcher refuses a reply whose version is not exactly 1 ("Remote iiziServer is not compatible with this version of the app.") and reads the member SPK of pkey.json as a hexadecimal number. So, when the switch is on, the two replies carry version 1 and a stand-in key; nothing else changes. The server reads no password (IIZI version 5, L-15 R5): the client public key pk and the encrypted password epw the launcher sends on app.json are not read, as before.

The switch: the system property "iizi.v4.support"; the value "true" is on, absent or anything else is off, and off is the server exactly as without this class.

The detection, per request: pkey.json is asked for by a launcher of version 4 alone (no iiziRun of version 5 asks for it); app.json with a member pk or epw is a launch of version 4 (a launcher of version 5 sends neither). apps.json is left alone: iiziRun Developer 4.x accepts any version from 1 there (jsr/comrun.js), and a reply of 1 would turn the iiziRun Developer of version 5 away. The WebSocket is not touched: no launcher of version 4 in the stores sends a key (k=) there, since the client it runs is this server's.

Author:
Christopher Mindus
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The parameter of app.json that carries the client public key of a launcher before version 5: "pk".
    static final String
    The member of the key reply the launcher reads the server's Diffie-Hellman public key from: "SPK".
    static final String
    The one value of the property that switches the shim on: "true".
    static final String
    The parameter of app.json that carries the encrypted password of a launcher before version 5: "epw".
    static final String
    The system property that switches the shim on: "iizi.v4.support".
    static final String
    The stand-in server public key: 64 hexadecimal digits, a 256-bit number below the prime of the launcher's Diffie-Hellman group, formatted as the server's own key was (the former DHKey).
    static final int
    The protocol version every iiziRun before version 5 expects in a reply, 1.
    static final String
    The member of the replies that carries the protocol version: "version".
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    adapt(JSONObject root, String target, ClientParams params)
    Adapts the reply of an iiziRun JSON route for a launcher of IIZI version 4, when the shim is on and the request is such a launcher's: the member "version" becomes 1 and the member "SPK" the stand-in key.
    static boolean
    Checks if the shim is on: the system property "iizi.v4.support" is "true".
    static boolean
    Checks if a request is one a launcher of IIZI version 4 makes: pkey.json always, and app.json carrying the client public key pk or the encrypted password epw.
  • Field Details

    • PROPERTY

      public static final String PROPERTY
      The system property that switches the shim on: "iizi.v4.support".
      See Also:
    • ON

      public static final String ON
      The one value of the property that switches the shim on: "true".
      See Also:
    • V4_PROTOCOL_VERSION

      public static final int V4_PROTOCOL_VERSION
      The protocol version every iiziRun before version 5 expects in a reply, 1.
      See Also:
    • VERSION_MEMBER

      public static final String VERSION_MEMBER
      The member of the replies that carries the protocol version: "version".
      See Also:
    • KEY_MEMBER

      public static final String KEY_MEMBER
      The member of the key reply the launcher reads the server's Diffie-Hellman public key from: "SPK".
      See Also:
    • STAND_IN_KEY

      public static final String STAND_IN_KEY
      The stand-in server public key: 64 hexadecimal digits, a 256-bit number below the prime of the launcher's Diffie-Hellman group, formatted as the server's own key was (the former DHKey). The launcher computes a shared key from it and encrypts the password with that; the server decrypts nothing, so a constant serves.
      See Also:
    • CLIENT_KEY_PARAMETER

      public static final String CLIENT_KEY_PARAMETER
      The parameter of app.json that carries the client public key of a launcher before version 5: "pk".
      See Also:
    • PASSWORD_PARAMETER

      public static final String PASSWORD_PARAMETER
      The parameter of app.json that carries the encrypted password of a launcher before version 5: "epw".
      See Also:
  • Method Details

    • isEnabled

      public static boolean isEnabled()
      Checks if the shim is on: the system property "iizi.v4.support" is "true". Read at every request, so a test can set and clear it.
      Returns:
      true when on, false when the property is absent or has any other value.
    • isVersion4Request

      public static boolean isVersion4Request(String target, ClientParams params)
      Checks if a request is one a launcher of IIZI version 4 makes: pkey.json always, and app.json carrying the client public key pk or the encrypted password epw. Every other request, apps.json among them, is not.
      Parameters:
      target - The request target, e.g. ServerConstants.RUN_PKEY.
      params - The client parameters of the request's query, null for none.
      Returns:
      true for a request of a launcher of version 4, false otherwise.
    • adapt

      public static boolean adapt(JSONObject root, String target, ClientParams params)
      Adapts the reply of an iiziRun JSON route for a launcher of IIZI version 4, when the shim is on and the request is such a launcher's: the member "version" becomes 1 and the member "SPK" the stand-in key. The server's log gets one WARNING the first time, and an INFO line per adapted reply.
      Parameters:
      root - The reply, with the server information already added.
      target - The request target, e.g. ServerConstants.RUN_APP.
      params - The client parameters of the request's query, null for none.
      Returns:
      true when the reply was adapted, false when it is left as it is (the shim is off, or the request is not a launcher's of version 4).