Commit graph

37 commits

Author SHA1 Message Date
Kenny Root
928116ceef Host builds: add fastboot and adb
Add fastboot and adb host utilities to debug builds for debugging
and development purposes.

Change-Id: If77699a27497b8641998930f14d4ee418b856080
2013-05-02 09:51:53 -07:00
Chih-Wei Huang
9c60755207 Correct LOCAL_LDLIBS of adb
adb doesn't really use ncurses-libs, remove it.

Add -ldl for the symbols dlclose, dlerror, dlopen...
introduced from dso_dlfcn.c of libcrypto_static.a.

Change-Id: If1cc23987a9b35ec535bbf8f4e7db141b9f10af7
2013-01-01 15:57:40 +08:00
Ying Wang
96535ba620 Dist fastboot and adb for the sdk build.
So they can be downloaded from the build page.
Bug: 7109694

Change-Id: Ibc60d0acbc5d2445c01010fd0bd4654a240b0a88
2012-09-05 10:26:43 -07:00
Benoit Goby
345ca131bb adb: Link statically with libcrypto
Bug: 7063951
Change-Id: I328b76a751aceaae625d64156f22ce3de65678c8
2012-08-31 18:24:07 -07:00
Benoit Goby
d5fcafaf41 adb: Add public key authentification
Secure adb using a public key authentication, to allow USB debugging
only from authorized hosts.

When a device is connected to an unauthorized host, the adb daemon sends
the user public key to the device. A popup is shown to ask the user to
allow debugging once or permanantly from the host. The public key is
installed on the device in the later case. Other keys may be installed
at build time.

On the host, the user public/private key pair is automatically generated,
if it does not exist, when the adb daemon starts and is stored in
$HOME/.android/adb_key(.pub) or in $ANDROID_SDK_HOME on windows. If needed,
the ADB_KEYS_PATH env variable may be set to a :-separated (; under
Windows) list of private keys, e.g. company-wide or vendor keys.

On the device, vendors public keys are installed at build time in
/adb_keys. User-installed keys are stored in /data/misc/adb/adb_keys.

ADB Protocol change:
If the device needs to authenticate the host, it replies to CNXN
packets with an AUTH packet. The AUTH packet payload is a random token.
The host signs the token with one of its private keys and sends an AUTH(0)
packet. If the signature verification succeeds, the device replies with
a CNXN packet. Otherwise, it sends a new AUTH packet with a new token so
that the host can retry with another private key. Once the host has tried
all its keys, it can send an AUTH(1) packet with a public key as
payload. adbd then sends the public key to the framework (if it has been
started) for confirmation.

Change-Id: I4e84d7621da956f66ff657245901bdaefead8395
2012-08-23 00:20:06 -07:00
Benoit Goby
3fc95a9918 Revert "adb: Add public key authentification"
This reverts commit f4ed516643.
2012-08-20 23:04:11 -07:00
Benoit Goby
f4ed516643 adb: Add public key authentification
Secure adb using a public key authentication, to allow USB debugging
only from authorized hosts.

When a device is connected to an unauthorized host, the adb daemon sends
the user public key to the device. A popup is shown to ask the user to
allow debugging once or permanantly from the host. The public key is
installed on the device in the later case. Other keys may be installed
at build time.

On the host, the user public/private key pair is automatically generated,
if it does not exist, when the adb daemon starts and is stored in
$HOME/.android/adb_key(.pub) or in $ANDROID_SDK_HOME on windows. If needed,
the ADB_KEYS_PATH env variable may be set to a ;-separated list of private
keys, e.g. company-wide or vendor keys.

On the device, vendors public keys are installed at build time in
/adb_keys. User-installed keys are stored in /data/misc/adb/adb_keys.

