Skip to content

docs: add adb one-liner to read an app's signer SHA by package name - #65

Merged
Xiddoc merged 2 commits into
masterfrom
claude/signer-sha-adb-docs-kqk2ya
Jul 6, 2026
Merged

docs: add adb one-liner to read an app's signer SHA by package name#65
Xiddoc merged 2 commits into
masterfrom
claude/signer-sha-adb-docs-kqk2ya

Conversation

@Xiddoc

@Xiddoc Xiddoc commented Jul 6, 2026

Copy link
Copy Markdown
Owner

What

Adds a single, copy-pastable adb command to docs/reference/schema.md, right next to the signer_sha256 provenance-field description, that reads an app's signer SHA-256 given only its package name.

PKG=com.example.app; adb pull "$(adb shell pm path "$PKG" | tr -d '\r' | sed -n 's/^package:\(.*base\.apk\)$/\1/p')" /tmp/base.apk && apksigner verify --print-certs /tmp/base.apk | grep -i 'SHA-256'

Why

The docs describe the signer_sha256 field's canonical form but never showed how to obtain the value in one step. The starting snippet (apksigner verify --print-certs /data/local/tmp/base.apk | grep -i 'SHA-256') assumed you already had the base APK on hand. This version resolves the base APK path from the package name (pm path), pulls it, and prints the digest.

Notes

  • apksigner already emits the colon-free, lowercase hex form the signer_sha256 field requires — no post-processing needed.
  • tr -d '\r' strips the carriage return adb shell appends; the sed extracts just the base.apk entry from pm path output (which lists split APKs too).
  • Docs-only change; no schema, map, or CI surface touched.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QXorW4zR6ABUWH5Ev4pMug


Generated by Claude Code

claude added 2 commits July 6, 2026 09:58
…stamp)

- Use ${TMPDIR:-.} instead of hardcoded /tmp so it works on-device (Termux).
- Filter to Signer #N cert lines and print the bare digest, excluding the
  Play source-stamp cert that apksigner also prints (not a signer_sha256 value).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QXorW4zR6ABUWH5Ev4pMug
@Xiddoc
Xiddoc merged commit b6ca8c1 into master Jul 6, 2026
1 check passed
@Xiddoc
Xiddoc deleted the claude/signer-sha-adb-docs-kqk2ya branch July 6, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants