Giter Site home page Giter Site logo

webadb.js's People

Contributors

cavokz avatar jesec avatar klausw avatar paulkinlan avatar xingrz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webadb.js's Issues

`DOMException: The transfer was cancelled.` on Pixels + Android 10 - and a possible fix

I've tested the sample here on a Pixel 2, 3 and 4, all of them with Android 10.

On those devices with Android 10, once connected, any call to device.transferIn or device.transferOut causes the transfer to fail with DOMException: The transfer was cancelled.

Removing the call to selectAlternateInterface here does seem to fix the issue.

I don't have great knowledge on the USB protocol, so would like to check before making a Pull Request to remove that call, as my guess is that it's probably there for a reason.

I have tested the code after removing that link on Android 9 + Nexus6P, and things seem to continue working as expected.

why me connect fail?

tip: NetworkError: Failed to execute 'claimInterface' on 'USBDevice': Unable to claim interface.

ADB protocol changed, newer versions no longer use checksum

New Android versions no longer use checksums for the protocol, this results in an out-of-range DataView access:

https://android.googlesource.com/platform/system/core/+/master/adb/adb.h#47

// ADB protocol version.
// Version revision:
// 0x01000000: original
// 0x01000001: skip checksum (Dec 2017)
#define A_VERSION_MIN 0x01000000
#define A_VERSION_SKIP_CHECKSUM 0x01000001
#define A_VERSION 0x01000001

I added a very crude workaround for this in my fork at https://github.com/klausw/webadb.js/commits/master , but I think this would need more work to be integrated more cleanly. The current send/receive methods are static, so there's no clean way to pass along a runtime-detected version flag.

Many thanks for the tool by the way! My planned use case is to run adb tcpip 5555 so that I can use wireless debugging on ChromeOS/Crostini which currently doesn't support USB access.

Npm package not found

When I attempted to import the npm package for webadb I got the following error.

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/webadb - Not found
npm ERR! 404
npm ERR! 404 'webadb@*' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Unable to pull files over 65k

Hi, first let me say this is an awesome project.

I tried to do a pull command to pull a movie off my device and it failed. It turned out to be that the response object's dataview had a full file's worth of data in, but the expected len returned from the protocol said "65k". https://github.com/webadb/webadb.js/blob/master/webadb.js#L583

It looks like the ADB protocol expects you to get DATA multiple times when there is more than 65k's worth of data... However, inspecting the response, I noted that the object contains all of the data (for my test at least), with the associated DONE command at the end of the response data. I've put up a patch (PaulKinlan@6fd5156#diff-c31f09e515fa2dcaff9fa11e88c742d7) so that you can see the difference.

I am pretty certain I am missing something, especially considering what I understand of the adb protocol, but it works right now....

It would be great to see a proper fix in your library. (I am building a screen recording piece of software and if your library works, I can do it entirely from the web. :)

Thanks,
P

Failed to connect with 'host::' sometimes

so this only happens about half the time, but sometimes I will get the following error:

Uncaught (in promise) Error: Failed to connect with 'host::'
    at webadb.js:141:13
    at async HTMLButtonElement.submitForm (test.js:11:13)

all of the code can be found here: the code
I am using a Nexus 5X for this experiment.

EDIT: Additionally, it seems that the adb command that I am running only returns to the console about half of the time as well.

License

Could you add a license for this project?

"Failed to connect with 'host::'" error.

Steps to reproduce:

  1. Go to https://webadb.github.io/
  2. Plug my "Google Pixel" phone, make sure USB debugging is enabled
  3. Click "I understand and accept" button
  4. Click "Connect" button
  5. Select the device in the USB chooser and click "Connect"

What happens?

I get "Failed to connect with 'host::'" error.
For info, the response I get in "connectAdb" is Adb.Message {cmd: "AUTH", arg0: 1, arg1: 0, data: DataView(20)}

connt pull file , size over 4kb

hi ,great !
I used this nice art,it is so wonderful. thank you!
now,I find ,full file larger than 4KB,it failed.
message: expected at least 65536, got 4096!
how can I do it?

Unable to claim interface.

It used to work (last time I tried) now it doesn't.
I am running the latest version of chrome on linux.
But the phone(s) connects to webusb api with no problems..
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.