Skip to content

Commit 59e12e8

Browse files
authored
Merge pull request #4 from ssbc/android-import
import the source code the tinySSB Android app (previously called Tremola and VoSSBoL)
2 parents 7281ec2 + 78d241b commit 59e12e8

486 files changed

Lines changed: 169945 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

android/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Android Apps for tinySSB
2+
3+
This directory collect the source code for tinySSB apps running on
4+
Android phones. Most prominent is ```tinySSB``` which is the user
5+
interface to the replicated tinySSB logs.
6+
7+
- [tinySSB](tinySSB) -- features chat with voice messaging (Codec2), Kanban boards (collaborative planning), log synchronization via Bluetooth Low Energy (BLE) as well as WebSocket. Thanks to its BLE interface, two devices in the same room can immediately synchronize their tinySSB content, import user IDs etc.
8+
- more to come here
9+
10+
## Notes
11+
12+
Compiling the ```tinySSB``` app is challenging because of the included
13+
Codec2 library which must be cross-compiled to native code (for
14+
Android smartphones). If on Windows you may have to change the file
15+
```tinySSB/app/src/main/codec2/src/CMakeLists.txt``` and add a
16+
```.exe``` suffix to a file name, see
17+
```tinySSB/app/src/main/codec2/src/CMakeLists-for-windows.txt```.
18+
19+
---

android/tinySSB/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# AndroidStudio
2+
.idea
3+
.gradle
4+
5+
# emacs backup files
6+
*~

android/tinySSB/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021-2023 University of Basel, Computer Network group
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

android/tinySSB/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# The tinySSB app for Android
2+
3+
The ```tinySSB``` app is a decent(ralized) user interface to the
4+
replicated append-only logs on which this project is build. It has the
5+
following highlights:
6+
7+
- supports several internal "apps":
8+
- chat, featuring voice messaging
9+
- Kanban boards for collaborative planning
10+
- has easy onboarding: user IDs from neighboring devices are automatically imported
11+
- works "offline-first" i.e., no Internet connection needed to edit your Kanban board
12+
- offers local Bluetooth Low Energy (BLE) as well as websocket (over the Internet) communication interfaces
13+
- is based on the tinySSB log format (all packets are 120B long) which potentially can also be shipped over narrowband wireless media (LoRa).
14+
15+
Two devices in the same room will immediately start to sync the
16+
content of the tinySSB app using BLE. This requires that Bluetooth is
17+
enabled as well as localization (in order to access BLE), and that the
18+
app is active (no background syncing).
19+
20+
21+
## A Note on Security
22+
23+
This is a preliminary version of the app, built mostly for demo
24+
purposes. As such it lacks some desirable security properties and
25+
supports only a single, unencrypted public chat channel.
26+
27+
A next version of this app is in preparation: it will be based on
28+
"encryption circles" that provide basic confidentiality and end-to-end
29+
encryption and will also have private person-to-person chats as well
30+
as encrypted Kanban boards.
31+
32+
33+
## Credits
34+
35+
"Codec 2 is an open source speech codec designed for communications
36+
quality speech between 700 and 3200 bit/s."
37+
[Codec2 homepage](http://rowetel.com/codec2.html)
38+
39+
The Android code for the voice recorder and player view is based on this
40+
[demo AudioRecorder app](https://github.com/exRivalis/AudioRecorder)
41+
42+
---

android/tinySSB/app/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# build directory for Codec2
2+
.cxx
3+
4+
# Android build directory
5+
build/*

android/tinySSB/app/build.gradle

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
apply plugin: 'com.android.application'
2+
apply plugin: 'kotlin-android'
3+
apply plugin: 'kotlin-android-extensions'
4+
apply plugin: 'kotlin-kapt'
5+
6+
android {
7+
compileSdkVersion 31
8+
buildToolsVersion "30.0.3"
9+
10+
defaultConfig {
11+
applicationId "nz.scuttlebutt.tremolavossbol"
12+
minSdkVersion 24
13+
targetSdkVersion 31
14+
versionCode 1
15+
versionName "0.1"
16+
17+
ndk {
18+
// abiFilters 'x86' // x86 needed for testing in the emulator
19+
// abiFilters 'arm64-v8a', 'armeabi-v7a' // 64bit support for release
20+
abiFilters 'arm64-v8a', 'armeabi-v7a'
21+
}
22+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
23+
externalNativeBuild {
24+
cmake {
25+
cppFlags ''
26+
}
27+
}
28+
multiDexEnabled true
29+
30+
javaCompileOptions {
31+
annotationProcessorOptions {
32+
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
33+
}
34+
}
35+
}
36+
37+
buildTypes {
38+
release {
39+
minifyEnabled true
40+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
41+
}
42+
debug {
43+
minifyEnabled false
44+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
45+
multiDexEnabled true
46+
}
47+
}
48+
ndkVersion '25.0.8775105'
49+
externalNativeBuild {
50+
cmake {
51+
path file('src/main/cpp/CMakeLists.txt')
52+
version '3.18.1'
53+
}
54+
}
55+
}
56+
57+
dependencies {
58+
api 'com.google.guava:guava:30.1.1-jre'
59+
60+
implementation fileTree(dir: "libs", include: ["*.jar"])
61+
62+
implementation 'org.jetbrains.kotlin:kotlin-reflect:1.5.20'
63+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2'
64+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.2'
65+
66+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
67+
implementation 'androidx.core:core-ktx:1.6.0'
68+
implementation 'androidx.appcompat:appcompat:1.4.2'
69+
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
70+
// testImplementation 'junit:junit:4.12'
71+
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
72+
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
73+
74+
implementation 'com.squareup.okhttp3:okhttp:4.9.2' //for websocket client
75+
76+
implementation 'com.google.android.material:material:1.6.1'
77+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
78+
implementation 'androidx.test.ext:junit-ktx:1.1.5'
79+
testImplementation 'junit:junit:4.12'
80+
androidTestImplementation 'junit:junit:4.12'
81+
82+
def room_version = "2.2.6"
83+
84+
// implementation "androidx.room:room-runtime:$room_version"
85+
// kapt "androidx.room:room-compiler:$room_version"
86+
87+
// optional - Kotlin Extensions and Coroutines support for Room
88+
// implementation "androidx.room:room-ktx:$room_version"
89+
90+
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
91+
implementation 'com.google.zxing:core:3.4.1'
92+
93+
//LAZY SODIUM
94+
implementation 'com.goterl:lazysodium-android:5.0.2@aar'
95+
implementation 'net.java.dev.jna:jna:5.9.0@aar'
96+
97+
//ROOM
98+
implementation "androidx.room:room-runtime:2.4.2"
99+
kapt "androidx.room:room-compiler:2.4.2"
100+
implementation "androidx.room:room-rxjava2:2.4.2"
101+
implementation "androidx.room:room-coroutines:2.1.0-alpha04"
102+
implementation "androidx.room:room-guava:2.4.2"
103+
104+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

0 commit comments

Comments
 (0)