Git Product home page Git Product logo

adb-usb-sample's Introduction

Adb

This is an Android app, ADB host implementation, fully written in Kotlin <3 (save for the native sources, for now). It uses USB-Host Mode apis available since Android 3.1.

The app listens for USB Device Attached events, as registered on the manifest, to connect to the filtered Adb capable devices (see the intent filter xml). It also enumerates and attempts connection to already plugged devices during launch.

Authentication

During adb protocol connection handshake, the Android device sends a token for the host to sign using public key encryption -- RSA. Android uses a custom format of the public key that is stored by device after a successful auth-dance for subsequent verification.

An RSA keypair is generated natively using a build of BoringSSL for Android. The app uses an armeabi-v7a static boringssl crypto lib but you can also find a arm64-v8a in the boringssl folder under native sources. NB: Make sure to change the app's target abi in the module's build.gradle if you make the swap.

Caveat

Max payload for an Adb packet is 65,536 bytes but the app only supports a max 16,384 bytes as limited by the native usb IO implementation.

See:

drivers/usb/core/devio.c

Contribution and releases


All development (both new features and bug fixes) is performed in develop branch. This way master sources always contain sources of the most recently released version. Please send PRs with bug fixes to develop branch

The develop branch is pushed to master during release.

License

Copyright (C) 2018 Charles Muchene

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

adb-usb-sample's People

Contributors

charlesmuchene avatar

Stargazers

 avatar โญ ๐Ÿพ avatar

Watchers

 avatar

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.