Commit graph

601 commits

Author SHA1 Message Date
JP Abgrall
5a5ab405cd am 4db6ce8e: Merge "Adding documentation on the sync part of the adb protocol previously missing."
* commit '4db6ce8e353458de751394102084bb3a304a7ff6':
  Adding documentation on the sync part of the adb protocol previously missing.
2014-03-20 22:12:43 +00:00
JP Abgrall
4db6ce8e35 Merge "Adding documentation on the sync part of the adb protocol previously missing." 2014-03-20 21:25:42 +00:00
Samuel Carlsson
912d5dddf8 Adding documentation on the sync part of the adb protocol previously missing.
In the SERVICES.TXT a missing documentation file is mentioned - SYNC.TXT. This file is supposed to contain all the godie bits of the adb protocol for pushing and pulling files. I've read the source code and documented this in the file SYNC.TXT. I've used my own documentation to create a java implementation to verify the documentation here: https://github.com/vidstige/jadb

Added line breaks at 78 characters. Added comments about remote files might be deleted.

Change-Id: I48c87c2a9fb5b59b85c72679124dfbbfa9a701bc
Signed-off-by: Samuel Carlsson <samuel.carlsson@gmail.com>
2014-03-20 20:36:46 +01:00
David 'Digit' Turner
7cb1504e8a am ee223d50: Merge "adb: Increase the max number of emulator instances to 64"
* commit 'ee223d50a009af39be577c30cc35257c751f05a1':
  adb: Increase the max number of emulator instances to 64
2014-03-14 20:34:26 +00:00
JP Abgrall
648f4113bc am 5fb1a34a: Merge "Added transfer progress reporting for push and pull commands."
* commit '5fb1a34af4128bfe7332b02e31b146a82bc2872d':
  Added transfer progress reporting for push and pull commands.
2014-03-13 15:54:17 +00:00
David 'Digit' Turner
094fd86b14 adb: Increase the max number of emulator instances to 64
When the ADB server starts, it probes the localhost ports to find
existing emulator instances, starting from 5555 with increments of
2, and stopping after ADB_LOCAL_TRANSPORT_MAX tries, which was
set to 16.

This means that the ADB server could not detect on startup more
than 16 existing emulator instances.

This increases the limit to 64, to match a corresponding change
on the emulator side.

  See https://android-review.googlesource.com/#/c/83553/

Change-Id: I35c69f8017298c3e5797bd396b8d788d44eaa00f
2014-03-13 11:21:58 +01:00
Mark Lindner
76f2a93b18 Added transfer progress reporting for push and pull commands.
Added a new '-p' switch to the 'push' and 'pull' commands that outputs
the file transfer progress (bytes transmitted, total bytes, and % done).
This provides useful feedback when transferring large files, and also
makes it possible for other tools to easily monitor the progress of a
forked push/pull command.

Change-Id: Iee6f42f5bd41292e5bc80fba779f526f0072e356
2014-03-11 19:31:26 -07:00
JP Abgrall
66146c40f7 am 44390474: Merge "adb: Don\'t unlink special files on sync failure."
* commit '443904746301e4d519e51075487ea4c8b9a860e3':
  adb: Don't unlink special files on sync failure.
2014-03-11 18:51:48 +00:00
JP Abgrall
8a00ce939a am b2c34ece: Merge "adb: Don\'t clobber block devices during push"
* commit 'b2c34ece647c212baa30c474394c498a2d6dd61f':
  adb: Don't clobber block devices during push
2014-03-11 18:51:48 +00:00
JP Abgrall
40b735f9b9 am 1367854a: Merge "adb: fix windows build after "forward --list" fix."
* commit '1367854a891090d1be1edfb12515691b20b350cf':
  adb: fix windows build after "forward --list" fix.
2014-03-11 18:42:20 +00:00
JP Abgrall
a4a9e64668 am 66e95d76: Merge "Fix adb forward --list when forwarding a lot"
* commit '66e95d76c47a3a099931bbebe7f4a0af4d3f7fbb':
  Fix adb forward --list when forwarding a lot
2014-03-11 18:42:18 +00:00
JP Abgrall
55b6c843a6 adb: Don't unlink special files on sync failure.
adb push some_disk_image /dev/block/mmcblk0p9
should not unlink the dev just because adb was ctrl-c'd.

