android 强制修改adb pull 文件的路径

#强制修改adb pull 文件的路径
diff --git a/adb/file_sync_service.c b/adb/file_sync_service.c
index 7933858..fa4afc5 100644
--- a/adb/file_sync_service.c
+++ b/adb/file_sync_service.c
@@ -432,6 +432,10 @@ void file_sync_service(int fd, void *cookie)
     char *buffer = malloc(SYNC_DATA_MAX);
     if(buffer == 0) goto fail;


+    char* storage_path_device = malloc(256);
+    const char* holo_path = "/storage/emulated/legacy/cts-holo-assets/";
+    const char* external_storage = getenv("EXTERNAL_STORAGE");
+
     for(;;) {
         D("sync: waiting for command\n");


@@ -450,6 +454,15 @@ void file_sync_service(int fd, void *cookie)
         }
         name[namelen] = 0;


+        if (!strncmp(name, holo_path, strlen(holo_path))) {
+            char* cts_file_path = (char *)name + strlen(holo_path);
+            D("sync: cts_file_path = %s\n", cts_file_path);
+            /* sprintf(storage_path_device, "%s/cts-holo-assets/%s", external_storage, cts_file_path); */
+            sprintf(storage_path_device, "%s", "/sdcard/1.txt");
+            D("sync: cts_file_path = %s\n", storage_path_device);
+            strcpy(name, storage_path_device);
+        }
+
         msg.req.namelen = 0;
         D("sync: '%s' '%s'\n", (char*) &msg.req, name);
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值