Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
58f2406
Fix warnings
bsilvia Nov 20, 2025
8e5dc44
Update gradle
bsilvia Nov 20, 2025
1e17d16
SDK upgrade from 34 -> 36, update dependencies
bsilvia Nov 20, 2025
743833a
SDK upgrade from 34 -> 36 in Dockerfile
bsilvia Nov 20, 2025
bb46563
Update gradle to 8.14.3
bsilvia Nov 20, 2025
b4323ed
Manifest and build warning errors fix
bsilvia Nov 20, 2025
4c2e041
Fix warnings
bsilvia Nov 20, 2025
44c93b2
Fix warnings
bsilvia Nov 20, 2025
a67aa37
More warning fixes
bsilvia Nov 20, 2025
f453ca7
Android version from 11 to 21
bsilvia Nov 20, 2025
54aac04
Update NDK version
bsilvia Nov 21, 2025
2a62958
Updated Syncthing to v2.0.9
bsilvia Nov 21, 2025
71245a5
Bumped version to 2.0.9
bsilvia Nov 21, 2025
583daa9
Update build script to account for latest Go version
bsilvia Nov 21, 2025
297cc2d
Remove AsyncTask and fix warnings
bsilvia Nov 22, 2025
1bc6680
Readme update
bsilvia Nov 22, 2025
7e75fca
Configure Kotlin
bsilvia Nov 22, 2025
4b56230
Convert SyncthingService to kotlin
bsilvia Nov 22, 2025
46fc743
Kotlin conversion
bsilvia Nov 22, 2025
65880a1
Fix dagger issue
bsilvia Nov 22, 2025
463d35a
Fix build issues
bsilvia Nov 22, 2025
64a5558
Kotlin convert of services, issues not resolved yet
bsilvia Nov 22, 2025
5bdce1a
Fixes
bsilvia Nov 22, 2025
1622337
Fixes
bsilvia Nov 22, 2025
8b87efa
Build success
bsilvia Nov 22, 2025
1edf238
Fix warnings
bsilvia Nov 22, 2025
e9641bd
Fix compiler warnings
bsilvia Nov 22, 2025
1575410
Kotlin upgrade
bsilvia Nov 22, 2025
77bad67
Update min SDK to 23
bsilvia Nov 22, 2025
f193b4c
Fix warnings
bsilvia Nov 22, 2025
5004356
Update min sdk to 24
bsilvia Nov 22, 2025
f137046
Fix deprecations
bsilvia Nov 22, 2025
d125d84
Kotlin upgrade
bsilvia Nov 22, 2025
0845fc8
Ignore kotlin files
bsilvia Nov 22, 2025
9510f5c
Kotlin upgrade and warning fixes
bsilvia Nov 22, 2025
1b822c7
Update ignore file
bsilvia Nov 22, 2025
dda56f3
Upgrade preferences version
bsilvia Nov 22, 2025
585a972
Kotlin for model files
bsilvia Nov 22, 2025
82b8b38
http to kotlin plus warning fixes
bsilvia Nov 22, 2025
696a686
Fix build warning
bsilvia Nov 22, 2025
23e3175
Kotlin fragments
bsilvia Nov 22, 2025
425ca04
Dialog to kotlin
bsilvia Nov 22, 2025
2cfc2e2
Activities to kotlin, compiler errors resolved, compiler warnings next
bsilvia Nov 22, 2025
fec3b5a
Replace deprecated methods
bsilvia Nov 22, 2025
41df64b
Fix compiler warnings
bsilvia Nov 22, 2025
915a48b
Attempts at fixing runtime
bsilvia Nov 22, 2025
db61b90
Fix runtime issues
bsilvia Nov 22, 2025
c6be5fc
Remove deprecated tag to fix later, cleanup warnings
bsilvia Nov 22, 2025
f5de0e0
Fix warnings
bsilvia Nov 22, 2025
ad4639d
Null pointer
bsilvia Nov 22, 2025
db4c307
Fix command lines used with syncthing binary
bsilvia Nov 22, 2025
8daa8f0
Views to kotlin
bsilvia Nov 22, 2025
e878384
Functionailty updates for SLL
bsilvia Nov 23, 2025
259fdbd
Update target version and specify foreground service as data sync
bsilvia Nov 25, 2025
e3d7637
Random cleanup items
bsilvia Nov 25, 2025
d41429e
Preferences to androidx
bsilvia Nov 27, 2025
c413cba
Update SettingsActivity to replace AsyncVoid
bsilvia Nov 27, 2025
7015f99
Cleanup items
bsilvia Nov 27, 2025
efc9d21
Gradle versions
bsilvia Nov 27, 2025
9345793
General warning cleanup
bsilvia Nov 27, 2025
b5803d3
Fix analyzer warnings
bsilvia Nov 27, 2025
4bd67ec
Warnings from inspect
bsilvia Nov 27, 2025
910dd99
Fix exception in SyncthingRunnable causing key generation to never re…
bsilvia Nov 28, 2025
020fc10
Handle edge-to-edge layout
bsilvia Nov 28, 2025
282a3c4
More edge-to-edge updates
bsilvia Nov 28, 2025
6056628
Build optimization
bsilvia Nov 28, 2025
4bfc95a
Build optimization
bsilvia Nov 28, 2025
a7f0dc8
Cleanup warnings
bsilvia Nov 28, 2025
e229691
Fix warnings
bsilvia Nov 28, 2025
62c52cc
Edge-to-edge on startup screen
bsilvia Nov 29, 2025
0db7801
Add query to manifest for storage permisssion
bsilvia Nov 29, 2025
f6ef5a5
Cleanup API 30 screen and code behind
bsilvia Nov 29, 2025
81242c7
Fix warnings on settings page
bsilvia Nov 29, 2025
355c38d
Resource strings
bsilvia Nov 29, 2025
e21455a
Cleanup warnings in device activity
bsilvia Dec 6, 2025
780f359
Remove sdk checks no longer needed
bsilvia Dec 6, 2025
a2f1872
Fix warning
bsilvia Dec 6, 2025
5b49861
Edge to edge for the settings page
bsilvia Dec 6, 2025
a13638e
Cleanup comment and address legacy cmd line comments
bsilvia Dec 6, 2025
9659645
Remove platform specific code no longer needed with target sdk
bsilvia Dec 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
# Java class files
*.class