Change-Id: I1b6669e8dba1f80fc1438b8deb618180b7e9a1b2
Signed-off-by: JP Abgrall <jpa@google.com>
2014-03-07 17:31:25 -08:00
JP Abgrall
4ce2f838e7 adb: Don't clobber block devices during push
In the past, an adb push would ALWAYS unlink the target path.
Now, we only links and regular files (and links).
This allows the following to work:

   adb shell ls -l /dev/block/mmcblk0p8
     # brw------- root     root     179,   8 2013-11-28 07:43 mmcblk0p8
   adb push n7.jpa.mda.post_jb_encryption.raw  /dev/block/mmcblk0p8

Bug: 11984121
Change-Id: I982c7a1cd87986621f2bebdcb41c4e281f67f772
2014-03-07 17:29:39 -08:00
JP Abgrall
5b0bb4898c adb: fix windows build after "forward --list" fix.
EWOULDBLOCK is not there on windows.
It gets translated by the adb_write() wrapper into EGAIN.
But the Linux one does not translate EWOULDBLOCK into EGAIN.
Without EWOULDBLOCK, it works just fine.

Change-Id: Ic293be392aa4364637428ea94ef87890ffa09b9b
Signed-off-by: JP Abgrall <jpa@google.com>
2014-03-06 19:40:45 -08:00
Nick Kralevich
6e94c5764b am 2e7347d6: Merge "Convert all selinux_android_restorecon and _setfilecon calls to new API."
* commit '2e7347d617b02b13d227bb4cecf6bd69b7b20fa9':
  Convert all selinux_android_restorecon and _setfilecon calls to new API.
2014-03-07 02:29:38 +00:00
Nick Kralevich
3530b9cd46 am 02916aa2: Remove obsolete vdc call.
* commit '02916aa20e3ffbe4b738bb12dc1607a7ec6a8c37':
  Remove obsolete vdc call.
2014-03-04 08:23:06 +00:00
Nick Kralevich
02916aa20e Remove obsolete vdc call.
Since ca8e66a8b0, init has
been handling reboots and filesystem unmounts. Remove obsolete
call to vdc.

Bug: 12504045
Change-Id: If8704ca042cb3a68857743b9973e48c52e7eb881
(cherry picked from commit 225459a5da)
2014-03-04 04:54:00 +00:00
Snild Dolkow
2264e7cfef Fix adb forward --list when forwarding a lot
The list action had some problems with large numbers of forwards:
 * adb_query() limited replies to 1024 B (and the print was useless)
 * the reply header's length could overflow (also in other commands)
 * ...and the client had no way of detecting it
 * writex() didn't retry on EAGAIN ("Resource temporarily unavailable")

This patch makes all "OKAY%04x" replies use a common function which
checks the length and limits it to 0xffff. This means that the client
can easily check for truncated replies.

Before: forward --list starts failing at 15-30 forwards (depending on
device serial and forward spec lengths).

After: no problems with forward --list.

Change-Id: Ie1e82c4d622f5c56e51abb26533ba17d40459914
2014-02-21 14:57:02 +01:00
Stephen Smalley
27a93650c0 Convert all selinux_android_restorecon and _setfilecon calls to new API.
libselinux selinux_android_restorecon API is changing to the more
general interface with flags and dropping the older variants.

Also get rid of the old, no longer used selinux_android_setfilecon API
and rename selinux_android_setfilecon2 to it as it is the only API in use.

Change-Id: I1e71ec398ccdc24cac4ec76f1b858d0f680f4925
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-02-07 09:38:32 -05:00
Mark Salyzyn
d2acdd82e6 Merge changes I70ab37d5,I716f89c0,I34c96adf,I77650923,I35b0d1ee, ...
* changes:
  libsysutils: SocketListener export release
  libsysutils: Add iovec/runOnEachSocket
  liblog: support struct logger_event_v2 format
  liblog: update timestamp on NOTICE file
  libcutils: resolve warning in iosched_policy.c
  liblog: Add const pedantics
  logcat: Add -T flag (-t w/o assumption of -d)
  logcat: Add logcat test suite
  liblog: Add cpu utilization test
  liblog: Add liblog test suite
  debuggerd: Support newline split in log messages
  liblog: deprecate export LOGGER ioctl definitions
  liblog: deprecate export of LOGGER_LOG_* defines
  liblog: Add README
  liblog: resolve build warning messages
  liblog: high CPU usage from logcat
  liblog: fix build again
  liblog: drop use of sys/cdefs.h
  liblog: git_master@964770 build problem
  logcat: Incorporate liblog reading API
  debuggerd: Incorporate liblog reading API
  liblog: Interface to support abstracting log read
  adb: deprecate legacy log service interface
  adb: regression from Move list.c to inlines
  liblog: whitespace cleanup
  libcutils: bug str_parms.c:str_parms_get_float().
  libcutils: UNUSED argument warnings
  libsysutils: Get rid of warnings
  libcutils: Move list.c to inlines on list.h
