Android-cuttlefish cvd tool
|
#include "sysdeps.h"
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <iostream>
#include <memory>
#include <string>
#include <thread>
#include <vector>
#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/parseint.h>
#include <android-base/stringprintf.h>
#include <android-base/strings.h>
#include "client/host_services.h"
#include <sys/ioctl.h>
#include <termios.h>
#include "adb.h"
#include "adb_auth.h"
#include "adb_client.h"
#include "adb_host.pb.h"
#include "adb_install.h"
#include "adb_io.h"
#include "adb_unique_fd.h"
#include "adb_utils.h"
#include "app_processes.pb.h"
#include "bugreport.h"
#include "client/file_sync_client.h"
#include "commandline.h"
#include "incremental_server.h"
#include "services.h"
#include "shell_protocol.h"
#include "socket_spec.h"
#include "sysdeps/chrono.h"
Classes | |
struct | StdinReadArgs |
class | AdbServerStateStreamsCallback |
Macros | |
#define | TRACE_TAG ADB |
#define | SIDELOAD_HOST_BLOCK_SIZE (CHUNK_SIZE) |
Functions | |
static std::string | product_file (const std::string &file) |
static void | help () |
static void | stdin_raw_init () |
static void | stdin_raw_restore () |
int | read_and_dump_protocol (borrowed_fd fd, StandardStreamsCallbackInterface *callback) |
int | read_and_dump (borrowed_fd fd, bool use_shell_protocol, StandardStreamsCallbackInterface *callback) |
static void | stdinout_raw_prologue (int inFd, int outFd, int &old_stdin_mode, int &old_stdout_mode) |
static void | stdinout_raw_epilogue (int inFd, int outFd, int old_stdin_mode, int old_stdout_mode) |
bool | copy_to_file (int inFd, int outFd) |
static void | send_window_size_change (int fd, std::unique_ptr< ShellProtocol > &shell) |
static void | stdin_read_thread_loop (void *x) |
static std::string | ShellServiceString (bool use_shell_protocol, const std::string &type_arg, const std::string &command) |
static int | RemoteShell (bool use_shell_protocol, const std::string &type_arg, char escape_char, bool empty_command, const std::string &service_string) |
static int | adb_shell (int argc, const char **argv) |
static int | adb_abb (int argc, const char **argv) |
static int | adb_shell_noinput (int argc, const char **argv) |
static int | adb_sideload_legacy (const char *filename, int in_fd, int size) |
static int | adb_sideload_install (const char *filename, bool rescue_mode) |
static int | adb_wipe_devices () |
static bool | wait_for_device (const char *service, std::optional< std::chrono::milliseconds > timeout=std::nullopt) |
static bool | adb_root (const char *command) |
int | send_shell_command (const std::string &command, bool disable_shell_protocol, StandardStreamsCallbackInterface *callback) |
static int | logcat (int argc, const char **argv) |
static void | write_zeros (int bytes, borrowed_fd fd) |
static int | backup (int argc, const char **argv) |
static int | restore (int argc, const char **argv) |
static CompressionType | parse_compression_type (const std::string &str, bool allow_numbers) |
static void | parse_push_pull_args (const char **arg, int narg, std::vector< const char * > *srcs, const char **dst, bool *copy_attrs, bool *sync, bool *quiet, CompressionType *compression, bool *dry_run) |
static int | adb_connect_command (const std::string &command, TransportId *transport, StandardStreamsCallbackInterface *callback) |
static int | adb_connect_command (const std::string &command, TransportId *transport=nullptr) |
static int | adb_connect_command_bidirectional (const std::string &command) |
const std::optional< FeatureSet > & | adb_get_feature_set_or_die (void) |
static int | process_remount_or_verity_service (const int argc, const char **argv) |
static int | adb_query_command (const std::string &command) |
static bool | _is_valid_ack_reply_fd (const int ack_reply_fd) |
static bool | _is_valid_os_fd (int fd) |
bool | forward_dest_is_featured (const std::string &dest, std::string *error) |
int | adb_commandline (int argc, const char **argv) |
Variables | |
DefaultStandardStreamsCallback | DEFAULT_STANDARD_STREAMS_CALLBACK (nullptr, nullptr) |
static constexpr int | kDefaultServerPort = 5037 |
static termios | g_saved_terminal_state |
#define SIDELOAD_HOST_BLOCK_SIZE (CHUNK_SIZE) |
#define TRACE_TAG ADB |
|
static |
|
static |
|
static |
int adb_commandline | ( | int | argc, |
const char ** | argv | ||
) |
|
static |
|
static |
|
static |
const std::optional< FeatureSet > & adb_get_feature_set_or_die | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
bool copy_to_file | ( | int | inFd, |
int | outFd | ||
) |
bool forward_dest_is_featured | ( | const std::string & | dest, |
std::string * | error | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
int read_and_dump | ( | borrowed_fd | fd, |
bool | use_shell_protocol, | ||
StandardStreamsCallbackInterface * | callback | ||
) |
int read_and_dump_protocol | ( | borrowed_fd | fd, |
StandardStreamsCallbackInterface * | callback | ||
) |
|
static |
|
static |
int send_shell_command | ( | const std::string & | command, |
bool | disable_shell_protocol, | ||
StandardStreamsCallbackInterface * | callback | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
DefaultStandardStreamsCallback DEFAULT_STANDARD_STREAMS_CALLBACK(nullptr, nullptr) | ( | nullptr | , |
nullptr | |||
) |
|
static |
|
staticconstexpr |