# Kotlin session files
.kotlin/

# generated files
bin/
build/
Expand All @@ -33,6 +36,8 @@ eclipse-java-style.xml
.classpath
.project
.settings
settings.json
.vscode

# Gradle wrapper
gradle/wrapper/gradle/
Expand Down
103 changes: 78 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,63 @@ The project is translated on [Hosted Weblate](https://hosted.weblate.org/project

## Dev

Language codes are usually mapped correctly by Weblate itself. The supported
set is different between [Google Play][1] and Android apps. The latter can be
deduced by what the [Android core framework itself supports][2]. New languages
Language codes are usually mapped correctly by Weblate itself. The supported
set is different between [Google Play][1] and Android apps. The latter can be
deduced by what the [Android core framework itself supports][2]. New languages
need to be added in the repository first, then appear automatically in Weblate.

[1]: https://support.google.com/googleplay/android-developer/table/4419860
[2]: https://android.googlesource.com/platform/frameworks/base/+/refs/heads/main/core/res/res/

# Dev Setup

To develop using Android Studio, install Android Studio and the Android SDK/NDK, then set persistent environment variables. Use the IDE SDK Manager for GUI installs or the command line for scripted installs.

1. Install Android Studio

- Download and install from https://developer.android.com/studio.
- On first run open Tools → SDK Manager:
- Under SDK Platform, install an Android SDK Platform (e.g. Android 36).
- Under SDK Tools, install
- Android SDK Build-Tools
- Android SDK Platform-Tools
- Android SDK Command-line Tools.
- “NDK (Side by side)” and a specific NDK version required by the project (or use the same version referenced in the Dockerfile).
- (Optional) Install CMake if prompted.

2. Install or update SDK/NDK from the command line (optional)

- Use the SDK command-line tools (sdkmanager). Example:
```
sdkmanager "platform-tools" "build-tools;33.0.2" "platforms;android-33" "ndk;25.2.9519653" "cmdline-tools;latest"
```
- Replace versions with the ones your build requires.

3. Set persistent environment variables

- Windows (use System → Advanced system settings → Environment Variables or run as Administrator):
- Recommended: open “Edit the system environment variables” UI and add/modify variables.
- `ANDROID_HOME=C:\Users\User\AppData\Local\Android\Sdk`
- `NDK_VERSION=29.0.14206865`

4. Install Go

- `winget install GoLang.Go`

5. Verify installation
```
$env:ANDROID_HOME
go version
java -version # must be Java 21
```

Notes

- Use the exact SDK/NDK versions required by the project (see docker/Dockerfile or project docs).
- Prefer setting ANDROID_SDK_ROOT (or ANDROID_HOME as a legacy alias) and ANDROID_NDK_HOME so build tools and Gradle can find the SDK/NDK.
- On Windows prefer the Environment Variables UI to avoid PATH truncation issues with setx.
- After setting these variables, Android Studio and command-line builds (./gradlew assembleDebug, ./gradlew buildNative) should find the SDK/NDK automatically.

# Building

These dependencies and instructions are necessary for building from the command
Expand All @@ -46,30 +95,34 @@ follow them separately.
## Dependencies

1. Android SDK and NDK
1. Download SDK command line tools from https://developer.android.com/studio#command-line-tools-only.
2. Unpack the downloaded archive to an empty folder. This path is going
to become your `ANDROID_HOME` folder.
3. Inside the unpacked `cmdline-tools` folder, create yet another folder
called `latest`, then move everything else inside it, so that the final
folder hierarchy looks as follows.
```
cmdline-tools/latest/bin
cmdline-tools/latest/lib
cmdline-tools/latest/source.properties
cmdline-tools/latest/NOTICE.txt
```
4. Navigate inside `cmdline-tools/latest/bin`, then execute
```
./sdkmanager "platform-tools" "build-tools;<version>" "platforms;android-<version>" "extras;android;m2repository" "ndk;<version>"
```
The required tools and NDK will be downloaded automatically.

**NOTE:** You should check [Dockerfile](docker/Dockerfile) for the
specific version numbers to insert in the command above.

1. Download SDK command line tools from https://developer.android.com/studio#command-line-tools-only.
2. Unpack the downloaded archive to an empty folder. This path is going
to become your `ANDROID_HOME` folder.
3. Inside the unpacked `cmdline-tools` folder, create yet another folder
called `latest`, then move everything else inside it, so that the final
folder hierarchy looks as follows.
```
cmdline-tools/latest/bin
cmdline-tools/latest/lib
cmdline-tools/latest/source.properties
cmdline-tools/latest/NOTICE.txt
```
4. Navigate inside `cmdline-tools/latest/bin`, then execute

```
./sdkmanager "platform-tools" "build-tools;<version>" "platforms;android-<version>" "extras;android;m2repository" "ndk;<version>"
```

The required tools and NDK will be downloaded automatically.

**NOTE:** You should check [Dockerfile](docker/Dockerfile) for the
specific version numbers to insert in the command above.

2. Go (see https://docs.syncthing.net/dev/building#prerequisites for the
required version)
3. Java version 11 (if not present in ``$PATH``, you might need to set
``$JAVA_HOME`` accordingly)
3. Java version 11 (if not present in `$PATH`, you might need to set
`$JAVA_HOME` accordingly)
4. Python version 3

## Build instructions
Expand Down
68 changes: 42 additions & 26 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,39 +1,43 @@
import org.gradle.configurationcache.extensions.capitalized

import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
id("com.android.application")
id("com.github.ben-manes.versions")
id("com.github.triplet.play") version "3.7.0"
id("com.github.triplet.play") version "3.12.2"
id("org.jetbrains.kotlin.android")
id("org.jetbrains.kotlin.kapt")
}