2014-01-28 21:09:37 +00:00
Benoit Goby
6ddabb7a1c Merge "adbd: Don't close/reopen FFS ep0 on disconnect" 2014-01-28 00:07:15 +00:00
Mark Salyzyn
7aa39a7b19 adb: deprecate legacy log service interface
(cherry picked form commit c66a7537df)

Change-Id: If96019cc13b3d7a4dcd7785c7137e0cbcc622981
2014-01-27 15:09:59 -08:00
Mark Salyzyn
c788278abc adb: regression from Move list.c to inlines
(cherry picked from commit 5f64d528be)

Change-Id: I057dbe3db80b1460f774e9f9ade11e0929529ec6
2014-01-27 15:09:22 -08:00
Nick Kralevich
75e0645921 Fix overflow in adb_client
Credit: Joshua Drake
Bug: 12060953

(cherry picked from commit e89e09dd2b)

Change-Id: I8a9b2592a5e4f7527c607abfe4ea6df6eb550aa8
2014-01-27 14:12:34 -08:00
Nick Kralevich
d49aa2537c adbd: switch to su domain when running as root
When adbd runs as root, it should transition into the
su domain. This is needed to run the adbd and shell
domains in enforcing on userdebug / eng devices without
breaking developer workflows.

Introduce a new device_banner command line option.

Change-Id: Ib33c0dd2dd6172035230514ac84fcaed2ecf44d6
2014-01-22 14:20:17 -08:00
Nick Kralevich
72917837e6 Fix "adb push /sdcard/filename"
Don't assume that calling chown(filename, getuid(), getgid())
will always succeed. In the case of /sdcard, a file you create
will be owned by root, so the chown call will fail.

Instead, use uid=gid=-1 so that the chown call is truly a no-op.

Ignore the results of calling chmod. Again, for /sdcard, the
chmod call will never succeed, because the file isn't owned by
the shell user.

Bug: 12441485
Change-Id: I11eaf1d6f6049c1158afc29754fbb7af2baf2c78
2014-01-17 16:16:42 -08:00
Elliott Hughes
ccecf14254 system/core 64-bit cleanup.
This cleans up most of the size-related problems in system/core.
There are still a few changes needed for a clean 64-bit build,
but they look like they might require changes to things like the
fastboot protocol.

Change-Id: I1560425a289fa158e13e2e3173cc3e71976f92c0
2014-01-16 12:54:18 -08:00
Colin Cross
e76343ef72 Merge "Emerson USB ID" 2014-01-12 07:05:04 +00:00
Jon Sawyer
6e39bace17 Emerson USB ID
Adds Emerson's USB id to the known USB Devices.

Change-Id: If6115c2551c1f30a5c190690f2aeaaf2adff7ee1
Signed-off-by: Jon Sawyer <jon@cunninglogic.com>
2014-01-11 22:59:18 -08:00
Jon Sawyer
5ff167ca11 HP USB ID
Adds HP's USB id to the know USB Devices

Change-Id: I975126f3ae5e53f25e18dea7cc43c29076bfc965
Signed-off-by: Jon Sawyer <jon@cunninglogic.com>
2014-01-08 08:14:26 -08:00
Jack Pham
4cbf1d8822 adbd: Don't close/reopen FFS ep0 on disconnect
In case of bulk read/write failure or disconnect, transport_usb
calls usb_ffs_kick in order to force the daemon to re-open the
FunctionFS ep files as a way to soft restart the kernel driver.

However, there's no reason to always close the ep0 file, as it
would need to be reopened and the descriptors rewritten--this
is unnecessary, especially in the simple/frequent case of cable
disconnect, and causes the kernel driver to unbind and bind *all*
of the function drivers. This is causing USB Chapter 9 tests to fail.

Thus, try to reuse the same ep0 file handle across reconnects. In
case there is a failure, the ep1/ep2 opens would fail and all the
file handles get dropped. For the adb root case, the entire daemon
gets restarted anyway.

