-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f1dc76
commit d2e9073
Showing
6 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
BSD 2-Clause License | ||
|
||
Copyright (c) 2020, Stephen Kingston | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# WebMTP | ||
This is a proof-of-concept implementation of the MTP protocol over WebUSB. Works with all [browsers which support WebUSB](https://developer.mozilla.org/en-US/docs/Web/API/USB) | ||
|
||
## Setup | ||
|
||
### Windows | ||
|
||
Replace default MTP driver with WinUSB driver. | ||
|
||
- Download [Zadig](https://zadig.akeo.ie/). | ||
- Open Zadig and select `Options → List All Devices`. | ||
- Select your MTP device from list of devices and install WinUSB driver by clicking `Replace Driver` | ||
|
||
![](media/install_winusb_driver.png) | ||
|
||
### Linux | ||
|
||
Requires `udev` rule to be installed | ||
|
||
Find Vendor ID and Product ID using `lsusb` | ||
|
||
```bash | ||
$ lsusb | ||
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub | ||
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub | ||
Bus 002 Device 001: ID 22b8:2e82 Motorola Device | ||
``` | ||
Add a file `/etc/udev/rules.d/webmtp.rules` with the below content. Use your phone's Vendor ID & Product ID. | ||
``` | ||
SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", ATTRS{idProduct}=="2e82", ACTION=="add", MODE="0666" | ||
``` | ||
Reload `udev` rules | ||
```bash | ||
$ sudo udevadm control --reload-rules | ||
``` | ||
## Supported Operations | ||
- Reading list of storages and files. | ||
- Downloading & uploading files. | ||
- Deleting files. | ||
|
||
## Known limitations | ||
- Works with root folder only | ||
- Renaming files not supporte | ||
- Not tested with large files | ||
|
||
___ | ||
### Stephen Kingston © 2020 |
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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