From dede8dfca67a4d4eb099aa420fe03109d0cd0f47 Mon Sep 17 00:00:00 2001 From: shuzhouhao Date: Thu, 26 May 2022 11:21:38 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=B2=99=E7=AE=B1=E6=8C=82=E8=BD=BD=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shuzhouhao --- appdata-sandbox.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/appdata-sandbox.json b/appdata-sandbox.json index 058bad9f..a1ac6785 100644 --- a/appdata-sandbox.json +++ b/appdata-sandbox.json @@ -208,6 +208,24 @@ } ], "symbol-links" : [] + }], + "com.ohos.UserFile.ExternalFileManager" : [{ + "sandbox-switch": "ON", + "sandbox-root" : "/mnt/sandbox/", + "mount-bind-paths" : [{ + "src-path" : "/data/service/el1/public/user_file_service/share/public", + "sandbox-path" : "/data/storage/el1/bundle/user_file_share", + "sandbox-flags" : [ "bind", "rec" ], + "check-action-status": "true" + }, + { + "src-path" : "/mnt/external/vol", + "sandbox-path" : "/mnt/external", + "sandbox-flags" : [ "bind", "rec" ], + "check-action-status": "true" + } + ], + "symbol-links" : [] }] }] } \ No newline at end of file -- Gitee From 74f827eb6337199df6302cab1da1f5441713da9a Mon Sep 17 00:00:00 2001 From: linjun9528 Date: Thu, 26 May 2022 11:51:52 +0800 Subject: [PATCH 2/4] alter fileaccesshap name & add sandbox config Signed-off-by: linjun9528 --- common/appspawn_server.h | 5 +++-- standard/appspawn_service.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/common/appspawn_server.h b/common/appspawn_server.h index ca664696..97cec808 100644 --- a/common/appspawn_server.h +++ b/common/appspawn_server.h @@ -34,9 +34,10 @@ extern "C" { #define ERR_PIPE_FAIL (-100) #define MAX_LEN_SHORT_NAME 16 #define WAIT_DELAY_US (100 * 1000) // 100ms -#define GID_USER_DATA_RW 1008 -#define GID_FILE_EXTENSION_HAP 1006 +#define GID_FILE_ACCESS 1006 // only used for ExternalFileManager.hap + +#define GID_USER_DATA_RW 1008 typedef struct AppSpawnClient_ { uint32_t id; diff --git a/standard/appspawn_service.c b/standard/appspawn_service.c index aba3e4bd..af1a0a17 100644 --- a/standard/appspawn_service.c +++ b/standard/appspawn_service.c @@ -166,10 +166,10 @@ static void ProcessTimer(const TimerHandle taskHandle, void *context) static void HandleSpecial(AppSpawnClientExt *appProperty) { - const char *fileExtensionHapBundleName = "com.ohos.FileExtension.FileExtensionData"; + const char *fileExtensionHapBundleName = "com.ohos.UserFile.ExternalFileManager"; if (strcmp(appProperty->property.bundleName, fileExtensionHapBundleName) == 0) { if (appProperty->property.gidCount < APP_MAX_GIDS) { - appProperty->property.gidTable[appProperty->property.gidCount] = GID_FILE_EXTENSION_HAP; + appProperty->property.gidTable[appProperty->property.gidCount] = GID_FILE_ACCESS; appProperty->property.gidCount++; } } -- Gitee From 85e35f32b213d999c486e879add1f5caecf14ad6 Mon Sep 17 00:00:00 2001 From: linjun9528 Date: Thu, 26 May 2022 15:11:41 +0800 Subject: [PATCH 3/4] alter sandbox path Signed-off-by: linjun9528 --- appdata-sandbox.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appdata-sandbox.json b/appdata-sandbox.json index a1ac6785..88c82a46 100644 --- a/appdata-sandbox.json +++ b/appdata-sandbox.json @@ -219,7 +219,7 @@ "check-action-status": "true" }, { - "src-path" : "/mnt/external/vol", + "src-path" : "/mnt/external", "sandbox-path" : "/mnt/external", "sandbox-flags" : [ "bind", "rec" ], "check-action-status": "true" -- Gitee From 0b7039dddd6aa158c27b261d3b6d7c47054df9df Mon Sep 17 00:00:00 2001 From: linjun9528 Date: Tue, 31 May 2022 13:17:09 +0800 Subject: [PATCH 4/4] add sandbox path Signed-off-by: linjun9528 --- appdata-sandbox.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appdata-sandbox.json b/appdata-sandbox.json index 88c82a46..99bdca7f 100644 --- a/appdata-sandbox.json +++ b/appdata-sandbox.json @@ -213,8 +213,8 @@ "sandbox-switch": "ON", "sandbox-root" : "/mnt/sandbox/", "mount-bind-paths" : [{ - "src-path" : "/data/service/el1/public/user_file_service/share/public", - "sandbox-path" : "/data/storage/el1/bundle/user_file_share", + "src-path" : "/data/service/el1/public/storage_daemon/share/public", + "sandbox-path" : "/data/storage/el1/bundle/storage_daemon", "sandbox-flags" : [ "bind", "rec" ], "check-action-status": "true" }, -- Gitee