Commit Graph

3379 Commits

Author SHA1 Message Date
Automerger Merge Worker 7a77da389d Merge changes Ia8f83a53,Ia1f6a659 am: 68f2e9cf1b am: b71ac7f83c am: 8593621b2d
Change-Id: I282326f1ff6158f60d4195a51ad2abdba382d483
2020-02-10 19:53:39 +00:00
Josh Gao 68f2e9cf1b Merge changes Ia8f83a53,Ia1f6a659
* changes:
  adbd: add a perfunctory abb test.
  adb: switch tests to python3.
2020-02-10 19:11:26 +00:00
Josh Gao e4d66fc678 adbd: add a perfunctory abb test.
Bug: http://b/148838069
Test: python3 -m unittest test_device.AbbTest
Change-Id: Ia8f83a535d4a513f4bdce5cfa4bfe69cd2dbb634
2020-02-07 15:59:49 -08:00
Josh Gao 93dee964d4 adb: switch tests to python3.
Test: treehugger
Change-Id: Ia1f6a659e23f5d9e63c9b106c60d56b5b954b19c
2020-02-07 15:59:49 -08:00
Automerger Merge Worker 9ca6eae9d5 Merge "use apex_test for test apexes" am: 07e74d65a2 am: dbb782eaf5 am: 31df29bc4b
Change-Id: I670b785f20eeaabba3d67abd8f0bb7e5153c01b4
2020-02-06 02:12:17 +00:00
Jiyong Park 17730e7cf6 use apex_test for test apexes
... so that the build system can distinguish testing APEXes and installable APEXes, and apply
different rules to them.

