diff --git a/frameworks/ets/ani/BUILD.gn b/frameworks/ets/ani/BUILD.gn index c1c6b1870d8287317a6d1e48710c392525c89064..c8544b5cd9c2f649e9981eca1a2e28d72f618a12 100644 --- a/frameworks/ets/ani/BUILD.gn +++ b/frameworks/ets/ani/BUILD.gn @@ -17,5 +17,6 @@ import("//foundation/ability/ability_runtime/ability_runtime.gni") group("ani_packages") { deps = [ "${ability_runtime_path}/frameworks/ets/ani/ani_common:ani_common", + "${ability_runtime_path}/frameworks/ets/ani/uri_permission_manager:uri_permission_manager_ani_kit", ] } diff --git a/frameworks/ets/ani/uri_permission_manager/BUILD.gn b/frameworks/ets/ani/uri_permission_manager/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..db4c22e2905d6954536192eaa98a7d9547744a97 --- /dev/null +++ b/frameworks/ets/ani/uri_permission_manager/BUILD.gn @@ -0,0 +1,85 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/config/components/ets_frontend/ets2abc_config.gni") +import("//build/ohos.gni") +import("//foundation/ability/ability_runtime/ability_runtime.gni") + +ohos_shared_library("uri_permission_manager_ani_kit") { + branch_protector_ret = "pac_ret" + sanitize = { + cfi = true + cfi_cross_dso = true + cfi_vcall_icall_only = true + debug = false + } + + include_dirs = [ + "./include", + "${ability_runtime_path}/frameworks/ets/ani/enum_convert", + "${ability_runtime_path}/frameworks/js/napi/uri_permission", + "${ability_runtime_path}/interfaces/kits/native/ability/native", + "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/app", + "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context", + "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/ability_delegator/include", + "${ability_runtime_services_path}/common/include", + ] + configs = [] + + public_configs = [] + + sources = [ "./src/sts_uri_perm_mgr.cpp" ] + + cflags = [] + if (target_cpu == "arm") { + cflags += [ "-DBINDER_IPC_32BIT" ] + } + + deps = [ + "${ability_runtime_innerkits_path}/ability_manager:ability_manager", + "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", + "${ability_runtime_innerkits_path}/error_utils:ability_runtime_error_util", + "${ability_runtime_innerkits_path}/runtime:runtime", + "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", + "${ability_runtime_path}/frameworks/ets/ani/ani_common:ani_common", + "${ability_runtime_napi_path}/inner/napi_common:napi_common", + "${ability_runtime_native_path}/ability/native:abilitykit_native", + "${ability_runtime_native_path}/ability/native:ability_business_error", + "${ability_runtime_native_path}/appkit:app_context", + "${ability_runtime_native_path}/appkit:appkit_delegator", + "${ability_runtime_native_path}/appkit:delegator_mgmt", + ] + + external_deps = [ + "ability_base:want", + "ability_base:zuri", + "access_token:libtokenid_sdk", + "bundle_framework:appexecfwk_base", + "c_utils:utils", + "common_event_service:cesfwk_innerkits", + "eventhandler:libeventhandler", + "hilog:libhilog", + "init:libbegetutil", + "ipc:ipc_core", + "ipc:ipc_napi", + "json:nlohmann_json_static", + "napi:ace_napi", + "runtime_core:ani", + ] + + public_external_deps = [ "ability_base:configuration" ] + + innerapi_tags = [ "platformsdk" ] + subsystem_name = "ability" + part_name = "ability_runtime" +} \ No newline at end of file diff --git a/frameworks/ets/ani/uri_permission_manager/include/sts_uri_perm_mgr.h b/frameworks/ets/ani/uri_permission_manager/include/sts_uri_perm_mgr.h new file mode 100644 index 0000000000000000000000000000000000000000..0972a72bb5a4b47f34cda5951885d4ce9f1cc8db --- /dev/null +++ b/frameworks/ets/ani/uri_permission_manager/include/sts_uri_perm_mgr.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_ABILITY_RUNTIME_STS_URI_PERM_MGR_H +#define OHOS_ABILITY_RUNTIME_STS_URI_PERM_MGR_H + +#include "sts_runtime.h" + +namespace OHOS { +namespace AbilityRuntime { +static void grantUriPermissionCallbackSync([[maybe_unused]]ani_env *env, + ani_string uri, ani_enum_item flagEnum, ani_string targetName, ani_double appCloneIndex, ani_object callback); +static void revokeUriPermissionCallbackSync([[maybe_unused]]ani_env *env, + ani_string uri, ani_string targetName, ani_double appCloneIndex, ani_object callback); +void CreateJsUriPermMgr(ani_env *env); +bool AsyncCallback(ani_env *env, ani_object call, ani_object error, ani_object result); +ani_object WrapBusinessError(ani_env *env, ani_int code); +ani_object WrapError(ani_env *env, const std::string &msg); +ani_string GetAniString(ani_env *env, const std::string &str); +ani_object createDouble(ani_env *env, int32_t res); +std::string GetErrMsg(int32_t err, const std::string &permission = ""); +} // namespace AbilityRuntime +} // namespace OHOS +#endif // OHOS_ABILITY_RUNTIME_STS_URI_PERM_MGR_H \ No newline at end of file diff --git a/frameworks/ets/ani/uri_permission_manager/src/sts_uri_perm_mgr.cpp b/frameworks/ets/ani/uri_permission_manager/src/sts_uri_perm_mgr.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a0e850698d08a30cc95cf7b500de7e6751115092 --- /dev/null +++ b/frameworks/ets/ani/uri_permission_manager/src/sts_uri_perm_mgr.cpp @@ -0,0 +1,298 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "sts_uri_perm_mgr.h" + +#include "ability_business_error.h" +#include "ability_manager_errors.h" +#include "ability_runtime_error_util.h" +#include "ani_enum_convert.h" +#include "hilog_tag_wrapper.h" +#include "ipc_skeleton.h" +#include "js_error_utils.h" +#include "js_runtime_utils.h" +#include "napi_common_util.h" +#include "parameters.h" +#include "tokenid_kit.h" +#include "uri.h" +#include "uri_permission_manager_client.h" +#include "sts_runtime.h" +#include "sts_error_utils.h" + +namespace OHOS { +namespace AbilityRuntime { +namespace { +constexpr const char* WRAPPER_CLASS_NAME = "Lutils/AbilityUtils/AsyncCallbackWrapper;"; +constexpr const char* ERROR_CLASS_NAME = "Lescompat/Error;"; +constexpr const char* BUSINESS_ERROR_CLASS_NAME = "L@ohos/base/BusinessError;"; +} +const char *INVOKE_METHOD_NAME = "invoke"; +const int32_t ERR_OK = 0; +const int32_t ERR_FAILURE = -1; +constexpr const char* NOT_SYSTEM_APP = "The application is not system-app, can not use system-api."; + +static std::string GetStdString(ani_env* env, ani_string str) +{ + std::string result; + ani_size sz {}; + env->String_GetUTF8Size(str, &sz); + result.resize(sz + 1); + env->String_GetUTF8SubString(str, 0, sz, result.data(), result.size(), &sz); + result.resize(sz); + return result; +} + +static void grantUriPermissionCallbackSync([[maybe_unused]]ani_env *env, + ani_string uri, ani_enum_item flagEnum, ani_string targetName, ani_double appCloneIndex, ani_object callback) +{ + TAG_LOGI(AAFwkTag::URIPERMMGR, "grantUriPermissionCallbackSync run"); + if (env == nullptr) { + TAG_LOGE(AAFwkTag::URIPERMMGR, "env null"); + return; + } + auto selfToken = IPCSkeleton::GetSelfTokenID(); + ani_object stsErrCode = CreateStsError(env, AbilityErrorCode::ERROR_OK); + if (!Security::AccessToken::TokenIdKit::IsSystemAppByFullTokenID(selfToken)) { + TAG_LOGE(AAFwkTag::URIPERMMGR, "app not system-app"); + stsErrCode = CreateStsError(env, static_cast(AbilityErrorCode::ERROR_CODE_NOT_SYSTEM_APP), + NOT_SYSTEM_APP); + AsyncCallback(env, callback, stsErrCode, createDouble(env, ERR_FAILURE)); + return; + } + std::string uriStr = GetStdString(env, uri); + Uri uriVec(uriStr); + ani_int flag = 0; + AAFwk::AniEnumConvertUtil::EnumConvertStsToNative(env, flagEnum, flag); + int32_t flagId = static_cast(flag); + std::string targetBundleName = GetStdString(env, targetName); + int32_t appCloneIndexId = static_cast(appCloneIndex); + int32_t errCode = ERR_OK; + int32_t result = ERR_OK; + errCode = AAFwk::UriPermissionManagerClient::GetInstance().GrantUriPermission(uriVec, flagId, + targetBundleName, appCloneIndexId); + if (errCode != ERR_OK) { + result = ERR_FAILURE; + stsErrCode = CreateStsErrorByNativeErr(env, errCode); + } + + AsyncCallback(env, callback, stsErrCode, createDouble(env, result)); +} + +static void revokeUriPermissionCallbackSync([[maybe_unused]]ani_env *env, + ani_string uri, ani_string targetName, ani_double appCloneIndex, ani_object callback) +{ + TAG_LOGI(AAFwkTag::URIPERMMGR, "revokeUriPermissionCallbackSync run"); + if (env == nullptr) { + TAG_LOGE(AAFwkTag::URIPERMMGR, "env null"); + return; + } + auto selfToken = IPCSkeleton::GetSelfTokenID(); + ani_object stsErrCode = CreateStsError(env, AbilityErrorCode::ERROR_OK); + if (!Security::AccessToken::TokenIdKit::IsSystemAppByFullTokenID(selfToken)) { + TAG_LOGE(AAFwkTag::URIPERMMGR, "app not system-app"); + stsErrCode = CreateStsError(env, static_cast(AbilityErrorCode::ERROR_CODE_NOT_SYSTEM_APP), + NOT_SYSTEM_APP); + AsyncCallback(env, callback, stsErrCode, createDouble(env, ERR_FAILURE)); + return; + } + std::string uriStr = GetStdString(env, uri); + Uri uriVec(uriStr); + std::string targetBundleName = GetStdString(env, targetName); + int32_t errCode = ERR_OK; + int32_t result = ERR_OK; + errCode = AAFwk::UriPermissionManagerClient::GetInstance().RevokeUriPermissionManually(uriVec, + targetBundleName, appCloneIndex); + if (errCode != ERR_OK) { + result = ERR_FAILURE; + stsErrCode = CreateStsErrorByNativeErr(env, errCode); + } + AsyncCallback(env, callback, stsErrCode, createDouble(env, result)); +} + +ani_object createDouble(ani_env *env, int32_t res) +{ +static const char *className = "Lstd/core/Double;"; +ani_class persion_cls; +if (ANI_OK != env->FindClass(className, &persion_cls)) { + TAG_LOGE(AAFwkTag::URIPERMMGR, "create double error"); + return nullptr; +} +ani_method persionInfoCtor; +env->Class_FindMethod(persion_cls, "", "D:V", &persionInfoCtor); +ani_object persionInfoObj; +env->Object_New(persion_cls, persionInfoCtor, &persionInfoObj, ani_double(res)); +return persionInfoObj; +} + +void StsUriPermissionManagerInit(ani_env *env) +{ + TAG_LOGI(AAFwkTag::URIPERMMGR, "StsUriPermissionManagerInit call"); + if (env == nullptr) { + TAG_LOGE(AAFwkTag::URIPERMMGR, "Invalid param"); + } + ani_namespace ns; + const char* targetNamespace = "L@ohos/application/uriPermissionManager/uriPermissionManager;"; + if (env->FindNamespace(targetNamespace, &ns) != ANI_OK) { + TAG_LOGE(AAFwkTag::URIPERMMGR, "FindNamespace failed"); + } + std::array functions = { + ani_native_function { + "grantUriPermissionCallbackSync", + "Lstd/core/String;L@ohos/app/ability/wantConstant/wantConstant/Flags;Lstd/core/String;D" + "Lutils/AbilityUtils/AsyncCallbackWrapper;:V", + reinterpret_cast(grantUriPermissionCallbackSync) + }, + ani_native_function { + "revokeUriPermissionCallbackSync", + "Lstd/core/String;Lstd/core/String;D" + "Lutils/AbilityUtils/AsyncCallbackWrapper;:V", + reinterpret_cast(revokeUriPermissionCallbackSync) + }, + }; + TAG_LOGI(AAFwkTag::URIPERMMGR, "StsUriPermissionManagerInit bind functions"); + if (env->Namespace_BindNativeFunctions(ns, functions.data(), functions.size()) != ANI_OK) { + TAG_LOGE(AAFwkTag::URIPERMMGR, "Namespace_BindNativeFunctions failed"); + }; + TAG_LOGI(AAFwkTag::URIPERMMGR, "StsUriPermissionManagerInit success"); +} + +extern "C"{ +ANI_EXPORT ani_status ANI_Constructor(ani_vm *vm, uint32_t *result) +{ + TAG_LOGI(AAFwkTag::URIPERMMGR, "ANI_Constructor"); + ani_env *env = nullptr; + ani_status status = ANI_ERROR; + status = vm->GetEnv(ANI_VERSION_1, &env); + if (status != ANI_OK) { + TAG_LOGI(AAFwkTag::URIPERMMGR, "GetEnv failed status: %{public}d", status); + return ANI_NOT_FOUND; + } + + StsUriPermissionManagerInit(env); + *result = ANI_VERSION_1; + TAG_LOGI(AAFwkTag::URIPERMMGR, "ANI_Constructor finish"); + return ANI_OK; +} +} + +bool AsyncCallback(ani_env *env, ani_object call, ani_object error, ani_object result) +{ + ani_status status = ANI_ERROR; + ani_class clsCall {}; + + if ((status = env->FindClass(WRAPPER_CLASS_NAME, &clsCall)) != ANI_OK) { + TAG_LOGE(AAFwkTag::URIPERMMGR, "status: %{public}d", status); + return false; + } + ani_method method = {}; + if ((status = env->Class_FindMethod( + clsCall, INVOKE_METHOD_NAME, "L@ohos/base/BusinessError;Lstd/core/Object;:V", &method)) != ANI_OK) { + TAG_LOGE(AAFwkTag::URIPERMMGR, "status: %{public}d", status); + return false; + } + if (result == nullptr) { + ani_ref nullRef = nullptr; + env->GetNull(&nullRef); + result = reinterpret_cast(nullRef); + } + if ((status = env->Object_CallMethod_Void(call, method, error, result)) != ANI_OK) { + TAG_LOGE(AAFwkTag::URIPERMMGR, "status: %{public}d", status); + return false; + } + return true; +} + +ani_object WrapError(ani_env *env, const std::string &msg) +{ + ani_class cls {}; + ani_method method {}; + ani_object obj = nullptr; + ani_status status = ANI_ERROR; + if (env == nullptr) { + TAG_LOGE(AAFwkTag::URIPERMMGR, "null env"); + return nullptr; + } + ani_string aniMsg = GetAniString(env, msg); + ani_ref undefRef; + env->GetUndefined(&undefRef); + if ((status = env->FindClass(ERROR_CLASS_NAME, &cls)) != ANI_OK) { + TAG_LOGE(AAFwkTag::URIPERMMGR, "statys: %{public}d", status); + return nullptr; + } + if ((status = env->Class_FindMethod(cls, "", "Lstd/core/String;Lescompat/ErrorOptions;:V", &method)) != + ANI_OK) { + TAG_LOGE(AAFwkTag::URIPERMMGR, "status: %{public}d", status); + return nullptr; + } + if ((status = env->Object_New(cls, method, &obj, aniMsg, undefRef)) != ANI_OK) { + TAG_LOGE(AAFwkTag::URIPERMMGR, "status: %{public}d", status); + return nullptr; + } + return obj; +} + +ani_string GetAniString(ani_env *env, const std::string &str) +{ + ani_string aniStr = nullptr; + ani_status status = env->String_NewUTF8(str.c_str(), str.size(), &aniStr); + if (status != ANI_OK) { + TAG_LOGE(AAFwkTag::JSNAPI, "status : %{public}d", status); + return nullptr; + } + return aniStr; +} + +ani_object WrapBusinessError(ani_env *env, int32_t code) +{ + ani_class cls {}; + ani_method method {}; + ani_object obj = nullptr; + ani_status status = ANI_ERROR; + if (env == nullptr) { + TAG_LOGE(AAFwkTag::UIABILITY, "null env"); + return nullptr; + } + if ((status = env->FindClass(BUSINESS_ERROR_CLASS_NAME, &cls)) != ANI_OK) { + TAG_LOGE(AAFwkTag::UIABILITY, "status : %{public}d", status); + return nullptr; + } + if ((status = env->Class_FindMethod(cls, "", "DLescompat/Error;:V", &method)) != ANI_OK) { + TAG_LOGE(AAFwkTag::UIABILITY, "status : %{public}d", status); + return nullptr; + } + ani_object error = WrapError(env, GetErrMsg(code)); + if (error == nullptr) { + TAG_LOGE(AAFwkTag::UIABILITY, "error nulll"); + return nullptr; + } + ani_double dCode(code); + if ((status = env->Object_New(cls, method, &obj, dCode, error)) != ANI_OK) { + TAG_LOGE(AAFwkTag::UIABILITY, "status : %{public}d", status); + return nullptr; + } + return obj; +} + +std::string GetErrMsg(int32_t err, const std::string &permission) +{ + auto errCode = GetJsErrorCodeByNativeError(err); + auto errMsg = (errCode == AbilityErrorCode::ERROR_CODE_PERMISSION_DENIED && !permission.empty()) + ? GetNoPermissionErrorMsg(permission) + : GetErrorMsg(errCode); + return errMsg; +} + +} // namespace AbilityRuntime +} // namespace OHOS \ No newline at end of file diff --git a/frameworks/ets/ets/@ohos.application.uriPermissionManager.ets b/frameworks/ets/ets/@ohos.application.uriPermissionManager.ets new file mode 100644 index 0000000000000000000000000000000000000000..307c7bb96610c8952fc8e8806a79866f39bf86b8 --- /dev/null +++ b/frameworks/ets/ets/@ohos.application.uriPermissionManager.ets @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import wantConstant from '@ohos.app.ability.wantConstant'; +import { BusinessError, AsyncCallback } from '@ohos.base'; +import AsyncCallbackWrapper from './utils/AbilityUtils'; + +export default namespace uriPermissionManager { + loadLibrary("uri_permission_manager_ani_kit.z"); + + export native function grantUriPermissionCallbackSync(uri: string, flag: wantConstant.Flags, targetBundleName: string, + appCloneIndex: number, callback: AsyncCallbackWrapper): void; + export native function revokeUriPermissionCallbackSync(uri: string, targetBundleName: string, appCloneIndex: number, + callback: AsyncCallbackWrapper): void; + + export function grantUriPermission(uri: string, flag: wantConstant.Flags, targetBundleName: string): Promise { + let p:Promise = new Promise((resolve: (data: number)=>void, reject:(err: BusinessError)=>void):void => { + let myCall = new AsyncCallbackWrapper((err: BusinessError | null, data: number | undefined)=>{ + if (err === null || err.code === 0) { + if (data === undefined) { + resolve(-1); + } else { + resolve(data); + } + } else { + reject(err); + } + }); + taskpool.execute((): void => { + uriPermissionManager.grantUriPermissionCallbackSync(uri, flag, targetBundleName, 0, myCall); + }); + }); + return p; + } + + export function grantUriPermission(uri: string, flag: wantConstant.Flags, targetBundleName: string, + appCloneIndex: number): Promise { + let p:Promise = new Promise((resolve: (data:undefined)=>void, reject:(err: BusinessError)=>void):void => { + let myCall = new AsyncCallbackWrapper((err: BusinessError | null, data: number | undefined)=>{ + if (err === null || err.code === 0) { + resolve(undefined); + } else { + reject(err); + } + }); + taskpool.execute((): void => { + uriPermissionManager.grantUriPermissionCallbackSync(uri, + flag, targetBundleName, appCloneIndex, myCall); + }); + }); + return p; + } + + export function grantUriPermission(uri: string, flag: wantConstant.Flags, targetBundleName: string, + callback: AsyncCallback): void { + let myCall = new AsyncCallbackWrapper(callback); + taskpool.execute((): void => { + uriPermissionManager.grantUriPermissionCallbackSync(uri, flag, targetBundleName, 0, myCall); + }) + } + + export function revokeUriPermission(uri: string, targetBundleName: string): Promise { + let p:Promise = new Promise((resolve: (data: number)=>void, reject:(err: BusinessError)=>void):void => { + let myCall = new AsyncCallbackWrapper((err: BusinessError | null, data: number | undefined)=>{ + if (err === null || err.code === 0) { + if (data === undefined) { + resolve(-1); + } else { + resolve(data); + } + } else { + reject(err); + } + }); + taskpool.execute((): void => { + uriPermissionManager.revokeUriPermissionCallbackSync(uri, targetBundleName, 0, myCall); + }); + }); + return p; + } + + export function revokeUriPermission(uri: string, targetBundleName: string, appCloneIndex: number): Promise { + let p:Promise = new Promise((resolve: (data:undefined)=>void, reject:(err: BusinessError)=>void):void => { + let myCall = new AsyncCallbackWrapper((err: BusinessError | null, data: number | undefined)=>{ + if (err === null || err.code === 0) { + resolve(undefined); + } else { + reject(err); + } + }); + taskpool.execute((): void => { + uriPermissionManager.revokeUriPermissionCallbackSync(uri, targetBundleName, appCloneIndex, myCall); + }); + }); + return p; + } + + export function revokeUriPermission(uri: string, targetBundleName: string, callback: AsyncCallback): void { + let myCall = new AsyncCallbackWrapper(callback); + taskpool.execute((): void => { + uriPermissionManager.revokeUriPermissionCallbackSync(uri, targetBundleName, 0, myCall); + }) + } +} \ No newline at end of file diff --git a/frameworks/ets/ets/BUILD.gn b/frameworks/ets/ets/BUILD.gn index 9f07fdb1852acb6b8a7f2fdd8836c92349d787e4..34e3cb528062a0890111ebbcace013d1241d877d 100644 --- a/frameworks/ets/ets/BUILD.gn +++ b/frameworks/ets/ets/BUILD.gn @@ -111,6 +111,26 @@ ohos_prebuilt_etc("ability_runtime_want_constant_abc_etc") { deps = [ ":ability_runtime_want_constant_abc" ] } +generate_static_abc("uri_permission_manager_abc") { + base_url = "./" + + files = [ "./@ohos.application.uriPermissionManager.ets" ] + + dst_file = "$target_out_dir/uri_permission_manager.abc" + out_puts = [ "$target_out_dir/uri_permission_manager.abc" ] + + is_boot_abc = "True" + device_dst_file = "/system/framework/uri_permission_manager.abc" +} + +ohos_prebuilt_etc("uri_permission_manager_abc_etc") { + source = "$target_out_dir/uri_permission_manager.abc" + module_install_dir = "framework" + subsystem_name = "ability" + part_name = "ability_runtime" + deps = [ ":uri_permission_manager_abc" ] +} + group("ets_packages") { deps = [ ":ability_runtime_ability_constant_abc_etc", @@ -119,5 +139,6 @@ group("ets_packages") { ":ability_runtime_start_options_abc_etc", ":ability_runtime_want_abc_etc", ":ability_runtime_want_constant_abc_etc", + ":uri_permission_manager_abc_etc", ] }