Change-Id: I0840085c52a0795dcb2d751c39aa4a436c039ee2
2014-01-07 15:04:09 -08:00
DanielMo
c1b6b153dc adb: Add USB vendor ID for YotaDevices
Change-Id: Id8bec8a35edd0d21ae52e8469f7a65b5f4433bc2
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
2014-01-06 12:16:40 -08:00
DanielMo
402c2b9888 adb: Add USB vendor ID for TechFaith
Change-Id: Ied42e4d011b736ee990ed75e7d81bc6a16db47f9
2014-01-06 12:16:40 -08:00
DanielMo
d0057c006b adb: Add USB vendor ID for Rockchip
Change-Id: Iea3f7cc6ed463684fe30a73c39445b3ca36854d9
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
2014-01-06 12:16:39 -08:00
DanielMo
fdd189c64e adb: Add USB vendor ID for EMERGING Technology (Holdings) Ltd.
Change-Id: Ic7f7c984db19050d2ce4da8ae87683ce42dc9094
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
2014-01-06 12:16:39 -08:00
DanielMo
63f0f5117b adb: Add USB vendor ID for Allwinner
Change-Id: Ic77d5f71c9e329e33cd31fa0854e692ad794a609
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
2014-01-06 12:16:39 -08:00
DanielMo
d5dab6d5f8 adb: Add USB vendor ID for Amlogic
Change-Id: I35fad82214f2b5a82b0150821326aaea15784de1
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
2014-01-06 12:16:39 -08:00
Volker Moesker
319d8c1d1f added Gigaset's USB vendor ID
Change-Id: Iebb0f352eec4530ee1e972527fc76bbb9dad5cc3
Signed-off-by: Volker Moesker <volker.moesker@gigaset.com>
2014-01-06 12:16:29 -08:00
Colin Cross
293717c364 adb: alphabetically sort usb vendors lists
Sort the lists of usb vendor ids alphabetically to reduce future
conflicts.

Change-Id: I682c18a1d97adf3a4aa9c00de9fed932c83e4646
2014-01-06 12:12:39 -08:00
Colin Cross
e1095e1da1 Merge "Modify BYD's USB Vendor ID" 2014-01-03 20:53:22 +00:00
Liang Cheng
20d33f4d99 adb: configure /system file permission with fs_config
adbd changes the permissions of files uploaded by copying
owner's permission to group and other. This causes kernel
load failure if any changes are made to kernel modules
followed by ``adb push'' or ``adb sync'' because file mode
644 would become 666.

The change uses fs_config to get the target mode of files.

In addition, the SELinux file label is set incorrectly
on synced files. Set the label properly.

Change-Id: I354db848f39adfbf189d7e8d3b028e8d763c772f
Signed-off-by: Liang Cheng <licheng@nvidia.com>
Bug: 12264775
2014-01-02 20:26:18 -08:00
David 'Digit' Turner
818d641c42 adb: Check sender's socket id when receiving packets.
handle_packet() in adb.c didn't check that when an A_WRTE packet is
received, the sender's local-id matches the socket's peer id.

This meant that a compromised adbd server could sent packets to
the host adb server, spoofing the identity of another connected
device if it could "guess" the right host socket id.

This patch gets rid of the issue by enforcing even more checks
to ensure that all packets comply with the description in
protocol.txt.

+ Fix a bug where closing a local socket associated with a
  remote one would always send an A_CLSE(0, remote-id, "")
  message, though protocol.txt says that should only happen
  for failed opens.

  The issue was that local_socket_close() called
  remote_socket_close() after clearing the remote socket's
  'peer' field.

  The fix introduces a new asocket optional callback,
  named 'shutdown' that is called before that, and is
  used to send the A_CLSE() message with the right ID
  in remote_socket_shutdown().

  Also add some code in handle_packet() to detect
  invalid close commands.

Change-Id: I9098bc8c6e81f8809334b060e5dca4fc92e6fbc9
2013-12-16 17:58:08 +01:00
Nick Kralevich
b2dfa7ece7 am 02d90b92: am 33e7f915: am 54a80bcf: am cd072e94: am ba104fb7: am e975716e: am 03d4eb29: am d63fb078: am e89e09dd: Fix overflow in adb_client
* commit '02d90b92ce65ad4e7f49565f0e97373e1d8b0fbf':
  Fix overflow in adb_client
2013-12-10 12:39:32 -08:00
Nick Kralevich
02d90b92ce am 33e7f915: am 54a80bcf: am cd072e94: am ba104fb7: am e975716e: am 03d4eb29: am d63fb078: am e89e09dd: Fix overflow in adb_client
* commit '33e7f915d6a27880dd4c4c0709dcc921f549eea2':
  Fix overflow in adb_client
