Skip to content

Make the real release and native test APKs use the same signing certificate #740

Closed

Description

@lumenpearson

Actual signed/native APK48 on reviewed master23dc5bfccb3cbeee52ae0873ec0665f391ba62f3 completed Build successfully, then failed Verify native APK pair.

Run: https://github.com/lumenpearson/lessons/actions/runs/43228579601
The verifier exited with: The native test and app must have the same valid signing certificate. Both apksigner pipelines reached the equality guard; no certificate values were logged. Shred keystore succeeded; collection/upload were skipped. No artifact was installed and no native call occurred.

The preceding local packaging pair used release-to-debug signing fallback, so it could not establish behavior with a distinct release key. Root cause still needs independent local certificate evidence; do not assume the exact signer from the error text.

Reproduce on unchanged source with a separate private throwaway signing fixture, never the production key or its values. Inspect the actual cached AGP9.5 signing API/implementation and actual apksigner main/test identities. Preserve production shrinking, release-target testing, the exact-source/master guard and the common-certificate refusal. Observe the existing certificate equality rule RED before correcting configuration, then GREEN with the same distinct fixture. Run complete affected gates, independent delta review and dev/master CI/production before another actual signed/native run.

Part of #273's remaining5a delivery gate, existing milestone11. #737's ordinary-JVM/native-packaging separation is confirmed by the successful Build step and remains intact. Preserve all earlier failed/successful reports, worktrees and the installed APK46 fixture. Project6 remains an explicit access/readback boundary; no denied action relay or browser/auth workaround.

Diagnostic update, 12 November: on unchanged master23dc, one local offline packaging invocation with a new private self-signed JKS fixture passed in17.11s. Both APK signatures verify and both certificate SHA256 values equal the requested distinct fixture certificate;2707 tracked source-file hashes remained unchanged. The production48 failure was NOT reproduced. No production key was read, no APK uploaded/installed, no native execution. The null-storeType hypothesis was rejected: the cached AGP DSL initializes storeType using KeyStore.getDefaultType. No signing DSL change is justified by this evidence. The exact hosted image uses Build Tools37.0.0; the local verifier was36.0.0. Continue at the actual verifier/workflow boundary with preserved APKs and official tool provenance, without weakening the equality guard or claiming a fix.

Root cause reproduced with the official Google Build Tools37 Linux archive, verified against its published SHA1 and66135704-byte size. The same retained distinct-key main/test pair verifies cryptographically under36 and37, and the earlier real signed APK46 also has the same certificate under both.37 prints V2 Signer: certificate SHA-256 digest: while36 prints Signer #1 certificate SHA-256 digest:. Executing the exact unchanged workflow verifier on the same pair gives36GREEN/37RED with the APK48 error. The old sed expression yields empty digests under37; this is a parser refusal, not evidence that Gradle signed the pair differently.

The minimal working correction accepts the certificate field independently of the signer label, excludes source stamps, deduplicates equal certificates repeated by signature scheme and requires exactly one common64-hex APK signing identity. Cryptographic nonzero exits still fail before receipt/upload; distinct signers are refused. Signing DSL, SDK selection, source guards and R8 remain unchanged. Eleven regression cases execute the actual workflow shell: old RED5/6passed, corrected complete test file35passed15.95s. The actual corrected guard now passes with36 and37 on the same retained pair. Full affected gates, independent delta review, exact CI/dev/master/production and a new real signed workflow remain pending; fixture evidence is not native or delivery acceptance.

Correction PR #741 is ready for review on c6795ce. Fresh complete frozen local gates passed: Ruff, mypy242, bare eight-worker pytest3893passed/17skipped=3910 in2147.67s; all four Android gates1973logical cases85.8s, with complete archived reports and canonical counts. The17 skip identities match the previous full run (six host, eleven PostgreSQL-only on SQLite). One independent final review approved54b6eb5f with Critical0/Important0/Minor6; four code/test Minors are fully deferred in PR741, two documentation-accuracy findings corrected in the final doc-only commit. Runtime/tests/workflow stayed byte-identical to the full gates. All9worktrees and installed APK46 preserved. Exact new-head/dev/master CI, production, a real signed pair and bounded Studio proof remain pending; do not infer delivery/native acceptance from local verifier fixtures.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions