Skip to content

ADFA-6207 | Add Share Your Apps, a plugin that publishes apps to a store on the local network - #163

Merged
hal-eisen-adfa merged 9 commits into
mainfrom
ADFA-6207
Nov 13, 2026
Merged

hal-eisen-adfa merged 9 commits into
mainfrom
ADFA-6207

Conversation

@hal-eisen-adfa

@hal-eisen-adfa hal-eisen-adfa commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

ADFA-6207

Summary

Adds Share Your Apps (plugins/Share-Your-Apps/), imported from Local Store. The plugin turns the owner's apps into a small web store that phones on the same Wi-Fi network or hotspot open in a browser, with no internet and no accounts. A companion app, Share Your Apps Server (plugins/Share-Your-Apps/server/), serves the store on port 6175. The plugin bundles it and installs it on the first Publish.

The design, limitations and open items are in plugins/Share-Your-Apps/docs/share-your-apps-design.md. The tester checklist is docs/qa-steps.md.

Commits, in order:

  1. Import Local Store as the Share-Your-Apps plugin.
  2. Rename the server to Share Your Apps Server, and add addon.json and the gallery page.
  3. Sign the server's release in CI: scripts/server-signing-key.sh and a downloadAssets task, wired into Build addon artifacts, Publish addons and Update libs from CodeOnTheGo. The key comes from the four SERVER_SIGNING_* repository secrets, which are set. In CI, downloadAssets stops rather than bundle an unsigned server.
  4. Document the server's new release key.
  5. Build against the shared libs/ and the standard toolchain.
  6. Fix the review blockers from /plugin-review: dispose() releases everything; the install receiver accepts only its own session and only a system confirmation activity; the APK picker finds builds in Code on the Go 26.45+'s relocated build folder; a tooltip on the tab; the gallery page's sections; and a PIN lockout — after 5 wrong PINs, an address waits 30 seconds, doubling up to an hour, with HTTP 429.
  7. Bring the docs in line with 6: the PIN-guess limit, and CI signing no longer listed as future work.
  8. Start Build addon artifacts, Publish addons and Update libs from CodeOnTheGo with a Pre-flight checks step. It names every missing SERVER_SIGNING_* secret, and in the last two the R2 settings or the push token, then fails the run before anything is built. The two existing early checks, which stopped at the first problem, are folded into it. Checked locally with every secret missing, one missing and none missing, and in CI (run 43144318626).

Verified

  • addons check exits 0.
  • Build addon artifacts for Share-Your-Apps on this branch passes with the release key in place (run 43139907353). It built 61e7f000; commit 7 changes only docs.
  • Plugin unit tests pass (4, including the end-to-end publish test). Server unit tests: 47 of 48 pass on macOS. CoreTest binds 127.0.0.2, which macOS lacks without an alias; Linux has it. CI runs neither suite.
  • Emulator (arm64, debug Code on the Go C-d-1031-1713), with the .cgp built locally from 61e7f000 and the server signed with a throwaway key:
    • The plugin installs from Addons Manager, loads after a restart, and adds the Share Your Apps tab.
    • A product with the Tetris project, its APK and its source shows Source ✓ APK ✓ 4.0 MB.
    • Cancel in the Publish dialog changes nothing. Publish installs the server, asks for All files access, and builds Store_*.
    • Over port 6175: the store page and the accessible page return 200. The APK downloads as tetris-classic.apk, byte-identical to the build. The source zip holds no build/, .git, keystore or release.properties.
    • The catalog survives an IDE restart. A second publish reports Published Store_29716133 — 5 files verified., deletes the old folder, and the server serves the new one.

Not yet verified

  • The two-phone parts of docs/qa-steps.md: QR codes, Wi-Fi and hotspot, sharing a store by code or sound, and the PIN lockout from a real buyer's phone.
  • Updating a server already installed on a phone.

Known, not in this PR

  • The PIN lockout is per address, so many addresses guessing together aren't slowed (a ponytail: note in HttpServer.kt).
  • server/CODE_REVIEW.md lists older non-blocking items.
  • The sharing protocol is to get an independent review before any public release (docs/share-protocol-review.md).

