Skip to content

t1k:unity:mobile:keystore-create

FieldValue
Modulemobile
Version3.65.6
Effortmedium
Tools—

Keywords: android signing, create keystore, keystore, keystore manager, keytool, partner game keystore, signing key

/t1k:unity:mobile:keystore-create

Creates the signing keystore the way Unity’s Keystore Manager does (PKCS12, RSA 2048, SHA256withRSA, 50 years validity) with ONE name for the file and the alias: <partner>_<game>, lowercase, no spaces, no diacritics (wido + Car Climber gives wido_carclimber.keystore). The keystore is COMMITTED in the Unity project repo at the project root, by studio decision: Jenkins builds from the checkout and reads it there. The store and key password is random, generated by the script, and written only to the gitignored keystore_pw.md. The password is never committed and not stored in the vault (only the deprecated create --vault and vault-store steps store it there). The driver is scripts/keystore.cjs (subcommands: derive, locate-keytool, create, patch, verify, and vault-store, deprecated for one release); flags, JSON fields and exit codes are in references/cli-contract.md, the measured defaults and what is still unverified in references/unity-keystore-defaults.md.

  • In scope: suggest the name, create the keystore at the Unity project root, point ProjectSettings.asset at it, verify it, and make .gitignore ignore keystore_pw.md while re-including the keystore (!<name>.keystore) so it is committable.
  • Out of scope: wiring the Jenkins job (t1k-jenkins-unity keystore-wire.cjs --delivery in-project reads this skill’s JSON), Play Console enrolment, overwriting or deleting an existing keystore. The vault route is DEPRECATED for one release: create --vault and vault-store remain only for jobs that still fetch from the vault.
  • “create a keystore”, “new Android signing key”, “keystore for partner X game Y”
  • A bootstrapped template still points at the1_googleplay.keystore and the game needs its own.

Run each step from the project; KS is bun .claude/skills/t1k-unity-mobile-keystore-create/scripts/keystore.cjs.

1. ask partner and game (two inputs). Hint the game from productName in ProjectSettings.asset, never assume.
2. derive KS derive --partner <p> --game <g>
SHOW the suggested name and what it becomes: the file <name>.keystore and the alias. The human confirms
or edits it.
3. locate KS locate-keytool exit 4: ask for --keytool <path> (Unity's JDK keytool or JAVA_HOME)
4. create KS create --name <name> random password into keystore_pw.md (always). .gitignore gets keystore_pw.md and the
negation !<name>.keystore (existing lines kept). Then the keystore is checked: git must NOT ignore it.
exit 3 keystore-ignored: a parent-directory rule ignores the project; nothing was created. Fix that rule, re-run.
exit 3 keystore-exists: tell the human to move the old file themselves, never touch it.
exit 3 not-gitignored: keystore_pw.md could not be made ignored; never proceed with a record git can commit.
5. patch KS patch --name <name>
exit 6 editor-open: the Editor holds the project (or a crash left the lockfile). Tell the human to close
it or to enter the three values in Player Settings > Publishing Settings. Never kill or drive the Editor.
exit 6 existing-keystore-reference: ask before --replace-reference, then show git diff
6. verify KS verify --name <name> committable must be true
7. commit stage the keystore, ProjectSettings/ProjectSettings.asset and .gitignore by explicit path, then commit with the
pathspec form. keystore_pw.md is never staged; check the staged list before committing.
8. report file path, alias, sha1, sha256, the Jenkins values PARAM_KEYSTORE_NAME=<name>.keystore and
PARAM_KEYSTORE_ALIAS_NAME=<name>, the backup reminder below; hand the create JSON to
t1k-jenkins-unity keystore-wire.cjs --delivery in-project --job <folder>/<name>, which prints the
set-secret command that stores the two Jenkins password parameters from keystore_pw.md (the agent runs it)
  • The password is not in the repo and not in the vault. It lives in keystore_pw.md only. The Jenkins wiring step sets the two password parameters from it with jenkins-job.cjs set-secret (the value never goes on argv), and the agent runs that step, so no human types it. Never read keystore_pw.md out loud, print it, paste it into a PR, log or chat.
  • End with the backup reminder: keystore_pw.md is the only copy of the password and it is gitignored, so back it up outside git. Losing it while the keystore is committed means no Play update can be signed. Name both files.
  • Say plainly that the committed keystore is readable by anyone with repo access and stays in git history. This is the studio’s explicit decision for per-game signing keys.
  • Optional follow-up, mention only: register the SHA fingerprints in Firebase.
  • The password is random and lives only in keystore_pw.md, and keytool’s environment while it runs; it never goes to argv or JSON.
  • Keystores made before random passwords used the name as the password: verify still opens them (passwordScheme: equals-name) when no record exists.
  • Never overwrite: an existing <name>.keystore is exit 3 (keytool would silently ADD an entry to it).
  • Never commit keystore_pw.md or any password, never write one into a PR body or log, never stage with git add -A or git add ..
  • After create, only the Jenkins wiring step reads keystore_pw.md, and only through jenkins-job.cjs set-secret --from-file (or --stdin). Nothing else opens the record to pass the password on.
  • A keystore is created only where git will track it. A keystore that git ignores never reaches the Jenkins build.

Deterministic core (name rules, argv, asset patch, gitignore lines, keytool -list -v parsing) is the script and its tests; this body only holds the human-facing judgment, so every step runs inline in the session that is talking to the human. Routing SSOT: rules/orchestration-rules.md § “Task-Type → Agent Routing”.

StepAgent
ask, derive, confirm, commit, reportthe main session (the human is in the loop; not delegable)
locate, create, patch, verifythe main session, running scripts/keystore.cjs
  • keytool prints its errors on stdout and localises -list -v labels; the script pins English and fails loudly on a parse miss.
  • Temp/UnityLockfile can be a live Editor or a crash leftover: ask the human, do not guess.
  • A template *.keystore rule is overridden by the negation the script adds. A rule from a parent directory is not, and create refuses.
  • Wrong or stale guidance here: emit a skill-bug marker for this skill; the fix lands in scripts/lib/constants.cjs, references/cli-contract.md or this file.