Skip to content

rclone to 1.73 and ndk to 29, Internxt, Drime support#394

Open
thies2005 wants to merge 44 commits into
newhinton:masterfrom
thies2005:master
Open

rclone to 1.73 and ndk to 29, Internxt, Drime support#394
thies2005 wants to merge 44 commits into
newhinton:masterfrom
thies2005:master

Conversation

@thies2005
Copy link
Copy Markdown

Changes: * New Providers: * Added explicit support for Drime cloud storage. * Added support for Internxt decentralized cloud storage, including a new flow for handling Two-Factor Authentication (2FA). * UI Enhancements: * Updated transfer notifications to display real-time Upload and Download speeds. * Added session statistics to track total data Uploaded and Downloaded. * Documentation: * Updated README.md to reflect the newly supported providers. bumped rclone to 1.73 and ndk to 29

thies2005 and others added 30 commits February 2, 2026 23:45
Internxt requires interactive authentication to connect to their API
and retrieve a mnemonic during config. This change adds internxt to
the list of providers that use the OAuth-style ConfigCreate flow,
enabling proper authentication handling.
…logging

- Add internxt to OAuth-style providers list for interactive multi-step auth
- Internxt requires connecting to their API to get mnemonic and handle 2FA
- Add error logging to RemoteConfigHelper to capture rclone stderr on failure
- This helps debug authentication issues with new backends
- Add InternxtTwoFactorStep and InternxtTwoFactorAction to OauthHelper.java
- Shows dialog for 2FA code input, blocks until user enters code
- Add InternxtFinishStep to handle config completion
- Update ConfigCreate.kt to detect Internxt and use InteractiveRunner
- Pass provider type from DynamicRemoteConfigFragment to ConfigCreate
- Uses CountDownLatch for thread synchronization with UI dialog
- Process all rclone log lines for stats/progress, not just error/warning
- Notification now updates with transfer progress, speed, ETA during sync
- Speed indication was already implemented in StatusObject, just not being used
- Add signing config passwords for release builds
…agement

Implements proactive session healing for OAuth-enabled remotes (Internxt, etc.)

Phase 1 - Go Backend:
- Replace boolean authFailed with stateful authFailCount/nextAuthAllowed
- Add TOTP time window retries (T, T-1, T+1) for clock skew handling
- Implement exponential backoff: 1m, 5m, 15m, 1h, 1h with ±10% jitter
- Max 5 failures before requiring manual re-auth
- Reset authFailCount to 0 on successful operations

Phase 2 - Android WorkManager:
- Create SessionGuardianWorker for 8-hour periodic health checks
- Discover OAuth remotes via config dump (token/access_token/totp_secret)
- Lightweight health probe using rclone lsd --max-depth 1
- Silent healing via Go backend during probe
- Add SessionGuardianScheduler with network/battery constraints

Phase 3 - Android UI:
- Add "Re-authenticate" menu item to remote options
- Manual re-auth triggers existing RemoteConfig with CONFIG_EDIT_TARGET
- Leverages existing OAuth flow and Internxt 2FA UI

Phase 4 - Failsafe Notifications:
- Detect "auth exceeded max retries" error from Go backend
- Show notification with deep-link to Remotes view
- Added checkAndNotifyAuthError() helper for easy integration

This moves from "Hard Fail" to "Resilient Background Healing" model,
preventing silent session drops after 2FA failures or clock skew.

Resolves: Sessions dropping silently for 2FA-enabled remotes after few days
- Enable CGO_ENABLED=1 for Android ARM builds (was disabled)
- Add CC environment variable pointing to NDK cross-compilers
- Support ARM64 Linux as build host (os.arch detection)
- Fixes cross-compilation on ARM64 build machines

Note: This enables native builds on ARM64 Linux hosts when using
the Android NDK with x86_64 toolchains via QEMU or native compilers.
- Skip cross-compiler (CC env var) on Windows builds
- Let Go handle CGO natively on Windows (Go 1.25.6 supports this)
- Only use cross-compiler when available (Linux/Mac builds)

Fixes build failures on Windows AMD64 systems where getCC() returned null
and caused Go build to fail with empty CC environment variable.

Tested on: Windows 10 (amd64) / AMD Ryzen 8845HS
- Document GitHub Actions workflow usage (already working)
- Provide multiple build options (GitHub Actions, MinGW, Docker, skip)
- Include download instructions for APK artifacts
- Explain current Session Guardian implementation status