Bug: 146308764
Test: m
Change-Id: I5fdab94da352e8014225b2454aacc2a5b5fc6a52
2020-02-05 18:44:10 +09:00
Automerger Merge Worker 399afe8827 Merge "adb: report error in copy_to_file." am: c71a1e7ab0 am: 4b093c83ff am: 64f0064a0d
Change-Id: Id427bd20ffc61121313f5d7d47912b43682930f5
2020-02-05 00:29:14 +00:00
Josh Gao c71a1e7ab0 Merge "adb: report error in copy_to_file." 2020-02-04 23:49:37 +00:00
Josh Gao 3828ebcdd8 adb: report error in copy_to_file.
Previously, if we failed to read a file after successfully opening it,
(e.g. because it's a directory), we would return prematurely without
notifying our caller, which would then wait forever for a response that
isn't coming.

Switch all of the adb install callsites over to checking the result,
but leave the other callsites ignoring the result, because they're
either deprecated, or don't care.

Bug: http://b/145621968
Test: mkdir foo.apk; adb install foo.apk
Change-Id: Ia82f8280b144f7881e067a10cd17f9a89019cf3f
2020-02-04 13:47:57 -08:00
Automerger Merge Worker eabfab94ee Merge "Add libadbd_auth to adbd's required list." am: 955601beb4 am: 4a0bbf0838 am: 023d78872b
Change-Id: I19135dbbdc39efda1607ebd74cdce1afe0041c0d
2020-02-04 10:47:28 +00:00
Josh Gao 955601beb4 Merge "Add libadbd_auth to adbd's required list." 2020-02-04 10:16:41 +00:00
Josh Gao 9952258416 Add libadbd_auth to adbd's required list.
It seems like we might not be tracking dependencies properly on
devices with flattened APEXes? Add libadbd_auth to adbd's required
list to work around this for now.

Bug: http://b/148812347
Test: `ls $ANDROID_PRODUCT_OUT/system/lib/libadbd_auth.so` before and after when building a go device
Change-Id: If60abeb00797e37bf6a5a037249a21877e0b3d26
2020-02-04 07:17:19 +00:00
Automerger Merge Worker d4345ac647 Merge "Add adbd_test to mts." am: d0854b3397 am: 80183a10cd am: ed60f2a2c6
Change-Id: Iaff793761dbfbe74df84cb9b7627ec33e1b6e776
2020-02-03 23:51:34 +00:00
Josh Gao d0854b3397 Merge "Add adbd_test to mts." 2020-02-03 23:30:12 +00:00
Automerger Merge Worker 550a6525be Merge "adbd: actually dynamically link against libadbd_auth." am: d5bad7c021 am: e263f4d717 am: c525814b95
Change-Id: Ie6f420b87a7347f365316a885fcabfc1c90a56d9
2020-02-03 20:38:42 +00:00
Automerger Merge Worker 9f4e6f5acb Merge "The darwin linker does not support version scripts" am: a911933a23 am: aa07f58bcf am: ab0a3cd806
Change-Id: I970c526e9c1454feff625e1207ac0ba9660a7a63
2020-02-03 20:17:38 +00:00
Josh Gao d5bad7c021 Merge "adbd: actually dynamically link against libadbd_auth." 2020-02-03 20:15:20 +00:00
Dan Willemsen a536b4280e The darwin linker does not support version scripts
Fixes: 148774297
Test: m nothing   on a mac
Change-Id: I4000b2076fe2dde3776b112b506ee3266a529fc6
2020-02-03 10:02:41 -08:00
Automerger Merge Worker f74bc08685 Merge "libadbconnection_client: apply version script to library." am: 28bf90f32b am: eee0bf53b9 am: 74b6e13a6d
Change-Id: Ied22b9127c945ea0b79f5ee8bc8dd94bd0f6a947
2020-02-03 10:01:19 +00:00
Josh Gao 24b01d2de8 libadbconnection_client: apply version script to library.
Previously, we were using the version script for only the stubs in the
library, which led to symbols from libc++_static leaking out.

Bug: http://b/148504737
Test: booted a user build
Change-Id: Ie22856f7d16cc837eb961f70195d49898bf7fb49
2020-01-31 16:51:54 -08:00
Automerger Merge Worker b867fd3fc9 Merge "adb: make the push summary fit in 80 columns." am: b2066fda6d am: 43f9d449b9 am: d837300991
Change-Id: Ieaa55af207137ce3975a83fc1073772e705f5e93
2020-01-31 16:34:54 +00:00
Josh Gao 7f72945eff adbd: actually dynamically link against libadbd_auth.
libadbd_auth was accidentally linked as a static library, which defeats
the entire purpose.

Test: treehugger
Test: readelf -d $ANDROID_PRODUCT_OUT/apex/com.android.adbd/bin/adbd
Change-Id: Id5b66745946a8b92e368ee5f3965275ff03e056d
2020-01-30 16:18:43 -08:00
Josh Gao 7e015871db Add adbd_test to mts.
Bug: http://b/137798163
Test: mts-tradefed run mts-adbd
Change-Id: I875f224bbcd7b1f81365fffdd8de8d2df4e87c84
2020-01-30 23:53:20 +00:00
Elliott Hughes b2066fda6d Merge "adb: make the push summary fit in 80 columns." 2020-01-30 16:01:01 +00:00
Automerger Merge Worker 123ccf0cee Merge "Move jdwp connection abstraction from ART apex to adbd apex." am: e30aa60128 am: baef7c2982 am: 05f6c1d4b7
Change-Id: Ib086312a31755600d7d427eb702175a95e127d79
2020-01-29 00:33:39 +00:00
Elliott Hughes 00ff8d7021 adb: make the push summary fit in 80 columns.
Elide $ANDROID_PRODUCT_OUT for a large saving:

  /data/: 2 files pushed. 734 files skipped. 6.5 MB/s (830776 bytes in 0.122s)
  /product/: 0 files pushed. 357 files skipped.
  /system/: 7 files pushed. 2638 files s...d. 16.3 MB/s (3785511 bytes in 0.221s)
  /system_ext/: 1 file pushed. 90 files ...d. 13.2 MB/s (1152016 bytes in 0.084s)
  /vendor/: 0 files pushed. 200 files skipped.

And drop the repeated "files" when talking about how many were skipped
for a small saving:

  /data/: 2 files pushed, 734 skipped. 6.4 MB/s (830776 bytes in 0.124s)
  /product/: 0 files pushed, 357 skipped.
  /system/: 7 files pushed, 2638 skipped. 13.8 MB/s (3785511 bytes in 0.262s)
  /system_ext/: 1 file pushed, 90 skipped. 12.2 MB/s (1152016 bytes in 0.090s)
  /vendor/: 0 files pushed, 200 skipped.

Bug: http://b/131717844
Test: adb sync
Change-Id: I9d24df49498211bc2b8dcebcc6d8bd557da214c1
2020-01-27 10:05:36 -08:00
Josh Gao bb7fc92ee1 Move jdwp connection abstraction from ART apex to adbd apex.
Test: ./art/tools/run-jdwp-tests.sh
Change-Id: I3114b8403f3548700a45df5d7bb72ebe727adec1
2020-01-24 12:31:59 -08:00
Automerger Merge Worker 320c799886 Merge "Build test_com.android.adbd.apex." am: 427006042c am: ee38372728 am: 2bac7bff47
Change-Id: Ib2ccc3f56597c0027db4027e70794223b25af5af
2020-01-24 00:38:40 +00:00
Josh Gao 427006042c Merge "Build test_com.android.adbd.apex." 2020-01-23 23:58:43 +00:00
Josh Gao 7da5d8a977 Build test_com.android.adbd.apex.
Build a test apex with an INT_MAX version code for the purposes of
update/rollback testing.

Test: atest adbd_e2e_tests # in internal master
Change-Id: I0e616db03dcbc940af2741dfca5b4c5f50a5a654
2020-01-23 11:55:03 -08:00
Baligh Uddin 3c420c0f34 Set version to 300000000
Exempt-From-Owner-Approval: baligh@ approving to unblock TM21 train
generation.

Change-Id: I6eb8c2f618c41800ad9defcc7eb8f8fcb1d724df
2020-01-23 10:18:35 -08:00
Junyong Sun 1ffccf5c8b adb: windows: fix adb execute root cmd with no tips
fwrite can cross windows platform to show log on terminal,
so we use it instead of WriteFdExactly.

Change-Id: I252c15a0bc72e1dbd98b7b5ec8000ecdcde16416
Signed-off-by: Junyong Sun <sunjy516@gmail.com>
2020-01-17 09:39:21 +08:00
Tom Cherry f633b62b63 Merge "Require liblog for libbase in all configurations" 2020-01-15 23:20:07 +00:00
Kevin Brodsky 0b633d8800 Remove leftover support for target-as-host
Support for target-as-host was removed by 4626b71057 ("Fix win_sdk
build."), so ADB_HOST_ON_TARGET is never defined.

Test: build
Change-Id: I5ab27e68208677266e2e4272bc2bae7d6a097c5d
2020-01-13 14:48:49 +00:00
Treehugger Robot a6379cd2df Merge "Add /system/lib to the permitted paths for ns of APEXes" 2020-01-13 08:19:23 +00:00
Tom Cherry 992163021d Require liblog for libbase in all configurations
liblog will soon be required for all of libbase's logging.  This
change proactively requires liblog in all configurations instead of
just Android.

Bug: 119867234
Test: build
Change-Id: I696162fbebc78d4ef23c6032412101ac51d397a4
2020-01-09 10:43:26 -08:00
Treehugger Robot f5a329f1a4 Merge "adb: fix `adb connect` help typo." 2020-01-09 04:34:27 +00:00
Treehugger Robot 97186600b5 Merge "adb: avoid consuming input in `adb remount`." 2020-01-08 23:52:40 +00:00
Josh Gao 9e75634082 adb: avoid consuming input in `adb remount`.
Bug: https://issuetracker.google.com/146163747
Test: dd if=/dev/zero bs=1024 count=1 | (adb remount; wc)
Change-Id: I700090cd0bbae2d76569008f3c1a116336951c0a
2020-01-08 12:43:34 -08:00
Elliott Hughes 65474fd78c adb: fix `adb connect` help typo.
Bug: http://b/130380645
Test: adb connect
Change-Id: I04205ff0120bcfd865dc5fa95846694d0ff6de80
2020-01-08 10:02:43 -08:00
Jiyong Park 016059dd46 Add /system/lib to the permitted paths for ns of APEXes
With b/144533348, there will be symlinks from libs in APEXes to the libs
in the system partition. This is to reduce the size of APEXes when the
APEX is bundled with the platform.

Adding the /system/lib to the permitted paths so that the realpaths of
the symlinks are allowed for the namespaces.

Note that this however does not open all libs in the system partition to
the APEX namespaces, because searching of the libs are NOT done in
/system/lib, but in /apex/<module>/lib directory.

Bug: 144533348
Test: m
Change-Id: I4bb1d6cb5dbf647ae669f49aa5ccb178f5488b5e
2020-01-07 19:53:38 +09:00
Kiyoung Kim 0513f0e266 Update ld.config.txt for adbd apex
ld.config.txt for ADBD APEX works properly, but it can be reduced into
simpler way. This change updates ADBD APEX linker configuration which
reduces complexity and limit library usage from system partition.

Test: m -j && confirmed adbd works from cuttlefish
Change-Id: Ifcf1323082148aec4b6417c0ba7df0d9fe8ffeb0
2020-01-03 13:37:29 +09:00
Josh Gao 27fa358d41 Merge "adb: use poll instead of select in shell_service." 2019-12-19 20:22:13 +00:00
Treehugger Robot 1cdcc5f7e8 Merge "adb: fix use after free of atransport." 2019-12-18 22:39:48 +00:00
Josh Gao 63da8e6272 adb: use poll instead of select in shell_service.
Bug: http://b/141955761
Test: test_device.py
Test: adbd_test
Change-Id: I8976304a1011e81e85f8d90d95d36ecd82834f5f
2019-12-18 14:02:57 -08:00
Elliott Hughes 264a37d12f Merge "Fix SEGV in libziparchive with malformed zip file." 2019-12-18 16:14:54 +00:00
Treehugger Robot 90e9217aca Merge "Enable "localfilesystem" UNIX domain socket for ADB." 2019-12-18 05:34:30 +00:00
Elliott Hughes fba2a1a1ec Fix SEGV in libziparchive with malformed zip file.
d77c99ebc3 changed MappedFile to return a
bogus zero-length mapping on failure rather than nullptr. None of the
calling code was changed, though, and it seems like doing so would be a
bad idea. Revert that part of the change.

Add missing tests, and tidy up some of the logging. Also remove
single-use or obfuscatory constants from the tests.

The new "empty.zip" was created by using zip(1) to create a zip file
with one entry, then using `zip -d` to remove it.

The new "zero-size-cd.zip" was created by using zip(1) to create a zip
file containing a single empty file, and then hex editing the two byte
"size of the central directory" field in the "end of central directory
record" structure at the end of the file. (This is equivalent to, but
much smaller than, the example zip file provided by the bug reporter.)

Bug: http://b/145925341
Test: treehugger
Change-Id: Iff64673bce7dae886ccbc9dd6c2bbe18de19f9d2
2019-12-17 08:39:09 -08:00
Elliott Hughes dfe6c84709 adb: improve help for -t/-tt.
Test: adb help
Change-Id: Ic75bf184dfc51e57b422666d85e3b7a5139b3853
2019-12-13 16:43:10 -08:00
Josh Gao 607fd5424a adb: fix use after free of atransport.
libadbd_auth might report authentication success for a transport that's
already been destroyed. Fix this by storing a weak pointer to the
atransport that gets cleared upon destruction instead of a raw pointer.

Bug: http://b/144704376
Test: ./test_adb.py
Test: ./test_device.py
Change-Id: Idffe027381e6b2e37f06aa0166e97cafc98eaf3b
2019-12-13 13:28:21 -08:00