kotlin-multiplatform

# Amethyst Builder Skill

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "kotlin-multiplatform" with this command: npx skills add vitorpamplona/amethyst/vitorpamplona-amethyst-kotlin-multiplatform

Amethyst Builder Skill

Build customized Amethyst Nostr clients for Android. Fork, rebrand, customize, and distribute your own version.

Overview

Amethyst is the premier Nostr client for Android. This skill enables you to:

  • Create rebranded versions (custom name, package, icons)
  • Build F-Droid-compatible releases (no Google Play dependencies)
  • Add or modify features
  • Sign and distribute APKs

Prerequisites

Required Tools

  1. Java 21 (via SDKMAN)

    curl -s "https://get.sdkman.io" | bash
    source "$HOME/.sdkman/bin/sdkman-init.sh"
    sdk install java 21.0.5-tem
    sdk use java 21.0.5-tem
    
  2. Android SDK

  3. Git for cloning the repository

Environment Setup

export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools

Build Workflow

1. Clone the Repository

mkdir -p ~/projects/your-app-name
cd ~/projects/your-app-name
git clone https://github.com/vitorpamplona/amethyst.git .

2. Create Signing Key

keytool -genkeypair -v \
  -keystore ./release-key.jks \
  -alias your-app \
  -keyalg RSA -keysize 2048 \
  -validity 10000

Create keystore.properties in project root:

storeFile=release-key.jks
storePassword=your-password
keyAlias=your-app
keyPassword=your-password

3. Configure Signing

Add to amethyst/build.gradle inside the android {} block:

def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

signingConfigs {
    release {
        if (keystorePropertiesFile.exists()) {
            storeFile rootProject.file(keystoreProperties['storeFile'])
            storePassword keystoreProperties['storePassword']
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
        }
    }
}

Update the release buildType to use the signing config:

buildTypes {
    release {
        signingConfig signingConfigs.release
        // ... existing config
    }
}

4. Disable Google Services (Required for F-Droid)

⚠️ CRITICAL: The Google Services plugin fails when you change the package name. For F-Droid builds, disable it.

Edit amethyst/build.gradle, comment out the plugin:

plugins {
    alias(libs.plugins.androidApplication)
    alias(libs.plugins.jetbrainsKotlinAndroid)
    // alias(libs.plugins.googleServices)  // DISABLED for F-Droid
    alias(libs.plugins.jetbrainsComposeCompiler)
}

5. Build

source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk use java 21.0.5-tem
./gradlew assembleFdroidRelease

Build time: ~9 minutes first build, faster on subsequent builds.

6. Locate APKs

Output directory: amethyst/build/outputs/apk/fdroid/release/

Files generated:

  • amethyst-fdroid-arm64-v8a-release.apk - ARM64 (most phones)
  • amethyst-fdroid-universal-release.apk - All architectures (larger)

Customizations

Change App Name

Edit amethyst/src/main/res/values/strings.xml:

<string name="app_name" translatable="false">YourAppName</string>
<string name="app_name_debug" translatable="false">YourAppName Debug</string>

Change Package ID

Edit amethyst/build.gradle:

android {
    defaultConfig {
        applicationId = "com.yourcompany.yourapp"
    }
}

Change Project Name

Edit settings.gradle:

rootProject.name = "YourAppName"

Change App Icon

Replace icon files in:

  • amethyst/src/main/res/mipmap-*/ic_launcher.webp
  • amethyst/src/main/res/mipmap-*/ic_launcher_round.webp

Add Client Tag to Posts

Make your app identify itself on posts with ["client", "YourAppName"].

1. Create tag builder extension:

Create quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/tags/clientTag/TagArrayBuilderExt.kt:

package com.vitorpamplona.quartz.nip01Core.tags.clientTag

import com.vitorpamplona.quartz.nip01Core.core.Event
import com.vitorpamplona.quartz.nip01Core.core.TagArrayBuilder

fun <T : Event> TagArrayBuilder<T>.client(clientName: String) = 
    addUnique(arrayOf(ClientTag.TAG_NAME, clientName))

2. Add to TextNoteEvent:

Edit quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip10Notes/TextNoteEvent.kt:

Add import:

import com.vitorpamplona.quartz.nip01Core.tags.clientTag.client

In both build() functions, add after alt(...):

client("YourAppName")

Modify Default Relays

Edit relay configuration in quartz/src/main/java/com/vitorpamplona/quartz/nip01Core/relay/ or the UI settings files.

Troubleshooting

google-services.json error

Disable the Google Services plugin (see step 4).

Java version error

sdk use java 21.0.5-tem
java -version  # Must show 21.x

Out of memory

Edit gradle.properties:

org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m

Clean build

./gradlew --stop
./gradlew clean
./gradlew assembleFdroidRelease

Distribution

Deploy APKs via:

  • Surge.sh: surge ./releases your-app.surge.sh
  • Zapstore: Submit to zapstore.dev
  • Direct download: Host on any web server

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

compose-expert

No summary provided by upstream source.

Repository SourceNeeds Review
General

Interior Fullplan

# 室内设计·全案方案自动生成器

Archived SourceRecently Updated
General

kb-archiver

智能本地知识库归档系统 v1.1.0。支持 AI 智能分类、批量归档、全文搜索、统计报告。 自动将文件分类归档到本地知识库,提取全文索引支持秒级搜索。 小文件存本地、大文件可对接云存储。支持 Excel/Word/PPT/PDF/TXT 等格式。 当用户需要:归档文件、建立知识库、全文检索文档内容、管理大量工作文档、批量处理文件夹时使用。 关键词:知识库、归档、文件管理、全文搜索、文档索引、批量归档、AI分类

Archived SourceRecently Updated
General

honest-agent

强制诚实系统:防止AI撒谎、虚构、言行不一。核心功能:(1) 承诺自动追踪(写入honest-commitments.json)(2) 回复前诚实校验拦截 (3) 媒体并行识别(大模型+OCR择优)(4) 诚实审计日志 (5) 安全独立存储。触发词:诚实、撒谎、虚构、承诺、图片识别、媒体处理、我承诺、我会帮你。

Archived SourceRecently Updated