This helps users on Windows build APKs using CI/CD workflow
- Complete rewrite of android.yml workflow
- Added detailed comments explaining Session Guardian features
- Documented each build step
- Added conditional uploads based on build success
- Included build summary with download instructions
- Added workflow_dispatch for manual triggering

This workflow builds all APK architectures including arm64-v8a
needed for Pixel 9 and other devices.
- Fix line 320: use mrand.Int63n instead of rand.Int63n (import alias)
- Fix line 400: rename offset to truncationOffset to avoid variable shadowing

These errors were preventing rclone compilation in GitHub Actions due to
CGO cross-compilation issues.
- Set CGO_ENABLED=0 to avoid cross-compilation issues
- Session Guardian code uses only standard Go libraries, no CGO needed
- Fixes build failures on GitHub Actions due to missing standard library packages
- Re-enabled CGO (required for Android ARM builds)
- Added go install std step before rclone build to prepare Android std lib
- This should resolve 'could not import' errors when cross-compiling
- Cleaned up duplicate steps in GitHub Actions workflow
- Removed duplicate/corrupted section from buildRclone function
- File had duplicate lines from previous edit
- Now build.gradle has correct structure with std lib build step
- Removed 'android' tag from Go build command
- The android tag was causing import issues with CGO cross-compilation
- Keeping 'noselfupdate' tag to exclude update checking
- This should allow Go to find the standard library packages
- Reverted to CGO_ENABLED=0 (no CGO required for GitHub Actions)
- Removed CC compiler environment variable
- Restored 'android' build tag
- This matches the working configuration before Session Guardian changes
- CGO changes were intended for ARM64 Linux hosts, not CI/CD
- Changed GOOS from 'android' to 'linux' to bypass CGO requirement
- Removed 'android' build tag since we're targeting linux now
- This allows building without CGO, avoiding standard library issues
- Linux ARM binaries should still work on Android (Android is Linux-based)
- Changed Go version from 1.24 to 1.19.8
- This matches the configuration that was working before Session Guardian
- Go 1.24 may have compatibility issues with cross-compilation
- Using proven Go version that was successfully building earlier
- Added build-windows.ps1 - PowerShell build script with menu
- Added build.bat - Simple batch file launcher
- Added WINDOWS_BUILD_GUIDE.md - Detailed build instructions
- Added BUILD_CHECKLIST.md - Environment verification checklist

These files help users build Session Guardian APK locally on Windows
(Ryzen 8845HS) to work around GitHub Actions CGO issues.
- Removed incorrect -x flags (were excluding tasks instead of running)
- Changed to use module-specific task :app:assembleOssDebugArm64-v8a
- Added proper error checking with LASTEXITCODE
- Shows BUILD FAILED message when build exits with error
- Added safety check to verify APK was actually created

This fixes the issue where ARM64 build was failing due to incorrect Gradle syntax.
Session Guardian Implementation and others added 14 commits March 20, 2026 16:39
- Removed incorrect -x flags from manual commands
- Changed to use :app:assembleOssDebugArm64-v8a syntax
- Matches the corrected build-windows.ps1 script
- Updated to use :app:assembleOssDebugArm64-v8a syntax
- Removes incorrect -x flags that were excluding tasks
- Added download-rclone.ps1 - Downloads rclone v1.73.1 Linux ARM64 binary
- Added download.bat - Batch launcher for download script
- Updated build-windows.ps1:
  - Added option 3: Use pre-built rclone (RECOMMENDED)
  - Fixed Gradle task name: assembleOssDebugArm64V8a (capital V)
  - Added warning about Go cross-compilation failures
  - Added confirmation dialog for option 2 (build from source)
- Updated gradle.properties: Clarified Go version is informational
- Added GO_STANDARD_LIBRARY_ISSUE.md - Analysis of the problem
- Added EMERGENCY_BUILD_PLAN.md - Alternative approaches

This allows users to build working APK on Windows without dealing with
Go's android/arm cross-compilation issues. The pre-built rclone
binary provides all core functionality, and Session Guardian features
can be added later via Kotlin implementation.
- Restored rclone build.gradle with optimized buildAll task
- Fixed Kotlin Observer and Java static context compilation errors
- Updated download-rclone.ps1 with latest build logic
…RT_DIR

- Set SSL_CERT_DIR=/system/etc/security/cacerts so that Go's crypto/x509 loads the proper CA certificate list on Android when using standard linux binaries.
…ature

