Amethyst: Nostr client for Android
 
 
 
Go to file
Vitor Pamplona 9424147a08 v0.84.3 2024-02-16 16:00:00 -05:00
.github Uses new build tools to sign releases 2024-01-11 12:32:58 -05:00
.idea Updates to Android Studio Hedgehog | 2023.1.1 Patch 2 2024-01-31 16:05:00 -05:00
app v0.84.3 2024-02-16 16:00:00 -05:00
benchmark updates license notice year 2024-02-15 18:31:26 -05:00
commons updates license notice year 2024-02-15 18:31:26 -05:00
docs Migration to Niel Liesmons' icons 2023-07-17 11:48:29 -04:00
fastlane/metadata/android Updating Amethyst Logo to Zitron's 2023-06-29 12:00:20 -04:00
git-hooks Moves to spotless 2024-01-06 10:44:05 -05:00
gradle/wrapper Updates gradle 2023-12-02 14:11:19 -05:00
quartz Avoids the need to tag a cited user to count as a citation. 2024-02-16 15:49:42 -05:00
spotless updates license notice year 2024-02-15 18:31:26 -05:00
.editorconfig reduces some of the huge lines we have. 2024-01-06 11:59:35 -05:00
.gitignore New Signup screen 2024-01-09 16:23:17 -05:00
LICENSE Initial commit 2023-01-11 13:28:31 -05:00
PRIVACY.md Typo fix 2023-06-12 15:04:25 +00:00
README.md Adds copyright sentence. 2024-02-14 09:17:39 -05:00
amethyst.png Updating Amethyst Logo to Zitron's 2023-06-29 12:00:20 -04:00
build.gradle Updates Compose dependencies 2024-02-13 11:38:55 -05:00
crowdin.yml Adds indonesian to crowdin 2023-09-08 08:41:07 -04:00
gradle.properties Moving buildConfig to DSL 2023-12-14 10:45:14 -05:00
gradlew Base code for Amethyst 2023-01-11 13:31:20 -05:00
gradlew.bat Base code for Amethyst 2023-01-11 13:31:20 -05:00
settings.gradle Starting a new module for app benchmarks 2024-02-05 18:18:33 -05:00

README.md

Amethyst: Nostr client for Android

Amethyst brings the best social network to your Android phone. Just insert your Nostr private key and start posting.

Get it on Obtaininum Get it on GitHub Get it on F-Droid Get it on Google Play

Current Features

  • Events / Relay Subscriptions (NIP-01)
  • Follow List (NIP-02)
  • OpenTimestamps Attestations (NIP-03)
  • Private Messages (NIP-04)
  • DNS Address (NIP-05)
  • Mnemonic seed phrase (NIP-06)
  • WebBrowser Signer (NIP-07, Not applicable)
  • Old-style mentions (NIP-08)
  • Event Deletion (NIP-09)
  • Replies, mentions, Threads, and Notifications (NIP-10)
  • Relay Information Document (NIP-11)
  • Generic Tag Queries (NIP-12)
  • Proof of Work Display (NIP-13)
  • Proof of Work Calculations (NIP-13)
  • Events with a Subject (NIP-14)
  • Marketplace (NIP-15)
  • Event Treatment (NIP-16)
  • Image/Video/Url/LnInvoice Previews
  • Reposts, Quotes, Generic Reposts (NIP-18)
  • Bech Encoding support (NIP-19)
  • Command Results (NIP-20)
  • URI Support (NIP-21)
  • Long-form Content (NIP-23)
  • User Profile Fields / Relay list (NIP-24)
  • Reactions (NIP-25)
  • Delegated Event Signing (NIP-26, Will not implement)
  • Text Note References (NIP-27)
  • Public Chats (NIP-28)
  • Custom Emoji (NIP-30)
  • Event kind summaries (NIP-31)
  • Labeling (NIP-32)
  • Parameterized Replaceable Events (NIP-33)
  • Sensitive Content (NIP-36)
  • User Status Event (NIP-38)
  • External Identities (NIP-39)
  • Expiration Support (NIP-40)
  • Relay Authentication (NIP-42)
  • Event Counts (NIP-45, Will not implement)
  • Nostr Connect (NIP-46)
  • Wallet Connect API (NIP-47)
  • Proxy Tags (NIP-48, Not applicable)
  • Private key encryption for import/export (NIP-49)
  • Online Relay Search (NIP-50)
  • Lists (NIP-51)
  • Calendar Events (NIP-52)
  • Live Activities & Live Chats (NIP-53)
  • Inline Metadata (NIP-55 - Draft)
  • Reporting (NIP-56)
  • Lightning Tips
  • Zaps (NIP-57)
  • Private Zaps
  • Zap Splits (NIP-57)
  • Gift Wraps & Seals (NIP-59)
  • Zapraiser (NIP-TBD)
  • Badges (NIP-58)
  • Relay List Metadata (NIP-65)
  • Polls (NIP-69)
  • Moderated Communities (NIP-72)
  • Zap Goals (NIP-75)
  • Arbitrary Custom App Data (NIP-78)
  • Highlights (NIP-84)
  • Recommended Application Handlers (NIP-89)
  • Data Vending Machine (NIP-90)
  • Inline Metadata (NIP-92)
  • Verifiable file URLs (NIP-94)
  • Binary Blobs (NIP-95)
  • HTTP File Storage Integration (NIP-96 Draft)
  • HTTP Auth (NIP-98)
  • Classifieds (NIP-99)
  • Private Messages and Small Groups (NIP-24/Draft)
  • Versioned Encrypted Payloads (NIP-44/Draft)
  • Audio Tracks (zapstr.live) (Kind:31337)
  • Push Notifications (Google and Unified Push)
  • In-Device Automatic Translations
  • Hashtag Following and Custom Hashtags
  • Login with QR
  • Bounty support (nostrbounties.com)
  • De-googled F-Droid flavor
  • Multiple Accounts
  • Markdown Support
  • Image/Video Capture in the app
  • Local Database
  • Workspaces
  • Infinity Scroll

