Compare commits

..

No commits in common. "main" and "v0.2.9" have entirely different histories.
main ... v0.2.9

340 changed files with 7645 additions and 65788 deletions

View file

@ -31,5 +31,5 @@ jobs:
- name: flutter analyze
run: flutter analyze
# - name: flutter test
# run: flutter test
- name: flutter test
run: flutter test

68
.github/workflows/release_github.yml vendored Normal file
View file

@ -0,0 +1,68 @@
name: Publish on Github
on:
workflow_dispatch: {}
push:
branches:
- main
paths:
- pubspec.yaml
jobs:
build_and_publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install requirements
run: sudo apt-get install protobuf-compiler
- name: Cloning sub-repos
run: git submodule update --init --recursive
# - name: Check flutter code
# run: |
# flutter pub get
# flutter analyze
# flutter test
- name: Check flutter code
run: flutter pub get
- name: Create key.properties file
run: |
echo "storePassword=${{ secrets.STORE_PASSWORD }}" >> ./android/key.properties
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> ./android/key.properties
echo "keyAlias=github-releases-signature" >> ./android/key.properties
echo "storeFile=./keystore.jks" >> ./android/key.properties
- name: Create keystore file
env:
KEYSTORE_FILE: ${{ secrets.KEYSTORE_FILE }}
run: echo $KEYSTORE_FILE | base64 --decode > ./android/app/keystore.jks
- name: Build Android APK
run: flutter build apk --release --split-per-abi
- name: Extract pubspec version
run: |
echo "PUBSPEC_VERSION=$(grep -oP 'version:\s*\K[^+]+(?=\+)' pubspec.yaml)" >> $GITHUB_ENV
- name: Upload Release Binaries (stable)
uses: ncipollo/release-action@v1.18.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ env.PUBSPEC_VERSION }}
allowUpdates: true
artifacts: build/app/outputs/flutter-apk/*.apk

9
.gitignore vendored
View file

@ -10,14 +10,8 @@
.history
.svn/
.swiftpm/
*.sqlite
*.sqlite-shm
*.sqlite-wal
migrate_working_dir/
fastlane/report.xml
fastlane/README.md
# IntelliJ related
*.iml
*.ipr
@ -54,5 +48,4 @@ app.*.map.json
android/.kotlin/
devtools_options.yaml
rust/target
rust_dependencies/target
fastlane/repo/status/running.json
rust_dependencies/target

View file

@ -1,67 +1,5 @@
# Changelog
## 0.2.26
- New: Import images from the gallery
- Improved: Media files are now stored in the dedicated "twonly" album
- Improved: UI components adapt to native styling (iOS/Android)
- Fix: Migration issue that resulted in a corrupted backup mechanism
- Fix: Database issues causing messages to be lost or the database to be corrupted
- Fix: Permission view did not disappear after they were granted
## 0.2.23
- Improved: Smaller UI changes
- Fix: Some messages were not marked as opened.
## 0.2.20
- New: Adds an "Ask a Friend" button to new contact suggestions.
- New: Adds security profiles.
- Improved: Onboarding flow for new users.
- Improved: Flame restore experience.
- Improved: The blue verification checkmark now displays the total number of verifications.
- Fix: Issue with receiving messages when user closed app while decrypting
- Fix: Background message fetching reliability.
- Fix: Issue with focus changing when taking a picture
- Fix: Issues with the camera initialization
## 0.2.16
- Fix: Images not shown after opening due to cleanup
## 0.2.15
- Fix: Issue with opening directly in chats
- Fix: Multiple smaller issues
## 0.2.13
- New: Tutorial on how to use zoom.
- New: Manage storage view.
- Improved: Media thumbnails for faster loading.
- Fix: Some messages were not marked as opened.
## 0.2.12
- New: Automatically mark identical media as opened across all chats (Settings > Chats).
- Improved: Memories viewer redesigned with smoother animations and new quick-action controls.
- Fix: Reliability of receiving media files.
## 0.2.11
- New: Create custom shortcuts to quickly share images with pre-selected groups
- New: Seamless recovery for iOS reinstallations
- Improved: Redesigned snackbar notifications
- Improved: New backup mechanism to allow larger backup files
- Improved: Move keys into a centralized Rust-owned structure stored in secure storage
- Fix: Messages occasionally not received until app restart
- Fix: Multiple smaller issues
## 0.2.10
- Fix: Issue with push notifications on Android
## 0.2.9
- Improved: Make contact avatars clickable

View file

@ -1,16 +1,10 @@
# twonly
<a href="https://twonly.eu" rel="some text"><img src="metadata/en-US/images/featureGraphic.png" alt="twonly, a privacy-friendly way to connect with friends through secure, spontaneous image sharing." /></a>
<a href="https://twonly.eu" rel="some text"><img src="docs/header.webp" alt="twonly, a privacy-friendly way to connect with friends through secure, spontaneous image sharing." /></a>
This repository contains the complete source code of the [twonly](https://twonly.eu) app. twonly is a replacement for Snapchat, but its purpose is not to replace instant messaging apps, as there are already [many fantastic alternatives](https://www.messenger-matrix.de/messenger-matrix-en.html) out there. It was started because I liked the basic features of Snapchat, such as opening with the camera, the easy-to-use image editor, and the focus on sending fun pictures to friends. But I was annoyed by Snapchat's forced AI chat, receiving random messages to follow strangers, and not knowing how my sent images/text messages were encrypted, if at all. I am also very critical of the direction in which the US is currently moving and therefore try to avoid US providers wherever possible.
<p align="center">
<img src="metadata/en-US/images/phoneScreenshots/01_share_moments.png" width="30%" alt="Share moments" />
<img src="metadata/en-US/images/phoneScreenshots/02_chat_list.png" width="30%" alt="Chat list" />
<img src="metadata/en-US/images/phoneScreenshots/03_groups.png" width="30%" alt="Groups" />
</p>
<div align="center" style="margin: 10px 20px 10px 20px">
<div style="margin: 10px 20px 10px 20px">
<a href="https://apps.apple.com/de/app/twonly/id6743774441">
<img alt="Get it on App Store button" src="https://twonly.eu/assets/buttons/download-on-the-app-store.svg"
width="100px" />

2
android/.gitignore vendored
View file

@ -9,7 +9,5 @@ GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore.
# See https://flutter.dev/to/reference-keystore
key.properties
key.github.properties
key.properties.backup
**/*.keystore
**/*.jks

View file

@ -73,5 +73,4 @@ flutter {
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4'
implementation 'com.otaliastudios:transcoder:0.11.0'
implementation 'androidx.core:core-splashscreen:1.0.1'
}

View file

@ -6,38 +6,8 @@ import dev.darttools.flutter_android_volume_keydown.FlutterAndroidVolumeKeydownP
import android.view.KeyEvent.KEYCODE_VOLUME_DOWN
import android.view.KeyEvent.KEYCODE_VOLUME_UP
import io.flutter.embedding.engine.FlutterEngine
import android.content.Context
import io.crates.keyring.Keyring
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import android.os.Bundle
import android.net.Uri
import java.io.InputStream
import androidx.activity.result.contract.ActivityResultContracts
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.PickVisualMediaRequest
import io.flutter.plugin.common.MethodChannel
class MainActivity : FlutterFragmentActivity() {
private val CHANNEL = "eu.twonly/photo_picker"
private var pendingResult: MethodChannel.Result? = null
private lateinit var pickMultipleMedia: ActivityResultLauncher<PickVisualMediaRequest>
override fun onCreate(savedInstanceState: Bundle?) {
installSplashScreen()
pickMultipleMedia = registerForActivityResult(ActivityResultContracts.PickMultipleVisualMedia()) { uris ->
if (uris.isNotEmpty()) {
val uriStrings = uris.map { it.toString() }
pendingResult?.success(uriStrings)
} else {
pendingResult?.success(emptyList<String>())
}
pendingResult = null
}
super.onCreate(savedInstanceState)
}
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
if (keyCode == KEYCODE_VOLUME_DOWN && eventSink != null) {
@ -54,38 +24,7 @@ class MainActivity : FlutterFragmentActivity() {
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
Keyring.initializeNdkContext(applicationContext)
MediaStoreChannel.configure(flutterEngine, applicationContext)
VideoCompressionChannel.configure(flutterEngine, applicationContext)
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler { call, result ->
when (call.method) {
"pickImages" -> {
pendingResult = result
pickMultipleMedia.launch(PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageOnly))
}
"getUriBytes" -> {
val uriString = call.argument<String>("uri")
if (uriString != null) {
try {
val uri = Uri.parse(uriString)
val inputStream: InputStream? = contentResolver.openInputStream(uri)
if (inputStream != null) {
val bytes = inputStream.readBytes()
inputStream.close()
result.success(bytes)
} else {
result.error("UNAVAILABLE", "Could not open InputStream", null)
}
} catch (e: Exception) {
result.error("ERROR", e.message, null)
}
} else {
result.error("INVALID_ARGUMENT", "URI string is null", null)
}
}
else -> result.notImplemented()
}
}
}
}

View file

@ -0,0 +1,92 @@
package eu.twonly
import android.content.ContentValues
import android.content.Context
import android.os.Build
import android.os.Environment
import android.provider.MediaStore
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel
import java.io.File
import java.io.FileInputStream
import java.io.InputStream
import java.io.OutputStream
object MediaStoreChannel {
private const val CHANNEL = "eu.twonly/mediaStore"
fun configure(flutterEngine: FlutterEngine, context: Context) {
val channel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL)
channel.setMethodCallHandler { call, result ->
try {
if (call.method == "safeFileToDownload") {
val arguments = call.arguments<Map<String, String>>() as Map<String, String>
val sourceFile = arguments["sourceFile"]
if (sourceFile == null) {
result.success(false)
} else {
val inputStream = FileInputStream(File(sourceFile))
val outputName = File(sourceFile).name.takeIf { it.isNotEmpty() } ?: "memories.zip"
val savedUri = saveZipToDownloads(context, outputName, inputStream)
if (savedUri != null) {
result.success(savedUri.toString())
} else {
result.error("SAVE_FAILED", "Could not save ZIP", null)
}
}
} else {
result.notImplemented()
}
} catch (e: Exception) {
result.error("EXCEPTION", e.message, null)
}
}
}
private fun saveZipToDownloads(
context: Context,
fileName: String = "archive.zip",
sourceStream: InputStream
): android.net.Uri? {
val resolver = context.contentResolver
val contentValues = ContentValues().apply {
put(MediaStore.MediaColumns.DISPLAY_NAME, fileName)
put(MediaStore.MediaColumns.MIME_TYPE, "application/zip")
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
put(MediaStore.MediaColumns.RELATIVE_PATH, Environment.DIRECTORY_DOWNLOADS)
put(MediaStore.MediaColumns.IS_PENDING, 1)
}
}
val collection = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
MediaStore.Downloads.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY)
} else {
MediaStore.Files.getContentUri("external")
}
val uri = resolver.insert(collection, contentValues) ?: return null
try {
resolver.openOutputStream(uri).use { out: OutputStream? ->
requireNotNull(out) { "Unable to open output stream" }
sourceStream.use { input ->
input.copyTo(out)
}
out.flush()
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
val done = ContentValues().apply { put(MediaStore.MediaColumns.IS_PENDING, 0) }
resolver.update(uri, done, null, null)
}
return uri
} catch (e: Exception) {
try { resolver.delete(uri, null, null) } catch (_: Exception) {}
return null
}
}
}

View file

@ -3,12 +3,10 @@ package eu.twonly
import io.flutter.app.FlutterApplication
import dev.fluttercommunity.workmanager.WorkmanagerDebug
import dev.fluttercommunity.workmanager.LoggingDebugHandler
import io.crates.keyring.Keyring
class MyApplication : FlutterApplication() {
override fun onCreate() {
super.onCreate()
Keyring.initializeNdkContext(this)
// This enables the internal plugin logging to Logcat
WorkmanagerDebug.setCurrent(LoggingDebugHandler())
}

View file

@ -1,14 +0,0 @@
package io.crates.keyring
import android.content.Context
class Keyring {
companion object {
init {
// Replace with the name of your compiled Rust library
System.loadLibrary("rust_lib_twonly")
}
// The underlying Rust crate provides the implementation for this
external fun initializeNdkContext(context: Context)
}
}

View file

@ -1,69 +0,0 @@
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt">
<aapt:attr name="android:drawable">
<vector
android:width="100dp"
android:height="100dp"
android:viewportWidth="640"
android:viewportHeight="640">
<!-- Wrap everything in a scaling group to add padding and prevent splash screen circular cropping -->
<group
android:pivotX="320"
android:pivotY="320"
android:scaleX="0.6"
android:scaleY="0.6">
<!-- Link One pivots around its visual center (approx X=416, Y=288) -->
<group
android:name="link_one_group"
android:pivotX="416"
android:pivotY="288">
<path
android:name="link_one_path"
android:fillColor="#fff"
android:pathData="M451.5 160C434.9 160 418.8 164.5 404.7 172.7C388.9 156.7 370.5 143.3 350.2 133.2C378.4 109.2 414.3 96 451.5 96C537.9 96 608 166 608 252.5C608 294 591.5 333.8 562.2 363.1L491.1 434.2C461.8 463.5 422 480 380.5 480C294.1 480 224 410 224 323.5C224 322 224 320.5 224.1 319C224.6 301.3 239.3 287.4 257 287.9C274.7 288.4 288.6 303.1 288.1 320.8C288.1 321.7 288.1 322.6 288.1 323.4C288.1 374.5 329.5 415.9 380.6 415.9C405.1 415.9 428.6 406.2 446 388.8L517.1 317.7C534.4 300.4 544.2 276.8 544.2 252.3C544.2 201.2 502.8 159.8 451.7 159.8z" />
</group>
<!-- Link Two pivots around its visual center (approx X=224, Y=352) -->
<group
android:name="link_two_group"
android:pivotX="224"
android:pivotY="352">
<path
android:name="link_two_path"
android:fillColor="#ffffff"
android:pathData="M307.2 237.3C305.3 236.5 303.4 235.4 301.7 234.2C289.1 227.7 274.7 224 259.6 224C235.1 224 211.6 233.7 194.2 251.1L123.1 322.2C105.8 339.5 96 363.1 96 387.6C96 438.7 137.4 480.1 188.5 480.1C205 480.1 221.1 475.7 235.2 467.5C251 483.5 269.4 496.9 289.8 507C261.6 530.9 225.8 544.2 188.5 544.2C102.1 544.2 32 474.2 32 387.7C32 346.2 48.5 306.4 77.8 277.1L148.9 206C178.2 176.7 218 160.2 259.5 160.2C346.1 160.2 416 230.8 416 317.1C416 318.4 416 319.7 416 321C415.6 338.7 400.9 352.6 383.2 352.2C365.5 351.8 351.6 337.1 352 319.4C352 318.6 352 317.9 352 317.1C352 283.4 334 253.8 307.2 237.5z" />
</group>
</group>
</vector>
</aapt:attr>
<!-- Rotate Link One smoothly back and forth -->
<target android:name="link_one_group">
<aapt:attr name="android:animation">
<objectAnimator
android:duration="800"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:propertyName="rotation"
android:repeatCount="-1"
android:repeatMode="reverse"
android:valueFrom="-3"
android:valueTo="3" />
</aapt:attr>
</target>
<!-- Rotate Link Two smoothly in the opposite direction to create the opening/closing effect -->
<target android:name="link_two_group">
<aapt:attr name="android:animation">
<objectAnimator
android:duration="800"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:propertyName="rotation"
android:repeatCount="-1"
android:repeatMode="reverse"
android:valueFrom="3"
android:valueTo="-3" />
</aapt:attr>
</target>
</animated-vector>

View file

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="Theme.SplashScreen">
<!-- Configure the Androidx Splash Screen API parameters -->
<item name="windowSplashScreenBackground">#FF57CC99</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/link_animated</item>
<item name="windowSplashScreenAnimationDuration">800</item>
<item name="postSplashScreenTheme">@style/NormalTheme</item>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your

View file

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="Theme.SplashScreen">
<!-- Configure the Androidx Splash Screen API parameters -->
<item name="windowSplashScreenBackground">#FF57CC99</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/link_animated</item>
<item name="windowSplashScreenAnimationDuration">800</item>
<item name="postSplashScreenTheme">@style/NormalTheme</item>
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<!-- Set the background color to the primary color so the white logo is visible -->
<item name="android:colorBackground">#FF57CC99</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your

View file

@ -1,8 +0,0 @@
# Example signing credentials configuration for GitHub Releases.
# Copy this file to 'key.github.properties' and fill in your actual credentials.
# Do not commit the actual 'key.github.properties' file to version control.
storePassword=YOUR_GITHUB_RELEASE_STORE_PASSWORD
keyPassword=YOUR_GITHUB_RELEASE_KEY_PASSWORD
keyAlias=github-releases-signature
storeFile=/absolute/path/to/your/github-release-keystore.jks

File diff suppressed because one or more lines are too long

Binary file not shown.

View file

@ -1,3 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#57CC99" class="bi bi-patch-check-fill" viewBox="0 0 16 16">
<path d="M10.067.87a2.89 2.89 0 0 0-4.134 0l-.622.638-.89-.011a2.89 2.89 0 0 0-2.924 2.924l.01.89-.636.622a2.89 2.89 0 0 0 0 4.134l.637.622-.011.89a2.89 2.89 0 0 0 2.924 2.924l.89-.01.622.636a2.89 2.89 0 0 0 4.134 0l.622-.637.89.011a2.89 2.89 0 0 0 2.924-2.924l-.01-.89.636-.622a2.89 2.89 0 0 0 0-4.134l-.637-.622.011-.89a2.89 2.89 0 0 0-2.924-2.924l-.89.01zM8.107 4.000L9.339 4.000L9.339 12.000L7.832 12.000L7.832 6.246L7.817 6.232L7.339 6.638L6.948 6.899L6.455 7.159L5.861 7.391L5.861 6.014L6.165 5.899L6.499 5.725L6.861 5.493L7.296 5.159L7.643 4.812L7.832 4.565L8.049 4.174L8.107 4.000Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 732 B

View file

@ -1,3 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#57CC99" class="bi bi-patch-check-fill" viewBox="0 0 16 16">
<path d="M10.067.87a2.89 2.89 0 0 0-4.134 0l-.622.638-.89-.011a2.89 2.89 0 0 0-2.924 2.924l.01.89-.636.622a2.89 2.89 0 0 0 0 4.134l.637.622-.011.89a2.89 2.89 0 0 0 2.924 2.924l.89-.01.622.636a2.89 2.89 0 0 0 4.134 0l.622-.637.89.011a2.89 2.89 0 0 0 2.924-2.924l-.01-.89.636-.622a2.89 2.89 0 0 0 0-4.134l-.637-.622.011-.89a2.89 2.89 0 0 0-2.924-2.924l-.89.01zM7.899 4.000L8.391 4.000L8.768 4.043L9.029 4.101L9.362 4.217L9.623 4.348L9.942 4.580L10.145 4.783L10.304 4.986L10.406 5.145L10.551 5.464L10.652 5.899L10.667 6.406L10.594 6.884L10.478 7.246L10.290 7.638L10.043 8.029L9.812 8.333L9.507 8.667L8.406 9.696L7.928 10.174L7.754 10.391L7.638 10.580L10.667 10.594L10.667 12.000L5.333 12.000L5.391 11.609L5.522 11.159L5.710 10.725L6.000 10.246L6.232 9.942L6.638 9.478L7.464 8.652L8.072 8.087L8.594 7.551L8.870 7.203L9.029 6.899L9.087 6.739L9.145 6.449L9.145 6.174L9.101 5.928L8.986 5.667L8.768 5.435L8.652 5.362L8.522 5.304L8.246 5.246L7.971 5.246L7.783 5.275L7.652 5.319L7.406 5.464L7.232 5.652L7.101 5.913L7.029 6.203L7.000 6.493L5.493 6.348L5.565 5.870L5.725 5.362L5.957 4.942L6.275 4.594L6.638 4.348L6.942 4.203L7.377 4.072L7.899 4.000Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -1,3 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#57CC99" class="bi bi-patch-check-fill" viewBox="0 0 16 16">
<path d="M10.067.87a2.89 2.89 0 0 0-4.134 0l-.622.638-.89-.011a2.89 2.89 0 0 0-2.924 2.924l.01.89-.636.622a2.89 2.89 0 0 0 0 4.134l.637.622-.011.89a2.89 2.89 0 0 0 2.924 2.924l.89-.01.622.636a2.89 2.89 0 0 0 4.134 0l.622-.637.89.011a2.89 2.89 0 0 0 2.924-2.924l-.01-.89.636-.622a2.89 2.89 0 0 0 0-4.134l-.637-.622.011-.89a2.89 2.89 0 0 0-2.924-2.924l-.89.01zM7.730 4.000L8.142 4.000L8.555 4.057L8.854 4.142L9.224 4.313L9.523 4.527L9.794 4.797L10.064 5.196L10.206 5.580L10.249 5.851L10.235 6.263L10.149 6.591L10.007 6.875L9.836 7.103L9.566 7.359L9.125 7.644L9.409 7.730L9.708 7.872L9.950 8.043L10.164 8.256L10.335 8.498L10.477 8.797L10.548 9.039L10.591 9.338L10.577 9.836L10.448 10.377L10.249 10.776L10.093 11.004L9.893 11.231L9.523 11.544L9.125 11.772L8.911 11.858L8.598 11.943L8.171 12.000L7.587 11.986L7.146 11.900L6.733 11.744L6.320 11.488L5.950 11.132L5.680 10.733L5.509 10.320L5.409 9.865L5.409 9.808L6.847 9.637L6.861 9.765L6.947 10.064L7.004 10.192L7.160 10.420L7.416 10.633L7.630 10.733L7.843 10.776L8.171 10.762L8.327 10.719L8.498 10.633L8.797 10.363L8.968 10.064L9.039 9.822L9.068 9.609L9.053 9.167L8.954 8.826L8.769 8.541L8.512 8.327L8.214 8.214L7.872 8.199L7.331 8.299L7.488 7.132L7.929 7.089L8.256 6.975L8.384 6.890L8.569 6.705L8.683 6.505L8.754 6.221L8.754 5.979L8.698 5.737L8.598 5.552L8.427 5.381L8.242 5.281L8.000 5.224L7.772 5.224L7.445 5.324L7.317 5.409L7.132 5.594L7.032 5.751L6.947 5.964L6.890 6.278L5.523 6.036L5.623 5.623L5.794 5.181L5.950 4.911L6.235 4.584L6.591 4.327L6.961 4.157L7.302 4.057L7.730 4.000Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

@ -1 +1 @@
Subproject commit 72d9bd6320bca1f1d29c6e61c3821fed326c0abe
Subproject commit e0c6a9617a20a8d6bc1ad4c6b9c2e229feb5f37a

BIN
docs/header.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

View file

@ -1,2 +0,0 @@
json_key_file(ENV["GOOGLE_PLAY_JSON_KEY_PATH"] || "../../local_data/accesskeys/upload_track_releases_google_play.json")
package_name("eu.twonly") # Your application ID

View file

@ -1,144 +0,0 @@
default_platform(:android)
platform :android do
desc "Submit a new App Bundle to the Google Play Internal Track"
lane :internal do
# This lane assumes that `flutter build appbundle` has already been run from the flutter root.
upload_to_play_store(
track: 'internal',
aab: 'build/app/outputs/bundle/release/app-release.aab',
skip_upload_metadata: true,
skip_upload_images: true,
skip_upload_screenshots: true
)
end
desc "Build the application locally and upload it as a new GitHub release"
lane :release_github do
# Read pubspec.yaml to get the version
pubspec_path = File.expand_path("../pubspec.yaml", __dir__)
unless File.exist?(pubspec_path)
UI.user_error!("Could not find pubspec.yaml at #{pubspec_path}")
end
pubspec_content = File.read(pubspec_path)
version_match = pubspec_content.match(/^version:\s*([^+]+)/)
unless version_match
UI.user_error!("Could not extract version from pubspec.yaml")
end
version = version_match[1].strip
tag_name = "v#{version}"
UI.message("Extracted version: #{version} (tag: #{tag_name})")
# Load release notes from CHANGELOG.md
changelog_path = File.expand_path("../CHANGELOG.md", __dir__)
release_notes = "Automated local release via Fastlane"
if File.exist?(changelog_path)
changelog_content = File.read(changelog_path)
escaped_version = Regexp.escape(version)
pattern = /##\s*\[?#{escaped_version}\]?(.*?)(?=##\s*|\z)/m
match = changelog_content.match(pattern)
if match
release_notes = match[1].strip
UI.message("Loaded release notes from CHANGELOG.md:\n#{release_notes}")
else
UI.important("Could not find release notes for version #{version} in CHANGELOG.md. Using default description.")
end
else
UI.important("CHANGELOG.md not found at #{changelog_path}. Using default description.")
end
# Handle key.properties swapping if key.github.properties exists
key_properties_path = File.expand_path("../android/key.properties", __dir__)
github_properties_path = File.expand_path("../android/key.github.properties", __dir__)
backup_properties_path = File.expand_path("../android/key.properties.backup", __dir__)
swapped_properties = false
if File.exist?(github_properties_path)
UI.message("Found key.github.properties. Swapping in for the build...")
if File.exist?(key_properties_path)
FileUtils.cp(key_properties_path, backup_properties_path)
end
FileUtils.cp(github_properties_path, key_properties_path)
swapped_properties = true
else
UI.message("No key.github.properties found. Building with default key.properties...")
end
begin
# Build the Android application
UI.message("Building Android APK...")
Dir.chdir(File.expand_path("..", __dir__)) do
sh("flutter build apk --release --split-per-abi")
end
ensure
# Restore original key.properties if swapped
if swapped_properties
UI.message("Restoring original key.properties...")
if File.exist?(backup_properties_path)
FileUtils.cp(backup_properties_path, key_properties_path)
FileUtils.rm(backup_properties_path)
else
FileUtils.rm_f(key_properties_path)
end
end
end
# Find built APKs
apk_glob = File.expand_path("../build/app/outputs/flutter-apk/*-release.apk", __dir__)
apks = Dir.glob(apk_glob)
if apks.empty?
UI.user_error!("No release APKs found matching #{apk_glob}")
end
UI.message("Found APKs to upload: #{apks.join(', ')}")
# Retrieve GitHub Token (fall back to gh auth token)
github_token = ENV["GITHUB_TOKEN"]
if github_token.nil? || github_token.empty?
UI.message("GITHUB_TOKEN env variable not set. Retrieving token via GitHub CLI (gh auth token)...")
begin
github_token = sh("gh auth token").strip
rescue => e
UI.user_error!("Failed to retrieve token from gh CLI. Make sure gh is installed and authenticated, or GITHUB_TOKEN environment variable is set. Error: #{e}")
end
end
UI.message("Creating GitHub Release #{tag_name}...")
set_github_release(
repository_name: "twonlyapp/twonly-app",
api_token: github_token,
tag_name: tag_name,
name: "Release #{tag_name}",
description: release_notes,
upload_assets: apks
)
UI.success("Successfully uploaded release #{tag_name} to GitHub!")
# F-Droid deployment
fdroid_repo_dir = "/Users/tobi/Documents/drive/twonly/F-Droid/repo"
UI.message("Starting F-Droid deployment...")
FileUtils.mkdir_p(fdroid_repo_dir)
apks.each do |apk_path|
basename = File.basename(apk_path)
new_name = "eu.twonly_v#{version}-#{basename}"
dest_path = File.join(fdroid_repo_dir, new_name)
UI.message("Copying APK to F-Droid repo: #{dest_path}")
FileUtils.cp(apk_path, dest_path)
end
fdroid_dir = "/Users/tobi/Documents/drive/twonly/F-Droid"
update_script = File.join(fdroid_dir, "update.sh")
if File.exist?(update_script)
UI.message("Executing F-Droid update script...")
Dir.chdir(fdroid_dir) do
sh("chmod +x ./update.sh && ./update.sh")
end
else
UI.important("F-Droid update script not found at #{update_script}")
end
end
end

View file

@ -280,9 +280,6 @@ PODS:
- Flutter
- permission_handler_apple (9.3.0):
- Flutter
- photo_manager (3.9.0):
- Flutter
- FlutterMacOS
- pro_video_editor (0.0.1):
- Flutter
- PromisesObjC (2.4.0)
@ -358,7 +355,6 @@ DEPENDENCIES:
- local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- photo_manager (from `.symlinks/plugins/photo_manager/darwin`)
- pro_video_editor (from `.symlinks/plugins/pro_video_editor/ios`)
- restart_app (from `.symlinks/plugins/restart_app/ios`)
- rust_lib_twonly (from `.symlinks/plugins/rust_lib_twonly/ios`)
@ -464,8 +460,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/package_info_plus/ios"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
photo_manager:
:path: ".symlinks/plugins/photo_manager/darwin"
pro_video_editor:
:path: ".symlinks/plugins/pro_video_editor/ios"
restart_app:
@ -542,7 +536,6 @@ SPEC CHECKSUMS:
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
photo_manager: 25fd77df14f4f0ba5ef99e2c61814dde77e2bceb
pro_video_editor: 44ef9a6d48dbd757ed428cf35396dd05f35c7830
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
restart_app: 0714144901e260eae68f7afc2fc4aacc1a323ad2

View file

@ -13,7 +13,7 @@ import workmanager_apple
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
UNUserNotificationCenter.current().delegate = self
if let registrar = self.registrar(forPlugin: "VideoCompressionChannel") {
VideoCompressionChannel.register(with: registrar.messenger())
}
@ -32,22 +32,20 @@ import workmanager_apple
WorkmanagerPlugin.registerBGProcessingTask(
withIdentifier: "eu.twonly.processing_task"
)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
override func application(
_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
let sharingIntent = SwiftFlutterSharingIntentPlugin.instance
if sharingIntent.hasSameSchemePrefix(url: url) {
return sharingIntent.application(app, open: url, options: options)
}
let sharingIntent = SwiftFlutterSharingIntentPlugin.instance
if sharingIntent.hasSameSchemePrefix(url: url) {
return sharingIntent.application(app, open: url, options: options)
}
// Proceed url handling for other Flutter libraries like app_links
return super.application(app, open: url, options: options)
}
// Proceed url handling for other Flutter libraries like app_links
return super.application(app, open: url, options:options)
}
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
@ -60,8 +58,7 @@ import workmanager_apple
NSLog(
"Application delegate method userNotificationCenter:didReceive:withCompletionHandler: is called with user info: %@",
response.notification.request.content.userInfo)
super.userNotificationCenter(
center, didReceive: response, withCompletionHandler: completionHandler)
//...
}
override func userNotificationCenter(
@ -89,4 +86,4 @@ import workmanager_apple
completionHandler([.alert, .sound])
}
}
}

View file

@ -18,17 +18,11 @@ import 'package:twonly/src/visual/views/home.view.dart';
import 'package:twonly/src/visual/views/onboarding/onboarding.view.dart';
import 'package:twonly/src/visual/views/onboarding/register.view.dart';
import 'package:twonly/src/visual/views/onboarding/setup.view.dart';
import 'package:twonly/src/visual/views/recovery.view.dart';
import 'package:twonly/src/visual/views/unlock_twonly.view.dart';
class App extends StatefulWidget {
const App({
required this.storageError,
required this.recoveryPossible,
super.key,
});
const App({required this.storageError, super.key});
final bool storageError;
final bool recoveryPossible;
@override
State<App> createState() => _AppState();
}
@ -83,6 +77,7 @@ class _AppState extends State<App> with WidgetsBindingObserver {
if (widget.storageError) {
return MaterialApp(
scaffoldMessengerKey: AppGlobalKeys.scaffoldMessengerKey,
localizationsDelegates: localizationsDelegates,
debugShowCheckedModeBanner: false,
supportedLocales: supportedLocales,
@ -94,21 +89,9 @@ class _AppState extends State<App> with WidgetsBindingObserver {
);
}
if (widget.recoveryPossible) {
return MaterialApp(
localizationsDelegates: localizationsDelegates,
debugShowCheckedModeBanner: false,
supportedLocales: supportedLocales,
title: 'twonly',
theme: lightTheme,
darkTheme: darkTheme,
themeMode: context.read<SettingsChangeProvider>().themeMode,
home: const RecoveryView(),
);
}
return MaterialApp.router(
routerConfig: routerProvider,
scaffoldMessengerKey: AppGlobalKeys.scaffoldMessengerKey,
localizationsDelegates: localizationsDelegates,
debugShowCheckedModeBanner: false,
supportedLocales: supportedLocales,
@ -137,14 +120,12 @@ class _AppMainWidgetState extends State<AppMainWidget> {
bool _isLoaded = false;
bool _isTwonlyLocked = true;
bool _wasLogged = true;
late int _initialPage;
(Future<int>?, bool) _proofOfWork = (null, false);
@override
void initState() {
super.initState();
_initialPage = widget.initialPage;
Log.info('AppWidgetState: initState started');
initAsync();
}
@ -152,17 +133,7 @@ class _AppMainWidgetState extends State<AppMainWidget> {
Future<void> initAsync() async {
Log.info('AppWidgetState: initAsync started');
if (userService.isUserCreated) {
if (_initialPage != 0) {
final count = await twonlyDB.contactsDao.getContactsCount();
if (count == 0) {
_initialPage = 0;
}
}
try {
unawaited(FirebaseMessaging.instance.requestPermission());
} catch (e) {
Log.error(e);
}
unawaited(FirebaseMessaging.instance.requestPermission());
if (_isTwonlyLocked) {
// do not change in case twonly was already unlocked at some point
_isTwonlyLocked = userService.currentUser.screenLockEnabled;
@ -208,7 +179,8 @@ class _AppMainWidgetState extends State<AppMainWidget> {
_isTwonlyLocked = false;
}),
);
} else if (!userService.currentUser.skipSetupPages && userService.currentUser.currentSetupPage != null) {
} else if (!userService.currentUser.skipSetupPages &&
userService.currentUser.currentSetupPage != null) {
// This will only be shown in case the user have not skipped
child = SetupView(
onUpdate: () => setState(() {
@ -217,7 +189,7 @@ class _AppMainWidgetState extends State<AppMainWidget> {
);
} else {
child = HomeView(
initialPage: _initialPage,
initialPage: widget.initialPage,
);
}
} else if (_showOnboarding) {

View file

@ -1,29 +0,0 @@
// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.12.0.
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
import '../frb_generated.dart';
import '../lib.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
class BackupPasswordKeys {
final U8Array32 backupId;
final U8Array32 encryptionKey;
const BackupPasswordKeys({
required this.backupId,
required this.encryptionKey,
});
@override
int get hashCode => backupId.hashCode ^ encryptionKey.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is BackupPasswordKeys &&
runtimeType == other.runtimeType &&
backupId == other.backupId &&
encryptionKey == other.encryptionKey;
}

View file

@ -9,7 +9,7 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
// These functions are ignored because they are not marked as `pub`: `get_twonly_flutter`
// These types are ignored because they are neither used by any `pub` functions nor (for structs and enums) marked `#[frb(unignore)]`: `TwonlyFlutter`
Future<void> initializeTwonlyFlutter({required InitConfig config}) =>
Future<void> initializeTwonlyFlutter({required TwonlyConfig config}) =>
RustLib.instance.api.crateBridgeInitializeTwonlyFlutter(config: config);
class AnnouncedUser {
@ -36,27 +36,6 @@ class AnnouncedUser {
publicId == other.publicId;
}
class InitConfig {
final String databaseDir;
final String dataDir;
const InitConfig({
required this.databaseDir,
required this.dataDir,
});
@override
int get hashCode => databaseDir.hashCode ^ dataDir.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is InitConfig &&
runtimeType == other.runtimeType &&
databaseDir == other.databaseDir &&
dataDir == other.dataDir;
}
class OtherPromotion {
final int promotionId;
final PlatformInt64 publicId;
@ -95,3 +74,24 @@ class OtherPromotion {
announcementShare == other.announcementShare &&
publicKeyVerifiedTimestamp == other.publicKeyVerifiedTimestamp;
}
class TwonlyConfig {
final String databasePath;
final String dataDirectory;
const TwonlyConfig({
required this.databasePath,
required this.dataDirectory,
});
@override
int get hashCode => databasePath.hashCode ^ dataDirectory.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is TwonlyConfig &&
runtimeType == other.runtimeType &&
databasePath == other.databasePath &&
dataDirectory == other.dataDirectory;
}

View file

@ -1,87 +0,0 @@
// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.12.0.
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
import '../../frb_generated.dart';
import '../../keys/backup_password_keys.dart';
import '../../lib.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
class RustBackupArchive {
const RustBackupArchive();
static Future<(String, String)> createBackupArchive() => RustLib.instance.api
.crateBridgeWrapperBackupRustBackupArchiveCreateBackupArchive();
static Future<String?> getBackupDownloadToken() => RustLib.instance.api
.crateBridgeWrapperBackupRustBackupArchiveGetBackupDownloadToken();
static Future<void> restoreBackupArchive({required String filePath}) =>
RustLib.instance.api
.crateBridgeWrapperBackupRustBackupArchiveRestoreBackupArchive(
filePath: filePath,
);
@override
int get hashCode => 0;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is RustBackupArchive && runtimeType == other.runtimeType;
}
class RustBackupIdentity {
const RustBackupIdentity();
static Future<String?> getBackupId() => RustLib.instance.api
.crateBridgeWrapperBackupRustBackupIdentityGetBackupId();
static Future<BackupPasswordKeys> getBackupPasswordKeys({
required PlatformInt64 userId,
required String password,
}) => RustLib.instance.api
.crateBridgeWrapperBackupRustBackupIdentityGetBackupPasswordKeys(
userId: userId,
password: password,
);
static Future<Uint8List> getIdentityBackupBytes() => RustLib.instance.api
.crateBridgeWrapperBackupRustBackupIdentityGetIdentityBackupBytes();
static Future<void> importBackupPasswordKeys({
required List<int> backupId,
required List<int> encryptionKey,
}) => RustLib.instance.api
.crateBridgeWrapperBackupRustBackupIdentityImportBackupPasswordKeys(
backupId: backupId,
encryptionKey: encryptionKey,
);
static Future<void> restoreIdentityBackup({
required BackupPasswordKeys keys,
required List<int> encryptedBytes,
}) => RustLib.instance.api
.crateBridgeWrapperBackupRustBackupIdentityRestoreIdentityBackup(
keys: keys,
encryptedBytes: encryptedBytes,
);
static Future<void> setBackupPasswordKeys({
required PlatformInt64 userId,
required String password,
}) => RustLib.instance.api
.crateBridgeWrapperBackupRustBackupIdentitySetBackupPasswordKeys(
userId: userId,
password: password,
);
@override
int get hashCode => 0;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is RustBackupIdentity && runtimeType == other.runtimeType;
}

View file

@ -1,77 +0,0 @@
// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.12.0.
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
import '../../frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
class RustKeyManager {
const RustKeyManager();
static Future<Uint8List> getLoginToken() => RustLib.instance.api
.crateBridgeWrapperKeyManagerRustKeyManagerGetLoginToken();
static Future<(Uint8List, PlatformInt64)> getSignalIdentity() => RustLib
.instance
.api
.crateBridgeWrapperKeyManagerRustKeyManagerGetSignalIdentity();
static Future<PlatformInt64?> getUserId() => RustLib.instance.api
.crateBridgeWrapperKeyManagerRustKeyManagerGetUserId();
static Future<void> importSignalIdentity({
required List<int> identityKeyPairStructure,
required PlatformInt64 registrationId,
required Map<PlatformInt64, Uint8List> signedPreKeyStore,
}) => RustLib.instance.api
.crateBridgeWrapperKeyManagerRustKeyManagerImportSignalIdentity(
identityKeyPairStructure: identityKeyPairStructure,
registrationId: registrationId,
signedPreKeyStore: signedPreKeyStore,
);
static Future<Uint8List?> loadSignedPrekey({
required PlatformInt64 signedPreKeyId,
}) => RustLib.instance.api
.crateBridgeWrapperKeyManagerRustKeyManagerLoadSignedPrekey(
signedPreKeyId: signedPreKeyId,
);
static Future<Map<PlatformInt64, Uint8List>> loadSignedPrekeys() => RustLib
.instance
.api
.crateBridgeWrapperKeyManagerRustKeyManagerLoadSignedPrekeys();
static Future<void> removeKeyManager() => RustLib.instance.api
.crateBridgeWrapperKeyManagerRustKeyManagerRemoveKeyManager();
static Future<void> removeSignedPrekey({
required PlatformInt64 signedPreKeyId,
}) => RustLib.instance.api
.crateBridgeWrapperKeyManagerRustKeyManagerRemoveSignedPrekey(
signedPreKeyId: signedPreKeyId,
);
static Future<void> setUserId({required PlatformInt64 userId}) => RustLib
.instance
.api
.crateBridgeWrapperKeyManagerRustKeyManagerSetUserId(userId: userId);
static Future<void> storeSignedPrekey({
required PlatformInt64 signedPreKeyId,
required List<int> record,
}) => RustLib.instance.api
.crateBridgeWrapperKeyManagerRustKeyManagerStoreSignedPrekey(
signedPreKeyId: signedPreKeyId,
record: record,
);
@override
int get hashCode => 0;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is RustKeyManager && runtimeType == other.runtimeType;
}

View file

@ -1,28 +0,0 @@
// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.12.0.
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
import 'frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
class InitConfig {
final String databasePath;
final String dataDirectory;
const InitConfig({
required this.databasePath,
required this.dataDirectory,
});
@override
int get hashCode => databasePath.hashCode ^ dataDirectory.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is InitConfig &&
runtimeType == other.runtimeType &&
databasePath == other.databasePath &&
dataDirectory == other.dataDirectory;
}

File diff suppressed because it is too large Load diff

View file

@ -5,15 +5,11 @@
import 'bridge.dart';
import 'bridge/callbacks.dart';
import 'bridge/wrapper/backup.dart';
import 'bridge/wrapper/key_manager.dart';
import 'bridge/wrapper/user_discovery.dart';
import 'dart:async';
import 'dart:convert';
import 'dart:ffi' as ffi;
import 'frb_generated.dart';
import 'keys/backup_password_keys.dart';
import 'lib.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_io.dart';
abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@ -102,11 +98,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
Object dco_decode_DartOpaque(dynamic raw);
@protected
Map<PlatformInt64, Uint8List> dco_decode_Map_i_64_list_prim_u_8_strict_None(
dynamic raw,
);
@protected
RustStreamSink<String> dco_decode_StreamSink_String_Sse(dynamic raw);
@ -116,23 +107,17 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
AnnouncedUser dco_decode_announced_user(dynamic raw);
@protected
BackupPasswordKeys dco_decode_backup_password_keys(dynamic raw);
@protected
bool dco_decode_bool(dynamic raw);
@protected
AnnouncedUser dco_decode_box_autoadd_announced_user(dynamic raw);
@protected
BackupPasswordKeys dco_decode_box_autoadd_backup_password_keys(dynamic raw);
@protected
PlatformInt64 dco_decode_box_autoadd_i_64(dynamic raw);
@protected
InitConfig dco_decode_box_autoadd_init_config(dynamic raw);
TwonlyConfig dco_decode_box_autoadd_twonly_config(dynamic raw);
@protected
FlutterUserDiscovery dco_decode_flutter_user_discovery(dynamic raw);
@ -140,9 +125,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
PlatformInt64 dco_decode_i_64(dynamic raw);
@protected
InitConfig dco_decode_init_config(dynamic raw);
@protected
PlatformInt64 dco_decode_isize(dynamic raw);
@ -158,13 +140,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
Uint8List dco_decode_list_prim_u_8_strict(dynamic raw);
@protected
List<(PlatformInt64, Uint8List)>
dco_decode_list_record_i_64_list_prim_u_8_strict(dynamic raw);
@protected
String? dco_decode_opt_String(dynamic raw);
@protected
AnnouncedUser? dco_decode_opt_box_autoadd_announced_user(dynamic raw);
@ -184,26 +159,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
OtherPromotion dco_decode_other_promotion(dynamic raw);
@protected
(PlatformInt64, Uint8List) dco_decode_record_i_64_list_prim_u_8_strict(
dynamic raw,
);
@protected
(Uint8List, PlatformInt64) dco_decode_record_list_prim_u_8_strict_i_64(
dynamic raw,
);
@protected
(String, String) dco_decode_record_string_string(dynamic raw);
@protected
RustBackupArchive dco_decode_rust_backup_archive(dynamic raw);
@protected
RustBackupIdentity dco_decode_rust_backup_identity(dynamic raw);
@protected
RustKeyManager dco_decode_rust_key_manager(dynamic raw);
TwonlyConfig dco_decode_twonly_config(dynamic raw);
@protected
int dco_decode_u_32(dynamic raw);
@ -211,9 +167,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
int dco_decode_u_8(dynamic raw);
@protected
U8Array32 dco_decode_u_8_array_32(dynamic raw);
@protected
void dco_decode_unit(dynamic raw);
@ -226,11 +179,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
Object sse_decode_DartOpaque(SseDeserializer deserializer);
@protected
Map<PlatformInt64, Uint8List> sse_decode_Map_i_64_list_prim_u_8_strict_None(
SseDeserializer deserializer,
);
@protected
RustStreamSink<String> sse_decode_StreamSink_String_Sse(
SseDeserializer deserializer,
@ -242,11 +190,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
AnnouncedUser sse_decode_announced_user(SseDeserializer deserializer);
@protected
BackupPasswordKeys sse_decode_backup_password_keys(
SseDeserializer deserializer,
);
@protected
bool sse_decode_bool(SseDeserializer deserializer);
@ -255,16 +198,13 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
SseDeserializer deserializer,
);
@protected
BackupPasswordKeys sse_decode_box_autoadd_backup_password_keys(
SseDeserializer deserializer,
);
@protected
PlatformInt64 sse_decode_box_autoadd_i_64(SseDeserializer deserializer);
@protected
InitConfig sse_decode_box_autoadd_init_config(SseDeserializer deserializer);
TwonlyConfig sse_decode_box_autoadd_twonly_config(
SseDeserializer deserializer,
);
@protected
FlutterUserDiscovery sse_decode_flutter_user_discovery(
@ -274,9 +214,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
PlatformInt64 sse_decode_i_64(SseDeserializer deserializer);
@protected
InitConfig sse_decode_init_config(SseDeserializer deserializer);
@protected
PlatformInt64 sse_decode_isize(SseDeserializer deserializer);
@ -296,15 +233,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer);
@protected
List<(PlatformInt64, Uint8List)>
sse_decode_list_record_i_64_list_prim_u_8_strict(
SseDeserializer deserializer,
);
@protected
String? sse_decode_opt_String(SseDeserializer deserializer);
@protected
AnnouncedUser? sse_decode_opt_box_autoadd_announced_user(
SseDeserializer deserializer,
@ -330,32 +258,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
OtherPromotion sse_decode_other_promotion(SseDeserializer deserializer);
@protected
(PlatformInt64, Uint8List) sse_decode_record_i_64_list_prim_u_8_strict(
SseDeserializer deserializer,
);
@protected
(Uint8List, PlatformInt64) sse_decode_record_list_prim_u_8_strict_i_64(
SseDeserializer deserializer,
);
@protected
(String, String) sse_decode_record_string_string(
SseDeserializer deserializer,
);
@protected
RustBackupArchive sse_decode_rust_backup_archive(
SseDeserializer deserializer,
);
@protected
RustBackupIdentity sse_decode_rust_backup_identity(
SseDeserializer deserializer,
);
@protected
RustKeyManager sse_decode_rust_key_manager(SseDeserializer deserializer);
TwonlyConfig sse_decode_twonly_config(SseDeserializer deserializer);
@protected
int sse_decode_u_32(SseDeserializer deserializer);
@ -363,9 +266,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
int sse_decode_u_8(SseDeserializer deserializer);
@protected
U8Array32 sse_decode_u_8_array_32(SseDeserializer deserializer);
@protected
void sse_decode_unit(SseDeserializer deserializer);
@ -466,12 +366,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_DartOpaque(Object self, SseSerializer serializer);
@protected
void sse_encode_Map_i_64_list_prim_u_8_strict_None(
Map<PlatformInt64, Uint8List> self,
SseSerializer serializer,
);
@protected
void sse_encode_StreamSink_String_Sse(
RustStreamSink<String> self,
@ -484,12 +378,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_announced_user(AnnouncedUser self, SseSerializer serializer);
@protected
void sse_encode_backup_password_keys(
BackupPasswordKeys self,
SseSerializer serializer,
);
@protected
void sse_encode_bool(bool self, SseSerializer serializer);
@ -499,12 +387,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
SseSerializer serializer,
);
@protected
void sse_encode_box_autoadd_backup_password_keys(
BackupPasswordKeys self,
SseSerializer serializer,
);
@protected
void sse_encode_box_autoadd_i_64(
PlatformInt64 self,
@ -512,8 +394,8 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
);
@protected
void sse_encode_box_autoadd_init_config(
InitConfig self,
void sse_encode_box_autoadd_twonly_config(
TwonlyConfig self,
SseSerializer serializer,
);
@ -526,9 +408,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_i_64(PlatformInt64 self, SseSerializer serializer);
@protected
void sse_encode_init_config(InitConfig self, SseSerializer serializer);
@protected
void sse_encode_isize(PlatformInt64 self, SseSerializer serializer);
@ -553,15 +432,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
SseSerializer serializer,
);
@protected
void sse_encode_list_record_i_64_list_prim_u_8_strict(
List<(PlatformInt64, Uint8List)> self,
SseSerializer serializer,
);
@protected
void sse_encode_opt_String(String? self, SseSerializer serializer);
@protected
void sse_encode_opt_box_autoadd_announced_user(
AnnouncedUser? self,
@ -599,40 +469,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
);
@protected
void sse_encode_record_i_64_list_prim_u_8_strict(
(PlatformInt64, Uint8List) self,
SseSerializer serializer,
);
@protected
void sse_encode_record_list_prim_u_8_strict_i_64(
(Uint8List, PlatformInt64) self,
SseSerializer serializer,
);
@protected
void sse_encode_record_string_string(
(String, String) self,
SseSerializer serializer,
);
@protected
void sse_encode_rust_backup_archive(
RustBackupArchive self,
SseSerializer serializer,
);
@protected
void sse_encode_rust_backup_identity(
RustBackupIdentity self,
SseSerializer serializer,
);
@protected
void sse_encode_rust_key_manager(
RustKeyManager self,
SseSerializer serializer,
);
void sse_encode_twonly_config(TwonlyConfig self, SseSerializer serializer);
@protected
void sse_encode_u_32(int self, SseSerializer serializer);
@ -640,9 +477,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_u_8(int self, SseSerializer serializer);
@protected
void sse_encode_u_8_array_32(U8Array32 self, SseSerializer serializer);
@protected
void sse_encode_unit(void self, SseSerializer serializer);

View file

@ -8,14 +8,10 @@
import 'bridge.dart';
import 'bridge/callbacks.dart';
import 'bridge/wrapper/backup.dart';
import 'bridge/wrapper/key_manager.dart';
import 'bridge/wrapper/user_discovery.dart';
import 'dart:async';
import 'dart:convert';
import 'frb_generated.dart';
import 'keys/backup_password_keys.dart';
import 'lib.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_web.dart';
abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@ -104,11 +100,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
Object dco_decode_DartOpaque(dynamic raw);
@protected
Map<PlatformInt64, Uint8List> dco_decode_Map_i_64_list_prim_u_8_strict_None(
dynamic raw,
);
@protected
RustStreamSink<String> dco_decode_StreamSink_String_Sse(dynamic raw);
@ -118,23 +109,17 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
AnnouncedUser dco_decode_announced_user(dynamic raw);
@protected
BackupPasswordKeys dco_decode_backup_password_keys(dynamic raw);
@protected
bool dco_decode_bool(dynamic raw);
@protected
AnnouncedUser dco_decode_box_autoadd_announced_user(dynamic raw);
@protected
BackupPasswordKeys dco_decode_box_autoadd_backup_password_keys(dynamic raw);
@protected
PlatformInt64 dco_decode_box_autoadd_i_64(dynamic raw);
@protected
InitConfig dco_decode_box_autoadd_init_config(dynamic raw);
TwonlyConfig dco_decode_box_autoadd_twonly_config(dynamic raw);
@protected
FlutterUserDiscovery dco_decode_flutter_user_discovery(dynamic raw);
@ -142,9 +127,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
PlatformInt64 dco_decode_i_64(dynamic raw);
@protected
InitConfig dco_decode_init_config(dynamic raw);
@protected
PlatformInt64 dco_decode_isize(dynamic raw);
@ -160,13 +142,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
Uint8List dco_decode_list_prim_u_8_strict(dynamic raw);
@protected
List<(PlatformInt64, Uint8List)>
dco_decode_list_record_i_64_list_prim_u_8_strict(dynamic raw);
@protected
String? dco_decode_opt_String(dynamic raw);
@protected
AnnouncedUser? dco_decode_opt_box_autoadd_announced_user(dynamic raw);
@ -186,26 +161,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
OtherPromotion dco_decode_other_promotion(dynamic raw);
@protected
(PlatformInt64, Uint8List) dco_decode_record_i_64_list_prim_u_8_strict(
dynamic raw,
);
@protected
(Uint8List, PlatformInt64) dco_decode_record_list_prim_u_8_strict_i_64(
dynamic raw,
);
@protected
(String, String) dco_decode_record_string_string(dynamic raw);
@protected
RustBackupArchive dco_decode_rust_backup_archive(dynamic raw);
@protected
RustBackupIdentity dco_decode_rust_backup_identity(dynamic raw);
@protected
RustKeyManager dco_decode_rust_key_manager(dynamic raw);
TwonlyConfig dco_decode_twonly_config(dynamic raw);
@protected
int dco_decode_u_32(dynamic raw);
@ -213,9 +169,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
int dco_decode_u_8(dynamic raw);
@protected
U8Array32 dco_decode_u_8_array_32(dynamic raw);
@protected
void dco_decode_unit(dynamic raw);
@ -228,11 +181,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
Object sse_decode_DartOpaque(SseDeserializer deserializer);
@protected
Map<PlatformInt64, Uint8List> sse_decode_Map_i_64_list_prim_u_8_strict_None(
SseDeserializer deserializer,
);
@protected
RustStreamSink<String> sse_decode_StreamSink_String_Sse(
SseDeserializer deserializer,
@ -244,11 +192,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
AnnouncedUser sse_decode_announced_user(SseDeserializer deserializer);
@protected
BackupPasswordKeys sse_decode_backup_password_keys(
SseDeserializer deserializer,
);
@protected
bool sse_decode_bool(SseDeserializer deserializer);
@ -257,16 +200,13 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
SseDeserializer deserializer,
);
@protected
BackupPasswordKeys sse_decode_box_autoadd_backup_password_keys(
SseDeserializer deserializer,
);
@protected
PlatformInt64 sse_decode_box_autoadd_i_64(SseDeserializer deserializer);
@protected
InitConfig sse_decode_box_autoadd_init_config(SseDeserializer deserializer);
TwonlyConfig sse_decode_box_autoadd_twonly_config(
SseDeserializer deserializer,
);
@protected
FlutterUserDiscovery sse_decode_flutter_user_discovery(
@ -276,9 +216,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
PlatformInt64 sse_decode_i_64(SseDeserializer deserializer);
@protected
InitConfig sse_decode_init_config(SseDeserializer deserializer);
@protected
PlatformInt64 sse_decode_isize(SseDeserializer deserializer);
@ -298,15 +235,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer);
@protected
List<(PlatformInt64, Uint8List)>
sse_decode_list_record_i_64_list_prim_u_8_strict(
SseDeserializer deserializer,
);
@protected
String? sse_decode_opt_String(SseDeserializer deserializer);
@protected
AnnouncedUser? sse_decode_opt_box_autoadd_announced_user(
SseDeserializer deserializer,
@ -332,32 +260,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
OtherPromotion sse_decode_other_promotion(SseDeserializer deserializer);
@protected
(PlatformInt64, Uint8List) sse_decode_record_i_64_list_prim_u_8_strict(
SseDeserializer deserializer,
);
@protected
(Uint8List, PlatformInt64) sse_decode_record_list_prim_u_8_strict_i_64(
SseDeserializer deserializer,
);
@protected
(String, String) sse_decode_record_string_string(
SseDeserializer deserializer,
);
@protected
RustBackupArchive sse_decode_rust_backup_archive(
SseDeserializer deserializer,
);
@protected
RustBackupIdentity sse_decode_rust_backup_identity(
SseDeserializer deserializer,
);
@protected
RustKeyManager sse_decode_rust_key_manager(SseDeserializer deserializer);
TwonlyConfig sse_decode_twonly_config(SseDeserializer deserializer);
@protected
int sse_decode_u_32(SseDeserializer deserializer);
@ -365,9 +268,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
int sse_decode_u_8(SseDeserializer deserializer);
@protected
U8Array32 sse_decode_u_8_array_32(SseDeserializer deserializer);
@protected
void sse_decode_unit(SseDeserializer deserializer);
@ -468,12 +368,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_DartOpaque(Object self, SseSerializer serializer);
@protected
void sse_encode_Map_i_64_list_prim_u_8_strict_None(
Map<PlatformInt64, Uint8List> self,
SseSerializer serializer,
);
@protected
void sse_encode_StreamSink_String_Sse(
RustStreamSink<String> self,
@ -486,12 +380,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_announced_user(AnnouncedUser self, SseSerializer serializer);
@protected
void sse_encode_backup_password_keys(
BackupPasswordKeys self,
SseSerializer serializer,
);
@protected
void sse_encode_bool(bool self, SseSerializer serializer);
@ -501,12 +389,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
SseSerializer serializer,
);
@protected
void sse_encode_box_autoadd_backup_password_keys(
BackupPasswordKeys self,
SseSerializer serializer,
);
@protected
void sse_encode_box_autoadd_i_64(
PlatformInt64 self,
@ -514,8 +396,8 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
);
@protected
void sse_encode_box_autoadd_init_config(
InitConfig self,
void sse_encode_box_autoadd_twonly_config(
TwonlyConfig self,
SseSerializer serializer,
);
@ -528,9 +410,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_i_64(PlatformInt64 self, SseSerializer serializer);
@protected
void sse_encode_init_config(InitConfig self, SseSerializer serializer);
@protected
void sse_encode_isize(PlatformInt64 self, SseSerializer serializer);
@ -555,15 +434,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
SseSerializer serializer,
);
@protected
void sse_encode_list_record_i_64_list_prim_u_8_strict(
List<(PlatformInt64, Uint8List)> self,
SseSerializer serializer,
);
@protected
void sse_encode_opt_String(String? self, SseSerializer serializer);
@protected
void sse_encode_opt_box_autoadd_announced_user(
AnnouncedUser? self,
@ -601,40 +471,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
);
@protected
void sse_encode_record_i_64_list_prim_u_8_strict(
(PlatformInt64, Uint8List) self,
SseSerializer serializer,
);
@protected
void sse_encode_record_list_prim_u_8_strict_i_64(
(Uint8List, PlatformInt64) self,
SseSerializer serializer,
);
@protected
void sse_encode_record_string_string(
(String, String) self,
SseSerializer serializer,
);
@protected
void sse_encode_rust_backup_archive(
RustBackupArchive self,
SseSerializer serializer,
);
@protected
void sse_encode_rust_backup_identity(
RustBackupIdentity self,
SseSerializer serializer,
);
@protected
void sse_encode_rust_key_manager(
RustKeyManager self,
SseSerializer serializer,
);
void sse_encode_twonly_config(TwonlyConfig self, SseSerializer serializer);
@protected
void sse_encode_u_32(int self, SseSerializer serializer);
@ -642,9 +479,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_u_8(int self, SseSerializer serializer);
@protected
void sse_encode_u_8_array_32(U8Array32 self, SseSerializer serializer);
@protected
void sse_encode_unit(void self, SseSerializer serializer);

View file

@ -1,29 +0,0 @@
// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.12.0.
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
import '../frb_generated.dart';
import '../lib.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
class BackupPasswordKeys {
final U8Array32 backupId;
final U8Array32 encryptionKey;
const BackupPasswordKeys({
required this.backupId,
required this.encryptionKey,
});
@override
int get hashCode => backupId.hashCode ^ encryptionKey.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is BackupPasswordKeys &&
runtimeType == other.runtimeType &&
backupId == other.backupId &&
encryptionKey == other.encryptionKey;
}

View file

@ -1,20 +0,0 @@
// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.12.0.
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
import 'frb_generated.dart';
import 'package:collection/collection.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
class U8Array32 extends NonGrowableListView<int> {
static const arraySize = 32;
@internal
Uint8List get inner => _inner;
final Uint8List _inner;
U8Array32(this._inner) : assert(_inner.length == arraySize), super(_inner);
U8Array32.init() : this(Uint8List(arraySize));
}

View file

@ -1,29 +1,26 @@
import 'dart:async';
import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart';
import 'package:twonly/src/utils/log.dart';
class AppEnvironment {
static late String cacheDir;
static late String supportDir;
static bool _isInitialized = false;
static late final String cacheDir;
static late final String supportDir;
// will be loaded in the main_camera_controller.dart
static List<CameraDescription> cameras = [];
static Future<void> init() async {
if (_isInitialized) return;
cacheDir = (await getApplicationCacheDirectory()).path;
supportDir = (await getApplicationSupportDirectory()).path;
Log.init();
_isInitialized = true;
}
static void initTesting({String? customCacheDir, String? customSupportDir}) {
cacheDir = customCacheDir ?? '/tmp/twonly_cache';
supportDir = customSupportDir ?? '/tmp/twonly_support';
_isInitialized = true;
static void initTesting() {
cacheDir = '/tmp/twonly_cache';
supportDir = '/tmp/twonly_support';
}
}
@ -32,6 +29,9 @@ class AppState {
static bool isInBackgroundTask = false;
static bool allowErrorTrackingViaSentry = false;
static bool gotMessageFromServer = false;
static int latestAppVersionId = 116;
static bool hasCameraPermissions = false;
static int latestAppVersionId = 110;
}
class AppGlobalKeys {
static final scaffoldMessengerKey = GlobalKey<ScaffoldMessengerState>();
}

View file

@ -1,4 +1,6 @@
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:mutex/mutex.dart';
@ -6,37 +8,39 @@ import 'package:provider/provider.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:twonly/app.dart';
import 'package:twonly/core/bridge.dart' as bridge;
import 'package:twonly/core/bridge/wrapper/key_manager.dart';
import 'package:twonly/core/frb_generated.dart';
import 'package:twonly/globals.dart';
import 'package:twonly/locator.dart';
import 'package:twonly/src/callbacks/callbacks.dart';
import 'package:twonly/src/database/tables/contacts.table.dart';
import 'package:twonly/src/providers/connection.provider.dart';
import 'package:twonly/src/providers/image_editor.provider.dart';
import 'package:twonly/src/providers/purchases.provider.dart';
import 'package:twonly/src/providers/settings.provider.dart';
import 'package:twonly/src/services/api/mediafiles/download.api.dart';
import 'package:twonly/src/services/api/mediafiles/media_background.api.dart';
import 'package:twonly/src/services/api/mediafiles/upload.api.dart';
import 'package:twonly/src/services/background/callback_dispatcher.background.dart';
import 'package:twonly/src/services/backup.service.dart';
import 'package:twonly/src/services/backup/create.backup.dart';
import 'package:twonly/src/services/mediafiles/mediafile.service.dart';
import 'package:twonly/src/services/memories/memories.service.dart';
import 'package:twonly/src/services/migrations.service.dart';
import 'package:twonly/src/services/notifications/fcm.notifications.dart';
import 'package:twonly/src/services/notifications/setup.notifications.dart';
import 'package:twonly/src/services/user.service.dart';
import 'package:twonly/src/services/user_discovery.service.dart';
import 'package:twonly/src/utils/avatars.dart';
import 'package:twonly/src/utils/exclusive_access.utils.dart';
import 'package:twonly/src/utils/log.dart';
import 'package:twonly/src/utils/secure_storage.dart';
import 'package:twonly/src/utils/startup_guard.dart';
import 'package:twonly/src/visual/views/onboarding/setup.view.dart';
final _initMutex = Mutex();
/// This function is used to initialized the absolute minimum so it
/// can also be used by the backend without the UI was loaded.
Future<bool> twonlyMinimumInitialization() async {
Future<void> twonlyMinimumInitialization() async {
Log.info('twonlyMinimumInitialization: called');
final hasStorageError = await exclusiveAccess(
await exclusiveAccess(
lockName: 'init',
mutex: _initMutex,
action: () async {
@ -50,22 +54,15 @@ Future<bool> twonlyMinimumInitialization() async {
await initFlutterCallbacksForRust();
Log.info('twonlyMinimumInitialization: bridge.initializeTwonlyFlutter()');
try {
await bridge.initializeTwonlyFlutter(
config: bridge.InitConfig(
databaseDir: AppEnvironment.supportDir,
dataDir: AppEnvironment.supportDir,
),
);
} catch (e) {
Log.error(e);
return true;
}
await bridge.initializeTwonlyFlutter(
config: bridge.TwonlyConfig(
databasePath: '${AppEnvironment.supportDir}/twonly.sqlite',
dataDirectory: AppEnvironment.supportDir,
),
);
Log.info('twonlyMinimumInitialization: finished');
return false;
},
);
return hasStorageError;
}
void main() async {
@ -75,30 +72,26 @@ void main() async {
unawaited(StartupGuard.markAppStartup());
var storageError = await twonlyMinimumInitialization();
await initFCMService();
await twonlyMinimumInitialization();
unawaited(initFCMService());
var userExists = false;
var storageError = false;
var recoveryPossible = false;
if (!storageError) {
try {
userExists = await userService.tryInit();
} catch (e) {
Log.error('Failed to initialize user session due to storage error: $e');
storageError = true;
}
try {
userExists = await userService.tryInit();
} catch (e) {
Log.error('Failed to initialize user session due to storage error: $e');
storageError = true;
}
if (!userExists && !storageError) {
try {
final userId = await RustKeyManager.getUserId();
if (userId != null) {
recoveryPossible = true;
}
} catch (e) {
Log.error('Could not check KeyManager userId for iOS recovery: $e');
if (Platform.isIOS && userExists) {
final dbFile = File('${AppEnvironment.supportDir}/twonly.sqlite');
if (!dbFile.existsSync()) {
Log.error('[twonly] IOS: App was removed and then reinstalled again...');
await SecureStorage.instance.deleteAll();
userExists = false;
}
}
@ -146,21 +139,53 @@ void main() async {
ChangeNotifierProvider(create: (_) => ImageEditorProvider()),
ChangeNotifierProvider(create: (_) => PurchasesProvider()),
],
child: App(
storageError: storageError,
recoveryPossible: recoveryPossible,
),
child: App(storageError: storageError),
),
);
}
Future<void> runMigrations() async {
if (userService.currentUser.appVersion < 90) {
// BUG: Requested media files for reupload where not reuploaded because the wrong state...
await twonlyDB.mediaFilesDao.updateAllRetransmissionUploadingState();
await UserService.update((u) => u.appVersion = 90);
}
if (userService.currentUser.appVersion < 91) {
// BUG: Requested media files for reupload where not reuploaded because the wrong state...
await makeMigrationToVersion91();
await UserService.update((u) => u.appVersion = 91);
}
if (userService.currentUser.appVersion < 109) {
final contacts = await twonlyDB.contactsDao.getAllContacts();
for (final contact in contacts) {
if (contact.verified) {
await twonlyDB.keyVerificationDao.addKeyVerification(
contact.userId,
VerificationType.migratedFromOldVersion,
);
}
}
await UserService.update((u) {
u
..appVersion = 109
..skipSetupPages = true;
if (u.avatarSvg == null) {
u.currentSetupPage = SetupPages.profile.name;
} else {
u.currentSetupPage = SetupPages.shareYourFriends.name;
}
});
}
}
Future<void> postStartupTasks() async {
Log.info('Post startup started.');
unawaited(MemoriesService.prewarmCache());
// 1. Immediate background cleanup (Non-blocking for UI)
await twonlyDB.messagesDao.purgeMessageTable();
unawaited(twonlyDB.receiptsDao.purgeReceivedReceipts());
unawaited(UserDiscoveryService.removeDeletedContacts());
unawaited(MediaFileService.purgeTempFolder());
// 2. Service initializations
@ -168,12 +193,25 @@ Future<void> postStartupTasks() async {
unawaited(finishStartedPreprocessing());
unawaited(createPushAvatars());
unawaited(UserDiscoveryService.verifyInitializationOnStartup());
if (userService.currentUser.userDiscoveryInitializationError) {
unawaited(() async {
try {
await UserDiscoveryService.initializeOrUpdate(
threshold: userService.currentUser.userDiscoveryThreshold,
sharePromotion: userService.currentUser.userDiscoverySharePromotion,
);
} catch (e) {
Log.error(
'Failed to retry UserDiscovery initialization on startup: $e',
);
}
}());
}
await Future.delayed(const Duration(seconds: 10));
unawaited(initializeBackgroundTaskManager());
// 3. Delayed tasks (Wait for app to settle)
await Future.delayed(const Duration(minutes: 2));
unawaited(BackupService.makeBackup());
unawaited(performTwonlySafeBackup());
unawaited(cleanLogFile());
}

View file

@ -1,5 +1,4 @@
import 'dart:async';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
import 'package:twonly/src/utils/log.dart';
@ -16,8 +15,7 @@ class LoggingCallbacks {
Log.info(log.split('INFO ')[1]);
} else if (log.contains('DEBUG ')) {
Log.info(log.split('DEBUG ')[1]);
} else if (kDebugMode && !Platform.environment.containsKey('FLUTTER_TEST')) {
// ignore: avoid_print
} else if (kDebugMode) {
print(log);
}
},

View file

@ -38,29 +38,21 @@ class UserDiscoveryCallbacks {
Uint8List pubKey,
Uint8List signature,
) async {
try {
return Curve.verifySignature(
IdentityKey.fromBytes(pubKey, 0).publicKey,
inputData,
signature,
);
} catch (_) {
return false;
}
return Curve.verifySignature(
IdentityKey.fromBytes(pubKey, 0).publicKey,
inputData,
signature,
);
}
static Future<bool> verifyStoredPubKey(
int contactId,
Uint8List pubKey,
) async {
try {
final storedPublicKey = await getPublicKeyFromContact(contactId);
if (storedPublicKey != null) {
return storedPublicKey.equals(pubKey);
} else {
return false;
}
} catch (_) {
final storedPublicKey = await getPublicKeyFromContact(contactId);
if (storedPublicKey != null) {
return storedPublicKey.equals(pubKey);
} else {
return false;
}
}

View file

@ -1,6 +1,4 @@
class KeyValueKeys {
static const String lastPeriodicTaskExecution =
'last_periodic_task_execution';
static const String currentBackupState = 'current_backup_state';
static const String backupRecoveryState = 'backup_recovery_state';
}

View file

@ -25,6 +25,7 @@ class Routes {
static const String settingsAccount = '/settings/account';
static const String settingsSubscription = '/settings/subscription';
static const String settingsBackup = '/settings/backup';
static const String settingsBackupServer = '/settings/backup/server';
static const String settingsBackupRecovery = '/settings/backup/recovery';
static const String settingsBackupSetup = '/settings/backup/setup';
static const String settingsAppearance = '/settings/appearance';
@ -35,14 +36,9 @@ class Routes {
'/settings/privacy/block_users';
static const String settingsPrivacyUserDiscovery =
'/settings/privacy/user_discovery';
static const String settingsPrivacyProfileSelection =
'/settings/privacy/profile_selection';
static const String settingsNotification = '/settings/notification';
static const String settingsStorage = '/settings/storage_data';
static const String settingsStorageManage = '/settings/storage_data/manage';
static const String settingsStorageImport = '/settings/storage_data/import';
static const String settingsStorageImportGallery =
'/settings/storage_data/import_gallery';
static const String settingsStorageExport = '/settings/storage_data/export';
static const String settingsHelp = '/settings/help';
static const String settingsHelpFaq = '/settings/help/faq';

View file

@ -1,15 +1,11 @@
class SecureStorageKeys {
@Deprecated('Use the secure storage in rust')
static const String signalIdentity = 'signal_identity';
@Deprecated('Use the secure storage in rust')
static const String signalSignedPreKey = 'signed_pre_key_store';
@Deprecated('Use the login token')
static const String apiAuthToken = 'api_auth_token';
@Deprecated('Use user.json file')
static const String googleFcm = 'google_fcm';
static const String userData = 'userData';
static const String twonlySafeLastBackupHash = 'twonly_safe_last_backup_hash';
// Not required for backup...
static const String receivingPushKeys = 'push_keys_receiving';
static const String sendingPushKeys = 'push_keys_sending';
}

View file

@ -103,13 +103,6 @@ class ContactsDao extends DatabaseAccessor<TwonlyDB> with _$ContactsDaoMixin {
return select(contacts).get();
}
Future<int> getContactsCount() async {
final count = contacts.userId.count();
final query = selectOnly(contacts)..addColumns([count]);
final result = await query.map((row) => row.read(count)).getSingle();
return result ?? 0;
}
Stream<int?> watchContactsBlocked() {
final count = contacts.userId.count();
final query = selectOnly(contacts)

View file

@ -1,7 +1,6 @@
import 'package:drift/drift.dart';
import 'package:hashlib/random.dart';
import 'package:twonly/locator.dart';
import 'package:twonly/src/database/daos/contacts.dao.dart';
import 'package:twonly/src/database/tables/groups.table.dart';
import 'package:twonly/src/database/twonly.db.dart';
import 'package:twonly/src/services/flame.service.dart';
@ -140,10 +139,15 @@ class GroupsDao extends DatabaseAccessor<TwonlyDB> with _$GroupsDaoMixin {
}
Future<Group?> _insertGroup(GroupsCompanion group) async {
await into(groups).insertOnConflictUpdate(group);
return (select(
groups,
)..where((t) => t.groupId.equals(group.groupId.value))).getSingleOrNull();
try {
await into(groups).insert(group);
return await (select(
groups,
)..where((t) => t.groupId.equals(group.groupId.value))).getSingle();
} catch (e) {
Log.error('Could not insert group: $e');
return null;
}
}
Future<List<Contact>> getGroupContact(String groupId) async {
@ -273,7 +277,7 @@ class GroupsDao extends DatabaseAccessor<TwonlyDB> with _$GroupsDaoMixin {
groups.groupId.equalsExp(groupMembers.groupId),
),
],
)..where(groups.isDirectChat.equals(false)));
)..where(groups.isDirectChat.isNull()));
return query.map((row) => row.readTable(groupMembers)).get();
} catch (e) {
Log.error(e);
@ -293,27 +297,6 @@ class GroupsDao extends DatabaseAccessor<TwonlyDB> with _$GroupsDaoMixin {
return query.map((row) => row.readTable(groups)).getSingleOrNull();
}
Future<Group?> createOrGetDirectChat(int contactId) async {
var directChat = await getDirectChat(contactId);
if (directChat == null) {
final contact = await attachedDatabase.contactsDao.getContactById(
contactId,
);
if (contact == null) {
Log.error('Contact $contactId not found, cannot create direct chat');
return null;
}
await createNewDirectChat(
contactId,
GroupsCompanion(
groupName: Value(getContactDisplayName(contact)),
),
);
directChat = await getDirectChat(contactId);
}
return directChat;
}
Stream<int> watchSumTotalMediaCounter() {
final query = selectOnly(groups)
..addColumns([groups.totalMediaCounter.sum()]);

View file

@ -6,7 +6,6 @@ import 'package:twonly/src/database/tables/contacts.table.dart';
import 'package:twonly/src/database/tables/groups.table.dart';
import 'package:twonly/src/database/tables/user_discovery.table.dart';
import 'package:twonly/src/database/twonly.db.dart';
import 'package:twonly/src/utils/log.dart';
part 'key_verification.dao.g.dart';
@ -27,8 +26,7 @@ class KeyVerificationDao extends DatabaseAccessor<TwonlyDB>
KeyVerificationDao(super.db);
Future<List<VerificationToken>> getRecentVerificationTokens() {
// Tokens are only valid for one hour, so if the users are currently offline, the verification notification will still work later.
final cutoff = DateTime.now().subtract(const Duration(hours: 1));
final cutoff = DateTime.now().subtract(const Duration(hours: 24));
return (select(
verificationTokens,
)..where((t) => t.createdAt.isBiggerOrEqualValue(cutoff))).get();
@ -84,19 +82,17 @@ class KeyVerificationDao extends DatabaseAccessor<TwonlyDB>
final query =
(select(contacts)..where((u) => u.userId.equals(contactId).not())).join(
[
innerJoin(
ur,
ur.fromContactId.equalsExp(contacts.userId),
),
innerJoin(kv, kv.contactId.equalsExp(ur.fromContactId)),
],
)
..where(
ur.announcedUserId.equals(contactId) &
ur.publicKeyVerifiedTimestamp.isNotNull(),
)
..groupBy([contacts.userId]);
[
innerJoin(
ur,
ur.fromContactId.equalsExp(contacts.userId),
),
innerJoin(kv, kv.contactId.equalsExp(ur.fromContactId)),
],
)..where(
ur.announcedUserId.equals(contactId) &
ur.publicKeyVerifiedTimestamp.isNotNull(),
);
return query.watch().map((rows) {
return rows.map((row) {
@ -120,42 +116,12 @@ class KeyVerificationDao extends DatabaseAccessor<TwonlyDB>
..where(
ur.publicKeyVerifiedTimestamp.isNotNull() &
ur.announcedUserId.equalsExp(ur.fromContactId).not(),
)
..groupBy([ur.announcedUserId]);
);
final rows = await query.get();
return rows.length;
}
Future<int> getCountOfContactsWithVerificationBadge() async {
final kv = keyVerifications;
final ur = userDiscoveryUserRelations;
final query = selectOnly(ur, distinct: true)
..addColumns([ur.announcedUserId])
..join([
innerJoin(contacts, contacts.userId.equalsExp(ur.fromContactId)),
innerJoin(kv, kv.contactId.equalsExp(ur.fromContactId)),
])
..where(
ur.publicKeyVerifiedTimestamp.isNotNull() &
ur.announcedUserId.equalsExp(ur.fromContactId).not(),
)
..groupBy([ur.announcedUserId]);
final rows = await query.get();
final transferredIds = rows.map((r) => r.read(ur.announcedUserId)!).toSet();
final directVerifications = await select(kv).get();
final directIds = directVerifications.map((v) => v.contactId).toSet();
// Reduce transferred contacts where announcedUserId is already in KeyVerifications
transferredIds.removeWhere(directIds.contains);
// Add count of all users who are in the KeyVerification table
return transferredIds.length + directIds.length;
}
Stream<VerificationStatus> watchAllGroupMembersVerified(String groupId) {
final gm = groupMembers;
final directKv = alias(keyVerifications, 'directKv');
@ -207,55 +173,17 @@ class KeyVerificationDao extends DatabaseAccessor<TwonlyDB>
}
Future<void> addKeyVerification(int contactId, VerificationType type) async {
try {
await into(keyVerifications).insertOnConflictUpdate(
KeyVerificationsCompanion(
contactId: Value(contactId),
type: Value(type),
),
await into(keyVerifications).insertOnConflictUpdate(
KeyVerificationsCompanion(
contactId: Value(contactId),
type: Value(type),
),
);
if (userService.currentUser.isUserDiscoveryEnabled) {
await FlutterUserDiscovery.updateVerificationStateForUser(
contactId: contactId,
publicKeyVerifiedTimestamp: clock.now().millisecondsSinceEpoch,
);
if (userService.currentUser.isUserDiscoveryEnabled) {
await FlutterUserDiscovery.updateVerificationStateForUser(
contactId: contactId,
publicKeyVerifiedTimestamp: clock.now().millisecondsSinceEpoch,
);
}
} catch (e) {
Log.error(e);
}
}
Future<void> deleteKeyVerification(int contactId) async {
try {
await (delete(
keyVerifications,
)..where((kv) => kv.contactId.equals(contactId))).go();
if (userService.currentUser.isUserDiscoveryEnabled) {
await FlutterUserDiscovery.updateVerificationStateForUser(
contactId: contactId,
);
}
} catch (e) {
Log.error(e);
}
}
Future<void> deleteKeyVerificationById(
int verificationId,
int contactId,
) async {
try {
await (delete(
keyVerifications,
)..where((kv) => kv.verificationId.equals(verificationId))).go();
final remaining = await getContactVerification(contactId);
if (remaining.isEmpty && userService.currentUser.isUserDiscoveryEnabled) {
await FlutterUserDiscovery.updateVerificationStateForUser(
contactId: contactId,
);
}
} catch (e) {
Log.error(e);
}
}
}

View file

@ -69,6 +69,7 @@ class MediaFilesDao extends DatabaseAccessor<TwonlyDB>
return (select(mediaFiles)..where((t) => t.mediaId.isIn(mediaIds))).get();
}
Future<MediaFile?> getDraftMediaFile() async {
final medias = await (select(
mediaFiles,
@ -114,15 +115,9 @@ class MediaFilesDao extends DatabaseAccessor<TwonlyDB>
.get();
}
Future<List<MediaFile>> getAllMediaFilesPendingMigration() async {
Future<List<MediaFile>> getAllNonHashedStoredMediaFiles() async {
return (select(mediaFiles)..where(
(t) =>
t.stored.equals(true) &
(t.storedFileHash.isNull() |
t.hasCropAnalyzed.equals(false) |
(t.hasThumbnail.equals(false) &
t.type.equals(MediaType.audio.name).not()) |
t.sizeInBytes.isNull()),
(t) => t.stored.equals(true) & t.storedFileHash.isNull(),
))
.get();
}
@ -164,43 +159,4 @@ class MediaFilesDao extends DatabaseAccessor<TwonlyDB>
),
);
}
Future<List<String>> getMessageIdsByMediaHash(
Uint8List hash,
int senderId,
) async {
final query =
select(db.messages).join([
innerJoin(
mediaFiles,
mediaFiles.mediaId.equalsExp(db.messages.mediaId),
),
])..where(
mediaFiles.storedFileHash.equals(hash) &
db.messages.senderId.equals(senderId) &
db.messages.openedAt.isNull(),
);
final rows = await query.get();
return rows.map((row) => row.readTable(db.messages).messageId).toList();
}
Future<List<MediaFile>> getMediaByHash(Uint8List hash) async {
final query = select(db.mediaFiles)
..where((t) => t.storedFileHash.equals(hash));
return query.get();
}
Future<Map<MediaType, int>> getStorageStats() async {
final rows = await select(mediaFiles).get();
final stats = <MediaType, int>{};
for (final row in rows) {
final type = row.type;
final size = row.sizeInBytes ?? 0;
stats[type] = (stats[type] ?? 0) + size;
}
return stats;
}
}

View file

@ -102,7 +102,7 @@ class MessagesDao extends DatabaseAccessor<TwonlyDB> with _$MessagesDaoMixin {
t.openedAt.isNull() |
t.mediaStored.equals(true)) &
(t.isDeletedFromSender.equals(true) |
(t.type.equals(MessageType.text.name).not() &
(t.type.equals(MessageType.text.name).not() |
t.type.equals(MessageType.media.name).not()) |
(t.type.equals(MessageType.text.name) &
t.content.isNotNull()) |
@ -153,25 +153,18 @@ class MessagesDao extends DatabaseAccessor<TwonlyDB> with _$MessagesDaoMixin {
);
final groupIds = entry.value;
final deletedCount =
await (delete(messages)..where(
(m) =>
m.groupId.isIn(groupIds) &
((m.mediaStored.equals(true) &
m.isDeletedFromSender.equals(true)) |
m.mediaStored.equals(false)) &
// Only remove the message when ALL members have seen it. Otherwise the receipt will also be deleted which could cause issues in case a member opens the image later..
(m.openedByAll.isSmallerThanValue(deletionTime) |
(m.isDeletedFromSender.equals(true) &
m.createdAt.isSmallerThanValue(deletionTime))),
))
.go();
if (deletedCount > 0) {
Log.info(
'Deleted $deletedCount messages for groups $groupIds due to retention policy.',
);
}
await (delete(messages)..where(
(m) =>
m.groupId.isIn(groupIds) &
(m.mediaStored.equals(true) &
m.isDeletedFromSender.equals(true) |
m.mediaStored.equals(false)) &
// Only remove the message when ALL members have seen it. Otherwise the receipt will also be deleted which could cause issues in case a member opens the image later..
(m.openedByAll.isSmallerThanValue(deletionTime) |
(m.isDeletedFromSender.equals(true) &
m.createdAt.isSmallerThanValue(deletionTime))),
))
.go();
}
}
@ -256,70 +249,41 @@ class MessagesDao extends DatabaseAccessor<TwonlyDB> with _$MessagesDaoMixin {
}
Future<void> handleMessagesOpened(
Value<int> contactId,
int contactId,
List<String> messageIds,
DateTime timestamp,
) async {
for (final messageId in messageIds) {
try {
var actionTimestamp = timestamp;
final msg = await getMessageById(messageId).getSingleOrNull();
if (msg != null && actionTimestamp.isBefore(msg.createdAt)) {
Log.warn(
'Receiver clock skew detected for message $messageId. '
'Action timestamp $actionTimestamp is before message creation ${msg.createdAt}. '
'Clamping to creation time.',
);
actionTimestamp = msg.createdAt;
}
final ts = actionTimestamp;
await transaction(() async {
await into(messageActions).insertOnConflictUpdate(
MessageActionsCompanion(
messageId: Value(messageId),
contactId: contactId,
type: const Value(MessageActionType.openedAt),
actionAt: Value(ts),
),
);
final isOpenedByAll = await haveAllMembers(
messageId,
MessageActionType.openedAt,
);
await (update(
messages,
)..where((tbl) => tbl.messageId.equals(messageId))).write(
MessagesCompanion(
openedAt: Value(ts),
openedByAll: Value(isOpenedByAll ? ts : null),
),
);
});
// Read-back verification: confirm the write was persisted.
final verified = await getMessageById(messageId).getSingleOrNull();
if (verified != null && verified.openedAt == null) {
Log.warn(
'handleMessagesOpened read-back failed for $messageId, retrying',
);
await (update(
messages,
)..where((tbl) => tbl.messageId.equals(messageId))).write(
MessagesCompanion(
openedAt: Value(actionTimestamp),
),
);
}
Log.info(
'handleMessagesOpened completed for message $messageId',
await batch((batch) async {
for (final messageId in messageIds) {
batch.insert(
messageActions,
MessageActionsCompanion(
messageId: Value(messageId),
contactId: Value(contactId),
type: const Value(MessageActionType.openedAt),
actionAt: Value(timestamp),
),
mode: InsertMode.insertOrReplace,
);
} catch (e) {
Log.error('handleMessagesOpened failed for $messageId: $e');
}
}
for (final messageId in messageIds) {
final isOpenedByAll = await haveAllMembers(
messageId,
MessageActionType.openedAt,
);
final now = clock.now();
batch.update(
twonlyDB.messages,
MessagesCompanion(
openedAt: Value(now),
openedByAll: Value(isOpenedByAll ? now : null),
),
where: (tbl) => tbl.messageId.equals(messageId),
);
}
});
}
Future<void> handleMessageAckByServer(
@ -327,67 +291,57 @@ class MessagesDao extends DatabaseAccessor<TwonlyDB> with _$MessagesDaoMixin {
String messageId,
DateTime timestamp,
) async {
await transaction(() async {
await into(messageActions).insertOnConflictUpdate(
MessageActionsCompanion(
messageId: Value(messageId),
contactId: Value(contactId),
type: const Value(MessageActionType.ackByServerAt),
actionAt: Value(timestamp),
),
);
await twonlyDB.messagesDao.updateMessageId(
messageId,
MessagesCompanion(ackByServer: Value(timestamp)),
);
});
await into(messageActions).insertOnConflictUpdate(
MessageActionsCompanion(
messageId: Value(messageId),
contactId: Value(contactId),
type: const Value(MessageActionType.ackByServerAt),
actionAt: Value(timestamp),
),
);
await twonlyDB.messagesDao.updateMessageId(
messageId,
MessagesCompanion(ackByServer: Value(clock.now())),
);
}
Future<bool> haveAllMembers(
String messageId,
MessageActionType action,
) async {
try {
final message = await twonlyDB.messagesDao
.getMessageById(messageId)
.getSingleOrNull();
if (message == null) return true;
final members = await twonlyDB.groupsDao.getGroupNonLeftMembers(
message.groupId,
);
final message = await twonlyDB.messagesDao
.getMessageById(messageId)
.getSingleOrNull();
if (message == null) return true;
final members = await twonlyDB.groupsDao.getGroupNonLeftMembers(
message.groupId,
);
final actions =
await (select(messageActions)..where(
(t) =>
t.type.equals(action.name) & t.messageId.equals(messageId),
))
.get();
final actions =
await (select(messageActions)..where(
(t) => t.type.equals(action.name) & t.messageId.equals(messageId),
))
.get();
return members.length == actions.length;
} catch (e) {
Log.error(e);
return true;
}
return members.length == actions.length;
}
Future<void> updateMessageId(
String messageId,
MessagesCompanion updatedValues,
) async {
final count = await (update(
await (update(
messages,
)..where((c) => c.messageId.equals(messageId))).write(updatedValues);
Log.info('Updated $count message(s) with messageId $messageId');
}
Future<void> updateMessagesByMediaId(
String mediaId,
MessagesCompanion updatedValues,
) async {
final count = await (update(
) {
return (update(
messages,
)..where((c) => c.mediaId.equals(mediaId))).write(updatedValues);
Log.info('Updated $count message(s) with mediaId $mediaId');
}
Future<Message?> insertMessage(MessagesCompanion message) async {

View file

@ -29,14 +29,7 @@ class ReactionsDao extends DatabaseAccessor<TwonlyDB> with _$ReactionsDaoMixin {
final msg = await twonlyDB.messagesDao
.getMessageById(messageId)
.getSingleOrNull();
if (msg == null) {
Log.error('updateReaction: Message $messageId not found!');
return;
}
if (msg.groupId != groupId) {
Log.error('updateReaction: Message groupId ${msg.groupId} != $groupId');
return;
}
if (msg == null || msg.groupId != groupId) return;
try {
if (remove) {

View file

@ -191,23 +191,6 @@ class ReceiptsDao extends DatabaseAccessor<TwonlyDB> with _$ReceiptsDaoMixin {
)..where((c) => c.receiptId.equals(receiptId))).write(updates);
}
Future<Receipt?> rotateReceiptId(String oldReceiptId) async {
final newReceiptId = uuid.v4();
await updateReceipt(
oldReceiptId,
ReceiptsCompanion(
receiptId: Value(newReceiptId),
),
);
final updatedReceipt = await getReceiptById(newReceiptId);
if (updatedReceipt == null) {
Log.error(
'Tried to change the receipt ID, but could not get the updated receipt...',
);
}
return updatedReceipt;
}
Future<void> updateReceiptByContactAndMessageId(
int contactId,
String messageId,

View file

@ -1,79 +0,0 @@
import 'package:drift/drift.dart';
import 'package:twonly/src/database/tables/shortcuts.table.dart';
import 'package:twonly/src/database/twonly.db.dart';
part 'shortcuts.dao.g.dart';
@DriftAccessor(
tables: [
Shortcuts,
ShortcutMembers,
],
)
class ShortcutsDao extends DatabaseAccessor<TwonlyDB> with _$ShortcutsDaoMixin {
ShortcutsDao(super.db);
Stream<List<Shortcut>> watchAllShortcuts() {
return select(shortcuts).watch();
}
Future<Shortcut?> getShortcutByEmoji(String emoji) {
return (select(
shortcuts,
)..where((t) => t.emoji.equals(emoji))).getSingleOrNull();
}
Future<void> createShortcut(String emoji) async {
try {
await into(shortcuts).insert(
ShortcutsCompanion.insert(emoji: emoji),
);
// ignore: empty_catches
} catch (e) {}
}
Future<void> addShortcutMembers(int shortcutId, List<String> groupIds) async {
await batch((b) {
b.insertAll(
shortcutMembers,
groupIds.map(
(gId) => ShortcutMembersCompanion.insert(
shortcutId: shortcutId,
groupId: gId,
),
),
);
});
}
Future<List<ShortcutMember>> getShortcutMembers(int shortcutId) {
return (select(
shortcutMembers,
)..where((t) => t.shortcutId.equals(shortcutId))).get();
}
Future<void> incrementUsage(int shortcutId) async {
await customStatement(
'UPDATE shortcuts SET usage_counter = usage_counter + 1 WHERE id = ?',
[shortcutId],
);
// Notify updates to trigger streams
notifyUpdates({TableUpdate.onTable(shortcuts, kind: UpdateKind.update)});
}
Future<void> updateShortcut(int shortcutId, String emoji) async {
await (update(shortcuts)..where((t) => t.id.equals(shortcutId))).write(
ShortcutsCompanion(emoji: Value(emoji)),
);
}
Future<void> deleteShortcutMembers(int shortcutId) async {
await (delete(
shortcutMembers,
)..where((t) => t.shortcutId.equals(shortcutId))).go();
}
Future<void> deleteShortcut(int shortcutId) async {
await (delete(shortcuts)..where((t) => t.id.equals(shortcutId))).go();
}
}

View file

@ -1,25 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'shortcuts.dao.dart';
// ignore_for_file: type=lint
mixin _$ShortcutsDaoMixin on DatabaseAccessor<TwonlyDB> {
$ShortcutsTable get shortcuts => attachedDatabase.shortcuts;
$GroupsTable get groups => attachedDatabase.groups;
$ShortcutMembersTable get shortcutMembers => attachedDatabase.shortcutMembers;
ShortcutsDaoManager get managers => ShortcutsDaoManager(this);
}
class ShortcutsDaoManager {
final _$ShortcutsDaoMixin _db;
ShortcutsDaoManager(this._db);
$$ShortcutsTableTableManager get shortcuts =>
$$ShortcutsTableTableManager(_db.attachedDatabase, _db.shortcuts);
$$GroupsTableTableManager get groups =>
$$GroupsTableTableManager(_db.attachedDatabase, _db.groups);
$$ShortcutMembersTableTableManager get shortcutMembers =>
$$ShortcutMembersTableTableManager(
_db.attachedDatabase,
_db.shortcutMembers,
);
}

View file

@ -228,12 +228,6 @@ class UserDiscoveryDao extends DatabaseAccessor<TwonlyDB>
);
}
Future<UserDiscoveryAnnouncedUser?> getAnnouncedUserById(int id) async {
return (select(
userDiscoveryAnnouncedUsers,
)..where((tbl) => tbl.announcedUserId.equals(id))).getSingleOrNull();
}
Stream<List<UserDiscoveryAnnouncedUser>> watchAllAnnouncedUsers() =>
select(userDiscoveryAnnouncedUsers).watch();

View file

@ -1,164 +0,0 @@
import 'dart:async';
import 'package:drift/drift.dart';
import 'package:twonly/locator.dart';
import 'package:twonly/src/utils/log.dart';
class DriftLoggingInterceptor extends QueryInterceptor {
bool get _isEnabled {
try {
if (!userService.isUserCreated) return false;
return userService.currentUser.enableDatabaseLogging;
} catch (_) {
return false;
}
}
List<String> _findUuids(dynamic value) {
if (value == null) return const [];
final uuids = <String>[];
final uuidRegex = RegExp(
'[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}',
);
if (value is String) {
for (final match in uuidRegex.allMatches(value)) {
uuids.add(match.group(0)!);
}
} else if (value is Iterable) {
for (final element in value) {
uuids.addAll(_findUuids(element));
}
} else if (value is Map) {
for (final element in value.values) {
uuids.addAll(_findUuids(element));
}
} else {
final str = value.toString();
for (final match in uuidRegex.allMatches(str)) {
uuids.add(match.group(0)!);
}
}
return uuids.toSet().toList();
}
Future<T> _run<T>(
String operation,
String statement,
List<Object?> args,
Future<T> Function() query,
) async {
if (!_isEnabled) {
return query();
}
final stopwatch = Stopwatch()..start();
try {
final result = await query();
final elapsed = stopwatch.elapsedMilliseconds;
final uuids = _findUuids(args);
if (uuids.isNotEmpty) {
Log.info(
'[DriftDB] $operation succeeded in ${elapsed}ms: "$statement" | UUIDs: $uuids',
);
} else {
Log.info(
'[DriftDB] $operation succeeded in ${elapsed}ms: "$statement"',
);
}
return result;
} catch (e) {
final elapsed = stopwatch.elapsedMilliseconds;
final uuids = _findUuids(args);
if (uuids.isNotEmpty) {
Log.info(
'[DriftDB] $operation failed after ${elapsed}ms ($e): "$statement" | UUIDs: $uuids',
);
} else {
Log.info(
'[DriftDB] $operation failed after ${elapsed}ms ($e): "$statement"',
);
}
rethrow;
}
}
@override
Future<int> runInsert(
QueryExecutor executor,
String statement,
List<Object?> args,
) {
return _run('INSERT', statement, args, () => executor.runInsert(statement, args));
}
@override
Future<int> runUpdate(
QueryExecutor executor,
String statement,
List<Object?> args,
) {
return _run('UPDATE', statement, args, () => executor.runUpdate(statement, args));
}
@override
Future<int> runDelete(
QueryExecutor executor,
String statement,
List<Object?> args,
) {
return _run('DELETE', statement, args, () => executor.runDelete(statement, args));
}
@override
Future<void> runCustom(
QueryExecutor executor,
String statement,
List<Object?> args,
) {
return _run('CUSTOM', statement, args, () => executor.runCustom(statement, args));
}
@override
Future<void> runBatched(
QueryExecutor executor,
BatchedStatements statements,
) async {
if (!_isEnabled) {
return executor.runBatched(statements);
}
final stopwatch = Stopwatch()..start();
try {
await executor.runBatched(statements);
final elapsed = stopwatch.elapsedMilliseconds;
final uuids = <String>[];
for (final batchArg in statements.arguments) {
uuids.addAll(_findUuids(batchArg.arguments));
}
final statementsStr = statements.statements.join('; ');
if (uuids.isNotEmpty) {
Log.info(
'[DriftDB] BATCH succeeded in ${elapsed}ms: "$statementsStr" | UUIDs: $uuids',
);
} else {
Log.info(
'[DriftDB] BATCH succeeded in ${elapsed}ms: "$statementsStr"',
);
}
} catch (e) {
final elapsed = stopwatch.elapsedMilliseconds;
final uuids = <String>[];
for (final batchArg in statements.arguments) {
uuids.addAll(_findUuids(batchArg.arguments));
}
final statementsStr = statements.statements.join('; ');
if (uuids.isNotEmpty) {
Log.info(
'[DriftDB] BATCH failed after ${elapsed}ms ($e): "$statementsStr" | UUIDs: $uuids',
);
} else {
Log.info(
'[DriftDB] BATCH failed after ${elapsed}ms ($e): "$statementsStr"',
);
}
rethrow;
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,50 +1,59 @@
import 'dart:collection';
import 'dart:convert';
import 'package:drift/drift.dart';
import 'dart:typed_data';
import 'package:libsignal_protocol_dart/libsignal_protocol_dart.dart';
import 'package:twonly/locator.dart';
import 'package:twonly/src/database/twonly.db.dart';
import 'package:twonly/src/utils/log.dart';
import 'package:twonly/src/constants/secure_storage.keys.dart';
import 'package:twonly/src/utils/secure_storage.dart';
Future<HashMap<int, Uint8List>> getSignalSignedPreKeyStoreOld() async {
final storeSerialized = await SecureStorage.instance.read(
key: 'signed_pre_key_store',
);
final store = HashMap<int, Uint8List>();
if (storeSerialized == null) {
class SignalSignedPreKeyStore extends SignedPreKeyStore {
Future<HashMap<int, Uint8List>> getStore() async {
final storeSerialized = await SecureStorage.instance.read(
key: SecureStorageKeys.signalSignedPreKey,
);
final store = HashMap<int, Uint8List>();
if (storeSerialized == null) {
return store;
}
final storeHashMap = json.decode(storeSerialized) as List<dynamic>;
for (final item in storeHashMap) {
// ignore: avoid_dynamic_calls
store[item[0] as int] = base64Decode(item[1] as String);
}
return store;
}
final storeHashMap = json.decode(storeSerialized) as List<dynamic>;
for (final item in storeHashMap) {
// ignore: avoid_dynamic_calls
store[item[0] as int] = base64Decode(item[1] as String);
}
return store;
}
class SignalSignedPreKeyStore extends SignedPreKeyStore {
Future<void> safeStore(HashMap<int, Uint8List> store) async {
final storeHashMap = <List<dynamic>>[];
for (final item in store.entries) {
storeHashMap.add([item.key, base64Encode(item.value)]);
}
final storeSerialized = json.encode(storeHashMap);
await SecureStorage.instance.write(
key: SecureStorageKeys.signalSignedPreKey,
value: storeSerialized,
);
}
@override
Future<SignedPreKeyRecord> loadSignedPreKey(int signedPreKeyId) async {
final record = await (twonlyDB.select(
twonlyDB.signalSignedPreKeyStores,
)..where((tbl) => tbl.signedPreKeyId.equals(signedPreKeyId))).get();
if (record.isEmpty) {
final store = await getStore();
if (!store.containsKey(signedPreKeyId)) {
throw InvalidKeyIdException(
'No such signed prekey record! $signedPreKeyId',
);
}
return SignedPreKeyRecord.fromSerialized(record.first.signedPreKey);
return SignedPreKeyRecord.fromSerialized(store[signedPreKeyId]!);
}
@override
Future<List<SignedPreKeyRecord>> loadSignedPreKeys() async {
final records = await twonlyDB
.select(twonlyDB.signalSignedPreKeyStores)
.get();
return records
.map((r) => SignedPreKeyRecord.fromSerialized(r.signedPreKey))
.toList();
final store = await getStore();
final results = <SignedPreKeyRecord>[];
for (final serialized in store.values) {
results.add(SignedPreKeyRecord.fromSerialized(serialized));
}
return results;
}
@override
@ -52,32 +61,19 @@ class SignalSignedPreKeyStore extends SignedPreKeyStore {
int signedPreKeyId,
SignedPreKeyRecord record,
) async {
final companion = SignalSignedPreKeyStoresCompanion(
signedPreKeyId: Value(signedPreKeyId),
signedPreKey: Value(record.serialize()),
);
try {
await twonlyDB
.into(twonlyDB.signalSignedPreKeyStores)
.insert(companion, mode: InsertMode.insertOrReplace);
} catch (e) {
Log.error('$e');
}
final store = await getStore();
store[signedPreKeyId] = record.serialize();
await safeStore(store);
}
@override
Future<bool> containsSignedPreKey(int signedPreKeyId) async {
final record = await (twonlyDB.select(
twonlyDB.signalSignedPreKeyStores,
)..where((tbl) => tbl.signedPreKeyId.equals(signedPreKeyId))).get();
return record.isNotEmpty;
}
Future<bool> containsSignedPreKey(int signedPreKeyId) async =>
(await getStore()).containsKey(signedPreKeyId);
@override
Future<void> removeSignedPreKey(int signedPreKeyId) async {
await (twonlyDB.delete(
twonlyDB.signalSignedPreKeyStores,
)..where((tbl) => tbl.signedPreKeyId.equals(signedPreKeyId))).go();
final store = await getStore();
store.remove(signedPreKeyId);
await safeStore(store);
}
}

View file

@ -50,9 +50,6 @@ class MediaFiles extends Table {
BoolColumn get stored => boolean().withDefault(const Constant(false))();
BoolColumn get isDraftMedia => boolean().withDefault(const Constant(false))();
BoolColumn get isFavorite => boolean().withDefault(const Constant(false))();
BoolColumn get hasCropAnalyzed =>
boolean().withDefault(const Constant(false))();
IntColumn get preProgressingProcess => integer().nullable()();
@ -69,14 +66,7 @@ class MediaFiles extends Table {
BlobColumn get storedFileHash => blob().nullable()();
BoolColumn get hasThumbnail =>
boolean().withDefault(const Constant(false))();
IntColumn get sizeInBytes => integer().nullable()();
DateTimeColumn get createdAt => dateTime().withDefault(currentDateAndTime)();
TextColumn get createdAtMonth => text().nullable()();
@override
Set<Column> get primaryKey => {mediaId};

View file

@ -3,7 +3,7 @@ import 'package:twonly/src/database/tables/contacts.table.dart';
import 'package:twonly/src/database/tables/groups.table.dart';
import 'package:twonly/src/database/tables/mediafiles.table.dart';
enum MessageType { media, text, contacts, restoreFlameCounter, askAboutUser }
enum MessageType { media, text, contacts, restoreFlameCounter }
@DataClassName('Message')
class Messages extends Table {

View file

@ -1,26 +0,0 @@
import 'package:drift/drift.dart';
import 'package:twonly/src/database/tables/groups.table.dart';
@DataClassName('Shortcut')
class Shortcuts extends Table {
IntColumn get id => integer().autoIncrement()();
TextColumn get emoji => text().unique()();
IntColumn get usageCounter => integer().withDefault(const Constant(0))();
}
@DataClassName('ShortcutMember')
class ShortcutMembers extends Table {
IntColumn get shortcutId => integer().references(
Shortcuts,
#id,
onDelete: KeyAction.cascade,
)();
TextColumn get groupId => text().references(
Groups,
#groupId,
onDelete: KeyAction.cascade,
)();
@override
Set<Column> get primaryKey => {shortcutId, groupId};
}

View file

@ -1,11 +0,0 @@
import 'package:drift/drift.dart';
@DataClassName('SignalSignedPreKeyStore')
class SignalSignedPreKeyStores extends Table {
IntColumn get signedPreKeyId => integer()();
BlobColumn get signedPreKey => blob()();
DateTimeColumn get createdAt => dateTime().withDefault(currentDateAndTime)();
@override
Set<Column> get primaryKey => {signedPreKeyId};
}

View file

@ -16,8 +16,6 @@ class UserDiscoveryAnnouncedUsers extends Table {
BoolColumn get wasShownToTheUser =>
boolean().withDefault(const Constant(false))();
BoolColumn get isHidden => boolean().withDefault(const Constant(false))();
BoolColumn get wasAskedFriends =>
boolean().withDefault(const Constant(false))();
@override
Set<Column> get primaryKey => {announcedUserId};

View file

@ -1,8 +1,8 @@
import 'package:clock/clock.dart';
import 'package:drift/drift.dart';
import 'package:drift_flutter/drift_flutter.dart'
show DriftNativeOptions, driftDatabase;
import 'package:path_provider/path_provider.dart';
import 'package:twonly/locator.dart';
import 'package:twonly/src/database/daos/contacts.dao.dart';
import 'package:twonly/src/database/daos/groups.dao.dart';
import 'package:twonly/src/database/daos/key_verification.dao.dart';
@ -10,21 +10,17 @@ import 'package:twonly/src/database/daos/mediafiles.dao.dart';
import 'package:twonly/src/database/daos/messages.dao.dart';
import 'package:twonly/src/database/daos/reactions.dao.dart';
import 'package:twonly/src/database/daos/receipts.dao.dart';
import 'package:twonly/src/database/daos/shortcuts.dao.dart';
import 'package:twonly/src/database/daos/user_discovery.dao.dart';
import 'package:twonly/src/database/drift_logging_interceptor.dart';
import 'package:twonly/src/database/tables/contacts.table.dart';
import 'package:twonly/src/database/tables/groups.table.dart';
import 'package:twonly/src/database/tables/mediafiles.table.dart';
import 'package:twonly/src/database/tables/messages.table.dart';
import 'package:twonly/src/database/tables/reactions.table.dart';
import 'package:twonly/src/database/tables/receipts.table.dart';
import 'package:twonly/src/database/tables/shortcuts.table.dart';
import 'package:twonly/src/database/tables/signal_identity_key_store.table.dart';
import 'package:twonly/src/database/tables/signal_pre_key_store.table.dart';
import 'package:twonly/src/database/tables/signal_sender_key_store.table.dart';
import 'package:twonly/src/database/tables/signal_session_store.table.dart';
import 'package:twonly/src/database/tables/signal_signed_pre_key_store.table.dart';
import 'package:twonly/src/database/tables/user_discovery.table.dart';
import 'package:twonly/src/database/twonly.db.steps.dart';
import 'package:twonly/src/utils/log.dart';
@ -47,7 +43,6 @@ part 'twonly.db.g.dart';
SignalPreKeyStores,
SignalSenderKeyStores,
SignalSessionStores,
SignalSignedPreKeyStores,
MessageActions,
GroupHistories,
KeyVerifications,
@ -57,8 +52,6 @@ part 'twonly.db.g.dart';
UserDiscoveryOtherPromotions,
UserDiscoveryOwnPromotions,
UserDiscoveryShares,
Shortcuts,
ShortcutMembers,
],
daos: [
MessagesDao,
@ -69,7 +62,6 @@ part 'twonly.db.g.dart';
MediaFilesDao,
UserDiscoveryDao,
KeyVerificationDao,
ShortcutsDao,
],
)
class TwonlyDB extends _$TwonlyDB {
@ -82,29 +74,21 @@ class TwonlyDB extends _$TwonlyDB {
TwonlyDB.forTesting(DatabaseConnection super.connection);
@override
int get schemaVersion => 17;
int get schemaVersion => 12;
static QueryExecutor _openConnection() {
final connection = driftDatabase(
return driftDatabase(
name: 'twonly',
native: DriftNativeOptions(
databaseDirectory: getApplicationSupportDirectory,
shareAcrossIsolates: true,
setup: (rawDb) {
rawDb
..execute('PRAGMA journal_mode=DELETE;')
..execute('PRAGMA synchronous=FULL;')
..execute('PRAGMA journal_mode=WAL;')
..execute('PRAGMA busy_timeout=5000;');
},
),
);
try {
if (userService.isUserCreated &&
userService.currentUser.enableDatabaseLogging) {
return connection.interceptWith(DriftLoggingInterceptor());
}
} catch (_) {}
return connection;
}
@override
@ -202,37 +186,6 @@ class TwonlyDB extends _$TwonlyDB {
await m.addColumn(schema.contacts, column);
}
},
from12To13: (m, schema) async {
await m.createTable(schema.shortcuts);
await m.createTable(schema.shortcutMembers);
},
from13To14: (m, schema) async {
await m.addColumn(
schema.mediaFiles,
schema.mediaFiles.createdAtMonth,
);
await m.addColumn(schema.mediaFiles, schema.mediaFiles.isFavorite);
await m.addColumn(
schema.mediaFiles,
schema.mediaFiles.hasCropAnalyzed,
);
},
from14To15: (m, schema) async {
await m.createTable(schema.signalSignedPreKeyStores);
},
from15To16: (m, schema) async {
await m.addColumn(
schema.mediaFiles,
schema.mediaFiles.hasThumbnail,
);
await m.addColumn(schema.mediaFiles, schema.mediaFiles.sizeInBytes);
},
from16To17: (m, schema) async {
await m.addColumn(
schema.userDiscoveryAnnouncedUsers,
schema.userDiscoveryAnnouncedUsers.wasAskedFriends,
);
},
)(m, from, to);
},
);
@ -254,4 +207,38 @@ class TwonlyDB extends _$TwonlyDB {
Log.info('Table: $tableName, Size: $tableSize bytes');
}
}
Future<void> deleteDataForTwonlySafe() async {
await (delete(messages)..where(
(t) =>
(t.mediaStored.equals(false) &
t.isDeletedFromSender.equals(false)),
))
.go();
await update(messages).write(
const MessagesCompanion(
downloadToken: Value(null),
),
);
await (delete(mediaFiles)..where(
(t) => (t.stored.equals(false)),
))
.go();
await delete(receipts).go();
await delete(receivedReceipts).go();
await update(contacts).write(
const ContactsCompanion(
avatarSvgCompressed: Value(null),
senderProfileCounter: Value(0),
),
);
await (delete(signalPreKeyStores)..where(
(t) => (t.createdAt.isSmallerThanValue(
clock.now().subtract(
const Duration(days: 25),
),
)),
))
.go();
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -98,10 +98,16 @@ abstract class AppLocalizations {
Locale('en'),
];
/// No description provided for @registerTitle.
///
/// In en, this message translates to:
/// **'Welcome to twonly!'**
String get registerTitle;
/// No description provided for @registerSlogan.
///
/// In en, this message translates to:
/// **'Stay in touch with friends privately and securely.'**
/// **'twonly, a privacy friendly way to connect with friends through secure, spontaneous image sharing'**
String get registerSlogan;
/// No description provided for @onboardingWelcomeTitle.
@ -173,7 +179,7 @@ abstract class AppLocalizations {
/// No description provided for @registerUsernameSlogan.
///
/// In en, this message translates to:
/// **'Your public username'**
/// **'Please select a username so others can find you!'**
String get registerUsernameSlogan;
/// No description provided for @registerUsernameDecoration.
@ -185,7 +191,7 @@ abstract class AppLocalizations {
/// No description provided for @registerUsernameLimits.
///
/// In en, this message translates to:
/// **'At least 3 characters.'**
/// **'Your username must be at least 3 characters long.'**
String get registerUsernameLimits;
/// No description provided for @registerProofOfWorkFailed.
@ -476,18 +482,6 @@ abstract class AppLocalizations {
/// **'Preselected reaction emojis'**
String get settingsPreSelectedReactions;
/// No description provided for @settingsAutomaticallyMarkEqualMediaFilesAsOpenedTitle.
///
/// In en, this message translates to:
/// **'Mark duplicates as opened'**
String get settingsAutomaticallyMarkEqualMediaFilesAsOpenedTitle;
/// No description provided for @settingsAutomaticallyMarkEqualMediaFilesAsOpenedSubtitle.
///
/// In en, this message translates to:
/// **'If you receive the same media in multiple chats, opening one marks all others as opened.'**
String get settingsAutomaticallyMarkEqualMediaFilesAsOpenedSubtitle;
/// No description provided for @settingsPreSelectedReactionsError.
///
/// In en, this message translates to:
@ -536,36 +530,6 @@ abstract class AppLocalizations {
/// **'When using WI-FI'**
String get settingsStorageDataAutoDownWifi;
/// No description provided for @settingsStorageManageTitle.
///
/// In en, this message translates to:
/// **'Manage storage'**
String get settingsStorageManageTitle;
/// No description provided for @settingsStorageUsed.
///
/// In en, this message translates to:
/// **'Storage used'**
String get settingsStorageUsed;
/// No description provided for @settingsStorageImages.
///
/// In en, this message translates to:
/// **'Images'**
String get settingsStorageImages;
/// No description provided for @settingsStorageVideos.
///
/// In en, this message translates to:
/// **'Videos'**
String get settingsStorageVideos;
/// No description provided for @settingsStorageGifs.
///
/// In en, this message translates to:
/// **'GIFs'**
String get settingsStorageGifs;
/// No description provided for @settingsProfileCustomizeAvatar.
///
/// In en, this message translates to:
@ -626,72 +590,12 @@ abstract class AppLocalizations {
/// **'{len} contact(s)'**
String settingsPrivacyBlockUsersCount(Object len);
/// No description provided for @settingsPrivacyProfileSelectionTitle.
///
/// In en, this message translates to:
/// **'Security Profile'**
String get settingsPrivacyProfileSelectionTitle;
/// No description provided for @settingsPrivacyProfileSelectionDesc.
///
/// In en, this message translates to:
/// **'Choose your setup path and security configuration'**
String get settingsPrivacyProfileSelectionDesc;
/// No description provided for @securityProfileTitle.
///
/// In en, this message translates to:
/// **'Security Profile'**
String get securityProfileTitle;
/// No description provided for @securityProfileSubtitle.
///
/// In en, this message translates to:
/// **'Choose the level of protection that fits your daily use. This can be changed at any time in your settings.'**
String get securityProfileSubtitle;
/// No description provided for @securityProfileNormalTitle.
///
/// In en, this message translates to:
/// **'Normal Protection'**
String get securityProfileNormalTitle;
/// No description provided for @securityProfileNormalDesc.
///
/// In en, this message translates to:
/// **'Good balance between a convenient mode without bothering you too much.'**
String get securityProfileNormalDesc;
/// No description provided for @securityProfileStrictTitle.
///
/// In en, this message translates to:
/// **'Strict Protection'**
String get securityProfileStrictTitle;
/// No description provided for @securityProfileStrictDesc.
///
/// In en, this message translates to:
/// **'Maximum anti-phishing protection but may be inconvenient.'**
String get securityProfileStrictDesc;
/// No description provided for @settingsNotification.
///
/// In en, this message translates to:
/// **'Notification'**
String get settingsNotification;
/// No description provided for @settingsNotifyPermission.
///
/// In en, this message translates to:
/// **'Notification permissions'**
String get settingsNotifyPermission;
/// No description provided for @settingsNotifyPermissionDesc.
///
/// In en, this message translates to:
/// **'Open system settings to allow push notifications.'**
String get settingsNotifyPermissionDesc;
/// No description provided for @settingsNotifyTroubleshooting.
///
/// In en, this message translates to:
@ -959,8 +863,8 @@ abstract class AppLocalizations {
/// No description provided for @verificationTypeSecretQrToken.
///
/// In en, this message translates to:
/// **'{username} has scanned your QR code.'**
String verificationTypeSecretQrToken(Object username);
/// **'The other person scanned your QR code.'**
String get verificationTypeSecretQrToken;
/// No description provided for @verificationTypeLink.
///
@ -1262,6 +1166,12 @@ abstract class AppLocalizations {
/// **'The plan upgrade must be paid for annually, as the current plan is also billed annually.'**
String get errorPlanUpgradeNotYearly;
/// No description provided for @upgradeToPaidPlan.
///
/// In en, this message translates to:
/// **'Upgrade to a paid plan.'**
String get upgradeToPaidPlan;
/// No description provided for @upgradeToPaidPlanButton.
///
/// In en, this message translates to:
@ -1376,6 +1286,18 @@ abstract class AppLocalizations {
/// **'Open'**
String get open;
/// No description provided for @createVoucher.
///
/// In en, this message translates to:
/// **'Buy voucher'**
String get createVoucher;
/// No description provided for @redeemVoucher.
///
/// In en, this message translates to:
/// **'Redeem voucher'**
String get redeemVoucher;
/// No description provided for @buy.
///
/// In en, this message translates to:
@ -1400,6 +1322,12 @@ abstract class AppLocalizations {
/// **'Delete file'**
String get galleryDelete;
/// No description provided for @galleryDetails.
///
/// In en, this message translates to:
/// **'Show details'**
String get galleryDetails;
/// No description provided for @galleryExport.
///
/// In en, this message translates to:
@ -1412,36 +1340,6 @@ abstract class AppLocalizations {
/// **'Successfully saved in the Gallery.'**
String get galleryExportSuccess;
/// No description provided for @gallerySelectAll.
///
/// In en, this message translates to:
/// **'Select all'**
String get gallerySelectAll;
/// No description provided for @galleryDeselectAll.
///
/// In en, this message translates to:
/// **'Deselect all'**
String get galleryDeselectAll;
/// No description provided for @galleryFavorite.
///
/// In en, this message translates to:
/// **'Favorite'**
String get galleryFavorite;
/// No description provided for @galleryUnfavorite.
///
/// In en, this message translates to:
/// **'Unfavorite'**
String get galleryUnfavorite;
/// No description provided for @galleryCancel.
///
/// In en, this message translates to:
/// **'Cancel'**
String get galleryCancel;
/// No description provided for @memoriesEmpty.
///
/// In en, this message translates to:
@ -1460,12 +1358,6 @@ abstract class AppLocalizations {
/// **'Delete for all'**
String get deleteOkBtnForAll;
/// No description provided for @memoriesDeleteSnackbarSuccess.
///
/// In en, this message translates to:
/// **'{count, plural, =1 {Deleted 1 item successfully} other {Deleted {count} items successfully}}'**
String memoriesDeleteSnackbarSuccess(num count);
/// No description provided for @deleteOkBtnForMe.
///
/// In en, this message translates to:
@ -1484,12 +1376,6 @@ abstract class AppLocalizations {
/// **'The image will be irrevocably deleted.'**
String get deleteImageBody;
/// No description provided for @deleteMemoriesBody.
///
/// In en, this message translates to:
/// **'{count, plural, =1 {The image will be irrevocably deleted.} other {The {count} images will be irrevocably deleted.}}'**
String deleteMemoriesBody(num count);
/// No description provided for @settingsBackup.
///
/// In en, this message translates to:
@ -1526,17 +1412,23 @@ abstract class AppLocalizations {
/// **'Due to twonly\'s security system, there is (currently) no password recovery function. Therefore, you must remember your password or, better yet, write it down.'**
String get backupNoPasswordRecovery;
/// No description provided for @backupIdentityHeader.
/// No description provided for @backupServer.
///
/// In en, this message translates to:
/// **'Identity'**
String get backupIdentityHeader;
/// **'Server'**
String get backupServer;
/// No description provided for @backupArchiveHeader.
/// No description provided for @backupMaxBackupSize.
///
/// In en, this message translates to:
/// **'Contacts, Settings and Messages'**
String get backupArchiveHeader;
/// **'max. backup size'**
String get backupMaxBackupSize;
/// No description provided for @backupStorageRetention.
///
/// In en, this message translates to:
/// **'Storage retention'**
String get backupStorageRetention;
/// No description provided for @backupLastBackupDate.
///
@ -1556,6 +1448,12 @@ abstract class AppLocalizations {
/// **'Result'**
String get backupLastBackupResult;
/// No description provided for @backupData.
///
/// In en, this message translates to:
/// **'Data-Backup'**
String get backupData;
/// No description provided for @backupInsecurePassword.
///
/// In en, this message translates to:
@ -1613,15 +1511,39 @@ abstract class AppLocalizations {
/// No description provided for @backupPasswordRequirement.
///
/// In en, this message translates to:
/// **'Password must be at least 10 characters long.'**
/// **'Password must be at least 8 characters long.'**
String get backupPasswordRequirement;
/// No description provided for @backupExpertSettings.
///
/// In en, this message translates to:
/// **'Expert settings'**
String get backupExpertSettings;
/// No description provided for @backupEnableBackup.
///
/// In en, this message translates to:
/// **'Activate automatic backup'**
String get backupEnableBackup;
/// No description provided for @backupOwnServerDesc.
///
/// In en, this message translates to:
/// **'Save your twonly Backup at twonly or on any server of your choice.'**
String get backupOwnServerDesc;
/// No description provided for @backupUseOwnServer.
///
/// In en, this message translates to:
/// **'Use server'**
String get backupUseOwnServer;
/// No description provided for @backupResetServer.
///
/// In en, this message translates to:
/// **'Use standard server'**
String get backupResetServer;
/// No description provided for @backupTwonlySaveNow.
///
/// In en, this message translates to:
@ -1637,9 +1559,15 @@ abstract class AppLocalizations {
/// No description provided for @twonlySafeRecoverTitle.
///
/// In en, this message translates to:
/// **'Restore backup'**
/// **'Recovery'**
String get twonlySafeRecoverTitle;
/// No description provided for @twonlySafeRecoverDesc.
///
/// In en, this message translates to:
/// **'If you have created a backup with twonly Backup, you can restore it here.'**
String get twonlySafeRecoverDesc;
/// No description provided for @twonlySafeRecoverBtn.
///
/// In en, this message translates to:
@ -2402,11 +2330,11 @@ abstract class AppLocalizations {
/// **'Open your own QR code'**
String get openYourOwnQRcode;
/// No description provided for @addContactQrSheetSubtext.
/// No description provided for @skipForNow.
///
/// In en, this message translates to:
/// **'Let a friend scan this QR code to add you'**
String get addContactQrSheetSubtext;
/// **'Skip for now'**
String get skipForNow;
/// No description provided for @finishSetupCardTitle.
///
@ -2426,24 +2354,6 @@ abstract class AppLocalizations {
/// **'Resume Setup'**
String get finishSetupCardAction;
/// No description provided for @missingBackupCardTitle.
///
/// In en, this message translates to:
/// **'Setup backup'**
String get missingBackupCardTitle;
/// No description provided for @missingBackupCardDesc.
///
/// In en, this message translates to:
/// **'We have improved the backup mechanism, which requires you to set it up again.'**
String get missingBackupCardDesc;
/// No description provided for @missingBackupCardAction.
///
/// In en, this message translates to:
/// **'Set up now'**
String get missingBackupCardAction;
/// No description provided for @onboardingFinishLater.
///
/// In en, this message translates to:
@ -2501,13 +2411,13 @@ abstract class AppLocalizations {
/// No description provided for @userDiscoverySettingsManualApproval.
///
/// In en, this message translates to:
/// **'Ask every time before sharing'**
/// **'Manual approval'**
String get userDiscoverySettingsManualApproval;
/// No description provided for @userDiscoverySettingsManualApprovalDesc.
///
/// In en, this message translates to:
/// **'Before one of your friends is shared, you will be asked every time.'**
/// **'Before someone is shared, you\'ll be asked first.'**
String get userDiscoverySettingsManualApprovalDesc;
/// No description provided for @onboardingUserDiscoveryLetFriendsFindYou.
@ -2765,7 +2675,7 @@ abstract class AppLocalizations {
/// No description provided for @verificationBadgeGeneralDesc.
///
/// In en, this message translates to:
/// **'The checkmark gives you the certainty that you are messaging the right person. You can verify contacts at any time by scanning their QR code.'**
/// **'The checkmark gives you the certainty that you are messaging the right person. Scan the contact\'s QR code to verify it.'**
String get verificationBadgeGeneralDesc;
/// No description provided for @verificationBadgeGreenDesc.
@ -2786,36 +2696,6 @@ abstract class AppLocalizations {
/// **'A contact whose identity has *not* yet been verified.'**
String get verificationBadgeRedDesc;
/// No description provided for @deleteVerificationTitle.
///
/// In en, this message translates to:
/// **'Delete verification?'**
String get deleteVerificationTitle;
/// No description provided for @deleteVerificationBody.
///
/// In en, this message translates to:
/// **'Are you sure you want to delete this verification?'**
String get deleteVerificationBody;
/// No description provided for @secretQrTokenVerifiedSnackbar.
///
/// In en, this message translates to:
/// **'{username} has scanned your QR code and is now verified.'**
String secretQrTokenVerifiedSnackbar(Object username);
/// No description provided for @mutualGroupsTitle.
///
/// In en, this message translates to:
/// **'{count, plural, =1{1 mutual group} other{{count} mutual groups}}'**
String mutualGroupsTitle(num count);
/// No description provided for @mutualGroupsSentMessages.
///
/// In en, this message translates to:
/// **'{count, plural, =1{1 message sent} other{{count} messages sent}}'**
String mutualGroupsSentMessages(num count);
/// No description provided for @chatEntryFlameRestored.
///
/// In en, this message translates to:
@ -2948,18 +2828,6 @@ abstract class AppLocalizations {
/// **'Mutual Friends'**
String get userDiscoverySettingsTitle;
/// No description provided for @userDiscoveryWhyThisIsUsed.
///
/// In en, this message translates to:
/// **'Why this is used'**
String get userDiscoveryWhyThisIsUsed;
/// No description provided for @userDiscoveryFeatureOffers.
///
/// In en, this message translates to:
/// **'Your benefits at a glance'**
String get userDiscoveryFeatureOffers;
/// No description provided for @userDiscoveryDisabledLearnMore.
///
/// In en, this message translates to:
@ -3032,66 +2900,6 @@ abstract class AppLocalizations {
/// **'Request'**
String get friendSuggestionsRequest;
/// No description provided for @friendSuggestionsAskFriend.
///
/// In en, this message translates to:
/// **'Ask your friends'**
String get friendSuggestionsAskFriend;
/// No description provided for @askFriendsDialogTitle.
///
/// In en, this message translates to:
/// **'Ask about {username}'**
String askFriendsDialogTitle(Object username);
/// No description provided for @askFriendsDialogDescription.
///
/// In en, this message translates to:
/// **'Select the friends you want to ask about this user:'**
String get askFriendsDialogDescription;
/// No description provided for @askFriendsDialogConfirm.
///
/// In en, this message translates to:
/// **'Ask'**
String get askFriendsDialogConfirm;
/// No description provided for @askFriendsDialogCancel.
///
/// In en, this message translates to:
/// **'Cancel'**
String get askFriendsDialogCancel;
/// No description provided for @chatAskAFriendReceivedDescription.
///
/// In en, this message translates to:
/// **'Your friend just got this as a suggestion and wants to know if he knows this person.'**
String get chatAskAFriendReceivedDescription;
/// No description provided for @chatAskAFriendAddedDescription.
///
/// In en, this message translates to:
/// **'You have added this user to your contacts.'**
String get chatAskAFriendAddedDescription;
/// No description provided for @chatAskAFriendHide.
///
/// In en, this message translates to:
/// **'Hide'**
String get chatAskAFriendHide;
/// No description provided for @chatAskAFriendRequest.
///
/// In en, this message translates to:
/// **'Request'**
String get chatAskAFriendRequest;
/// No description provided for @chatAskAFriendUnknownUser.
///
/// In en, this message translates to:
/// **'User {userId}'**
String chatAskAFriendUnknownUser(Object userId);
/// No description provided for @contactUserDiscoveryImagesLeft.
///
/// In en, this message translates to:
@ -3253,442 +3061,6 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'{maker} changed their display name from {oldName} to {newName}.'**
String makerChangedDisplayName(Object maker, Object oldName, Object newName);
/// No description provided for @recoverErrorNoInternet.
///
/// In en, this message translates to:
/// **'No internet connection. Please check your network and try again.'**
String get recoverErrorNoInternet;
/// No description provided for @recoverErrorUsernameNotValid.
///
/// In en, this message translates to:
/// **'The username provided is not valid or does not exist.'**
String get recoverErrorUsernameNotValid;
/// No description provided for @recoverErrorPasswordInvalid.
///
/// In en, this message translates to:
/// **'The password provided is incorrect.'**
String get recoverErrorPasswordInvalid;
/// No description provided for @recoverErrorTryAgainLater.
///
/// In en, this message translates to:
/// **'The server is currently unavailable. Please try again later.'**
String get recoverErrorTryAgainLater;
/// No description provided for @recoverErrorUnknown.
///
/// In en, this message translates to:
/// **'An unknown error occurred. Please try again.'**
String get recoverErrorUnknown;
/// No description provided for @recoverSuccessTitle.
///
/// In en, this message translates to:
/// **'Backup successfully recovered.'**
String get recoverSuccessTitle;
/// No description provided for @recoverSuccessBody.
///
/// In en, this message translates to:
/// **'Click here to open the app again'**
String get recoverSuccessBody;
/// No description provided for @iosRecoveryWelcomeBack.
///
/// In en, this message translates to:
/// **'Welcome Back'**
String get iosRecoveryWelcomeBack;
/// No description provided for @iosRecoveryPrompt.
///
/// In en, this message translates to:
/// **'We detected a previously secured twonly identity on this device. Would you like to automatically download and restore your contacts, messages, and settings from your cloud archive?'**
String get iosRecoveryPrompt;
/// No description provided for @iosRecoveryNoBackupFound.
///
/// In en, this message translates to:
/// **'No backup archive could be retrieved from the server for this device.\n\nError: {error}\n\nPlease proceed to register a new twonly account.'**
String iosRecoveryNoBackupFound(Object error);
/// No description provided for @registerNewAccount.
///
/// In en, this message translates to:
/// **'Register New Account'**
String get registerNewAccount;
/// No description provided for @tryRestoreAgain.
///
/// In en, this message translates to:
/// **'Try Restore Again'**
String get tryRestoreAgain;
/// No description provided for @registeringNewAccount.
///
/// In en, this message translates to:
/// **'Registering new account'**
String get registeringNewAccount;
/// No description provided for @createShortcut.
///
/// In en, this message translates to:
/// **'Create shortcut'**
String get createShortcut;
/// No description provided for @editShortcut.
///
/// In en, this message translates to:
/// **'Edit shortcut'**
String get editShortcut;
/// No description provided for @deleteShortcut.
///
/// In en, this message translates to:
/// **'Delete shortcut'**
String get deleteShortcut;
/// No description provided for @deleteShortcutBody.
///
/// In en, this message translates to:
/// **'Are you sure you want to delete this shortcut?'**
String get deleteShortcutBody;
/// No description provided for @updateShortcut.
///
/// In en, this message translates to:
/// **'Update shortcut'**
String get updateShortcut;
/// No description provided for @selectEmoji.
///
/// In en, this message translates to:
/// **'Select Emoji'**
String get selectEmoji;
/// No description provided for @errorEmojiUsedOrInvalid.
///
/// In en, this message translates to:
/// **'Emoji already used or invalid'**
String get errorEmojiUsedOrInvalid;
/// No description provided for @subscriptionPledgeSecureTitle.
///
/// In en, this message translates to:
/// **'Secure by Design'**
String get subscriptionPledgeSecureTitle;
/// No description provided for @subscriptionPledgeSecureDesc.
///
/// In en, this message translates to:
/// **'Your messages and shared moments are fully end-to-end encrypted.'**
String get subscriptionPledgeSecureDesc;
/// No description provided for @subscriptionPledgeNoAdsTitle.
///
/// In en, this message translates to:
/// **'No Ads or Data selling'**
String get subscriptionPledgeNoAdsTitle;
/// No description provided for @subscriptionPledgeNoAdsDesc.
///
/// In en, this message translates to:
/// **'twonly will never show advertisements or sell your private data.'**
String get subscriptionPledgeNoAdsDesc;
/// No description provided for @subscriptionPledgeSubtitle.
///
/// In en, this message translates to:
/// **'Zero ads. Total privacy.'**
String get subscriptionPledgeSubtitle;
/// No description provided for @dragToZoom.
///
/// In en, this message translates to:
/// **'Drag to Zoom'**
String get dragToZoom;
/// No description provided for @showUsername.
///
/// In en, this message translates to:
/// **'Show username'**
String get showUsername;
/// No description provided for @onboardingProfileSelectionTitle.
///
/// In en, this message translates to:
/// **'Choose your setup path'**
String get onboardingProfileSelectionTitle;
/// No description provided for @onboardingProfileSelectionSubtitle.
///
/// In en, this message translates to:
/// **'Choose how you want to configure your security and privacy settings.'**
String get onboardingProfileSelectionSubtitle;
/// No description provided for @onboardingProfileSelectionDefaultTitle.
///
/// In en, this message translates to:
/// **'Default'**
String get onboardingProfileSelectionDefaultTitle;
/// No description provided for @onboardingProfileSelectionDefaultDesc.
///
/// In en, this message translates to:
/// **'Instantly applies recommended settings so you can start using the app.'**
String get onboardingProfileSelectionDefaultDesc;
/// No description provided for @onboardingProfileSelectionDefaultBadge.
///
/// In en, this message translates to:
/// **'Fast Setup'**
String get onboardingProfileSelectionDefaultBadge;
/// No description provided for @onboardingProfileSelectionCustomizeTitle.
///
/// In en, this message translates to:
/// **'Customize'**
String get onboardingProfileSelectionCustomizeTitle;
/// No description provided for @onboardingProfileSelectionCustomizeDesc.
///
/// In en, this message translates to:
/// **'Step-by-step setup so you can decide for yourself.'**
String get onboardingProfileSelectionCustomizeDesc;
/// No description provided for @onboardingProfileSelectionStrictTitle.
///
/// In en, this message translates to:
/// **'Enhanced Protection'**
String get onboardingProfileSelectionStrictTitle;
/// No description provided for @onboardingProfileSelectionStrictDesc.
///
/// In en, this message translates to:
/// **'Maximum anti-phishing defense. Recommended for *journalists & public figures*.'**
String get onboardingProfileSelectionStrictDesc;
/// No description provided for @replyFlameRestored.
///
/// In en, this message translates to:
/// **'Flames restored'**
String get replyFlameRestored;
/// No description provided for @replyAskAFriend.
///
/// In en, this message translates to:
/// **'Ask a friend'**
String get replyAskAFriend;
/// No description provided for @unverifiedWarningDirectTitle.
///
/// In en, this message translates to:
/// **'Identity not verified in person'**
String get unverifiedWarningDirectTitle;
/// No description provided for @unverifiedWarningGroupTitle.
///
/// In en, this message translates to:
/// **'Not all members are verified in person'**
String get unverifiedWarningGroupTitle;
/// No description provided for @unverifiedWarningBody.
///
/// In en, this message translates to:
/// **'*Avoid sharing sensitive data*. Risk of *impersonation* without manual verification.'**
String get unverifiedWarningBody;
/// No description provided for @unverifiedWarningButton.
///
/// In en, this message translates to:
/// **'Verify now'**
String get unverifiedWarningButton;
/// No description provided for @today.
///
/// In en, this message translates to:
/// **'Today'**
String get today;
/// No description provided for @yesterday.
///
/// In en, this message translates to:
/// **'Yesterday'**
String get yesterday;
/// No description provided for @galleryDisableWarningTitle.
///
/// In en, this message translates to:
/// **'Disable gallery saving?'**
String get galleryDisableWarningTitle;
/// No description provided for @galleryDisableWarningBody.
///
/// In en, this message translates to:
/// **'If you disable this, your media files will not be saved to your gallery and could be permanently lost if twonly is removed or has an issue, as media files are not yet backed up.'**
String get galleryDisableWarningBody;
/// No description provided for @galleryDisableWarningConfirm.
///
/// In en, this message translates to:
/// **'Disable'**
String get galleryDisableWarningConfirm;
/// No description provided for @settingsStorageScanGalleryTitle.
///
/// In en, this message translates to:
/// **'Import from Gallery'**
String get settingsStorageScanGalleryTitle;
/// No description provided for @importGalleryDeselectAll.
///
/// In en, this message translates to:
/// **'Deselect all'**
String get importGalleryDeselectAll;
/// No description provided for @importGallerySelectAll.
///
/// In en, this message translates to:
/// **'Select all'**
String get importGallerySelectAll;
/// No description provided for @importGalleryPermissionRequired.
///
/// In en, this message translates to:
/// **'Permission to access your gallery is required to import previous twonly media files.'**
String get importGalleryPermissionRequired;
/// No description provided for @importGalleryPermissionError.
///
/// In en, this message translates to:
/// **'An error occurred while requesting permission: {error}'**
String importGalleryPermissionError(Object error);
/// No description provided for @importGalleryLoadError.
///
/// In en, this message translates to:
/// **'Failed to load assets: {error}'**
String importGalleryLoadError(Object error);
/// No description provided for @importGalleryImportingOf.
///
/// In en, this message translates to:
/// **'Importing {current} of {total}...'**
String importGalleryImportingOf(Object current, Object total);
/// No description provided for @importGalleryStarting.
///
/// In en, this message translates to:
/// **'Starting import...'**
String get importGalleryStarting;
/// No description provided for @importGalleryComplete.
///
/// In en, this message translates to:
/// **'Import complete: {imported} successfully imported, {duplicated} duplicated and {failed} failed.'**
String importGalleryComplete(
Object imported,
Object duplicated,
Object failed,
);
/// No description provided for @importGalleryGrantAccess.
///
/// In en, this message translates to:
/// **'Grant Access'**
String get importGalleryGrantAccess;
/// No description provided for @importGalleryOpenSettings.
///
/// In en, this message translates to:
/// **'Open Settings'**
String get importGalleryOpenSettings;
/// No description provided for @importGalleryPermissionDenied.
///
/// In en, this message translates to:
/// **'Permission to access gallery denied.'**
String get importGalleryPermissionDenied;
/// No description provided for @importGalleryTryAgain.
///
/// In en, this message translates to:
/// **'Try Again'**
String get importGalleryTryAgain;
/// No description provided for @importGalleryAlbumNotFound.
///
/// In en, this message translates to:
/// **'\"twonly\" album not found'**
String get importGalleryAlbumNotFound;
/// No description provided for @importGalleryAlbumNotFoundDesc.
///
/// In en, this message translates to:
/// **'If you don\'t have this album yet, you can also create it to import photos into twonly.'**
String get importGalleryAlbumNotFoundDesc;
/// No description provided for @importGalleryNoImagesFound.
///
/// In en, this message translates to:
/// **'No images found'**
String get importGalleryNoImagesFound;
/// No description provided for @importGalleryNoImagesFoundDesc.
///
/// In en, this message translates to:
/// **'There are no images on your device.'**
String get importGalleryNoImagesFoundDesc;
/// No description provided for @importGalleryShowAllImages.
///
/// In en, this message translates to:
/// **'Show all images'**
String get importGalleryShowAllImages;
/// No description provided for @importGalleryShowTwonlyAlbum.
///
/// In en, this message translates to:
/// **'Show twonly album'**
String get importGalleryShowTwonlyAlbum;
/// No description provided for @importGalleryToggleDescAll.
///
/// In en, this message translates to:
/// **'Viewing all images on your device.'**
String get importGalleryToggleDescAll;
/// No description provided for @importGalleryToggleDescTwonly.
///
/// In en, this message translates to:
/// **'Viewing the \"twonly\" album.'**
String get importGalleryToggleDescTwonly;
/// No description provided for @importGalleryFilterTwonly.
///
/// In en, this message translates to:
/// **'Only show the twonly-Album'**
String get importGalleryFilterTwonly;
/// No description provided for @importGalleryRefresh.
///
/// In en, this message translates to:
/// **'Refresh'**
String get importGalleryRefresh;
/// No description provided for @importGallerySelectToImport.
///
/// In en, this message translates to:
/// **'Select items to import'**
String get importGallerySelectToImport;
/// No description provided for @importGalleryImportCount.
///
/// In en, this message translates to:
/// **'{count, plural, =1{Import 1 item} other{Import {count} items}}'**
String importGalleryImportCount(num count);
}
class _AppLocalizationsDelegate

View file

@ -8,9 +8,12 @@ import 'app_localizations.dart';
class AppLocalizationsDe extends AppLocalizations {
AppLocalizationsDe([String locale = 'de']) : super(locale);
@override
String get registerTitle => 'Willkommen bei twonly!';
@override
String get registerSlogan =>
'Privat und sicher mit Freunden in Kontakt bleiben.';
'twonly, eine private und sichere Möglichkeit um mit Freunden in Kontakt zu bleiben.';
@override
String get onboardingWelcomeTitle => 'Willkommen bei twonly!';
@ -52,13 +55,15 @@ class AppLocalizationsDe extends AppLocalizations {
String get onboardingGetStartedTitle => 'Auf geht\'s';
@override
String get registerUsernameSlogan => 'Dein öffentlicher Benutzername';
String get registerUsernameSlogan =>
'Bitte wähle einen Benutzernamen, damit dich andere finden können!';
@override
String get registerUsernameDecoration => 'Benutzername';
@override
String get registerUsernameLimits => 'Mindestens 3 Zeichen.';
String get registerUsernameLimits =>
'Der Benutzername muss mindestens 3 Zeichen lang sein.';
@override
String get registerProofOfWorkFailed =>
@ -209,14 +214,6 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get settingsPreSelectedReactions => 'Vorgewählte Reaktions-Emojis';
@override
String get settingsAutomaticallyMarkEqualMediaFilesAsOpenedTitle =>
'Duplikate als geöffnet markieren';
@override
String get settingsAutomaticallyMarkEqualMediaFilesAsOpenedSubtitle =>
'Wenn du die selbe Mediendatei in mehreren Chats erhältst, markiert das Öffnen einer Kopie alle anderen als geöffnet.';
@override
String get settingsPreSelectedReactionsError =>
'Es können maximal 12 Reaktionen ausgewählt werden.';
@ -244,21 +241,6 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get settingsStorageDataAutoDownWifi => 'Bei Nutzung von WLAN';
@override
String get settingsStorageManageTitle => 'Speicher verwalten';
@override
String get settingsStorageUsed => 'Speicherplatz belegt';
@override
String get settingsStorageImages => 'Bilder';
@override
String get settingsStorageVideos => 'Videos';
@override
String get settingsStorageGifs => 'GIFs';
@override
String get settingsProfileCustomizeAvatar => 'Avatar anpassen';
@ -292,44 +274,9 @@ class AppLocalizationsDe extends AppLocalizations {
return '$len Kontakt(e)';
}
@override
String get settingsPrivacyProfileSelectionTitle => 'Sicherheitsprofil';
@override
String get settingsPrivacyProfileSelectionDesc =>
'Wähle deinen Setup-Pfad und deine Sicherheitskonfiguration';
@override
String get securityProfileTitle => 'Sicherheitsprofil';
@override
String get securityProfileSubtitle =>
'Wähle das Schutzniveau, das zu deiner täglichen Nutzung passt. Dies kann jederzeit in den Einstellungen geändert werden.';
@override
String get securityProfileNormalTitle => 'Normaler Schutz';
@override
String get securityProfileNormalDesc =>
'Gute Balance zwischen Komfort und Sicherheit, ohne dich zu sehr einzuschränken.';
@override
String get securityProfileStrictTitle => 'Strikter Schutz';
@override
String get securityProfileStrictDesc =>
'Maximaler Schutz vor Phishing, kann aber unkomfortabel sein.';
@override
String get settingsNotification => 'Benachrichtigung';
@override
String get settingsNotifyPermission => 'Benachrichtigungsberechtigung';
@override
String get settingsNotifyPermissionDesc =>
'Systemeinstellungen öffnen, um Push-Benachrichtigungen zu erlauben.';
@override
String get settingsNotifyTroubleshooting => 'Fehlersuche';
@ -475,9 +422,8 @@ class AppLocalizationsDe extends AppLocalizations {
String get verificationTypeQrScanned => 'Du hast den QR-Code gescannt.';
@override
String verificationTypeSecretQrToken(Object username) {
return '$username hat deinen QR-Code gescannt.';
}
String get verificationTypeSecretQrToken =>
'Die andere Person hat deinen QR-Code gescannt.';
@override
String get verificationTypeLink => 'Per Link verifiziert.';
@ -648,6 +594,9 @@ class AppLocalizationsDe extends AppLocalizations {
String get errorPlanUpgradeNotYearly =>
'Das Upgrade des Plans muss jährlich bezahlt werden, da der aktuelle Plan ebenfalls jährlich abgerechnet wird.';
@override
String get upgradeToPaidPlan => 'Upgrade auf einen kostenpflichtigen Plan.';
@override
String upgradeToPaidPlanButton(Object planId, Object sufix) {
return 'Auf $planId upgraden$sufix';
@ -709,6 +658,12 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get open => 'Offene';
@override
String get createVoucher => 'Gutschein kaufen';
@override
String get redeemVoucher => 'Gutschein einlösen';
@override
String get buy => 'Kaufen';
@ -721,27 +676,15 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get galleryDelete => 'Datei löschen';
@override
String get galleryDetails => 'Details anzeigen';
@override
String get galleryExport => 'In Galerie exportieren';
@override
String get galleryExportSuccess => 'Erfolgreich in der Gallery gespeichert.';
@override
String get gallerySelectAll => 'Alle auswählen';
@override
String get galleryDeselectAll => 'Auswahl aufheben';
@override
String get galleryFavorite => 'Als Favorit markieren';
@override
String get galleryUnfavorite => 'Favorit entfernen';
@override
String get galleryCancel => 'Abbrechen';
@override
String get memoriesEmpty =>
'Sobald du Bilder oder Videos speicherst, landen sie hier in deinen Erinnerungen.';
@ -752,17 +695,6 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get deleteOkBtnForAll => 'Für alle löschen';
@override
String memoriesDeleteSnackbarSuccess(num count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count Elemente erfolgreich gelöscht',
one: '1 Element erfolgreich gelöscht',
);
return '$_temp0';
}
@override
String get deleteOkBtnForMe => 'Für mich löschen';
@ -772,17 +704,6 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get deleteImageBody => 'Das Bild wird unwiderruflich gelöscht.';
@override
String deleteMemoriesBody(num count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'Die $count Bilder werden unwiderruflich gelöscht.',
one: 'Das Bild wird unwiderruflich gelöscht.',
);
return '$_temp0';
}
@override
String get settingsBackup => 'Backup';
@ -804,10 +725,13 @@ class AppLocalizationsDe extends AppLocalizations {
'Aufgrund des Sicherheitssystems von twonly gibt es (derzeit) keine Funktion zur Wiederherstellung des Passworts. Daher musst du dir dein Passwort merken oder, besser noch, aufschreiben.';
@override
String get backupIdentityHeader => 'Identität';
String get backupServer => 'Server';
@override
String get backupArchiveHeader => 'Kontakte, Einstellungen und Nachrichten';
String get backupMaxBackupSize => 'max. Backup-Größe';
@override
String get backupStorageRetention => 'Speicheraufbewahrung';
@override
String get backupLastBackupDate => 'Letztes Backup';
@ -818,6 +742,9 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get backupLastBackupResult => 'Ergebnis';
@override
String get backupData => 'Daten-Backup';
@override
String get backupInsecurePassword => 'Unsicheres Passwort';
@ -850,11 +777,24 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get backupPasswordRequirement =>
'Das Passwort muss mindestens 10 Zeichen lang sein.';
'Das Passwort muss mindestens 8 Zeichen lang sein.';
@override
String get backupExpertSettings => 'Experteneinstellungen';
@override
String get backupEnableBackup => 'Automatische Sicherung aktivieren';
@override
String get backupOwnServerDesc =>
'Speichere dein twonly Backup auf einem Server deiner Wahl.';
@override
String get backupUseOwnServer => 'Server verwenden';
@override
String get backupResetServer => 'Standardserver verwenden';
@override
String get backupTwonlySaveNow => 'Jetzt speichern';
@ -862,7 +802,11 @@ class AppLocalizationsDe extends AppLocalizations {
String get backupChangePassword => 'Password ändern';
@override
String get twonlySafeRecoverTitle => 'Backup wiederherstellen';
String get twonlySafeRecoverTitle => 'Recovery';
@override
String get twonlySafeRecoverDesc =>
'Wenn du ein Backup mit twonly Backup erstellt hast, kannst du es hier wiederherstellen.';
@override
String get twonlySafeRecoverBtn => 'Backup wiederherstellen';
@ -1328,8 +1272,7 @@ class AppLocalizationsDe extends AppLocalizations {
String get openYourOwnQRcode => 'Eigenen QR-Code öffnen';
@override
String get addContactQrSheetSubtext =>
'Lass einen Freund diesen QR-Code scannen, um dich hinzuzufügen';
String get skipForNow => 'Vorerst überspringen';
@override
String get finishSetupCardTitle => 'Profil vervollständigen';
@ -1341,16 +1284,6 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get finishSetupCardAction => 'Setup fortsetzen';
@override
String get missingBackupCardTitle => 'Backup einrichten';
@override
String get missingBackupCardDesc =>
'Wir haben den Backup-Mechanismus verbessert, weshalb du ihn erneut einrichten musst.';
@override
String get missingBackupCardAction => 'Jetzt einrichten';
@override
String get onboardingFinishLater => 'Später abschließen';
@ -1384,11 +1317,11 @@ class AppLocalizationsDe extends AppLocalizations {
'Erfahre, wer dich anfragt';
@override
String get userDiscoverySettingsManualApproval => 'Vor jedem Teilen fragen';
String get userDiscoverySettingsManualApproval => 'Manuelle Zustimmung';
@override
String get userDiscoverySettingsManualApprovalDesc =>
'Bevor einer deiner Freunde geteilt wird, wirst du jedes Mal gefragt.';
'Bevor jemand geteilt wird, wirst du zuerst gefragt.';
@override
String get onboardingUserDiscoveryLetFriendsFindYou =>
@ -1556,7 +1489,7 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get verificationBadgeGeneralDesc =>
'Der Haken gibt dir die Sicherheit, dass du mit der richtigen Person schreibst. Du kannst Kontakte jederzeit verifizieren, indem du deren QR-Code scannst.';
'Der Haken gibt dir die Sicherheit, dass du mit der richtigen Person schreibst. Scanne einen Kontakt, um diesen zu verifizieren.';
@override
String get verificationBadgeGreenDesc =>
@ -1570,40 +1503,6 @@ class AppLocalizationsDe extends AppLocalizations {
String get verificationBadgeRedDesc =>
'Ein Kontakt, dessen Identität noch *nicht überprüft* wurde.';
@override
String get deleteVerificationTitle => 'Verifizierung löschen?';
@override
String get deleteVerificationBody =>
'Möchtest du diese Verifizierung wirklich löschen?';
@override
String secretQrTokenVerifiedSnackbar(Object username) {
return '$username hat deinen QR-Code gescannt und ist nun verifiziert.';
}
@override
String mutualGroupsTitle(num count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count gemeinsame Gruppen',
one: '1 gemeinsame Gruppe',
);
return '$_temp0';
}
@override
String mutualGroupsSentMessages(num count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count Nachrichten gesendet',
one: '1 Nachricht gesendet',
);
return '$_temp0';
}
@override
String chatEntryFlameRestored(Object count) {
return '$count Flammen wiederhergestellt';
@ -1683,12 +1582,6 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get userDiscoverySettingsTitle => 'Gemeinsame Freunde';
@override
String get userDiscoveryWhyThisIsUsed => 'Warum dies verwendet wird';
@override
String get userDiscoveryFeatureOffers => 'Dein Nutzen auf einen Blick';
@override
String get userDiscoveryDisabledLearnMore => 'Mehr erfahren';
@ -1732,43 +1625,6 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get friendSuggestionsRequest => 'Anfragen';
@override
String get friendSuggestionsAskFriend => 'Deine Freunde fragen';
@override
String askFriendsDialogTitle(Object username) {
return 'Nach $username fragen';
}
@override
String get askFriendsDialogDescription =>
'Wähle die Freunde aus, die du zu diesem Nutzer fragen möchtest:';
@override
String get askFriendsDialogConfirm => 'Fragen';
@override
String get askFriendsDialogCancel => 'Abbrechen';
@override
String get chatAskAFriendReceivedDescription =>
'Dein Freund hat diesen Nutzer als Vorschlag erhalten und möchte wissen, ob er diese Person kennt.';
@override
String get chatAskAFriendAddedDescription =>
'Du hast diesen Nutzer zu deinen Kontakten hinzugefügt.';
@override
String get chatAskAFriendHide => 'Ausblenden';
@override
String get chatAskAFriendRequest => 'Anfragen';
@override
String chatAskAFriendUnknownUser(Object userId) {
return 'Nutzer $userId';
}
@override
String contactUserDiscoveryImagesLeft(Object imagesLeft, Object username) {
return 'Es fehlen noch $imagesLeft Bilder bis deine Freunde mit $username geteilt werden.';
@ -1858,273 +1714,11 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String makerChangedUsername(Object maker, Object oldName, Object newName) {
return '$maker hat den Benutzernamen von $oldName zu $newName geändert.';
return '$maker hat seinen Benutzernamen von $oldName zu $newName geändert.';
}
@override
String makerChangedDisplayName(Object maker, Object oldName, Object newName) {
return '$maker hat den Anzeigenamen von $oldName zu $newName geändert.';
}
@override
String get recoverErrorNoInternet =>
'Keine Internetverbindung. Bitte überprüfe deine Netzwerkverbindung und versuche es erneut.';
@override
String get recoverErrorUsernameNotValid =>
'Der eingegebene Benutzername ist ungültig oder existiert nicht.';
@override
String get recoverErrorPasswordInvalid =>
'Das eingegebene Passwort ist falsch.';
@override
String get recoverErrorTryAgainLater =>
'Der Server ist derzeit nicht erreichbar. Bitte versuche es später erneut.';
@override
String get recoverErrorUnknown =>
'Ein unbekannter Fehler ist aufgetreten. Bitte versuche es erneut.';
@override
String get recoverSuccessTitle => 'Backup erfolgreich wiederhergestellt.';
@override
String get recoverSuccessBody => 'Klicke hier, um die App wieder zu öffnen';
@override
String get iosRecoveryWelcomeBack => 'Willkommen zurück';
@override
String get iosRecoveryPrompt =>
'Wir haben eine zuvor gesicherte twonly-Identität auf diesem Gerät erkannt. Möchtest du deine Kontakte, Nachrichten und Einstellungen automatisch aus deinem Cloud-Archiv herunterladen und wiederherstellen?';
@override
String iosRecoveryNoBackupFound(Object error) {
return 'Für dieses Gerät konnte kein Backup-Archiv vom Server abgerufen werden.\n\nFehler: $error\n\nBitte fahre mit der Registrierung eines neuen twonly-Kontos fort.';
}
@override
String get registerNewAccount => 'Neues Konto registrieren';
@override
String get tryRestoreAgain => 'Wiederherstellung erneut versuchen';
@override
String get registeringNewAccount => 'Neues Konto wird registriert';
@override
String get createShortcut => 'Shortcut erstellen';
@override
String get editShortcut => 'Shortcut bearbeiten';
@override
String get deleteShortcut => 'Shortcut löschen';
@override
String get deleteShortcutBody =>
'Bist du sicher, dass du diesen Shortcut löschen möchtest?';
@override
String get updateShortcut => 'Shortcut aktualisieren';
@override
String get selectEmoji => 'Emoji auswählen';
@override
String get errorEmojiUsedOrInvalid =>
'Emoji wird bereits verwendet oder ist ungültig';
@override
String get subscriptionPledgeSecureTitle => 'Secure by Design';
@override
String get subscriptionPledgeSecureDesc =>
'Deine Nachrichten und Bilder sind immer vollständig Ende-zu-Ende verschlüsselt.';
@override
String get subscriptionPledgeNoAdsTitle => 'Keine Werbung oder Datenverkauf';
@override
String get subscriptionPledgeNoAdsDesc =>
'twonly wird niemals Werbung anzeigen oder deine privaten Daten verkaufen.';
@override
String get subscriptionPledgeSubtitle => 'Keine Werbung. Volle Privatsphäre.';
@override
String get dragToZoom => 'Zum Zoomen ziehen';
@override
String get showUsername => 'Benutzernamen anzeigen';
@override
String get onboardingProfileSelectionTitle => 'Wähle deinen Setup-Weg';
@override
String get onboardingProfileSelectionSubtitle =>
'Wähle aus, wie du deine Sicherheits- und Privatsphäre-Einstellungen konfigurieren möchtest.';
@override
String get onboardingProfileSelectionDefaultTitle => 'Standard';
@override
String get onboardingProfileSelectionDefaultDesc =>
'Wendet sofort die empfohlenen Einstellungen an, damit du die App direkt nutzen kannst.';
@override
String get onboardingProfileSelectionDefaultBadge => 'Schnelles Setup';
@override
String get onboardingProfileSelectionCustomizeTitle => 'Anpassen';
@override
String get onboardingProfileSelectionCustomizeDesc =>
'Schritt-für-Schritt-Einrichtung, damit du selbst entscheiden kannst.';
@override
String get onboardingProfileSelectionStrictTitle => 'Erhöhter Schutz';
@override
String get onboardingProfileSelectionStrictDesc =>
'Maximaler Schutz vor Phishing. Empfohlen für *Journalisten & Personen des öffentlichen Lebens*.';
@override
String get replyFlameRestored => 'Flammen wiederhergestellt';
@override
String get replyAskAFriend => 'Einen Freund fragen';
@override
String get unverifiedWarningDirectTitle =>
'Identität nicht persönlich verifiziert';
@override
String get unverifiedWarningGroupTitle =>
'Nicht alle Mitglieder sind persönlich verifiziert';
@override
String get unverifiedWarningBody =>
'*Teile keine geheimen Daten*. Jemand könnte sich *als dein Freund ausgeben*.';
@override
String get unverifiedWarningButton => 'Jetzt verifizieren';
@override
String get today => 'Heute';
@override
String get yesterday => 'Gestern';
@override
String get galleryDisableWarningTitle => 'Galeriespeicherung deaktivieren?';
@override
String get galleryDisableWarningBody =>
'Wenn du dies deaktivierst, werden deine Mediendateien nicht in deiner Galerie gespeichert und könnten dauerhaft verloren gehen, wenn twonly deinstalliert wird oder ein Problem auftritt, da Mediendateien noch nicht in Backups enthalten sind.';
@override
String get galleryDisableWarningConfirm => 'Deaktivieren';
@override
String get settingsStorageScanGalleryTitle => 'Aus Galerie importieren';
@override
String get importGalleryDeselectAll => 'Alle abwählen';
@override
String get importGallerySelectAll => 'Alle auswählen';
@override
String get importGalleryPermissionRequired =>
'Zugriff auf deine Galerie ist erforderlich, um frühere twonly-Mediendateien zu importieren.';
@override
String importGalleryPermissionError(Object error) {
return 'Beim Anfordern der Berechtigung ist ein Fehler aufgetreten: $error';
}
@override
String importGalleryLoadError(Object error) {
return 'Laden der Medien fehlgeschlagen: $error';
}
@override
String importGalleryImportingOf(Object current, Object total) {
return '$current von $total wird importiert...';
}
@override
String get importGalleryStarting => 'Import wird gestartet...';
@override
String importGalleryComplete(
Object imported,
Object duplicated,
Object failed,
) {
return 'Import abgeschlossen: $imported erfolgreich importiert, $duplicated Duplikate und $failed fehlgeschlagen.';
}
@override
String get importGalleryGrantAccess => 'Zugriff erlauben';
@override
String get importGalleryOpenSettings => 'Einstellungen öffnen';
@override
String get importGalleryPermissionDenied => 'Zugriff auf Galerie verweigert.';
@override
String get importGalleryTryAgain => 'Erneut versuchen';
@override
String get importGalleryAlbumNotFound => '\"twonly\"-Album nicht gefunden';
@override
String get importGalleryAlbumNotFoundDesc =>
'Falls du dieses Album noch nicht hast, kannst du es auch erstellen, um Fotos in twonly zu importieren.';
@override
String get importGalleryNoImagesFound => 'Keine Bilder gefunden';
@override
String get importGalleryNoImagesFoundDesc =>
'Es befinden sich keine Bilder auf deinem Gerät.';
@override
String get importGalleryShowAllImages => 'Alle Bilder anzeigen';
@override
String get importGalleryShowTwonlyAlbum => 'twonly-Album anzeigen';
@override
String get importGalleryToggleDescAll =>
'Es werden alle Bilder auf deinem Gerät angezeigt.';
@override
String get importGalleryToggleDescTwonly =>
'Es wird das \"twonly\"-Album angezeigt.';
@override
String get importGalleryFilterTwonly => 'Nur das twonly-Album anzeigen';
@override
String get importGalleryRefresh => 'Aktualisieren';
@override
String get importGallerySelectToImport =>
'Elemente zum Importieren auswählen';
@override
String importGalleryImportCount(num count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count Elemente importieren',
one: '1 Element importieren',
);
return '$_temp0';
return '$maker hat seinen Anzeigenamen von $oldName zu $newName geändert.';
}
}

View file

@ -8,9 +8,12 @@ import 'app_localizations.dart';
class AppLocalizationsEn extends AppLocalizations {
AppLocalizationsEn([String locale = 'en']) : super(locale);
@override
String get registerTitle => 'Welcome to twonly!';
@override
String get registerSlogan =>
'Stay in touch with friends privately and securely.';
'twonly, a privacy friendly way to connect with friends through secure, spontaneous image sharing';
@override
String get onboardingWelcomeTitle => 'Welcome to twonly!';
@ -51,13 +54,15 @@ class AppLocalizationsEn extends AppLocalizations {
String get onboardingGetStartedTitle => 'Let\'s go!';
@override
String get registerUsernameSlogan => 'Your public username';
String get registerUsernameSlogan =>
'Please select a username so others can find you!';
@override
String get registerUsernameDecoration => 'Username';
@override
String get registerUsernameLimits => 'At least 3 characters.';
String get registerUsernameLimits =>
'Your username must be at least 3 characters long.';
@override
String get registerProofOfWorkFailed =>
@ -206,14 +211,6 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get settingsPreSelectedReactions => 'Preselected reaction emojis';
@override
String get settingsAutomaticallyMarkEqualMediaFilesAsOpenedTitle =>
'Mark duplicates as opened';
@override
String get settingsAutomaticallyMarkEqualMediaFilesAsOpenedSubtitle =>
'If you receive the same media in multiple chats, opening one marks all others as opened.';
@override
String get settingsPreSelectedReactionsError =>
'A maximum of 12 reactions can be selected.';
@ -240,21 +237,6 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get settingsStorageDataAutoDownWifi => 'When using WI-FI';
@override
String get settingsStorageManageTitle => 'Manage storage';
@override
String get settingsStorageUsed => 'Storage used';
@override
String get settingsStorageImages => 'Images';
@override
String get settingsStorageVideos => 'Videos';
@override
String get settingsStorageGifs => 'GIFs';
@override
String get settingsProfileCustomizeAvatar => 'Customize your avatar';
@ -288,44 +270,9 @@ class AppLocalizationsEn extends AppLocalizations {
return '$len contact(s)';
}
@override
String get settingsPrivacyProfileSelectionTitle => 'Security Profile';
@override
String get settingsPrivacyProfileSelectionDesc =>
'Choose your setup path and security configuration';
@override
String get securityProfileTitle => 'Security Profile';
@override
String get securityProfileSubtitle =>
'Choose the level of protection that fits your daily use. This can be changed at any time in your settings.';
@override
String get securityProfileNormalTitle => 'Normal Protection';
@override
String get securityProfileNormalDesc =>
'Good balance between a convenient mode without bothering you too much.';
@override
String get securityProfileStrictTitle => 'Strict Protection';
@override
String get securityProfileStrictDesc =>
'Maximum anti-phishing protection but may be inconvenient.';
@override
String get settingsNotification => 'Notification';
@override
String get settingsNotifyPermission => 'Notification permissions';
@override
String get settingsNotifyPermissionDesc =>
'Open system settings to allow push notifications.';
@override
String get settingsNotifyTroubleshooting => 'Troubleshooting';
@ -470,9 +417,8 @@ class AppLocalizationsEn extends AppLocalizations {
String get verificationTypeQrScanned => 'You scanned their QR code.';
@override
String verificationTypeSecretQrToken(Object username) {
return '$username has scanned your QR code.';
}
String get verificationTypeSecretQrToken =>
'The other person scanned your QR code.';
@override
String get verificationTypeLink => 'Verified via link.';
@ -642,6 +588,9 @@ class AppLocalizationsEn extends AppLocalizations {
String get errorPlanUpgradeNotYearly =>
'The plan upgrade must be paid for annually, as the current plan is also billed annually.';
@override
String get upgradeToPaidPlan => 'Upgrade to a paid plan.';
@override
String upgradeToPaidPlanButton(Object planId, Object sufix) {
return 'Upgrade to $planId$sufix';
@ -703,6 +652,12 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get open => 'Open';
@override
String get createVoucher => 'Buy voucher';
@override
String get redeemVoucher => 'Redeem voucher';
@override
String get buy => 'Buy';
@ -715,27 +670,15 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get galleryDelete => 'Delete file';
@override
String get galleryDetails => 'Show details';
@override
String get galleryExport => 'Export to gallery';
@override
String get galleryExportSuccess => 'Successfully saved in the Gallery.';
@override
String get gallerySelectAll => 'Select all';
@override
String get galleryDeselectAll => 'Deselect all';
@override
String get galleryFavorite => 'Favorite';
@override
String get galleryUnfavorite => 'Unfavorite';
@override
String get galleryCancel => 'Cancel';
@override
String get memoriesEmpty =>
'As soon as you save pictures or videos, they end up here in your memories.';
@ -746,17 +689,6 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get deleteOkBtnForAll => 'Delete for all';
@override
String memoriesDeleteSnackbarSuccess(num count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'Deleted $count items successfully',
one: 'Deleted 1 item successfully',
);
return '$_temp0';
}
@override
String get deleteOkBtnForMe => 'Delete for me';
@ -766,17 +698,6 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get deleteImageBody => 'The image will be irrevocably deleted.';
@override
String deleteMemoriesBody(num count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'The $count images will be irrevocably deleted.',
one: 'The image will be irrevocably deleted.',
);
return '$_temp0';
}
@override
String get settingsBackup => 'Backup';
@ -798,10 +719,13 @@ class AppLocalizationsEn extends AppLocalizations {
'Due to twonly\'s security system, there is (currently) no password recovery function. Therefore, you must remember your password or, better yet, write it down.';
@override
String get backupIdentityHeader => 'Identity';
String get backupServer => 'Server';
@override
String get backupArchiveHeader => 'Contacts, Settings and Messages';
String get backupMaxBackupSize => 'max. backup size';
@override
String get backupStorageRetention => 'Storage retention';
@override
String get backupLastBackupDate => 'Last backup';
@ -812,6 +736,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get backupLastBackupResult => 'Result';
@override
String get backupData => 'Data-Backup';
@override
String get backupInsecurePassword => 'Insecure password';
@ -844,11 +771,24 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get backupPasswordRequirement =>
'Password must be at least 10 characters long.';
'Password must be at least 8 characters long.';
@override
String get backupExpertSettings => 'Expert settings';
@override
String get backupEnableBackup => 'Activate automatic backup';
@override
String get backupOwnServerDesc =>
'Save your twonly Backup at twonly or on any server of your choice.';
@override
String get backupUseOwnServer => 'Use server';
@override
String get backupResetServer => 'Use standard server';
@override
String get backupTwonlySaveNow => 'Save now';
@ -856,7 +796,11 @@ class AppLocalizationsEn extends AppLocalizations {
String get backupChangePassword => 'Change password';
@override
String get twonlySafeRecoverTitle => 'Restore backup';
String get twonlySafeRecoverTitle => 'Recovery';
@override
String get twonlySafeRecoverDesc =>
'If you have created a backup with twonly Backup, you can restore it here.';
@override
String get twonlySafeRecoverBtn => 'Restore backup';
@ -1319,8 +1263,7 @@ class AppLocalizationsEn extends AppLocalizations {
String get openYourOwnQRcode => 'Open your own QR code';
@override
String get addContactQrSheetSubtext =>
'Let a friend scan this QR code to add you';
String get skipForNow => 'Skip for now';
@override
String get finishSetupCardTitle => 'Complete your profile';
@ -1332,16 +1275,6 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get finishSetupCardAction => 'Resume Setup';
@override
String get missingBackupCardTitle => 'Setup backup';
@override
String get missingBackupCardDesc =>
'We have improved the backup mechanism, which requires you to set it up again.';
@override
String get missingBackupCardAction => 'Set up now';
@override
String get onboardingFinishLater => 'Finish later';
@ -1375,12 +1308,11 @@ class AppLocalizationsEn extends AppLocalizations {
'Be informed about who is requesting';
@override
String get userDiscoverySettingsManualApproval =>
'Ask every time before sharing';
String get userDiscoverySettingsManualApproval => 'Manual approval';
@override
String get userDiscoverySettingsManualApprovalDesc =>
'Before one of your friends is shared, you will be asked every time.';
'Before someone is shared, you\'ll be asked first.';
@override
String get onboardingUserDiscoveryLetFriendsFindYou =>
@ -1542,7 +1474,7 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get verificationBadgeGeneralDesc =>
'The checkmark gives you the certainty that you are messaging the right person. You can verify contacts at any time by scanning their QR code.';
'The checkmark gives you the certainty that you are messaging the right person. Scan the contact\'s QR code to verify it.';
@override
String get verificationBadgeGreenDesc =>
@ -1556,40 +1488,6 @@ class AppLocalizationsEn extends AppLocalizations {
String get verificationBadgeRedDesc =>
'A contact whose identity has *not* yet been verified.';
@override
String get deleteVerificationTitle => 'Delete verification?';
@override
String get deleteVerificationBody =>
'Are you sure you want to delete this verification?';
@override
String secretQrTokenVerifiedSnackbar(Object username) {
return '$username has scanned your QR code and is now verified.';
}
@override
String mutualGroupsTitle(num count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count mutual groups',
one: '1 mutual group',
);
return '$_temp0';
}
@override
String mutualGroupsSentMessages(num count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count messages sent',
one: '1 message sent',
);
return '$_temp0';
}
@override
String chatEntryFlameRestored(Object count) {
return '$count flames restored';
@ -1669,12 +1567,6 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get userDiscoverySettingsTitle => 'Mutual Friends';
@override
String get userDiscoveryWhyThisIsUsed => 'Why this is used';
@override
String get userDiscoveryFeatureOffers => 'Your benefits at a glance';
@override
String get userDiscoveryDisabledLearnMore => 'Learn more';
@ -1718,43 +1610,6 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get friendSuggestionsRequest => 'Request';
@override
String get friendSuggestionsAskFriend => 'Ask your friends';
@override
String askFriendsDialogTitle(Object username) {
return 'Ask about $username';
}
@override
String get askFriendsDialogDescription =>
'Select the friends you want to ask about this user:';
@override
String get askFriendsDialogConfirm => 'Ask';
@override
String get askFriendsDialogCancel => 'Cancel';
@override
String get chatAskAFriendReceivedDescription =>
'Your friend just got this as a suggestion and wants to know if he knows this person.';
@override
String get chatAskAFriendAddedDescription =>
'You have added this user to your contacts.';
@override
String get chatAskAFriendHide => 'Hide';
@override
String get chatAskAFriendRequest => 'Request';
@override
String chatAskAFriendUnknownUser(Object userId) {
return 'User $userId';
}
@override
String contactUserDiscoveryImagesLeft(Object imagesLeft, Object username) {
return '$imagesLeft more images are needed until your friends are shared with $username.';
@ -1851,262 +1706,4 @@ class AppLocalizationsEn extends AppLocalizations {
String makerChangedDisplayName(Object maker, Object oldName, Object newName) {
return '$maker changed their display name from $oldName to $newName.';
}
@override
String get recoverErrorNoInternet =>
'No internet connection. Please check your network and try again.';
@override
String get recoverErrorUsernameNotValid =>
'The username provided is not valid or does not exist.';
@override
String get recoverErrorPasswordInvalid =>
'The password provided is incorrect.';
@override
String get recoverErrorTryAgainLater =>
'The server is currently unavailable. Please try again later.';
@override
String get recoverErrorUnknown =>
'An unknown error occurred. Please try again.';
@override
String get recoverSuccessTitle => 'Backup successfully recovered.';
@override
String get recoverSuccessBody => 'Click here to open the app again';
@override
String get iosRecoveryWelcomeBack => 'Welcome Back';
@override
String get iosRecoveryPrompt =>
'We detected a previously secured twonly identity on this device. Would you like to automatically download and restore your contacts, messages, and settings from your cloud archive?';
@override
String iosRecoveryNoBackupFound(Object error) {
return 'No backup archive could be retrieved from the server for this device.\n\nError: $error\n\nPlease proceed to register a new twonly account.';
}
@override
String get registerNewAccount => 'Register New Account';
@override
String get tryRestoreAgain => 'Try Restore Again';
@override
String get registeringNewAccount => 'Registering new account';
@override
String get createShortcut => 'Create shortcut';
@override
String get editShortcut => 'Edit shortcut';
@override
String get deleteShortcut => 'Delete shortcut';
@override
String get deleteShortcutBody =>
'Are you sure you want to delete this shortcut?';
@override
String get updateShortcut => 'Update shortcut';
@override
String get selectEmoji => 'Select Emoji';
@override
String get errorEmojiUsedOrInvalid => 'Emoji already used or invalid';
@override
String get subscriptionPledgeSecureTitle => 'Secure by Design';
@override
String get subscriptionPledgeSecureDesc =>
'Your messages and shared moments are fully end-to-end encrypted.';
@override
String get subscriptionPledgeNoAdsTitle => 'No Ads or Data selling';
@override
String get subscriptionPledgeNoAdsDesc =>
'twonly will never show advertisements or sell your private data.';
@override
String get subscriptionPledgeSubtitle => 'Zero ads. Total privacy.';
@override
String get dragToZoom => 'Drag to Zoom';
@override
String get showUsername => 'Show username';
@override
String get onboardingProfileSelectionTitle => 'Choose your setup path';
@override
String get onboardingProfileSelectionSubtitle =>
'Choose how you want to configure your security and privacy settings.';
@override
String get onboardingProfileSelectionDefaultTitle => 'Default';
@override
String get onboardingProfileSelectionDefaultDesc =>
'Instantly applies recommended settings so you can start using the app.';
@override
String get onboardingProfileSelectionDefaultBadge => 'Fast Setup';
@override
String get onboardingProfileSelectionCustomizeTitle => 'Customize';
@override
String get onboardingProfileSelectionCustomizeDesc =>
'Step-by-step setup so you can decide for yourself.';
@override
String get onboardingProfileSelectionStrictTitle => 'Enhanced Protection';
@override
String get onboardingProfileSelectionStrictDesc =>
'Maximum anti-phishing defense. Recommended for *journalists & public figures*.';
@override
String get replyFlameRestored => 'Flames restored';
@override
String get replyAskAFriend => 'Ask a friend';
@override
String get unverifiedWarningDirectTitle => 'Identity not verified in person';
@override
String get unverifiedWarningGroupTitle =>
'Not all members are verified in person';
@override
String get unverifiedWarningBody =>
'*Avoid sharing sensitive data*. Risk of *impersonation* without manual verification.';
@override
String get unverifiedWarningButton => 'Verify now';
@override
String get today => 'Today';
@override
String get yesterday => 'Yesterday';
@override
String get galleryDisableWarningTitle => 'Disable gallery saving?';
@override
String get galleryDisableWarningBody =>
'If you disable this, your media files will not be saved to your gallery and could be permanently lost if twonly is removed or has an issue, as media files are not yet backed up.';
@override
String get galleryDisableWarningConfirm => 'Disable';
@override
String get settingsStorageScanGalleryTitle => 'Import from Gallery';
@override
String get importGalleryDeselectAll => 'Deselect all';
@override
String get importGallerySelectAll => 'Select all';
@override
String get importGalleryPermissionRequired =>
'Permission to access your gallery is required to import previous twonly media files.';
@override
String importGalleryPermissionError(Object error) {
return 'An error occurred while requesting permission: $error';
}
@override
String importGalleryLoadError(Object error) {
return 'Failed to load assets: $error';
}
@override
String importGalleryImportingOf(Object current, Object total) {
return 'Importing $current of $total...';
}
@override
String get importGalleryStarting => 'Starting import...';
@override
String importGalleryComplete(
Object imported,
Object duplicated,
Object failed,
) {
return 'Import complete: $imported successfully imported, $duplicated duplicated and $failed failed.';
}
@override
String get importGalleryGrantAccess => 'Grant Access';
@override
String get importGalleryOpenSettings => 'Open Settings';
@override
String get importGalleryPermissionDenied =>
'Permission to access gallery denied.';
@override
String get importGalleryTryAgain => 'Try Again';
@override
String get importGalleryAlbumNotFound => '\"twonly\" album not found';
@override
String get importGalleryAlbumNotFoundDesc =>
'If you don\'t have this album yet, you can also create it to import photos into twonly.';
@override
String get importGalleryNoImagesFound => 'No images found';
@override
String get importGalleryNoImagesFoundDesc =>
'There are no images on your device.';
@override
String get importGalleryShowAllImages => 'Show all images';
@override
String get importGalleryShowTwonlyAlbum => 'Show twonly album';
@override
String get importGalleryToggleDescAll => 'Viewing all images on your device.';
@override
String get importGalleryToggleDescTwonly => 'Viewing the \"twonly\" album.';
@override
String get importGalleryFilterTwonly => 'Only show the twonly-Album';
@override
String get importGalleryRefresh => 'Refresh';
@override
String get importGallerySelectToImport => 'Select items to import';
@override
String importGalleryImportCount(num count) {
String _temp0 = intl.Intl.pluralLogic(
count,
locale: localeName,
other: 'Import $count items',
one: 'Import 1 item',
);
return '$_temp0';
}
}

@ -1 +1 @@
Subproject commit 189bf8f4dbe2bee4f19a15b9640b8826e4f2e235
Subproject commit 781626f66c5f992ffad861abb7b4937f82319392

View file

@ -1,51 +0,0 @@
import 'package:json_annotation/json_annotation.dart';
part 'backup.model.g.dart';
enum LastBackupUploadState { none, pending, failed, success }
@JsonSerializable()
class CurrentBackupStatus {
CurrentBackupStatus();
factory CurrentBackupStatus.fromJson(Map<String, dynamic> json) =>
_$CurrentBackupStatusFromJson(json);
LastBackupUploadState identityState = LastBackupUploadState.none;
DateTime? identityLastSuccessFull;
int? identitySize;
LastBackupUploadState archiveState = LastBackupUploadState.none;
DateTime? archiveLastSuccessFull;
int? archiveSize;
Map<String, dynamic> toJson() => _$CurrentBackupStatusToJson(this);
}
enum BackupRecoveryState {
// The userId was loaded from the server and the user is asked to enter his password.
identityBackupStarted,
// -> Download identity, replace keymanager
// Identity was downloaded and Keymanager was updated
archiveBackupStarted,
// -> Download archive, replace files, restart app
}
@JsonSerializable()
class BackupRecovery {
BackupRecovery({
required this.username,
required this.password,
required this.userId,
});
factory BackupRecovery.fromJson(Map<String, dynamic> json) =>
_$BackupRecoveryFromJson(json);
String username;
String password;
int userId;
BackupRecoveryState state = BackupRecoveryState.identityBackupStarted;
Map<String, dynamic> toJson() => _$BackupRecoveryToJson(this);
}

View file

@ -1,65 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'backup.model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
CurrentBackupStatus _$CurrentBackupStatusFromJson(Map<String, dynamic> json) =>
CurrentBackupStatus()
..identityState = $enumDecode(
_$LastBackupUploadStateEnumMap,
json['identityState'],
)
..identityLastSuccessFull = json['identityLastSuccessFull'] == null
? null
: DateTime.parse(json['identityLastSuccessFull'] as String)
..identitySize = (json['identitySize'] as num?)?.toInt()
..archiveState = $enumDecode(
_$LastBackupUploadStateEnumMap,
json['archiveState'],
)
..archiveLastSuccessFull = json['archiveLastSuccessFull'] == null
? null
: DateTime.parse(json['archiveLastSuccessFull'] as String)
..archiveSize = (json['archiveSize'] as num?)?.toInt();
Map<String, dynamic> _$CurrentBackupStatusToJson(
CurrentBackupStatus instance,
) => <String, dynamic>{
'identityState': _$LastBackupUploadStateEnumMap[instance.identityState]!,
'identityLastSuccessFull': instance.identityLastSuccessFull
?.toIso8601String(),
'identitySize': instance.identitySize,
'archiveState': _$LastBackupUploadStateEnumMap[instance.archiveState]!,
'archiveLastSuccessFull': instance.archiveLastSuccessFull?.toIso8601String(),
'archiveSize': instance.archiveSize,
};
const _$LastBackupUploadStateEnumMap = {
LastBackupUploadState.none: 'none',
LastBackupUploadState.pending: 'pending',
LastBackupUploadState.failed: 'failed',
LastBackupUploadState.success: 'success',
};
BackupRecovery _$BackupRecoveryFromJson(Map<String, dynamic> json) =>
BackupRecovery(
username: json['username'] as String,
password: json['password'] as String,
userId: (json['userId'] as num).toInt(),
)..state = $enumDecode(_$BackupRecoveryStateEnumMap, json['state']);
Map<String, dynamic> _$BackupRecoveryToJson(BackupRecovery instance) =>
<String, dynamic>{
'username': instance.username,
'password': instance.password,
'userId': instance.userId,
'state': _$BackupRecoveryStateEnumMap[instance.state]!,
};
const _$BackupRecoveryStateEnumMap = {
BackupRecoveryState.identityBackupStarted: 'identityBackupStarted',
BackupRecoveryState.archiveBackupStarted: 'archiveBackupStarted',
};

View file

@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:twonly/src/services/profile.service.dart';
part 'userdata.model.g.dart';
@JsonSerializable()
@ -11,7 +10,6 @@ class UserData {
required this.displayName,
required this.subscriptionPlan,
required this.currentSetupPage,
required this.appVersion,
});
factory UserData.fromJson(Map<String, dynamic> json) =>
_$UserDataFromJson(json);
@ -37,12 +35,6 @@ class UserData {
@JsonKey(defaultValue: 0)
int deviceId = 0;
@JsonKey(defaultValue: SetupProfile.standard)
SetupProfile setupProfile = SetupProfile.standard;
@JsonKey(defaultValue: SecurityProfile.normal)
SecurityProfile securityProfile = SecurityProfile.normal;
// --- SUBSCRIPTION DTA ---
@JsonKey(defaultValue: 'Free')
@ -65,12 +57,6 @@ class UserData {
@JsonKey(defaultValue: false)
bool requestedAudioPermission = false;
@JsonKey(defaultValue: false)
bool enableDatabaseLogging = false;
@JsonKey(defaultValue: false)
bool automaticallyMarkEqualMediaFilesAsOpened = false;
@JsonKey(defaultValue: true)
bool videoStabilizationEnabled = true;
@ -87,8 +73,8 @@ class UserData {
Map<String, List<String>>? autoDownloadOptions;
@JsonKey(defaultValue: true)
bool storeMediaFilesInGallery = true;
@JsonKey(defaultValue: false)
bool storeMediaFilesInGallery = false;
@JsonKey(defaultValue: false)
bool autoStoreAllSendUnlimitedMediaFiles = false;
@ -142,20 +128,12 @@ class UserData {
@JsonKey(defaultValue: true)
bool updateFCMToken = true;
@JsonKey(defaultValue: true)
bool canUseLoginTokenForAuth = true;
// --- BACKUP ---
@Deprecated('Use the secure storage in rust')
DateTime? nextTimeToShowBackupNotice;
BackupServer? backupServer;
TwonlySafeBackup? twonlySafeBackup;
@JsonKey(defaultValue: false)
bool isBackupEnabled = false;
// Used for push notifcation via FCM.
String? fcmToken;
// For my master thesis I want to create a anonymous user study:
// - users in the "Tester" Plan can, if they want, take part of the user study
@ -176,9 +154,6 @@ class UserData {
@JsonKey(defaultValue: false)
bool skipSetupPages = false;
@JsonKey(defaultValue: false)
bool hasZoomed = false;
Map<String, dynamic> toJson() => _$UserDataToJson(this);
}
@ -200,3 +175,19 @@ class TwonlySafeBackup {
List<int> encryptionKey;
Map<String, dynamic> toJson() => _$TwonlySafeBackupToJson(this);
}
@JsonSerializable()
class BackupServer {
BackupServer({
required this.serverUrl,
required this.retentionDays,
required this.maxBackupBytes,
});
factory BackupServer.fromJson(Map<String, dynamic> json) =>
_$BackupServerFromJson(json);
String serverUrl;
int retentionDays;
int maxBackupBytes;
Map<String, dynamic> toJson() => _$BackupServerToJson(this);
}

View file

@ -13,22 +13,13 @@ UserData _$UserDataFromJson(Map<String, dynamic> json) =>
displayName: json['displayName'] as String,
subscriptionPlan: json['subscriptionPlan'] as String? ?? 'Free',
currentSetupPage: json['currentSetupPage'] as String?,
appVersion: (json['appVersion'] as num?)?.toInt() ?? 0,
)
..avatarSvg = json['avatarSvg'] as String?
..avatarJson = json['avatarJson'] as String?
..appVersion = (json['appVersion'] as num?)?.toInt() ?? 0
..avatarCounter = (json['avatarCounter'] as num?)?.toInt() ?? 0
..isDeveloper = json['isDeveloper'] as bool? ?? false
..deviceId = (json['deviceId'] as num?)?.toInt() ?? 0
..setupProfile =
$enumDecodeNullable(_$SetupProfileEnumMap, json['setupProfile']) ??
SetupProfile.standard
..securityProfile =
$enumDecodeNullable(
_$SecurityProfileEnumMap,
json['securityProfile'],
) ??
SecurityProfile.normal
..subscriptionPlanIdStore = json['subscriptionPlanIdStore'] as String?
..lastImageSend = json['lastImageSend'] == null
? null
@ -42,9 +33,6 @@ UserData _$UserDataFromJson(Map<String, dynamic> json) =>
..defaultShowTime = (json['defaultShowTime'] as num?)?.toInt()
..requestedAudioPermission =
json['requestedAudioPermission'] as bool? ?? false
..enableDatabaseLogging = json['enableDatabaseLogging'] as bool? ?? false
..automaticallyMarkEqualMediaFilesAsOpened =
json['automaticallyMarkEqualMediaFilesAsOpened'] as bool? ?? false
..videoStabilizationEnabled =
json['videoStabilizationEnabled'] as bool? ?? true
..showFeedbackShortcut = json['showFeedbackShortcut'] as bool? ?? true
@ -83,8 +71,6 @@ UserData _$UserDataFromJson(Map<String, dynamic> json) =>
json['userDiscoveryRequiresManualApproval'] as bool? ?? false
..userDiscoverySharePromotion =
json['userDiscoverySharePromotion'] as bool? ?? true
..userDiscoveryInitializationError =
json['userDiscoveryInitializationError'] as bool? ?? false
..currentPreKeyIndexStart =
(json['currentPreKeyIndexStart'] as num?)?.toInt() ?? 100000
..currentSignedPreKeyIndexStart =
@ -94,15 +80,17 @@ UserData _$UserDataFromJson(Map<String, dynamic> json) =>
.toList()
..hideChangeLog = json['hideChangeLog'] as bool? ?? true
..updateFCMToken = json['updateFCMToken'] as bool? ?? true
..canUseLoginTokenForAuth =
json['canUseLoginTokenForAuth'] as bool? ?? true
..nextTimeToShowBackupNotice = json['nextTimeToShowBackupNotice'] == null
? null
: DateTime.parse(json['nextTimeToShowBackupNotice'] as String)
..backupServer = json['backupServer'] == null
? null
: BackupServer.fromJson(json['backupServer'] as Map<String, dynamic>)
..twonlySafeBackup = json['twonlySafeBackup'] == null
? null
: TwonlySafeBackup.fromJson(
json['twonlySafeBackup'] as Map<String, dynamic>,
)
..isBackupEnabled = json['isBackupEnabled'] as bool? ?? false
..fcmToken = json['fcmToken'] as String?
..askedForUserStudyPermission =
json['askedForUserStudyPermission'] as bool? ?? false
..userStudyParticipantsToken =
@ -112,8 +100,7 @@ UserData _$UserDataFromJson(Map<String, dynamic> json) =>
..lastUserStudyDataUpload = json['lastUserStudyDataUpload'] == null
? null
: DateTime.parse(json['lastUserStudyDataUpload'] as String)
..skipSetupPages = json['skipSetupPages'] as bool? ?? false
..hasZoomed = json['hasZoomed'] as bool? ?? false;
..skipSetupPages = json['skipSetupPages'] as bool? ?? false;
Map<String, dynamic> _$UserDataToJson(UserData instance) => <String, dynamic>{
'userId': instance.userId,
@ -125,8 +112,6 @@ Map<String, dynamic> _$UserDataToJson(UserData instance) => <String, dynamic>{
'avatarCounter': instance.avatarCounter,
'isDeveloper': instance.isDeveloper,
'deviceId': instance.deviceId,
'setupProfile': _$SetupProfileEnumMap[instance.setupProfile]!,
'securityProfile': _$SecurityProfileEnumMap[instance.securityProfile]!,
'subscriptionPlan': instance.subscriptionPlan,
'subscriptionPlanIdStore': instance.subscriptionPlanIdStore,
'lastImageSend': instance.lastImageSend?.toIso8601String(),
@ -136,9 +121,6 @@ Map<String, dynamic> _$UserDataToJson(UserData instance) => <String, dynamic>{
'themeMode': _$ThemeModeEnumMap[instance.themeMode]!,
'defaultShowTime': instance.defaultShowTime,
'requestedAudioPermission': instance.requestedAudioPermission,
'enableDatabaseLogging': instance.enableDatabaseLogging,
'automaticallyMarkEqualMediaFilesAsOpened':
instance.automaticallyMarkEqualMediaFilesAsOpened,
'videoStabilizationEnabled': instance.videoStabilizationEnabled,
'showFeedbackShortcut': instance.showFeedbackShortcut,
'showShowImagePreviewWhenSending': instance.showShowImagePreviewWhenSending,
@ -160,16 +142,15 @@ Map<String, dynamic> _$UserDataToJson(UserData instance) => <String, dynamic>{
'userDiscoveryRequiresManualApproval':
instance.userDiscoveryRequiresManualApproval,
'userDiscoverySharePromotion': instance.userDiscoverySharePromotion,
'userDiscoveryInitializationError': instance.userDiscoveryInitializationError,
'currentPreKeyIndexStart': instance.currentPreKeyIndexStart,
'currentSignedPreKeyIndexStart': instance.currentSignedPreKeyIndexStart,
'lastChangeLogHash': instance.lastChangeLogHash,
'hideChangeLog': instance.hideChangeLog,
'updateFCMToken': instance.updateFCMToken,
'canUseLoginTokenForAuth': instance.canUseLoginTokenForAuth,
'nextTimeToShowBackupNotice': instance.nextTimeToShowBackupNotice
?.toIso8601String(),
'backupServer': instance.backupServer,
'twonlySafeBackup': instance.twonlySafeBackup,
'isBackupEnabled': instance.isBackupEnabled,
'fcmToken': instance.fcmToken,
'askedForUserStudyPermission': instance.askedForUserStudyPermission,
'userStudyParticipantsToken': instance.userStudyParticipantsToken,
'userStudyCountNewFriendsViaSuggestion':
@ -178,18 +159,6 @@ Map<String, dynamic> _$UserDataToJson(UserData instance) => <String, dynamic>{
?.toIso8601String(),
'currentSetupPage': instance.currentSetupPage,
'skipSetupPages': instance.skipSetupPages,
'hasZoomed': instance.hasZoomed,
};
const _$SetupProfileEnumMap = {
SetupProfile.standard: 'standard',
SetupProfile.customized: 'customized',
SetupProfile.maximum: 'maximum',
};
const _$SecurityProfileEnumMap = {
SecurityProfile.normal: 'normal',
SecurityProfile.strict: 'strict',
};
const _$ThemeModeEnumMap = {
@ -232,3 +201,16 @@ const _$LastBackupUploadStateEnumMap = {
LastBackupUploadState.failed: 'failed',
LastBackupUploadState.success: 'success',
};
BackupServer _$BackupServerFromJson(Map<String, dynamic> json) => BackupServer(
serverUrl: json['serverUrl'] as String,
retentionDays: (json['retentionDays'] as num).toInt(),
maxBackupBytes: (json['maxBackupBytes'] as num).toInt(),
);
Map<String, dynamic> _$BackupServerToJson(BackupServer instance) =>
<String, dynamic>{
'serverUrl': instance.serverUrl,
'retentionDays': instance.retentionDays,
'maxBackupBytes': instance.maxBackupBytes,
};

View file

@ -5,11 +5,9 @@ class MemoryItem {
MemoryItem({
required this.mediaService,
required this.messages,
this.sender,
});
final List<Message> messages;
final MediaFileService mediaService;
final Contact? sender;
static Future<Map<String, MemoryItem>> convertFromMessages(
List<Message> messages,

File diff suppressed because it is too large Load diff

View file

@ -134,33 +134,13 @@ const Handshake$json = {
'9': 0,
'10': 'requestPOW'
},
{
'1': 'authenticate_with_login_token',
'3': 6,
'4': 1,
'5': 11,
'6': '.client_to_server.Handshake.AuthenticateWithLoginToken',
'9': 0,
'10': 'authenticateWithLoginToken'
},
{
'1': 'get_userid_by_username',
'3': 7,
'4': 1,
'5': 11,
'6': '.client_to_server.Handshake.GetUserIdByUsername',
'9': 0,
'10': 'getUseridByUsername'
},
],
'3': [
Handshake_RequestPOW$json,
Handshake_Register$json,
Handshake_GetAuthChallenge$json,
Handshake_GetUserIdByUsername$json,
Handshake_GetAuthToken$json,
Handshake_Authenticate$json,
Handshake_AuthenticateWithLoginToken$json
Handshake_Authenticate$json
],
'8': [
{'1': 'Handshake'},
@ -206,19 +186,9 @@ const Handshake_Register$json = {
{'1': 'is_ios', '3': 8, '4': 1, '5': 8, '10': 'isIos'},
{'1': 'lang_code', '3': 9, '4': 1, '5': 9, '10': 'langCode'},
{'1': 'proof_of_work', '3': 10, '4': 1, '5': 3, '10': 'proofOfWork'},
{
'1': 'login_token',
'3': 11,
'4': 1,
'5': 12,
'9': 1,
'10': 'loginToken',
'17': true
},
],
'8': [
{'1': '_invite_code'},
{'1': '_login_token'},
],
};
@ -227,14 +197,6 @@ const Handshake_GetAuthChallenge$json = {
'1': 'GetAuthChallenge',
};
@$core.Deprecated('Use handshakeDescriptor instead')
const Handshake_GetUserIdByUsername$json = {
'1': 'GetUserIdByUsername',
'2': [
{'1': 'username', '3': 1, '4': 1, '5': 9, '10': 'username'},
],
};
@$core.Deprecated('Use handshakeDescriptor instead')
const Handshake_GetAuthToken$json = {
'1': 'GetAuthToken',
@ -285,24 +247,6 @@ const Handshake_Authenticate$json = {
],
};
@$core.Deprecated('Use handshakeDescriptor instead')
const Handshake_AuthenticateWithLoginToken$json = {
'1': 'AuthenticateWithLoginToken',
'2': [
{'1': 'user_id', '3': 1, '4': 1, '5': 3, '10': 'userId'},
{
'1': 'secret_login_token',
'3': 2,
'4': 1,
'5': 12,
'10': 'secretLoginToken'
},
{'1': 'app_version', '3': 3, '4': 1, '5': 9, '10': 'appVersion'},
{'1': 'device_id', '3': 4, '4': 1, '5': 3, '10': 'deviceId'},
{'1': 'in_background', '3': 5, '4': 1, '5': 8, '10': 'inBackground'},
],
};
/// Descriptor for `Handshake`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List handshakeDescriptor = $convert.base64Decode(
'CglIYW5kc2hha2USQgoIcmVnaXN0ZXIYASABKAsyJC5jbGllbnRfdG9fc2VydmVyLkhhbmRzaG'
@ -312,30 +256,20 @@ final $typed_data.Uint8List handshakeDescriptor = $convert.base64Decode(
'LkdldEF1dGhUb2tlbkgAUgxnZXRBdXRoVG9rZW4STgoMYXV0aGVudGljYXRlGAQgASgLMiguY2'
'xpZW50X3RvX3NlcnZlci5IYW5kc2hha2UuQXV0aGVudGljYXRlSABSDGF1dGhlbnRpY2F0ZRJI'
'CgpyZXF1ZXN0UE9XGAUgASgLMiYuY2xpZW50X3RvX3NlcnZlci5IYW5kc2hha2UuUmVxdWVzdF'
'BPV0gAUgpyZXF1ZXN0UE9XEnsKHWF1dGhlbnRpY2F0ZV93aXRoX2xvZ2luX3Rva2VuGAYgASgL'
'MjYuY2xpZW50X3RvX3NlcnZlci5IYW5kc2hha2UuQXV0aGVudG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GaXNfaW9zGAggASgIUgVpc0lvcxIbCglsYW5nX2NvZGUYCSABKAlSCGxhbmdDb2RlEiIK'
'DXByb29mX29mX3dvcmsYCiABKANSC3Byb29mT2ZXb3JrQg4KDF9pbnZpdGVfY29kZRoSChBHZX'
'RBdXRoQ2hhbGxlbmdlGkMKDEdldEF1dGhUb2tlbhIXCgd1c2VyX2lkGAEgASgDUgZ1c2VySWQS'
'GgoIcmVzcG9uc2UYAiABKAxSCHJlc3BvbnNlGugBCgxBdXRoZW50aWNhdGUSFwoHdXNlcl9pZB'
'gBIAEoA1IGdXNlcklkEh0KCmF1dGhfdG9rZW4YAiABKAxSCWF1dGhUb2tlbhIkCgthcHBfdmVy'
'c2lvbhgDIAEoCUgAUgphcHBWZXJzaW9uiAEBEiAKCWRldmljZV9pZBgEIAEoA0gBUghkZXZpY2'
'VJZIgBARIoCg1pbl9iYWNrZ3JvdW5kGAUgASgISAJSDGluQmFja2dyb3VuZIgBAUIOCgxfYXBw'
'X3ZlcnNpb25CDAoKX2RldmljZV9pZEIQCg5faW5fYmFja2dyb3VuZEILCglIYW5kc2hha2U=');
@$core.Deprecated('Use applicationDataDescriptor instead')
const ApplicationData$json = {
@ -387,13 +321,13 @@ const ApplicationData$json = {
'10': 'updateGoogleFcmToken'
},
{
'1': 'deprecated_9',
'1': 'getLocation',
'3': 9,
'4': 1,
'5': 11,
'6': '.client_to_server.ApplicationData.Deprecated',
'6': '.client_to_server.ApplicationData.GetLocation',
'9': 0,
'10': 'deprecated9'
'10': 'getLocation'
},
{
'1': 'getCurrentPlanInfos',
@ -405,13 +339,13 @@ const ApplicationData$json = {
'10': 'getCurrentPlanInfos'
},
{
'1': 'deprecated_11',
'1': 'redeemVoucher',
'3': 11,
'4': 1,
'5': 11,
'6': '.client_to_server.ApplicationData.Deprecated',
'6': '.client_to_server.ApplicationData.RedeemVoucher',
'9': 0,
'10': 'deprecated11'
'10': 'redeemVoucher'
},
{
'1': 'getAvailablePlans',
@ -423,58 +357,58 @@ const ApplicationData$json = {
'10': 'getAvailablePlans'
},
{
'1': 'deprecated_13',
'1': 'createVoucher',
'3': 13,
'4': 1,
'5': 11,
'6': '.client_to_server.ApplicationData.Deprecated',
'6': '.client_to_server.ApplicationData.CreateVoucher',
'9': 0,
'10': 'deprecated13'
'10': 'createVoucher'
},
{
'1': 'deprecated_14',
'1': 'getVouchers',
'3': 14,
'4': 1,
'5': 11,
'6': '.client_to_server.ApplicationData.Deprecated',
'6': '.client_to_server.ApplicationData.GetVouchers',
'9': 0,
'10': 'deprecated14'
'10': 'getVouchers'
},
{
'1': 'deprecated_15',
'1': 'switchtoPayedPlan',
'3': 15,
'4': 1,
'5': 11,
'6': '.client_to_server.ApplicationData.Deprecated',
'6': '.client_to_server.ApplicationData.SwitchToPayedPlan',
'9': 0,
'10': 'deprecated15'
'10': 'switchtoPayedPlan'
},
{
'1': 'deprecated_16',
'1': 'getAddaccountsInvites',
'3': 16,
'4': 1,
'5': 11,
'6': '.client_to_server.ApplicationData.Deprecated',
'6': '.client_to_server.ApplicationData.GetAddAccountsInvites',
'9': 0,
'10': 'deprecated16'
'10': 'getAddaccountsInvites'
},
{
'1': 'deprecated_17',
'1': 'redeemAdditionalCode',
'3': 17,
'4': 1,
'5': 11,
'6': '.client_to_server.ApplicationData.Deprecated',
'6': '.client_to_server.ApplicationData.RedeemAdditionalCode',
'9': 0,
'10': 'deprecated17'
'10': 'redeemAdditionalCode'
},
{
'1': 'deprecated_19',
'1': 'updatePlanOptions',
'3': 19,
'4': 1,
'5': 11,
'6': '.client_to_server.ApplicationData.Deprecated',
'6': '.client_to_server.ApplicationData.UpdatePlanOptions',
'9': 0,
'10': 'deprecated19'
'10': 'updatePlanOptions'
},
{
'1': 'downloadDone',
@ -566,15 +500,6 @@ const ApplicationData$json = {
'9': 0,
'10': 'addAdditionalUser'
},
{
'1': 'set_login_token',
'3': 30,
'4': 1,
'5': 11,
'6': '.client_to_server.ApplicationData.SetLoginToken',
'9': 0,
'10': 'setLoginToken'
},
],
'3': [
ApplicationData_TextMessage$json,
@ -582,9 +507,16 @@ const ApplicationData$json = {
ApplicationData_ChangeUsername$json,
ApplicationData_UpdateGoogleFcmToken$json,
ApplicationData_GetUserById$json,
ApplicationData_RedeemVoucher$json,
ApplicationData_SwitchToPayedPlan$json,
ApplicationData_UpdatePlanOptions$json,
ApplicationData_CreateVoucher$json,
ApplicationData_GetLocation$json,
ApplicationData_GetVouchers$json,
ApplicationData_GetAvailablePlans$json,
ApplicationData_GetAddAccountsInvites$json,
ApplicationData_GetCurrentPlanInfos$json,
ApplicationData_RedeemAdditionalCode$json,
ApplicationData_RemoveAdditionalUser$json,
ApplicationData_GetPrekeysByUserId$json,
ApplicationData_GetSignedPreKeyByUserId$json,
@ -594,9 +526,7 @@ const ApplicationData$json = {
ApplicationData_IPAPurchase$json,
ApplicationData_IPAForceCheck$json,
ApplicationData_DeleteAccount$json,
ApplicationData_AddAdditionalUser$json,
ApplicationData_SetLoginToken$json,
ApplicationData_Deprecated$json
ApplicationData_AddAdditionalUser$json
],
'8': [
{'1': 'ApplicationData'},
@ -656,6 +586,50 @@ const ApplicationData_GetUserById$json = {
],
};
@$core.Deprecated('Use applicationDataDescriptor instead')
const ApplicationData_RedeemVoucher$json = {
'1': 'RedeemVoucher',
'2': [
{'1': 'voucher', '3': 1, '4': 1, '5': 9, '10': 'voucher'},
],
};
@$core.Deprecated('Use applicationDataDescriptor instead')
const ApplicationData_SwitchToPayedPlan$json = {
'1': 'SwitchToPayedPlan',
'2': [
{'1': 'plan_id', '3': 1, '4': 1, '5': 9, '10': 'planId'},
{'1': 'pay_monthly', '3': 2, '4': 1, '5': 8, '10': 'payMonthly'},
{'1': 'auto_renewal', '3': 3, '4': 1, '5': 8, '10': 'autoRenewal'},
],
};
@$core.Deprecated('Use applicationDataDescriptor instead')
const ApplicationData_UpdatePlanOptions$json = {
'1': 'UpdatePlanOptions',
'2': [
{'1': 'auto_renewal', '3': 1, '4': 1, '5': 8, '10': 'autoRenewal'},
],
};
@$core.Deprecated('Use applicationDataDescriptor instead')
const ApplicationData_CreateVoucher$json = {
'1': 'CreateVoucher',
'2': [
{'1': 'value_cents', '3': 1, '4': 1, '5': 13, '10': 'valueCents'},
],
};
@$core.Deprecated('Use applicationDataDescriptor instead')
const ApplicationData_GetLocation$json = {
'1': 'GetLocation',
};
@$core.Deprecated('Use applicationDataDescriptor instead')
const ApplicationData_GetVouchers$json = {
'1': 'GetVouchers',
};
@$core.Deprecated('Use applicationDataDescriptor instead')
const ApplicationData_GetAvailablePlans$json = {
'1': 'GetAvailablePlans',
@ -671,6 +645,14 @@ const ApplicationData_GetCurrentPlanInfos$json = {
'1': 'GetCurrentPlanInfos',
};
@$core.Deprecated('Use applicationDataDescriptor instead')
const ApplicationData_RedeemAdditionalCode$json = {
'1': 'RedeemAdditionalCode',
'2': [
{'1': 'invite_code', '3': 2, '4': 1, '5': 9, '10': 'inviteCode'},
],
};
@$core.Deprecated('Use applicationDataDescriptor instead')
const ApplicationData_RemoveAdditionalUser$json = {
'1': 'RemoveAdditionalUser',
@ -762,19 +744,6 @@ const ApplicationData_AddAdditionalUser$json = {
],
};
@$core.Deprecated('Use applicationDataDescriptor instead')
const ApplicationData_SetLoginToken$json = {
'1': 'SetLoginToken',
'2': [
{'1': 'login_token', '3': 1, '4': 1, '5': 12, '10': 'loginToken'},
],
};
@$core.Deprecated('Use applicationDataDescriptor instead')
const ApplicationData_Deprecated$json = {
'1': 'Deprecated',
};
/// Descriptor for `ApplicationData`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List applicationDataDescriptor = $convert.base64Decode(
'Cg9BcHBsaWNhdGlvbkRhdGESUQoLdGV4dE1lc3NhZ2UYASABKAsyLS5jbGllbnRfdG9fc2Vydm'
@ -786,61 +755,66 @@ final $typed_data.Uint8List applicationDataDescriptor = $convert.base64Decode(
'bnRfdG9fc2VydmVyLkFwcGxpY2F0aW9uRGF0YS5HZXRVc2VyQnlJZEgAUgtnZXRVc2VyQnlJZ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TR2V0Q3VycmVudFBsYW5JbmZvcxo3ChRSZWRlZW1BZGRpdGlvbmFs'
'Q29kZRIfCgtpbnZpdGVfY29kZRgCIAEoCVIKaW52aXRlQ29kZRovChRSZW1vdmVBZGRpdGlvbm'
'FsVXNlchIXCgd1c2VyX2lkGAEgASgDUgZ1c2VySWQaLQoSR2V0UHJla2V5c0J5VXNlcklkEhcK'
'B3VzZXJfaWQYASABKANSBnVzZXJJZBoyChdHZXRTaWduZWRQcmVLZXlCeVVzZXJJZBIXCgd1c2'
'VyX2lkGAEgASgDUgZ1c2VySWQamwEKElVwZGF0ZVNpZ25lZFByZUtleRIoChBzaWduZWRfcHJl'
'a2V5X2lkGAEgASgDUg5zaWduZWRQcmVrZXlJZBIjCg1zaWduZWRfcHJla2V5GAIgASgMUgxzaW'
'duZWRQcmVrZXkSNgoXc2lnbmVkX3ByZWtleV9zaWduYXR1cmUYAyABKAxSFXNpZ25lZFByZWtl'
'eVNpZ25hdHVyZRo1CgxEb3dubG9hZERvbmUSJQoOZG93bmxvYWRfdG9rZW4YASABKAxSDWRvd2'
'5sb2FkVG9rZW4aTgoKUmVwb3J0VXNlchIoChByZXBvcnRlZF91c2VyX2lkGAEgASgDUg5yZXBv'
'cnRlZFVzZXJJZBIWCgZyZWFzb24YAiABKAlSBnJlYXNvbhpxCgtJUEFQdXJjaGFzZRIdCgpwcm'
'9kdWN0X2lkGAEgASgJUglwcm9kdWN0SWQSFgoGc291cmNlGAIgASgJUgZzb3VyY2USKwoRdmVy'
'aWZpY2F0aW9uX2RhdGEYAyABKAlSEHZlcmlmaWNhdGlvbkRhdGEaDwoNSVBBRm9yY2VDaGVjax'
'oPCg1EZWxldGVBY2NvdW50GiwKEUFkZEFkZGl0aW9uYWxVc2VyEhcKB3VzZXJfaWQYASABKANS'
'BnVzZXJJZEIRCg9BcHBsaWNhdGlvbkRhdGE=');
@$core.Deprecated('Use responseDescriptor instead')
const Response$json = {

View file

@ -16,9 +16,12 @@ import 'package:fixnum/fixnum.dart' as $fixnum;
import 'package:protobuf/protobuf.dart' as $pb;
import 'error.pbenum.dart' as $0;
import 'server_to_client.pbenum.dart';
export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions;
export 'server_to_client.pbenum.dart';
enum ServerToClient_V { v0, notSet }
class ServerToClient extends $pb.GeneratedMessage {
@ -749,6 +752,90 @@ class Response_AddAccountsInvites extends $pb.GeneratedMessage {
$pb.PbList<Response_AddAccountsInvite> get invites => $_getList(0);
}
class Response_Transaction extends $pb.GeneratedMessage {
factory Response_Transaction({
$fixnum.Int64? depositCents,
Response_TransactionTypes? transactionType,
$fixnum.Int64? createdAtUnixTimestamp,
}) {
final result = create();
if (depositCents != null) result.depositCents = depositCents;
if (transactionType != null) result.transactionType = transactionType;
if (createdAtUnixTimestamp != null)
result.createdAtUnixTimestamp = createdAtUnixTimestamp;
return result;
}
Response_Transaction._();
factory Response_Transaction.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory Response_Transaction.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'Response.Transaction',
package:
const $pb.PackageName(_omitMessageNames ? '' : 'server_to_client'),
createEmptyInstance: create)
..aInt64(1, _omitFieldNames ? '' : 'depositCents')
..aE<Response_TransactionTypes>(2, _omitFieldNames ? '' : 'transactionType',
enumValues: Response_TransactionTypes.values)
..aInt64(3, _omitFieldNames ? '' : 'createdAtUnixTimestamp')
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
Response_Transaction clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
Response_Transaction copyWith(void Function(Response_Transaction) updates) =>
super.copyWith((message) => updates(message as Response_Transaction))
as Response_Transaction;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static Response_Transaction create() => Response_Transaction._();
@$core.override
Response_Transaction createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static Response_Transaction getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<Response_Transaction>(create);
static Response_Transaction? _defaultInstance;
@$pb.TagNumber(1)
$fixnum.Int64 get depositCents => $_getI64(0);
@$pb.TagNumber(1)
set depositCents($fixnum.Int64 value) => $_setInt64(0, value);
@$pb.TagNumber(1)
$core.bool hasDepositCents() => $_has(0);
@$pb.TagNumber(1)
void clearDepositCents() => $_clearField(1);
@$pb.TagNumber(2)
Response_TransactionTypes get transactionType => $_getN(1);
@$pb.TagNumber(2)
set transactionType(Response_TransactionTypes value) => $_setField(2, value);
@$pb.TagNumber(2)
$core.bool hasTransactionType() => $_has(1);
@$pb.TagNumber(2)
void clearTransactionType() => $_clearField(2);
/// Represents seconds of UTC time since Unix epoch
/// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
/// 9999-12-31T23:59:59Z inclusive.
@$pb.TagNumber(3)
$fixnum.Int64 get createdAtUnixTimestamp => $_getI64(2);
@$pb.TagNumber(3)
set createdAtUnixTimestamp($fixnum.Int64 value) => $_setInt64(2, value);
@$pb.TagNumber(3)
$core.bool hasCreatedAtUnixTimestamp() => $_has(2);
@$pb.TagNumber(3)
void clearCreatedAtUnixTimestamp() => $_clearField(3);
}
class Response_AdditionalAccount extends $pb.GeneratedMessage {
factory Response_AdditionalAccount({
$fixnum.Int64? userId,
@ -818,82 +905,158 @@ class Response_AdditionalAccount extends $pb.GeneratedMessage {
void clearPlanId() => $_clearField(3);
}
class Response_Deprecated extends $pb.GeneratedMessage {
factory Response_Deprecated() => create();
class Response_Voucher extends $pb.GeneratedMessage {
factory Response_Voucher({
$core.String? voucherId,
$fixnum.Int64? valueCents,
$core.bool? redeemed,
$core.bool? requested,
$fixnum.Int64? createdAtUnixTimestamp,
}) {
final result = create();
if (voucherId != null) result.voucherId = voucherId;
if (valueCents != null) result.valueCents = valueCents;
if (redeemed != null) result.redeemed = redeemed;
if (requested != null) result.requested = requested;
if (createdAtUnixTimestamp != null)
result.createdAtUnixTimestamp = createdAtUnixTimestamp;
return result;
}
Response_Deprecated._();
Response_Voucher._();
factory Response_Deprecated.fromBuffer($core.List<$core.int> data,
factory Response_Voucher.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory Response_Deprecated.fromJson($core.String json,
factory Response_Voucher.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'Response.Deprecated',
_omitMessageNames ? '' : 'Response.Voucher',
package:
const $pb.PackageName(_omitMessageNames ? '' : 'server_to_client'),
createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'voucherId')
..aInt64(2, _omitFieldNames ? '' : 'valueCents')
..aOB(3, _omitFieldNames ? '' : 'redeemed')
..aOB(4, _omitFieldNames ? '' : 'requested')
..aInt64(5, _omitFieldNames ? '' : 'createdAtUnixTimestamp')
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
Response_Deprecated clone() => deepCopy();
Response_Voucher clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
Response_Deprecated copyWith(void Function(Response_Deprecated) updates) =>
super.copyWith((message) => updates(message as Response_Deprecated))
as Response_Deprecated;
Response_Voucher copyWith(void Function(Response_Voucher) updates) =>
super.copyWith((message) => updates(message as Response_Voucher))
as Response_Voucher;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static Response_Deprecated create() => Response_Deprecated._();
static Response_Voucher create() => Response_Voucher._();
@$core.override
Response_Deprecated createEmptyInstance() => create();
Response_Voucher createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static Response_Deprecated getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<Response_Deprecated>(create);
static Response_Deprecated? _defaultInstance;
static Response_Voucher getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<Response_Voucher>(create);
static Response_Voucher? _defaultInstance;
@$pb.TagNumber(1)
$core.String get voucherId => $_getSZ(0);
@$pb.TagNumber(1)
set voucherId($core.String value) => $_setString(0, value);
@$pb.TagNumber(1)
$core.bool hasVoucherId() => $_has(0);
@$pb.TagNumber(1)
void clearVoucherId() => $_clearField(1);
@$pb.TagNumber(2)
$fixnum.Int64 get valueCents => $_getI64(1);
@$pb.TagNumber(2)
set valueCents($fixnum.Int64 value) => $_setInt64(1, value);
@$pb.TagNumber(2)
$core.bool hasValueCents() => $_has(1);
@$pb.TagNumber(2)
void clearValueCents() => $_clearField(2);
@$pb.TagNumber(3)
$core.bool get redeemed => $_getBF(2);
@$pb.TagNumber(3)
set redeemed($core.bool value) => $_setBool(2, value);
@$pb.TagNumber(3)
$core.bool hasRedeemed() => $_has(2);
@$pb.TagNumber(3)
void clearRedeemed() => $_clearField(3);
@$pb.TagNumber(4)
$core.bool get requested => $_getBF(3);
@$pb.TagNumber(4)
set requested($core.bool value) => $_setBool(3, value);
@$pb.TagNumber(4)
$core.bool hasRequested() => $_has(3);
@$pb.TagNumber(4)
void clearRequested() => $_clearField(4);
@$pb.TagNumber(5)
$fixnum.Int64 get createdAtUnixTimestamp => $_getI64(4);
@$pb.TagNumber(5)
set createdAtUnixTimestamp($fixnum.Int64 value) => $_setInt64(4, value);
@$pb.TagNumber(5)
$core.bool hasCreatedAtUnixTimestamp() => $_has(4);
@$pb.TagNumber(5)
void clearCreatedAtUnixTimestamp() => $_clearField(5);
}
class Response_Transaction extends $pb.GeneratedMessage {
factory Response_Transaction() => create();
class Response_Vouchers extends $pb.GeneratedMessage {
factory Response_Vouchers({
$core.Iterable<Response_Voucher>? vouchers,
}) {
final result = create();
if (vouchers != null) result.vouchers.addAll(vouchers);
return result;
}
Response_Transaction._();
Response_Vouchers._();
factory Response_Transaction.fromBuffer($core.List<$core.int> data,
factory Response_Vouchers.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory Response_Transaction.fromJson($core.String json,
factory Response_Vouchers.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'Response.Transaction',
_omitMessageNames ? '' : 'Response.Vouchers',
package:
const $pb.PackageName(_omitMessageNames ? '' : 'server_to_client'),
createEmptyInstance: create)
..pPM<Response_Voucher>(1, _omitFieldNames ? '' : 'vouchers',
subBuilder: Response_Voucher.create)
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
Response_Transaction clone() => deepCopy();
Response_Vouchers clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
Response_Transaction copyWith(void Function(Response_Transaction) updates) =>
super.copyWith((message) => updates(message as Response_Transaction))
as Response_Transaction;
Response_Vouchers copyWith(void Function(Response_Vouchers) updates) =>
super.copyWith((message) => updates(message as Response_Vouchers))
as Response_Vouchers;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static Response_Transaction create() => Response_Transaction._();
static Response_Vouchers create() => Response_Vouchers._();
@$core.override
Response_Transaction createEmptyInstance() => create();
Response_Vouchers createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static Response_Transaction getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<Response_Transaction>(create);
static Response_Transaction? _defaultInstance;
static Response_Vouchers getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<Response_Vouchers>(create);
static Response_Vouchers? _defaultInstance;
@$pb.TagNumber(1)
$pb.PbList<Response_Voucher> get vouchers => $_getList(0);
}
class Response_PlanBallance extends $pb.GeneratedMessage {
@ -1032,6 +1195,85 @@ class Response_PlanBallance extends $pb.GeneratedMessage {
void clearAdditionalAccountOwnerId() => $_clearField(8);
}
class Response_Location extends $pb.GeneratedMessage {
factory Response_Location({
$core.String? county,
$core.String? region,
$core.String? city,
}) {
final result = create();
if (county != null) result.county = county;
if (region != null) result.region = region;
if (city != null) result.city = city;
return result;
}
Response_Location._();
factory Response_Location.fromBuffer($core.List<$core.int> data,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromBuffer(data, registry);
factory Response_Location.fromJson($core.String json,
[$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
create()..mergeFromJson(json, registry);
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
_omitMessageNames ? '' : 'Response.Location',
package:
const $pb.PackageName(_omitMessageNames ? '' : 'server_to_client'),
createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'county')
..aOS(2, _omitFieldNames ? '' : 'region')
..aOS(3, _omitFieldNames ? '' : 'city')
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
Response_Location clone() => deepCopy();
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
Response_Location copyWith(void Function(Response_Location) updates) =>
super.copyWith((message) => updates(message as Response_Location))
as Response_Location;
@$core.override
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static Response_Location create() => Response_Location._();
@$core.override
Response_Location createEmptyInstance() => create();
@$core.pragma('dart2js:noInline')
static Response_Location getDefault() => _defaultInstance ??=
$pb.GeneratedMessage.$_defaultFor<Response_Location>(create);
static Response_Location? _defaultInstance;
@$pb.TagNumber(1)
$core.String get county => $_getSZ(0);
@$pb.TagNumber(1)
set county($core.String value) => $_setString(0, value);
@$pb.TagNumber(1)
$core.bool hasCounty() => $_has(0);
@$pb.TagNumber(1)
void clearCounty() => $_clearField(1);
@$pb.TagNumber(2)
$core.String get region => $_getSZ(1);
@$pb.TagNumber(2)
set region($core.String value) => $_setString(1, value);
@$pb.TagNumber(2)
$core.bool hasRegion() => $_has(1);
@$pb.TagNumber(2)
void clearRegion() => $_clearField(2);
@$pb.TagNumber(3)
$core.String get city => $_getSZ(2);
@$pb.TagNumber(3)
set city($core.String value) => $_setString(2, value);
@$pb.TagNumber(3)
$core.bool hasCity() => $_has(2);
@$pb.TagNumber(3)
void clearCity() => $_clearField(3);
}
class Response_PreKey extends $pb.GeneratedMessage {
factory Response_PreKey({
$fixnum.Int64? id,
@ -1512,11 +1754,11 @@ enum Response_Ok_Ok {
uploadtoken,
userdata,
authtoken,
deprecated7,
location,
authenticated,
plans,
planballance,
deprecated11,
vouchers,
addaccountsinvites,
downloadtokens,
signedprekey,
@ -1532,11 +1774,11 @@ class Response_Ok extends $pb.GeneratedMessage {
Response_UploadToken? uploadtoken,
Response_UserData? userdata,
$core.List<$core.int>? authtoken,
Response_Deprecated? deprecated7,
Response_Location? location,
Response_Authenticated? authenticated,
Response_Plans? plans,
Response_PlanBallance? planballance,
Response_Deprecated? deprecated11,
Response_Vouchers? vouchers,
Response_AddAccountsInvites? addaccountsinvites,
Response_DownloadTokens? downloadtokens,
Response_SignedPreKey? signedprekey,
@ -1549,11 +1791,11 @@ class Response_Ok extends $pb.GeneratedMessage {
if (uploadtoken != null) result.uploadtoken = uploadtoken;
if (userdata != null) result.userdata = userdata;
if (authtoken != null) result.authtoken = authtoken;
if (deprecated7 != null) result.deprecated7 = deprecated7;
if (location != null) result.location = location;
if (authenticated != null) result.authenticated = authenticated;
if (plans != null) result.plans = plans;
if (planballance != null) result.planballance = planballance;
if (deprecated11 != null) result.deprecated11 = deprecated11;
if (vouchers != null) result.vouchers = vouchers;
if (addaccountsinvites != null)
result.addaccountsinvites = addaccountsinvites;
if (downloadtokens != null) result.downloadtokens = downloadtokens;
@ -1578,11 +1820,11 @@ class Response_Ok extends $pb.GeneratedMessage {
4: Response_Ok_Ok.uploadtoken,
5: Response_Ok_Ok.userdata,
6: Response_Ok_Ok.authtoken,
7: Response_Ok_Ok.deprecated7,
7: Response_Ok_Ok.location,
8: Response_Ok_Ok.authenticated,
9: Response_Ok_Ok.plans,
10: Response_Ok_Ok.planballance,
11: Response_Ok_Ok.deprecated11,
11: Response_Ok_Ok.vouchers,
12: Response_Ok_Ok.addaccountsinvites,
13: Response_Ok_Ok.downloadtokens,
14: Response_Ok_Ok.signedprekey,
@ -1605,16 +1847,16 @@ class Response_Ok extends $pb.GeneratedMessage {
subBuilder: Response_UserData.create)
..a<$core.List<$core.int>>(
6, _omitFieldNames ? '' : 'authtoken', $pb.PbFieldType.OY)
..aOM<Response_Deprecated>(7, _omitFieldNames ? '' : 'deprecated7',
protoName: 'deprecated_7', subBuilder: Response_Deprecated.create)
..aOM<Response_Location>(7, _omitFieldNames ? '' : 'location',
subBuilder: Response_Location.create)
..aOM<Response_Authenticated>(8, _omitFieldNames ? '' : 'authenticated',
subBuilder: Response_Authenticated.create)
..aOM<Response_Plans>(9, _omitFieldNames ? '' : 'plans',
subBuilder: Response_Plans.create)
..aOM<Response_PlanBallance>(10, _omitFieldNames ? '' : 'planballance',
subBuilder: Response_PlanBallance.create)
..aOM<Response_Deprecated>(11, _omitFieldNames ? '' : 'deprecated11',
protoName: 'deprecated_11', subBuilder: Response_Deprecated.create)
..aOM<Response_Vouchers>(11, _omitFieldNames ? '' : 'vouchers',
subBuilder: Response_Vouchers.create)
..aOM<Response_AddAccountsInvites>(
12, _omitFieldNames ? '' : 'addaccountsinvites',
subBuilder: Response_AddAccountsInvites.create)
@ -1737,15 +1979,15 @@ class Response_Ok extends $pb.GeneratedMessage {
void clearAuthtoken() => $_clearField(6);
@$pb.TagNumber(7)
Response_Deprecated get deprecated7 => $_getN(6);
Response_Location get location => $_getN(6);
@$pb.TagNumber(7)
set deprecated7(Response_Deprecated value) => $_setField(7, value);
set location(Response_Location value) => $_setField(7, value);
@$pb.TagNumber(7)
$core.bool hasDeprecated7() => $_has(6);
$core.bool hasLocation() => $_has(6);
@$pb.TagNumber(7)
void clearDeprecated7() => $_clearField(7);
void clearLocation() => $_clearField(7);
@$pb.TagNumber(7)
Response_Deprecated ensureDeprecated7() => $_ensure(6);
Response_Location ensureLocation() => $_ensure(6);
@$pb.TagNumber(8)
Response_Authenticated get authenticated => $_getN(7);
@ -1781,15 +2023,15 @@ class Response_Ok extends $pb.GeneratedMessage {
Response_PlanBallance ensurePlanballance() => $_ensure(9);
@$pb.TagNumber(11)
Response_Deprecated get deprecated11 => $_getN(10);
Response_Vouchers get vouchers => $_getN(10);
@$pb.TagNumber(11)
set deprecated11(Response_Deprecated value) => $_setField(11, value);
set vouchers(Response_Vouchers value) => $_setField(11, value);
@$pb.TagNumber(11)
$core.bool hasDeprecated11() => $_has(10);
$core.bool hasVouchers() => $_has(10);
@$pb.TagNumber(11)
void clearDeprecated11() => $_clearField(11);
void clearVouchers() => $_clearField(11);
@$pb.TagNumber(11)
Response_Deprecated ensureDeprecated11() => $_ensure(10);
Response_Vouchers ensureVouchers() => $_ensure(10);
@$pb.TagNumber(12)
Response_AddAccountsInvites get addaccountsinvites => $_getN(11);

View file

@ -9,3 +9,48 @@
// ignore_for_file: curly_braces_in_flow_control_structures
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
// ignore_for_file: non_constant_identifier_names, prefer_relative_imports
import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;
class Response_TransactionTypes extends $pb.ProtobufEnum {
static const Response_TransactionTypes Refund =
Response_TransactionTypes._(0, _omitEnumNames ? '' : 'Refund');
static const Response_TransactionTypes VoucherRedeemed =
Response_TransactionTypes._(1, _omitEnumNames ? '' : 'VoucherRedeemed');
static const Response_TransactionTypes VoucherCreated =
Response_TransactionTypes._(2, _omitEnumNames ? '' : 'VoucherCreated');
static const Response_TransactionTypes Cash =
Response_TransactionTypes._(3, _omitEnumNames ? '' : 'Cash');
static const Response_TransactionTypes PlanUpgrade =
Response_TransactionTypes._(4, _omitEnumNames ? '' : 'PlanUpgrade');
static const Response_TransactionTypes Unknown =
Response_TransactionTypes._(5, _omitEnumNames ? '' : 'Unknown');
static const Response_TransactionTypes ThanksForTesting =
Response_TransactionTypes._(6, _omitEnumNames ? '' : 'ThanksForTesting');
static const Response_TransactionTypes AutoRenewal =
Response_TransactionTypes._(7, _omitEnumNames ? '' : 'AutoRenewal');
static const $core.List<Response_TransactionTypes> values =
<Response_TransactionTypes>[
Refund,
VoucherRedeemed,
VoucherCreated,
Cash,
PlanUpgrade,
Unknown,
ThanksForTesting,
AutoRenewal,
];
static final $core.List<Response_TransactionTypes?> _byValue =
$pb.ProtobufEnum.$_initByValueList(values, 7);
static Response_TransactionTypes? valueOf($core.int value) =>
value < 0 || value >= _byValue.length ? null : _byValue[value];
const Response_TransactionTypes._(super.value, super.name);
}
const $core.bool _omitEnumNames =
$core.bool.fromEnvironment('protobuf.omit_enum_names');

View file

@ -166,10 +166,12 @@ const Response$json = {
Response_Plans$json,
Response_AddAccountsInvite$json,
Response_AddAccountsInvites$json,
Response_AdditionalAccount$json,
Response_Deprecated$json,
Response_Transaction$json,
Response_AdditionalAccount$json,
Response_Voucher$json,
Response_Vouchers$json,
Response_PlanBallance$json,
Response_Location$json,
Response_PreKey$json,
Response_SignedPreKey$json,
Response_UserData$json,
@ -178,6 +180,7 @@ const Response$json = {
Response_ProofOfWork$json,
Response_Ok$json
],
'4': [Response_TransactionTypes$json],
'8': [
{'1': 'Response'},
],
@ -282,6 +285,29 @@ const Response_AddAccountsInvites$json = {
],
};
@$core.Deprecated('Use responseDescriptor instead')
const Response_Transaction$json = {
'1': 'Transaction',
'2': [
{'1': 'deposit_cents', '3': 1, '4': 1, '5': 3, '10': 'depositCents'},
{
'1': 'transaction_type',
'3': 2,
'4': 1,
'5': 14,
'6': '.server_to_client.Response.TransactionTypes',
'10': 'transactionType'
},
{
'1': 'created_at_unix_timestamp',
'3': 3,
'4': 1,
'5': 3,
'10': 'createdAtUnixTimestamp'
},
],
};
@$core.Deprecated('Use responseDescriptor instead')
const Response_AdditionalAccount$json = {
'1': 'AdditionalAccount',
@ -292,13 +318,36 @@ const Response_AdditionalAccount$json = {
};
@$core.Deprecated('Use responseDescriptor instead')
const Response_Deprecated$json = {
'1': 'Deprecated',
const Response_Voucher$json = {
'1': 'Voucher',
'2': [
{'1': 'voucher_id', '3': 1, '4': 1, '5': 9, '10': 'voucherId'},
{'1': 'value_cents', '3': 2, '4': 1, '5': 3, '10': 'valueCents'},
{'1': 'redeemed', '3': 3, '4': 1, '5': 8, '10': 'redeemed'},
{'1': 'requested', '3': 4, '4': 1, '5': 8, '10': 'requested'},
{
'1': 'created_at_unix_timestamp',
'3': 5,
'4': 1,
'5': 3,
'10': 'createdAtUnixTimestamp'
},
],
};
@$core.Deprecated('Use responseDescriptor instead')
const Response_Transaction$json = {
'1': 'Transaction',
const Response_Vouchers$json = {
'1': 'Vouchers',
'2': [
{
'1': 'vouchers',
'3': 1,
'4': 3,
'5': 11,
'6': '.server_to_client.Response.Voucher',
'10': 'vouchers'
},
],
};
@$core.Deprecated('Use responseDescriptor instead')
@ -380,6 +429,16 @@ const Response_PlanBallance$json = {
],
};
@$core.Deprecated('Use responseDescriptor instead')
const Response_Location$json = {
'1': 'Location',
'2': [
{'1': 'county', '3': 1, '4': 1, '5': 9, '10': 'county'},
{'1': 'region', '3': 2, '4': 1, '5': 9, '10': 'region'},
{'1': 'city', '3': 3, '4': 1, '5': 9, '10': 'city'},
],
};
@$core.Deprecated('Use responseDescriptor instead')
const Response_PreKey$json = {
'1': 'PreKey',
@ -543,13 +602,13 @@ const Response_Ok$json = {
},
{'1': 'authtoken', '3': 6, '4': 1, '5': 12, '9': 0, '10': 'authtoken'},
{
'1': 'deprecated_7',
'1': 'location',
'3': 7,
'4': 1,
'5': 11,
'6': '.server_to_client.Response.Deprecated',
'6': '.server_to_client.Response.Location',
'9': 0,
'10': 'deprecated7'
'10': 'location'
},
{
'1': 'authenticated',
@ -579,13 +638,13 @@ const Response_Ok$json = {
'10': 'planballance'
},
{
'1': 'deprecated_11',
'1': 'vouchers',
'3': 11,
'4': 1,
'5': 11,
'6': '.server_to_client.Response.Deprecated',
'6': '.server_to_client.Response.Vouchers',
'9': 0,
'10': 'deprecated11'
'10': 'vouchers'
},
{
'1': 'addaccountsinvites',
@ -629,6 +688,21 @@ const Response_Ok$json = {
],
};
@$core.Deprecated('Use responseDescriptor instead')
const Response_TransactionTypes$json = {
'1': 'TransactionTypes',
'2': [
{'1': 'Refund', '2': 0},
{'1': 'VoucherRedeemed', '2': 1},
{'1': 'VoucherCreated', '2': 2},
{'1': 'Cash', '2': 3},
{'1': 'PlanUpgrade', '2': 4},
{'1': 'Unknown', '2': 5},
{'1': 'ThanksForTesting', '2': 6},
{'1': 'AutoRenewal', '2': 7},
],
};
/// Descriptor for `Response`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List responseDescriptor = $convert.base64Decode(
'CghSZXNwb25zZRIvCgJvaxgBIAEoCzIdLnNlcnZlcl90b19jbGllbnQuUmVzcG9uc2UuT2tIAF'
@ -646,53 +720,64 @@ final $typed_data.Uint8List responseDescriptor = $convert.base64Decode(
'bnQuUmVzcG9uc2UuUGxhblIFcGxhbnMaTQoRQWRkQWNjb3VudHNJbnZpdGUSFwoHcGxhbl9pZB'
'gBIAEoCVIGcGxhbklkEh8KC2ludml0ZV9jb2RlGAIgASgJUgppbnZpdGVDb2RlGlwKEkFkZEFj'
'Y291bnRzSW52aXRlcxJGCgdpbnZpdGVzGAEgAygLMiwuc2VydmVyX3RvX2NsaWVudC5SZXNwb2'
'5zZS5BZGRBY2NvdW50c0ludml0ZVIHaW52aXRlcxpFChFBZGRpdGlvbmFsQWNjb3VudBIXCgd1'
'c2VyX2lkGAEgASgDUgZ1c2VySWQSFwoHcGxhbl9pZBgDIAEoCVIGcGxhbklkGgwKCkRlcHJlY2'
'F0ZWQaDQoLVHJhbnN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f'
'Y2xpZW50LlJlc3BvbnNlLlZvdWNoZXJzSABSCHZvdWNoZXJzEl8KEmFkZGFjY291bnRzaW52aX'
'RlcxgMIAEoCzItLnNlcnZlcl90b19jbGllbnQuUmVzcG9uc2UuQWRkQWNjb3VudHNJbnZpdGVz'
'SABSEmFkZGFjY291bnRzaW52aXRlcxJTCg5kb3dubG9hZHRva2VucxgNIAEoCzIpLnNlcnZlcl'
'90b19jbGllbnQuUmVzcG9uc2UuRG93bmxvYWRUb2tlbnNIAFIOZG93bmxvYWR0b2tlbnMSTQoM'
'c2lnbmVkcHJla2V5GA4gASgLMicuc2VydmVyX3RvX2NsaWVudC5SZXNwb25zZS5TaWduZWRQcm'
'VLZXlIAFIMc2lnbmVkcHJla2V5EkoKC3Byb29mT2ZXb3JrGA8gASgLMiYuc2VydmVyX3RvX2Ns'
'aWVudC5SZXNwb25zZS5Qcm9vZk9mV29ya0gAUgtwcm9vZk9mV29ya0IECgJPayKWAQoQVHJhbn'
'NhY3Rpb25UeXBlcxIKCgZSZWZ1bmQQABITCg9Wb3VjaGVyUmVkZWVtZWQQARISCg5Wb3VjaGVy'
'Q3JlYXRlZBACEggKBENhc2gQAxIPCgtQbGFuVXBncmFkZRAEEgsKB1Vua25vd24QBRIUChBUaG'
'Fua3NGb3JUZXN0aW5nEAYSDwoLQXV0b1JlbmV3YWwQB0IKCghSZXNwb25zZQ==');

View file

@ -11,12 +11,10 @@ message AdditionalMessageData {
LINK = 0;
CONTACTS = 1;
RESTORED_FLAME_COUNTER = 2;
ASK_ABOUT_USER = 3;
}
Type type = 1;
optional string link = 2;
repeated SharedContact contacts = 3;
optional int64 restored_flame_counter = 4;
optional int64 ask_about_user_id = 5;
}

View file

@ -105,7 +105,6 @@ class AdditionalMessageData extends $pb.GeneratedMessage {
$core.String? link,
$core.Iterable<SharedContact>? contacts,
$fixnum.Int64? restoredFlameCounter,
$fixnum.Int64? askAboutUserId,
}) {
final result = create();
if (type != null) result.type = type;
@ -113,7 +112,6 @@ class AdditionalMessageData extends $pb.GeneratedMessage {
if (contacts != null) result.contacts.addAll(contacts);
if (restoredFlameCounter != null)
result.restoredFlameCounter = restoredFlameCounter;
if (askAboutUserId != null) result.askAboutUserId = askAboutUserId;
return result;
}
@ -135,7 +133,6 @@ class AdditionalMessageData extends $pb.GeneratedMessage {
..pPM<SharedContact>(3, _omitFieldNames ? '' : 'contacts',
subBuilder: SharedContact.create)
..aInt64(4, _omitFieldNames ? '' : 'restoredFlameCounter')
..aInt64(5, _omitFieldNames ? '' : 'askAboutUserId')
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
@ -187,15 +184,6 @@ class AdditionalMessageData extends $pb.GeneratedMessage {
$core.bool hasRestoredFlameCounter() => $_has(3);
@$pb.TagNumber(4)
void clearRestoredFlameCounter() => $_clearField(4);
@$pb.TagNumber(5)
$fixnum.Int64 get askAboutUserId => $_getI64(4);
@$pb.TagNumber(5)
set askAboutUserId($fixnum.Int64 value) => $_setInt64(4, value);
@$pb.TagNumber(5)
$core.bool hasAskAboutUserId() => $_has(4);
@$pb.TagNumber(5)
void clearAskAboutUserId() => $_clearField(5);
}
const $core.bool _omitFieldNames =

View file

@ -22,19 +22,16 @@ class AdditionalMessageData_Type extends $pb.ProtobufEnum {
static const AdditionalMessageData_Type RESTORED_FLAME_COUNTER =
AdditionalMessageData_Type._(
2, _omitEnumNames ? '' : 'RESTORED_FLAME_COUNTER');
static const AdditionalMessageData_Type ASK_ABOUT_USER =
AdditionalMessageData_Type._(3, _omitEnumNames ? '' : 'ASK_ABOUT_USER');
static const $core.List<AdditionalMessageData_Type> values =
<AdditionalMessageData_Type>[
LINK,
CONTACTS,
RESTORED_FLAME_COUNTER,
ASK_ABOUT_USER,
];
static final $core.List<AdditionalMessageData_Type?> _byValue =
$pb.ProtobufEnum.$_initByValueList(values, 3);
$pb.ProtobufEnum.$_initByValueList(values, 2);
static AdditionalMessageData_Type? valueOf($core.int value) =>
value < 0 || value >= _byValue.length ? null : _byValue[value];

View file

@ -67,21 +67,11 @@ const AdditionalMessageData$json = {
'10': 'restoredFlameCounter',
'17': true
},
{
'1': 'ask_about_user_id',
'3': 5,
'4': 1,
'5': 3,
'9': 2,
'10': 'askAboutUserId',
'17': true
},
],
'4': [AdditionalMessageData_Type$json],
'8': [
{'1': '_link'},
{'1': '_restored_flame_counter'},
{'1': '_ask_about_user_id'},
],
};
@ -92,7 +82,6 @@ const AdditionalMessageData_Type$json = {
{'1': 'LINK', '2': 0},
{'1': 'CONTACTS', '2': 1},
{'1': 'RESTORED_FLAME_COUNTER', '2': 2},
{'1': 'ASK_ABOUT_USER', '2': 3},
],
};
@ -101,7 +90,6 @@ final $typed_data.Uint8List additionalMessageDataDescriptor = $convert.base64Dec
'ChVBZGRpdGlvbmFsTWVzc2FnZURhdGESLwoEdHlwZRgBIAEoDjIbLkFkZGl0aW9uYWxNZXNzYW'
'dlRGF0YS5UeXBlUgR0eXBlEhcKBGxpbmsYAiABKAlIAFIEbGlua4gBARIqCghjb250YWN0cxgD'
'IAMoCzIOLlNoYXJlZENvbnRhY3RSCGNvbnRhY3RzEjkKFnJlc3RvcmVkX2ZsYW1lX2NvdW50ZX'
'IYBCABKANIAVIUcmVzdG9yZWRGbGFtZUNvdW50ZXKIAQESLgoRYXNrX2Fib3V0X3VzZXJfaWQY'
'BSABKANIAlIOYXNrQWJvdXRVc2VySWSIAQEiTgoEVHlwZRIICgRMSU5LEAASDAoIQ09OVEFDVF'
'MQARIaChZSRVNUT1JFRF9GTEFNRV9DT1VOVEVSEAISEgoOQVNLX0FCT1VUX1VTRVIQA0IHCgVf'
'bGlua0IZChdfcmVzdG9yZWRfZmxhbWVfY291bnRlckIUChJfYXNrX2Fib3V0X3VzZXJfaWQ=');
'IYBCABKANIAVIUcmVzdG9yZWRGbGFtZUNvdW50ZXKIAQEiOgoEVHlwZRIICgRMSU5LEAASDAoI'
'Q09OVEFDVFMQARIaChZSRVNUT1JFRF9GTEFNRV9DT1VOVEVSEAJCBwoFX2xpbmtCGQoXX3Jlc3'
'RvcmVkX2ZsYW1lX2NvdW50ZXI=');

View file

@ -97,7 +97,6 @@ class PublicProfile extends $pb.GeneratedMessage {
$core.List<$core.int>? signedPrekeySignature,
$fixnum.Int64? signedPrekeyId,
$core.List<$core.int>? secretVerificationToken,
$fixnum.Int64? timestamp,
}) {
final result = create();
if (userId != null) result.userId = userId;
@ -110,7 +109,6 @@ class PublicProfile extends $pb.GeneratedMessage {
if (signedPrekeyId != null) result.signedPrekeyId = signedPrekeyId;
if (secretVerificationToken != null)
result.secretVerificationToken = secretVerificationToken;
if (timestamp != null) result.timestamp = timestamp;
return result;
}
@ -138,7 +136,6 @@ class PublicProfile extends $pb.GeneratedMessage {
..aInt64(7, _omitFieldNames ? '' : 'signedPrekeyId')
..a<$core.List<$core.int>>(
8, _omitFieldNames ? '' : 'secretVerificationToken', $pb.PbFieldType.OY)
..aInt64(9, _omitFieldNames ? '' : 'timestamp')
..hasRequiredFields = false;
@$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
@ -233,15 +230,6 @@ class PublicProfile extends $pb.GeneratedMessage {
$core.bool hasSecretVerificationToken() => $_has(7);
@$pb.TagNumber(8)
void clearSecretVerificationToken() => $_clearField(8);
@$pb.TagNumber(9)
$fixnum.Int64 get timestamp => $_getI64(8);
@$pb.TagNumber(9)
set timestamp($fixnum.Int64 value) => $_setInt64(8, value);
@$pb.TagNumber(9)
$core.bool hasTimestamp() => $_has(8);
@$pb.TagNumber(9)
void clearTimestamp() => $_clearField(9);
}
const $core.bool _omitFieldNames =

View file

@ -77,19 +77,9 @@ const PublicProfile$json = {
'10': 'secretVerificationToken',
'17': true
},
{
'1': 'timestamp',
'3': 9,
'4': 1,
'5': 3,
'9': 1,
'10': 'timestamp',
'17': true
},
],
'8': [
{'1': '_secret_verification_token'},
{'1': '_timestamp'},
],
};
@ -101,5 +91,4 @@ final $typed_data.Uint8List publicProfileDescriptor = $convert.base64Decode(
'lvbl9pZBgFIAEoA1IOcmVnaXN0cmF0aW9uSWQSNgoXc2lnbmVkX3ByZWtleV9zaWduYXR1cmUY'
'BiABKAxSFXNpZ25lZFByZWtleVNpZ25hdHVyZRIoChBzaWduZWRfcHJla2V5X2lkGAcgASgDUg'
'5zaWduZWRQcmVrZXlJZBI/ChlzZWNyZXRfdmVyaWZpY2F0aW9uX3Rva2VuGAggASgMSABSF3Nl'
'Y3JldFZlcmlmaWNhdGlvblRva2VuiAEBEiEKCXRpbWVzdGFtcBgJIAEoA0gBUgl0aW1lc3RhbX'
'CIAQFCHAoaX3NlY3JldF92ZXJpZmljYXRpb25fdG9rZW5CDAoKX3RpbWVzdGFtcA==');
'Y3JldFZlcmlmaWNhdGlvblRva2VuiAEBQhwKGl9zZWNyZXRfdmVyaWZpY2F0aW9uX3Rva2Vu');

View file

@ -17,5 +17,4 @@ message PublicProfile {
bytes signed_prekey_signature = 6;
int64 signed_prekey_id = 7;
optional bytes secret_verification_token = 8;
optional int64 timestamp = 9;
}

View file

@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:twonly/app.dart';
import 'package:twonly/src/constants/routes.keys.dart';
@ -17,13 +16,14 @@ import 'package:twonly/src/visual/views/onboarding/recover.view.dart';
import 'package:twonly/src/visual/views/public_profile.view.dart';
import 'package:twonly/src/visual/views/settings/account.view.dart';
import 'package:twonly/src/visual/views/settings/appearance.view.dart';
import 'package:twonly/src/visual/views/settings/backup/backup_server.view.dart';
import 'package:twonly/src/visual/views/settings/backup/backup_settings.view.dart';
import 'package:twonly/src/visual/views/settings/backup/backup_setup.view.dart';
import 'package:twonly/src/visual/views/settings/chat/chat_reactions.view.dart';
import 'package:twonly/src/visual/views/settings/chat/chat_settings.view.dart';
import 'package:twonly/src/visual/views/settings/data_and_storage.view.dart';
import 'package:twonly/src/visual/views/settings/data_and_storage/import_from_gallery.view.dart';
import 'package:twonly/src/visual/views/settings/data_and_storage/manage_storage.view.dart';
import 'package:twonly/src/visual/views/settings/data_and_storage/export_media.view.dart';
import 'package:twonly/src/visual/views/settings/data_and_storage/import_media.view.dart';
import 'package:twonly/src/visual/views/settings/developer/automated_testing.view.dart';
import 'package:twonly/src/visual/views/settings/developer/developer.view.dart';
import 'package:twonly/src/visual/views/settings/developer/reduce_flames.view.dart';
@ -38,7 +38,6 @@ import 'package:twonly/src/visual/views/settings/help/help.view.dart';
import 'package:twonly/src/visual/views/settings/notification.view.dart';
import 'package:twonly/src/visual/views/settings/privacy.view.dart';
import 'package:twonly/src/visual/views/settings/privacy/block_users.view.dart';
import 'package:twonly/src/visual/views/settings/privacy/profile_selection.view.dart';
import 'package:twonly/src/visual/views/settings/privacy/user_discovery.view.dart';
import 'package:twonly/src/visual/views/settings/profile/modify_avatar.view.dart';
import 'package:twonly/src/visual/views/settings/profile/profile.view.dart';
@ -48,10 +47,7 @@ import 'package:twonly/src/visual/views/settings/subscription/subscription.view.
import 'package:twonly/src/visual/views/user_study/user_study_questionnaire.view.dart';
import 'package:twonly/src/visual/views/user_study/user_study_welcome.view.dart';
final GlobalKey<NavigatorState> rootNavigatorKey = GlobalKey<NavigatorState>();
final routerProvider = GoRouter(
navigatorKey: rootNavigatorKey,
routes: [
GoRoute(
path: Routes.home,
@ -169,6 +165,10 @@ final routerProvider = GoRouter(
path: 'backup',
builder: (context, state) => const BackupView(),
routes: [
GoRoute(
path: 'server',
builder: (context, state) => const BackupServerView(),
),
GoRoute(
path: 'recovery',
builder: (context, state) => const BackupRecoveryView(),
@ -205,10 +205,6 @@ final routerProvider = GoRouter(
path: 'user_discovery',
builder: (context, state) => const UserDiscoverySettingsView(),
),
GoRoute(
path: 'profile_selection',
builder: (context, state) => const ProfileSelectionSettingsView(),
),
],
),
GoRoute(
@ -220,12 +216,12 @@ final routerProvider = GoRouter(
builder: (context, state) => const DataAndStorageView(),
routes: [
GoRoute(
path: 'manage',
builder: (context, state) => const ManageStorageView(),
path: 'import',
builder: (context, state) => const ImportMediaView(),
),
GoRoute(
path: 'import_gallery',
builder: (context, state) => const ImportFromGalleryView(),
path: 'export',
builder: (context, state) => const ExportMediaView(),
),
],
),

View file

@ -1,25 +0,0 @@
import 'package:flutter/services.dart';
class AndroidPhotoPickerService {
static const MethodChannel _channel = MethodChannel('eu.twonly/photo_picker');
/// Launches the native Android Photo Picker and returns a list of URIs.
static Future<List<String>> pickImages() async {
try {
final result = await _channel.invokeListMethod<String>('pickImages');
return result ?? [];
} catch (e) {
return [];
}
}
/// Reads the raw bytes from a content URI using the Android ContentResolver.
static Future<Uint8List?> getUriBytes(String uri) async {
try {
final bytes = await _channel.invokeMethod<Uint8List>('getUriBytes', {'uri': uri});
return bytes;
} catch (e) {
return null;
}
}
}

View file

@ -15,13 +15,14 @@ import 'package:flutter/foundation.dart';
import 'package:libsignal_protocol_dart/src/ecc/ed25519.dart';
import 'package:mutex/mutex.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:twonly/core/bridge/wrapper/key_manager.dart';
import 'package:twonly/globals.dart';
import 'package:twonly/locator.dart';
import 'package:twonly/src/constants/secure_storage.keys.dart';
import 'package:twonly/src/database/twonly.db.dart';
import 'package:twonly/src/model/protobuf/api/websocket/client_to_server.pbserver.dart';
import 'package:twonly/src/model/protobuf/api/websocket/error.pb.dart';
import 'package:twonly/src/model/protobuf/api/websocket/server_to_client.pb.dart' as server;
import 'package:twonly/src/model/protobuf/api/websocket/server_to_client.pb.dart'
as server;
import 'package:twonly/src/model/protobuf/api/websocket/server_to_client.pbserver.dart';
import 'package:twonly/src/services/api/client2client/user_discovery.c2c.dart';
import 'package:twonly/src/services/api/mediafiles/download.api.dart';
@ -30,7 +31,7 @@ import 'package:twonly/src/services/api/messages.api.dart';
import 'package:twonly/src/services/api/server_messages.api.dart';
import 'package:twonly/src/services/api/utils.api.dart';
import 'package:twonly/src/services/flame.service.dart';
import 'package:twonly/src/services/group.service.dart';
import 'package:twonly/src/services/group.services.dart';
import 'package:twonly/src/services/notifications/fcm.notifications.dart';
import 'package:twonly/src/services/notifications/pushkeys.notifications.dart';
import 'package:twonly/src/services/signal/identity.signal.dart';
@ -59,19 +60,19 @@ class ApiService {
// final String apiHost = kReleaseMode ? 'api.twonly.eu' : 'dev.twonly.eu';
final String apiSecure = kReleaseMode ? 's' : 's';
String get apiEndpoint => 'http$apiSecure://$apiHost/api/';
final _planUpdateController = StreamController<SubscriptionPlan>.broadcast();
Stream<SubscriptionPlan> get onPlanUpdated => _planUpdateController.stream;
final _connectionStateController = StreamController<bool>.broadcast();
Stream<bool> get onConnectionStateUpdated => _connectionStateController.stream;
Stream<bool> get onConnectionStateUpdated =>
_connectionStateController.stream;
final _appOutdatedController = StreamController<void>.broadcast();
Stream<void> get onAppOutdated => _appOutdatedController.stream;
final _newDeviceRegisteredController = StreamController<void>.broadcast();
Stream<void> get onNewDeviceRegistered => _newDeviceRegisteredController.stream;
Stream<void> get onNewDeviceRegistered =>
_newDeviceRegisteredController.stream;
bool appIsOutdated = false;
bool isAuthenticated = false;
@ -80,7 +81,8 @@ class ApiService {
Timer? reconnectionTimer;
int _reconnectionDelay = 5;
final HashMap<Int64, Completer<server.ServerToClient?>> _pendingRequests = HashMap();
final HashMap<Int64, Completer<server.ServerToClient?>> _pendingRequests =
HashMap();
IOWebSocketChannel? _channel;
// ignore: cancel_subscriptions
StreamSubscription<List<ConnectivityResult>>? _connectivitySubscription;
@ -90,22 +92,13 @@ class ApiService {
try {
final channel = IOWebSocketChannel.connect(
Uri.parse(apiUrl),
pingInterval: const Duration(seconds: 30),
);
try {
await channel.ready.timeout(const Duration(seconds: 10));
} catch (e) {
channel.sink.close().ignore();
rethrow;
}
_channel = channel;
_channel!.stream.listen(_onData, onDone: _onDone, onError: _onError);
await _channel!.ready;
Log.info('websocket connected to $apiUrl');
return true;
} catch (e) {
_channel = null;
} catch (_) {
return false;
}
}
@ -129,7 +122,7 @@ class ApiService {
twonlyDB.markUpdated();
unawaited(syncFlameCounters());
unawaited(setupNotificationWithUsers());
unawaited(SignalIdentityService.onAuthenticated());
unawaited(signalHandleNewServerConnection());
resetResyncedUsers();
resetUserDiscoveryRequestUpdates();
unawaited(fetchGroupStatesForUnjoinedGroups());
@ -152,7 +145,6 @@ class ApiService {
}
Future<void> onClosed() async {
if (_channel == null) return;
Log.info('websocket connection closed');
_channel = null;
isAuthenticated = false;
@ -184,19 +176,15 @@ class ApiService {
_reconnectionDelay = 3;
}
Future<void> close(Function? callback) async {
Future<void> close(Function callback) async {
Log.info('closing websocket connection');
if (_channel != null) {
try {
await _channel!.sink.close().timeout(const Duration(seconds: 2));
} catch (e) {
Log.warn('Timeout or error closing websocket: $e');
}
await _channel!.sink.close();
await onClosed();
callback?.call();
callback();
return;
}
callback?.call();
callback();
}
Future<void> listenToNetworkChanges() async {
@ -254,16 +242,13 @@ class ApiService {
Future<void> _onData(dynamic msgBuffer) async {
try {
if (msgBuffer is! Uint8List) {
msgBuffer = Uint8List.fromList(msgBuffer as List<int>);
}
final msg = server.ServerToClient.fromBuffer(msgBuffer);
final msg = server.ServerToClient.fromBuffer(msgBuffer as Uint8List);
if (msg.v0.hasResponse()) {
await removeFromRetransmissionBuffer(msg.v0.seq);
final completer = _pendingRequests.remove(msg.v0.seq);
if (completer != null && !completer.isCompleted) {
completer.complete(msg);
}
unawaited(removeFromRetransmissionBuffer(msg.v0.seq));
} else {
unawaited(handleServerMessage(msg));
}
@ -418,7 +403,9 @@ class ApiService {
}
if (res.error == ErrorCode.UserIdNotFound && contactId != null) {
Log.warn('Contact deleted their account $contactId.');
final contact = await twonlyDB.contactsDao.getContactByUserId(contactId).getSingleOrNull();
final contact = await twonlyDB.contactsDao
.getContactByUserId(contactId)
.getSingleOrNull();
if (contact != null) {
await twonlyDB.contactsDao.updateContact(
contactId,
@ -427,7 +414,6 @@ class ApiService {
),
);
}
await twonlyDB.receiptsDao.deleteReceiptForUser(contactId);
}
}
return res;
@ -435,7 +421,7 @@ class ApiService {
Future<bool> tryAuthenticateWithToken() async {
final apiAuthToken = await SecureStorage.instance.read(
key: 'api_auth_token',
key: SecureStorageKeys.apiAuthToken,
);
if (apiAuthToken != null) {
@ -464,26 +450,12 @@ class ApiService {
await onAuthenticated();
} else {
unawaited(onAuthenticated());
try {
Log.info('Switching authentication to login token');
final loginToken = await RustKeyManager.getLoginToken();
final res = await _setLoginToken(loginToken);
if (res.isSuccess) {
Log.info('Switch was successfully.');
await UserService.update((u) => u.canUseLoginTokenForAuth = true);
await SecureStorage.instance.delete(
key: 'api_auth_token',
);
}
} catch (e) {
Log.error(e);
}
}
return true;
}
if (result.isError) {
if (result.error != ErrorCode.AuthTokenNotValid && result.error != ErrorCode.ForegroundSessionConnected) {
if (result.error != ErrorCode.AuthTokenNotValid &&
result.error != ErrorCode.ForegroundSessionConnected) {
Log.error(
'got error while authenticating to the server: ${result.error}',
);
@ -494,66 +466,22 @@ class ApiService {
return false;
}
Future<bool> tryAuthenticateWithLoginToken() async {
try {
final loginToken = await RustKeyManager.getLoginToken();
final authenticate = Handshake_AuthenticateWithLoginToken()
..userId = Int64(userService.currentUser.userId)
..appVersion = (await PackageInfo.fromPlatform()).version
..deviceId = Int64(userService.currentUser.deviceId)
..inBackground = AppState.isInBackgroundTask
..secretLoginToken = loginToken.toList();
final handshake = Handshake()..authenticateWithLoginToken = authenticate;
final req = createClientToServerFromHandshake(handshake);
final result = await sendRequestSync(req, authenticated: false);
if (result.isSuccess) {
Log.info('websocket is authenticated');
isAuthenticated = true;
if (AppState.isInBackgroundTask) {
await onAuthenticated();
} else {
unawaited(onAuthenticated());
}
return true;
}
if (result.isError) {
if (result.error != ErrorCode.AuthTokenNotValid && result.error != ErrorCode.ForegroundSessionConnected) {
Log.error(
'got error while authenticating to the server: ${result.error}',
);
return false;
}
}
} catch (e) {
Log.error(e);
}
return false;
}
Future<void> authenticate() async {
return lockAuthentication.protect(() async {
if (isAuthenticated) return;
if (!userService.isUserCreated) {
if (await getSignalIdentity() == null) {
Log.error('Signal identity not found.');
return;
}
if (!userService.isUserCreated) return;
if (userService.currentUser.canUseLoginTokenForAuth) {
await tryAuthenticateWithLoginToken();
return;
}
if (await tryAuthenticateWithToken()) {
return;
}
final handshake = Handshake()..getAuthChallenge = Handshake_GetAuthChallenge();
final handshake = Handshake()
..getAuthChallenge = Handshake_GetAuthChallenge();
final req = createClientToServerFromHandshake(handshake);
final result = await sendRequestSync(req, authenticated: false);
@ -592,7 +520,7 @@ class ApiService {
final apiAuthTokenB64 = base64Encode(apiAuthToken);
await SecureStorage.instance.write(
key: 'api_auth_token',
key: SecureStorageKeys.apiAuthToken,
value: apiAuthTokenB64,
);
@ -614,17 +542,16 @@ class ApiService {
final signedPreKey = (await signalStore.loadSignedPreKeys())[0];
final loginToken = await RustKeyManager.getLoginToken();
final register = Handshake_Register()
..username = username
..publicIdentityKey = (await signalStore.getIdentityKeyPair()).getPublicKey().serialize()
..publicIdentityKey = (await signalStore.getIdentityKeyPair())
.getPublicKey()
.serialize()
..registrationId = Int64(signalIdentity.registrationId)
..signedPrekey = signedPreKey.getKeyPair().publicKey.serialize()
..signedPrekeySignature = signedPreKey.signature
..signedPrekeyId = Int64(signedPreKey.id)
..langCode = ui.PlatformDispatcher.instance.locale.languageCode
..loginToken = loginToken
..proofOfWork = Int64(proofOfWorkResult)
..isIos = Platform.isIOS;
@ -690,28 +617,13 @@ class ApiService {
return sendRequestSync(req, ensureRetransmission: true);
}
Future<Result> _setLoginToken(List<int> token) async {
final get = ApplicationData_SetLoginToken()..loginToken = token;
final appData = ApplicationData()..setLoginToken = get;
Future<Result> getCurrentLocation() async {
final get = ApplicationData_GetLocation();
final appData = ApplicationData()..getLocation = get;
final req = createClientToServerFromApplicationData(appData);
return sendRequestSync(req);
}
Future<int?> getUserIdFromUsername(String username) async {
final appData = Handshake(
getUseridByUsername: Handshake_GetUserIdByUsername(username: username),
);
final req = createClientToServerFromHandshake(appData);
final res = await sendRequestSync(req);
if (res.isSuccess) {
final ok = res.value as server.Response_Ok;
if (ok.hasUserid()) {
return ok.userid.toInt();
}
}
return null;
}
Future<Response_UserData?> getUserData(String username) async {
final get = ApplicationData_GetUserByUsername()..username = username;
final appData = ApplicationData()..getUserByUsername = get;
@ -740,6 +652,27 @@ class ApiService {
return null;
}
Future<Response_Vouchers?> getVoucherList() async {
final get = ApplicationData_GetVouchers();
final appData = ApplicationData()..getVouchers = get;
final req = createClientToServerFromApplicationData(appData);
final res = await sendRequestSync(req);
if (res.isSuccess) {
final ok = res.value as server.Response_Ok;
if (ok.hasVouchers()) {
return ok.vouchers;
}
}
return null;
}
Future<Result> updatePlanOptions(bool autoRenewal) async {
final get = ApplicationData_UpdatePlanOptions()..autoRenewal = autoRenewal;
final appData = ApplicationData()..updatePlanOptions = get;
final req = createClientToServerFromApplicationData(appData);
return sendRequestSync(req);
}
Future<Result> removeAdditionalUser(Int64 userId) async {
final get = ApplicationData_RemoveAdditionalUser()..userId = userId;
final appData = ApplicationData()..removeAdditionalUser = get;
@ -754,6 +687,34 @@ class ApiService {
return sendRequestSync(req, contactId: userId.toInt());
}
Future<Result> buyVoucher(int valueInCents) async {
final get = ApplicationData_CreateVoucher()..valueCents = valueInCents;
final appData = ApplicationData()..createVoucher = get;
final req = createClientToServerFromApplicationData(appData);
return sendRequestSync(req);
}
Future<Result> switchToPayedPlan(
String planId,
bool payMonthly,
bool autoRenewal,
) async {
final get = ApplicationData_SwitchToPayedPlan()
..planId = planId
..payMonthly = payMonthly
..autoRenewal = autoRenewal;
final appData = ApplicationData()..switchtoPayedPlan = get;
final req = createClientToServerFromApplicationData(appData);
return sendRequestSync(req);
}
Future<Result> redeemVoucher(String voucher) async {
final get = ApplicationData_RedeemVoucher()..voucher = voucher;
final appData = ApplicationData()..redeemVoucher = get;
final req = createClientToServerFromApplicationData(appData);
return sendRequestSync(req);
}
Future<Result> reportUser(int userId, String reason) async {
final get = ApplicationData_ReportUser()
..reportedUserId = Int64(userId)
@ -770,6 +731,13 @@ class ApiService {
return sendRequestSync(req);
}
Future<Result> redeemUserInviteCode(String inviteCode) async {
final get = ApplicationData_RedeemAdditionalCode()..inviteCode = inviteCode;
final appData = ApplicationData()..redeemAdditionalCode = get;
final req = createClientToServerFromApplicationData(appData);
return sendRequestSync(req);
}
Future<Result> updateFCMToken(String googleFcm) async {
final get = ApplicationData_UpdateGoogleFcmToken()..googleFcm = googleFcm;
final appData = ApplicationData()..updateGoogleFcmToken = get;

View file

@ -10,10 +10,9 @@ Future<void> handleAdditionalDataMessage(
int fromUserId,
String groupId,
EncryptedContent_AdditionalDataMessage message,
String receiptId,
) async {
Log.info(
'[$receiptId] Got a additional data message: ${message.senderMessageId} from $groupId',
'Got a additional data message: ${message.senderMessageId} from $groupId',
);
// Prevent message overwrite: reject if a message with this ID already
@ -23,7 +22,7 @@ Future<void> handleAdditionalDataMessage(
.getSingleOrNull();
if (existing != null && existing.senderId != fromUserId) {
Log.warn(
'[$receiptId] $fromUserId tried to overwrite message from ${existing.senderId}. Dropping.',
'$fromUserId tried to overwrite message from ${existing.senderId}. Dropping.',
);
return;
}
@ -46,6 +45,6 @@ Future<void> handleAdditionalDataMessage(
fromTimestamp(message.timestamp),
);
if (msg != null) {
Log.info('[$receiptId] Inserted a new text message with ID: ${msg.messageId}');
Log.info('Inserted a new text message with ID: ${msg.messageId}');
}
}

View file

@ -28,6 +28,7 @@ Future<bool> handleNewContactRequest(int fromUserId) async {
await handleContactAccept(fromUserId);
}
// contact was already accepted, so just accept the request in the background.
await sendCipherText(
contact.userId,
EncryptedContent(
@ -35,7 +36,6 @@ Future<bool> handleNewContactRequest(int fromUserId) async {
type: EncryptedContent_ContactRequest_Type.ACCEPT,
),
),
blocking: false,
);
return true;
}
@ -60,15 +60,6 @@ Future<bool> handleNewContactRequest(int fromUserId) async {
}
Future<void> handleContactAccept(int fromUserId) async {
final contact = await twonlyDB.contactsDao
.getContactByUserId(fromUserId)
.getSingleOrNull();
if (contact == null) return;
if (contact.requested || contact.deletedByUser) {
Log.error('User has never send an request. So ignore the Accept.');
return;
}
await twonlyDB.contactsDao.updateContact(
fromUserId,
const ContactsCompanion(
@ -77,28 +68,32 @@ Future<void> handleContactAccept(int fromUserId) async {
deletedByUser: Value(false),
),
);
await twonlyDB.groupsDao.createNewDirectChat(
fromUserId,
GroupsCompanion(
groupName: Value(getContactDisplayName(contact)),
),
);
final contact = await twonlyDB.contactsDao
.getContactByUserId(fromUserId)
.getSingleOrNull();
if (contact != null) {
await twonlyDB.groupsDao.createNewDirectChat(
fromUserId,
GroupsCompanion(
groupName: Value(getContactDisplayName(contact)),
),
);
}
}
Future<bool> handleContactRequest(
int fromUserId,
EncryptedContent_ContactRequest contactRequest,
String receiptId,
) async {
switch (contactRequest.type) {
case EncryptedContent_ContactRequest_Type.REQUEST:
Log.info('[$receiptId] Got a contact request from $fromUserId');
Log.info('Got a contact request from $fromUserId');
return handleNewContactRequest(fromUserId);
case EncryptedContent_ContactRequest_Type.ACCEPT:
Log.info('[$receiptId] Got a contact accept from $fromUserId');
Log.info('Got a contact accept from $fromUserId');
await handleContactAccept(fromUserId);
case EncryptedContent_ContactRequest_Type.REJECT:
Log.info('[$receiptId] Got a contact reject from $fromUserId');
Log.info('Got a contact reject from $fromUserId');
await twonlyDB.contactsDao.updateContact(
fromUserId,
const ContactsCompanion(
@ -115,15 +110,14 @@ Future<void> handleContactUpdate(
int fromUserId,
EncryptedContent_ContactUpdate contactUpdate,
int? senderProfileCounter,
String receiptId,
) async {
switch (contactUpdate.type) {
case EncryptedContent_ContactUpdate_Type.REQUEST:
Log.info('[$receiptId] Got a contact update request from $fromUserId');
Log.info('Got a contact update request from $fromUserId');
await sendContactMyProfileData(fromUserId);
case EncryptedContent_ContactUpdate_Type.UPDATE:
Log.info('[$receiptId] Got a contact update $fromUserId');
Log.info('Got a contact update $fromUserId');
Uint8List? avatarSvgCompressed;
if (contactUpdate.hasAvatarSvgCompressed()) {
avatarSvgCompressed = Uint8List.fromList(
@ -149,8 +143,8 @@ Future<void> handleContactUpdate(
groupId: Value(group.groupId),
type: const Value(GroupActionType.updatedContactUsername),
contactId: Value(fromUserId),
oldGroupName: Value(contact.username),
newGroupName: Value(contactUpdate.username),
oldGroupName: Value('@${contact.username}'),
newGroupName: Value('@${contactUpdate.username}'),
),
);
}
@ -163,7 +157,7 @@ Future<void> handleContactUpdate(
groupId: Value(group.groupId),
type: const Value(GroupActionType.updatedContactDisplayName),
contactId: Value(fromUserId),
oldGroupName: Value(contact.displayName ?? contact.username),
oldGroupName: Value(contact.displayName ?? ''),
newGroupName: Value(contactUpdate.displayName),
),
);
@ -190,9 +184,8 @@ Future<void> handleContactUpdate(
Future<void> handleFlameSync(
String groupId,
EncryptedContent_FlameSync flameSync,
String receiptId,
) async {
Log.info('[$receiptId] Got a flameSync for group $groupId');
Log.info('Got a flameSync for group $groupId');
final group = await twonlyDB.groupsDao.getGroup(groupId);
if (group == null || group.lastFlameCounterChange == null) return;
@ -238,7 +231,6 @@ Future<int?> checkForProfileUpdate(
type: EncryptedContent_ContactUpdate_Type.REQUEST,
),
),
blocking: false,
);
}
}

View file

@ -8,9 +8,8 @@ import 'package:twonly/src/utils/log.dart';
Future<void> handleErrorMessage(
int fromUserId,
EncryptedContent_ErrorMessages error,
String receiptId,
) async {
Log.error('[$receiptId] Got error from $fromUserId: $error');
Log.error('Got error from $fromUserId: $error');
switch (error.type) {
case EncryptedContent_ErrorMessages_Type

View file

@ -8,20 +8,21 @@ import 'package:twonly/src/database/twonly.db.dart';
import 'package:twonly/src/model/protobuf/client/generated/messages.pb.dart';
import 'package:twonly/src/services/api/messages.api.dart';
import 'package:twonly/src/services/api/utils.api.dart';
import 'package:twonly/src/services/group.service.dart';
import 'package:twonly/src/services/group.services.dart';
import 'package:twonly/src/utils/log.dart';
Future<void> handleGroupCreate(
int fromUserId,
String groupId,
EncryptedContent_GroupCreate newGroup,
String receiptId,
) async {
final user = await twonlyDB.contactsDao.getContactByUserId(fromUserId).getSingleOrNull();
final user = await twonlyDB.contactsDao
.getContactByUserId(fromUserId)
.getSingleOrNull();
if (user == null) {
// Only contacts can invite other contacts, so this can (via the UI) not happen.
Log.error(
'[$receiptId] User is not a contact. Aborting.',
'User is not a contact. Aborting.',
);
return;
}
@ -65,7 +66,7 @@ Future<void> handleGroupCreate(
if (group == null) {
Log.error(
'[$receiptId] Could not create new group. Probably because the group already existed.',
'Could not create new group. Probably because the group already existed.',
);
return;
}
@ -107,13 +108,12 @@ Future<void> handleGroupUpdate(
int fromUserId,
String groupId,
EncryptedContent_GroupUpdate update,
String receiptId,
) async {
Log.info('[$receiptId] Got group update for $groupId from $fromUserId');
Log.info('Got group update for $groupId from $fromUserId');
final actionType = groupActionTypeFromString(update.groupActionType);
if (actionType == null) {
Log.error('[$receiptId] Group action ${update.groupActionType} is unknown ignoring.');
Log.error('Group action ${update.groupActionType} is unknown ignoring.');
return;
}
@ -189,11 +189,10 @@ Future<bool> handleGroupJoin(
int fromUserId,
String groupId,
EncryptedContent_GroupJoin join,
String receiptId,
) async {
if (await twonlyDB.contactsDao.getContactById(fromUserId) == null) {
if (!await addNewHiddenContact(fromUserId)) {
Log.error('[$receiptId] Got group join, but could not load contact.');
Log.error('Got group join, but could not load contact.');
// This can happen in case the group join was received before the group create.
// In this case return false, which will cause the receipt to fail and the user
// will resend this message.
@ -214,7 +213,6 @@ Future<void> handleResendGroupPublicKey(
int fromUserId,
String groupId,
EncryptedContent_GroupJoin join,
String receiptId,
) async {
final group = await twonlyDB.groupsDao.getGroup(groupId);
if (group == null || group.myGroupPrivateKey == null) return;
@ -227,7 +225,6 @@ Future<void> handleResendGroupPublicKey(
groupPublicKey: keyPair.getPublicKey().serialize(),
),
),
blocking: false,
);
}
@ -235,7 +232,6 @@ Future<void> handleTypingIndicator(
int fromUserId,
String groupId,
EncryptedContent_TypingIndicator indicator,
String receiptId,
) async {
var lastTypeIndicator = const Value<DateTime?>.absent();

View file

@ -18,10 +18,9 @@ Future<void> handleMedia(
int fromUserId,
String groupId,
EncryptedContent_Media media,
String receiptId,
) async {
Log.info(
'[$receiptId] Got a media message: ${media.senderMessageId} from $groupId with type ${media.type}',
'Got a media message: ${media.senderMessageId} from $groupId with type ${media.type}',
);
late MediaType mediaType;
@ -34,7 +33,7 @@ Future<void> handleMedia(
message.senderId != fromUserId ||
message.mediaId == null) {
Log.warn(
'[$receiptId] Got reupload for a message that either does not exists (${message == null}) or senderId = ${message?.senderId}',
'Got reupload from $fromUserId for a message that either does not exists (${message == null}) or senderId = ${message?.senderId}',
);
return;
}
@ -83,13 +82,13 @@ Future<void> handleMedia(
if (messageTmp != null) {
if (messageTmp.senderId != fromUserId) {
Log.warn(
'[$receiptId] $fromUserId tried to modify the message from ${messageTmp.senderId}.',
'$fromUserId tried to modify the message from ${messageTmp.senderId}.',
);
return;
}
if (messageTmp.mediaId == null) {
Log.warn(
'[$receiptId] This message already exit without a mediaId. Message is dropped.',
'This message already exit without a mediaId. Message is dropped.',
);
return;
}
@ -98,7 +97,7 @@ Future<void> handleMedia(
);
if (mediaFile?.downloadState != DownloadState.reuploadRequested) {
Log.warn(
'[$receiptId] This message and media file already exit and was not requested again. Dropping it.',
'This message and media file already exit and was not requested again. Dropping it.',
);
return;
}
@ -122,9 +121,6 @@ Future<void> handleMedia(
MediaFile? mediaFile;
Message? message;
Log.info(
'[$receiptId] Starting transaction for media message ${media.senderMessageId}',
);
await twonlyDB.transaction(() async {
mediaFile = await twonlyDB.mediaFilesDao.insertOrUpdateMedia(
MediaFilesCompanion(
@ -144,7 +140,7 @@ Future<void> handleMedia(
);
if (mediaFile == null) {
Log.error('[$receiptId] Could not insert media file into database');
Log.error('Could not insert media file into database');
return;
}
@ -167,18 +163,13 @@ Future<void> handleMedia(
),
);
});
Log.info(
'[$receiptId] Finished transaction for media message ${media.senderMessageId}. Success: ${message != null}',
);
if (message != null && mediaFile != null) {
await twonlyDB.groupsDao.increaseLastMessageExchange(
groupId,
fromTimestamp(media.timestamp),
);
Log.info(
'[$receiptId] Inserted a new media message with ID: ${message!.messageId}',
);
Log.info('Inserted a new media message with ID: ${message!.messageId}');
await incFlameCounter(
message!.groupId,
true,
@ -189,16 +180,12 @@ Future<void> handleMedia(
} else {
if (mediaFile == null && message == null) {
Log.error(
'[$receiptId] Could not insert new message as both the message and mediaFile are empty.',
'Could not insert new message as both the message and mediaFile are empty.',
);
} else if (mediaFile == null) {
Log.error(
'[$receiptId] Could not insert new message as the mediaFile is empty.',
);
Log.error('Could not insert new message as the mediaFile is empty.');
} else {
Log.error(
'[$receiptId] Could not insert new message as the message is empty.',
);
Log.error('Could not insert new message as the message is empty.');
}
}
}
@ -206,7 +193,6 @@ Future<void> handleMedia(
Future<void> handleMediaUpdate(
int fromUserId,
EncryptedContent_MediaUpdate mediaUpdate,
String receiptId,
) async {
final message = await twonlyDB.messagesDao
.getMessageById(mediaUpdate.targetMessageId)
@ -214,14 +200,14 @@ Future<void> handleMediaUpdate(
if (message == null) {
// this can happen, in case the message was already deleted.
Log.info(
'[$receiptId] Got media update to message ${mediaUpdate.targetMessageId} but message not found.',
'Got media update to message ${mediaUpdate.targetMessageId} but message not found.',
);
return;
}
if (message.mediaId == null) {
// this can happen, in case the message was already deleted.
Log.warn(
'[$receiptId] Got media update for message ${mediaUpdate.targetMessageId} which does not have a mediaId defined.',
'Got media update for message ${mediaUpdate.targetMessageId} which does not have a mediaId defined.',
);
return;
}
@ -230,14 +216,14 @@ Future<void> handleMediaUpdate(
);
if (mediaFile == null) {
Log.info(
'[$receiptId] Got media file update, but media file was not found ${message.mediaId}',
'Got media file update, but media file was not found ${message.mediaId}',
);
return;
}
switch (mediaUpdate.type) {
case EncryptedContent_MediaUpdate_Type.REOPENED:
Log.info('[$receiptId] Got media file reopened ${mediaFile.mediaId}');
Log.info('Got media file reopened ${mediaFile.mediaId}');
await twonlyDB.messagesDao.updateMessageId(
message.messageId,
const MessagesCompanion(
@ -245,7 +231,7 @@ Future<void> handleMediaUpdate(
),
);
case EncryptedContent_MediaUpdate_Type.STORED:
Log.info('[$receiptId] Got media file stored ${mediaFile.mediaId}');
Log.info('Got media file stored ${mediaFile.mediaId}');
final mediaService = MediaFileService(mediaFile);
await mediaService.storeMediaFile();
await twonlyDB.messagesDao.updateMessageId(
@ -256,9 +242,7 @@ Future<void> handleMediaUpdate(
);
case EncryptedContent_MediaUpdate_Type.DECRYPTION_ERROR:
Log.info(
'[$receiptId] Got media file decryption error ${mediaFile.mediaId}',
);
Log.info('Got media file decryption error ${mediaFile.mediaId}');
await reuploadMediaFile(fromUserId, mediaFile, message.messageId);
}
}

View file

@ -1,4 +1,3 @@
import 'package:drift/drift.dart' show Value;
import 'package:twonly/locator.dart';
import 'package:twonly/src/model/protobuf/client/generated/messages.pb.dart';
import 'package:twonly/src/services/api/utils.api.dart';
@ -7,27 +6,26 @@ import 'package:twonly/src/utils/log.dart';
Future<void> handleMessageUpdate(
int contactId,
EncryptedContent_MessageUpdate messageUpdate,
String receiptId,
) async {
switch (messageUpdate.type) {
case EncryptedContent_MessageUpdate_Type.OPENED:
Log.info(
'[$receiptId] Opened message ${messageUpdate.multipleTargetMessageIds}',
'Opened message ${messageUpdate.multipleTargetMessageIds}',
);
try {
await twonlyDB.messagesDao.handleMessagesOpened(
Value(contactId),
contactId,
messageUpdate.multipleTargetMessageIds,
fromTimestamp(messageUpdate.timestamp),
);
} catch (e) {
Log.warn('[$receiptId] Error handling messages opened: $e');
Log.warn(e);
}
case EncryptedContent_MessageUpdate_Type.DELETE:
if (!await isSender(contactId, messageUpdate.senderMessageId, receiptId)) {
if (!await isSender(contactId, messageUpdate.senderMessageId)) {
return;
}
Log.info('[$receiptId] Delete message ${messageUpdate.senderMessageId}');
Log.info('Delete message ${messageUpdate.senderMessageId}');
try {
await twonlyDB.messagesDao.handleMessageDeletion(
contactId,
@ -35,13 +33,13 @@ Future<void> handleMessageUpdate(
fromTimestamp(messageUpdate.timestamp),
);
} catch (e) {
Log.warn('[$receiptId] Error handling message deletion: $e');
Log.warn(e);
}
case EncryptedContent_MessageUpdate_Type.EDIT_TEXT:
if (!await isSender(contactId, messageUpdate.senderMessageId, receiptId)) {
if (!await isSender(contactId, messageUpdate.senderMessageId)) {
return;
}
Log.info('[$receiptId] Edit message ${messageUpdate.senderMessageId}');
Log.info('Edit message ${messageUpdate.senderMessageId}');
try {
await twonlyDB.messagesDao.handleTextEdit(
contactId,
@ -50,12 +48,12 @@ Future<void> handleMessageUpdate(
fromTimestamp(messageUpdate.timestamp),
);
} catch (e) {
Log.warn('[$receiptId] Error handling text edit: $e');
Log.warn(e);
}
}
}
Future<bool> isSender(int fromUserId, String messageId, String receiptId) async {
Future<bool> isSender(int fromUserId, String messageId) async {
final message = await twonlyDB.messagesDao
.getMessageById(messageId)
.getSingleOrNull();
@ -63,6 +61,6 @@ Future<bool> isSender(int fromUserId, String messageId, String receiptId) async
if (message.senderId == fromUserId) {
return true;
}
Log.error('[$receiptId] Contact $fromUserId tried to modify the message $messageId');
Log.error('Contact $fromUserId tried to modify the message $messageId');
return false;
}

View file

@ -10,11 +10,10 @@ DateTime lastPushKeyRequest = clock.now().subtract(const Duration(hours: 1));
Future<void> handlePushKey(
int contactId,
EncryptedContent_PushKeys pushKeys,
String receiptId,
) async {
switch (pushKeys.type) {
case EncryptedContent_PushKeys_Type.REQUEST:
Log.info('[$receiptId] Got a pushkey request from $contactId');
Log.info('Got a pushkey request from $contactId');
if (lastPushKeyRequest.isBefore(
clock.now().subtract(const Duration(seconds: 60)),
)) {
@ -23,7 +22,7 @@ Future<void> handlePushKey(
}
case EncryptedContent_PushKeys_Type.UPDATE:
Log.info('[$receiptId] Got a pushkey update from $contactId');
Log.info('Got a pushkey update from $contactId');
await handleNewPushKey(contactId, pushKeys.keyId.toInt(), pushKeys.key);
}
}

Some files were not shown because too many files have changed in this diff Show more