Update to v33.0.3

This commit is contained in:
Artur Frenszek-Iwicki 2022-11-01 10:50:00 +01:00
commit 9b5ad2ce9d
3 changed files with 120 additions and 4 deletions

View file

@ -0,0 +1,98 @@
diff -rU4 android-tools-33.0.3--orig/vendor/adb/client/usb_linux.cpp android-tools-33.0.3--patched/vendor/adb/client/usb_linux.cpp
--- android-tools-33.0.3--orig/vendor/adb/client/usb_linux.cpp 2022-09-23 10:53:08.000000000 +0200
+++ android-tools-33.0.3--patched/vendor/adb/client/usb_linux.cpp 2022-11-01 10:37:48.631251871 +0100
@@ -71,10 +71,10 @@
size_t max_packet_size;
unsigned zero_mask;
unsigned writeable = 1;
- usbdevfs_urb urb_in;
- usbdevfs_urb urb_out;
+ usbdevfs_urb *urb_in;
+ usbdevfs_urb *urb_out;
bool urb_in_busy = false;
bool urb_out_busy = false;
bool dead = false;
@@ -303,9 +303,9 @@
static int usb_bulk_write(usb_handle* h, const void* data, int len) {
std::unique_lock<std::mutex> lock(h->mutex);
D("++ usb_bulk_write ++");
- usbdevfs_urb* urb = &h->urb_out;
+ usbdevfs_urb* urb = h->urb_out;
memset(urb, 0, sizeof(*urb));
urb->type = USBDEVFS_URB_TYPE_BULK;
urb->endpoint = h->ep_out;
urb->status = -1;
@@ -342,9 +342,9 @@
static int usb_bulk_read(usb_handle* h, void* data, int len) {
std::unique_lock<std::mutex> lock(h->mutex);
D("++ usb_bulk_read ++");
- usbdevfs_urb* urb = &h->urb_in;
+ usbdevfs_urb* urb = h->urb_in;
memset(urb, 0, sizeof(*urb));
urb->type = USBDEVFS_URB_TYPE_BULK;
urb->endpoint = h->ep_in;
urb->status = -1;
@@ -387,18 +387,18 @@
return -1;
}
D("[ urb @%p status = %d, actual = %d ]", out, out->status, out->actual_length);
- if (out == &h->urb_in) {
+ if (out == h->urb_in) {
D("[ reap urb - IN complete ]");
h->urb_in_busy = false;
if (urb->status != 0) {
errno = -urb->status;
return -1;
}
return urb->actual_length;
}
- if (out == &h->urb_out) {
+ if (out == h->urb_out) {
D("[ reap urb - OUT compelete ]");
h->urb_out_busy = false;
h->cv.notify_all();
}
@@ -500,12 +500,12 @@
** these will quietly fail if the txns are not active,
** but this ensures that a reader blocked on REAPURB
** will get unblocked
*/
- ioctl(h->fd, USBDEVFS_DISCARDURB, &h->urb_in);
- ioctl(h->fd, USBDEVFS_DISCARDURB, &h->urb_out);
- h->urb_in.status = -ENODEV;
- h->urb_out.status = -ENODEV;
+ ioctl(h->fd, USBDEVFS_DISCARDURB, h->urb_in);
+ ioctl(h->fd, USBDEVFS_DISCARDURB, h->urb_out);
+ h->urb_in->status = -ENODEV;
+ h->urb_out->status = -ENODEV;
h->urb_in_busy = false;
h->urb_out_busy = false;
h->cv.notify_all();
} else {
@@ -519,8 +519,10 @@
g_usb_handles.remove(h);
D("-- usb close %p (fd = %d) --", h, h->fd);
+ delete h->urb_in;
+ delete h->urb_out;
delete h;
return 0;
}
@@ -572,8 +574,10 @@
usb->ep_in = ep_in;
usb->ep_out = ep_out;
usb->zero_mask = zero_mask;
usb->max_packet_size = max_packet_size;
+ usb->urb_in = new usbdevfs_urb;
+ usb->urb_out = new usbdevfs_urb;
// Initialize mark so we don't get garbage collected after the device scan.
usb->mark = true;

View file

@ -1,8 +1,8 @@
%global _hardened_build 1
Name: android-tools
Version: 31.0.2
Release: 7%{?dist}
Version: 33.0.3
Release: 1%{?dist}
Epoch: 1
Summary: Android platform tools(adb, fastboot)
@ -16,6 +16,11 @@ Source0: https://github.com/nmeum/%{name}/releases/download/%{version}/%{n
Source1: 51-android.rules
Source2: adb.service
# Adapt ADB client code for kernel 6.0 API changes.
# The patch is backwards-compatible with the kernel 5.19 API.
# Based on upstream commit: https://github.com/nmeum/android-tools/commit/f9197d0d10ad22666541c950090a1da92dc85eb7
Patch0: 0000--kernel-6.0-api.patch
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
@ -69,7 +74,7 @@ to read and write the flash partitions. It needs the same USB device
setup between the host and the target phone as adb.
%prep
%autosetup
%autosetup -p1
cp -p %{SOURCE1} 51-android.rules
%build
@ -104,7 +109,17 @@ install -d -m 0775 ${RPM_BUILD_ROOT}%{_sharedstatedir}/adb
%{_bindir}/img2simg
%{_bindir}/fastboot
%{_bindir}/append2simg
%{_bindir}/ext2simg
%{_bindir}/e2fsdroid
%{_bindir}/mke2fs.android
%{_bindir}/lpadd
%{_bindir}/lpdump
%{_bindir}/lpflash
%{_bindir}/lpmake
%{_bindir}/lpunpack
%{_bindir}/mkbootimg
%{_bindir}/repack_bootimg
%{_bindir}/unpack_bootimg
%{_datadir}/android-tools/completions/adb
%{_datadir}/android-tools/completions/fastboot
%{_datadir}/bash-completion/completions/adb
@ -113,6 +128,9 @@ install -d -m 0775 ${RPM_BUILD_ROOT}%{_sharedstatedir}/adb
%changelog
* Tue Nov 01 2022 Artur Frenszek-Iwicki <fedora@svgames.pl> - 1:33.0.3-1
- Update to v33.0.3
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:31.0.2-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

View file

@ -1 +1 @@
SHA512 (android-tools-31.0.2.tar.xz) = 55f592c2622ef5936f7aea254271fb0b4f57ffcae3ac089c79522efa0d27c31373ba936418a56758d553ebf290cabcd65582b2a6ae60f81bdea15711941664cb
SHA512 (android-tools-33.0.3.tar.xz) = 78c8141f5f13f1c0e5da474e1d79760a612e911519af4e9f21c0e5005f2ce99f3aeacf16f3fcdfe1250fc795a88190fa243592e1066a2156e1fd8d2b9c3d7f71