• 大小: 340KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-05-14
  • 语言: Java
  • 标签: 开源项目  

资源简介

fb-adb 是一个用于 Android 设备上的界面工具,用于与 Android 系统的交互。它与 Android adb 之间存在很多的相同点,但是 fb-adb 能够更好的支持远程;且 Bug 更少。 fb-adb 与 Android adb 之间的差异如下: is binary clean (no LF -> CRLF mangling) transmits and updates window size distinguishes standard output and standard error properly muxes streams with independent flow control allows for ssh-like pty allocation control propagates program exit status instead of always exiting with status 0 properly escapes program arguments kills remote program provides a generic facility to elevate to root without re-escaping


标签:fbadb





分享












window._bd_share_config = {
"common": {
"bdSnsKey": {},
"bdText": "",
"bdMini": "2",
"bdMiniList": [],
"bdPic": "",
"bdStyle": "1",
"bdSize": "24"
}, "share": {}
};
with (document)0[(getElementsByTagName('head')[0] || bod

资源截图

代码片段和文件信息

/*
 *  Copyright (c) 2014 Facebook Inc.
 *  All rights reserved.
 *
 *  This source code is licensed under the BSD-style license found in
 *  the LICENSE file in the root directory of this source tree. An
 *  additional grant of patent rights can be found in the PATENTS file
 *  in the same directory.
 *
 */
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include “adb.h“
#include “child.h“
#include “util.h“
#include “argv.h“
#include “strutil.h“
#include “fs.h“

struct adb_communication {
    char* output;
    int status;
};

static struct adb_communication
run_adb(const char* const* adb_args
        const char* args[])
{
    struct child_start_info csi = {
        .io[STDIN_FILENO] = CHILD_IO_DEV_NULL
        .io[STDOUT_FILENO] = CHILD_IO_PIPE
        .io[STDERR_FILENO] = CHILD_IO_DUP_TO_STDOUT
        .exename = “adb“
        .argv = ARGV_CONCAT(ARGV(“adb“)
                            adb_args ?: empty_argv
                            args ?: empty_argv)
    };

    struct child* adb = child_start(&csi);
    return (struct adb_communication) {
        .output = massage_output_buf(slurp_fd_buf(adb->fd[1]->fd))
        .status = child_wait(adb)
    };
}

void
adb_send_file(const char* local
              const char* remote
              const char* const* adb_args)
{
    SCOPED_RESLIST(rl);

    struct adb_communication com =
        run_adb(adb_args ARGV(“push“ local remote));

    if (!child_status_success_p(com.status))
        die(ECOMM “adb error: %s“ com.output);
}

void
adb_rename_file(const char* old_name
                const char* new_name
                unsigned api_level
                unsigned rename_flags
                const char* const* adb_args)
{
    SCOPED_RESLIST(rl);

    if (!shell_safe_word_p(old_name))
        die(EINVAL “invalid shell word: [%s]“ old_name);

    if (!shell_safe_word_p(new_name))
        die(EINVAL “invalid shell word: [%s]“ new_name);

    // Old versions of Android don‘t support mv -f but treat stdin of
    // /dev/null as a clue to not prompt on overwrite.  Google somehow
    // managed to screw up mv(1) in API 23 and above so that the
    //     // prompt --- instead it makes mv delete(!) the source file.
    // Let‘s just make the move version-dependent.  Split on version
    // 19 because that version does support mv -f and we want to
    // catch all possible breakage.

    struct adb_communication com =
        run_adb(adb_args
                api_level > 19
                ? ARGV(“shell“
                       “mv“
                       “-f“
                       old_name
                       new_name
                       “&&“
                       “echo“
                       “yes“)
                : ARGV(“shell“
                       “                       “mv

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-06-03 19:14  fb-adb-master\
     文件         161  2019-06-03 19:14  fb-adb-master\.gitignore
     文件       16846  2019-06-03 19:14  fb-adb-master\Agent.java
     文件         520  2019-06-03 19:14  fb-adb-master\AgentFakeContext.java
     文件         241  2019-06-03 19:14  fb-adb-master\CODE_OF_CONDUCT.md
     文件        1248  2019-06-03 19:14  fb-adb-master\CONTRIBUTING.md
     文件        1519  2019-06-03 19:14  fb-adb-master\LICENSE
     文件        3460  2019-06-03 19:14  fb-adb-master\Makefile.am
     文件        4009  2019-06-03 19:14  fb-adb-master\Makefile.am.fb-adb
     文件        1548  2019-06-03 19:14  fb-adb-master\Makefile.am.stub
     文件         732  2019-06-03 19:14  fb-adb-master\Makefile.binary-releases
     文件        3835  2019-06-03 19:14  fb-adb-master\NEWS
     文件        1981  2019-06-03 19:14  fb-adb-master\PATENTS
     文件          86  2019-06-03 19:14  fb-adb-master\README.lz4
     文件        2311  2019-06-03 19:14  fb-adb-master\README.md
     文件        6782  2019-06-03 19:14  fb-adb-master\adb.c
     文件        1553  2019-06-03 19:14  fb-adb-master\adb.h
     文件        3705  2019-06-03 19:14  fb-adb-master\adbenc.c
     文件         825  2019-06-03 19:14  fb-adb-master\adbenc.h
     文件         463  2019-06-03 19:14  fb-adb-master\agent.h
     文件         747  2019-06-03 19:14  fb-adb-master\androidmsg.c
     文件         609  2019-06-03 19:14  fb-adb-master\androidmsg.h
     文件        5826  2019-06-03 19:14  fb-adb-master\ar-lib
     文件        5352  2019-06-03 19:14  fb-adb-master\argv.c
     文件        1397  2019-06-03 19:14  fb-adb-master\argv.h
     文件        9970  2019-06-03 19:14  fb-adb-master\arpy.py
     文件         321  2019-06-03 19:14  fb-adb-master\autogen.sh
     文件        9984  2019-06-03 19:14  fb-adb-master\channel.c
     文件        1460  2019-06-03 19:14  fb-adb-master\channel.h
     文件        5018  2019-06-03 19:14  fb-adb-master\chat.c
     文件         676  2019-06-03 19:14  fb-adb-master\chat.h
............此处省略105个文件信息

评论

共有 条评论