The descriptors to enable USB 3.0 SuperSpeed support had previously
been added in commit d6ee9f26a5
but were removed when the v1/v2 descriptor handling was refactored
in commits ab3446dd34 and again in
c49f51c451. Now that the dust has
settled, add back the SS descriptors to re-enable USB 3.0.
Bug: 23385314
Change-Id: I8de7c7e50d9216a7492ce7863e3aaf92ff805eff
(cherry picked from commit a190c800bf)
Using a getenv('OUT') in such a deep down function is a wrong design
choice. Replacing with explicit parameter that may be NULL in case
device specific files can be accessed from /.
Since TARGET_COPY_OUT_SYSTEM may be defined to something different than
system we also ensure that we use a path relative to TARGET_OUT to
compute path to fs_config_* files.
Bug: 21989305
Bug: 22048934
Change-Id: Id91bc183b29beac7379d1117ad83bd3346e6897b
Signed-off-by: Thierry Strudel <tstrudel@google.com>
Require authorization by default, and remove the ability to override
that in user builds. (userdebug and eng are still free to do whatever
they want.)
Bug: http://b/21862859
Change-Id: Ibf8af375be5bf1141c1ad481eee7a59fb10a7adb
(cherry picked from commit 5cba504215)
The issue is that adb uses fopen() with "e" (presumably to open the file
with O_CLOEXEC), but that flag causes MSVCRT.DLL to return an error. So
when adb_auth_host.cpp goes to read or write the adbkey files, it fails.
The quick fix is to not use the "e" option on adb host code since it
isn't necessary there, compared to adbd.
An alternative fix would be to have a fopen() wrapper on Windows that
filters out the "e" option.
Bug: http://b/21806456
Bug: https://code.google.com/p/android/issues/detail?id=175077
Change-Id: I7d8ba2847dab0ed558ffe156e79093251eb253c9
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
(cherry picked from commit 9b9603148b)
You can't just use \' inside a single-quoted string.
Bug: http://b/20323053
Bug: http://b/3090932
Change-Id: I73754b097671d02dc11c35052f0534b6dd789e4f
(cherry picked from commit 84b0bf2264)
Many devices don't have an /oem partition, so find_mount should be
expected to fail, but shouldn't cause the overall remount to fail.
Also clean up all the error handling and reporting, and remove the
dead int* globals.
Bug: http://b/21024141
Change-Id: Ie31021b03c9cab8e972269d7d1ffe383cd30ee9e
(cherry picked from commit 9aa4fda4e6)
On a device without an oem partition, we now have an /oem directory
anyway. This causes find_mount to fail, and that was returning nullptr
from a std::string-returning function. Boom!
Also clean up the bits of code I had to trace through between "adb remount"
on the host to the crash on the device as I debugged this.
The only other meaningful change is the error checking in
adb_connect_command --- adb_connect can also return -2.
Bug: http://b/20916855
Change-Id: I4c3b7858e13f3a3a8bbc7d30b3c0ee470bead587
(cherry picked from commit 5677c23e8d)
The USB spec explicitly says this is optional, so we shouldn't be
relying on it.
Bug: http://b/20883914
Change-Id: Icf38405b00275199bcf51a70c47d428ae7264f2b
The first rule of ssh(1) escaping is that there is no escaping.
This doesn't undo any of my recent security fixes because they're all
calling escape_arg themselves.
This fixes "adb shell rm /data/dalvik-cache/arm/*".
Also remove do_cmd which caused concern during code review.
Bug: http://b/20564385
Change-Id: I4588fd949d51e2a50cff47ea171ed2d75f402d0d
(cherry picked from commit 2b10111d25)
Also say *which* device wasn't found.
Bug: http://b/20666660
Change-Id: I50e234ad89e39ae0a8995083c0b642c61275c5a3
(cherry picked from commit ab52c181fa)
This patch factors out a lot of the basic protocol code: sending OKAY,
sending FAIL, and sending a length-prefixed string.
ADB_TRACE has been non-optional for a long time, so let's just remove
the #ifs.
Also actually build the device tracker test tool (and remove its duplicate).
Bug: http://b/20666660
Change-Id: I6c7d59f18707bdc62ca69dea45547617f9f31fc6
(cherry picked from commit e67f1f87d9)
Also remove an sprintf. Also fix various bits of code that were
reporting stale adb_error values when they meant strerror.
(cherry-pick of 078f0fcf4c63b8d8e8c10a18855eae04ca321e06.)
Bug: http://b/20666660
Change-Id: Ibeb48b7bc21bb0ec30ba47889d1d671ee480e1b7
Also fix android::base::Split to behave like Java, Python, and google3.
(cherry picked from commit 8d5fa6da44)
Change-Id: I9388ae37ee8dd4a4a6c2a9a19f068b70d9a78353
Two bugs: we couldn't report the serial number correctly if it was long
enough, and it wasn't possible to connect to a device whose serial number
was long enough to overflow a different fixed-length buffer.
Bug: http://b/20317730
(cherry picked from commit 9309ecbcec)
Change-Id: I04c160a215418a57bd4fb27b7f63060c8be6f12e
This doesn't fix the bug, but it does flatten the bug to the well-known
and long-standing "adb shell" doesn't return exit statuses, so when we
fix that, this one will fix itself.
Bug: http://b/20423886
Change-Id: I48351e46f05dd3f2f6e57f0df1d851333458d0ef
Until I fixed this, we would fail this example:
$ adb shell sh -c 'echo hello; echo world'
hello
/system/bin/sh: echo world: not found
Bug: http://b/19734868
Change-Id: I11a437cd0c0362303028f23fbaa103611b75707e
It looks like we can't use clang on Windows yet because libc++ isn't ready.
So move back to GCC for the Windows host clang. Work around the mingw
printf format string problems that made us want to switch to clang in the
first place, and #include "sysdeps.h" in adb_utils.cpp to work around the
absence of lstat(2) on Windows.
Change-Id: Icd0797a8c0c2d1d326bdd704ba6bcafcbaeb742f
The specific motivating case is "text;ls;1.apk", but rather than continue
adding individual characters to the list of characters to be escaped, let's
just switch to quote all arguments with ', which only leaves ' itself to be
escaped.
Bug: 20323053
Bug: 19734868
Change-Id: I8bd71db9373bc2d1169fc11e46c889da6638550a
This doesn't fix the injection vulnerability, but it makes "adb backup"
no worse than the other commands, and lets me fix them all at once.
Bug: 20323053
Change-Id: I39843c065d9d738b6b7943b2ffd660e4a031cc36
Incorrectly set $ADB_VENDOR_KEYS is the most likely cause of failed
adb connections. Make it easier to debug such problems by including
the value in use in the error message.
Bug: 20165551
Change-Id: I64c1d98ae6d3fb40eea9e1f0ddcfcf4f2d9d7318