Skip to content

Bring project up to date#3

Merged
bsilvia merged 80 commits intomainfrom
bring-up-to-date
Dec 6, 2025
Merged

Bring project up to date#3
bsilvia merged 80 commits intomainfrom
bring-up-to-date

Conversation

@bsilvia
Copy link
Copy Markdown
Owner

@bsilvia bsilvia commented Dec 6, 2025

Fixes #1

AI summary:

This pull request makes significant updates to modernize the Android project, including upgrading dependencies, migrating core application classes from Java to Kotlin, updating Android SDK versions, and refining build and manifest configurations. These changes collectively improve maintainability, compatibility with recent Android versions, and prepare the project for future development.

Key changes:

Dependency and Build System Updates

  • Upgraded multiple dependencies to their latest versions (e.g., material, gson, guava, commons-io, zxing, constraintlayout, dagger, and others) and added new dependencies like androidx.documentfile and androidx.preference. Updated the Play plugin to 3.12.2 and enabled Kotlin support in the build.
  • Increased compileSdk to 36, set minSdk and targetSdk to 35, and updated versionCode/versionName. Set Java and Kotlin compilation targets to Java 21/Kotlin JVM 21. [1] [2]
  • Refactored build configuration to use modern Gradle DSL and improved task dependency logic for native builds.

Migration from Java to Kotlin

  • Migrated the core Dagger dependency injection setup from Java to Kotlin, including DaggerComponent, SyncthingApp, and SyncthingModule classes, improving code readability and maintainability. [1] [2] [3] [4] [5] [6]

Manifest and Permission Improvements

  • Updated AndroidManifest.xml to add new permissions (e.g., FOREGROUND_SERVICE_DATA_SYNC), specify foreground service type for SyncthingService, and add a <queries> block for package visibility. Adjusted permission attributes to address policy warnings. [1] [2] [3]
  • Removed redundant android:label attributes from activities and cleaned up manifest structure. [1] [2]

Documentation Enhancements

  • Added a comprehensive "Dev Setup" section to README.md with step-by-step instructions for setting up Android Studio, SDK/NDK, environment variables, and Go, improving onboarding for new contributors.

Minor Fixes and Cleanups

  • Updated and clarified instructions for dependency installation in README.md, including SDK/NDK and Java/Python versions. [1] [2]
  • Removed deprecated or unnecessary build configuration flags (e.g., isRenderscriptDebuggable).

These updates bring the project up to date with current Android development standards and streamline both the codebase and developer experience.

@bsilvia bsilvia linked an issue Dec 6, 2025 that may be closed by this pull request
@bsilvia bsilvia assigned Copilot and unassigned Copilot Dec 6, 2025
@bsilvia bsilvia requested a review from Copilot December 6, 2025 18:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request modernizes the Android project by migrating core components from Java to Kotlin, upgrading dependencies and SDK versions, and improving configuration and documentation. The changes enhance code maintainability, ensure compatibility with recent Android versions, and streamline the developer experience.

Key changes:

  • Migrated core service classes, models, HTTP clients, fragments, and receivers from Java to Kotlin
  • Updated Android SDK to target API 35, upgraded multiple dependencies to latest versions, and set compilation targets to Java 21/Kotlin JVM 21
  • Enhanced AndroidManifest.xml with new permissions, foreground service types, and package visibility queries

Reviewed changes

Copilot reviewed 119 out of 169 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
SyncthingRunnable.kt Migrated from Java to Kotlin with updated command line argument formats and improved type safety
RunConditionMonitor.kt Migrated from Java to Kotlin, modernized network detection using NetworkCapabilities API
RestApi.kt Migrated from Java to Kotlin with improved null safety and modern date formatting
ReceiverManager.kt Converted to Kotlin object with updated receiver registration using RECEIVER_NOT_EXPORTED flag
NotificationHandler.kt Migrated to Kotlin with updated notification channel handling and Service.STOP_FOREGROUND_DETACH
EventProcessor.kt Migrated to Kotlin with improved event handling and null safety
Constants.kt Converted to Kotlin object with updated visibility modifiers
BootReceiver.kt Migrated to Kotlin with companion object for utility methods
AppConfigReceiver.kt Migrated to Kotlin maintaining broadcast receiver functionality
Model files (SystemVersion.kt, SystemInfo.kt, etc.) Migrated model classes to Kotlin with proper null safety annotations
SyncthingTrustManager.kt Rewritten to delegate to system trust managers before falling back to local CA
HTTP request classes Migrated to Kotlin with improved null handling
Fragment classes Migrated dialog and list fragments to Kotlin
ThemedAppCompatActivity.kt Migrated to Kotlin maintaining theme application logic
Comments suppressed due to low confidence (2)

app/src/main/java/com/nutomic/syncthingandroid/service/RunConditionMonitor.kt:1

  • The enum name POWER_SAVING_ENABLED is inconsistent with the Java version which used POWERSAVING_ENABLED. This naming change could break existing code that references this enum value.
package com.nutomic.syncthingandroid.service

app/src/main/java/com/nutomic/syncthingandroid/service/RunConditionMonitor.kt:1

  • The enum name NO_NETWORK_OR_FLIGHT_MODE is inconsistent with the Java version which used NO_NETWORK_OR_FLIGHTMODE. This naming change could break existing code that references this enum value.
package com.nutomic.syncthingandroid.service

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.kt Outdated
Comment thread app/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.kt Outdated
@bsilvia bsilvia requested a review from Copilot December 6, 2025 18:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 119 out of 169 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +94 to +98
Command.ResetDatabase -> mCommand = arrayOf<String>(
mSyncthingBinary.path,
"--home=${mContext.filesDir}",
"--reset-database",
"--log-level=$logLevel"
Copy link

Copilot AI Dec 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TODO comment on line 93 indicates that reset-database no longer exists as a valid command, but the code still attempts to use it. This will likely result in an error when this command is executed. The deprecated command should either be removed or replaced with the correct alternative.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Create an issue for later to clean this up

Comment thread app/src/main/java/com/nutomic/syncthingandroid/service/Constants.kt Outdated
Repository owner deleted a comment from Copilot AI Dec 6, 2025
@bsilvia bsilvia merged commit 1a84c8f into main Dec 6, 2025
@bsilvia bsilvia deleted the bring-up-to-date branch December 6, 2025 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade Java 11 to Java 21 LTS

3 participants