t1k:unity:mobile:keystore-create
| Field | Value |
|---|---|
| Module | mobile |
| Version | 3.65.6 |
| Effort | medium |
| Tools | — |
Keywords: android signing, create keystore, keystore, keystore manager, keytool, partner game keystore, signing key
How to invoke
Section titled “How to invoke”/t1k:unity:mobile:keystore-createT1K: Create the Android Keystore
Section titled “T1K: Create the Android Keystore”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.assetat it, verify it, and make.gitignoreignorekeystore_pw.mdwhile 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-projectreads this skill’s JSON), Play Console enrolment, overwriting or deleting an existing keystore. The vault route is DEPRECATED for one release:create --vaultandvault-storeremain only for jobs that still fetch from the vault.
When to Use
Section titled “When to Use”- “create a keystore”, “new Android signing key”, “keystore for partner X game Y”
- A bootstrapped template still points at
the1_googleplay.keystoreand the game needs its own.
Workflow
Section titled “Workflow”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 diff6. verify KS verify --name <name> committable must be true7. 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)Report Rules
Section titled “Report Rules”- The password is not in the repo and not in the vault. It lives in
keystore_pw.mdonly. The Jenkins wiring step sets the two password parameters from it withjenkins-job.cjs set-secret(the value never goes on argv), and the agent runs that step, so no human types it. Never readkeystore_pw.mdout loud, print it, paste it into a PR, log or chat. - End with the backup reminder:
keystore_pw.mdis 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.
Hard Rules
Section titled “Hard Rules”- 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:
verifystill opens them (passwordScheme: equals-name) when no record exists. - Never overwrite: an existing
<name>.keystoreis exit 3 (keytool would silently ADD an entry to it). - Never commit
keystore_pw.mdor any password, never write one into a PR body or log, never stage withgit add -Aorgit add .. - After
create, only the Jenkins wiring step readskeystore_pw.md, and only throughjenkins-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.
Executed by
Section titled “Executed by”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”.
| Step | Agent |
|---|---|
| ask, derive, confirm, commit, report | the main session (the human is in the loop; not delegable) |
| locate, create, patch, verify | the main session, running scripts/keystore.cjs |
Hard rules
Section titled “Hard rules”- keytool prints its errors on stdout and localises
-list -vlabels; the script pins English and fails loudly on a parse miss. Temp/UnityLockfilecan be a live Editor or a crash leftover: ask the human, do not guess.- A template
*.keystorerule is overridden by the negation the script adds. A rule from a parent directory is not, andcreaterefuses. - Wrong or stale guidance here: emit a skill-bug marker for this skill; the fix lands in
scripts/lib/constants.cjs,references/cli-contract.mdor this file.