windows下编译adb源码


可在Windows下编译的源代码,用VS2010编译
资源截图
代码片段和文件信息
/*
 * Copyright (C) 2007 The Android Open Source Project
 *
 * Licensed under the Apache License Version 2.0 (the “License“);
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing software
 * distributed under the License is distributed on an “AS IS“ BASIS
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#define  TRACE_TAG   TRACE_ADB

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
//#include 

#include “sysdeps.h“
#include “adb.h“
#include “adb_auth.h“

#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))

#if !ADB_HOST
#include 
#include 
#include 
#include 
#else
#include “usb_vendors.h“
#endif
#include 

#if ADB_TRACE
ADB_MUTEX_DEFINE( D_lock );
#endif

int HOST = 0;

static int auth_enabled = 0;

#if !ADB_HOST
static const char *adb_device_banner = “device“;
#endif

void fatal(const char *fmt ...)
{
    va_list ap;
    va_start(ap fmt);
    fprintf(stderr “error: “);
    vfprintf(stderr fmt ap);
    fprintf(stderr “
“);
    va_end(ap);
    exit(-1);
}

void fatal_errno(const char *fmt ...)
{
    va_list ap;
    va_start(ap fmt);
    fprintf(stderr “error: %s: “ strerror(errno));
    vfprintf(stderr fmt ap);
    fprintf(stderr “
“);
    va_end(ap);
    exit(-1);
}

int   adb_trace_mask;

/* read a comma/space/colum/semi-column separated list of tags
 * from the ADB_TRACE environment variable and build the trace
 * mask from it. note that ‘1‘ and ‘all‘ are special cases to
 * enable all tracing
 */
void  adb_trace_init(void)
{
    const char*  p = getenv(“ADB_TRACE“);
    const char*  q;

    static const struct {
        const char*  tag;
        int           flag;
    } tags[] = {
        { “1“ 0 }
        { “all“ 0 }
        { “adb“ TRACE_ADB }
        { “sockets“ TRACE_SOCKETS }
        { “packets“ TRACE_PACKETS }
        { “rwx“ TRACE_RWX }
        { “usb“ TRACE_USB }
        { “sync“ TRACE_SYNC }
        { “sysdeps“ TRACE_SYSDEPS }
        { “transport“ TRACE_TRANSPORT }
        { “jdwp“ TRACE_JDWP }
        { “services“ TRACE_SERVICES }
        { “auth“ TRACE_AUTH }
        { NULL 0 }
    };

    if (p == NULL)
            return;

    /* use a comma/column/semi-colum/space separated list */
    while (*p) {
        int  len tagn;

        q = strpbrk(p “ :;“);
        if (q == NULL) {
            q = p + strlen(p);
        }
        len = q - p;

        for (tagn = 0; tags[tagn].tag != NULL; tagn++)
        {
            int  taglen = strlen(tags[tagn].tag);

            

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-01-26 15:13  adb-source
     目录           0  2014-01-26 15:13  adb-sourceadb
     文件       44302  2014-01-26 15:11  adb-sourceadbadb.cpp
     文件       14674  2013-03-26 16:07  adb-sourceadbadb.h
     文件       31744  2014-01-26 14:42  adb-sourceadbadb.suo
     文件        8160  2013-09-12 19:46  adb-sourceadbadb.vcxproj
     文件        3767  2013-09-01 21:17  adb-sourceadbadb.vcxproj.filters
     文件         453  2013-09-13 17:51  adb-sourceadbadb.vcxproj.user
     文件        1940  2013-03-26 16:07  adb-sourceadbadb_auth.h
     文件        5387  2013-03-26 16:07  adb-sourceadbadb_auth_client.c
     文件        9525  2014-01-26 14:54  adb-sourceadbadb_auth_host.cpp
     文件        8022  2014-01-26 14:54  adb-sourceadbadb_client.cpp
     文件        1601  2013-03-26 16:07  adb-sourceadbadb_client.h
     文件        3890  2013-03-26 16:07  adb-sourceadbAndroid.mk
     文件        4608  2013-03-26 16:07  adb-sourceadbackup_service.c
     文件        7604  2013-09-01 21:27  adb-sourceadbcentraldir.cpp
     文件       47835  2014-01-26 14:56  adb-sourceadbcommandline.cpp
     文件        1009  2013-03-26 16:07  adb-sourceadbconsole.cpp
     文件       17778  2013-03-26 16:07  adb-sourceadbfdevent.c
     文件        2184  2013-03-26 16:07  adb-sourceadbfdevent.h
     文件       26440  2014-01-26 15:12  adb-sourceadbfile_sync_client.cpp
     文件        9248  2013-03-26 16:07  adb-sourceadbfile_sync_service.c
     文件        2425  2013-03-26 16:07  adb-sourceadbfile_sync_service.h
     文件        5217  2013-03-26 16:07  adb-sourceadbframebuffer_service.c
     文件        1036  2013-03-26 16:07  adb-sourceadbget_my_path_darwin.c
     文件        1015  2013-03-26 16:07  adb-sourceadbget_my_path_freebsd.c
     文件         962  2013-03-26 16:07  adb-sourceadbget_my_path_linux.c
     文件         985  2014-01-26 15:00  adb-sourceadbget_my_path_windows.cpp
     文件       20165  2013-03-26 16:07  adb-sourceadbjdwp_service.c
     文件        1024  2013-07-31 02:57  adb-sourceadblist.cpp
     文件        2445  2013-03-26 16:07  adb-sourceadblog_service.c
............此处省略170个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)