2013-12-10 12:37:32 -08:00
Nick Kralevich
33e7f915d6 am 54a80bcf: am cd072e94: am ba104fb7: am e975716e: am 03d4eb29: am d63fb078: am e89e09dd: Fix overflow in adb_client
* commit '54a80bcf88060b21f527c631c7ec911171bdb13f':
  Fix overflow in adb_client
2013-12-10 12:31:17 -08:00
Nick Kralevich
54a80bcf88 am cd072e94: am ba104fb7: am e975716e: am 03d4eb29: am d63fb078: am e89e09dd: Fix overflow in adb_client
* commit 'cd072e94cf7e546cd6d333cd65641edcd69402b7':
  Fix overflow in adb_client
2013-12-10 12:29:05 -08:00
Nick Kralevich
03d4eb2900 am d63fb078: am e89e09dd: Fix overflow in adb_client
* commit 'd63fb078aea697c536b19c03d29d4dde4ac087fc':
  Fix overflow in adb_client
2013-12-10 12:17:45 -08:00
Nick Kralevich
d63fb078ae am e89e09dd: Fix overflow in adb_client
* commit 'e89e09dd2b9b42184973e3ade291186a2737bced':
  Fix overflow in adb_client
2013-12-10 12:14:44 -08:00
Nick Kralevich
e89e09dd2b Fix overflow in adb_client
Change-Id: I7f8582bd8a69d61ce47d11a9ffd0e901fc371037
Credit: Joshua Drake
Bug: 12060953
2013-12-10 10:18:10 -08:00
Elliott Hughes
9259663cdb am f17f5591: am 36d44740: Merge "Fix a bunch of small system/core bugs."
* commit 'f17f55914e18eb176ccc5bb8266b248ece8cb56b':
  Fix a bunch of small system/core bugs.
2013-10-29 18:31:01 -07:00
Elliott Hughes
14e28d39f7 Fix a bunch of small system/core bugs.
Missing frees in:
  adb/file_sync_client.c
  fastboot/fastboot.c
  libsparse/output_file.c

Missing closedirs in:
  adb/file_sync_service.c
  cpio/mkbootfs.c
  libcutils/dir_hash.c

Potential buffer overrun in:
  gpttool/gpttool.c

Incorrect NULL check in:
  libsparse/backed_block.c

Bug: https://code.google.com/p/android/issues/detail?id=61564
Change-Id: If97838a9e73a77aef7f416c31c237ce1fca4ce21
2013-10-29 14:12:46 -07:00
Brian Carlstrom
406abdc8a2 am 5dadac50: am 87af04a4: Merge "Improve some adb error logging"
* commit '5dadac50c4bbeaf8baf4d5e04c2d2706d9e74fc7':
  Improve some adb error logging
2013-10-28 14:30:26 -07:00
Brian Carlstrom
93c91fad77 Improve some adb error logging
Bug: 11290643
Change-Id: Ibad4e9f0b69421cd6017b70a52237e7f27aab848
2013-10-27 16:56:55 -07:00
Nick Kralevich
0bf7924df1 am 91704522: Don\'t return immediately from reboot commands.
* commit '917045222a69021eb36aea96708649c709685509':
  Don't return immediately from reboot commands.
2013-10-24 12:39:29 -07:00
Nick Kralevich
917045222a Don't return immediately from reboot commands.
The reboot commands return too fast, interfering with testing.
Add a pause(), which will allow the device time to complete the
reboot.

Change-Id: Ie9cc6eea67b7ff662ec71ea2329cbb94f8d55404
Bug: 11369303
2013-10-24 11:01:16 -07:00
Colin Cross
903e6865ca am b024bbf6: am 6da66ef4: Merge "Handle screendumps for all framebuffer sizes"
* commit 'b024bbf6a1daf752a8d756bfda472fe6fb48dd9e':
  Handle screendumps for all framebuffer sizes
2013-10-02 14:31:46 -07:00
Colin Cross
6da66ef49b Merge "Handle screendumps for all framebuffer sizes" 2013-10-02 20:24:46 +00:00
Doug Zongker
8e5b63d045 mincrypt: support SHA-256 hash algorithm
- adds a library to compute the SHA-256 hash

- updates the RSA verifier to take an argument specifying either SHA-1
  or SHA-256

- updates DumpPublicKey to with new "key" version numbers for
  specifying SHA-256

- adds new argument to adb auth code to maintain existing behavior

(cherry picked from commit 515e1639ef)