dependencies {
implementation("eu.chainfire:libsuperuser:1.1.1")
implementation("com.google.android.material:material:1.8.0")
implementation("com.google.code.gson:gson:2.10.1")
implementation("com.google.android.material:material:1.13.0")
implementation("com.google.code.gson:gson:2.13.2")
implementation("org.mindrot:jbcrypt:0.4")
implementation("com.google.guava:guava:32.1.3-android")
implementation("com.google.guava:guava:33.5.0-android")
implementation("com.annimon:stream:1.2.2")
implementation("com.android.volley:volley:1.2.1")
implementation("commons-io:commons-io:2.11.0")
implementation("commons-io:commons-io:2.21.0")
implementation("androidx.documentfile:documentfile:1.1.0")
implementation("androidx.preference:preference-ktx:1.2.1")

implementation("com.journeyapps:zxing-android-embedded:4.3.0") {
isTransitive = false
}
implementation("com.google.zxing:core:3.4.1")
implementation("com.google.zxing:core:3.5.4")

implementation("androidx.constraintlayout:constraintlayout:2.0.4")
implementation("com.google.dagger:dagger:2.49")
annotationProcessor("com.google.dagger:dagger-compiler:2.49")
androidTestImplementation("androidx.test:rules:1.4.0")
androidTestImplementation("androidx.annotation:annotation:1.2.0")
implementation("androidx.constraintlayout:constraintlayout:2.2.1")
implementation("com.google.dagger:dagger:2.57.2")
implementation("androidx.core:core-ktx:1.17.0")
kapt("com.google.dagger:dagger-compiler:2.57.2")
// Align annotation version with other AndroidX constraints to avoid resolution
// conflicts during lint and test configuration resolution.
androidTestImplementation("androidx.annotation:annotation:1.8.1")
}

