summaryrefslogtreecommitdiffstats
path: root/adb
Commit message (Collapse)AuthorAgeFilesLines
...
* | Use escape_arg in "adb backup".Elliott Hughes2015-04-172-39/+22
| | | | | | | | | | | | | | | | 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
* | Remove yet more fixed-length buffers (and their overruns).Elliott Hughes2015-04-176-90/+27
| | | | | | | | | | Bug: 20317724 Change-Id: If137fc96f5f23576ccecd388ac87afefa47337c6
* | Switch adb over to clang.Elliott Hughes2015-04-171-1/+1
| | | | | | | | Change-Id: Ib5511dcba56e80ffce6bc293d99251ccfd61c330
* | Merge "Fix more buffer overruns."Elliott Hughes2015-04-176-223/+232
|\ \
| * | Fix more buffer overruns.Elliott Hughes2015-04-176-223/+232
| | | | | | | | | | | | | | | | | | | | | Also add some tests. Bug: 20323050 Change-Id: I9eaf3dc04efd85206663c4cca4f8c1208620a89a
* | | Use PRI* macros to fix the Windows build.Elliott Hughes2015-04-171-4/+6
|/ / | | | | | | Change-Id: Icd400be05c2bc726265832875b5a05dba7966847
* | Remove various fixed-length buffers (and their overflows).Elliott Hughes2015-04-172-110/+59
| | | | | | | | | | | | | | | | | | | | Bug: 20323052 Bug: 20323051 Bug: 20317728 Bug: 20317727 Bug: 20317726 Bug: 20317725 Change-Id: I57a5e30a5b7867715f55cee7429aa36d7ce21484
* | Merge "Remove extern "C" barriers to using C++."Elliott Hughes2015-04-1715-124/+21
|\ \
| * | Remove extern "C" barriers to using C++.Elliott Hughes2015-04-1715-124/+21
| | | | | | | | | | | | Change-Id: Ic046d6aa540738cb46b54531bc59ba3b47b0136d
* | | Show $ADB_VENDOR_KEYS if authentication fails.Elliott Hughes2015-04-165-50/+40
|/ / | | | | | | | | | | | | | | | | 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
* | Merge "Move usb_osx to C++."Dan Albert2015-04-172-10/+11
|\ \
| * | Move usb_osx to C++.Dan Albert2015-04-162-10/+11
| | | | | | | | | | | | Change-Id: I21673211a702cc4f31d4311c36e2a4b22e55fac8
* | | Merge "Link libraries needed for Darwin adb tests."Dan Albert2015-04-171-0/+4
|\ \ \ | |/ /
| * | Link libraries needed for Darwin adb tests.Dan Albert2015-04-161-0/+4
| | | | | | | | | | | | Change-Id: I1c3c3a7bbd3824f5f3a37ee80c24d1c2a9b98748
* | | Move sysdeps_win32 to C++.Elliott Hughes2015-04-163-98/+74
|/ / | | | | | | Change-Id: I27ca41b64d62bb3611b3a39a5c3bb4377d0773bc
* | Switch usb_linux_client to C++.Elliott Hughes2015-04-162-31/+17
| | | | | | | | Change-Id: I8172e81e6c4665aa16e9e8e0c33b048dbb9ad848
* | Move get_my_path_darwin to C++.Elliott Hughes2015-04-162-1/+1
|/ | | | | | As long as we have C in here, we can't use C++ in our headers. Change-Id: Ibccaa77a5af506dc504aa9c39c8dca5dcdbeccab
* Merge "Set verity mode as the verified property value"Sami Tolvanen2015-04-071-4/+4
|\
| * Set verity mode as the verified property valueSami Tolvanen2015-03-311-4/+4
| | | | | | | | | | | | | | Set the verity mode as the value for partition.%s.verified to make it easier for userspace to determine in which mode dm-verity was started. Change-Id: Icc635515f8a8ede941277aed196867351d8387cb
* | Disable CR/LF translation for adb interactive shell.Alistair Buxton2015-04-051-14/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | adb shell uses termios to disable canonical input processing in order to get raw control codes but it does not disable CR/LF translation. The default for Linux terminals is to convert CR to LF unless the running program specifically asks for this to be disabled. Since adb does not, there is no way to send a CR to any program run on adb shell. Many programs do in fact differentiate and so are broken by this behaviour, notably nano. This patch sets the termios flags to disable all line ending translation. Change-Id: I8b950220f7cc52fefaed2ee37d97e0789b40a078 Signed-off-by: Alistair Buxton <a.j.buxton@gmail.com>
* | Fix "adb devices -l".Elliott Hughes2015-04-031-17/+14
| | | | | | | | | | | | | | | | | | Change 055f1aa4ff58ba71133d506b202ad46612758ded switched to using isalnum(3) but didn't take into account that isalnum has the opposite sense to the function it replaced, so the tests should have been inverted. Bug: http://b/20056546 Change-Id: I90630c0bea69ddbb4a95dc09f79f49d23fd497de
* | Remove LOCAL_ADDITIONAL_DEPENDENCIES in cases where it's not needed.Elliott Hughes2015-04-021-3/+0
|/ | | | Change-Id: I720b8ef1050da45a7833adef8219b6acb2cf3a38
* adb: Add option to reboot into sideload mode in recoveryTao Bao2015-03-313-35/+79
| | | | | | | | | | | | | | | | Currently it requires manual key press to enter the sideload mode. This CL adds 'adb reboot sideload' to reboot the device into sideload mode directly with text display on. With 'adb reboot sideload-auto-reboot', it will reboot after the sideload regardless of the installation result, unless interrupted by user. Since it needs to write to /cache/recovery/command file, 'adb root' is required before calling 'adb reboot sideload' and the one with '-auto-reboot'. Also it requires the matching CL in bootable/recovery. Change-Id: Ib7bd4e216a1efc01e64460659c97c6005bbaec1b
* Revert "Remove the emulator special case from the "adb root" code."Dan Albert2015-03-281-0/+7
| | | | | | | | | | | adb root doesn't work on the emulator, so this prevents root access to a userdebug emulator. Since the emulator has always been root even on userdebug builds, it may be that adb root has never worked on the emulator. Bug: 19974213 This reverts commit abd6773b41effd1e1005ad7ce8cb5e370a367302.
* adb shell: Win32: fix Ctrl-C, tab completion, line editing, server echoSpencer Low2015-03-263-11/+909
| | | | | | | | | | | | | | | | | | | | | | | | | | | The 'adb shell' command on Windows has had problems: * Ctrl-C killed the local Windows adb.exe process instead of sending the Ctrl-C to the Android device. * Local echo was enabled, causing everything typed to be displayed twice. * Line input was enabled, so the Android device only received input after hitting enter. This meant that tab completion did not work because the tab wasn't seen by the shell until pressing enter. * The usual input line editing keys did not work (Ctrl-A to go to the beginning of the line, etc.). This commit fixes these issues by reconfiguring the Win32 console and then translating input into what Gnome Terminal would send, in effect somewhat emulating a Unix terminal. This does not fix all Win32 console issues, but is designed to be better than what we had before, and to make the common day-to-day usage much more comfortable and usable. Change-Id: Idb10e0b634e27002804fa99c09a64e7176cf7c09 Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
* Additional cleanup of start_device_log.Dan Albert2015-03-202-8/+19
| | | | | | | | | | | | | | | | | Addresses nnk's post commit review comments on https://android-review.googlesource.com/#/c/139381/ Remove unneeded code for creating /data/adb. Add an O_CLOEXEC. Move the closing of stdin out to main(). Append the pid of the current process to the log file to avoid clobbering the log if the process crashes and restarts within the same second. Change-Id: Ide0be86b4b33256486634c29ba02efaf10cf913d
* Use text based trace masks for adbd.Dan Albert2015-03-192-63/+88
| | | | | | | | | Previously the adbd trace mask had to be set as raw hex rather than with the colon separated list. We all have better things to do than memorize bitmasks, so make adbd use the same trace mask setting code as adb. Change-Id: I0bf0ab61c070d06d1cc2acf1ed90b2b77ccd261b
* Merge "The generic failure case disappeared..."Dan Albert2015-03-202-0/+14
|\
| * The generic failure case disappeared...Dan Albert2015-03-192-0/+14
| | | | | | | | | | | | | | Was manifesting as a write to a full disk hanging indefinitely. Bug: 19846181 Change-Id: Ia581e0bbbb331c221bdb68882c238d0cb9f8a0b3
* | Merge "File header cleanup."Dan Albert2015-03-2024-89/+148
|\ \ | |/ |/|
| * File header cleanup.Dan Albert2015-03-1924-89/+148
| | | | | | | | | | | | | | | | | | * sysdeps.h should always be included first. * TRACE_TAG needs to be defined before anything is included. * Some files were missing copyright headers. * Save precious bytes on my SSD by removing useless whitespace. Change-Id: I88980e6e00b5be1093806cf286740d9e4a033b94
* | Fix clang-format file for correct indent settings.Dan Albert2015-03-191-2/+2
|/ | | | Change-Id: I8786baf33c0b84e3614e9d40c404eeef94b91236
* Merge "Fix memory leak on jdwp_process_free()"Dan Albert2015-03-191-0/+1
|\
| * Fix memory leak on jdwp_process_free()SungHyun Kwon2015-03-031-0/+1
| | | | | | | | | | | | | | | | | | if many jdwp connection are created(), the memory will be leaked. When it deletes heap memory on jdwp_process_free(), the proc->fde just set to null. so it need to free() in fdevent_destory().
* | Fix file descriptor leakage in adbdPavel Labath2015-03-173-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | adb_auth_init in adb_auth_client.cpp sets FD_CLOEXEC on the control socket, which prevents the leakage. However if ro.adb.secure property is unset (as it is on the emulator), adb_auth_init is not invoked, which results in the control socket fd leaking into any process started by the deamon (specifically, any command executed through adb shell). Split the fd cleanup into a separate function that is called unconditionally. Change-Id: I73ea84977542ddfc4ac20599593ecf3745ae9108
* | Revert "Revert "adb: support /oem partition""Elliott Hughes2015-03-168-104/+122
| | | | | | | | | | | | | | | | | | | | This reverts commit 6084a0124f868c7ec43f6c415a27a168f27ff694. The original build breakage is fixed by (a) building the verity code for eng builds as well as userdebug builds and (b) moving the exported remount service functions into a new header file. Change-Id: Ice0c4f97d4db38ab7eb333c7a6e56bbd11123f5b
* | Revert "adb: support /oem partition"Dan Albert2015-03-163-94/+100
| | | | | | | | | | | | | | | | This is broken on userdebug builds, and it isn't completely clear why. The declaration for make_block-device_writable in adb.h wasn't updated to match the definition (which uses a std::string instead of a char*). adb.h is currently extern "C", and it isn't clear why this is only broken for userdebug, so I'd like to revert while we investigate. This reverts commit 81416fdb186070fe4db3ca5fed2e713a4eecaac1. Change-Id: I47f321574f9f21052e2c7332e8b0f6ef9ab98277
* | adb: support /oem partitionMÃ¥rten Kongstad2015-03-163-100/+94
| | | | | | | | | | | | Add support for /oem partition in commands 'adb remount' and 'adb sync'. Change-Id: I5defc74ccaa37feaef74b9268e22b4075f98a59f
* | Create libbase.Dan Albert2015-03-142-10/+9
| | | | | | | | | | | | | | Move StringPrintf and the string based file I/O from libutils to libbase. Change-Id: I0297a6063874b9d92100e0dd5123fddfbda932fe
* | adb doesn't actually use libzipfile.Elliott Hughes2015-03-133-3/+0
| | | | | | | | Change-Id: Ia7d22214bc8422c88edaaf9bb716d7e12e0bb381
* | Fix build from -Werror=maybe-uninitialized.Dan Albert2015-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | This won't actually ever be uninitialized because the code will take a failure path if the code that initializes it fails. The goto seems to thwart this check though. Not sure why this is only firing on userdebug builds yet. I'll look in to it tomorrow. Change-Id: Ie9d837d6baea255d2a4d169355b53dfd775eacce
* | Move adb to C++.Dan Albert2015-03-0934-278/+317
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I keep trying to clean things up and needing std::strings. Might as well just do this now. usb_linux_client.c is going to stay as C because GCC isn't smart enough to deal with the designated initializers it uses (though for some reason it is in C mode). The Darwin files are staying as C because I don't have a way to test that they build. The Windows files are staying as C because while I can actually build for them, it's slow and painful. Change-Id: I75367d29205a9049d34460032b3bb36384f43941
* | Merge "Fix a writex transcription error."Dan Albert2015-03-091-1/+1
|\ \
| * | Fix a writex transcription error.Dan Albert2015-03-091-1/+1
| |/ | | | | | | Change-Id: I71b11127d41ebac6caf68926089c5a3b99d8c21e
* | Make the root/unroot test more robust.Dan Albert2015-03-091-2/+22
|/ | | | | | | * Check the current adb user to choose the order of root/unroot. * Re-root the device when finished. Change-Id: I47a14b89e2c405bd63722e4d2043fcc629fb5e58
* check if uid=0 before attempting remountNick Kralevich2015-02-251-0/+6
| | | | | | | | | If "adb remount" is done without having done "adb root" first, scary looking SELinux denials are emitted before the operation eventually fails. Avoid the scary looking messages by refusing remount attempts if we're not running with privileges. Change-Id: I298621251a10e38345ef77875003a97c8b5a0270
* Test readx/writex (now renamed).Dan Albert2015-02-2519-211/+435
| | | | | | | | | | | | | | Renamed readx/writex to ReadFdExactly/WriteFdExactly respectively. These read/write a full fixed-size buffer. If the whole buffer cannot be read/written, these functions return an error. Rename write_string to WriteStringFully. Move the TEMP_FAILURE_RETRY definition in sysdeps.h out of the !Windows section. It seems Windows won't actually interrupt a call, but it's easier to just define it than to #ifdef each call. Change-Id: Ia8ddffa2a52764a2f9a281c96c937660e002b9b9
* Remove _(GNU|XOPEN)_SOURCE makefile cruft.Dan Albert2015-02-251-4/+6
| | | | | | None of the functions that require these are used. Change-Id: I10cffab127795b94340131f8737f7924b9138f9e
* Add some basic tests to adb.Dan Albert2015-02-253-18/+107
| | | | Change-Id: I946b5b1e5650540db3b4f75892214c4218b3baf3
* Fix the mac build.Dan Albert2015-02-251-2/+3
| | | | Change-Id: Ieb6f2650ce5f39f1d8c938d0ca8cbec459d8e2fd