Change-Id: Ib35643b3d864742e817ac6e725499b451e45afcf
2013-09-25 09:26:34 -07:00
Chris Dearman
85373f4280 Handle screendumps for all framebuffer sizes
readx() treats a partial read as an error but also consumes the data,
Now exactly the amount of data needed for the screendump is requested.

This bug showed up for framebuffers that were not a multiple of 640
bytes.

Also fix a compiler warning related to handing pipe() failure.

Change-Id: I8b1713923e156d4e3424784152e5dc5cbc7d478d
2013-09-25 02:43:45 -07:00
Elliott Hughes
b926493417 am 876f4366: am a7f6e015: Merge "correct msi usb vendor id."
* commit '876f436668036e8e9d3f86434eee1a44ff5364b8':
  correct msi usb vendor id.
2013-08-28 08:37:02 -07:00
astonehuang
48c5d7b6cd correct msi usb vendor id.
Change-Id: I13128531b8dd7758abddce47ce1c119381773c26
2013-08-28 10:53:17 +08:00
Elliott Hughes
88ea2f669f am 3042c265: am b3644d8f: Merge "Add USB Vendor ID for WACOM"
* commit '3042c265bf3123426e99fed856c9d3b7fa3b3ad6':
  Add USB Vendor ID for WACOM
2013-08-16 15:37:43 -07:00
Wing Tseng
64a602942e Add USB Vendor ID for WACOM
Change-Id: I3deee6d5bdfb9c5bbc0fddcfa39814d27ee281c2
Signed-off-by: Wing Tseng <Wing_Tseng@pegatroncorp.com>
2013-08-15 09:33:59 +08:00
Elliott Hughes
49f2e1cedf am cc39d421: am 936032b4: Merge "Add USB Vendor ID for MSI"
* commit 'cc39d421ea5f449d5e201dd1ada7b2a12acf5ad9':
  Add USB Vendor ID for MSI
2013-08-12 10:34:58 -07:00
astonehuang
307d96a6e6 Add USB Vendor ID for MSI
Change-Id: I4f4bfb6ef08058bf749917119a2b08952e7bc337
2013-08-01 15:23:17 +08:00
Colin Cross
44f5c15724 Merge "Move liblog headers to system/core/include/log" 2013-07-25 21:39:24 +00:00
Elliott Hughes
b815810f47 am 09f240e0: am 5d855432: Merge "Add USB Vendor ID for ECS"
* commit '09f240e0b06326531e64e9826859a774cd456ad7':
  Add USB Vendor ID for ECS
2013-07-25 09:58:12 -07:00
Elliott Hughes
5d8554323c Merge "Add USB Vendor ID for ECS" 2013-07-25 16:50:39 +00:00
Colin Cross
9227bd3855 Move liblog headers to system/core/include/log
Move the liblog headers to log/ instead of cutils/ to complete
the separation of libcutils and liblog.  cutils/log.h still
exists and includes log/log.h in order to support the many existing
modules that use cutils/log.h.

Change-Id: I2758c9f4aedcb809ca7ba8383d0f55041dd44345
2013-07-24 12:32:39 -07:00
ecsgms
cae8b9df5c Add USB Vendor ID for ECS
Change-Id: Ib2fa70204d37f53dc642091eb927d865ddc585b5
2013-07-24 16:13:49 +08:00
Elliott Hughes
228ee639be am 98c02528: am 19188955: am d92e35eb: Merge "Add Qisda usb config"
* commit '98c02528a2f8bdc0f31a78a8b0b086f4ae823310':
  Add Qisda usb config
2013-06-18 11:37:47 -07:00
Elliott Hughes
19188955b5 am d92e35eb: Merge "Add Qisda usb config"
* commit 'd92e35eb7b97f349054390cfee1d40154dba6d66':
  Add Qisda usb config
2013-06-18 11:32:58 -07:00
esther
001fe87e02 Add Qisda usb config
add Qisda usb config
Signed-off-by: esther <esther530@gmail.com>

Change-Id: I5b8a0e5bd2218ecdf417de357c9a7d9307c91932

Conflicts:
	adb/usb_vendors.c
2013-06-18 11:28:08 -07:00
Elliott Hughes
e39057b687 am 88411498: am 520f4f06: am 865bb05d: Merge "adb: fix reported transfer size for transfer over 4 GiB"
* commit '88411498b3341dbf8f2976991524b1e21dedc6f6':
  adb: fix reported transfer size for transfer over 4 GiB