android {
val ndkVersionShared = rootProject.extra.get("ndkVersionShared")
// Changes to these values need to be reflected in `../docker/Dockerfile`
compileSdk = 34
buildToolsVersion = "34.0.0"
ndkVersion = "${ndkVersionShared}"
compileSdk = 36
ndkVersion = "$ndkVersionShared"

buildFeatures {
dataBinding = true
Expand All @@ -42,10 +46,10 @@ android {

defaultConfig {
applicationId = "com.nutomic.syncthingandroid"
minSdk = 21
targetSdk = 33
versionCode = 4395
versionName = "1.28.1"
minSdk = 35
targetSdk = 35
versionCode = 4396
versionName = "2.0.9"
testApplicationId = "com.nutomic.syncthingandroid.test"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -64,7 +68,6 @@ android {
applicationIdSuffix = ".debug"
isDebuggable = true
isJniDebuggable = true
isRenderscriptDebuggable = true
isMinifyEnabled = false
}
getByName("release") {
Expand All @@ -75,17 +78,28 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

// Otherwise libsyncthing.so doesn't appear where it should in installs
// based on app bundles, and thus nothing works.
packagingOptions {
packaging {
jniLibs {
useLegacyPackaging = true
}
}
namespace = "com.nutomic.syncthingandroid"
}

kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
}
}

kapt {
correctErrorTypes = true
}

play {
Expand Down Expand Up @@ -113,8 +127,10 @@ tasks.register<Delete>("deleteUnsupportedPlayTranslations") {
}

project.afterEvaluate {
android.buildTypes.forEach {
tasks.named("merge${it.name.capitalized()}JniLibFolders") {
android.buildTypes.forEach { buildType ->
tasks.named("merge${
buildType.name.replaceFirstChar { if (it.isLowerCase()) it.titlecase() else it.toString() }
}JniLibFolders") {
dependsOn(":syncthing:buildNative")
}
}
Expand Down
19 changes: 14 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<uses-feature android:name="android.software.leanback" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />

<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Expand All @@ -20,17 +23,24 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!-- FOREGROUND_SERVICE is required to create a foreground service on 9 -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"/>
<!-- ACCESS_FINE_LOCATION is required to get WiFi's SSID on 10 "Q" -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- ACCESS_BACKGROUND_LOCATION is required to get WiFi's SSID on 10 "Q" -->
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"
tools:ignore="BackgroundLocationPolicy" />
<!-- CAMERA is required for the QR Code Scanner -->
<uses-permission android:name="android.permission.CAMERA" />
<!-- MANAGE_EXTERNAL_STORAGE is required on Android 11 "R" -->
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />

<uses-sdk tools:overrideLibrary="com.google.zxing.client.android" />

<queries>
<package android:name="android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION" />
</queries>

<application
android:allowBackup="false"
android:fullBackupContent="false"
Expand All @@ -45,7 +55,6 @@
android:name=".SyncthingApp">
<activity
android:name=".activities.FirstStartActivity"
android:label="@string/app_name"
android:launchMode="singleTask"
android:exported="true">
<intent-filter>
Expand All @@ -59,7 +68,6 @@
</activity>
<activity
android:name=".activities.MainActivity"
android:label="@string/app_name"
android:launchMode="singleTask">
</activity>
<activity
Expand Down Expand Up @@ -126,7 +134,8 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".activities.MainActivity" />
</activity>
<service android:name=".service.SyncthingService" />
<service android:name=".service.SyncthingService"
android:foregroundServiceType="dataSync"/>
<receiver android:name=".receiver.BootReceiver"
android:exported="false">
<intent-filter>
Expand Down

This file was deleted.

Loading