Make the preview APK reproducible from its tag

Open
#26 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
android, github-actions, react-native, typescript

Research direction

Start with the APK recipe in docs/devices.md and the release workflow in .github/workflows/release-apk.yml; trace how the tag version and workflow run number reach apps/mobile/app.json and the release notes. Build twice from one tag as the recipe describes, then compare the unzipped APK contents while excluding META-INF/. Document each source of differences and whether it was fixed. Done means matching unsigned contents, an automated check, and the recipe on the download page and in release notes.

Written by the indexing model from the issue text.

Description

accepted help wanted

Why

Anyone can build Hermit from the tag a preview APK came from, but the result doesn't match the published APK byte for byte, and nothing checks it. The PRD lists the reproducible APK as open (SL-45 and NFR-15 in docs/prd/hermit-prd.md). A rebuild that matches, apart from the signature, is how people can trust that the APK is the code they read.

What to do

  1. Make the recipe complete. Before it builds, .github/workflows/release-apk.yml writes the version from the tag, and a versionCode equal to the workflow's run number, into apps/mobile/app.json. Put the same step in the recipe in docs/devices.md ("Or build it yourself"), and print the versionCode in the release notes so a rebuild can use it.
  2. Build twice from the same tag, on two machines or two clean clones, following docs/devices.md. Compare the APKs with the signature left out: unzip both and compare every file except META-INF/, or use diffoscope.
  3. Find and remove each source of difference, such as timestamps, file order, absolute paths, the JavaScript bundle or the native builds. List what you find in the pull request, even the parts you couldn't fix.
  4. When two builds match, add a script or a CI job that checks it, and put the recipe in the release notes.

Done when

  • Two builds from the same tag give APKs that match apart from the signature, and a script or a CI job shows it.
  • docs/devices.md and the site's download page say so, and the release notes carry the recipe.

How to check

Build twice as docs/devices.md says, then compare the unzipped APKs without META-INF/.

Keep in mind

  • Compare unsigned contents. Never ask for the preview key, and never commit a keystore or a password.
  • The app gains no network call. Build-time downloads are fine when their versions are pinned.
Dominant language
TypeScript
Stars
11
Forks
0
Avg merge
10m
Merged PRs (30d)
6

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DojoCodingLabs/hermit

All issues in DojoCodingLabs/hermit

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.