amethyst/README.md

292 wiersze
12 KiB
Markdown

2024-02-17 16:05:40 +00:00
<div align="center">
2024-02-17 16:09:40 +00:00
<a href="https://amethyst.social">
<img src="./docs/design/3rd%20Logo%20-%20Zitron/amethyst.svg" alt="Amethyst Logo" title="Amethyst logo" width="80"/>
2024-02-17 16:05:40 +00:00
</a>
2023-01-11 20:06:02 +00:00
2024-02-17 16:05:40 +00:00
# Amethyst
2024-02-23 19:29:14 +00:00
## Nostr Client for Android
2024-02-17 16:05:40 +00:00
2024-02-17 16:15:19 +00:00
Join the social network you control.
2023-01-11 20:06:02 +00:00
2024-02-17 17:39:48 +00:00
[![GitHub downloads](https://img.shields.io/github/downloads/vitorpamplona/amethyst/total?label=Downloads&labelColor=27303D&color=0D1117&logo=github&logoColor=FFFFFF&style=flat)](https://github.com/vitorpamplona/amethyst/releases)
2024-02-17 16:51:42 +00:00
[![PlayStore downloads](https://img.shields.io/endpoint?color=green&logo=google-play&logoColor=green&url=https%3A%2F%2Fplay.cuzi.workers.dev%2Fplay%3Fi%3Dcom.vitorpamplona.amethyst%26gl%3DUS%26hl%3Den%26l%3DPlayStore%26m%3D%24shortinstalls)](https://play.google.com/store/apps/details?id=com.vitorpamplona.amethyst)
2024-02-17 16:05:40 +00:00
2024-02-17 16:09:40 +00:00
[![Last Version](https://img.shields.io/github/release/vitorpamplona/amethyst.svg?maxAge=3600&label=Stable&labelColor=06599d&color=043b69)](https://github.com/vitorpamplona/amethyst)
2024-02-23 19:27:20 +00:00
[![JitPack version](https://jitpack.io/v/vitorpamplona/amethyst.svg)](https://jitpack.io/#vitorpamplona/amethyst)
2024-02-17 16:05:40 +00:00
[![CI](https://img.shields.io/github/actions/workflow/status/vitorpamplona/amethyst/build.yml?labelColor=27303D)](https://github.com/vitorpamplona/amethyst/actions/workflows/build.yml)
[![License: Apache-2.0](https://img.shields.io/github/license/vitorpamplona/amethyst?labelColor=27303D&color=0877d2)](/LICENSE)
2024-02-23 19:29:14 +00:00
## Download and Install
2023-01-11 20:06:02 +00:00
2023-06-29 13:25:35 +00:00
[<img src="./docs/design/obtainium.png"
alt="Get it on Obtaininum"
2024-02-17 16:29:18 +00:00
height="70">](https://github.com/ImranR98/Obtainium)
2023-06-29 13:25:35 +00:00
[<img src="https://github.com/machiav3lli/oandbackupx/raw/034b226cea5c1b30eb4f6a6f313e4dadcbb0ece4/badge_github.png" alt="Get it on GitHub"
2024-02-17 16:29:18 +00:00
height="70">](https://github.com/vitorpamplona/amethyst/releases)
2023-04-05 11:54:47 +00:00
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
alt="Get it on F-Droid"
2024-02-17 16:29:18 +00:00
height="70">](https://f-droid.org/packages/com.vitorpamplona.amethyst/)
2023-04-05 11:54:47 +00:00
[<img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png"
alt="Get it on Google Play"
2024-02-17 16:29:18 +00:00
height="70">](https://play.google.com/store/apps/details?id=com.vitorpamplona.amethyst)
2023-04-05 11:54:47 +00:00
2024-02-17 16:05:40 +00:00
</div>
2024-02-17 16:29:18 +00:00
## Supported Features
<img align="right" src="./docs/screenshots/home.png" data-canonical-src="./docs/screenshots/home.png" width="350px">
2023-01-11 20:06:02 +00:00
- [x] Events / Relay Subscriptions (NIP-01)
- [x] Follow List (NIP-02)
- [x] OpenTimestamps Attestations (NIP-03)
2023-01-16 21:42:46 +00:00
- [x] Private Messages (NIP-04)
- [x] DNS Address (NIP-05)
- [ ] Mnemonic seed phrase (NIP-06)
- [ ] WebBrowser Signer (NIP-07, Not applicable)
- [x] Old-style mentions (NIP-08)
- [x] Event Deletion (NIP-09)
2024-02-02 23:53:36 +00:00
- [x] Replies, mentions, Threads, and Notifications (NIP-10)
- [x] Relay Information Document (NIP-11)
- [x] Generic Tag Queries (NIP-12)
- [x] Proof of Work Display (NIP-13)
- [ ] Proof of Work Calculations (NIP-13)
- [x] Events with a Subject (NIP-14)
- [ ] Marketplace (NIP-15)
- [x] Event Treatment (NIP-16)
- [x] Image/Video/Url/LnInvoice Previews
- [x] Reposts, Quotes, Generic Reposts (NIP-18)
2023-02-28 16:01:24 +00:00
- [x] Bech Encoding support (NIP-19)
- [x] Command Results (NIP-20)
2023-02-28 16:01:24 +00:00
- [x] URI Support (NIP-21)
- [x] Long-form Content (NIP-23)
- [x] User Profile Fields / Relay list (NIP-24)
- [x] Reactions (NIP-25)
- [ ] Delegated Event Signing (NIP-26, Will not implement)
- [x] Text Note References (NIP-27)
- [x] Public Chats (NIP-28)
- [x] Custom Emoji (NIP-30)
- [x] Event kind summaries (NIP-31)
- [ ] Labeling (NIP-32)
- [x] Parameterized Replaceable Events (NIP-33)
- [x] Git Stuff (NIP-34/Draft)
- [x] Sensitive Content (NIP-36)
- [x] Note Edits (NIP-37/Draft)
- [x] User Status Event (NIP-38)
- [x] External Identities (NIP-39)
- [x] Expiration Support (NIP-40)
- [x] Relay Authentication (NIP-42)
- [ ] Event Counts (NIP-45, Will not implement)
- [ ] Nostr Connect (NIP-46)
- [x] Wallet Connect API (NIP-47)
- [ ] Proxy Tags (NIP-48, Not applicable)
- [x] Private key encryption for import/export (NIP-49)
2023-03-05 00:11:49 +00:00
- [x] Online Relay Search (NIP-50)
- [x] Lists (NIP-51)
- [ ] Calendar Events (NIP-52)
- [x] Live Activities & Live Chats (NIP-53)
- [x] Inline Metadata (NIP-55 - Draft)
- [x] Reporting (NIP-56)
- [x] Lightning Tips
- [x] Zaps (NIP-57)
- [x] Private Zaps
- [x] Zap Splits (NIP-57)
2024-01-29 16:19:56 +00:00
- [x] Gift Wraps & Seals (NIP-59)
- [x] Zapraiser (NIP-TBD)
- [x] Badges (NIP-58)
- [ ] Relay List Metadata (NIP-65)
2023-04-25 22:26:18 +00:00
- [x] Polls (NIP-69)
- [x] Moderated Communities (NIP-72)
- [ ] Zap Goals (NIP-75)
- [ ] Arbitrary Custom App Data (NIP-78)
- [x] Highlights (NIP-84)
- [x] Recommended Application Handlers (NIP-89)
- [ ] Data Vending Machine (NIP-90)
2024-02-02 00:20:26 +00:00
- [x] Inline Metadata (NIP-92)
- [x] Verifiable file URLs (NIP-94)
- [x] Binary Blobs (NIP-95)
- [x] HTTP File Storage Integration (NIP-96 Draft)
- [x] HTTP Auth (NIP-98)
- [x] Classifieds (NIP-99)
- [x] Private Messages and Small Groups (NIP-24/Draft)
- [x] Versioned Encrypted Payloads (NIP-44/Draft)
- [x] Audio Tracks (zapstr.live) (kind:31337)
- [x] Push Notifications (Google and Unified Push)
- [x] In-Device Automatic Translations
- [x] Hashtag Following and Custom Hashtags
2023-04-25 22:26:18 +00:00
- [x] Login with QR
- [x] Bounty support (nostrbounties.com)
- [x] De-googled F-Droid flavor
- [x] Multiple Accounts
- [x] Markdown Support
- [x] FHIR Payloads (kind:82)
- [ ] Decentralized Wiki (kind:30818)
- [ ] Embed events
2023-05-02 12:20:45 +00:00
- [ ] Image/Video Capture in the app
- [ ] Local Database
2023-02-28 16:01:24 +00:00
- [ ] Workspaces
- [ ] Infinity Scroll
2023-01-11 20:06:02 +00:00
2024-02-17 16:29:18 +00:00
## Privacy and Information Permanence
2024-02-17 16:05:40 +00:00
Relays know your IP address, 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) except for Private Zaps and Private DMs. 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.
If you want to improve your privacy, consider utilizing a service that masks your IP address (e.g. a VPN or Tor) from trackers online.
The relay also learns which public keys you are requesting, meaning your public key will be tied to your IP address.
Information shared on Nostr can be re-broadcasted to other servers and should be assumed permanent for privacy purposes. There is no way to guarantee the deletion of any content once posted.
2023-01-11 20:06:02 +00:00
# Development Overview
This repository is split between Amethyst and Quartz:
2024-02-17 16:05:40 +00:00
- Amethyst is a native Android app made with Kotlin and Jetpack Compose.
- Quartz is our own Nostr-commons library to host classes that are of interest to other Nostr Clients.
2024-02-17 16:05:40 +00:00
The app 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.
2024-02-17 16:05:40 +00:00
The repository layer stores Nostr Events as Notes and Users separately. Those classes use LiveData and Flow objects to
2024-02-02 23:53:36 +00:00
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. As the user scrolls through Events, the Datasource classes
2024-02-17 16:05:40 +00:00
are updated 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.
2024-02-02 23:53:36 +00:00
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.
2024-02-17 16:05:40 +00:00
Lastly, the user's account information (private key/pub key) is stored in the Android KeyStore for security.
2023-01-11 20:06:02 +00:00
## Setup
Make sure to have the following pre-requisites installed:
2024-02-17 16:05:40 +00:00
1. Java 17+
2023-01-11 20:06:02 +00:00
2. Android Studio
3. Android 8.0+ Phone or Emulation setup
2024-02-02 23:53:36 +00:00
Fork and clone this repository and import it into Android Studio
2023-01-11 20:06:02 +00:00
```bash
git clone https://github.com/vitorpamplona/amethyst.git
```
2024-02-17 16:05:40 +00:00
Use an Android Studio build action to install and run the app on your device or a simulator.
2023-01-11 20:06:02 +00:00
## Building
Build the app:
```bash
./gradlew assembleDebug
```
## Testing
```bash
./gradlew test
./gradlew connectedAndroidTest
```
2023-03-07 17:59:52 +00:00
## Linting
```bash
2024-01-06 15:44:05 +00:00
./gradlew spotlessCheck
./gradlew spotlessApply
2023-03-07 17:59:52 +00:00
```
2023-01-11 20:06:02 +00:00
## Installing on device
2023-04-04 23:24:02 +00:00
For the F-Droid build:
```bash
./gradlew installFdroidDebug
```
For the Play build:
2023-01-11 20:06:02 +00:00
```bash
2023-04-04 23:24:02 +00:00
./gradlew installPlayDebug
2023-01-11 20:06:02 +00:00
```
2024-02-17 16:05:40 +00:00
## Deploying
2023-01-11 20:06:02 +00:00
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
```
2. Create four Secret Key variables on your GitHub repository and fill in the signing key information
2023-01-11 20:06:02 +00:00
- `KEY_ALIAS` <- `<alias_name>`
- `KEY_PASSWORD` <- `<your password>`
- `KEY_STORE_PASSWORD` <- `<your key store password>`
- `SIGNING_KEY` <- the data from `<my-release-key.keystore>`
3. Change the `versionCode` and `versionName` on `app/build.gradle`
4. Commit and push.
5. Tag the commit with `v{x.x.x}`
6. Let the [Create Release GitHub Action](https://github.com/vitorpamplona/amethyst/actions/workflows/create-release.yml) build a new `aab` file.
7. Add your CHANGE LOG to the description of the new release
2024-02-02 23:53:36 +00:00
8. Download the `aab` file and upload it to the PlayStore.
2023-01-11 20:06:02 +00:00
2024-02-23 19:27:20 +00:00
## Using the Quartz library
Setup [JitPack.io](https://jitpack.io/#vitorpamplona/amethyst/v0.84.3) to your build file
Add `maven { url 'https://jitpack.io' }` to settings.gradle at the end of repositories:
```gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
```
Add the dependency
```gradle
implementation('com.github.vitorpamplona.amethyst:quartz:v0.85.1')
2024-02-23 19:27:20 +00:00
```
2024-02-17 16:05:40 +00:00
## Contributing
Issues can be logged on: [https://gitworkshop.dev/repo/amethyst](https://gitworkshop.dev/repo/amethyst)
[GitHub issues](https://github.com/vitorpamplona/amethyst/issues) and [pull requests](https://github.com/vitorpamplona/amethyst/pulls) here are also welcome. Translations can be provided via [Crowdin](https://crowdin.com/project/amethyst-social)
2024-02-17 16:05:40 +00:00
You can also send patches through Nostr using [GitStr](https://github.com/fiatjaf/gitstr) to [this nostr address](https://patch34.pages.dev/naddr1qqyxzmt9w358jum5qyg8v6t5daezumn0wd68yvfwvdhk6qg7waehxw309ahx7um5wgkhqatz9emk2mrvdaexgetj9ehx2ap0qy2hwumn8ghj7un9d3shjtnwdaehgu3wvfnj7q3qgcxzte5zlkncx26j68ez60fzkvtkm9e0vrwdcvsjakxf9mu9qewqxpqqqpmej720gac)
2024-02-17 16:05:40 +00:00
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.
2023-06-29 16:09:05 +00:00
# Screenshots
2023-12-12 23:09:18 +00:00
| FollowFeeds | ChatsGroup | LiveStreams | Notifications |
2023-06-29 16:15:03 +00:00
|-------------------------------------------|----------------------------------------------|-------------------------------------------------|--------------------------------------------------------|
| ![Home Feed](./docs/screenshots/home.png) | ![Messages](./docs/screenshots/messages.png) | ![Live Streams](./docs/screenshots/replies.png) | ![Notifications](./docs/screenshots/notifications.png) |
2023-06-29 16:09:05 +00:00
2024-02-17 16:16:45 +00:00
# Contributors
<a align="center" href="https://github.com/vitorpamplona/amethyst/graphs/contributors">
<img src="https://contrib.rocks/image?repo=vitorpamplona/amethyst" />
</a>
2023-01-11 20:06:02 +00:00
# MIT License
2024-02-17 16:05:40 +00:00
<pre>
2023-01-11 20:06:02 +00:00
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
2023-02-11 15:16:50 +00:00
SOFTWARE.
2024-02-17 16:05:40 +00:00
</pre>