summaryrefslogtreecommitdiffstats
path: root/adb
Commit message (Collapse)AuthorAgeFilesLines
...
* | Ignore useless cpplint messages in adb.Dan Albert2015-02-181-0/+2
|/ | | | Change-Id: I6411eb3963d215b228e50cd967a2174e5036ed73
* fix bug that passing invalid fd to fstats on win32 buildseric.yan2015-02-091-1/+1
| | | | | | | | | | lfd returned by adb_open is not the actual file desc. on win32 builds. calling through fstat with invalid fd will lead to crash, using stat instead. Change-Id: I7fdc8b825162eaa42efe8755265842c300b00e39 Signed-off-by: eric.yan <eric.yan@yulong.com> Signed-off-by: severecold <severecold@gmail.com>
* Remove netcfg's unused options.Elliott Hughes2015-02-031-1/+1
| | | | | | | Only "netcfg" for a list of interfaces and "netcfg <interface> dhcp" still seem to be used. Change-Id: I9f0b580474258fa648deb5287f98d8ec5533ca6f
* Revert "Remove netcfg's unused options."Elliott Hughes2015-02-031-1/+1
| | | | | | This reverts commit f8e83054cb8a8b13ee84a4aeeaa0a2fd8debca81. Change-Id: Iede772f96ff9008277df433dcbb5f6603de65283
* Remove netcfg's unused options.Elliott Hughes2015-02-031-1/+1
| | | | | | | Only "netcfg" for a list of interfaces and "netcfg <interface> dhcp" still seem to be used. Change-Id: Iaf499c06b09ffe5e0925339b9cd6e502f3234a86
* The bsddroid project has been dead since 2010.Elliott Hughes2015-01-313-699/+0
| | | | | | | And even if it wasn't, they should probably keep this stuff in their own repository. Change-Id: If9fa2e47ee2700098d8a99f6986f7e89fc6dfdf3
* Merge "Verify token length before adb signs it"Sami Tolvanen2015-01-281-0/+5
|\
| * Verify token length before adb signs itSami Tolvanen2015-01-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, a host running adb will sign a token of any length passed to it by a device, effectively acting as a signing oracle. If the ADB_VENDOR_KEYS environment variable is used to specify an additional key to use, this behavior is not only unexpected, but probably also unwanted. Further discussion can be found from this thread: http://www.metzdowd.com/pipermail/cryptography/2015-January/024423.html This change adds a check to ensure token length matches TOKEN_SIZE before it's signed, which prevents an attacker from signing longer messages. Change-Id: I7b2cc1f051941bf9b66e1c02980850bede501793
* | Merge "Make server port option work on windows"Elliott Hughes2015-01-281-2/+3
|\ \
| * | Make server port option work on windowsWenhao Li2013-11-131-2/+3
| | | | | | | | | | | | | | | | | | | | | The server port command line option do not work on windows, need pass -P option to child process. Change-Id: Ibb3f0a926fae8e17c75fccbd4bb3a33318fffe9e
* | | adb: tracing: don't make strings if runtime tracing is disabledSpencer Low2015-01-271-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If tracing was not enabled (the ADB_TRACE environment variable was not set specially), writex() and readx() would still call dump_hex() which would construct hex tracing strings, which would be immediately discarded and not printed (because tracing is not enabled). The fix is to only call dump_hex() if ADB_TRACING evalutes to true, the same way that dump_packet() is only called if ADB_TRACING evaluates to true. Change-Id: I1651680da344389475ebdeea77ba1982960d5764 Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
* | | adb: Win32: set socket buffer sizes properlySpencer Low2015-01-263-11/+31
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows, adb_socket_setbufsize() was taking a file descriptor value from the compatibility layer in sysdeps_win32.c (namely, an index into the _win32_fhs array) and passing it to the Winsock setsockopt() call, which wants a Winsock SOCKET handle. Basically, adb_socket_setbufsize() was passing `fd` instead of `_fh_from_int(fd)->fh_socket`, resulting in adb effectively setting a socket buffer size on a random socket in the process. The fix is to introduce adb_setsockopt() which just calls setsockopt() on non-Win32, and which uses the Winsock SOCKET handle on Win32. The change also moves Win32 disable_tcp_nagle() to a header and adds an extra sanity check to adb_shutdown(). Change-Id: I4354e818d27538f7ff5b0e70b28bdb6300e1b98b Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
* | Protect from eng vs userdebug build breaks.Dan Albert2015-01-261-60/+66
| | | | | | | | | | | | | | | | Using a const bool rather than an ifdef means the compiler can still protect us from breaking code paths that aren't included in every build variant. Change-Id: Ic45c8fb52cd66c3ce090d760cdb92104e31265f5
* | Merge "Fix userdebug build."Dan Albert2015-01-272-0/+5
|\ \
| * | Fix userdebug build.Dan Albert2015-01-262-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Apparently this code I thought was unused is just unused for eng builds... Bug: 17626262 Change-Id: I2e5f411a2ead7f23d9f5822935de66c992750a03
* | | Fix win_sdk build.Dan Albert2015-01-261-42/+1
|/ / | | | | | | | | | | | | | | Hadn't caught this in the previous submission because I tested the build with another change on top of it that also fixes this. Bug: 17626262 Change-Id: Ia40127618a5466e382081760d614ff7fc09d50a3
* | Begin moving code from adb to libadb.Dan Albert2015-01-267-50/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | Much of adb is duplicated in bootable/recovery/minadb and fastboot. Changes made to adb rarely get ported to the other two, so the trees have diverged a bit. We'd like to stop this because it is a maintenance nightmare, but the divergence makes this difficult to do all at once. For now, we will start small by moving common files into a static library. Hopefully some day we can get enough of adb in here that we no longer need minadb. Bug: 17626262 Change-Id: Ic8d5653bfcc0fec4e1acbece124402355084b864
* | Merge "Fix the v2 descriptor handling."Christopher Ferris2015-01-261-11/+6
|\ \
| * | Fix the v2 descriptor handling.Christopher Ferris2015-01-261-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | There was a misinterpretation of how the v2 header works. The flags in the header indicate what is in the rest of the structure. Bug: 19127803 Change-Id: I5fa0dae6da51522c9afc4c94838eb6f462208683
* | | adbd: tcpip command uses port number from uninitialized memorySpencer Low2015-01-251-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you run `adb tcpip`, adbd tries to process a string of 'tcpip:' using this code: } else if(!strncmp(name, "tcpip:", 6)) { int port; if (sscanf(name + 6, "%d", &port) == 0) { port = 0; } ret = create_service_thread(restart_tcp_service, (void *) (uintptr_t) port); If a zero-length string is passed to sscanf(), it returns EOF (-1) which causes the if statement to skip the block, leaving the port variable uninitialized. I found this by running `adb tcpip` and sometimes getting 'invalid port' and sometimes a device would start listening on a random port number. The fix is to check the sscanf() return value for the success case (the number of items successfully parsed), as is already done in other parts of the adb code. I also fixed-up another instance of the same code-pattern in services.c. Change-Id: I8c9c33485ad076828da0ac74f048fdad561669d3 Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
* | Merge "adb: Fix 'adb forward --no-rebind'."David 'Digit' Turner2015-01-231-1/+1
|\ \
| * | adb: Fix 'adb forward --no-rebind'.David 'Digit' Turner2015-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to a typo, the --no-rebind option never worked (it always failed). The root of the problem was that the client was sending on the wire a command like: host:forward:norebind::tcp:<port>;tcp:<port> ^^ Instead of: host:forward:norebind:tcp:<port>;tcp:<port> ^ Note the erroneous double-column. The fix is local to the adb client and thus doesn't require a new version of the server or guest adbd on the device-side. This also fixes 'adb reverse --no-rebind'. See https://code.google.com/p/chromium/issues/detail?id=451109 Change-Id: I680fd432b5470072f6a9968ca32a7f90c600ac68
* | | Python unit test for adb.Riley Andrews2015-01-131-0/+390
| | | | | | | | | | | | Change-Id: I1b2b8004f47b708e6a1d6a4ad20816e7beb21a0f
* | | Clean up adb Win32 symlink #ifdefs.Elliott Hughes2015-01-122-35/+26
|/ / | | | | | | Change-Id: I83ef30e82d820f91960c29f6b737e6e900caaca6
* | Merge "Use getmntent when accessing /proc/mounts."Yabin Cui2015-01-061-29/+13
|\ \
| * | Use getmntent when accessing /proc/mounts.Yabin Cui2015-01-051-29/+13
| | | | | | | | | | | | | | | Bug: 18887435 Change-Id: I6d7f95bbdb976428d4722bd640745e73c9839160
* | | Fix disable-verity when the underlying block device is ROSami Tolvanen2015-01-053-49/+18
|/ / | | | | | | | | | | | | | | | | | | | | If verity is enabled and the underlying block device is marked read-only, disable-verity fails. We cannot use the existing code for enable-verity to make the device writable as the device in /proc/mounts will be the verity device instead of the underlying device we want to change. This change makes the correct device writable when altering verity state. Change-Id: I423ee50fb34d78cff2fe843318b9081c03c5142d
* | Fix build with clangBernhard Rosenkränzer2014-12-121-1/+3
| | | | | | | | | | | | | | | | Remove 2 unused functions and 1 unused label in the !ALLOW_ADBD_DISABLE_VERITY case Change-Id: Id6b29f57bcb95e54f5a4014021d47d8ca6e4556e Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
* | fix memory leak in copy_remote_dir_localRiley Andrews2014-12-121-19/+43
| | | | | | | | | | | | Bug https://code.google.com/p/android/issues/detail?id=82436 Change-Id: I4bfa865638742e1b7cedd17f5b33dcc10c7f711c
* | Remove unused local variable.Chih-Hung Hsieh2014-12-101-1/+0
| | | | | | | | | | | | Clang compiler gives it a warning and error. Change-Id: Id35b740e265b393b5e31e05bd83544f391d8ff08
* | Fix some style issues in adb_commandline().Riley Andrews2014-12-091-27/+27
| | | | | | | | Change-Id: I8ed7899e7e137405594b3f3cbb0a87eae411dfc9
* | Refactor the host adb argument parsing loop to remove a gotoRiley Andrews2014-12-091-101/+70
| | | | | | | | Change-Id: I3412ac473abc4efa51a6275658e65f7191b5439d
* | Fix buildPaul Lawrence2014-12-091-1/+1
| | | | | | | | | | | | (cherry-pick of 731136ca36bb7af1490856373d463e3a6c4df1c8.) Change-Id: I9b493fd5fc5c5f62f02bc5234ccca2a5118380b4
* | Add adb enable-verityPaul Lawrence2014-12-096-31/+104
| | | | | | | | | | | | | | | | | | | | | | Note that it is *easy* to break your phone with this feature. It is not a bug that reenabling verity after changing one byte of the system partition stops the device booting. (cherry-pick of 7c442e1700e6312727283db402dec6f666f1b55a.) Bug: 18529433 Change-Id: I632e91281884471a362960f1ba30312d2669b8ff
* | Revert "Revert "Enable verity on userdebug, and add disable-verity to adb""Paul Lawrence2014-12-095-4/+220
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 152d2d4234ba89e0c20c4af13e291b6049a7bc33. Fixed build error, and also fixed memory leak spotted from warning. (cherry-pick of bbb36319119edde9377fb80015235893c30d2bc9.) Bug: 17691572 Change-Id: I23b5ba537f7b557432041d4338b38b9be434e981
* | adb warns on remount when verity is enabledPaul Lawrence2014-12-091-1/+33
| | | | | | | | | | | | | | (cherry-pick of f643beced1d154726dca7115014d2d1fdfcca993.) Bug: 18119147 Change-Id: I75e5edf83fa01dbf2495e24df4597dce41f13654
* | adbd & fastbootd: Support for new f_fs descriptor formatBadhri Jagan Sridharan2014-12-091-114/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch "[RFC] usb: gadget: f_fs: Add flags to descriptors block" marks the current usb_functionfs_descs_head format deprecated and introduces support for sending SuperSpeed descriptors. This CL makes adbd to send Descriptors in the new format. Adbd would fall back to the old format, if kernel is not able to recognize the new format. This is done to prevent adbd from breaking in the older versions of the kernel. (cherry-pick of fad60336daa5a7adf82d8140cbddd1c735770e71.) Bug: 17394972 Change-Id: I05095ccdcc74bf6953cbef847d7583eab137e12e Signed-off-by: Badhri Jagan Sridharan <Badhri@google.com>
* | Fix build on mac.leozwang2014-12-091-1/+1
| | | | | | | | | | | | | | | | | | On mac require a case. Also, this code is not portable, will fix it in long run. (cherry-pick of 0f1fda9ee80ba086e4c8960a7d153798e3cf3285.) Change-Id: I76194b62cea29bd3d21c7ba6c3da4d549bea4738
* | Add more debug information.leozwang2014-12-098-14/+36
| | | | | | | | | | | | | | | | | | | | | | | | Re-commit https://googleplex-android-review.googlesource.com/#/c/519430/ Add fix for win_sdk build. Add socketpair debug log. Also output thread information in log on host side. (cherry-pick of adb09fa01a16d8c5c92c2f8d325e1678c531223f.) Change-Id: I21021bc111a3f7362a91b70593e3738125878118
* | Fix adb/fastboot windows compilations.Christopher Ferris2014-12-093-1/+6
| | | | | | | | | | | | | | | | | | Many of the windows files where not including stdlib.h even though they are using malloc/free calls. (cherry-pick of ae7bf0959bd3f79afbf365e41f015ed1c304afdc.) Change-Id: If6959df9909d9d9928e9f4a2a96018166361cf3c
* | Merge "Introduce "adb keygen""Elliott Hughes2014-12-103-3/+34
|\ \
| * | Introduce "adb keygen"Nick Kralevich2014-12-083-3/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce the "adb keygen" command. Usage: adb keygen <filename> This command creates an adb public/private key pair in a user specified file. This can be used to create new adb keys, or rotate existing keys. Modify adb's key generation routines to use the HOSTNAME/LOGNAME environment variables if available. This allows someone to override the username/hostname embedded within the adb public key file if desired. Fallback to the old mechanisms if those environment variables aren't available. Bug: 18342715 Change-Id: Ibccee6088d4609aa05ad6687d3a1d8a8689d3e8a (cherry picked from commit af782b9f2ac4fb817ded80d4317a45345bb3f992) Change-Id: Ic76ffc9412171dddc879af0bbf6e20fbe1a8f057
* | | Merge "ADB on linux: Handle USB SuperSpeed extra Descriptors"Elliott Hughes2014-12-081-0/+12
|\ \ \ | |/ / |/| |
| * | ADB on linux: Handle USB SuperSpeed extra DescriptorsIngo Rohloff2014-05-161-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under Linux, ADB manually parses USB Descriptors to check for possible ADB USB Interfaces. USB Devices connected with SuperSpeed will exhibit extra USB SuperSpeed Endpoint Companion Descriptors. This patch handles these USB SuperSpeed specific USB Descriptors. Change-Id: Icd1e5fdde0b324c7df4f933583499f2c52a922f3 Signed-off-by: Ingo Rohloff <lundril@gmx.de>
* | | Merge "adb: enable superspeed support"Elliott Hughes2014-12-081-7/+56
|\ \ \
| * | | adb: enable superspeed supportZhuang Jin Can2014-12-081-7/+56
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I5a350bfa5641365d7a0939d89c6f477c335e948a Signed-off-by: Zhuang Jin Can <jin.can.zhuang@intel.com> Signed-off-by: Robert Chiras <robert.chiras@intel.com>
* | | | Clean up adb/Android.mkTrevor Drake2014-12-071-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed redundant LOCAL_C_INCLUDES. Switch from using libunz to libz Change-Id: Ic90c582fa56453bbac09561158e73f240dd47503
* | | | Merge "Fix deadlocks."Elliott Hughes2014-12-031-3/+3
|\ \ \ \ | |/ / / |/| | |
| * | | Fix deadlocks.Bao Haojun2014-05-141-3/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Close pipe fds[1] as soon as possible. Otherwise it may block when reading from fds[0] even though the child process has exited early and closed its copy of fds[1]. 2. Waitpid after pipe is closed. Otherwise the screencap child process may block while writing fds[1], because the fds[0] is not closed yet. If we close fds[0] first, then the screencap child process will die because of SIGPIPE, and waitpid will return correctly. Change-Id: I433c95a5ba2eb3045727fc39a49fd9557fb1a1d1 Signed-off-by: Bao Haojun <baohaojun@gmail.com>
* | | Kill HAVE_BIG_ENDIAN, HAVE_ENDIAN_H, and HAVE_LITTLE_ENDIAN.Elliott Hughes2014-11-214-68/+1
| | | | | | | | | | | | Change-Id: I9e25ac9d27e95b04fb8bf7a66c619af0139d8b8f