Skip to content

Dropbox and Onedrive implementation of storage API using RESTful APIs#113

Open
TranceLove wants to merge 2 commits intomainfrom
feature/sdkless-dropbox-onedrive
Open

Dropbox and Onedrive implementation of storage API using RESTful APIs#113
TranceLove wants to merge 2 commits intomainfrom
feature/sdkless-dropbox-onedrive

Conversation

@TranceLove
Copy link
Collaborator

@TranceLove TranceLove commented Aug 27, 2025

Summary

Implementation of android-omh-storage API for Dropbox and Microsoft Onedrive integration, without using Dropbox and Microsoft SDK but rely on RESTful API using https://github.com/square/okhttp and https://github.com/square/retrofit, along the style used by plugin-googledrive-non-gms module.

One of the biggest drawback using original Dropbox and Microsoft implementation is developers must follow Dropbox and Microsoft SDK's method to place API credentials, which may not be ideal in some usage scenarios. With this SDK-less integration this opens up opportunities for integration without exposing API credentials in app source, either plaintext or compiled/obfuscated.

Note however, due to the common characteristics of this implementation with regards to plugin-googledrive-non-gms, there are some classes moved to a new core-restful-common module. Separate PR shall be required for updating the Github Action build and publish workflow.

Additionally, the metadata dialog in storage-sample-app is also fixed for the crash problem whenever it pops up.

Still in draft status since the UI acceptance test is not completed yet, as well as foreseeing some more fixes required. However still wanted to put this up for a proper checklist for testing the implementation as well.

Demo

Combination of original omh-auth using Dropbox and Microsoft SDK, integrated with this Dropbox and Microsoft RESTful implementation, is implemented into storage-sample-app.

Screenshot_20250827_235916

Checklist:

  • Documentation is up to date to reflect these changes
  • Created Unit tests
  • Ran all the UI acceptance tests on storage-sample-app

@TranceLove
Copy link
Collaborator Author

TranceLove commented Aug 27, 2025

Test cases - list as suggested by Copilot for exhaustive scenarios, but may be redundant as well - subject to change before PR is out of draft status.

Category Test item Dropbox RESTful Microsoft RESTful
Navigation & Listing Launch shows root listing (calls listFiles(root)) ✔️ ✔️
Navigation & Listing Enter subfolder loads correct contents ✔️ ✔️
Navigation & Listing Back returns to previous folder ✔️ ✔️
Navigation & Listing Empty folder shows empty state UI ✔️ ✔️
Search Query filters list via search() ✔️ ✔️
Search No results shows proper empty state ✔️ ✔️
Search Search should accept unicode/multi-byte characters ✔️ ✔️
Create Successful folder creation appears without manual refresh ✔️ ✔️
Create Create folder with Unicode characters ✔️ ✔️
Create Create file updates list ✔️ ✔️
Create Create file with Unicode characters ✔️ ✔️
Create Create file with filename having space ✔️ ✔️
Create Error during create shows user message ✔️
Upload / Update Successful upload inserts item in correct order ✔️ ✔️
Upload / Update Upload small files (size limit depends on provider) ✔️ ✔️
Upload / Update Upload big files successfully and able to upload in chunks automatically ✔️ ✔️
Upload / Update Update existing file refreshes metadata (modified date, version) ✔️ ✔️
Upload / Update Quota exceeded during upload shows specific error
Download / Export Download file working ✔️ ✔️
Download / Export Export file with different mime yields correct extension (both not supported)
File Versions Open file details lists versions (getFileVersions()) ✔️ ✔️
File Versions Download specific version works ✔️ ✔️
Metadata File detail loads metadata (size, modified) ✔️ ✔️
Permissions List file permissions loads (getFilePermissions()) ✔️ ✔️
Permissions List folder permissions loads (getFilePermissions()) ✔️ ✔️
Permissions Add permission validation (email, role) Caveats Caveats
Permissions Successful create file permission updates list ✔️ ✔️
Permissions Successful create folder permission updates list ✔️ ✔️
Permissions Update file permission role reflects immediately ➖ (not supported?) ✔️
Permissions Update folder permission role reflects immediately ✔️ ✔️
Permissions Delete permission removes entry ✔️ ✔️
Permissions Insufficient rights error surfaced cleanly ✔️
Web URL Support get item URL ✔️ ✔️
Web URL Null / missing URL handled gracefully ✔️
Delete Soft delete removes item (if supported) ✔️ ✔️
Delete Permanently delete shows confirmation dialog (both not supported)
Delete Handles permanent delete feature missing gracefully ✔️ ✔️
Path Resolution Deep link path resolves via resolvePath()
Path Resolution Invalid path shows not found error UI
Storage Usage / Quota Usage screen shows getStorageUsage() value ✔️ ✔️
Error Handling Generic API exception shows consistent error component
Error Handling Permission denied on folder navigation handled
Error Handling Large file near quota: quota exceeded message

@TranceLove TranceLove force-pushed the feature/sdkless-dropbox-onedrive branch 6 times, most recently from 7b890e6 to 2b758fc Compare August 31, 2025 15:38
@TranceLove TranceLove force-pushed the feature/sdkless-dropbox-onedrive branch 6 times, most recently from 7fb430f to d045100 Compare September 7, 2025 04:38
@TranceLove TranceLove requested a review from Copilot September 7, 2025 15:48
Copy link

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 PR introduces RESTful API implementations for Dropbox and Microsoft OneDrive storage providers, offering SDK-less alternatives to the existing SDK-based implementations. The primary motivation is to enable usage scenarios where API credentials need to be provisioned outside the app, avoiding the constraints imposed by official SDKs.

  • Creates new plugin-dropbox-restful and plugin-onedrive-restful modules using REST APIs instead of SDKs
  • Introduces a shared core-restful-common module to consolidate common RESTful API functionality
  • Fixes documentation and updates the sample app to include the new RESTful options

Reviewed Changes

Copilot reviewed 128 out of 130 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
settings.gradle.kts Adds new plugin modules to project configuration
packages/plugin-onedrive/README.md Fixes incorrect dependency name in documentation
packages/plugin-onedrive-restful/ Complete OneDrive RESTful API implementation with tests
packages/plugin-dropbox-restful/ Complete Dropbox RESTful API implementation with tests
packages/core-restful-common/ Shared utilities for RESTful implementations
packages/core/src/main/java/com/openmobilehub/android/storage/core/ Core utility extensions and exception types
packages/plugin-googledrive-non-gms/ Updates to use shared restful-common module
apps/storage-sample/ UI updates to include new RESTful login options

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Signed-off-by: Raymond Lai <airwave209gt@gmail.com>
@TranceLove TranceLove force-pushed the feature/sdkless-dropbox-onedrive branch from d045100 to 22561b5 Compare September 8, 2025 15:02
- Updated Github Actions workflow for new artifacts
- Updated dependencies between modules

Signed-off-by: Raymond Lai <airwave209gt@gmail.com>
@TranceLove TranceLove marked this pull request as ready for review September 9, 2025 23:09
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.

1 participant