2013-06-17 14:00:17 -07:00
Elliott Hughes
8df29c9b61 am 1aeefcd6: am 0173ebd5: am 5f8d9c01: Merge "adb: add vendor ID\'s for Nook, Haier, Hisense, and MTK"
* commit '1aeefcd6900d85911028e6d3e344e338e0a05158':
  adb: add vendor ID's for Nook, Haier, Hisense, and MTK
2013-06-17 13:56:54 -07:00
Elliott Hughes
520f4f0603 am 865bb05d: Merge "adb: fix reported transfer size for transfer over 4 GiB"
* commit '865bb05dd0db1531f252de5e137605beec171ca2':
  adb: fix reported transfer size for transfer over 4 GiB
2013-06-17 13:56:04 -07:00
Elliott Hughes
0173ebd531 am 5f8d9c01: Merge "adb: add vendor ID\'s for Nook, Haier, Hisense, and MTK"
* commit '5f8d9c012cf28fad57d0896b938b05e2c976073f':
  adb: add vendor ID's for Nook, Haier, Hisense, and MTK
2013-06-17 13:51:46 -07:00
Elliott Hughes
865bb05dd0 Merge "adb: fix reported transfer size for transfer over 4 GiB" 2013-06-17 20:49:25 +00:00
Jeff Smith
71150ce4ef adb: add vendor ID's for Nook, Haier, Hisense, and MTK
Change-Id: I156ff750ef9ae66113d1e0e3ceffea047abc03b9
Signed-off-by: Jeff Smith <whydoubt@gmail.com>
2013-06-17 13:21:04 -05:00
Jeff Smith
d9a1430ff2 adb: fix reported transfer size for transfer over 4 GiB
When transferring files over 4 GiB with adb, the size of the transfer
is misreported.

Change-Id: Ia3d4cae1e9f82b4f7432341820b101ea9a44f85b
Signed-off-by: Jeff Smith <whydoubt@gmail.com>
2013-06-15 16:03:54 -05:00
Nick Kralevich
893a4a47e8 adb: Only use properties on device builds
When building for the host, don't make reference to
property_get / property_set.  I'm in the process of removing
host side support for properties.

Change-Id: I691c5872b5fd538e78bc38a3fe72574cdc7f43c3
2013-05-23 10:37:46 -07:00
kongfanqing
cabb75e427 Modify BYD's USB Vendor ID
Change-Id: I391487a12ba7ed86aac81457f8026acd3fd7576c
2013-05-15 14:17:41 +08:00
Kenny Root
928116ceef Host builds: add fastboot and adb
Add fastboot and adb host utilities to debug builds for debugging
and development purposes.

Change-Id: If77699a27497b8641998930f14d4ee418b856080
2013-05-02 09:51:53 -07:00
Benoit Goby
15e84ad042 Merge "adb: Handle adb connect in a thread" 2013-04-25 22:43:54 +00:00
Nick Kralevich
44a5fb5704 Merge "fs_mgr: make block devices read-only" 2013-04-25 20:22:20 +00:00
Benoit Goby
1c45ee92e2 adb: Handle adb connect in a thread
adb connect calls connect() in the event loop. If you pass a wrong ip
address or the server is slow to respond, this will block the event loop
and you can't even kill the adb server with adb kill-server. Handle connect
requests in a service thread instead.

Change-Id: I2ee732869a3dc22a6d3b87cf8ac80acaa7790037
2013-04-25 12:34:49 -07:00
Benoit Goby
9470c2f1ab adb: Cleanup dead code
dns_service is unused and recover_service has been replaced by adb
sideload

Change-Id: Ie90000d7f672e8299ee1622a9690c7371b214dc1
2013-04-24 21:31:45 -07:00
Nick Kralevich
e18c0d508a fs_mgr: make block devices read-only
When a filesystem is mounted read-only, make the underlying
block device read-only too. This helps prevent an attacker
who is able to change permissions on the files in /dev
(for example, symlink attack) from modifying the block device.

