mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-07-22 07:48:27 +00:00
docs: fix license badge and refresh stale SKILL.md
The README license badge label read "Apache-2.0" while LICENSE, PRIVACY.md
and every source header are MIT. Only the static label text was wrong (the
shields.io endpoint auto-detects), but it is the license on the front page.
SKILL.md had drifted from the codebase since the Kotlin DSL migration:
- All Gradle references pointed at Groovy `build.gradle` / `settings.gradle`;
the repo is `.gradle.kts` throughout. Converted the snippets to Kotlin DSL
and matched the repo's existing `getByName("release")` style.
- The plugins block listed `jetbrainsKotlinAndroid` (gone) and omitted
`serialization` and `googleKsp`.
- compileSdk is 37, not 35. Added a pointer to libs.versions.toml so the
number has a source of truth rather than drifting again.
- The client-tag section told readers to create
`nip01Core/tags/clientTag/TagArrayBuilderExt.kt` and edit both `build()`
functions in TextNoteEvent. That file already exists at
`nip89AppHandlers/clientTag/`, and the tag is now applied centrally by the
NostrSignerWithClientTag decorator — so rebranding is a one-constant edit
to CLIENT_TAG_NAME.
- Default relays pointed at `quartz/src/main/java/...`, a path that does not
exist in the KMP layout; they live in commons `defaults/`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,7 @@ Join the social network you control.
|
|||||||
[](https://central.sonatype.com/artifact/com.vitorpamplona.quartz/quartz)
|
[](https://central.sonatype.com/artifact/com.vitorpamplona.quartz/quartz)
|
||||||
[](https://jitpack.io/#vitorpamplona/amethyst)
|
[](https://jitpack.io/#vitorpamplona/amethyst)
|
||||||
[](https://github.com/vitorpamplona/amethyst/actions/workflows/build.yml)
|
[](https://github.com/vitorpamplona/amethyst/actions/workflows/build.yml)
|
||||||
[](/LICENSE)
|
[](/LICENSE)
|
||||||
[](https://deepwiki.com/vitorpamplona/amethyst)
|
[](https://deepwiki.com/vitorpamplona/amethyst)
|
||||||
|
|
||||||
## Download and Install
|
## Download and Install
|
||||||
|
|||||||
86
SKILL.md
86
SKILL.md
@@ -24,7 +24,9 @@ Build customized Amethyst Nostr clients for Android. Fork, rebrand, customize, a
|
|||||||
|
|
||||||
2. **Android SDK**
|
2. **Android SDK**
|
||||||
- Command-line tools from https://developer.android.com/studio#command-line-tools-only
|
- Command-line tools from https://developer.android.com/studio#command-line-tools-only
|
||||||
- Required components: build-tools, platform-tools, platforms;android-35
|
- Required components: build-tools, platform-tools, platforms;android-37
|
||||||
|
- The exact SDK level is `android-compileSdk` in `gradle/libs.versions.toml` —
|
||||||
|
check there if this number has drifted.
|
||||||
|
|
||||||
3. **Git** for cloning the repository
|
3. **Git** for cloning the repository
|
||||||
|
|
||||||
@@ -66,48 +68,54 @@ keyPassword=your-password
|
|||||||
|
|
||||||
### 3. Configure Signing
|
### 3. Configure Signing
|
||||||
|
|
||||||
Add to `amethyst/build.gradle` inside the `android {}` block:
|
Add to `amethyst/build.gradle.kts` inside the `android {}` block:
|
||||||
|
|
||||||
```gradle
|
```kotlin
|
||||||
def keystorePropertiesFile = rootProject.file("keystore.properties")
|
val keystorePropertiesFile = rootProject.file("keystore.properties")
|
||||||
def keystoreProperties = new Properties()
|
val keystoreProperties = Properties()
|
||||||
if (keystorePropertiesFile.exists()) {
|
if (keystorePropertiesFile.exists()) {
|
||||||
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
keystorePropertiesFile.inputStream().use { keystoreProperties.load(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
create("release") {
|
||||||
if (keystorePropertiesFile.exists()) {
|
if (keystorePropertiesFile.exists()) {
|
||||||
storeFile rootProject.file(keystoreProperties['storeFile'])
|
storeFile = rootProject.file(keystoreProperties["storeFile"] as String)
|
||||||
storePassword keystoreProperties['storePassword']
|
storePassword = keystoreProperties["storePassword"] as String
|
||||||
keyAlias keystoreProperties['keyAlias']
|
keyAlias = keystoreProperties["keyAlias"] as String
|
||||||
keyPassword keystoreProperties['keyPassword']
|
keyPassword = keystoreProperties["keyPassword"] as String
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This needs `import java.util.Properties` at the top of the file.
|
||||||
|
|
||||||
Update the release buildType to use the signing config:
|
Update the release buildType to use the signing config:
|
||||||
```gradle
|
```kotlin
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
getByName("release") {
|
||||||
signingConfig signingConfigs.release
|
signingConfig = signingConfigs.getByName("release")
|
||||||
// ... existing config
|
// ... existing config
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Verify with `./gradlew :amethyst:signingReport` — the release variants should
|
||||||
|
report your keystore rather than `~/.android/debug.keystore`.
|
||||||
|
|
||||||
### 4. Disable Google Services (Required for F-Droid)
|
### 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.
|
**⚠️ 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:
|
Edit `amethyst/build.gradle.kts`, comment out the plugin:
|
||||||
```gradle
|
```kotlin
|
||||||
plugins {
|
plugins {
|
||||||
alias(libs.plugins.androidApplication)
|
alias(libs.plugins.androidApplication)
|
||||||
alias(libs.plugins.jetbrainsKotlinAndroid)
|
|
||||||
// alias(libs.plugins.googleServices) // DISABLED for F-Droid
|
// alias(libs.plugins.googleServices) // DISABLED for F-Droid
|
||||||
alias(libs.plugins.jetbrainsComposeCompiler)
|
alias(libs.plugins.jetbrainsComposeCompiler)
|
||||||
|
alias(libs.plugins.serialization)
|
||||||
|
alias(libs.plugins.googleKsp)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -141,8 +149,8 @@ Edit `amethyst/src/main/res/values/strings.xml`:
|
|||||||
|
|
||||||
### Change Package ID
|
### Change Package ID
|
||||||
|
|
||||||
Edit `amethyst/build.gradle`:
|
Edit `amethyst/build.gradle.kts`:
|
||||||
```gradle
|
```kotlin
|
||||||
android {
|
android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "com.yourcompany.yourapp"
|
applicationId = "com.yourcompany.yourapp"
|
||||||
@@ -152,8 +160,8 @@ android {
|
|||||||
|
|
||||||
### Change Project Name
|
### Change Project Name
|
||||||
|
|
||||||
Edit `settings.gradle`:
|
Edit `settings.gradle.kts`:
|
||||||
```gradle
|
```kotlin
|
||||||
rootProject.name = "YourAppName"
|
rootProject.name = "YourAppName"
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -167,36 +175,28 @@ Replace icon files in:
|
|||||||
|
|
||||||
Make your app identify itself on posts with `["client", "YourAppName"]`.
|
Make your app identify itself on posts with `["client", "YourAppName"]`.
|
||||||
|
|
||||||
**1. Create tag builder extension:**
|
You do **not** need to add the tag per event type. The client tag is applied
|
||||||
|
centrally by `NostrSignerWithClientTag`, a signer decorator that appends the tag
|
||||||
|
to everything it signs (and respects the user's "add client tag" privacy
|
||||||
|
setting). Changing the name is a one-constant edit:
|
||||||
|
|
||||||
Create `quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/tags/clientTag/TagArrayBuilderExt.kt`:
|
Edit `amethyst/src/main/java/com/vitorpamplona/amethyst/model/accountsCache/AccountCacheState.kt`:
|
||||||
```kotlin
|
```kotlin
|
||||||
package com.vitorpamplona.quartz.nip01Core.tags.clientTag
|
const val CLIENT_TAG_NAME = "YourAppName"
|
||||||
|
|
||||||
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:**
|
That constant is passed to `NostrSignerWithClientTag` when the account's signer
|
||||||
|
is built, so every signed event carries your name.
|
||||||
|
|
||||||
Edit `quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip10Notes/TextNoteEvent.kt`:
|
The tag itself lives in
|
||||||
|
`quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip89AppHandlers/clientTag/`
|
||||||
Add import:
|
(`ClientTag`, `TagArrayBuilderExt`, `NostrSignerWithClientTag`) — you only need to
|
||||||
```kotlin
|
touch it if you want the optional NIP-89 handler address / relay hint variants.
|
||||||
import com.vitorpamplona.quartz.nip01Core.tags.clientTag.client
|
|
||||||
```
|
|
||||||
|
|
||||||
In both `build()` functions, add after `alt(...)`:
|
|
||||||
```kotlin
|
|
||||||
client("YourAppName")
|
|
||||||
```
|
|
||||||
|
|
||||||
### Modify Default Relays
|
### Modify Default Relays
|
||||||
|
|
||||||
Edit relay configuration in `quartz/src/main/java/com/vitorpamplona/quartz/nip01Core/relay/` or the UI settings files.
|
Edit `commons/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/defaults/Constants.kt`
|
||||||
|
(see also `AmethystDefaults.kt` and `DefaultDmIndexerRelays.kt` in the same folder).
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user