adb: add Android Debug Bridge backend - fixes #2956#9409
Open
ferrumclaudepilgrim wants to merge 1 commit into
Open
adb: add Android Debug Bridge backend - fixes #2956#9409ferrumclaudepilgrim wants to merge 1 commit into
ferrumclaudepilgrim wants to merge 1 commit into
Conversation
Adds an rclone backend for Android devices over the ADB protocol. Forward-ports the 2019 implementation by B4dM4n on ncw/rclone#adb-remote to current master, swaps the dead `thinkhy/go-adb` for `electricbubble/gadb` (vendored as a subset because gadb upstream does not expose the `exec:` service required for range reads), and adds the operations the original beta did not have: - Move (server-side mv with destination-parent mkdir) - Copy (server-side cp -p with destination-parent mkdir) - Purge (server-side rm -rf) - About (df -k parsing for /data/media and /dev/fuse layouts) - DirMove (with proper fs.ErrorDirExists semantics) The default encoder mask covers Windows-reserved characters, leading and trailing whitespace and dots, control characters, and percent so fstest's TestFsEncoding subtests pass on every device class probed. Tested on Galaxy S7 (API 26), Moto G7 Power (API 29), Galaxy S26 Ultra (API 36), and Pixel 10 Pro (API 37).
Contributor
Author
|
I'll have to say this was quite the experience. A few things I left out of the PR Body for presumed etiquette:
The Android API differences surfaced some genuinely useful, and time consuming debugging such as
The last 70ish hours of work have been strictly dedicated to this and the notes are long and full. Android/ ADB continues to amaze me rather regularly, in a good way. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of this change?
Adds Android Debug Bridge as an rclone backend. Forward-ports B4dM4n's 2019 implementation to current master, swaps the dead
thinkhy/go-adbforelectricbubble/gadb(vendored subset to accessexec:), and adds Move, Copy, Purge, About, DirMove.Was the change discussed in an issue or in the forum before?
Closes #2956.
Known (potential) Issues
/data/media) does not preserve modtime oncp -p.TestServerSideCopyfamily fails there. Toybox 0.8.0 and up (API 29+) preserves correctly.uint32, so files at or above 4 GiB have their reported size wrap modulo 2^32. AOSP defines V2 with a 64-bit size field; not implemented here.Devices tested
Pixel 10 Pro (API 37), Galaxy S26 Ultra (API 36), Moto G7 Power (API 29), Galaxy S7 (API 26).
Fork CI green here