Setting up zsp (v2) for publishing an app (Plume) to Zapstore

Image
Zapstore

I forked Feather made by Gigi. Why? I would like to see this feature.

While I made the fork some weeks ago and started to read the docs (https://zapstore.dev/docs/publish), a new major update was there from the Zapstore team.

A perfect excuse for me to start exploring how it works.

Install zsp (v2)

go install github.com/zapstore/zsp/v2/cmd/zsp@latest

Or download the binary from https://github.com/zapstore/zsp/releases 

Verify if zsp is working with zsp --version in your cli (command-line interface).

Configuration

Make sure you are in a root directory of a app project you like to publish as an application into https://zapstore.dev 

! - required: an APK file of your application

Run zsp in your cli to start. 

You will be asked for a location where your APK can be downloaded or is located on your machine.

But if you start from scratch and have no APK file of your app yet, this won't work.

Build, sign and publish an APK file

If your are using an AI agent, run zsp skill in your cli and will parse a Markdown formatted skill file
You can read what is described in that skill here.

In my Pi agent, I've pasted this text into zapstore-publish/SKILL.md inside my project directory. Inside the terminal of my Pi Agent I've loaded the skill with /skill:zapstore-publish. It not only loads the skill, but it will also execute all the tasks described. This means the agent will already try to build, sign and publish your APK file of the app. This attempt failed in my case, because the result was that the agent could not find the hotbox tool (see next section).

More info at https://pi.dev/docs/latest/skills how to integrate skills in a Pi agent.

Hotbox

This is a brand new cli tool using by zsp version 2. It's a requirement, so you also install hotbox.

https://github.com/zapstore/hotbox 

It took me quite some time to understand how the binary works. It seems very easy when demonstrated in this note, but when you are setting it up and are reading the help documention with hotbox --help it's pretty complex to understand (I'm not a Android developer, so I'm not familar how the signing ceremony works for APK files). First thing I had to do, was creating a keystore for Android. This Stackoverflow thread helped me with using keytool on my machine.

Finally I figured it out.

./hotbox --key <path to android keystore> <path to hotbox file>

Basicly there are two files needed:

  1. A keystore file (signing key) for Android (this is my publishing identity for Android)
  2. A signing key (nostr private key) for publishing the nostr events (my Nostr identity)

My advice is to read the skill above, so you will have better understanding how things works and what hotbox is doing.

When everything works with hotbox, you will see this kind of output:

```
SIGN_WITH='bunker://your_hex_formatted_pubkey?relay=ws%3A%2F%2F127.0.0.1%3A39147%2F4b50b81933981850cde90638e59d210f&amp;secret=a_secret'
HOTBOX_PIN='a_pin'
HOTBOX_SOCKET='/tmp/hotbox-1000/name_of_your_app.sock'

```

This mean there is a service / deamon now running on your machine ready to sign your APK file and sign the nostr events.

I copy-pasted these variables with the values into the .env file in the directory of my application. 

Tested in practice - publishing my first app named Plume

Here is the app: https://zapstore.dev/apps/plume.sebastix.dev 

This app is a fork of Feather: https://zapstore.dev/apps/org.dergigi.feather 

It had already a defined Zapstore configuration file (version 1.7x), a bash script `scripts/zapstore-publish.sh` and was not in sync with the instructions above.

So I had to instruct my agent quite some times about these differences and let it figure out all the things. At some point, there was a success message that the APK was signed and the signed Nostr event where broadcasted. Also the APK file was created as Blossom blob file and uploaded to the Zapstore Blossom server. And voila, there is now an Android available in the Zapstore under my name. It has been more than 13 years ago that I published a mobile app to an appstore (I did make one, using Titanium SDK back in the days). Gosh...now let the real fun begin because I have a feature I would like to see in Feather and/or Plume. To be continued!