- Restored Internxt custom Go patches
- Fixed Go module caching integrity issues on Windows when cross-compiling
- Fixed Go trailing CRLF compilation panic caused by Windows line endings
- Implemented long-press to copy on individual log entries
Move from upstream rclone + local patches to the thies2005/rclone fork
(pinned at e86f01c1). The fork contains Internxt-specific changes
directly — proactive JWT token renewal, 2FA/TOTP auto-login, and the
full reAuthorize/reLogin pipeline — eliminating the need to maintain
separate patch files that drifted out of sync with upstream.

This reduces development overhead: Internxt backend improvements are
made once in the fork and consumed by RoundSync (and any other
project) via gradle.properties ref pinning. No more local patch
management, CRLF fixups, or Go module cache conflicts.

Key changes:

rclone build system (rclone/build.gradle):
- Remove patchRclone task (patches/ dir no longer used)
- checkoutRclone now clones from configurable repo URL + ref
- Fork URL and ref are pinned in gradle.properties for reproducibility
- Reads version from fork's VERSION file instead of hardcoded suffix

gradle.properties:
- rCloneRepoUrl: thies2005/rclone fork
- rCloneRef: e86f01c1 (proactive renewer + auto-login)
- Go version bumped to 1.25.0, rclone version to 1.74.0

ConfigCreate.kt (Internxt auth flow):
- Switch from config reconnect to config update with JSON state machine
- Add auth method dialog (Temporary vs Auto-Login with TOTP seed)
- Properly handle 2FA code prompts via non-interactive JSON protocol
- Add exit code validation for config create step

SessionGuardianWorker.kt:
- Fix exit code bug: rclone returns process codes (0/1), not HTTP (401/403)
- Rename sessionsHealed to failedHealthChecks (accurate semantics)

Rclone.java:
- Pass rclone env to config() for consistent environment
- reconnectRemote() uses config update instead of config reconnect

SettingsFragment.java + settings_fragment.xml:
- Add Reset App feature (clears all data and restarts)

CI (android.yml, dependencies.yml):
- Bump actions/setup-go from v4 to v5
- Fix GO_VERSION env export in dependencies workflow

AGENTS.md:
- Add comprehensive project documentation for AI-assisted development
- Migrate package namespace from de.felixnuesse.extract to de.schuelken.cloudbridge
- Update display names across localized string resources
- Generate and apply padded launcher icons from new CloudBridge logo
- Adjust theme colors for new branding
- Update GitHub download URL for automatic updates
- Clean up outdated badges and standardize version bumping rules
…oudBridge

This release completes the transformation from Round Sync to CloudBridge.

Key Changes:
- App Identity: Renamed application ID to de.schuelken.cloudbridge and built as CloudBridge 1.0.0 (versionCode 10).
- Package Structure: Fully migrated and renamed the java/kotlin packages from de.felixnuesse.extract to de.schuelken.cloudbridge.
- Visual Assets: Regenerated and integrated all new Android launcher icons and adaptive foregrounds, fully padded for proper rendering inside circular masks. Updated colors.xml to the new blueish primary palette.
- UI Strings & Localization: Rewrote all legacy project references to CloudBridge across English, German, Catalan, and Simplified Chinese localizations.
- Documentation & Build Pipelines: Cleaned up README.md badges, specified new GitHub source URLs (thies2005/CloudBridge) for automatic app updates, and set up the documentation domain to cloudbridge.schuelken.uk.
…custom DNS resolver

- Switch rclone source to thies2005/rclone fork which includes Android DNS override
- Add getDnsServers() to Rclone.java and RcloneRcd.java using ConnectivityManager
- Pass detected DNS servers via RCLONE_DNS_SERVERS env var to rclone process
- Falls back to Google DNS (8.8.8.8, 8.8.4.4) if detection fails
Property names were renamed from de.felixnuesse.extract.* to
de.schuelken.cloudbridge.* but the CI workflow still grepped for the
old names, causing NDK version to be empty.
- Switch from debug to release builds with the in-repo keystore
- Auto-tag as v<version>-beta.<short-sha> on every master push
- Attach all ABI APKs to a prerelease GitHub release
- Clean up old beta releases before creating new one
@newhinton
Copy link
Copy Markdown
Owner

Hi!
Are you still willing to fork your changes to this branch?
What are your mid-term goals with your fork?

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.

2 participants