Development Overview

Overall Architecture

This is a native Android app made with Kotlin and Jetpack Compose. The app uses a modified version of the nostrpostrlib to talk to Nostr relays. The overall architecture consists of the UI, which uses the usual State/ViewModel/Composition, the service layer that connects with Nostr relays, and the model/repository layer, which keeps all Nostr objects in memory, in a full OO graph.

The repository layer stores Nostr Events as Notes and Users separately. Those classes use LiveData objects to allow the UI and other parts of the app to subscribe to each Note/User and receive updates when they happen. They are also responsible for updating viewModels when needed. Filters react to changes in the screen. As the user sees different Events, the Datasource classes are used to receive more information about those particular Events.

Most of the UI is reactive to changes in the repository classes. The service layer assembles Nostr filters for each need of the app, receives the data from the Relay, and sends it to the repository. Connection with relays is never closed during the use of the app. The UI receives a notification that objects have been updated. Instances of User and Notes are mutable directly. There will never be two Notes with the same ID or two User instances with the same pubkey.

Lastly, the user's account information (priv key/pub key) is stored in the Android KeyStore for security.

Setup

Make sure to have the following pre-requisites installed:

  1. Java 17
  2. Android Studio
  3. Android 8.0+ Phone or Emulation setup

Fork and clone this repository and import it into Android Studio

git clone https://github.com/vitorpamplona/amethyst.git

Use one of the Android Studio builds to install and run the app in your device or a simulator.

Building

Build the app:

./gradlew assembleDebug

Testing

./gradlew test
./gradlew connectedAndroidTest

Linting

./gradlew spotlessCheck
./gradlew spotlessApply

Installing on device

For the F-Droid build:

./gradlew installFdroidDebug

For the Play build:

./gradlew installPlayDebug

Contributing

Issues and pull requests here are also very welcome.

Translations can be provided via Crowdin

You can also send patches through Nostr using GitStr to this nostr address

By contributing to this repository, you agree to license your work under the MIT license. Any work contributed where you are not the original author must contain its license header with the original author(s) and source.

How to Deploy

  1. Generate a new signing key
keytool -genkey -v -keystore <my-release-key.keystore> -alias <alias_name> -keyalg RSA -keysize 2048 -validity 10000
openssl base64 < <my-release-key.keystore> | tr -d '\n' | tee some_signing_key.jks.base64.txt
  1. Create four Secret Key variables on your GitHub repository and fill in the signing key information
    • KEY_ALIAS <- <alias_name>
    • KEY_PASSWORD <- <your password>
    • KEY_STORE_PASSWORD <- <your key store password>
    • SIGNING_KEY <- the data from <my-release-key.keystore>
  2. Change the versionCode and versionName on app/build.gradle
  3. Commit and push.
  4. Tag the commit with v{x.x.x}
  5. Let the Create Release GitHub Action build a new aab file.
  6. Add your CHANGE LOG to the description of the new release
  7. Download the aab file and upload it to the PlayStore.

Privacy on Relays & nostr

Your internet protocol (IP) address is exposed to the relays you connect to. If you want to improve your privacy, consider utilizing a service that masks your IP address (e.g. a VPN) from trackers online.

The relay also learns which public keys you are requesting, meaning your public key will be tied to your IP address.

Relays have all your data in raw text. They know your IP, your name, your location (guessed from IP), your pub key, all your contacts, and other relays, and can read every action you do (post, like, boost, quote, report, etc) with the exception of Private Zaps and Private DMs.

DM Privacy

While the content of direct messages (DMs) is only visible to you and your DM counterparty, everyone can see when you and your counterparty DM each other.

Visibility & Permanence of Your Content on nostr

Information Visibility

Content that you share can be shared to other relays. Information that you share publicly is visible to anyone reading from relays that have your information. Your information may also be visible to nostr users who do not share relays with you.

Information Permanence

Information shared on nostr should be assumed permanent for privacy purposes. There is no way to guarantee edit or deletion of any content once posted.

Screenshots

FollowFeeds ChatsGroup LiveStreams Notifications
Home Feed Messages Live Streams Notifications

Contributors

MIT License

Copyright (c) 2023 Vitor Pamplona

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.