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>
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
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
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>
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
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>
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
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>
* 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
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
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
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
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
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
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
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
- 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
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