feat(android): add Obtainium and a signed F-Droid repository (#3765)

* feat(android): publish verified releases through F-Droid clients and Obtainium

* docs(android): record catalogue packaging requirements and release note

* fix(android): refresh the repository after stable release publication

* fix(release): keep container dispatch independent of Android updates

* test(release): locate the publication step by identity
This commit is contained in:
Palash Debnath authored and GitHub committed 2026-11-02 02:12:14 +05:30
1 parent 522bdc0e34
commit 1a29929cb8
22 files changed
+2086 -3

No files matched your search

+135
View File
@@ -0,0 +1,135 @@
name: Android repository
on:
pull_request:
paths:
- '.github/workflows/android-repository.yml'
- '.github/workflows/electron-release.yml'
- 'scripts/prepare_android_repository.py'
- 'tests/test_android_repository.py'
- 'store/fdroid/**'
- 'store/obtainium.json'
- 'fastlane/metadata/android/**'
push:
branches: [main]
paths:
- '.github/workflows/android-repository.yml'
- 'scripts/prepare_android_repository.py'
- 'store/fdroid/**'
- 'store/obtainium.json'
- 'fastlane/metadata/android/**'
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: android-repository-${{ github.event_name == 'pull_request' && github.event.pull_request.number || 'publish' }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
dispatch-release:
# Human-published releases run from a tag. Dispatch trusted main instead of
# making the persistent index key available to tag workflows.
if: >-
github.repository == 'debpalash/VoiceStudio' &&
github.event_name == 'release' && !github.event.release.prerelease && !github.event.release.draft
runs-on: ubuntu-24.04
permissions:
actions: write
steps:
- name: Refresh from main
env:
GH_TOKEN: ${{ github.token }}
run: gh workflow run android-repository.yml --repo "$GITHUB_REPOSITORY" --ref main
prepare:
# Fork PRs receive only a fresh preview key; publishing secrets live in the
# github-pages environment and are available only to the deploy job.
if: github.event_name != 'release'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: temurin
java-version: '21'
- uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
with:
python-version: '3.11'
- name: Install isolated publisher
run: |
uv venv "$RUNNER_TEMP/fdroid-tools" --python 3.11
uv pip sync --require-hashes --python "$RUNNER_TEMP/fdroid-tools/bin/python" store/fdroid/requirements.txt
- name: Validate publisher and build a signed preview
env:
GH_TOKEN: ${{ github.token }}
run: |
"$RUNNER_TEMP/fdroid-tools/bin/python" tests/test_android_repository.py
gh api repos/debpalash/VoiceStudio/releases/latest > "$RUNNER_TEMP/release.json"
export FDROID_KEYSTORE_PASSWORD="$(python -c 'import secrets; print(secrets.token_urlsafe(36))')"
echo "::add-mask::$FDROID_KEYSTORE_PASSWORD"
keytool -genkeypair -keystore "$RUNNER_TEMP/preview.p12" -storetype PKCS12 -alias voicestudio -keyalg RSA -keysize 4096 -validity 2 -dname 'CN=Repository Preview' -storepass:env FDROID_KEYSTORE_PASSWORD -keypass:env FDROID_KEYSTORE_PASSWORD
"$RUNNER_TEMP/fdroid-tools/bin/python" scripts/prepare_android_repository.py \
--release-json "$RUNNER_TEMP/release.json" --download-directory "$RUNNER_TEMP/incoming" \
--keystore "$RUNNER_TEMP/preview.p12" --apksigner "$ANDROID_HOME/build-tools/36.0.0/apksigner" \
--output "$RUNNER_TEMP/preview-site" --preview
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: android-repository-preview
path: ${{ runner.temp }}/preview-site
retention-days: 3
publish:
needs: prepare
if: >-
github.repository == 'debpalash/VoiceStudio' &&
github.ref == 'refs/heads/main' &&
(github.event_name == 'push' || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-24.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: read
pages: write
id-token: write
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: temurin
java-version: '21'
- uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
with:
python-version: '3.11'
- name: Install isolated publisher
run: |
uv venv "$RUNNER_TEMP/fdroid-tools" --python 3.11
uv pip sync --require-hashes --python "$RUNNER_TEMP/fdroid-tools/bin/python" store/fdroid/requirements.txt
- name: Sign production indexes
env:
GH_TOKEN: ${{ github.token }}
FDROID_REPO_KEYSTORE_B64: ${{ secrets.FDROID_REPO_KEYSTORE_B64 }}
FDROID_KEYSTORE_PASSWORD: ${{ secrets.FDROID_REPO_PASSWORD }}
run: |
umask 077
printf '%s' "$FDROID_REPO_KEYSTORE_B64" | base64 --decode > "$RUNNER_TEMP/repository.p12"
trap 'rm -f "$RUNNER_TEMP/repository.p12"' EXIT
gh api repos/debpalash/VoiceStudio/releases/latest > "$RUNNER_TEMP/release.json"
"$RUNNER_TEMP/fdroid-tools/bin/python" scripts/prepare_android_repository.py \
--release-json "$RUNNER_TEMP/release.json" --download-directory "$RUNNER_TEMP/incoming" \
--keystore "$RUNNER_TEMP/repository.p12" --apksigner "$ANDROID_HOME/build-tools/36.0.0/apksigner" \
--output "$RUNNER_TEMP/site"
- uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
- uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
with:
path: ${{ runner.temp }}/site
- id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
+9 -1
View File
@@ -425,6 +425,7 @@ jobs:
gh release edit "$TAG" --prerelease="$PRERELEASE" --notes-file release-assets/RELEASE_NOTES.md
find release-assets -maxdepth 1 -type f ! -name RELEASE_NOTES.md -print0 | xargs -0 gh release upload "$TAG" --clobber
- name: Publish only when explicitly requested
id: publish_release
if: github.event_name == 'workflow_dispatch' && inputs.publish == true
run: |
if [ "$CHANNEL" = beta ]; then
@@ -432,11 +433,18 @@ jobs:
else
gh release edit "$TAG" --draft=false --prerelease=false --latest
fi
# GITHUB_TOKEN publication does not emit another workflow's release event.
- name: Update the Android repository after stable publication
if: github.event_name == 'workflow_dispatch' && inputs.publish == true
run: |
if [ "$CHANNEL" = stable ]; then
gh workflow run android-repository.yml --ref main
fi
# docker.yml publishes release images on `release: published`, which a
# GITHUB_TOKEN publish cannot trigger; dispatch its release backfill path.
# Only Stable moves `:stable`; a beta gets `:beta` and its exact tag.
- name: Publish release container images
if: github.event_name == 'workflow_dispatch' && inputs.publish == true
if: ${{ !cancelled() && steps.publish_release.outcome == 'success' && github.event_name == 'workflow_dispatch' && inputs.publish == true }}
run: |
PROMOTE=false
if [ "$CHANNEL" = stable ]; then PROMOTE=true; fi
+1 -1
View File
@@ -103,7 +103,7 @@ Start with **VoiceStudio** (default, powered by k2-fsa/OmniVoice), or pick from
| <img src="docs/assets/platforms/windows.svg" alt="" width="20" height="20" />&nbsp;**Windows 10/11** (x64)<br /><sub>Stable</sub> | `.exe` · [guide](docs/install/windows.md)<br /><sub>NVIDIA CUDA · [AMD ROCm (opt-in)](docs/install/windows-rocm.md) · CPU</sub> |
| <img src="docs/assets/platforms/linux.svg" alt="" width="20" height="20" />&nbsp;**Linux** (x64)<br /><sub>Stable</sub> | `.AppImage` · `.deb` · <a href="https://snapcraft.io/voicestudio"><img src="https://img.shields.io/badge/Snap%20Store-27272a?style=flat-square&amp;logo=snapcraft&amp;logoColor=ffffff" alt="Snap Store" height="20" /></a> · [Nix](docs/install/nix.md) · [guide](docs/install/linux.md)<br /><sub>NVIDIA CUDA · CPU</sub> |
| <img src="docs/assets/platforms/docker.svg" alt="" width="20" height="20" />&nbsp;**Docker**<br /><sub>Stable</sub> | [GHCR](docs/install/docker.md "ghcr.io/debpalash/voicestudio")<br /><sub>NVIDIA CUDA · AMD ROCm</sub> |
| <img src="docs/assets/platforms/android.svg" alt="" width="20" height="20" />&nbsp;**Android** 10+<br /><sub>Preview</sub> | `.apk` · [guide](docs/mobile.md#install)<br /><sub>On-device, offline</sub> |
| <img src="docs/assets/platforms/android.svg" alt="" width="20" height="20" />&nbsp;**Android** 10+<br /><sub>Preview</sub> | [APK](https://github.com/debpalash/VoiceStudio/releases/latest) · [Obtainium / F-Droid repo](store/fdroid/README.md) · [guide](docs/mobile.md#install)<br /><sub>On-device, offline</sub> |
| <img src="docs/assets/platforms/apple.svg" alt="" width="20" height="20" />&nbsp;**iPhone / iPad** (iOS 17+)<br /><sub>Preview</sub> | `.ipa` (sideload) · [guide](docs/mobile.md#install)<br /><sub>On-device, offline</sub> |
| <img src="docs/assets/platforms/windows.svg" alt="" width="20" height="20" />&nbsp;**Windows on ARM**<br /><sub>Experimental</sub> | `.exe` · [guide](docs/install/windows.md)<br /><sub>CPU (x64 backend under emulation)</sub> |
| <img src="docs/assets/platforms/apple.svg" alt="" width="20" height="20" />&nbsp;**Intel Mac**<br /><sub>Limited</sub> | `.dmg` · [why](docs/install/macos.md)<br /><sub>App UI only, connects to a remote backend</sub> |
+1
View File
@@ -0,0 +1 @@
Add Android release updates through Obtainium and a publisher-operated F-Droid repository. (#3765)
+4
View File
@@ -22,6 +22,10 @@ Each release attaches the phone apps next to the desktop installers on the
- **Android:** download `VoiceStudio-<version>-android.apk` on the phone, open
it and allow installs from that source when Android asks.
For release updates, add `https://github.com/debpalash/VoiceStudio` in
[Obtainium](https://obtainium.imranr.dev/), or add the
[publisher-operated F-Droid repository](../store/fdroid/README.md). It carries
the same release-signed APK; it is separate from F-Droid.org's main catalogue.
- **iPhone:** download `VoiceStudio-<version>-ios-unsigned.ipa` and install it
with a sideloading tool that signs it with your own Apple ID (for example
Sideloadly). With a free Apple ID the install expires after 7 days; turn on
@@ -0,0 +1 @@
VoiceStudio 0.5.7: signed Android release. Release notes: https://github.com/debpalash/VoiceStudio/releases/tag/v0.5.7
@@ -0,0 +1,8 @@
VoiceStudio runs voice AI on your Android phone. Download a model to generate speech, clone a voice with consent, transcribe recordings, or dub audio and video. Once downloaded, compatible models work offline.
You can also pair with your own VoiceStudio computer and choose where each task runs. No account or API key is required for local use.
Model weights are separate downloads with their own licences, including non-commercial and unassessed terms. Review the model terms before downloading or using its output commercially. Only clone voices you have permission to use.
Source code: https://github.com/debpalash/VoiceStudio
Privacy: https://voicestudio.sh/privacy
Binary file not shown.

After

Width:  |  Height:  |  Size: 297 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

@@ -0,0 +1 @@
Offline speech, voice cloning, dubbing and transcription
@@ -0,0 +1 @@
VoiceStudio
+248
View File
@@ -0,0 +1,248 @@
"""Publish verified GitHub release APKs as a publisher-operated F-Droid repo.
Requires the isolated tools in store/fdroid/requirements.txt. The private
workspace and signing inputs are never part of the public Pages artifact.
"""
from __future__ import annotations
import argparse
import hashlib
import html
import json
import os
from pathlib import Path
import re
import shutil
import subprocess
import sys
import tempfile
from urllib.parse import quote, urlencode
from urllib.request import urlopen
import zipfile
ROOT = Path(__file__).resolve().parents[1]
TAG = re.compile(r"v[0-9]+\.[0-9]+\.[0-9]+\Z")
ANDROID_NS = "{http://schemas.android.com/apk/res/android}"
def sha256(path: Path) -> str:
digest = hashlib.sha256()
with path.open('rb') as source:
for block in iter(lambda: source.read(1024 * 1024), b''):
digest.update(block)
return digest.hexdigest()
def release_asset(release: dict, repository: str) -> dict:
tag = release.get('tag_name', '')
if release.get('draft') is not False or release.get('prerelease') is not False or not TAG.fullmatch(tag):
raise ValueError('Only published stable version tags can enter this repository')
origin = f'https://github.com/{repository}'
if release.get('html_url') != f'{origin}/releases/tag/{tag}':
raise ValueError('Unexpected release source')
name = f'VoiceStudio-{tag[1:]}-android.apk'
assets = [item for item in release.get('assets', []) if item.get('name') == name]
if len(assets) != 1:
raise ValueError('Release must contain exactly one Android APK')
asset = assets[0]
if asset.get('browser_download_url') != f'{origin}/releases/download/{tag}/{name}':
raise ValueError('Unexpected APK source')
if not isinstance(asset.get('size'), int) or not 0 < asset['size'] <= 512 * 1024**2:
raise ValueError('Invalid APK size')
if not re.fullmatch(r'sha256:[0-9a-f]{64}', asset.get('digest') or ''):
raise ValueError('Release APK needs a GitHub SHA-256 digest')
return asset
def verify_download(path: Path, asset: dict) -> None:
if path.stat().st_size != asset['size'] or 'sha256:' + sha256(path) != asset['digest']:
raise ValueError('APK does not match the published release digest')
def download_asset(asset: dict, directory: Path) -> Path:
directory.mkdir(parents=True, exist_ok=True)
target = directory / asset['name']
temporary = target.with_suffix('.partial')
try:
with urlopen(asset['browser_download_url'], timeout=120) as response, temporary.open('wb') as output:
size = 0
while block := response.read(1024 * 1024):
size += len(block)
if size > asset['size']:
raise ValueError('Download exceeded the declared APK size')
output.write(block)
verify_download(temporary, asset)
temporary.replace(target)
finally:
temporary.unlink(missing_ok=True)
return target
def validate_manifest(application, expected_id: str, version: str) -> dict:
if application.get_package() != expected_id or application.get_androidversion_name() != version:
raise ValueError('APK identity or version does not match the release')
code = application.get_androidversion_code()
if not code or not code.isdecimal() or int(code) <= 0:
raise ValueError('APK needs a positive versionCode')
manifest = application.get_android_manifest_xml()
apps = list(manifest.iter('application')) if manifest is not None else []
if len(apps) != 1:
raise ValueError('APK needs exactly one application manifest entry')
for name in ('debuggable', 'testOnly'):
if apps[0].get(ANDROID_NS + name) not in (None, 'false', '0', '0x0', '0x00000000'):
raise ValueError('Release APK must not be debuggable or testOnly')
return {'applicationId': expected_id, 'versionName': version, 'versionCode': int(code)}
def inspect_apk(path: Path, settings: dict, version: str, apksigner: str) -> dict:
# APK certificates are inspected only after cryptographic verification.
result = subprocess.run([apksigner, 'verify', '--min-sdk-version', '29', '--print-certs', str(path)],
check=True, capture_output=True, text=True)
certificates = re.findall(r'^Signer #[0-9]+ certificate SHA-256 digest: ([0-9a-fA-F]{64})$', result.stdout, re.MULTILINE)
if [value.lower() for value in certificates] != [settings['apkSignerSha256']]:
raise ValueError('APK signing identity changed')
from loguru import logger
logger.disable('androguard')
from androguard.core.apk import APK
metadata = validate_manifest(APK(str(path)), settings['applicationId'], version)
return {**metadata, 'apkSignerSha256': certificates[0].lower(), 'sha256': sha256(path), 'bytes': path.stat().st_size}
def obtainium_link(config: dict) -> str:
deep_link = 'obtainium://app/' + quote(json.dumps(config, separators=(',', ':')), safe='')
return 'https://apps.obtainium.imranr.dev/redirect?' + urlencode({'r': deep_link})
def validate_index(directory: Path, metadata: dict, fingerprint: str) -> None:
index = json.loads((directory / 'index-v1.json').read_text())
packages = index['packages']
versions = packages.get(metadata['applicationId'], [])
if set(packages) != {metadata['applicationId']} or len(versions) != 1:
raise ValueError('Repository did not index exactly the verified APK')
record = versions[0]
if (record['versionCode'] != metadata['versionCode'] or record['versionName'] != metadata['versionName']
or record['signer'].lower() != metadata['apkSignerSha256'] or record['hash'] != metadata['sha256']
or sha256(directory / record['apkName']) != metadata['sha256']):
raise ValueError('Indexed APK changed')
from cryptography.hazmat.primitives.serialization.pkcs7 import load_der_pkcs7_certificates
from cryptography.hazmat.primitives import hashes
for name in ('entry.jar', 'index-v1.jar'):
with zipfile.ZipFile(directory / name) as jar:
blocks = [item for item in jar.namelist() if item.upper().endswith('.RSA')]
if len(blocks) != 1:
raise ValueError('Repository index needs exactly one signer')
certificates = load_der_pkcs7_certificates(jar.read(blocks[0]))
if [cert.fingerprint(hashes.SHA256()).hex() for cert in certificates] != [fingerprint]:
raise ValueError('Index signing identity changed')
def build(apk: Path, release: dict, output: Path, keystore: Path, alias: str,
apksigner: str, preview: bool = False) -> dict:
settings = json.loads((ROOT / 'store/fdroid/repository.json').read_text())
asset = release_asset(release, settings['sourceRepository'])
verify_download(apk, asset)
metadata = inspect_apk(apk, settings, release['tag_name'][1:], apksigner)
certificate = subprocess.check_output(['keytool', '-exportcert', '-keystore', str(keystore),
'-alias', alias, '-storepass:env', 'FDROID_KEYSTORE_PASSWORD'], stderr=subprocess.DEVNULL)
fingerprint = hashlib.sha256(certificate).hexdigest()
if not preview and fingerprint != settings['repositorySignerSha256']:
raise ValueError('Repository signing identity changed')
if output.exists():
raise ValueError('Output already exists; use a fresh staging directory')
# Private files live outside the Pages artifact, even if fdroid update fails.
with tempfile.TemporaryDirectory(prefix='voicestudio-fdroid-') as temporary:
work = Path(temporary)
repo = work / 'repo'
repo.mkdir()
destination = repo / f'{metadata["applicationId"]}_{metadata["versionCode"]}.apk'
shutil.copyfile(apk, destination)
config = {
'repo_url': settings['repositoryUrl'],
'repo_name': 'VoiceStudio' + (' preview (not published)' if preview else ''),
'repo_description': 'Android releases published by VoiceStudio. Models download only when requested.',
'repo_icon': 'icon.png', 'archive_older': 0,
'keystore': str(keystore), 'repo_keyalias': alias,
'keystorepass': {'env': 'FDROID_KEYSTORE_PASSWORD'},
'keypass': {'env': 'FDROID_KEYSTORE_PASSWORD'}, 'apksigner': apksigner,
}
config_file = work / 'config.yml'
config_file.write_text(json.dumps(config, indent=2))
config_file.chmod(0o600)
(repo / 'icons').mkdir()
shutil.copyfile(ROOT / 'store/google-play/icon-512.png', repo / 'icons/icon.png')
app_metadata = {
'Name': 'VoiceStudio', 'Categories': ['Multimedia'], 'License': 'AGPL-3.0-only',
'WebSite': 'https://voicestudio.sh', 'SourceCode': f'https://github.com/{settings["sourceRepository"]}',
'IssueTracker': f'https://github.com/{settings["sourceRepository"]}/issues',
'Summary': 'Offline speech, voice cloning, dubbing and transcription',
'Description': ('Run voice models on your phone after downloading their weights, or pair with your own computer. '
'No account is required. Optional models have separate licences, including restrictive and unassessed terms; review them before downloading.'),
'AntiFeatures': ['NonFreeAssets'],
'CurrentVersion': metadata['versionName'], 'CurrentVersionCode': metadata['versionCode'],
'AutoUpdateMode': 'None', 'UpdateCheckMode': 'None',
}
(work / 'metadata').mkdir()
(work / 'metadata' / f'{metadata["applicationId"]}.yml').write_text(json.dumps(app_metadata, indent=2))
locale = work / 'metadata' / metadata['applicationId'] / 'en-US'
shutil.copytree(ROOT / 'fastlane/metadata/android/en-US', locale)
(locale / 'changelogs').mkdir(exist_ok=True)
(locale / 'changelogs' / f'{metadata["versionCode"]}.txt').write_text(
f'VoiceStudio {metadata["versionName"]}: signed Android release. Release notes: {release["html_url"]}\n')
# Keep the tool log private: only repo/ is copied into the public tree.
with (work / 'fdroid-update.log').open('wb') as log:
completed = subprocess.run([str(Path(sys.executable).with_name('fdroid')), 'update', '--pretty'],
cwd=work, stdout=log, stderr=subprocess.STDOUT)
if completed.returncode:
detail = (work / 'fdroid-update.log').read_text()[-3000:]
raise RuntimeError('fdroid update failed: ' + detail.replace(os.environ['FDROID_KEYSTORE_PASSWORD'], '[redacted]'))
validate_index(repo, metadata, fingerprint)
# Verify both signed index containers, including the modern v2 entry.
from fdroidserver import common
common.config = {'apksigner': apksigner}
common.fill_config_defaults(common.config)
common.verify_deprecated_jar_signature(str(repo / 'index-v1.jar'))
common.verify_jar_signature(str(repo / 'entry.jar'))
output.mkdir(parents=True)
shutil.copytree(repo, output / 'fdroid/repo')
obtainium = json.loads((ROOT / 'store/obtainium.json').read_text())
(output / 'obtainium.json').write_text(json.dumps([obtainium], indent=2) + '\n')
proof = {**metadata, 'release': release['html_url'], 'preview': preview,
'repositoryUrl': settings['repositoryUrl'], 'repositorySignerSha256': fingerprint}
(output / 'distribution.json').write_text(json.dumps(proof, indent=2) + '\n')
repo_href = 'fdroid/repo/?fingerprint=' + fingerprint.upper()
(output / 'index.html').write_text(
'<!doctype html><meta charset="utf-8"><title>VoiceStudio Android</title>'
'<h1>VoiceStudio Android</h1><p>Publisher-operated Android release repository.</p>'
f'<p><a href="{html.escape(repo_href)}">F-Droid repository</a> · '
f'<a href="{html.escape(obtainium_link(obtainium))}">Add to Obtainium</a></p>'
'<p>Use the repository URL and fingerprint to add it in an F-Droid client. '
'Play-delivered builds may use a different signing certificate; preserve your projects before switching channels.</p>'
f'<p>Repository certificate SHA-256: <code>{fingerprint.upper()}</code></p>')
return proof
def main() -> None:
parser = argparse.ArgumentParser(description=__doc__)
source = parser.add_mutually_exclusive_group(required=True)
source.add_argument('--apk', type=Path)
source.add_argument('--download-directory', type=Path)
parser.add_argument('--release-json', type=Path, required=True)
parser.add_argument('--output', type=Path, required=True)
parser.add_argument('--keystore', type=Path, required=True)
parser.add_argument('--alias', default='voicestudio')
parser.add_argument('--apksigner', required=True)
parser.add_argument('--preview', action='store_true', help='Use an ephemeral test key; never deploy this output')
args = parser.parse_args()
if not os.environ.get('FDROID_KEYSTORE_PASSWORD'):
parser.error('FDROID_KEYSTORE_PASSWORD is required')
release = json.loads(args.release_json.read_text())
settings = json.loads((ROOT / 'store/fdroid/repository.json').read_text())
asset = release_asset(release, settings['sourceRepository'])
apk = args.apk or download_asset(asset, args.download_directory)
proof = build(apk.resolve(), release, args.output.resolve(),
args.keystore.resolve(), args.alias, args.apksigner, args.preview)
print(json.dumps(proof))
if __name__ == '__main__':
main()
+83
View File
@@ -0,0 +1,83 @@
# VoiceStudio Android distribution
The publisher-operated repository for F-Droid clients is
`https://debpalash.github.io/VoiceStudio/fdroid/repo`. It distributes the unchanged,
release-signed APK from the latest stable GitHub Release. This is separate from
inclusion in F-Droid.org's main catalogue.
Add this URL in an F-Droid-compatible client's repository settings and verify
the certificate SHA-256 fingerprint:
```text
B0EEBDF9745A00FAFF4EDAFBF63E2B20521117C5B368BD30752AFCA9FC50B798
```
The APK uses the developer's existing release certificate, not the repository
index key. Play-delivered builds can have a different signing certificate.
Preserve projects before changing installation channels; do not promise an
in-place update between differently signed installations.
## Obtainium
Add `https://github.com/debpalash/VoiceStudio` in Obtainium, or import
[the generated import file](https://debpalash.github.io/VoiceStudio/obtainium.json).
The repository's landing page also has
an import link. Obtainium follows published APK releases, not CI artifacts or
unreleased commits on `main`. Prereleases are an explicit client choice.
## Publishing
[`android-repository.yml`](../../.github/workflows/android-repository.yml) tests
the publisher on pull requests using a fresh, temporary index key. Production
deployments run from `main` after relevant merges, stable release publication,
or a manual dispatch. Human-published release events dispatch trusted `main`;
tag workflows have no access to the persistent repository key. The release publisher explicitly dispatches the
repository workflow after publishing a stable release: a `GITHUB_TOKEN` release
cannot trigger a second workflow through its `release` event. They rebuild the indexes with the persistent key
in the `github-pages` environment and publish only the generated public site.
The environment needs `FDROID_REPO_KEYSTORE_B64` (PKCS12, alias `voicestudio`)
and `FDROID_REPO_PASSWORD`. Keep an offline backup of that key and password.
Losing or rotating the index key requires users to trust a new repository.
Private keys and credentials are never checked in or copied into Pages artifacts.
`repository.json` pins both signing identities. The publisher checks the release
origin, stable tag, API digest, APK bytes, package/version and both manifest flags
before invoking `fdroid update`. It verifies the resulting APK hash and both
index signatures/certificates before publishing. A signing change fails closed.
Local preparation uses an isolated environment:
```sh
uv venv /tmp/voicestudio-fdroid-tools --python 3.11
uv pip sync --require-hashes --python /tmp/voicestudio-fdroid-tools/bin/python store/fdroid/requirements.txt
/tmp/voicestudio-fdroid-tools/bin/python tests/test_android_repository.py
```
Use the workflow for production signing. Do not publish a pull request's preview
artifact: its temporary certificate intentionally differs from the public pin.
## Main F-Droid catalogue and IzzyOnDroid
Neither upstream catalogue inclusion is claimed by this repository.
- F-Droid's [inclusion policy](https://f-droid.org/docs/Inclusion_Policy/) requires
a compliant source build and dependency review. Our current Android build
downloads the pinned Sherpa-ONNX AAR from GitHub (`mobile/native/pins.json`,
`mobile/native/android/fetch.py`); that needs a source-build recipe or an
accepted dependency arrangement before submission. The native notices record
17 components and their corresponding-source references. The catalogue also
offers optional model weights with restrictive or unassessed licences, so the
independent repository declares `NonFreeAssets` and explains the separate terms.
- IzzyOnDroid's [inclusion policy](https://izzyondroid.org/docs/general/AppInclusionPolicy/)
usually limits APKs to 30 MB and disallows AI-generated application code.
The released APK is about 130 MB. Neither problem is solved by adding metadata;
no inclusion request claiming eligibility is submitted.
The Fastlane listing in `fastlane/metadata/android/en-US` can be reused for a
future eligible catalogue submission. Its two screenshots are real Android
emulator captures from the 2026-10-31 store asset preparation; they are not a new
physical-device test or proof of changes made after that capture.
These channels do not require Play Console's foreground-service declaration
videos. Android's foreground-service permissions and execution rules still apply.
+65
View File
@@ -0,0 +1,65 @@
# Request for packaging: VoiceStudio
This is a packaging-assistance request, not a claim that the current build has
passed F-Droid's source-build checks. The publisher authorizes inclusion.
- Application ID: `sh.voicestudio.mobile`
- Source: https://github.com/debpalash/VoiceStudio
- Licence: AGPL-3.0-only
- Android source: `mobile/android/`
- Latest published version at preparation: `v0.5.7`, version code `3586502`
- Developer APK certificate SHA-256:
`A4CDFD177375F4B8F9448996C34E246C73F1FFA97447A47B842051E27EA74730`
- Metadata, icon and real Android screenshots:
`fastlane/metadata/android/en-US/` (introduced in upstream PR #3765)
- Issue tracker/contact: https://github.com/debpalash/VoiceStudio/issues
- Privacy policy: https://voicestudio.sh/privacy
VoiceStudio runs speech synthesis, voice cloning with consent, transcription
and dubbing on the phone after explicit model downloads. It can also pair with
the user's own VoiceStudio computer. No account is required for local use.
Models and results work offline after downloads. A user can explicitly send a
content report to the developer; phone analytics does not transmit events in
the current implementation.
## Source packaging work to resolve
The normal build runs `mobile/native/android/fetch.py` and `build.sh` through
Gradle `preBuild`. It downloads a hash-pinned Sherpa-ONNX AAR from GitHub, plus
pinned OmniVoice/llama.cpp/ggml source archives. The AAR is the principal native
dependency packaging obstacle; its public corresponding source is available,
but a GitHub binary download is not an established F-Droid dependency route.
Pins and SHA-256 values are in `mobile/native/pins.json` and
`mobile/native/android/source-checksums.json`. The app bundles notices and
corresponding-source references for 17 native components in
`mobile/android/app/src/main/assets/licenses/native-sources.json`.
A relevant accepted pattern is [Ramblr's F-Droid source-build work](https://gitlab.com/fdroid/fdroiddata/-/merge_requests/42401):
source-build the pinned Sherpa-ONNX code and its native source dependencies,
use an accepted Maven ONNX Runtime dependency, and provide all CMake
FetchContent sources before entering the network-isolated build. This has not
yet been implemented or verified for VoiceStudio's pinned runtime versions.
The VoiceStudio native libraries must preserve the full current model/API
coverage and the two isolated GGML engines; removing engines to make a build
pass is not intended.
The build uses JDK 21, Android SDK 36, NDK `27.1.12297006` and CMake `3.22.1`.
The canonical version comes from the root `package.json`; the maintained
release workflow supplies a monotonically increasing
`VOICESTUDIO_ANDROID_VERSION_CODE`. A catalogue recipe must set a matching
version code rather than assume the local fallback code matches the published
APK. Developer-signature reproduction has not been established.
## Model and network declarations
Optional model weights have separate terms, including non-commercial and
unassessed licences. They are not bundled and download only after the user
chooses them. `NonFreeAssets` should be disclosed. The catalogue and licence
records are in `mobile/contract/models.json`; please also assess whether the
Hugging Face downloads warrant `NonFreeNet`, as in the existing SherpaTTS entry.
The publisher-operated binary repository uses the developer's signed release
APK and is independently available to F-Droid clients. This request is for the
separate F-Droid.org source-built catalogue; its acceptance is not implied by
that repository or by the presence of Fastlane metadata.
+8
View File
@@ -0,0 +1,8 @@
{
"schemaVersion": 1,
"sourceRepository": "debpalash/VoiceStudio",
"repositoryUrl": "https://debpalash.github.io/VoiceStudio/fdroid/repo",
"applicationId": "sh.voicestudio.mobile",
"apkSignerSha256": "a4cdfd177375f4b8f9448996c34e246c73f1ffa97447a47b842051e27ea74730",
"repositorySignerSha256": "b0eebdf9745a00faff4edafbf63e2b20521117c5b368bd30752afca9fc50b798"
}
+2
View File
@@ -0,0 +1,2 @@
# Isolated repository publisher; these packages are not shipped in the app.
fdroidserver==2.4.5
File diff suppressed because it is too large. Load diff
+6
View File
@@ -0,0 +1,6 @@
{
"id": "sh.voicestudio.mobile",
"url": "https://github.com/debpalash/VoiceStudio",
"author": "debpalash",
"name": "VoiceStudio"
}
+156
View File
@@ -0,0 +1,156 @@
"""Trust boundaries of the independent Android repository publisher."""
import copy
import hashlib
import importlib.util
import io
import json
import os
import shutil
from pathlib import Path
import tempfile
import types
import subprocess
import unittest
from unittest.mock import patch
from urllib.parse import parse_qs, unquote, urlparse
from xml.etree.ElementTree import Element, SubElement
ROOT = Path(__file__).resolve().parents[1]
spec = importlib.util.spec_from_file_location('android_repository', ROOT / 'scripts/prepare_android_repository.py')
publisher = importlib.util.module_from_spec(spec)
spec.loader.exec_module(publisher)
class AndroidRepositoryTests(unittest.TestCase):
def release(self):
url = 'https://github.com/debpalash/VoiceStudio/releases'
return {'draft': False, 'prerelease': False, 'tag_name': 'v0.5.7',
'html_url': url + '/tag/v0.5.7', 'assets': [{
'name': 'VoiceStudio-0.5.7-android.apk', 'size': 3,
'browser_download_url': url + '/download/v0.5.7/VoiceStudio-0.5.7-android.apk',
'digest': 'sha256:' + hashlib.sha256(b'apk').hexdigest()}]}
def test_release_download_is_bound_to_the_published_project_and_digest(self):
release = self.release()
asset = publisher.release_asset(release, 'debpalash/VoiceStudio')
with tempfile.TemporaryDirectory() as temporary:
apk = Path(temporary) / 'release.apk'
apk.write_bytes(b'apk')
publisher.verify_download(apk, asset)
apk.write_bytes(b'bad')
with self.assertRaisesRegex(ValueError, 'digest'):
publisher.verify_download(apk, asset)
def test_rejects_unpublished_prerelease_duplicate_and_redirected_assets(self):
changes = [
('draft', True), ('prerelease', True), ('tag_name', '../unreviewed'),
('html_url', 'https://github.com/other/project/releases/tag/v0.5.7'),
]
for key, value in changes:
with self.subTest(key=key):
release = self.release(); release[key] = value
with self.assertRaises(ValueError):
publisher.release_asset(release, 'debpalash/VoiceStudio')
for key, value in [('browser_download_url', 'https://untrusted.example/app.apk'),
('size', 0), ('size', 513 * 1024**2), ('digest', None)]:
with self.subTest(asset_field=key):
release = self.release(); release['assets'][0][key] = value
with self.assertRaises(ValueError):
publisher.release_asset(release, 'debpalash/VoiceStudio')
release = self.release(); release['assets'].append(copy.deepcopy(release['assets'][0]))
with self.assertRaisesRegex(ValueError, 'exactly one'):
publisher.release_asset(release, 'debpalash/VoiceStudio')
def test_interrupted_or_oversized_download_preserves_the_previous_file(self):
asset = self.release()['assets'][0]
with tempfile.TemporaryDirectory() as temporary:
directory = Path(temporary)
original = directory / asset['name']
original.write_bytes(b'previous')
with patch.object(publisher, 'urlopen', return_value=io.BytesIO(b'oversized')):
with self.assertRaisesRegex(ValueError, 'exceeded'):
publisher.download_asset(asset, directory)
self.assertEqual(original.read_bytes(), b'previous')
self.assertEqual(list(directory.iterdir()), [original])
with patch.object(publisher, 'urlopen', return_value=io.BytesIO(b'bad')):
with self.assertRaisesRegex(ValueError, 'digest'):
publisher.download_asset(asset, directory)
self.assertEqual(original.read_bytes(), b'previous')
def manifest(self, **flags):
manifest = Element('manifest')
app = SubElement(manifest, 'application')
app.attrib.update({publisher.ANDROID_NS + name: value for name, value in flags.items()})
return types.SimpleNamespace(get_package=lambda: 'sh.voicestudio.mobile',
get_androidversion_name=lambda: '0.5.7', get_androidversion_code=lambda: '3586502',
get_android_manifest_xml=lambda: manifest)
def test_checks_both_flags_even_when_debuggable_is_explicitly_false(self):
publisher.validate_manifest(self.manifest(debuggable='false', testOnly='false'), 'sh.voicestudio.mobile', '0.5.7')
for flags in ({'debuggable': 'true'}, {'debuggable': 'false', 'testOnly': 'true'}, {'testOnly': '@bool/reference'}):
with self.subTest(flags=flags), self.assertRaisesRegex(ValueError, 'debuggable or testOnly'):
publisher.validate_manifest(self.manifest(**flags), 'sh.voicestudio.mobile', '0.5.7')
def test_rejects_wrong_application_version_and_nonpositive_version_code(self):
for appid, version in [('other.app', '0.5.7'), ('sh.voicestudio.mobile', '0.5.8')]:
with self.assertRaises(ValueError):
publisher.validate_manifest(self.manifest(), appid, version)
apk = self.manifest(); apk.get_androidversion_code = lambda: '0'
with self.assertRaisesRegex(ValueError, 'versionCode'):
publisher.validate_manifest(apk, 'sh.voicestudio.mobile', '0.5.7')
def test_obtainium_link_round_trips_the_actual_import_configuration(self):
config = json.loads((ROOT / 'store/obtainium.json').read_text())
link = publisher.obtainium_link(config)
deep = parse_qs(urlparse(link).query)['r'][0]
self.assertEqual(json.loads(unquote(deep.removeprefix('obtainium://app/'))), config)
self.assertEqual(config['url'], 'https://github.com/debpalash/VoiceStudio')
@unittest.skipIf(os.name == 'nt' or shutil.which('bash') is None, 'requires the POSIX workflow shell')
def test_release_workflow_dispatches_the_repository_only_for_stable(self):
import yaml
workflow = yaml.safe_load((ROOT / '.github/workflows/electron-release.yml').read_text())
step = next(item for item in workflow['jobs']['release']['steps']
if 'gh workflow run android-repository.yml' in item.get('run', ''))
self.assertIn('inputs.publish == true', step['if'])
with tempfile.TemporaryDirectory() as temporary:
root = Path(temporary)
command = root / 'gh'
command.write_text('#!/bin/sh\nprintf "%s\\n" "$*" >> "$DISPATCH_LOG"\n')
command.chmod(0o755)
for channel in ('stable', 'beta'):
log = root / f'{channel}.txt'
subprocess.run(['bash', '-eu', '-c', step['run']], check=True,
env={**os.environ, 'PATH': str(root) + os.pathsep + os.environ['PATH'],
'CHANNEL': channel, 'DISPATCH_LOG': str(log)})
if channel == 'stable':
self.assertEqual(log.read_text().strip(), 'workflow run android-repository.yml --ref main')
else:
self.assertFalse(log.exists())
def test_docker_dispatch_is_independent_of_android_failure_after_publication(self):
import yaml
workflow = yaml.safe_load((ROOT / '.github/workflows/electron-release.yml').read_text())
steps = workflow['jobs']['release']['steps']
publish = next(step for step in steps if step.get('id') == 'publish_release')
docker = next(step for step in steps if step.get('name') == 'Publish release container images')
self.assertIn('inputs.publish == true', publish['if'])
# A status function bypasses GitHub's implicit success() guard, while
# the publication outcome prevents dispatching images for a failed draft.
self.assertIn('!cancelled()', docker['if'])
self.assertIn("steps.publish_release.outcome == 'success'", docker['if'])
self.assertNotIn('continue-on-error', next(step for step in steps if 'gh workflow run android-repository.yml' in step.get('run', '')))
def test_store_metadata_is_complete_and_reuses_the_current_brand_art(self):
locale = ROOT / 'fastlane/metadata/android/en-US'
self.assertLessEqual(len((locale / 'short_description.txt').read_text().strip()), 80)
self.assertEqual((locale / 'images/icon.png').read_bytes(), (ROOT / 'store/google-play/icon-512.png').read_bytes())
self.assertGreaterEqual(len(list((locale / 'images/phoneScreenshots').glob('*.png'))), 2)
config = json.loads((ROOT / 'store/fdroid/repository.json').read_text())
self.assertRegex(config['apkSignerSha256'], r'^[0-9a-f]{64}$')
self.assertRegex(config['repositorySignerSha256'], r'^[0-9a-f]{64}$')
self.assertNotEqual(config['apkSignerSha256'], config['repositorySignerSha256'])
if __name__ == '__main__':
unittest.main()
+1 -1
View File
@@ -243,7 +243,7 @@ def test_electron_release_scopes_signing_secrets_and_gates_unsigned_owner_dispat
assert guard["env"]["OWNER"] == "${{ github.repository_owner }}"
assert guard["env"]["DISPATCH_ACTOR"] == "${{ github.actor }}"
assert guard["env"]["RERUN_ACTOR"] == "${{ github.triggering_actor }}"
publish = jobs["release"]["steps"][-1]
publish = next(step for step in jobs["release"]["steps"] if step.get("id") == "publish_release")
assert publish["if"] == "github.event_name == 'workflow_dispatch' && inputs.publish == true"