Loading adb/commandline.c +12 −2 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ void help() " adb push <local> <remote> - copy file/dir to device\n" " adb pull <remote> [<local>] - copy file/dir from device\n" " adb sync [ <directory> ] - copy host->device only if changed\n" " (-l means list but don't copy)\n" " (see 'adb help all')\n" " adb shell - run remote shell interactively\n" " adb shell <command> - run remote shell command\n" Loading Loading @@ -1041,10 +1042,19 @@ top: if(!strcmp(argv[0], "sync")) { char *srcarg, *android_srcpath, *data_srcpath; int listonly = 0; int ret; if(argc < 2) { /* No local path was specified. */ srcarg = NULL; } else if (argc >= 2 && strcmp(argv[1], "-l") == 0) { listonly = 1; if (argc == 3) { srcarg = argv[2]; } else { srcarg = NULL; } } else if(argc == 2) { /* A local path or "android"/"data" arg was specified. */ srcarg = argv[1]; Loading @@ -1055,9 +1065,9 @@ top: if(ret != 0) return usage(); if(android_srcpath != NULL) ret = do_sync_sync(android_srcpath, "/system"); ret = do_sync_sync(android_srcpath, "/system", listonly); if(ret == 0 && data_srcpath != NULL) ret = do_sync_sync(data_srcpath, "/data"); ret = do_sync_sync(data_srcpath, "/data", listonly); free(android_srcpath); free(data_srcpath); Loading adb/file_sync_client.c +7 −6 Original line number Diff line number Diff line Loading @@ -670,7 +670,7 @@ static int local_build_list(copyinfo **filelist, } static int copy_local_dir_remote(int fd, const char *lpath, const char *rpath, int checktimestamps) static int copy_local_dir_remote(int fd, const char *lpath, const char *rpath, int checktimestamps, int listonly) { copyinfo *filelist = 0; copyinfo *ci, *next; Loading Loading @@ -718,8 +718,9 @@ static int copy_local_dir_remote(int fd, const char *lpath, const char *rpath, i for(ci = filelist; ci != 0; ci = next) { next = ci->next; if(ci->flag == 0) { fprintf(stderr,"push: %s -> %s\n", ci->src, ci->dst); if(sync_send(fd, ci->src, ci->dst, ci->time, ci->mode, 0 /* no verify APK */)){ fprintf(stderr,"%spush: %s -> %s\n", listonly ? "would " : "", ci->src, ci->dst); if(!listonly && sync_send(fd, ci->src, ci->dst, ci->time, ci->mode, 0 /* no verify APK */)){ return 1; } pushed++; Loading Loading @@ -757,7 +758,7 @@ int do_sync_push(const char *lpath, const char *rpath, int verifyApk) if(S_ISDIR(st.st_mode)) { BEGIN(); if(copy_local_dir_remote(fd, lpath, rpath, 0)) { if(copy_local_dir_remote(fd, lpath, rpath, 0, 0)) { return 1; } else { END(); Loading Loading @@ -1001,7 +1002,7 @@ int do_sync_pull(const char *rpath, const char *lpath) } } int do_sync_sync(const char *lpath, const char *rpath) int do_sync_sync(const char *lpath, const char *rpath, int listonly) { fprintf(stderr,"syncing %s...\n",rpath); Loading @@ -1012,7 +1013,7 @@ int do_sync_sync(const char *lpath, const char *rpath) } BEGIN(); if(copy_local_dir_remote(fd, lpath, rpath, 1)){ if(copy_local_dir_remote(fd, lpath, rpath, 1, listonly)){ return 1; } else { END(); Loading adb/file_sync_service.h +1 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ typedef union { void file_sync_service(int fd, void *cookie); int do_sync_ls(const char *path); int do_sync_push(const char *lpath, const char *rpath, int verifyApk); int do_sync_sync(const char *lpath, const char *rpath); int do_sync_sync(const char *lpath, const char *rpath, int listonly); int do_sync_pull(const char *rpath, const char *lpath); #define SYNC_DATA_MAX (64*1024) Loading Loading
adb/commandline.c +12 −2 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ void help() " adb push <local> <remote> - copy file/dir to device\n" " adb pull <remote> [<local>] - copy file/dir from device\n" " adb sync [ <directory> ] - copy host->device only if changed\n" " (-l means list but don't copy)\n" " (see 'adb help all')\n" " adb shell - run remote shell interactively\n" " adb shell <command> - run remote shell command\n" Loading Loading @@ -1041,10 +1042,19 @@ top: if(!strcmp(argv[0], "sync")) { char *srcarg, *android_srcpath, *data_srcpath; int listonly = 0; int ret; if(argc < 2) { /* No local path was specified. */ srcarg = NULL; } else if (argc >= 2 && strcmp(argv[1], "-l") == 0) { listonly = 1; if (argc == 3) { srcarg = argv[2]; } else { srcarg = NULL; } } else if(argc == 2) { /* A local path or "android"/"data" arg was specified. */ srcarg = argv[1]; Loading @@ -1055,9 +1065,9 @@ top: if(ret != 0) return usage(); if(android_srcpath != NULL) ret = do_sync_sync(android_srcpath, "/system"); ret = do_sync_sync(android_srcpath, "/system", listonly); if(ret == 0 && data_srcpath != NULL) ret = do_sync_sync(data_srcpath, "/data"); ret = do_sync_sync(data_srcpath, "/data", listonly); free(android_srcpath); free(data_srcpath); Loading
adb/file_sync_client.c +7 −6 Original line number Diff line number Diff line Loading @@ -670,7 +670,7 @@ static int local_build_list(copyinfo **filelist, } static int copy_local_dir_remote(int fd, const char *lpath, const char *rpath, int checktimestamps) static int copy_local_dir_remote(int fd, const char *lpath, const char *rpath, int checktimestamps, int listonly) { copyinfo *filelist = 0; copyinfo *ci, *next; Loading Loading @@ -718,8 +718,9 @@ static int copy_local_dir_remote(int fd, const char *lpath, const char *rpath, i for(ci = filelist; ci != 0; ci = next) { next = ci->next; if(ci->flag == 0) { fprintf(stderr,"push: %s -> %s\n", ci->src, ci->dst); if(sync_send(fd, ci->src, ci->dst, ci->time, ci->mode, 0 /* no verify APK */)){ fprintf(stderr,"%spush: %s -> %s\n", listonly ? "would " : "", ci->src, ci->dst); if(!listonly && sync_send(fd, ci->src, ci->dst, ci->time, ci->mode, 0 /* no verify APK */)){ return 1; } pushed++; Loading Loading @@ -757,7 +758,7 @@ int do_sync_push(const char *lpath, const char *rpath, int verifyApk) if(S_ISDIR(st.st_mode)) { BEGIN(); if(copy_local_dir_remote(fd, lpath, rpath, 0)) { if(copy_local_dir_remote(fd, lpath, rpath, 0, 0)) { return 1; } else { END(); Loading Loading @@ -1001,7 +1002,7 @@ int do_sync_pull(const char *rpath, const char *lpath) } } int do_sync_sync(const char *lpath, const char *rpath) int do_sync_sync(const char *lpath, const char *rpath, int listonly) { fprintf(stderr,"syncing %s...\n",rpath); Loading @@ -1012,7 +1013,7 @@ int do_sync_sync(const char *lpath, const char *rpath) } BEGIN(); if(copy_local_dir_remote(fd, lpath, rpath, 1)){ if(copy_local_dir_remote(fd, lpath, rpath, 1, listonly)){ return 1; } else { END(); Loading
adb/file_sync_service.h +1 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ typedef union { void file_sync_service(int fd, void *cookie); int do_sync_ls(const char *path); int do_sync_push(const char *lpath, const char *rpath, int verifyApk); int do_sync_sync(const char *lpath, const char *rpath); int do_sync_sync(const char *lpath, const char *rpath, int listonly); int do_sync_pull(const char *rpath, const char *lpath); #define SYNC_DATA_MAX (64*1024) Loading