ADB Protocol change:
If the device needs to authenticate the host, it replies to CNXN
packets with an AUTH packet. The AUTH packet payload is a random token.
The host signs the token with one of its private keys and sends an AUTH(0)
packet. If the signature verification succeeds, the device replies with
a CNXN packet. Otherwise, it sends a new AUTH packet with a new token so
that the host can retry with another private key. Once the host has tried
all its keys, it can send an AUTH(1) packet with a public key as
payload. adbd then sends the public key to the framework (if it has been
started) for confirmation.

Change-Id: Idce931a7bfe4ce878428eaa47838e5184ac6073f
2012-08-16 21:36:26 -07:00
Benoit Goby
9f1af8cde9 adb: Remove unused flags
BUILD_ADBD is always true

ANDROID_GADGET is not used in the code anymore. adbd now checks at
runtime if /dev/android_adb is present

Change-Id: If6c3278606c79cc74d1ef5978e7b8e3a4513aef8
2012-03-16 15:29:34 -07:00
Nick Kralevich
5890fe3314 Don't allow adb to run as root in user builds.
Change-Id: I4fbd7beb7f76c68fead1a89b745f0dfb931b4597
2012-01-19 15:06:14 -08:00
Jeff Brown
29e1e7393d Remove the simulator target from all makefiles.
Bug: 5010576

Change-Id: I2fcf31af681d92880e5d31a46d5f6777f7ca1977
2011-07-11 22:12:32 -07:00
Christopher Tate
702967afb1 Add 'adb restore' to parallel 'adb backup'
It won't actually do anything until the 'bu' tool and framework are
updated to respond properly, but this is the adb side of the
necessary infrastructure: we copy the tarfile into the socket pointed
at the device, using the existing mechanisms.

Change-Id: Ic3b5779ade256bd1ad989a94b0685f7b1a7d59d2
2011-05-17 15:52:54 -07:00
Christopher Tate
d2f5415c60 Add 'adb backup' for pulling a full backup tarfile to the host
The direct command interfaces with the 'bu' binary in /system/bin
on the device.

Change-Id: I4cd69eedfe5144c47277573c5626c6ad8755d70b
2011-04-27 15:27:23 -07:00
Ying Wang
1c061b9ea9 dist for dist_files
Change-Id: I665572a2212f1239b02b7816e37ada210afbdb48
2010-12-09 10:33:27 -08:00
Benoit Goby
dff0237430 Don't build adb for sdk only builds
Change-Id: I0c56213e81a889fd3a7c5e72c4a6e63544a2a3bd
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 18:30:55 -07:00
Benoit Goby
cb56b712b5 Don't build adb for simulator target
Change-Id: Ibe4ef6bb111dc7123e53262553deb8f5e25e9391
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 17:23:16 -07:00
John Michelau
c318833b35 Build adb for target-as-host
Added a new target for adb, so that the adb
host executable is built for the target as
well. This allows the target to connect to
any Android devices which are attached to it.

Bug: 3022194
Change-Id: Ib01983e70b75cec40a9ee161da7f4cf1343eecf2
2010-10-05 16:08:19 -07:00
Mike Lockwood
ac3d757b81 Revert "adb: Use new libusbhost library for USB support on Linux host."
This reverts commit d7249c45f6.
2010-06-14 14:44:23 -07:00
The Android Open Source Project
b0e270fd24 am 5458065f: am 456688bf: merge from open-source master 2010-06-02 08:19:27 -07:00
The Android Open Source Project
f296c5bc39 am 12e549b0: am 5dc0f5db: merge from open-source master 2010-06-02 08:16:59 -07:00
The Android Open Source Project
456688bfb4 merge from open-source master
Change-Id: I99ae03ba51ee185b9cfecf4f26e94a757f3815c2
2010-06-02 08:14:33 -07:00
The Android Open Source Project
5dc0f5db71 merge from open-source master
Change-Id: I9e7ebc99f0de12ed3ae38a3882481485a96f9680
2010-06-02 08:13:29 -07:00
Mike Lockwood
67d5358e2a adb: remove obsolete shell history support.
Change-Id: I85a7cda176ca3bb7cb9f96e18556d53daaac3023
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-05-25 13:40:15 -04:00
Jack Palevich
7fe202f160 Use linenoise to add simple editing and history to the Android shell.
The linenoise library is from http://github.com/antirez/linenoise

