#强制修改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);
Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