1
0
mirror of https://github.com/termux/termux-packages synced 2024-06-20 17:07:08 +00:00

bump(main/android-tools): 35.0.1

This commit is contained in:
Twaik Yont 2024-05-09 20:16:20 +03:00
parent b0ab9072b3
commit 794aeceaaf
5 changed files with 55 additions and 43 deletions

View File

@ -3,10 +3,9 @@ TERMUX_PKG_DESCRIPTION="Android platform tools"
TERMUX_PKG_LICENSE="Apache-2.0, BSD 2-Clause"
TERMUX_PKG_LICENSE_FILE="LICENSE, vendor/core/fastboot/LICENSE"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=34.0.4
TERMUX_PKG_REVISION=4
TERMUX_PKG_VERSION="35.0.1"
TERMUX_PKG_SRCURL=https://github.com/nmeum/android-tools/releases/download/$TERMUX_PKG_VERSION/android-tools-$TERMUX_PKG_VERSION.tar.xz
TERMUX_PKG_SHA256=7a22ff9cea81ff4f38f560687858e8f8fb733624412597e3cc1ab0262f8da3a1
TERMUX_PKG_SHA256=654030c7f96d25d7224cd6861fac14a043cf1d3980f40288cdfbe219f94ffaf9
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_DEPENDS="abseil-cpp, brotli, libc++, liblz4, libprotobuf, libusb, pcre2, zlib, zstd"
TERMUX_PKG_BUILD_DEPENDS="googletest"

View File