In particular, this change would have stopped the LG Thrill / Optimus
3D rooting exploit
(http://vulnfactory.org/blog/2012/02/26/rooting-the-lg-thrill-optimus-3d/)
as that exploit modified the raw block device corresponding to /system.

This change also makes UID=0 less powerful. Block devices cannot
be made writable again without CAP_SYS_ADMIN, so an escalation
to UID=0 by itself doesn't give full root access.

adb/mount: Prior to mounting something read-write, remove the
read-only restrictions on the underlying block device. This avoids
messing up developer workflows.

Change-Id: I135098a8fe06f327336f045aab0d48ed9de33807
2013-04-24 08:53:26 -07:00
Nick Kralevich
ca8e66a8b0 Make init handle reboots
Move the responsibility for rebooting the system from the
reboot command to init. Init is in a better position to take
actions to bring the system down cleanly, including making sure
filesystems are mounted read-only.

The only UIDs which can perform an init triggered reboot are
root, system, and shell.

Modify the reboot command so that it calls into init to perform
the reboot. The reboot command no longer requires CAP_SYS_BOOT.

Remove the -n reboot option and code which supports it.  Anyone needing
to do an unclean shutdown can just do a 'echo c > /proc/sysrq-trigger'.

Modify adb so that it calls into init to perform a shutdown.

Bug: 8646621
Change-Id: I84c0513acb549720cb0e8c9fcbda0050f5c396f5
2013-04-23 13:21:40 -07:00
Colin Cross
5192363226 am b544da0b: am d7cab8bf: Merge "adb : add missing connection states"
* commit 'b544da0be42cdd1e28d6562a26215d57c51b2f2b':
  adb : add missing connection states
2013-04-17 15:13:27 -07:00
Colin Cross
b544da0be4 am d7cab8bf: Merge "adb : add missing connection states"
* commit 'd7cab8bff1334ba48620a16d1b98f2ae623fee7d':
  adb : add missing connection states
2013-04-17 15:11:39 -07:00
Colin Cross
d7cab8bff1 Merge "adb : add missing connection states" 2013-04-17 21:45:45 +00:00
Elliott Hughes
50970341bf am ac76c1f1: am ffc5a4a5: Merge "Add OUYA VID to known VID list"
* commit 'ac76c1f16f889140ec5c56faccd676c2ff15d7bc':
  Add OUYA VID to known VID list
2013-04-17 09:30:59 -07:00
Elliott Hughes
ac76c1f16f am ffc5a4a5: Merge "Add OUYA VID to known VID list"
* commit 'ffc5a4a529338c834954e58de2701572eb0752f0':
  Add OUYA VID to known VID list
2013-04-17 09:27:37 -07:00
Al Sutton
21ec0516cf Add OUYA VID to known VID list
Add the OUYA VID to the list of known USB VIDs to allow developers with OUYA
consoles to have their device automatically recognized.

Change-Id: I499114d8071747b972c24681fc0771f000ad9f9d
2013-04-17 09:20:05 -07:00
trevd
a5ad539cff adb : add missing connection states
Both CS_RECOVERY and CS_SIDELOAD where not being checked by
connection_state_name which resulted in adb get-state returning
unknown when a device is in those modes.

Change-Id: I00716024d6a0bdb68d6e2380c8cd7b5d056bd15f
Signed-off-by: trevd <trevd1234@gmail.com>
2013-04-17 14:34:23 +01:00
Doug Zongker
515e1639ef mincrypt: support SHA-256 hash algorithm
- adds a library to compute the SHA-256 hash

- updates the RSA verifier to take an argument specifying either SHA-1
  or SHA-256

- updates DumpPublicKey to with new "key" version numbers for
  specifying SHA-256

- adds new argument to adb auth code to maintain existing behavior

Change-Id: I5b1406cf57c2b8993f6032eda3e29139f7740839
2013-04-10 14:33:31 -07:00
Benoit Goby
05d6a649a3 am 9f25178a: am 7f8fb3ff: Merge "adb: Prevent registering usb_disconnect twice" into jb-mr2-dev
* commit '9f25178a9dd0aa8fab5e74f785c9997ae230a325':
  adb: Prevent registering usb_disconnect twice
2013-04-02 11:03:18 -07:00
Benoit Goby
9f25178a9d am 7f8fb3ff: Merge "adb: Prevent registering usb_disconnect twice" into jb-mr2-dev
* commit '7f8fb3ffa2a234b704fc975fc9b1001f17df9cac':
  adb: Prevent registering usb_disconnect twice
2013-04-02 08:24:36 -07:00
Benoit Goby
b66356cab6 adb: Prevent registering usb_disconnect twice
adbd can receive multiple AUTH_RSAPUBLICKEY packets. This happens for
example when booting with usb attached when we retry authenticating
after the framework is done booting. Make sure usb_disconnect is only
registered once, otherwise this creates a loop in the disconnects list.

Bug: 8504991
Change-Id: Ia1f9a37005dd17b7eefee1493d622e1679263eea
2013-04-01 17:39:06 -07:00