Copies the plugin and its companion server (server/) from LocalStoreCombined.zip,
and renames Local Store to Share Your Apps in the plugin: package and plugin.id
org.appdevforall.shareyourapps, pluginName share-your-apps, class, file and
folder names, and display text. Names the unrenamed server still owns (its
package, app name, share-protocol labels, log tags, keystore, APK asset name)
are kept. Media files (webm, mp3, mp4) are gitignored.
…on and the gallery page

The server's package and applicationId become org.appdevforall.shareyourapps.server,
its app name Share Your Apps Server, and the share-link scheme, protocol labels,
log tags, help category and APK asset name follow. The plugin's references to the
server change with it. The server's help database is rebuilt from build_help_db.py.

addon.json and share-your-apps.html make addons check pass.
scripts/server-signing-key.sh writes the server's release key from repository secrets to the
runner and exports SERVER_SIGNING_*, which the server's build now reads before falling back to
release.properties on the phone. The plugin's new downloadAssets task builds the server's release
and bundles it; build-plugins.sh already runs that hook. The three plugin-building workflows call
the script. In CI, without the key, downloadAssets stops rather than bundle an unsigned server.

The design document again names the key's real file and alias, which the rename had changed.
The old Local Store Server key no longer exists, so the server has a new one: alias
shareyourapps-server, RSA 4096, SHA-256 78:75:16:B7:...:45:C6. It's in the four
SERVER_SIGNING_* repository secrets, and its file and password are kept by the maintainer.
…ndard toolchain

The plugin used its own older copies of plugin-api.jar and gradle-plugin.jar, so its .cgp had
no build provenance and verify-provenance.sh failed. It now uses ../../libs, like every other
plugin, and the copies are gone.

check-toolchain wants jvmTarget set to JvmTarget.JVM_17 and Kotlin pinned on the settings
buildscript classpath. The server now keeps AGP and the Kotlin plugin there together (they must
share a class loader) and applies AGP by id. downloadAssets uses tasks.register, which Gradle 9.6
prefers.
- dispose() now stops the plugin's work and lets go of its state: PublishFlow interrupts its
  threads, drops posted work and clears its Context, Intent and listeners; CatalogState saves,
  then shuts its writer down; the install receiver is unregistered; the static PluginContext
  is cleared. The fragment no longer calls requireContext() on a background thread.
- The install result receiver, exported before Android 13, accepts only its own session's
  result and launches only a system app's confirmation screen, without URI grants.
- The server locks a client out after 5 wrong PINs, for 30 s, doubling per further wrong PIN.
- The APK picker also finds APKs in Code on the Go 26.45+'s relocated build tree
  (no_backup/gradle-build/<ProjectStorageKey>/main/*/outputs/apk).
- The bottom-sheet tab has a tooltip tag.
- The gallery page has the rubric's five sections.
- Plugin 1.0.3; server versionCode 50, so the plugin installs the new server.
…e open items

The review-blockers commit added a per-address PIN lockout and CI signing, but the
design document and the review prompt still said there was no limit on PIN guesses,
and listed signing in CI as future work.
…e missing

Build addon artifacts, Publish addons and Update libs from CodeOnTheGo now start with a
Pre-flight checks step. It checks the four SERVER_SIGNING_* secrets, and in the last two
the R2 settings or the push token, which each had their own check that stopped at the first
problem. It reports every missing prerequisite as an error, then fails the run.

Before, a missing keystore secret only failed the build later, and a keystore secret
without its passwords was reported as "release key is in place" and then failed inside
packageRelease with "keystore password was incorrect". server-signing-key.sh no longer
needs its own no-secret branch.
@hal-eisen-adfa
hal-eisen-adfa merged commit 0c2ba46 into main Nov 13, 2026
1 check passed
@hal-eisen-adfa
hal-eisen-adfa deleted the ADFA-6207 branch November 13, 2026 02:03
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.

1 participant