Native Google Drive Sync (App Data Storage) - #2600
Conversation
fire-light42
left a comment
There was a problem hiding this comment.
-
We have an AI policy, please read and update your PR:
https://github.com/recloudstream/cloudstream/blob/master/AI-POLICY.md -
Read the issue with backup and sync at #1641 (comment) The current implementation is insufficient and will create a lot of confusion using it.
-
Check out #2411 and the issues related to it, as they implement the same feature.
🚀 Status Update: Stabilization & UI PolishedSince the initial push, I have implemented several critical stability and UX improvements to ensure the new sharded sync system is production-ready. ✅ Latest Stability Fixes
🛠 Core Architecture Reminder
📋 Setup for Maintainers
|
☁️ Cloud Sync Data Mapping DetailsFor reviewers and contributors, here is a detailed breakdown of the data I have gathered and pushed by the Cloud Sync system. This maps out exactly what is included in the payload while preventing accidental synchronization of massive or sensitive local files. The system segments the uploaded data into two JSON shards: 1. Datastore Shard (
|
|
Pretty decent |
…rds for maximum reliability
bca171c to
f3da53f
Compare
|
When will it be implemented? Any estimation? |
…ive-sync # Conflicts: # app/build.gradle.kts # app/src/main/java/com/lagradost/cloudstream3/plugins/PluginManager.kt # app/src/main/java/com/lagradost/cloudstream3/plugins/RepositoryManager.kt # app/src/main/java/com/lagradost/cloudstream3/utils/BackupUtils.kt # app/src/main/res/values/strings.xml # gradle/libs.versions.toml
Summary of ChangesThis PR includes updates from merging the latest upstream master branch, conflict resolution, code quality improvements (resolving static analysis warnings), and a new settings option to sync provider logins. 1. Upstream Merge & Conflict ResolutionSynchronized the branch with
2. Refactored
|
02f9ece to
cee21d2
Compare
Additional Changes Google Drive Sync4. Fixed Sync Toggles Being Ignored
5. Restore Reliability Fixes
Files Changed (this update)
|
Instructions for the developer to enable Gdrive to all usersTo enable the Google Drive Sync feature in your builds, you must configure a project in the Google Cloud Console, enable the Drive API, and generate two OAuth Client IDs (one Web Application and one Android). Step 1: Enable the Google Drive API
Step 2: Configure the OAuth Consent Screen & Scopes
Step 3: Create the Web Application Client ID (Server Client ID)This Client ID is used by the app's Credential Manager to identify your project.
Step 4: Find your SHA-1 fingerprintYour app is signed with a certificate signature. Google requires this to authenticate requests:
Step 5: Register the Android Client ID in Google Cloud
Step 6: Add the Web Client ID to local.properties
|
…ive-sync # Conflicts: # app/src/main/res/values/strings.xml
Conflict Resolution & Maintenance Update
The branch is now fully up to date with @fire-light42 review requested |
Feature: Native Google Drive Sync (App Data Storage)
📝 Overview
This PR implements a native, privacy-safe synchronization provider using Google Drive's App Data folder. Unlike traditional trackers (AniList/MAL), this feature syncs the entire application state (settings, bookmarks, and local data) across devices.
🛡️ Privacy & Security
appDataFolderscope, which is hidden from the user's main Drive UI and inaccessible to other apps.GoogleAuthUtil).🛠️ Technical Changes
SyncManager: A modern implementation usingAuthorizationRequestandIdentityclients for OAuth2 token management.BackupUtilsIntegration: Seamlessly hooks into the existingBackupFilearchitecture. Special care was taken to preserve the latest upstream fixes (e.g.,DOWNLOAD_HEADER_CACHE).SyncSettingsFragmentproviding "Push Now", "Pull Now", and "Auto-sync" options.libs.versions.toml).⚙️ Setup for Maintainers
Important
To enable this feature in official builds, you must configure a Google Cloud project with both a Web application Client ID and an Android Client ID.
For the full instructions, follow the Detailed Step-by-Step Setup Guide.
drive.appdataandemailscopes.google.client_id=your_web_client_id_here.apps.googleusercontent.com✅ Verification & Compatibility
recloudstream/cloudstream(Master) as of Feb 28, 2026.Note: I've verified the navigation graph and fragment bindings, everything is ready for a prompt merge.