1 /* 2 * Copyright (C) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef SANDBOX_SHARED_H 17 #define SANDBOX_SHARED_H 18 19 #include "appspawn.h" 20 #include "appspawn_hook.h" 21 #include "appspawn_manager.h" 22 #include "appspawn_utils.h" 23 #include "json_utils.h" 24 #include "list.h" 25 26 #ifdef __cplusplus 27 extern "C" { 28 #endif 29 30 enum { 31 EL2 = 0, 32 EL3, 33 EL4, 34 EL5, 35 ELX_MAX 36 }; 37 38 typedef struct DataGroupSandboxPathTemplate { 39 const char *elxName; 40 uint32_t category; 41 const char *sandboxPath; 42 const char *permission; 43 } DataGroupSandboxPathTemplate; 44 45 /** 46 * @brief DataGroup expand info 47 */ 48 bool IsValidDataGroupItem(cJSON *item); 49 int GetElxInfoFromDir(const char *path); 50 const DataGroupSandboxPathTemplate *GetDataGroupArgTemplate(uint32_t category); 51 52 /** 53 * @brief Mount the dirs as shared before device unlocking 54 */ 55 int MountDirsToShared(AppSpawnMgr *content, SandboxContext *context, AppSpawnSandboxCfg *sandbox); 56 57 #ifdef __cplusplus 58 } 59 #endif 60 #endif // SANDBOX_SHARED_H 61