From 7e780bb2ea742db2afaa047ccc2eafc25c8e6937 Mon Sep 17 00:00:00 2001 From: wangke Date: Wed, 19 Jan 2022 11:37:18 +0800 Subject: [PATCH 1/8] base --- LICENSE | 177 ++++++++++++++++++ README.en.md | 36 ---- README.md | 39 ++-- README_zh.md | 23 +++ interfaces/kits/js/BUILD.gn | 35 ++++ .../kits/js/share_over_device/share.cpp | 130 +++++++++++++ ohos.build | 14 ++ 7 files changed, 397 insertions(+), 57 deletions(-) create mode 100644 LICENSE delete mode 100644 README.en.md create mode 100644 README_zh.md create mode 100644 interfaces/kits/js/BUILD.gn create mode 100644 interfaces/kits/js/share_over_device/share.cpp create mode 100644 ohos.build diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..4947287f7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 65de95fde..000000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# storage_app_fileshare_manager - -#### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md index 5071028f9..65de95fde 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,36 @@ # storage_app_fileshare_manager -#### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} +#### Description +{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} -#### 软件架构 -软件架构说明 +#### Software Architecture +Software architecture description - -#### 安装教程 +#### Installation 1. xxxx 2. xxxx 3. xxxx -#### 使用说明 +#### Instructions 1. xxxx 2. xxxx 3. xxxx -#### 参与贡献 +#### Contribution -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request +1. Fork the repository +2. Create Feat_xxx branch +3. Commit your code +4. Create Pull Request -#### 特技 +#### Gitee Feature -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md +2. Gitee blog [blog.gitee.com](https://blog.gitee.com) +3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) +4. The most valuable open source project [GVP](https://gitee.com/gvp) +5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) +6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README_zh.md b/README_zh.md new file mode 100644 index 000000000..07d85621d --- /dev/null +++ b/README_zh.md @@ -0,0 +1,23 @@ +# 应用文件管理服务 + +## **简介** +应用文件管理提供应用私有文件访问控制和分享能力。 + +## **目录** +``` +/foundation/filemanagement/app_file_service +├── interfaces // 接口声明 +│ └── kits // 对外接口声明 +``` + +## **约束** + +### 接口支持情况 + +### 规格 + +## **说明** + +### 使用说明 + +## **相关仓** \ No newline at end of file diff --git a/interfaces/kits/js/BUILD.gn b/interfaces/kits/js/BUILD.gn new file mode 100644 index 000000000..d22e6b374 --- /dev/null +++ b/interfaces/kits/js/BUILD.gn @@ -0,0 +1,35 @@ +# Copyright (c) 2021 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/ohos.gni") + +ohos_shared_library("shareoverdevice") { + include_dirs = [ + "//foundation/ace/napi/interfaces/kits", + "//utils/native/base/include", + ] + + sources = [ + "share_over_device/share.cpp", + ] + + deps = [ + "//foundation/ace/napi:ace_napi", + "//utils/native/base:utilsecurec", + ] + + relative_install_dir = "module" + + part_name = "filemanagement_app_file_service" + subsystem_name = "filemanagement" +} diff --git a/interfaces/kits/js/share_over_device/share.cpp b/interfaces/kits/js/share_over_device/share.cpp new file mode 100644 index 000000000..097c8c02e --- /dev/null +++ b/interfaces/kits/js/share_over_device/share.cpp @@ -0,0 +1,130 @@ +#include "napi/native_api.h" +#include "napi/native_node_api.h" +#include +#include +#include + +#define HMDFS_IOC 0xf2 +#define HMDFS_IOC_SET_SHARE_PATH _IOW(HMDFS_IOC, 1, \ + struct hmdfs_share_control) +#define HMDFS_CID_SIZE 64 + +namespace OHOS { +namespace FileShareAbility { +struct hmdfs_share_control { + uint32_t src_fd; + char cid[HMDFS_CID_SIZE]; +}; + +struct AddonData { + napi_async_work work; + napi_deferred deferred; + int32_t fd; + char *cid; +}; + +void ExecuteWork(napi_env env, void *data) +{ + struct AddonData *addon_data = (struct AddonData *)data; + struct hmdfs_share_control sc; + int32_t err = 0; + std::string packagePath = "/mnt/hmdfs/0/device_view/local/data/com.example.filtestkits"; + std::string sharePath = packagePath + "/.share"; + + int32_t dirFd = open(sharePath.c_str(), O_RDONLY); + if (dirFd < 0) { + return; + } + + sc.src_fd = addon_data->fd; + memcpy(sc.cid, addon_data->cid, HMDFS_CID_SIZE); + err = ioctl(dirFd, HMDFS_IOC_SET_SHARE_PATH, &sc); + + close(dirFd); +} + +void WorkComplete(napi_env env, napi_status status, void *data) +{ + struct AddonData *addon_data = (struct AddonData *)data; + napi_value resPath; + + if (status != napi_ok) { + return; + } + + napi_create_string_utf8(env, "/mnt/hmdfs/0/merge_view/data/com.example.filetestkits/.share/test.editshare.txt", + NAPI_AUTO_LENGTH, &resPath); + + napi_resolve_deferred(env, addon_data->deferred, resPath); + napi_delete_async_work(env, addon_data->work); + free(addon_data->cid); + delete addon_data; +} + +static napi_value CreateSharePath(napi_env env, napi_callback_info info) +{ + napi_value result, work_name; + struct AddonData *addon_data = new AddonData(); + size_t argc = 2; + napi_value args[2]; + size_t copysize; + napi_valuetype type = napi_undefined; + + napi_get_cb_info(env, info, &argc, args, NULL, NULL); + + if (argc > 2) { + + } + + napi_typeof(env, args[0], &type); + if (type != napi_number) { + + } + napi_get_value_int32(env, args[0], &(addon_data->fd)); + + napi_typeof(env, args[1], &type); + if (type != napi_string) { + + } + napi_get_value_string_utf8(env, args[1], NULL, 0, ©size); + addon_data->cid = (char *)malloc(sizeof(char) * (copysize + 1)); + addon_data->cid[copysize] = '\0'; + napi_get_value_string_utf8(env, args[1], addon_data->cid, copysize + 1, ©size); + + napi_create_promise(env, &addon_data->deferred, &result); + napi_create_string_utf8(env, "Async Work", NAPI_AUTO_LENGTH, &work_name); + napi_create_async_work(env, NULL, work_name, ExecuteWork, WorkComplete, addon_data, &(addon_data->work)); + napi_queue_async_work(env, addon_data->work); + + return result; +} + +#define DECLARE_NAPI_METHOD(name, func) \ + { \ + name, 0, func, 0, 0, 0, napi_default, 0 \ + } + +static napi_value Init(napi_env env, napi_value exports) +{ + napi_status status; + napi_property_descriptor desc = DECLARE_NAPI_METHOD("createsharepath", CreateSharePath); + status = napi_define_properties(env, exports, 1, &desc); + return exports; +} +} // namespace FileShareAbility +} // namespace OHOS + +static napi_module demoModule = { + .nm_version = 1, + .nm_flags = 0, + .nm_filename = nullptr, + .nm_register_func = OHOS::FileShareAbility::Init, + .nm_modname = "shareoverdevice", + .nm_priv = ((void *)0), + .reserved = {0}, +}; + +extern "C" __attribute__((constructor)) void RegisterModule(void) +{ + napi_module_register(&demoModule); +} \ No newline at end of file diff --git a/ohos.build b/ohos.build new file mode 100644 index 000000000..8fa0d0db5 --- /dev/null +++ b/ohos.build @@ -0,0 +1,14 @@ +{ + "subsystem": "filemanagement", + "parts": { + "filemanagement_app_file_service": { + "variants": [ + "wearable", + "phone" + ], + "module_list": [ + "//foundation/filemanagement/app_file_service/interfaces/kits/js/:shareoverdevice" + ] + } + } +} \ No newline at end of file -- Gitee From 3afc0f197d31599e5d142adf5ceb3318bec80c2f Mon Sep 17 00:00:00 2001 From: wangke Date: Wed, 19 Jan 2022 20:20:31 +0800 Subject: [PATCH 2/8] add arch.jpg --- README_zh.md | 13 +++++-------- figures/arch.jpg | Bin 0 -> 23861 bytes 2 files changed, 5 insertions(+), 8 deletions(-) create mode 100644 figures/arch.jpg diff --git a/README_zh.md b/README_zh.md index 07d85621d..7b53968cd 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1,7 +1,10 @@ # 应用文件管理服务 ## **简介** -应用文件管理提供应用私有文件访问控制和分享能力。 +应用文件管理提供应用跨设备分享能力。 + +**图1** 应用文件子系统架构图 +![架构图](figures/arch.jpg) ## **目录** ``` @@ -11,13 +14,7 @@ ``` ## **约束** - ### 接口支持情况 - -### 规格 - -## **说明** - -### 使用说明 +跨设备分享接口仅支持REG类别文件分享,不支持DIR、BLK等类别文件分享,不支持分享文件二次分享。 ## **相关仓** \ No newline at end of file diff --git a/figures/arch.jpg b/figures/arch.jpg new file mode 100644 index 0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O3$#eyVx)=9g$F&wGnWQHtdr!R<$hChU0aJw`lGJ1CcJ z&1!6;GZMiG5!g)DAJ+Biw@cF^ih^5$a^)5}OZmOI<`cA;78u!>mH563t7j%V$3+vA zqgAGVW*J@z>lpDWbC91id_mxlp*K87iT;CoEg<}PMAJdbQ)j`rJi~R-C%PjwO)i#X zF&?FSu>}QUgfdvG(iAqoFZr z&-WdD*7`JOs+SFxW3F2hwseMDx-g4S zX}5~UFF_%Kxq@892b6Idm7(3$6|wux#Qe|iD&2h3EX`i;p|C8Ds$}Yw{T#+>QE82?(M`XpbtXAdQ9~p49>&W`JHm9|@ zatv{{4sM0at9z+7x1r(5@`_txP_o#r_)K4yv%q}igqcD+V5ktCzDC6qogCZMAWg#@ z>!Ki1c%Q8zpX?|5_mAX|{jQPpj~G(_1^4`Shg$reG5bGV_a{Nv8nO;}#1l%Sc2UkZ hVl|~A0`nGtZ}ZYtnAQAW`BlmP3<>;4&tM_P{tv%OubTh> literal 0 HcmV?d00001 -- Gitee From 0f7e5eebd689e61e606d47a6ecfb681413f452a6 Mon Sep 17 00:00:00 2001 From: wangke Date: Wed, 19 Jan 2022 21:27:08 +0800 Subject: [PATCH 3/8] rename to remote_file_share & delete arch.jpg --- README_zh.md | 21 +++++++++--------- figures/arch.jpg | Bin 23861 -> 0 bytes interfaces/kits/js/BUILD.gn | 4 ++-- .../remote_file_share.cpp} | 4 ++-- ohos.build | 2 +- 5 files changed, 16 insertions(+), 15 deletions(-) delete mode 100644 figures/arch.jpg rename interfaces/kits/js/{share_over_device/share.cpp => remote_file_share/remote_file_share.cpp} (93%) diff --git a/README_zh.md b/README_zh.md index 7b53968cd..165f011a6 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1,20 +1,21 @@ -# 应用文件管理服务 +# 应用文件管理组件 ## **简介** -应用文件管理提供应用跨设备分享能力。 - -**图1** 应用文件子系统架构图 -![架构图](figures/arch.jpg) +应用文件管理基于分布式文件系统,提供跨设备文件分享能力,包括以下内容: +1. 跨设备分享接口 ## **目录** ``` /foundation/filemanagement/app_file_service -├── interfaces // 接口声明 -│ └── kits // 对外接口声明 +├── interfaces // 对外接口 +│ └── kits // 对外接口代码 ``` -## **约束** -### 接口支持情况 -跨设备分享接口仅支持REG类别文件分享,不支持DIR、BLK等类别文件分享,不支持分享文件二次分享。 +## **说明** +### 接口说明 +**表1**应用文件管理接口说明 +| **接口名** | **说明** | +| --- | --- | +| createSharePath(fd:number, cid:string, AsyncCallback\): void \| Promise\ | 将分享文件fd传递给分布式文件系统,创建分享路径 | ## **相关仓** \ No newline at end of file diff --git a/figures/arch.jpg b/figures/arch.jpg deleted file mode 100644 index 91803c9fab7839e78bb692c32b526b2e572be210..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 23861 zcmeHv2RNPEw)WDA61^@&NpwQ=E}})$=rvljAbJUw5G0}t62THBIw6)G6212lOYdFu zZms{zzUQ2~+57B$?z!bZ_kVt#?^)*bee;`T%rW2bjxiSUJ8}j@cwb&g9)yB|0(u1e zf{^1NSr9fRCKe_JHWn5Z4i5G;JW_l-TwFXVVv_5mwAA!;wA5hm4Q6hZ8;qPxU@)r? z8|Q6aetv#>77+$UqM9JC=I9+Xef*z zR3a2KA{1m3h#mw&!2o*uv%`P+K|w`B$H2tG#<_+I+yEm4p`xInp`xQqOz*Gp|PpCrM0cSV_-^fN`Osqobi?{TvqxswZ%v5usx+@M03nXkeK+lQ8l< z$0ofS^P%J$4$~dYZ8CG0{%hpS{IfTAeh%%Ik^N%>3;d@>_P2rk`?%mBJTw$w@z97s zQlO(#*7SgD{{t6e$P(3JWh5Kf)RYW34T46d^9>0KD229U6>wo8WF=XVpifDVRa%&1 zABr5Q`v0~ILs_XHv#MTMJj|!Va2gWSX5CDGNTPPZ zR9*-Nv8IRpue)+>1>PhIt=bW)kj`=+ejKpc?F&!#Z8eKZ_4>N`-0@Qx{R!T22BN_h z3Ci>su93zd)%ag`k#XHBja|Cnx{H&Zd~<3D{-Dl)C@$*l2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fkO8`fmRFz4HG^w$nTpWWjug=i&vB4mhCfv#}miIUsQ6=cHZrseI6p>xZ?{ zQ13Hl)yfdzwj1{vf1xFfj+0z+Ra(T7`eVbl+8rGR)+T3Svb3B7&EqqizP$;QLerif z;QwA=S)z<B{&5(Cvo2#Bop$erHdOE@j+Z+JdlVH})7!U{4ZR8@%AVefCX{)l zjLEI-_RU9qh7(>F)u+jiAfSz$){FgU+wA)9m-UlBDw==|cNkf+?-U!c4|PvHBM80m=&%AXSydt;11N$Wju zbLxG8P#E)sn~{8=_QU+7#~%m^vkdG6*VgfeIQVcdDLL@MqfBf*k+1xPpa18+n^H%< zq`=6Qydn|byi|eI&SAXw+O3$#eyVx)=9g$F&wGnWQHtdr!R<$hChU0aJw`lGJ1CcJ z&1!6;GZMiG5!g)DAJ+Biw@cF^ih^5$a^)5}OZmOI<`cA;78u!>mH563t7j%V$3+vA zqgAGVW*J@z>lpDWbC91id_mxlp*K87iT;CoEg<}PMAJdbQ)j`rJi~R-C%PjwO)i#X zF&?FSu>}QUgfdvG(iAqoFZr z&-WdD*7`JOs+SFxW3F2hwseMDx-g4S zX}5~UFF_%Kxq@892b6Idm7(3$6|wux#Qe|iD&2h3EX`i;p|C8Ds$}Yw{T#+>QE82?(M`XpbtXAdQ9~p49>&W`JHm9|@ zatv{{4sM0at9z+7x1r(5@`_txP_o#r_)K4yv%q}igqcD+V5ktCzDC6qogCZMAWg#@ z>!Ki1c%Q8zpX?|5_mAX|{jQPpj~G(_1^4`Shg$reG5bGV_a{Nv8nO;}#1l%Sc2UkZ hVl|~A0`nGtZ}ZYtnAQAW`BlmP3<>;4&tM_P{tv%OubTh> diff --git a/interfaces/kits/js/BUILD.gn b/interfaces/kits/js/BUILD.gn index d22e6b374..38031194b 100644 --- a/interfaces/kits/js/BUILD.gn +++ b/interfaces/kits/js/BUILD.gn @@ -13,14 +13,14 @@ import("//build/ohos.gni") -ohos_shared_library("shareoverdevice") { +ohos_shared_library("remotefileshare") { include_dirs = [ "//foundation/ace/napi/interfaces/kits", "//utils/native/base/include", ] sources = [ - "share_over_device/share.cpp", + "remote_file_share/remote_file_share.cpp", ] deps = [ diff --git a/interfaces/kits/js/share_over_device/share.cpp b/interfaces/kits/js/remote_file_share/remote_file_share.cpp similarity index 93% rename from interfaces/kits/js/share_over_device/share.cpp rename to interfaces/kits/js/remote_file_share/remote_file_share.cpp index 097c8c02e..9818f655d 100644 --- a/interfaces/kits/js/share_over_device/share.cpp +++ b/interfaces/kits/js/remote_file_share/remote_file_share.cpp @@ -107,7 +107,7 @@ static napi_value CreateSharePath(napi_env env, napi_callback_info info) static napi_value Init(napi_env env, napi_value exports) { napi_status status; - napi_property_descriptor desc = DECLARE_NAPI_METHOD("createsharepath", CreateSharePath); + napi_property_descriptor desc = DECLARE_NAPI_METHOD("createSharePath", CreateSharePath); status = napi_define_properties(env, exports, 1, &desc); return exports; } @@ -119,7 +119,7 @@ static napi_module demoModule = { .nm_flags = 0, .nm_filename = nullptr, .nm_register_func = OHOS::FileShareAbility::Init, - .nm_modname = "shareoverdevice", + .nm_modname = "remotefileshare", .nm_priv = ((void *)0), .reserved = {0}, }; diff --git a/ohos.build b/ohos.build index 8fa0d0db5..f19290d7c 100644 --- a/ohos.build +++ b/ohos.build @@ -7,7 +7,7 @@ "phone" ], "module_list": [ - "//foundation/filemanagement/app_file_service/interfaces/kits/js/:shareoverdevice" + "//foundation/filemanagement/app_file_service/interfaces/kits/js/:remotefileshare" ] } } -- Gitee From b78dd2af1ca13a8daadb1391a4a226595a9a944f Mon Sep 17 00:00:00 2001 From: wangke Date: Thu, 20 Jan 2022 11:17:57 +0800 Subject: [PATCH 4/8] fix some oat problems & CRLF => LF --- README_zh.md | 2 +- interfaces/kits/js/BUILD.gn | 70 ++--- .../remote_file_share/remote_file_share.cpp | 273 +++++++++--------- ohos.build | 26 +- 4 files changed, 193 insertions(+), 178 deletions(-) diff --git a/README_zh.md b/README_zh.md index 165f011a6..01c037e04 100644 --- a/README_zh.md +++ b/README_zh.md @@ -16,6 +16,6 @@ **表1**应用文件管理接口说明 | **接口名** | **说明** | | --- | --- | -| createSharePath(fd:number, cid:string, AsyncCallback\): void \| Promise\ | 将分享文件fd传递给分布式文件系统,创建分享路径 | +| createSharePath(fd: number, cid: string, callback: AsyncCallback\): Promise\ | 将分享文件fd传递给分布式文件系统,创建分享路径 | ## **相关仓** \ No newline at end of file diff --git a/interfaces/kits/js/BUILD.gn b/interfaces/kits/js/BUILD.gn index 38031194b..bcbb8ac32 100644 --- a/interfaces/kits/js/BUILD.gn +++ b/interfaces/kits/js/BUILD.gn @@ -1,35 +1,35 @@ -# Copyright (c) 2021 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/ohos.gni") - -ohos_shared_library("remotefileshare") { - include_dirs = [ - "//foundation/ace/napi/interfaces/kits", - "//utils/native/base/include", - ] - - sources = [ - "remote_file_share/remote_file_share.cpp", - ] - - deps = [ - "//foundation/ace/napi:ace_napi", - "//utils/native/base:utilsecurec", - ] - - relative_install_dir = "module" - - part_name = "filemanagement_app_file_service" - subsystem_name = "filemanagement" -} +# Copyright (c) 2021 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/ohos.gni") + +ohos_shared_library("remotefileshare") { + include_dirs = [ + "//foundation/ace/napi/interfaces/kits", + "//utils/native/base/include", + ] + + sources = [ + "remote_file_share/remote_file_share.cpp", + ] + + deps = [ + "//foundation/ace/napi:ace_napi", + "//utils/native/base:utilsecurec", + ] + + relative_install_dir = "module" + + part_name = "filemanagement_app_file_service" + subsystem_name = "filemanagement" +} diff --git a/interfaces/kits/js/remote_file_share/remote_file_share.cpp b/interfaces/kits/js/remote_file_share/remote_file_share.cpp index 9818f655d..9429f8ead 100644 --- a/interfaces/kits/js/remote_file_share/remote_file_share.cpp +++ b/interfaces/kits/js/remote_file_share/remote_file_share.cpp @@ -1,130 +1,145 @@ -#include "napi/native_api.h" -#include "napi/native_node_api.h" -#include -#include -#include - -#define HMDFS_IOC 0xf2 -#define HMDFS_IOC_SET_SHARE_PATH _IOW(HMDFS_IOC, 1, \ - struct hmdfs_share_control) -#define HMDFS_CID_SIZE 64 - -namespace OHOS { -namespace FileShareAbility { -struct hmdfs_share_control { - uint32_t src_fd; - char cid[HMDFS_CID_SIZE]; -}; - -struct AddonData { - napi_async_work work; - napi_deferred deferred; - int32_t fd; - char *cid; -}; - -void ExecuteWork(napi_env env, void *data) -{ - struct AddonData *addon_data = (struct AddonData *)data; - struct hmdfs_share_control sc; - int32_t err = 0; - std::string packagePath = "/mnt/hmdfs/0/device_view/local/data/com.example.filtestkits"; - std::string sharePath = packagePath + "/.share"; - - int32_t dirFd = open(sharePath.c_str(), O_RDONLY); - if (dirFd < 0) { - return; - } - - sc.src_fd = addon_data->fd; - memcpy(sc.cid, addon_data->cid, HMDFS_CID_SIZE); - err = ioctl(dirFd, HMDFS_IOC_SET_SHARE_PATH, &sc); - - close(dirFd); -} - -void WorkComplete(napi_env env, napi_status status, void *data) -{ - struct AddonData *addon_data = (struct AddonData *)data; - napi_value resPath; - - if (status != napi_ok) { - return; - } - - napi_create_string_utf8(env, "/mnt/hmdfs/0/merge_view/data/com.example.filetestkits/.share/test.editshare.txt", - NAPI_AUTO_LENGTH, &resPath); - - napi_resolve_deferred(env, addon_data->deferred, resPath); - napi_delete_async_work(env, addon_data->work); - free(addon_data->cid); - delete addon_data; -} - -static napi_value CreateSharePath(napi_env env, napi_callback_info info) -{ - napi_value result, work_name; - struct AddonData *addon_data = new AddonData(); - size_t argc = 2; - napi_value args[2]; - size_t copysize; - napi_valuetype type = napi_undefined; - - napi_get_cb_info(env, info, &argc, args, NULL, NULL); - - if (argc > 2) { - - } - - napi_typeof(env, args[0], &type); - if (type != napi_number) { - - } - napi_get_value_int32(env, args[0], &(addon_data->fd)); - - napi_typeof(env, args[1], &type); - if (type != napi_string) { - - } - napi_get_value_string_utf8(env, args[1], NULL, 0, ©size); - addon_data->cid = (char *)malloc(sizeof(char) * (copysize + 1)); - addon_data->cid[copysize] = '\0'; - napi_get_value_string_utf8(env, args[1], addon_data->cid, copysize + 1, ©size); - - napi_create_promise(env, &addon_data->deferred, &result); - napi_create_string_utf8(env, "Async Work", NAPI_AUTO_LENGTH, &work_name); - napi_create_async_work(env, NULL, work_name, ExecuteWork, WorkComplete, addon_data, &(addon_data->work)); - napi_queue_async_work(env, addon_data->work); - - return result; -} - -#define DECLARE_NAPI_METHOD(name, func) \ - { \ - name, 0, func, 0, 0, 0, napi_default, 0 \ - } - -static napi_value Init(napi_env env, napi_value exports) -{ - napi_status status; - napi_property_descriptor desc = DECLARE_NAPI_METHOD("createSharePath", CreateSharePath); - status = napi_define_properties(env, exports, 1, &desc); - return exports; -} -} // namespace FileShareAbility -} // namespace OHOS - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = OHOS::FileShareAbility::Init, - .nm_modname = "remotefileshare", - .nm_priv = ((void *)0), - .reserved = {0}, -}; - -extern "C" __attribute__((constructor)) void RegisterModule(void) -{ - napi_module_register(&demoModule); +/* + * Copyright (C) 2021 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 "napi/native_api.h" +#include "napi/native_node_api.h" +#include +#include +#include + +#define HMDFS_IOC 0xf2 +#define HMDFS_IOC_SET_SHARE_PATH _IOW(HMDFS_IOC, 1, \ + struct hmdfs_share_control) +#define HMDFS_CID_SIZE 64 + +namespace OHOS { +namespace FileShareAbility { +struct hmdfs_share_control { + uint32_t src_fd; + char cid[HMDFS_CID_SIZE]; +}; + +struct AddonData { + napi_async_work work; + napi_deferred deferred; + int32_t fd; + char *cid; +}; + +void ExecuteWork(napi_env env, void *data) +{ + struct AddonData *addon_data = (struct AddonData *)data; + struct hmdfs_share_control sc; + int32_t err = 0; + std::string packagePath = "/mnt/hmdfs/0/device_view/local/data/com.example.filtestkits"; + std::string sharePath = packagePath + "/.share"; + + int32_t dirFd = open(sharePath.c_str(), O_RDONLY); + if (dirFd < 0) { + return; + } + + sc.src_fd = addon_data->fd; + memcpy(sc.cid, addon_data->cid, HMDFS_CID_SIZE); + err = ioctl(dirFd, HMDFS_IOC_SET_SHARE_PATH, &sc); + + close(dirFd); +} + +void WorkComplete(napi_env env, napi_status status, void *data) +{ + struct AddonData *addon_data = (struct AddonData *)data; + napi_value resPath; + + if (status != napi_ok) { + return; + } + + napi_create_string_utf8(env, "/mnt/hmdfs/0/merge_view/data/com.example.filetestkits/.share/test.editshare.txt", + NAPI_AUTO_LENGTH, &resPath); + + napi_resolve_deferred(env, addon_data->deferred, resPath); + napi_delete_async_work(env, addon_data->work); + free(addon_data->cid); + delete addon_data; +} + +static napi_value CreateSharePath(napi_env env, napi_callback_info info) +{ + napi_value result, work_name; + struct AddonData *addon_data = new AddonData(); + size_t argc = 2; + napi_value args[2]; + size_t copysize; + napi_valuetype type = napi_undefined; + + napi_get_cb_info(env, info, &argc, args, NULL, NULL); + + if (argc > 2) { + NAPI_ASSERT(env, false, "number of arguments mismatch"); + } + + napi_typeof(env, args[0], &type); + if (type != napi_number) { + NAPI_ASSERT(env, false, "type mismatch"); + } + napi_get_value_int32(env, args[0], &(addon_data->fd)); + + napi_typeof(env, args[1], &type); + if (type != napi_string) { + NAPI_ASSERT(env, false, "type mismatch"); + } + napi_get_value_string_utf8(env, args[1], NULL, 0, ©size); + addon_data->cid = (char *)malloc(sizeof(char) * (copysize + 1)); + addon_data->cid[copysize] = '\0'; + napi_get_value_string_utf8(env, args[1], addon_data->cid, copysize + 1, ©size); + + napi_create_promise(env, &addon_data->deferred, &result); + napi_create_string_utf8(env, "Async Work", NAPI_AUTO_LENGTH, &work_name); + napi_create_async_work(env, NULL, work_name, ExecuteWork, WorkComplete, addon_data, &(addon_data->work)); + napi_queue_async_work(env, addon_data->work); + + return result; +} + +#define DECLARE_NAPI_METHOD(name, func) \ + { \ + name, 0, func, 0, 0, 0, napi_default, 0 \ + } + +static napi_value Init(napi_env env, napi_value exports) +{ + napi_status status; + napi_property_descriptor desc = DECLARE_NAPI_METHOD("createSharePath", CreateSharePath); + status = napi_define_properties(env, exports, 1, &desc); + return exports; +} +} // namespace FileShareAbility +} // namespace OHOS + +static napi_module demoModule = { + .nm_version = 1, + .nm_flags = 0, + .nm_filename = nullptr, + .nm_register_func = OHOS::FileShareAbility::Init, + .nm_modname = "remotefileshare", + .nm_priv = ((void *)0), + .reserved = {0}, +}; + +extern "C" __attribute__((constructor)) void RegisterModule(void) +{ + napi_module_register(&demoModule); } \ No newline at end of file diff --git a/ohos.build b/ohos.build index f19290d7c..f11f065ef 100644 --- a/ohos.build +++ b/ohos.build @@ -1,14 +1,14 @@ -{ - "subsystem": "filemanagement", - "parts": { - "filemanagement_app_file_service": { - "variants": [ - "wearable", - "phone" - ], - "module_list": [ - "//foundation/filemanagement/app_file_service/interfaces/kits/js/:remotefileshare" - ] - } - } +{ + "subsystem": "filemanagement", + "parts": { + "filemanagement_app_file_service": { + "variants": [ + "wearable", + "phone" + ], + "module_list": [ + "//foundation/filemanagement/app_file_service/interfaces/kits/js/:remotefileshare" + ] + } + } } \ No newline at end of file -- Gitee From 1f16dde76599890132f9f658553287fda457cf35 Mon Sep 17 00:00:00 2001 From: wangke Date: Fri, 21 Jan 2022 10:26:41 +0800 Subject: [PATCH 5/8] add remotefileshare.d.ts --- README_zh.md | 2 +- interfaces/kits/js/@ohos.remotefileshare.d.ts | 35 +++++++++++++++++++ .../remote_file_share/remote_file_share.cpp | 6 ++-- 3 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 interfaces/kits/js/@ohos.remotefileshare.d.ts diff --git a/README_zh.md b/README_zh.md index 01c037e04..16311f2f9 100644 --- a/README_zh.md +++ b/README_zh.md @@ -16,6 +16,6 @@ **表1**应用文件管理接口说明 | **接口名** | **说明** | | --- | --- | -| createSharePath(fd: number, cid: string, callback: AsyncCallback\): Promise\ | 将分享文件fd传递给分布式文件系统,创建分享路径 | +| createSharePath(fd: number, cid: string, callback: AsyncCallback\): void \| Promise\ | 将文件fd传递给分布式文件系统,创建分享路径 | ## **相关仓** \ No newline at end of file diff --git a/interfaces/kits/js/@ohos.remotefileshare.d.ts b/interfaces/kits/js/@ohos.remotefileshare.d.ts new file mode 100644 index 000000000..876b8379a --- /dev/null +++ b/interfaces/kits/js/@ohos.remotefileshare.d.ts @@ -0,0 +1,35 @@ +/* +* Copyright (C) 2021 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 {AsyncCallback, Callback} from "./basic"; + +/** + * Provides remote file share APIs + * + * @since 8 + * @sysCap N/A + * @devices phone, tablet + */ +declare namespace Remotefileshare { + /** + * Create the remote share path of src share file. + * + * @since 8 + */ + function createSharePath(fd: number, cid: string, callback: AsyncCallback): void; + function createSharePath(fd: number, cid: string): Promise; +} + +export default Remotefileshare; diff --git a/interfaces/kits/js/remote_file_share/remote_file_share.cpp b/interfaces/kits/js/remote_file_share/remote_file_share.cpp index 9429f8ead..c02919711 100644 --- a/interfaces/kits/js/remote_file_share/remote_file_share.cpp +++ b/interfaces/kits/js/remote_file_share/remote_file_share.cpp @@ -25,7 +25,7 @@ #define HMDFS_CID_SIZE 64 namespace OHOS { -namespace FileShareAbility { +namespace RemoteFileShare { struct hmdfs_share_control { uint32_t src_fd; char cid[HMDFS_CID_SIZE]; @@ -126,14 +126,14 @@ static napi_value Init(napi_env env, napi_value exports) status = napi_define_properties(env, exports, 1, &desc); return exports; } -} // namespace FileShareAbility +} // namespace RemoteFileShare } // namespace OHOS static napi_module demoModule = { .nm_version = 1, .nm_flags = 0, .nm_filename = nullptr, - .nm_register_func = OHOS::FileShareAbility::Init, + .nm_register_func = OHOS::RemoteFileShare::Init, .nm_modname = "remotefileshare", .nm_priv = ((void *)0), .reserved = {0}, -- Gitee From b18f984e6ec725b59c19c2f34a033f6b9255ff34 Mon Sep 17 00:00:00 2001 From: wangke Date: Fri, 21 Jan 2022 11:16:29 +0800 Subject: [PATCH 6/8] fix some code style problems --- .../remote_file_share/remote_file_share.cpp | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/interfaces/kits/js/remote_file_share/remote_file_share.cpp b/interfaces/kits/js/remote_file_share/remote_file_share.cpp index c02919711..f1d0e8a7a 100644 --- a/interfaces/kits/js/remote_file_share/remote_file_share.cpp +++ b/interfaces/kits/js/remote_file_share/remote_file_share.cpp @@ -22,10 +22,11 @@ #define HMDFS_IOC 0xf2 #define HMDFS_IOC_SET_SHARE_PATH _IOW(HMDFS_IOC, 1, \ struct hmdfs_share_control) -#define HMDFS_CID_SIZE 64 namespace OHOS { namespace RemoteFileShare { +const int HMDFS_CID_SIZE = 64; +const int DEFAULT_ARGC = 2; struct hmdfs_share_control { uint32_t src_fd; char cid[HMDFS_CID_SIZE]; @@ -40,7 +41,7 @@ struct AddonData { void ExecuteWork(napi_env env, void *data) { - struct AddonData *addon_data = (struct AddonData *)data; + struct AddonData *addonData = (struct AddonData *)data; struct hmdfs_share_control sc; int32_t err = 0; std::string packagePath = "/mnt/hmdfs/0/device_view/local/data/com.example.filtestkits"; @@ -51,8 +52,8 @@ void ExecuteWork(napi_env env, void *data) return; } - sc.src_fd = addon_data->fd; - memcpy(sc.cid, addon_data->cid, HMDFS_CID_SIZE); + sc.src_fd = addonData->fd; + memcpy(sc.cid, addonData->cid, HMDFS_CID_SIZE); err = ioctl(dirFd, HMDFS_IOC_SET_SHARE_PATH, &sc); close(dirFd); @@ -60,7 +61,7 @@ void ExecuteWork(napi_env env, void *data) void WorkComplete(napi_env env, napi_status status, void *data) { - struct AddonData *addon_data = (struct AddonData *)data; + struct AddonData *addonData = (struct AddonData *)data; napi_value resPath; if (status != napi_ok) { @@ -70,18 +71,18 @@ void WorkComplete(napi_env env, napi_status status, void *data) napi_create_string_utf8(env, "/mnt/hmdfs/0/merge_view/data/com.example.filetestkits/.share/test.editshare.txt", NAPI_AUTO_LENGTH, &resPath); - napi_resolve_deferred(env, addon_data->deferred, resPath); - napi_delete_async_work(env, addon_data->work); - free(addon_data->cid); - delete addon_data; + napi_resolve_deferred(env, addonData->deferred, resPath); + napi_delete_async_work(env, addonData->work); + free(addonData->cid); + delete addonData; } static napi_value CreateSharePath(napi_env env, napi_callback_info info) { napi_value result, work_name; - struct AddonData *addon_data = new AddonData(); - size_t argc = 2; - napi_value args[2]; + struct AddonData *addonData = new AddonData(); + size_t argc = DEFAULT_ARGC; + napi_value args[DEFAULT_ARGC]; size_t copysize; napi_valuetype type = napi_undefined; @@ -95,21 +96,24 @@ static napi_value CreateSharePath(napi_env env, napi_callback_info info) if (type != napi_number) { NAPI_ASSERT(env, false, "type mismatch"); } - napi_get_value_int32(env, args[0], &(addon_data->fd)); + napi_get_value_int32(env, args[0], &(addonData->fd)); napi_typeof(env, args[1], &type); if (type != napi_string) { NAPI_ASSERT(env, false, "type mismatch"); } napi_get_value_string_utf8(env, args[1], NULL, 0, ©size); - addon_data->cid = (char *)malloc(sizeof(char) * (copysize + 1)); - addon_data->cid[copysize] = '\0'; - napi_get_value_string_utf8(env, args[1], addon_data->cid, copysize + 1, ©size); + if (copysize != HMDFS_CID_SIZE) { + NAPI_ASSERT(env, false, "cid size mismatch"); + } + addonData->cid = (char *)malloc(sizeof(char) * (copysize + 1)); + addonData->cid[copysize] = '\0'; + napi_get_value_string_utf8(env, args[1], addonData->cid, copysize + 1, ©size); - napi_create_promise(env, &addon_data->deferred, &result); + napi_create_promise(env, &addonData->deferred, &result); napi_create_string_utf8(env, "Async Work", NAPI_AUTO_LENGTH, &work_name); - napi_create_async_work(env, NULL, work_name, ExecuteWork, WorkComplete, addon_data, &(addon_data->work)); - napi_queue_async_work(env, addon_data->work); + napi_create_async_work(env, NULL, work_name, ExecuteWork, WorkComplete, addonData, &(addonData->work)); + napi_queue_async_work(env, addonData->work); return result; } -- Gitee From dffc24f6fa5f081ef109b137f64dbfbce1d8584b Mon Sep 17 00:00:00 2001 From: wangke Date: Fri, 21 Jan 2022 14:51:52 +0800 Subject: [PATCH 7/8] update readme 2022/1/21 --- README_zh.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/README_zh.md b/README_zh.md index 16311f2f9..20e9204d2 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1,8 +1,8 @@ -# 应用文件管理组件 +# 应用文件服务 ## **简介** -应用文件管理基于分布式文件系统,提供跨设备文件分享能力,包括以下内容: -1. 跨设备分享接口 +应用文件服务是为应用提供文件分享和管理能力的服务,包含应用间的文件分享能力、跨设备同应用文件分享以及跨设备跨应用文件分享的能力。 +当前已具备能力包含基于分布式文件系统提供跨设备同应用的文件分享能力。 ## **目录** ``` @@ -13,9 +13,18 @@ ## **说明** ### 接口说明 -**表1**应用文件管理接口说明 +**表1**应用文件服务接口说明 | **接口名** | **说明** | | --- | --- | -| createSharePath(fd: number, cid: string, callback: AsyncCallback\): void \| Promise\ | 将文件fd传递给分布式文件系统,创建分享路径 | +| createSharePath(fd: number, cid: string, callback: AsyncCallback\): void \| Promise\ | 将文件fd与设备cid传递给分布式文件系统,创建跨设备分享路径 | +### 使用说明 +- createSharePath +``` +import remotefileshare from'@ohos.remotefileshare' + +remotefileshare.createSharePath(fd, cid).then(function(path) { + // do something +}); +``` ## **相关仓** \ No newline at end of file -- Gitee From 26107d7d0b1054208e027be654cab647e035fa7b Mon Sep 17 00:00:00 2001 From: wangke Date: Sat, 22 Jan 2022 16:56:00 +0800 Subject: [PATCH 8/8] add async --- README_zh.md | 10 +- interfaces/kits/js/BUILD.gn | 2 +- .../remote_file_share/remote_file_share.cpp | 126 ++++++++++++++---- ohos.build | 2 +- 4 files changed, 112 insertions(+), 28 deletions(-) diff --git a/README_zh.md b/README_zh.md index 20e9204d2..2671214b4 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1,8 +1,8 @@ # 应用文件服务 ## **简介** -应用文件服务是为应用提供文件分享和管理能力的服务,包含应用间的文件分享能力、跨设备同应用文件分享以及跨设备跨应用文件分享的能力。 -当前已具备能力包含基于分布式文件系统提供跨设备同应用的文件分享能力。 +应用文件服务是为应用提供文件分享和管理能力的服务,包含应用间文件分享、跨设备同应用文件分享以及跨设备跨应用文件分享的能力。 +当前已具备基于分布式文件系统的跨设备同应用文件分享能力。 ## **目录** ``` @@ -23,8 +23,12 @@ import remotefileshare from'@ohos.remotefileshare' remotefileshare.createSharePath(fd, cid).then(function(path) { - // do something + // promise }); + +remotefileshare.createSharePath(fd, cid, function(err, path) { + // aysnc +}) ``` ## **相关仓** \ No newline at end of file diff --git a/interfaces/kits/js/BUILD.gn b/interfaces/kits/js/BUILD.gn index bcbb8ac32..b1f295fe7 100644 --- a/interfaces/kits/js/BUILD.gn +++ b/interfaces/kits/js/BUILD.gn @@ -30,6 +30,6 @@ ohos_shared_library("remotefileshare") { relative_install_dir = "module" - part_name = "filemanagement_app_file_service" + part_name = "app_file_service" subsystem_name = "filemanagement" } diff --git a/interfaces/kits/js/remote_file_share/remote_file_share.cpp b/interfaces/kits/js/remote_file_share/remote_file_share.cpp index f1d0e8a7a..58d6fe29f 100644 --- a/interfaces/kits/js/remote_file_share/remote_file_share.cpp +++ b/interfaces/kits/js/remote_file_share/remote_file_share.cpp @@ -17,6 +17,8 @@ #include "napi/native_node_api.h" #include #include +#include +#include #include #define HMDFS_IOC 0xf2 @@ -26,7 +28,16 @@ namespace OHOS { namespace RemoteFileShare { const int HMDFS_CID_SIZE = 64; -const int DEFAULT_ARGC = 2; +const int DEFAULT_PROMISE_ARGC = 2; +const int DEFAULT_ASYNC_ARGC = 3; +const int DEFAULT_AYSNC_CALLBACK_ARGC = 2; + +enum NUM { + ZERO = 0, + ONE = 1, + TWO = 2, +}; + struct hmdfs_share_control { uint32_t src_fd; char cid[HMDFS_CID_SIZE]; @@ -35,6 +46,9 @@ struct hmdfs_share_control { struct AddonData { napi_async_work work; napi_deferred deferred; + napi_ref callbackRef; + int err; + int status; int32_t fd; char *cid; }; @@ -42,36 +56,79 @@ struct AddonData { void ExecuteWork(napi_env env, void *data) { struct AddonData *addonData = (struct AddonData *)data; +#ifdef CONFIG_PERMISSION struct hmdfs_share_control sc; int32_t err = 0; - std::string packagePath = "/mnt/hmdfs/0/device_view/local/data/com.example.filtestkits"; + int32_t dirFd; + std::string packagePath = "/mnt/hmdfs/0/device_view/local/data/com.example.filesharetestcase"; std::string sharePath = packagePath + "/.share"; +#endif + + if (addonData->status == 0) + return; - int32_t dirFd = open(sharePath.c_str(), O_RDONLY); +#ifdef CONFIG_PERMISSION + dirFd = open(sharePath.c_str(), O_RDONLY); if (dirFd < 0) { + addonData->status = 0; + addonData->err = errno; return; } sc.src_fd = addonData->fd; memcpy(sc.cid, addonData->cid, HMDFS_CID_SIZE); + err = ioctl(dirFd, HMDFS_IOC_SET_SHARE_PATH, &sc); + if (err < 0) { + addonData->status = 0; + addonData->err = errno; + } close(dirFd); +#else + if (addonData->fd <= 0) + { + addonData->err = EBADF; + return; + } +#endif } void WorkComplete(napi_env env, napi_status status, void *data) { struct AddonData *addonData = (struct AddonData *)data; - napi_value resPath; + napi_value path, callback, global; + napi_value argv[DEFAULT_AYSNC_CALLBACK_ARGC], result[DEFAULT_AYSNC_CALLBACK_ARGC]; if (status != napi_ok) { return; } - napi_create_string_utf8(env, "/mnt/hmdfs/0/merge_view/data/com.example.filetestkits/.share/test.editshare.txt", - NAPI_AUTO_LENGTH, &resPath); + if (addonData->callbackRef != NULL) { + napi_get_reference_value(env, addonData->callbackRef, &callback); + napi_get_global(env, &global); + if (addonData->status) { + napi_get_null(env, &argv[NUM::ZERO]); + napi_create_string_utf8(env, "/mnt/hmdfs/0/merge_view/data/com.example.filesharetestcase/.share/test.editshare.txt", + NAPI_AUTO_LENGTH, &argv[NUM::ONE]); + napi_call_function(env, global, callback, NUM::TWO, argv, result); + } else { + napi_create_string_utf8(env, strerror(addonData->err), NAPI_AUTO_LENGTH, &argv[NUM::ZERO]); + napi_get_null(env, &argv[NUM::ONE]); + napi_call_function(env, global, callback, NUM::TWO, argv, result); + } + napi_delete_reference(env, addonData->callbackRef); + } else { + if (addonData->status) { + napi_create_string_utf8(env, "/mnt/hmdfs/0/merge_view/data/com.example.filesharetestcase/.share/test.editshare.txt", + NAPI_AUTO_LENGTH, &path); + napi_resolve_deferred(env, addonData->deferred, path); + } else { + napi_create_string_utf8(env, strerror(addonData->err), NAPI_AUTO_LENGTH, &path); + napi_reject_deferred(env, addonData->deferred, path); + } + } - napi_resolve_deferred(env, addonData->deferred, resPath); napi_delete_async_work(env, addonData->work); free(addonData->cid); delete addonData; @@ -79,40 +136,63 @@ void WorkComplete(napi_env env, napi_status status, void *data) static napi_value CreateSharePath(napi_env env, napi_callback_info info) { - napi_value result, work_name; + napi_value result, workName; struct AddonData *addonData = new AddonData(); - size_t argc = DEFAULT_ARGC; - napi_value args[DEFAULT_ARGC]; + size_t argc = DEFAULT_ASYNC_ARGC; + napi_value args[DEFAULT_ASYNC_ARGC]; size_t copysize; napi_valuetype type = napi_undefined; + addonData->status = 1; + addonData->err = 0; + addonData->callbackRef = NULL; napi_get_cb_info(env, info, &argc, args, NULL, NULL); - if (argc > 2) { - NAPI_ASSERT(env, false, "number of arguments mismatch"); + if (argc != DEFAULT_ASYNC_ARGC && argc != DEFAULT_PROMISE_ARGC) { + napi_throw_error(env, NULL, "number of arguments mismatch"); + delete addonData; + return NULL; } - napi_typeof(env, args[0], &type); + napi_typeof(env, args[NUM::ZERO], &type); if (type != napi_number) { - NAPI_ASSERT(env, false, "type mismatch"); + addonData->err = EINVAL; + addonData->status = 0; } - napi_get_value_int32(env, args[0], &(addonData->fd)); + napi_get_value_int32(env, args[NUM::ZERO], &(addonData->fd)); - napi_typeof(env, args[1], &type); + napi_typeof(env, args[NUM::ONE], &type); if (type != napi_string) { - NAPI_ASSERT(env, false, "type mismatch"); + addonData->err = EINVAL; + addonData->status = 0; } - napi_get_value_string_utf8(env, args[1], NULL, 0, ©size); + napi_get_value_string_utf8(env, args[NUM::ONE], NULL, 0, ©size); if (copysize != HMDFS_CID_SIZE) { - NAPI_ASSERT(env, false, "cid size mismatch"); + addonData->err = EINVAL; + addonData->status = 0; } addonData->cid = (char *)malloc(sizeof(char) * (copysize + 1)); addonData->cid[copysize] = '\0'; - napi_get_value_string_utf8(env, args[1], addonData->cid, copysize + 1, ©size); + napi_get_value_string_utf8(env, args[NUM::ONE], addonData->cid, copysize + 1, ©size); + + if (argc == DEFAULT_ASYNC_ARGC) { + napi_typeof(env, args[NUM::TWO], &type); + if (type != napi_function) { + addonData->err = EINVAL; + addonData->status = 0; + } else { + napi_create_reference(env, args[NUM::TWO], NUM::ONE, &addonData->callbackRef); + } + } + + if (addonData->callbackRef == NULL) { + napi_create_promise(env, &addonData->deferred, &result); + } else { + napi_get_undefined(env, &result); + } - napi_create_promise(env, &addonData->deferred, &result); - napi_create_string_utf8(env, "Async Work", NAPI_AUTO_LENGTH, &work_name); - napi_create_async_work(env, NULL, work_name, ExecuteWork, WorkComplete, addonData, &(addonData->work)); + napi_create_string_utf8(env, "Async Work", NAPI_AUTO_LENGTH, &workName); + napi_create_async_work(env, NULL, workName, ExecuteWork, WorkComplete, addonData, &(addonData->work)); napi_queue_async_work(env, addonData->work); return result; diff --git a/ohos.build b/ohos.build index f11f065ef..0ce348547 100644 --- a/ohos.build +++ b/ohos.build @@ -1,7 +1,7 @@ { "subsystem": "filemanagement", "parts": { - "filemanagement_app_file_service": { + "app_file_service": { "variants": [ "wearable", "phone" -- Gitee