This patch also disables command-line editing and history from adb. The
adb implementation was shadowing the Android shell's implementation.

The adb implementation was also shadowing the editing and history
implementation in alternative shells such as BusyBox's ash.

Change-Id: I7ebd4cb391d0ce966c0ce0e707d80ecd659f9079
2010-05-25 14:49:57 +08:00
Mike Lockwood
d7249c45f6 adb: Use new libusbhost library for USB support on Linux host.
Change-Id: I341e3be0a3eed48b6c5b6559fdbd0e956e2d8fb9
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-05-10 12:10:02 -04:00
Raphael
b419c35c66 Fix adb, fastboot to compile in Windows SDK under Linux.
(Merged from master Change I3d0e4cab)

Change-Id: Ib3fd566bdaf09d5893a6b0c66168c76c6b0d92eb
2010-04-23 13:07:17 -07:00
Raphael
fab167850d Fix adb, fastboot to compile in Windows SDK under Linux.
Change-Id: I3d0e4cabd65d9de17036901a22ec3277a6d58e64
2010-04-13 15:28:26 -07:00
Alexey Tarasov
3b226f9e3b FreeBSD support for usb-connected devices in adb
FreeBSD (and other systems as well) may use libusb to work with USB devices.
libusb is integrated in FreeBSD base system in recent builds (8.0+),
however in other systems it may need include libusb.h like <libusb/libusb.h>
and install library from devel/libusb port or other repository.

Submitted change not supports events (attach/detach) as libusb 1.0 lacks
such functionality and in order to make code more portable I've not used
workarounds as in earlier changeset.

Code was tested on FreeBSD 8.0-RC1, HTC Hero (1.0.0.A6288, Android 1.5)
2009-10-25 01:56:35 +11:00
Raphael
26f3de6738 BUG 2033924: Add AdbWinUsbApi.dll to prebuilt for Windows SDK 2009-08-26 14:46:18 -07:00
Mike Lockwood
63e6152748 adb: Remove adbd from simulator build.
It no longer compiles without recent kernel headers.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-08-26 14:46:18 -07:00
Xavier Ducrohet
a09fbd164d Preparation work for adb to support USB vendor Ids provided by SDK add-ons.
Added usb_vendors.* which handles creating (and deleting) a list of vendor ids.
This list is meant to be used everywhere the built-in lists (usb_osx), or the
built-in vendor IDs (transport_usb)  were used.

For now the list is only built with the built-in VENDOR_ID_*. Next step
is to read a small file created from all the SDK add-on.

Other misc changes: made is_adb_interface present only if ADB_HOST is true
to prevent accessing a list that doesn't exist (usb_vendors is only
compiled for the host version of adb).
2009-05-21 10:18:43 -07:00
David 'Digit' Turner
414ff7d98a Move fdevent from libcutils into adb directory. ADB is the only client of this API, and I intend to modify it extensively to clean its codebase soon. 2009-05-18 17:07:46 +02:00
Marco Nelissen
b9e966f56b adb seems to build in 64 bit mode these days, so it's safe to build for the simulator too.
While adb is not needed for the simulator, it's handy to have around when you're working with the simulator but need to look at a device.
2009-05-01 08:15:55 -07:00
The Android Open Source Project
dd7bc3319d auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
The Android Open Source Project
e54eebbf1a auto import from //depot/cupcake/@135843 2009-03-03 18:29:04 -08:00
The Android Open Source Project
5ae090ed94 auto import from //branches/cupcake/...@125939 2009-01-09 17:51:25 -08:00
The Android Open Source Project
35237d1358 Code drop from //branches/cupcake/...@124589 2008-12-17 18:08:08 -08:00
The Android Open Source Project
4f6e8d7a00 Initial Contribution 2008-10-21 07:00:00 -07:00