A Flutter based Cwtch UI https://cwtch.im
Go to file
Sarah Jamie Lewis 50c9f66aca
continuous-integration/drone/push Build is passing Details
Merge pull request 'Formatting / Layout Tweaks' (#858) from android_foreground_fix into trunk
Reviewed-on: #858
Reviewed-by: Dan Ballard <dan@openprivacy.ca>
2024-02-27 21:13:58 +00:00
android Sync cache for acks 2024-02-26 19:24:04 -08:00
assets Fix Juniper Theme 2024-02-08 13:54:36 -08:00
fastlane/metadata/android/en-US Initial Commit of Fastlane + Debug Accessibiltiy Views 2022-08-11 13:17:38 -07:00
integration_test Dart Fix 2024-02-13 20:05:33 -08:00
ios build updates for macos flutter 3.10 2023-05-29 17:40:44 +00:00
lib Formatting / Layout Tweaks 2024-02-27 18:52:30 +00:00
linux theme fixups for loading bg image and new chat reaction icon color 2024-01-03 22:05:08 -08:00
macos Revert "script to update tor-fetch script to latest published tor expert bundle; compress mac .dmg" 2023-11-24 14:07:03 -08:00
test Dart Fix 2024-02-13 20:05:33 -08:00
test_driver Update UI Tests to Run with Flutter 3 / In Drone (#621) 2023-02-01 22:48:36 +00:00
windows Shorten Blub in Installer 2024-02-13 13:06:48 -08:00
.drone.yml Name vs File 2024-02-26 14:42:19 -08:00
.gitignore Revert "script to update tor-fetch script to latest published tor expert bundle; compress mac .dmg" 2023-11-24 14:07:03 -08:00
.metadata build updates for macos flutter 3.10 2023-05-29 17:40:44 +00:00
ARCH.md Fresh Respository Commit - Cwtch Beta 2021-06-24 16:10:45 -07:00
LIBCWTCH-GO.version Prevent Android from Wiping Unsaved Conversations Every Time the Foreground Reloads 2024-02-26 18:19:50 -08:00
LICENSE Fixup Installer Text 2024-02-13 21:00:25 +00:00
NSIS-Notes.md 24 Color Title Image 2024-02-13 21:00:25 +00:00
README.md Fix UI Tests. 2023-08-22 23:27:41 +00:00
SPEC.md Fresh Respository Commit - Cwtch Beta 2021-06-24 16:10:45 -07:00
build-release.sh macos: handle shutdown & first release run copy dev profile if none 2021-09-10 18:12:30 -07:00
build.yaml add gherkin tests (#353) 2022-02-05 00:37:25 +00:00
cwtch-android-lifecycle.png Fresh Respository Commit - Cwtch Beta 2021-06-24 16:10:45 -07:00
cwtch.png Android Icons + Debug Fixes 2021-07-15 13:07:11 -07:00
elf_x86_64.x Reduce Build Variance (Path to Reproducible Builds) (#692) 2023-07-07 01:44:20 +00:00
fetch-libcwtch-go-macos.sh New Autobindings Version + Korean 2023-03-14 14:46:57 -07:00
fetch-libcwtch-go.ps1 New Autobindings Version + Korean 2023-03-14 14:46:57 -07:00
fetch-libcwtch-go.sh Support Conversation Search, Upgrade Cwtch, Patch support for downloading new Cwtch library name formats 2023-08-02 09:45:37 -07:00
fetch-tor-macos.sh update fetch tors to 0.4.8.9 2023-11-25 11:11:34 -08:00
fetch-tor-win.ps1 fix update scripts to tor 0.4.8.9 2023-11-29 12:01:58 -08:00
fetch-tor.sh update fetch tors to 0.4.8.9 2023-11-25 11:11:34 -08:00
gen-nightly-index.sh Add Retry Peer Connection. Japanese Translation. Nice Nightly Redirect and Update Cwtch 2023-05-11 22:08:15 +00:00
index2.js add gherkin tests (#353) 2022-02-05 00:37:25 +00:00
l10n.yaml Fresh Respository Commit - Cwtch Beta 2021-06-24 16:10:45 -07:00
pubspec.lock Formatting / Layout Tweaks 2024-02-27 18:52:30 +00:00
pubspec.yaml Formatting / Layout Tweaks 2024-02-27 18:52:30 +00:00
quality.sh add quality.sh and run 2021-07-14 15:07:29 -07:00
run-tests-headless.sh Update UI Tests to Run with Flutter 3 / In Drone (#621) 2023-02-01 22:48:36 +00:00
run-tests.sh Fix Crash Bug in Android (ShareFile and Reconnect) + Force prettyDateString to use .toLocal() time + Formatting (#794) 2024-01-03 22:10:07 +00:00
update-icons.sh Android Icons + Debug Fixes 2021-07-15 13:07:11 -07:00
upload-releases.sh Name vs File 2024-02-26 14:42:19 -08:00

README.md

Cwtch UI

A Flutter based Cwtch UI.

This README covers build instructions, for information on Cwtch itself please go to https://cwtch.im

Installing

Running

Cwtch processes the following environment variables:

  • CWTCH_HOME= overrides the default storage path of ~/.cwtch with what ever you choose
  • LOG_FILE= will reroute all of libcwtch-go's logging to the specified file instead of the console
  • LOG_LEVEL=debug will set the log level to debug instead of info

Running Tests

You can run specific tests with ./run-tests-headless.sh. See also the .drone.yml file for information on the specific tests that run.1

The gherkin test framework will occasionally fail silently with incomplete test. This is usually because a previous run resulted in an exception and the underlying Tor process was not cleaned up (See #711).

Building

Getting Started

First you will need a valid flutter sdk installation. You will probably want to disable Analytics on the Flutter Tool: flutter config --no-analytics

This project uses the flutter stable channel

Once flutter is set up, run flutter pub get from this project folder to fetch dependencies.

By default a development version is built, which loads profiles from $CWTCH_HOME/dev/. This is so that you can build and test development builds with alternative profiles while running a release/stable version of Cwtch uninterrupted. To build a release version and load normal profiles, use build-release.sh X instead of flutter build X

Building on Linux (for Linux)

  • copy libCwtch-go.so to linux/, or run fetch-libcwtch-go.sh to download it
  • set LD_LIBRARY_PATH="$PWD/linux"
  • copy a tor binary to linux/ or run fetch-tor.sh to download one
  • run flutter config --enable-linux-desktop if you've never done so before
  • optional: launch cwtch-ui debug build by running flutter run -d linux
  • to build cwtch-ui, run flutter build linux
  • optional: launch cwtch-ui release build with env LD_LIBRARY_PATH=linux ./build/linux/x64/release/bundle/cwtch
  • to package the build, run linux/package-release.sh

Building on Windows (for Windows)

  • copy libCwtch.dll to windows/, or run fetch-libcwtch-go.ps1 to download it
  • run fetch-tor-win.ps1 to fetch Tor for windows
  • optional: launch cwtch-ui debug build by running flutter run -d windows
  • to build cwtch-ui, run flutter build windows
  • optional: to run the release build:
    • cp windows/libCwtch.dll .
    • ./build/windows/runner/Release/cwtch.exe

Building on Linux/Windows (for Android)

  • Follow the steps above to fetch libCwtch-go and tor (these will fetch Android versions of these binaries also)
  • run flutter run with an Android phone connect via USB (or some other valid debug mode)

Building on MacOS

  • Cocoapods is required. Mac and Ruby don't seem to care about version stability and compatibility so good luck. The version of Ruby Mac seems to ship is very incompatible with software in the gem repo. You will probablly need to manually specify a specific older version of cocoapods that is compatible with your system. First you will also probably need to make sure you are on the latest MacOS version and then try gem install cocoapods -v 1.x.x
    • For MacOS 13.4 gem install cocoapods -v 1.11.3 worked on 2023.05.28
  • copy libCwtch.x64.dylib and libCwtch.arm.dylib into the root folder, or run fetch-libcwtch-go-macos.sh to download it
    • The error 'Podfile not found' has still been seen on fresh repos, depending on varios versions. To fix run flutter create --platforms=macos . --org im.cwtch
    • You may have to temporarily rename the project folder a "dart project suitable name" like "cwtch"
  • run fetch-tor-macos.sh to fetch Tor or Download and install Tor Browser and cp -r /Applications/Tor\ Browser.app/Contents/MacOS/Tor ./macos/
  • flutter build macos
    • If you are building on Mac Arm Silicon you may need to append --no-tree-shake-icons as the build seems to invoke a mac x64 binary that Arm Mac "cannot verify" and therefor will not run on some versions of Flutter
  • optional: launch cwtch-ui release build with ./build/macos/Build/Products/Release/Cwtch.app/Contents/MacOS/Cwtch
  • To package the UI: ./macos/package-release.sh, which results in a Cwtch.dmg that has libCwtch.dylib and tor in it as well and can be installed into Applications

Known Platform Issues

  • Windows: Flutter engine has a known bug around the Right Shift key being sticky. We have implemented a partial workaround, if this happens, tap left shift and it will reset.

l10n Instructions

Adding a new string

Strings are managed directly from our Lokalise(url?) project. Keys should be valid Dart variable names in lowerCamelCase. After adding a new key and providing/obtaining translations for it, follow the next step to update your local copy.

Updating translations

Only Open Privacy staff members can update translations.

In Lokalise, hit Download and make sure:

  • Format is set to "Flutter (.arb)
  • Output filename is set to l10n/intl_%LANG_ISO%.%FORMAT%
  • Empty translations is set to "Replace with base language"
  • Order "Last Update"

Build, download and unzip the output, overwriting lib/l10n. The next time Flwtch is built, Flutter will notice the changes and update app_localizations.dart accordingly (thanks to generate:true in pubspec.yaml).

Adding a language

If a new language has been added to the Lokalise project, two additional manual steps need to be done:

  • Create a new key called localeXX for the name of the language
  • Add it to the settings pane by updating getLanguageFull() in lib/views/globalsettingsview.dart

Then rebuild as normal.

Using a string

Any widget underneath the main MaterialApp should be able to:

import 'package:flutter_gen/gen_l10n/app_localizations.dart';

and then use:

Text(AppLocalizations.of(context)!.stringIdentifer),

Configuration

With generate: true in pubspec.yaml, the Flutter build process checks l10n.yaml for input/output filenames.