@ -1,8 +1,5 @@
diff --git a/vendor/CMakeLists.fastboot.txt b/vendor/CMakeLists.fastboot.txt
index a217ecc..1d8d3b1 100644
--- a/vendor/CMakeLists.fastboot.txt
+++ b/vendor/CMakeLists.fastboot.txt
@@ -5,7 +5,7 @@ add_library(libzip STATIC
+++ ./vendor/CMakeLists.fastboot.txt
@@ -5,7 +5,7 @@
libziparchive/zip_error.cpp
libziparchive/zip_writer.cc)
@ -11,7 +8,16 @@ index a217ecc..1d8d3b1 100644
target_include_directories(libzip PUBLIC
libziparchive/include
libziparchive/incfs_support/include
@@ -61,7 +61,41 @@ add_library(libselinux STATIC
@@ -30,6 +30,8 @@
core/include
logging/liblog/include
core/libutils/include
+ core/libprocessgroup/include
+ core/libvndksupport/include
libbase/include)
add_library(libext4 STATIC
@@ -54,7 +56,41 @@
selinux/libselinux/src/setrans_client.c
selinux/libselinux/src/sha1.c
selinux/libselinux/src/label_file.c
@ -52,12 +58,12 @@ index a217ecc..1d8d3b1 100644
+ selinux/libselinux/src/stringrep.c
+ core/libpackagelistparser/packagelistparser.cpp)
target_compile_definitions(libselinux PRIVATE
-DAUDITD_LOG_TAG=1003 -D_GNU_SOURCE -DBUILD_HOST -DUSE_PCRE2
@@ -82,6 +86,13 @@ target_compile_definitions(libselinux PRIVATE
if(HAVE_STRLCPY)
target_compile_definitions(libselinux PRIVATE HAVE_STRLCPY)
@@ -68,6 +104,13 @@
target_include_directories(libselinux PUBLIC
selinux/libselinux/include selinux/libsepol/include)
+target_include_directories(libselinux PRIVATE
+ selinux/libselinux/src
+ libselinux/src/android
@ -68,7 +74,7 @@ index a217ecc..1d8d3b1 100644
add_library(libsepol
selinux/libsepol/src/assertion.c
selinux/libsepol/src/avrule_block.c
@@ -100,6 +111,7 @@ add_library(libsepol
@@ -86,6 +129,7 @@
selinux/libsepol/src/policydb.c
selinux/libsepol/src/policydb_convert.c
selinux/libsepol/src/policydb_public.c
@ -76,9 +82,9 @@ index a217ecc..1d8d3b1 100644
selinux/libsepol/src/services.c
selinux/libsepol/src/sidtab.c
selinux/libsepol/src/symtab.c
@@ -135,7 +147,7 @@ target_compile_definitions(fastboot PRIV
@@ -136,7 +180,7 @@
target_link_libraries(fastboot
libsparse libzip libcutils liblog libfsmgr libutil
libsparse libzip libcutils liblog liblp libutil
libbase libext4 libselinux libsepol libdiagnoseusb crypto
- z PkgConfig::libpcre2-8 Threads::Threads dl)
+ z PkgConfig::libpcre2-8 Threads::Threads dl usb-1.0)

View File

@ -1,10 +1,7 @@
diff --git a/vendor/core/fastboot/fastboot.cpp b/vendor/core/fastboot/fastboot.cpp
index 0062e7e..5f2894d 100644
--- a/vendor/core/fastboot/fastboot.cpp
+++ b/vendor/core/fastboot/fastboot.cpp
@@ -1343,6 +1343,12 @@ static bool is_userspace_fastboot() {
+++ ./vendor/core/fastboot/fastboot.cpp
@@ -1547,6 +1547,13 @@
static void reboot_to_userspace_fastboot() {
void reboot_to_userspace_fastboot() {
fb->RebootTo("fastboot");
+#ifdef __ANDROID__
+ if (fb->transport()->NotReusable()) {
@ -12,6 +9,7 @@ index 0062e7e..5f2894d 100644
+ return;
+ }
+#endif
+
fb->set_transport(nullptr);
auto* old_transport = fb->set_transport(nullptr);
delete old_transport;
// Give the current connection time to close.

View File

@ -0,0 +1,10 @@
+++ ./vendor/core/fastboot/fastboot_driver.h
@@ -131,6 +131,8 @@
RetCode RawCommand(const std::string& cmd, std::string* response = nullptr,
std::vector<std::string>* info = nullptr, int* dsize = nullptr);
+ Transport* transport() { return transport_.get(); }
+
protected:
RetCode DownloadCommand(uint32_t size, std::string* response = nullptr,
std::vector<std::string>* info = nullptr);

View File

@ -1,7 +1,4 @@
diff --git a/vendor/core/fastboot/usb_linux.cpp b/vendor/core/fastboot/usb_linux.cpp
index 964488c..995a219 100644
--- a/vendor/core/fastboot/usb_linux.cpp
+++ b/vendor/core/fastboot/usb_linux.cpp
+++ ./vendor/core/fastboot/usb_linux.cpp
@@ -48,6 +48,9 @@
#include <chrono>
#include <memory>
@ -12,7 +9,7 @@ index 964488c..995a219 100644
#include "usb.h"
#include "util.h"
@@ -88,11 +91,29 @@ using namespace std::chrono_literals;
@@ -99,11 +102,29 @@
struct usb_handle
{
char fname[64];
@ -42,7 +39,7 @@ index 964488c..995a219 100644
class LinuxUsbTransport : public UsbTransport {
public:
explicit LinuxUsbTransport(std::unique_ptr<usb_handle> handle, uint32_t ms_timeout = 0)
@@ -104,6 +125,9 @@ class LinuxUsbTransport : public UsbTransport {
@@ -115,6 +136,9 @@
int Close() override;
int Reset() override;
int WaitForDisconnect() override;
@ -52,10 +49,11 @@ index 964488c..995a219 100644
private:
std::unique_ptr<usb_handle> handle_;
@@ -140,7 +164,18 @@ static int check(void *_desc, int len, unsigned type, int size)
@@ -151,8 +175,19 @@
return 0;
}
+
+#ifdef __ANDROID__
+bool ref_deleted(int fd) {
+ struct stat fd_stat;
@ -63,7 +61,7 @@ index 964488c..995a219 100644
+ return fd_stat.st_nlink < 1;
+}
+#endif
+
static int filter_usb_device(char* sysfs_name,
+#ifdef __ANDROID__
+ bool is_termux_usb, int termux_usb_fd,
@ -71,7 +69,7 @@ index 964488c..995a219 100644
char *ptr, int len, int writable,
ifc_match_func callback,
int *ept_in_id, int *ept_out_id, int *ifc_id)
@@ -149,6 +184,9 @@ static int filter_usb_device(char* sysfs_name,
@@ -161,6 +196,9 @@
struct usb_config_descriptor *cfg;
struct usb_interface_descriptor *ifc;
struct usb_endpoint_descriptor *ept;
@ -81,7 +79,7 @@ index 964488c..995a219 100644
struct usb_ifc_info info;
int in, out;
@@ -167,6 +205,11 @@ static int filter_usb_device(char* sysfs_name,
@@ -179,6 +217,11 @@
len -= cfg->bLength;
ptr += cfg->bLength;
@ -93,7 +91,7 @@ index 964488c..995a219 100644
info.dev_vendor = dev->idVendor;
info.dev_product = dev->idProduct;
info.dev_class = dev->bDeviceClass;
@@ -174,6 +217,12 @@ static int filter_usb_device(char* sysfs_name,
@@ -186,6 +229,12 @@
info.dev_protocol = dev->bDeviceProtocol;
info.writable = writable;
@ -106,7 +104,7 @@ index 964488c..995a219 100644
snprintf(info.device_path, sizeof(info.device_path), "usb:%s", sysfs_name);
/* Read device serial number (if there is one).
@@ -184,6 +233,15 @@ static int filter_usb_device(char* sysfs_name,
@@ -196,6 +245,15 @@
*/
info.serial_number[0] = '\0';
if (dev->iSerialNumber) {
@ -122,7 +120,7 @@ index 964488c..995a219 100644
char path[80];
int fd;
@@ -204,6 +262,9 @@ static int filter_usb_device(char* sysfs_name,
@@ -216,6 +274,9 @@
info.serial_number[chars_read - 1] = '\0';
}
}
@ -132,7 +130,7 @@ index 964488c..995a219 100644
}
for(i = 0; i < cfg->bNumInterfaces; i++) {
@@ -265,12 +326,25 @@ static int filter_usb_device(char* sysfs_name,
@@ -277,6 +338,16 @@
info.has_bulk_in = (in != -1);
info.has_bulk_out = (out != -1);
@ -149,7 +147,8 @@ index 964488c..995a219 100644
std::string interface;
auto path = android::base::StringPrintf("/sys/bus/usb/devices/%s/%s:1.%d/interface",
sysfs_name, sysfs_name, ifc->bInterfaceNumber);
if (android::base::ReadFileToString(path, &interface)) {
@@ -286,6 +357,9 @@
}
snprintf(info.interface, sizeof(info.interface), "%s", interface.c_str());
}
+#ifdef __ANDROID__
@ -158,7 +157,7 @@ index 964488c..995a219 100644
if(callback(&info) == 0) {
*ept_in_id = in;
@@ -353,16 +427,52 @@ static std::unique_ptr<usb_handle> find_usb_device(const char* base, ifc_match_f
@@ -368,16 +442,52 @@
int fd;
int writable;
@ -211,7 +210,7 @@ index 964488c..995a219 100644
if ((fd = open(devname, O_RDWR)) < 0) {
// Check if we have read-only access, so we can give a helpful
// diagnostic like "adb devices" does.
@@ -371,12 +481,25 @@ static std::unique_ptr<usb_handle> find_usb_device(const char* base, ifc_match_f
@@ -386,12 +496,25 @@
continue;
}
}
@ -237,7 +236,7 @@ index 964488c..995a219 100644
usb->ep_in = in;
usb->ep_out = out;
usb->desc = fd;
@@ -516,8 +639,19 @@ int LinuxUsbTransport::WaitForDisconnect()
@@ -593,8 +716,19 @@
{
double deadline = now() + WAIT_FOR_DISCONNECT_TIMEOUT;
while (now() < deadline) {