Skip to content

Commit

Permalink
Upgrade to platform-tools-35.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Biswa96 committed Apr 25, 2024
1 parent a81d3b2 commit 108d772
Show file tree
Hide file tree
Showing 29 changed files with 368 additions and 305 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ set(ANDROID_MKE2FS_NAME "mke2fs.android")

# Version of android-tools and the version of boringssl being used.
# See: https://android.googlesource.com/platform/external/boringssl/+/platform-tools-${ANDROID_VERSION}/BORINGSSL_REVISION
set(ANDROID_VERSION 34.0.5)
set(BORINGSSL_VERSION e28988ecaa5e72523a982915084c9422e495116d)
set(ANDROID_VERSION 35.0.1)
set(BORINGSSL_VERSION 538b2a6cf0497cf8bb61ae726a484a3d7a34e54e)

# Vendor string used in version outputs.
set(ANDROID_VENDOR android-tools)
Expand Down
7 changes: 4 additions & 3 deletions patches/adb/0002-adb-disable-mdns-transport-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ diff --git a/client/main.cpp b/client/main.cpp
index 4fa58faf..c14b3463 100644
--- a/client/main.cpp
+++ b/client/main.cpp
@@ -129,9 +129,6 @@ int adb_server_main(int is_daemon, const std::string& socket_spec, int ack_reply
@@ -132,10 +132,6 @@ int adb_server_main(int is_daemon, const std::string& socket_spec, const char* o

init_reconnect_handler();

adb_wifi_init();
- if (!getenv("ADB_MDNS") || strcmp(getenv("ADB_MDNS"), "0") != 0) {
- init_mdns_transport_discovery();
- }
-
if (!getenv("ADB_USB") || strcmp(getenv("ADB_USB"), "0") != 0) {
if (should_use_libusb()) {
libusb::usb_init();
26 changes: 0 additions & 26 deletions patches/adb/0025-Add-explicit-import-for-algorithm.patch

This file was deleted.

26 changes: 0 additions & 26 deletions patches/base/0001-LoadedArsc-un-const-T-in-std-vector-T.patch

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,51 @@ Subject: [PATCH] PosixUtils: don't use reserved name std{out,err} for

musl's std{out,err} are macros.
---
libs/androidfw/PosixUtils.cpp | 40 +++++++++----------
libs/androidfw/include/androidfw/PosixUtils.h | 4 +-
libs/androidfw/tests/PosixUtils_test.cpp | 4 +-
3 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/libs/androidfw/PosixUtils.cpp b/libs/androidfw/PosixUtils.cpp
index 026912883a73..c01bfcd29eb8 100644
index 8ddc5724..8dd1cd68 100644
--- a/libs/androidfw/PosixUtils.cpp
+++ b/libs/androidfw/PosixUtils.cpp
@@ -50,17 +50,17 @@ namespace android {
@@ -46,17 +46,17 @@ namespace android {
namespace util {

std::unique_ptr<ProcResult> ExecuteBinary(const std::vector<std::string>& argv) {
- int stdout[2]; // stdout[0] read, stdout[1] write
ProcResult ExecuteBinary(const std::vector<std::string>& argv) {
- int stdout[2]; // [0] read, [1] write
- if (pipe(stdout) != 0) {
+ int fdout[2]; // fdout[0] read, fdout[1] write
+ int fdout[2]; // [0] read, [1] write
+ if (pipe(fdout) != 0) {
PLOG(ERROR) << "pipe";
return nullptr;
PLOG(ERROR) << "out pipe";
return ProcResult{-1};
}

- int stderr[2]; // stdout[0] read, stdout[1] write
- int stderr[2]; // [0] read, [1] write
- if (pipe(stderr) != 0) {
+ int fderr[2]; // fderr[0] read, fderr[1] write
+ int fderr[2]; // [0] read, [1] write
+ if (pipe(fderr) != 0) {
PLOG(ERROR) << "pipe";
PLOG(ERROR) << "err pipe";
- close(stdout[0]);
- close(stdout[1]);
+ close(fdout[0]);
+ close(fdout[1]);
return nullptr;
return ProcResult{-1};
}

@@ -89,12 +89,12 @@ std::unique_ptr<ProcResult> ExecuteBinary(const std::vector<std::string>& argv)

@@ -73,10 +73,10 @@ ProcResult ExecuteBinary(const std::vector<std::string>& argv) {
switch (pid) {
case -1: // error
free(argv0);
- close(stdout[0]);
- close(stdout[1]);
- close(stderr[0]);
- close(stderr[1]);
+ close(fdout[0]);
+ close(fdout[1]);
+ close(fderr[0]);
+ close(fderr[1]);
PLOG(ERROR) << "fork";
return ProcResult{-1};
case 0: // child
@@ -90,12 +90,12 @@ ProcResult ExecuteBinary(const std::vector<std::string>& argv) {
exit(1);
}

Expand All @@ -57,7 +68,7 @@ index 026912883a73..c01bfcd29eb8 100644
abort();
}
execvp(argv0[0], const_cast<char* const*>(argv0));
@@ -102,23 +102,23 @@ std::unique_ptr<ProcResult> ExecuteBinary(const std::vector<std::string>& argv)
@@ -103,22 +103,22 @@ ProcResult ExecuteBinary(const std::vector<std::string>& argv) {
abort();
default: // parent
free(argv0);
Expand All @@ -72,58 +83,19 @@ index 026912883a73..c01bfcd29eb8 100644
- close(stderr[0]);
+ close(fdout[0]);
+ close(fderr[0]);
return nullptr;
return ProcResult{-1};
}
std::unique_ptr<ProcResult> result(new ProcResult());
result->status = status;
- const auto out = ReadFile(stdout[0]);
- result->stdout_str = out ? *out : "";
ProcResult result(status);
- auto out = ReadFile(stdout[0]);
+ auto out = ReadFile(fdout[0]);
result.stdout_str = out ? std::move(*out) : "";
- close(stdout[0]);
- const auto err = ReadFile(stderr[0]);
- result->stderr_str = err ? *err : "";
- close(stderr[0]);
+ const auto out = ReadFile(fdout[0]);
+ result->stdout_ = out ? *out : "";
- auto err = ReadFile(stderr[0]);
+ close(fdout[0]);
+ const auto err = ReadFile(fderr[0]);
+ result->stderr_ = err ? *err : "";
+ auto err = ReadFile(fderr[0]);
result.stderr_str = err ? std::move(*err) : "";
- close(stderr[0]);
+ close(fderr[0]);
return result;
return std::move(result);
}
}
diff --git a/libs/androidfw/include/androidfw/PosixUtils.h b/libs/androidfw/include/androidfw/PosixUtils.h
index bb2084740a44..c6bb3fb42757 100644
--- a/libs/androidfw/include/androidfw/PosixUtils.h
+++ b/libs/androidfw/include/androidfw/PosixUtils.h
@@ -23,8 +23,8 @@ namespace util {

struct ProcResult {
int status;
- std::string stdout_str;
- std::string stderr_str;
+ std::string stdout_;
+ std::string stderr_;
};

// Fork, exec and wait for an external process. Return nullptr if the process could not be launched,
diff --git a/libs/androidfw/tests/PosixUtils_test.cpp b/libs/androidfw/tests/PosixUtils_test.cpp
index c7b3eba1451f..44816b279c1a 100644
--- a/libs/androidfw/tests/PosixUtils_test.cpp
+++ b/libs/androidfw/tests/PosixUtils_test.cpp
@@ -30,14 +30,14 @@ TEST(PosixUtilsTest, AbsolutePathToBinary) {
const auto result = ExecuteBinary({"/bin/date", "--help"});
ASSERT_THAT(result, NotNull());
ASSERT_EQ(result->status, 0);
- ASSERT_GE(result->stdout_str.find("usage: date "), 0);
+ ASSERT_GE(result->stdout_.find("usage: date "), 0);
}

TEST(PosixUtilsTest, RelativePathToBinary) {
const auto result = ExecuteBinary({"date", "--help"});
ASSERT_THAT(result, NotNull());
ASSERT_EQ(result->status, 0);
- ASSERT_GE(result->stdout_str.find("usage: date "), 0);
+ ASSERT_GE(result->stdout_.find("usage: date "), 0);
}

TEST(PosixUtilsTest, BadParameters) {

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1529526b..a393b7d7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -140,7 +140,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CLANG)
@@ -139,7 +139,7 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
if(CMAKE_COMPILER_IS_GNUCXX OR CLANG)
# Note clang-cl is odd and sets both CLANG and MSVC. We base our configuration
# primarily on our normal Clang one.
# TODO(bbe) took out -Wmissing-field-initializers for pki - fix and put back or disable only for pki
- set(C_CXX_FLAGS "-Werror -Wformat=2 -Wsign-compare -Wwrite-strings -Wvla -Wshadow -Wtype-limits")
+ set(C_CXX_FLAGS "-Wformat=2 -Wsign-compare -Wwrite-strings -Wvla -Wshadow -Wtype-limits")
- set(C_CXX_FLAGS "-Werror -Wformat=2 -Wsign-compare -Wwrite-strings -Wvla -Wshadow -Wtype-limits -Wmissing-field-initializers")
+ set(C_CXX_FLAGS "-Wformat=2 -Wsign-compare -Wwrite-strings -Wvla -Wshadow -Wtype-limits -Wmissing-field-initializers")
if(MSVC)
# clang-cl sets different default warnings than clang. It also treats -Wall
# as -Weverything, to match MSVC. Instead -W3 is the alias for -Wall.
--
2.40.1

Original file line number Diff line number Diff line change
Expand Up @@ -516,24 +516,24 @@ index dbaeb93..0cc119c 100644
@@ -24,7 +23,9 @@
#include <string_view>
#include <vector>

-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
static constexpr const char* CGROUPV2_CONTROLLER_NAME = "cgroup2";

@@ -38,7 +39,9 @@ bool SetTaskProfiles(int tid, const std::vector<std::string>& profiles, bool use

static constexpr const char* CGROUPV2_HIERARCHY_NAME = "cgroup2";
[[deprecated]] static constexpr const char* CGROUPV2_CONTROLLER_NAME = "cgroup2";
@@ -40,7 +41,9 @@ bool SetTaskProfiles(pid_t tid, const std::vector<std::string>& profiles,
bool SetProcessProfiles(uid_t uid, pid_t pid, const std::vector<std::string>& profiles);
bool SetUserProfiles(uid_t uid, const std::vector<std::string>& profiles);

-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
bool SetTaskProfiles(int tid, std::initializer_list<std::string_view> profiles,

bool SetTaskProfiles(pid_t tid, std::initializer_list<std::string_view> profiles,
bool use_fd_cache = false);
@@ -49,7 +52,9 @@ bool SetTaskProfiles(int tid, std::span<const std::string_view> profiles,
bool SetProcessProfiles(uid_t uid, pid_t pid, std::span<const std::string_view> profiles);
Expand Down Expand Up @@ -878,13 +878,13 @@ index 16207e6..9a12458 100644
@@ -20,7 +20,9 @@
#include <keymaster/android_keymaster_messages.h>
#include <trusty_keymaster/ipc/keymaster_ipc.h>

-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
const uint32_t TRUSTY_KEYMASTER_RECV_BUF_SIZE = 2 * PAGE_SIZE;

const uint32_t TRUSTY_KEYMASTER_RECV_BUF_SIZE = 2 * 4096;
const uint32_t TRUSTY_KEYMASTER_SEND_BUF_SIZE =
@@ -35,6 +37,8 @@ keymaster_error_t translate_error(int err);
keymaster_error_t trusty_keymaster_send(uint32_t command, const keymaster::Serializable& req,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ index c0f62d39..5c759793 100644
#include <sys/types.h>

#include <private/android_logger.h>
diff --git a/logd/libaudit.h b/logd/libaudit.h
diff --git a/logd/libaudit/include/libaudit.h b/logd/libaudit/include/libaudit.h
index 27b08669..872d6996 100644
--- a/logd/libaudit.h
+++ b/logd/libaudit.h
--- a/logd/libaudit/include/libaudit.h
+++ b/logd/libaudit/include/libaudit.h
@@ -20,14 +20,15 @@
#pragma once

Expand All @@ -208,10 +208,10 @@ index 27b08669..872d6996 100644

#define MAX_AUDIT_MESSAGE_LENGTH 8970

@@ -100,4 +101,6 @@ extern int audit_setup(int fd, pid_t pid);
@@ -111,4 +112,6 @@ extern int audit_rate_limit(int fd, uint32_t limit);
*/
extern int audit_rate_limit(int fd, uint32_t limit);
extern int audit_log_android_avc_message(int fd, const char* msg);

-__END_DECLS
+#ifdef __cplusplus
+}
Expand Down
Loading

0 comments on commit 108d772

Please sign in to comment.