mid-kid
8 years ago
4 changed files with 329 additions and 21 deletions
@ -0,0 +1,28 @@ |
|||||
|
import 'vcs/git' |
||||
|
|
||||
|
name=android-tools |
||||
|
version=7.1.1_r13 |
||||
|
arch_rev='71c06907eb19e7b21dd8ecf4f6b90fd03d62bcc8' |
||||
|
update_url='https://android.googlesource.com/platform/system/core/+refs' |
||||
|
update_names="<a href=\"/platform/system/core/+/android-$version\">" |
||||
|
|
||||
|
vcs_git -Vr "android-$version" 'https://android.googlesource.com/platform/system/core' |
||||
|
vcs_git -Vr "android-$version" 'https://android.googlesource.com/platform/system/extras' |
||||
|
vcs_git -Vr "android-$version" 'https://android.googlesource.com/platform/external/libselinux' |
||||
|
vcs_git -Vr "android-$version" 'https://android.googlesource.com/platform/external/f2fs-tools' |
||||
|
extrafile 'Makefile' |
||||
|
extrafile 'fix_core.patch' |
||||
|
header_end |
||||
|
|
||||
|
( cd core |
||||
|
patch -p1 -i ../fix_core.patch |
||||
|
) |
||||
|
|
||||
|
make \ |
||||
|
VERSION="$version" |
||||
|
MYCFLAGS="$CFLAGS" \ |
||||
|
MYCXXFLAGS="$CXXFLAGS" |
||||
|
|
||||
|
install -Dm755 -t "$dir_install/$dir_prefix/$dir_bindir" adb fastboot |
||||
|
|
||||
|
# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: |
@ -0,0 +1,142 @@ |
|||||
|
# Created for android-7.0.0_r13
|
||||
|
|
||||
|
CFLAGS := -O3 -fdata-sections -ffunction-sections -flto \
|
||||
|
-DFASTBOOT_REVISION='"$(VERSION)"' \
|
||||
|
-DADB_REVISION='"$(VERSION)"' \
|
||||
|
-DADB_HOST=1 \
|
||||
|
-DFAKE_LOG_DEVICE=1 \
|
||||
|
-I core/adb \
|
||||
|
-I core/base/include \
|
||||
|
-I core/include \
|
||||
|
-I core/libsparse/include \
|
||||
|
-I core/mkbootimg \
|
||||
|
-I extras/ext4_utils \
|
||||
|
-I extras/f2fs_utils \
|
||||
|
-I f2fs-tools/include \
|
||||
|
-I f2fs-tools/mkfs \
|
||||
|
-I libselinux/include \
|
||||
|
|
||||
|
CXXFLAGS := -std=gnu++14 -fpermissive \
|
||||
|
$(CFLAGS) |
||||
|
|
||||
|
CFLAGS += $(MYCFLAGS) |
||||
|
CXXFLAGS += $(MYCXXFLAGS) |
||||
|
|
||||
|
FASTBOOT_OBJECTS := \
|
||||
|
core/fastboot/bootimg_utils.o \
|
||||
|
core/fastboot/engine.o \
|
||||
|
core/fastboot/fastboot.o \
|
||||
|
core/fastboot/fs.o \
|
||||
|
core/fastboot/protocol.o \
|
||||
|
core/fastboot/socket.o \
|
||||
|
core/fastboot/tcp.o \
|
||||
|
core/fastboot/udp.o \
|
||||
|
core/fastboot/usb_linux.o \
|
||||
|
core/fastboot/util.o \
|
||||
|
core/fastboot/util_linux.o \
|
||||
|
core/adb/diagnose_usb.o \
|
||||
|
core/base/errors_unix.o \
|
||||
|
core/base/file.o \
|
||||
|
core/base/parsenetaddress.o \
|
||||
|
core/base/stringprintf.o \
|
||||
|
core/base/strings.o \
|
||||
|
core/libcutils/socket_inaddr_any_server_unix.o \
|
||||
|
core/libcutils/socket_local_client_unix.o \
|
||||
|
core/libcutils/socket_network_client_unix.o \
|
||||
|
core/libcutils/sockets.o \
|
||||
|
core/libcutils/sockets_unix.o \
|
||||
|
core/liblog/config_write.o \
|
||||
|
core/liblog/fake_log_device.o \
|
||||
|
core/liblog/fake_writer.o \
|
||||
|
core/liblog/log_event_list.o \
|
||||
|
core/liblog/logger_lock.o \
|
||||
|
core/liblog/logger_name.o \
|
||||
|
core/liblog/logger_write.o \
|
||||
|
core/libsparse/backed_block.o \
|
||||
|
core/libsparse/output_file.o \
|
||||
|
core/libsparse/sparse.o \
|
||||
|
core/libsparse/sparse_crc32.o \
|
||||
|
core/libsparse/sparse_err.o \
|
||||
|
core/libsparse/sparse_read.o \
|
||||
|
core/libutils/FileMap.o \
|
||||
|
core/libziparchive/zip_archive.o \
|
||||
|
extras/ext4_utils/allocate.o \
|
||||
|
extras/ext4_utils/contents.o \
|
||||
|
extras/ext4_utils/crc16.o \
|
||||
|
extras/ext4_utils/ext4_sb.o \
|
||||
|
extras/ext4_utils/ext4_utils.o \
|
||||
|
extras/ext4_utils/extent.o \
|
||||
|
extras/ext4_utils/indirect.o \
|
||||
|
extras/ext4_utils/make_ext4fs.o \
|
||||
|
extras/ext4_utils/sha1.o \
|
||||
|
extras/ext4_utils/wipe.o \
|
||||
|
extras/f2fs_utils/f2fs_dlutils.o \
|
||||
|
extras/f2fs_utils/f2fs_ioutils.o \
|
||||
|
libselinux/src/callbacks.o \
|
||||
|
libselinux/src/check_context.o \
|
||||
|
libselinux/src/freecon.o \
|
||||
|
libselinux/src/init.o \
|
||||
|
libselinux/src/label.o \
|
||||
|
libselinux/src/label_android_property.o \
|
||||
|
libselinux/src/label_file.o \
|
||||
|
libselinux/src/label_support.o |
||||
|
|
||||
|
ADB_OBJECTS := \
|
||||
|
core/adb/adb.o \
|
||||
|
core/adb/adb_auth.o \
|
||||
|
core/adb/adb_auth_host.o \
|
||||
|
core/adb/adb_client.o \
|
||||
|
core/adb/adb_io.o \
|
||||
|
core/adb/adb_listeners.o \
|
||||
|
core/adb/adb_trace.o \
|
||||
|
core/adb/adb_utils.o \
|
||||
|
core/adb/bugreport.o \
|
||||
|
core/adb/client/main.o \
|
||||
|
core/adb/commandline.o \
|
||||
|
core/adb/console.o \
|
||||
|
core/adb/diagnose_usb.o \
|
||||
|
core/adb/fdevent.o \
|
||||
|
core/adb/file_sync_client.o \
|
||||
|
core/adb/get_my_path_linux.o \
|
||||
|
core/adb/line_printer.o \
|
||||
|
core/adb/services.o \
|
||||
|
core/adb/shell_service_protocol.o \
|
||||
|
core/adb/sockets.o \
|
||||
|
core/adb/sysdeps_unix.o \
|
||||
|
core/adb/transport.o \
|
||||
|
core/adb/transport_local.o \
|
||||
|
core/adb/transport_usb.o \
|
||||
|
core/adb/usb_linux.o \
|
||||
|
core/base/file.o \
|
||||
|
core/base/logging.o \
|
||||
|
core/base/parsenetaddress.o \
|
||||
|
core/base/stringprintf.o \
|
||||
|
core/base/strings.o \
|
||||
|
core/libcutils/load_file.o \
|
||||
|
core/libcutils/socket_inaddr_any_server_unix.o \
|
||||
|
core/libcutils/socket_local_client_unix.o \
|
||||
|
core/libcutils/socket_local_server_unix.o \
|
||||
|
core/libcutils/socket_loopback_client_unix.o \
|
||||
|
core/libcutils/socket_loopback_server_unix.o \
|
||||
|
core/libcutils/socket_network_client_unix.o \
|
||||
|
core/libcutils/threads.o \
|
||||
|
core/liblog/config_write.o \
|
||||
|
core/liblog/fake_log_device.o \
|
||||
|
core/liblog/fake_writer.o \
|
||||
|
core/liblog/log_event_list.o \
|
||||
|
core/liblog/logger_lock.o \
|
||||
|
core/liblog/logger_name.o \
|
||||
|
core/liblog/logger_write.o |
||||
|
|
||||
|
.PHONY: all |
||||
|
all: fastboot adb |
||||
|
|
||||
|
.PHONY: clean |
||||
|
clean: |
||||
|
rm -f fastboot $(FASTBOOT_OBJECTS) adb $(ADB_OBJECTS) |
||||
|
|
||||
|
fastboot: $(FASTBOOT_OBJECTS) |
||||
|
$(LINK.o) $(OUTPUT_OPTION) -Wl,--gc-sections -flto -lstdc++ -lpthread -lz $^ |
||||
|
|
||||
|
adb: $(ADB_OBJECTS) |
||||
|
$(LINK.o) $(OUTPUT_OPTION) -Wl,--gc-sections -flto -lstdc++ -lm -lpthread -lcrypto $^ |
@ -0,0 +1,122 @@ |
|||||
|
diff --git a/adb/adb_client.h b/adb/adb_client.h
|
||||
|
index 9f9eb1f..5355ade 100644
|
||||
|
--- a/adb/adb_client.h
|
||||
|
+++ b/adb/adb_client.h
|
||||
|
@@ -25,8 +25,8 @@
|
||||
|
|
||||
|
// Connect to adb, connect to the named service, and return a valid fd for |
||||
|
// interacting with that service upon success or a negative number on failure. |
||||
|
-int adb_connect(const std::string& service, std::string* _Nonnull error);
|
||||
|
-int _adb_connect(const std::string& service, std::string* _Nonnull error);
|
||||
|
+int adb_connect(const std::string& service, std::string* error);
|
||||
|
+int _adb_connect(const std::string& service, std::string* error);
|
||||
|
|
||||
|
// Connect to adb, connect to the named service, returns true if the connection |
||||
|
// succeeded AND the service returned OKAY. Outputs any returned error otherwise. |
||||
|
@@ -34,36 +34,36 @@ bool adb_command(const std::string& service);
|
||||
|
|
||||
|
// Connects to the named adb service and fills 'result' with the response. |
||||
|
// Returns true on success; returns false and fills 'error' on failure. |
||||
|
-bool adb_query(const std::string& service, std::string* _Nonnull result,
|
||||
|
- std::string* _Nonnull error);
|
||||
|
+bool adb_query(const std::string& service, std::string* result,
|
||||
|
+ std::string* error);
|
||||
|
|
||||
|
// Set the preferred transport to connect to. |
||||
|
-void adb_set_transport(TransportType type, const char* _Nullable serial);
|
||||
|
+void adb_set_transport(TransportType type, const char* serial);
|
||||
|
|
||||
|
// Get the preferred transport to connect to. |
||||
|
-void adb_get_transport(TransportType* _Nullable type, const char* _Nullable* _Nullable serial);
|
||||
|
+void adb_get_transport(TransportType* type, const char** serial);
|
||||
|
|
||||
|
// Set TCP specifics of the transport to use. |
||||
|
void adb_set_tcp_specifics(int server_port); |
||||
|
|
||||
|
// Set TCP Hostname of the transport to use. |
||||
|
-void adb_set_tcp_name(const char* _Nullable hostname);
|
||||
|
+void adb_set_tcp_name(const char* hostname);
|
||||
|
|
||||
|
// Send commands to the current emulator instance. Will fail if there is not |
||||
|
// exactly one emulator connected (or if you use -s <serial> with a <serial> |
||||
|
// that does not designate an emulator). |
||||
|
-int adb_send_emulator_command(int argc, const char* _Nonnull* _Nonnull argv,
|
||||
|
- const char* _Nullable serial);
|
||||
|
+int adb_send_emulator_command(int argc, const char** argv,
|
||||
|
+ const char* serial);
|
||||
|
|
||||
|
// Reads a standard adb status response (OKAY|FAIL) and returns true in the |
||||
|
// event of OKAY, false in the event of FAIL or protocol error. |
||||
|
-bool adb_status(int fd, std::string* _Nonnull error);
|
||||
|
+bool adb_status(int fd, std::string* error);
|
||||
|
|
||||
|
// Create a host command corresponding to selected transport type/serial. |
||||
|
-std::string format_host_command(const char* _Nonnull command, TransportType type,
|
||||
|
- const char* _Nullable serial);
|
||||
|
+std::string format_host_command(const char* command, TransportType type,
|
||||
|
+ const char* serial);
|
||||
|
|
||||
|
// Get the feature set of the current preferred transport. |
||||
|
-bool adb_get_feature_set(FeatureSet* _Nonnull feature_set, std::string* _Nonnull error);
|
||||
|
+bool adb_get_feature_set(FeatureSet* feature_set, std::string* error);
|
||||
|
|
||||
|
#endif |
||||
|
diff --git a/base/errors_unix.cpp b/base/errors_unix.cpp
|
||||
|
index 296995e..3b983d3 100644
|
||||
|
--- a/base/errors_unix.cpp
|
||||
|
+++ b/base/errors_unix.cpp
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
#include "android-base/errors.h" |
||||
|
|
||||
|
#include <errno.h> |
||||
|
+#include <cstring>
|
||||
|
|
||||
|
namespace android { |
||||
|
namespace base { |
||||
|
diff --git a/base/file.cpp b/base/file.cpp
|
||||
|
index da1adba..aed93d6 100644
|
||||
|
--- a/base/file.cpp
|
||||
|
+++ b/base/file.cpp
|
||||
|
@@ -21,7 +21,7 @@
|
||||
|
#include <sys/stat.h> |
||||
|
#include <sys/types.h> |
||||
|
|
||||
|
-#include <string>
|
||||
|
+#include <cstring>
|
||||
|
|
||||
|
#include "android-base/macros.h" // For TEMP_FAILURE_RETRY on Darwin. |
||||
|
#include "android-base/utf8.h" |
||||
|
diff --git a/base/logging.cpp b/base/logging.cpp
|
||||
|
index 1741871..a80cae9 100644
|
||||
|
--- a/base/logging.cpp
|
||||
|
+++ b/base/logging.cpp
|
||||
|
@@ -32,7 +32,7 @@
|
||||
|
#include <iostream> |
||||
|
#include <limits> |
||||
|
#include <sstream> |
||||
|
-#include <string>
|
||||
|
+#include <cstring>
|
||||
|
#include <utility> |
||||
|
#include <vector> |
||||
|
|
||||
|
diff --git a/fastboot/socket.h b/fastboot/socket.h
|
||||
|
index de543db..b53d2b0 100644
|
||||
|
--- a/fastboot/socket.h
|
||||
|
+++ b/fastboot/socket.h
|
||||
|
@@ -41,7 +41,6 @@
|
||||
|
|
||||
|
#include <android-base/macros.h> |
||||
|
#include <cutils/sockets.h> |
||||
|
-#include <gtest/gtest_prod.h>
|
||||
|
|
||||
|
// Socket interface to be implemented for each platform. |
||||
|
class Socket { |
||||
|
@@ -120,8 +119,6 @@ class Socket {
|
||||
|
socket_send_buffers_function_ = &socket_send_buffers; |
||||
|
|
||||
|
private: |
||||
|
- FRIEND_TEST(SocketTest, TestTcpSendBuffers);
|
||||
|
- FRIEND_TEST(SocketTest, TestUdpSendBuffers);
|
||||
|
|
||||
|
DISALLOW_COPY_AND_ASSIGN(Socket); |
||||
|
}; |
Loading…
Reference in new issue