91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 296KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-12
  • 語言: Java
  • 標簽: adb??push??中文??android??

資源簡介

搞android開發(fā)的童鞋都知道,有時需要上傳文件到SD卡中,但是苦于中文的不好對付(利用數(shù)據(jù)線,開啟SD卡除外),這時用ADB PUSH相當方便,但是就是不支持中文(GBK),現(xiàn)在上傳一個重寫過的ADB工具,可以自動進行轉(zhuǎn)碼,以后push中文文件再也不用煩惱了

資源截圖

代碼片段和文件信息

/*
?*?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.
?*/

#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?

#include?“sysdeps.h“
#include?“adb.h“
#include?“adb_client.h“
#include?“file_sync_service.h“

#ifdef?USE_MINGW
#include
#endif

static?unsigned?total_bytes;
static?long?long?start_time;

static?long?long?NOW()
{
????struct?timeval?tv;
????gettimeofday(&tv?0);
????return?((long?long)?tv.tv_usec)?+
????????1000000LL?*?((long?long)?tv.tv_sec);
}

static?void?BEGIN()
{
????total_bytes?=?0;
????start_time?=?NOW();
}

static?void?END()
{
????long?long?t?=?NOW()?-?start_time;
????if(total_bytes?==?0)?return;

????if?(t?==?0)??/*?prevent?division?by?0?:-)?*/
????????t?=?1000000;

????fprintf(stderr“%lld?KB/s?(%lld?bytes?in?%lld.%03llds)\n“
????????????((((long?long)?total_bytes)?*?1000000LL)?/?t)?/?1024LL
????????????(long?long)?total_bytes?(t?/?1000000LL)?(t?%?1000000LL)?/?1000LL);
}

void?sync_quit(int?fd)
{
????syncmsg?msg;

????msg.req.id?=?ID_QUIT;
????msg.req.namelen?=?0;

????writex(fd?&msg.req?sizeof(msg.req));
}

typedef?void?(*sync_ls_cb)(unsigned?mode?unsigned?size?unsigned?time?const?char?*name?void?*cookie);

int?sync_ls(int?fd?const?char?*path?sync_ls_cb?func?void?*cookie)
{
????syncmsg?msg;
????char?buf[257];
????int?len;

????len?=?strlen(path);
????if(len?>?1024)?goto?fail;

????msg.req.id?=?ID_LIST;
????msg.req.namelen?=?htoll(len);

????if(writex(fd?&msg.req?sizeof(msg.req))?||
???????writex(fd?path?len))?{
????????goto?fail;
????}

????for(;;)?{
????????if(readx(fd?&msg.dent?sizeof(msg.dent)))?break;
????????if(msg.dent.id?==?ID_DONE)?return?0;
????????if(msg.dent.id?!=?ID_DENT)?break;

????????len?=?ltohl(msg.dent.namelen);
????????if(len?>?256)?break;

????????if(readx(fd?buf?len))?break;
????????buf[len]?=?0;

????????func(ltohl(msg.dent.mode)
?????????????ltohl(msg.dent.size)
?????????????ltohl(msg.dent.time)
?????????????buf?cookie);
????}

fail:
????adb_close(fd);
????return?-1;
}

typedef?struct?syncsendbuf?syncsendbuf;

struct?syncsendbuf?{
????unsigned?id;
????unsigned?size;
????char?data[SYNC_DATA_MAX];
};

static?syncsendbuf?send_buffer;

int?sync_readtime(int?fd?const?char?*path?unsigned?*timestamp)
{
????syncmsg?msg;
????int?len?=?strlen(path);

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件?????589639??2012-10-22?19:59??adb_zh\adb.exe

?????文件??????96256??2012-10-22?11:33??adb_zh\AdbWinApi.dll

?????文件??????60928??2012-10-22?11:33??adb_zh\AdbWinUsbApi.dll

?????文件??????28515??2012-11-12?20:12??adb_zh\file_sync_client.c

?????目錄??????????0??2013-08-05?15:49??adb_zh

-----------?---------??----------?-----??----

???????????????775338????????????????????5


評論

共有 條評論