2009-03-04 04:32:55 +01:00
|
|
|
# Copyright 2005 The Android Open Source Project
|
|
|
|
#
|
|
|
|
# Android.mk for adb
|
|
|
|
#
|
|
|
|
|
|
|
|
LOCAL_PATH:= $(call my-dir)
|
|
|
|
|
|
|
|
# adb host tool
|
|
|
|
# =========================================================
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
# Default to a virtual (sockets) usb interface
|
|
|
|
USB_SRCS :=
|
|
|
|
EXTRA_SRCS :=
|
|
|
|
|
|
|
|
ifeq ($(HOST_OS),linux)
|
|
|
|
USB_SRCS := usb_linux.c
|
|
|
|
EXTRA_SRCS := get_my_path_linux.c
|
2013-01-01 08:24:33 +01:00
|
|
|
LOCAL_LDLIBS += -lrt -ldl -lpthread
|
2012-12-07 03:18:12 +01:00
|
|
|
LOCAL_CFLAGS += -DWORKAROUND_BUG6558362
|
2009-03-04 04:32:55 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(HOST_OS),darwin)
|
|
|
|
USB_SRCS := usb_osx.c
|
|
|
|
EXTRA_SRCS := get_my_path_darwin.c
|
2012-09-01 02:44:27 +02:00
|
|
|
LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit -framework Carbon
|
2014-07-25 03:33:12 +02:00
|
|
|
LOCAL_CFLAGS += -Wno-sizeof-pointer-memaccess -Wno-unused-parameter
|
2009-03-04 04:32:55 +01:00
|
|
|
endif
|
|
|
|
|
2009-10-24 16:37:37 +02:00
|
|
|
ifeq ($(HOST_OS),freebsd)
|
|
|
|
USB_SRCS := usb_libusb.c
|
|
|
|
EXTRA_SRCS := get_my_path_freebsd.c
|
|
|
|
LOCAL_LDLIBS += -lpthread -lusb
|
|
|
|
endif
|
|
|
|
|
2009-03-04 04:32:55 +01:00
|
|
|
ifeq ($(HOST_OS),windows)
|
|
|
|
USB_SRCS := usb_windows.c
|
2013-12-07 00:50:48 +01:00
|
|
|
EXTRA_SRCS := get_my_path_windows.c
|
2012-09-01 02:44:27 +02:00
|
|
|
EXTRA_STATIC_LIBS := AdbWinApi
|
2009-03-04 04:32:55 +01:00
|
|
|
ifneq ($(strip $(USE_CYGWIN)),)
|
2010-04-14 00:25:50 +02:00
|
|
|
# Pure cygwin case
|
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-04-12 21:23:49 +02:00
|
|
|
LOCAL_LDLIBS += -lpthread -lgdi32
|
2010-04-14 00:25:50 +02:00
|
|
|
endif
|
|
|
|
ifneq ($(strip $(USE_MINGW)),)
|
|
|
|
# MinGW under Linux case
|
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-04-12 21:23:49 +02:00
|
|
|
LOCAL_LDLIBS += -lws2_32 -lgdi32
|
2009-03-04 04:32:55 +01:00
|
|
|
USE_SYSDEPS_WIN32 := 1
|
|
|
|
endif
|
2010-04-14 00:25:50 +02:00
|
|
|
LOCAL_C_INCLUDES += development/host/windows/usb/api/
|
2009-03-04 04:32:55 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
LOCAL_SRC_FILES := \
|
|
|
|
adb.c \
|
|
|
|
console.c \
|
|
|
|
transport.c \
|
|
|
|
transport_local.c \
|
|
|
|
transport_usb.c \
|
|
|
|
commandline.c \
|
|
|
|
adb_client.c \
|
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-04-12 21:23:49 +02:00
|
|
|
adb_auth_host.c \
|
2009-03-04 04:32:55 +01:00
|
|
|
sockets.c \
|
|
|
|
services.c \
|
|
|
|
file_sync_client.c \
|
|
|
|
$(EXTRA_SRCS) \
|
|
|
|
$(USB_SRCS) \
|
|
|
|
|
|
|
|
ifneq ($(USE_SYSDEPS_WIN32),)
|
|
|
|
LOCAL_SRC_FILES += sysdeps_win32.c
|
2009-05-18 17:07:46 +02:00
|
|
|
else
|
|
|
|
LOCAL_SRC_FILES += fdevent.c
|
2009-03-04 04:32:55 +01:00
|
|
|
endif
|
|
|
|
|
2014-10-02 02:16:37 +02:00
|
|
|
LOCAL_CFLAGS += -O2 -g -DADB_HOST=1 -Wall -Wno-unused-parameter -Werror
|
2010-05-25 08:49:57 +02:00
|
|
|
LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE
|
2009-03-04 04:32:55 +01:00
|
|
|
LOCAL_MODULE := adb
|
2012-09-26 18:58:07 +02:00
|
|
|
LOCAL_MODULE_TAGS := debug
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2014-12-07 16:13:29 +01:00
|
|
|
LOCAL_STATIC_LIBRARIES := libzipfile libz libcrypto_static $(EXTRA_STATIC_LIBS)
|
2009-03-04 04:32:55 +01:00
|
|
|
ifeq ($(USE_SYSDEPS_WIN32),)
|
|
|
|
LOCAL_STATIC_LIBRARIES += libcutils
|
|
|
|
endif
|
|
|
|
|
2014-09-04 04:48:48 +02:00
|
|
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
2009-03-04 04:32:55 +01:00
|
|
|
include $(BUILD_HOST_EXECUTABLE)
|
|
|
|
|
2012-09-05 19:26:43 +02:00
|
|
|
$(call dist-for-goals,dist_files sdk,$(LOCAL_BUILT_MODULE))
|
2009-03-04 04:32:55 +01:00
|
|
|
|
|
|
|
ifeq ($(HOST_OS),windows)
|
2009-08-11 20:08:45 +02:00
|
|
|
$(LOCAL_INSTALLED_MODULE): \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/AdbWinApi.dll \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/AdbWinUsbApi.dll
|
2009-03-04 04:32:55 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
# adbd device daemon
|
|
|
|
# =========================================================
|
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_SRC_FILES := \
|
|
|
|
adb.c \
|
2009-05-18 17:07:46 +02:00
|
|
|
fdevent.c \
|
2009-03-04 04:32:55 +01:00
|
|
|
transport.c \
|
|
|
|
transport_local.c \
|
|
|
|
transport_usb.c \
|
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-04-12 21:23:49 +02:00
|
|
|
adb_auth_client.c \
|
2009-03-04 04:32:55 +01:00
|
|
|
sockets.c \
|
|
|
|
services.c \
|
|
|
|
file_sync_service.c \
|
|
|
|
jdwp_service.c \
|
|
|
|
framebuffer_service.c \
|
|
|
|
remount_service.c \
|
2014-12-04 00:31:57 +01:00
|
|
|
set_verity_enable_state_service.c \
|
2013-12-10 21:37:57 +01:00
|
|
|
usb_linux_client.c
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2014-09-04 04:48:48 +02:00
|
|
|
LOCAL_CFLAGS := \
|
|
|
|
-O2 \
|
|
|
|
-g \
|
|
|
|
-DADB_HOST=0 \
|
|
|
|
-D_XOPEN_SOURCE \
|
|
|
|
-D_GNU_SOURCE \
|
|
|
|
-Wall -Wno-unused-parameter -Werror -Wno-deprecated-declarations \
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2012-01-19 22:11:35 +01:00
|
|
|
ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
|
|
|
|
LOCAL_CFLAGS += -DALLOW_ADBD_ROOT=1
|
|
|
|
endif
|
|
|
|
|
2014-10-09 16:22:49 +02:00
|
|
|
ifneq (,$(filter userdebug,$(TARGET_BUILD_VARIANT)))
|
|
|
|
LOCAL_CFLAGS += -DALLOW_ADBD_DISABLE_VERITY=1
|
|
|
|
endif
|
|
|
|
|
2009-03-04 04:32:55 +01:00
|
|
|
LOCAL_MODULE := adbd
|
|
|
|
|
|
|
|
LOCAL_FORCE_STATIC_EXECUTABLE := true
|
|
|
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
|
|
|
|
LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
|
2014-10-09 16:22:49 +02:00
|
|
|
LOCAL_C_INCLUDES += system/extras/ext4_utils system/core/fs_mgr/include
|
|
|
|
|
|
|
|
LOCAL_STATIC_LIBRARIES := liblog \
|
|
|
|
libfs_mgr \
|
|
|
|
libcutils \
|
|
|
|
libc \
|
|
|
|
libmincrypt \
|
|
|
|
libselinux \
|
|
|
|
libext4_utils_static
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2014-09-04 04:48:48 +02:00
|
|
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
2014-10-09 16:22:49 +02:00
|
|
|
|
2011-07-12 07:12:32 +02:00
|
|
|
include $(BUILD_EXECUTABLE)
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2010-09-24 00:08:34 +02:00
|
|
|
|
|
|
|
# adb host tool for device-as-host
|
|
|
|
# =========================================================
|
2010-10-07 03:30:55 +02:00
|
|
|
ifneq ($(SDK_ONLY),true)
|
2010-09-24 00:08:34 +02:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_SRC_FILES := \
|
|
|
|
adb.c \
|
|
|
|
console.c \
|
|
|
|
transport.c \
|
|
|
|
transport_local.c \
|
|
|
|
transport_usb.c \
|
|
|
|
commandline.c \
|
|
|
|
adb_client.c \
|
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-04-12 21:23:49 +02:00
|
|
|
adb_auth_host.c \
|
2010-09-24 00:08:34 +02:00
|
|
|
sockets.c \
|
|
|
|
services.c \
|
|
|
|
file_sync_client.c \
|
|
|
|
get_my_path_linux.c \
|
|
|
|
usb_linux.c \
|
|
|
|
fdevent.c
|
|
|
|
|
|
|
|
LOCAL_CFLAGS := \
|
|
|
|
-O2 \
|
|
|
|
-g \
|
|
|
|
-DADB_HOST=1 \
|
|
|
|
-DADB_HOST_ON_TARGET=1 \
|
2014-04-30 18:10:31 +02:00
|
|
|
-Wall -Wno-unused-parameter -Werror \
|
2010-09-24 00:08:34 +02:00
|
|
|
-D_XOPEN_SOURCE \
|
|
|
|
-D_GNU_SOURCE
|
|
|
|
|
|
|
|
LOCAL_MODULE := adb
|
|
|
|
|
2014-12-07 16:13:29 +01:00
|
|
|
LOCAL_STATIC_LIBRARIES := libzipfile libz libcutils liblog
|
2010-09-24 00:08:34 +02:00
|
|
|
|
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-04-12 21:23:49 +02:00
|
|
|
LOCAL_SHARED_LIBRARIES := libcrypto
|
|
|
|
|
2014-09-04 04:48:48 +02:00
|
|
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
2010-09-24 00:08:34 +02:00
|
|
|
include $(BUILD_EXECUTABLE)
|
2010-10-07 02:11:59 +02:00
|
|
|
endif
|