Changeset View
Changeset View
Standalone View
Standalone View
files/fix_build_core.patch
| diff --git a/adb/adb.cpp b/adb/adb.cpp | diff --git a/adb/adb.cpp b/adb/adb.cpp | ||||
| index 1ec145b25c..b6e943f6ee 100644 | index 08986b77e..46b603650 100644 | ||||
| --- a/adb/adb.cpp | --- a/adb/adb.cpp | ||||
| +++ b/adb/adb.cpp | +++ b/adb/adb.cpp | ||||
| @@ -44,8 +44,6 @@ | @@ -45,8 +45,6 @@ | ||||
| #include <android-base/parsenetaddress.h> | #include <android-base/parsenetaddress.h> | ||||
| #include <android-base/stringprintf.h> | #include <android-base/stringprintf.h> | ||||
| #include <android-base/strings.h> | #include <android-base/strings.h> | ||||
| -#include <build/version.h> | -#include <build/version.h> | ||||
| -#include <platform_tools_version.h> | -#include <platform_tools_version.h> | ||||
| #include "adb_auth.h" | #include "adb_auth.h" | ||||
| #include "adb_io.h" | #include "adb_io.h" | ||||
| @@ -66,10 +64,10 @@ std::string adb_version() { | @@ -74,10 +72,10 @@ std::string adb_version() { | ||||
| // Don't change the format of this --- it's parsed by ddmlib. | // Don't change the format of this --- it's parsed by ddmlib. | ||||
| return android::base::StringPrintf( | return android::base::StringPrintf( | ||||
| "Android Debug Bridge version %d.%d.%d\n" | "Android Debug Bridge version %d.%d.%d\n" | ||||
| - "Version %s-%s\n" | - "Version %s-%s\n" | ||||
| + "Version %s\n" | + "Version %s\n" | ||||
| "Installed as %s\n", | "Installed as %s\n", | ||||
| ADB_VERSION_MAJOR, ADB_VERSION_MINOR, ADB_SERVER_VERSION, | ADB_VERSION_MAJOR, ADB_VERSION_MINOR, ADB_SERVER_VERSION, | ||||
| - PLATFORM_TOOLS_VERSION, android::build::GetBuildNumber().c_str(), | - PLATFORM_TOOLS_VERSION, android::build::GetBuildNumber().c_str(), | ||||
| + PLATFORM_TOOLS_VERSION, | + PLATFORM_TOOLS_VERSION, | ||||
| android::base::GetExecutablePath().c_str()); | android::base::GetExecutablePath().c_str()); | ||||
| } | } | ||||
| @@ -1079,21 +1077,6 @@ void adb_set_reject_kill_server(bool value) { | |||||
| } | |||||
| static bool handle_mdns_request(std::string_view service, int reply_fd) { | |||||
| - if (!android::base::ConsumePrefix(&service, "mdns:")) { | |||||
| - return false; | |||||
| - } | |||||
| - | |||||
| - if (service == "check") { | |||||
| - std::string check = mdns_check(); | |||||
| - SendOkay(reply_fd, check); | |||||
| - return true; | |||||
| - } | |||||
| - if (service == "services") { | |||||
| - std::string services_list = mdns_list_discovered_services(); | |||||
| - SendOkay(reply_fd, services_list); | |||||
| - return true; | |||||
| - } | |||||
| - | |||||
| return false; | |||||
| } | |||||
| diff --git a/adb/client/adb_wifi.cpp b/adb/client/adb_wifi.cpp | |||||
| index 61a9a480c..ded4f8f61 100644 | |||||
| --- a/adb/client/adb_wifi.cpp | |||||
| +++ b/adb/client/adb_wifi.cpp | |||||
| @@ -179,23 +179,6 @@ bool adb_wifi_is_known_host(const std::string& host) { | |||||
| void adb_wifi_pair_device(const std::string& host, const std::string& password, | |||||
| std::string& response) { | |||||
| - auto mdns_info = mdns_get_pairing_service_info(host); | |||||
| - | |||||
| - if (!mdns_info.has_value()) { | |||||
| - // Check the address for a valid address and port. | |||||
| - std::string parsed_host; | |||||
| - std::string err; | |||||
| - int port = -1; | |||||
| - if (!android::base::ParseNetAddress(host, &parsed_host, &port, nullptr, &err)) { | |||||
| - response = "Failed to parse address for pairing: " + err; | |||||
| - return; | |||||
| - } | |||||
| - if (port <= 0 || port > 65535) { | |||||
| - response = "Invalid port while parsing address [" + host + "]"; | |||||
| - return; | |||||
| - } | |||||
| - } | |||||
| - | |||||
| auto priv_key = adb_auth_get_user_privkey(); | |||||
| auto x509_cert = GenerateX509Certificate(priv_key.get()); | |||||
| if (!x509_cert) { | |||||
| @@ -224,10 +207,7 @@ void adb_wifi_pair_device(const std::string& host, const std::string& password, | |||||
| PairingResultWaiter waiter; | |||||
| std::unique_lock<std::mutex> lock(waiter.mutex_); | |||||
| - if (!client->Start(mdns_info.has_value() | |||||
| - ? android::base::StringPrintf("%s:%d", mdns_info->addr.c_str(), | |||||
| - mdns_info->port) | |||||
| - : host, | |||||
| + if (!client->Start(host, | |||||
| waiter.OnResult, &waiter)) { | |||||
| response = "Failed: Unable to start pairing client."; | |||||
| return; | |||||
| @@ -250,5 +230,6 @@ void adb_wifi_pair_device(const std::string& host, const std::string& password, | |||||
| // Write to adb_known_hosts | |||||
| write_known_host_to_file(device_guid); | |||||
| // Try to auto-connect. | |||||
| - adb_secure_connect_by_service_name(device_guid.c_str()); | |||||
| + // ARCH: following function requires mdns code that is not compatible with mdns system library | |||||
| + // adb_secure_connect_by_service_name(device_guid.c_str()); | |||||
| } | |||||
| diff --git a/adb/client/main.cpp b/adb/client/main.cpp | diff --git a/adb/client/main.cpp b/adb/client/main.cpp | ||||
| index 0c5c28f1b3..b6a1281521 100644 | index a19bd6d31..356aeb221 100644 | ||||
| --- a/adb/client/main.cpp | --- a/adb/client/main.cpp | ||||
| +++ b/adb/client/main.cpp | +++ b/adb/client/main.cpp | ||||
| @@ -118,10 +118,6 @@ int adb_server_main(int is_daemon, const std::string& socket_spec, int ack_reply | @@ -126,9 +126,6 @@ int adb_server_main(int is_daemon, const std::string& socket_spec, int ack_reply | ||||
| init_transport_registration(); | |||||
| init_reconnect_handler(); | init_reconnect_handler(); | ||||
| adb_wifi_init(); | |||||
| - if (!getenv("ADB_MDNS") || strcmp(getenv("ADB_MDNS"), "0") != 0) { | - if (!getenv("ADB_MDNS") || strcmp(getenv("ADB_MDNS"), "0") != 0) { | ||||
| - init_mdns_transport_discovery(); | - init_mdns_transport_discovery(); | ||||
| - } | - } | ||||
| - | |||||
| if (!getenv("ADB_USB") || strcmp(getenv("ADB_USB"), "0") != 0) { | if (!getenv("ADB_USB") || strcmp(getenv("ADB_USB"), "0") != 0) { | ||||
| usb_init(); | usb_init(); | ||||
| } else { | |||||
| diff --git a/adb/client/usb_libusb.cpp b/adb/client/usb_libusb.cpp | diff --git a/adb/client/usb_libusb.cpp b/adb/client/usb_libusb.cpp | ||||
| index 53f01a0ce5..b4c3aadc28 100644 | index 07cbc9418..614539219 100644 | ||||
| --- a/adb/client/usb_libusb.cpp | --- a/adb/client/usb_libusb.cpp | ||||
| +++ b/adb/client/usb_libusb.cpp | +++ b/adb/client/usb_libusb.cpp | ||||
| @@ -30,7 +30,7 @@ | @@ -30,7 +30,7 @@ | ||||
| #include <thread> | #include <thread> | ||||
| #include <unordered_map> | #include <unordered_map> | ||||
| -#include <libusb/libusb.h> | -#include <libusb/libusb.h> | ||||
| +#include <libusb-1.0/libusb.h> | +#include <libusb-1.0/libusb.h> | ||||
| #include <android-base/file.h> | #include <android-base/file.h> | ||||
| #include <android-base/logging.h> | #include <android-base/logging.h> | ||||
| diff --git a/adb/crypto/x509_generator.cpp b/adb/crypto/x509_generator.cpp | |||||
| index 43b815304..6900b3a49 100644 | |||||
| --- a/adb/crypto/x509_generator.cpp | |||||
| +++ b/adb/crypto/x509_generator.cpp | |||||
| @@ -17,6 +17,7 @@ | |||||
| #include "adb/crypto/x509_generator.h" | |||||
| #include <vector> | |||||
| +#include <string.h> | |||||
| #include <android-base/logging.h> | |||||
| #include <crypto_utils/android_pubkey.h> | |||||
| diff --git a/adb/pairing_auth/aes_128_gcm.cpp b/adb/pairing_auth/aes_128_gcm.cpp | |||||
| index 51520d814..2d5f86fa8 100644 | |||||
| --- a/adb/pairing_auth/aes_128_gcm.cpp | |||||
| +++ b/adb/pairing_auth/aes_128_gcm.cpp | |||||
| @@ -23,6 +23,8 @@ | |||||
| #include <openssl/hkdf.h> | |||||
| #include <openssl/rand.h> | |||||
| +#include <string.h> | |||||
| + | |||||
| namespace adb { | |||||
| namespace pairing { | |||||
| diff --git a/adb/pairing_auth/pairing_auth.cpp b/adb/pairing_auth/pairing_auth.cpp | |||||
| index 0ac04e691..de2aa740e 100644 | |||||
| --- a/adb/pairing_auth/pairing_auth.cpp | |||||
| +++ b/adb/pairing_auth/pairing_auth.cpp | |||||
| @@ -21,6 +21,7 @@ | |||||
| #include <openssl/curve25519.h> | |||||
| #include <openssl/mem.h> | |||||
| +#include <string.h> | |||||
| #include <iomanip> | |||||
| #include <sstream> | |||||
| #include <vector> | |||||
| diff --git a/adb/socket_spec.cpp b/adb/socket_spec.cpp | |||||
| index 5cad70d09..9f9730719 100644 | |||||
| --- a/adb/socket_spec.cpp | |||||
| +++ b/adb/socket_spec.cpp | |||||
| @@ -196,24 +196,7 @@ bool socket_spec_connect(unique_fd* fd, std::string_view address, int* port, std | |||||
| fd->reset(network_loopback_client(port_value, SOCK_STREAM, error)); | |||||
| } else { | |||||
| #if ADB_HOST | |||||
| - // Check if the address is an mdns service we can connect to. | |||||
| - if (auto mdns_info = mdns_get_connect_service_info(address.substr(4)); | |||||
| - mdns_info != std::nullopt) { | |||||
| - fd->reset(network_connect(mdns_info->addr, mdns_info->port, SOCK_STREAM, 0, error)); | |||||
| - if (fd->get() != -1) { | |||||
| - // TODO(joshuaduong): We still show the ip address for the serial. Change it to | |||||
| - // use the mdns instance name, so we can adjust to address changes on | |||||
| - // reconnects. | |||||
| - port_value = mdns_info->port; | |||||
| - if (serial) { | |||||
| - *serial = android::base::StringPrintf("%s.%s", | |||||
| - mdns_info->service_name.c_str(), | |||||
| - mdns_info->service_type.c_str()); | |||||
| - } | |||||
| - } | |||||
| - } else { | |||||
| - fd->reset(network_connect(hostname, port_value, SOCK_STREAM, 0, error)); | |||||
| - } | |||||
| + fd->reset(network_connect(hostname, port_value, SOCK_STREAM, 0, error)); | |||||
| #else | |||||
| // Disallow arbitrary connections in adbd. | |||||
| *error = "adbd does not support arbitrary tcp connections"; | |||||
| diff --git a/adb/tls/tls_connection.cpp b/adb/tls/tls_connection.cpp | |||||
| index 853cdac08..3613c3768 100644 | |||||
| --- a/adb/tls/tls_connection.cpp | |||||
| +++ b/adb/tls/tls_connection.cpp | |||||
| @@ -18,6 +18,7 @@ | |||||
| #include <algorithm> | |||||
| #include <vector> | |||||
| +#include <limits.h> | |||||
| #include <android-base/logging.h> | |||||
| #include <android-base/strings.h> | |||||
| diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp | diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp | ||||
| index 2fe3b1a9e0..a61b221ce3 100644 | index 4bf791ecf..42c48d816 100644 | ||||
| --- a/fastboot/fastboot.cpp | --- a/fastboot/fastboot.cpp | ||||
| +++ b/fastboot/fastboot.cpp | +++ b/fastboot/fastboot.cpp | ||||
| @@ -59,10 +59,8 @@ | @@ -59,10 +59,8 @@ | ||||
| #include <android-base/stringprintf.h> | #include <android-base/stringprintf.h> | ||||
| #include <android-base/strings.h> | #include <android-base/strings.h> | ||||
| #include <android-base/unique_fd.h> | #include <android-base/unique_fd.h> | ||||
| -#include <build/version.h> | -#include <build/version.h> | ||||
| #include <libavb/libavb.h> | #include <libavb/libavb.h> | ||||
| #include <liblp/liblp.h> | #include <liblp/liblp.h> | ||||
| -#include <platform_tools_version.h> | -#include <platform_tools_version.h> | ||||
| #include <sparse/sparse.h> | #include <sparse/sparse.h> | ||||
| #include <ziparchive/zip_archive.h> | #include <ziparchive/zip_archive.h> | ||||
| @@ -1783,7 +1781,7 @@ int FastBootTool::Main(int argc, char* argv[]) { | @@ -1863,7 +1861,7 @@ int FastBootTool::Main(int argc, char* argv[]) { | ||||
| setvbuf(stdout, nullptr, _IONBF, 0); | setvbuf(stdout, nullptr, _IONBF, 0); | ||||
| setvbuf(stderr, nullptr, _IONBF, 0); | setvbuf(stderr, nullptr, _IONBF, 0); | ||||
| } else if (name == "version") { | } else if (name == "version") { | ||||
| - fprintf(stdout, "fastboot version %s-%s\n", PLATFORM_TOOLS_VERSION, android::build::GetBuildNumber().c_str()); | - fprintf(stdout, "fastboot version %s-%s\n", PLATFORM_TOOLS_VERSION, android::build::GetBuildNumber().c_str()); | ||||
| + fprintf(stdout, "fastboot version %s\n", PLATFORM_TOOLS_VERSION); | + fprintf(stdout, "fastboot version %s\n", PLATFORM_TOOLS_VERSION); | ||||
| fprintf(stdout, "Installed as %s\n", android::base::GetExecutablePath().c_str()); | fprintf(stdout, "Installed as %s\n", android::base::GetExecutablePath().c_str()); | ||||
| return 0; | return 0; | ||||
| #if !defined(_WIN32) | #if !defined(_WIN32) | ||||
| diff --git a/fastboot/fs.cpp b/fastboot/fs.cpp | diff --git a/fastboot/fs.cpp b/fastboot/fs.cpp | ||||
| index 8c0aa6bf4e..3ad5b53568 100644 | index 8c0aa6bf4..3ad5b5356 100644 | ||||
| --- a/fastboot/fs.cpp | --- a/fastboot/fs.cpp | ||||
| +++ b/fastboot/fs.cpp | +++ b/fastboot/fs.cpp | ||||
| @@ -117,7 +117,7 @@ static int generate_ext4_image(const char* fileName, long long partSize, | @@ -117,7 +117,7 @@ static int generate_ext4_image(const char* fileName, long long partSize, | ||||
| static constexpr int block_size = 4096; | static constexpr int block_size = 4096; | ||||
| const std::string exec_dir = android::base::GetExecutableDirectory(); | const std::string exec_dir = android::base::GetExecutableDirectory(); | ||||
| - const std::string mke2fs_path = exec_dir + "/mke2fs"; | - const std::string mke2fs_path = exec_dir + "/mke2fs"; | ||||
| + const std::string mke2fs_path = exec_dir + "/mke2fs.android"; | + const std::string mke2fs_path = exec_dir + "/mke2fs.android"; | ||||
| std::vector<const char*> mke2fs_args = {mke2fs_path.c_str(), "-t", "ext4", "-b"}; | std::vector<const char*> mke2fs_args = {mke2fs_path.c_str(), "-t", "ext4", "-b"}; | ||||
| std::string block_size_str = std::to_string(block_size); | std::string block_size_str = std::to_string(block_size); | ||||
| diff --git a/libcutils/include/cutils/threads.h b/libcutils/include/cutils/threads.h | diff --git a/libcutils/include/cutils/threads.h b/libcutils/include/cutils/threads.h | ||||
| index ba4846e33b..f3fccc4895 100644 | index ba4846e33..f3fccc489 100644 | ||||
| --- a/libcutils/include/cutils/threads.h | --- a/libcutils/include/cutils/threads.h | ||||
| +++ b/libcutils/include/cutils/threads.h | +++ b/libcutils/include/cutils/threads.h | ||||
| @@ -33,8 +33,6 @@ extern "C" { | @@ -33,8 +33,6 @@ extern "C" { | ||||
| // Deprecated: use android::base::GetThreadId instead, which doesn't truncate on Mac/Windows. | // Deprecated: use android::base::GetThreadId instead, which doesn't truncate on Mac/Windows. | ||||
| // | // | ||||
| -extern pid_t gettid(); | -extern pid_t gettid(); | ||||
| - | - | ||||
| // | // | ||||
| // Deprecated: use `_Thread_local` in C or `thread_local` in C++. | // Deprecated: use `_Thread_local` in C or `thread_local` in C++. | ||||
| // | // | ||||
| No newline at end of file | |||||
Copyright © 2015-2021 Solus Project. The Solus logo is Copyright © 2016-2021 Solus Project. All Rights Reserved.