diff --git a/@ohos.dlpPermission.d.ts b/@ohos.dlpPermission.d.ts new file mode 100644 index 0000000..e215732 --- /dev/null +++ b/@ohos.dlpPermission.d.ts @@ -0,0 +1,329 @@ +/* + * Copyright (c) 2022 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 } from "./basic"; + +/** + * @syscap SystemCapability.Security.DlpPermissionService + */ +declare namespace dlpPermission { + export enum AuthPermType { + /** + * Read only access to DLP file. + * @since 9 + * @syscap SystemCapability.Security.DlpPermissionService + */ + READ_ONLY = 1, + + /** + * Full control access to DLP file. + * @since 9 + * @syscap SystemCapability.Security.DlpPermissionService + */ + FULL_CONTROL = 2, + } + + /** + * Query access to DLP file from dlp permission service. + * + * @since 9 + * @syscap SystemCapability.Security.DlpPermissionService + * @return The access to a DLP file. + */ + function queryFileAccess(): Promise; + function queryFileAccess(callback: AsyncCallback): void; + + /** + * Whether current application is in DLP sandbox. + * + * @since 9 + * @syscap SystemCapability.Security.DlpPermissionService + * @return whether or not. + */ + function isInSandbox(): Promise; + function isInSandbox(callback: AsyncCallback): void; + + /** + * Get support DLP file type. + * + * @since 9 + * @syscap SystemCapability.Security.DlpPermissionService + * @return The list of supported DLP file type. + */ + function getDlpSupportFileType(): Promise>; + function getDlpSupportFileType(callback: AsyncCallback>): void; + + /** + * Install an application in DLP sandbox. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.ACCESS_DLP_FILE + * @syscap SystemCapability.Security.DlpPermissionService + * @param bundleName Indicates the bundle name of the application. + * @param access Indicates the access to DLP file. + * @param userId Indicates the user ID. + * @return the appIndex installed application. + */ + function installDlpSandbox(bundleName: string, access: AuthPermType, userId: number): Promise; + function installDlpSandbox(bundleName: string, access: AuthPermType, userId: number, callback: AsyncCallback): void; + + /** + * Uninstall an application in DLP sandbox. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.ACCESS_DLP_FILE + * @syscap SystemCapability.Security.DlpPermissionService + * @param bundleName Indicates the bundle name of the application. + * @param userId Indicates the user ID. + * @param appIndex Indicates the index of dlp sandbox. + * @return - + */ + function uninstallDlpSandbox(bundleName: string, userId: number, appIndex: number): Promise; + function uninstallDlpSandbox(bundleName: string, userId: number, appIndex: number, callback: AsyncCallback): void; + + /** + * register to the death of dlp permission service. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.ACCESS_DLP_FILE + * @syscap SystemCapability.Security.DlpPermissionService + * @param type Type of the death event of service. + * @return - + */ + function on(type: "serviceDie", callback: Callback): void; + + /** + * Listen the state of DLP sandbox. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.ACCESS_DLP_FILE + * @syscap SystemCapability.Security.DlpPermissionService + * @param bundleName Indicates the bundle name of the application. + * @param userId Indicates the user ID. + * @param appIndex Indicates the index of DLP sandbox. + * @return - + */ + export interface DlpSandboxStateParam { + bundleName: string; + userId: number; + appIndex: number; + } + + /** + * Subscribe the event reported when dlp sandbox uninstall. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.ACCESS_DLP_FILE + * @syscap SystemCapability.Security.DlpPermissionService + * @param type Type of the uninstall sandbox event. + * @param listener Indicates the listenner of dlp sandbox state. + * @return - + */ + function on(type: "uninstallDlpSandbox", listener: Callback): void; + + /** + * Unsubscribe the event reported when dlp sandbox uninstall. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.ACCESS_DLP_FILE + * @syscap SystemCapability.Security.DlpPermissionService + * @param type Type of the uninstall sandbox event. + * @param listener Indicates the listenner of dlp sandbox state. + * @return - + */ + function off(type: "uninstallDlpSandbox", listener?: Callback): void; + + export enum AccountType { + /** + * Cloud account type, type of the account for granting permissions to the DLP file. + * @since 9 + * @syscap SystemCapability.Security.DlpPermissionService + */ + CLOUD_ACCOUNT = 1, + + /** + * Domain account type, type of the account for granting permissions to the DLP file. + * @since 9 + * @syscap SystemCapability.Security.DlpPermissionService + */ + DOMAIN_ACCOUNT = 2, + + /** + * Application account type, type of the account for granting permissions to the DLP file. + * @since 9 + * @syscap SystemCapability.Security.DlpPermissionService + */ + APPLICATION_ACCOUNT = 3, + } + + export interface AuthUser { + /** + * Access authorized account + * @since 9 + */ + authAccount: string; + + /** + * Access authorized type + * @since 9 + */ + authPerm: AuthPermType; + + /** + * Permission expiry time + * @since 9 + */ + permExpiryTime: number; + + /** + * Access authorized account type + * @since 9 + */ + authAccountType: AccountType; + } + + export interface DlpProperty { + /** + * Dlp file owner account + * @since 9 + */ + ownerAccount: string; + + /** + * Dlp file authorized user list + * @since 9 + */ + authUsers?: Array; + + /** + * Dlp file authorizer contact information + * @since 9 + */ + contractAccount: string; + + /** + * Access authorized account type + * @since 9 + */ + ownerAccountType: AccountType; + } + + export interface DlpFile { + /** + * Dlp file property + * @since 9 + */ + dlpProperty: DlpProperty; + + /** + * add the link file of origin dlp file, the link file is implemented through the fuse file system. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.ACCESS_DLP_FILE + * @syscap SystemCapability.Security.DlpPermissionService + * @param linkFileName Indicates the name of link file. + * @return - + */ + addDlpLinkFile(linkFileName: string): Promise; + addDlpLinkFile(linkFileName: string, callback: AsyncCallback): void; + + /** + * delete the link file of origin dlp file, the link file is implemented through the fuse file system. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.ACCESS_DLP_FILE + * @syscap SystemCapability.Security.DlpPermissionService + * @param linkFileName Indicates the name of link file. + * @return - + */ + deleteDlpLinkFile(linkFileName: string): Promise; + deleteDlpLinkFile(linkFileName: string, callback: AsyncCallback): void; + + /** + * recover the origin plain file from dlp file. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.ACCESS_DLP_FILE + * @syscap SystemCapability.Security.DlpPermissionService + * @param plainFd Indicates the file descriptor of the origin plain file. + * @return - + */ + recoverDlpFile(plainFd: number): Promise; + recoverDlpFile(plainFd: number, callback: AsyncCallback): void; + + /** + * close the dlp file, when the object never be used. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.ACCESS_DLP_FILE + * @syscap SystemCapability.Security.DlpPermissionService + * @return - + */ + closeDlpFile(): Promise; + closeDlpFile(callback: AsyncCallback): void; + } + + /** + * generate the dlp file + * + * @since 9 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.ACCESS_DLP_FILE + * @syscap SystemCapability.Security.DlpPermissionService + * @param plainTextFd Indicates the file descriptor of the origin plain file. + * @param cipherTextFd Indicates the file descriptor of the dlp file. + * @param property Indicates the property of the dlp file. + * @return dlpFile object + */ + function generateDlpFile(plainTextFd: number, cipherTextFd: number, property: DlpProperty): Promise + function generateDlpFile(plainTextFd: number, cipherTextFd: number, property: DlpProperty, callback: AsyncCallback): void + + /** + * open the dlp file, and parse it. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.ACCESS_DLP_FILE + * @syscap SystemCapability.Security.DlpPermissionService + * @param cipherTextFd Indicates the file descriptor of the dlp file. + * @return dlpFile object + */ + function openDlpFile(cipherTextFd: number): Promise + function openDlpFile(cipherTextFd: number, callback: AsyncCallback): void + + /** + * check whether is dlp file + * + * @since 9 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.ACCESS_DLP_FILE + * @syscap SystemCapability.Security.DlpPermissionService + * @param cipherTextFd Indicates the file descriptor of the dlp file. + * @return boolean + */ + function isDlpFile(cipherTextFd: number): Promise + function isDlpFile(cipherTextFd: number, callback: AsyncCallback): void +} +export default dlpPermission; diff --git a/AppScope/app.json b/AppScope/app.json new file mode 100644 index 0000000..37a0a18 --- /dev/null +++ b/AppScope/app.json @@ -0,0 +1,13 @@ +{ + "app": { + "bundleName": "com.ohos.dlpmanager", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "minAPIVersion": 9, + "targetAPIVersion": 9, + "distributedNotificationEnabled": true + } +} diff --git a/AppScope/resources/base/element/string.json b/AppScope/resources/base/element/string.json new file mode 100644 index 0000000..3c1d4e7 --- /dev/null +++ b/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "DLPManager" + } + ] +} diff --git a/AppScope/resources/base/media/app_icon.png b/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000..ce307a8 Binary files /dev/null and b/AppScope/resources/base/media/app_icon.png differ diff --git a/BUILD.gn b/BUILD.gn new file mode 100644 index 0000000..cd89473 --- /dev/null +++ b/BUILD.gn @@ -0,0 +1,56 @@ +# Copyright (c) 2022 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_copy("dlp_permission_api") { + sources = [ "@ohos.dlpPermission.d.ts" ] + outputs = [ root_out_dir + "/ohos_declaration/ohos_declaration_ets/@ohos.dlpPermission.d.ts" ] + module_install_name = "" +} + +ohos_hap("dlp_manager") { + hap_profile = "entry/src/main/module.json" + deps = [ + ":dlp_permission_api", + ":dlp_manager_js_assets", + ":dlp_manager_resources", + ] + js_build_mode = "debug" + certificate_profile = "signature/dlpmanager.p7b" + hap_name = "dlp_manager" + part_name = "prebuilt_hap" + subsystem_name = "applications" + module_install_dir = "app/com.ohos.dlpmanager" +} + +ohos_app_scope("dlp_manager_app_profile") { + app_profile = "AppScope/app.json" + sources = [ "AppScope/resources" ] +} + +ohos_js_assets("dlp_manager_js_assets") { + ets2abc = true + source_dir = "entry/src/main/ets" +} + +ohos_resources("dlp_manager_resources") { + sources = [ + "entry/src/main/resources", + ] + deps = [ + ":dlp_manager_app_profile", + ] + hap_profile = "entry/src/main/module.json" +} \ No newline at end of file diff --git a/build-profile.json5 b/build-profile.json5 new file mode 100644 index 0000000..fb7fc61 --- /dev/null +++ b/build-profile.json5 @@ -0,0 +1,40 @@ +{ + "app": { + "signingConfigs": [ + { + "name": "default", + "material": { + "certpath": "C:/Users/l00699231/Desktop/dlpnew/DLPManager3/dlpmanager.cer", + "storePassword": "0000001921869AB129053291395B5CACC3FF7D7583EA01AE0D6E71E7BE1229027F0847C4BF7DE075AD", + "keyAlias": "dlpKey", + "keyPassword": "00000019A811E802679AF61F9AD9C5C5FB15482C580234A8DB6E69A0514503A8945591A3FB3AB353CA", + "profile": "C:/Users/l00699231/Desktop/dlpnew/DLPManager3/dlpmanager.p7b", + "signAlg": "SHA256withECDSA", + "storeFile": "C:/Users/l00699231/Desktop/dlpnew/DLPManager3/dlpmanager.p12" + } + } + ], + "compileSdkVersion": 9, + "compatibleSdkVersion": 8, + "products": [ + { + "name": "default", + "signingConfig": "default", + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/entry/.gitignore b/entry/.gitignore new file mode 100644 index 0000000..16ad228 --- /dev/null +++ b/entry/.gitignore @@ -0,0 +1,3 @@ +/node_modules +/.preview +/build \ No newline at end of file diff --git a/entry/build-profile.json5 b/entry/build-profile.json5 new file mode 100644 index 0000000..308a68d --- /dev/null +++ b/entry/build-profile.json5 @@ -0,0 +1,13 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/entry/hvigorfile.js b/entry/hvigorfile.js new file mode 100644 index 0000000..d7720ee --- /dev/null +++ b/entry/hvigorfile.js @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks diff --git a/entry/package-lock.json b/entry/package-lock.json new file mode 100644 index 0000000..6b5c677 --- /dev/null +++ b/entry/package-lock.json @@ -0,0 +1,5 @@ +{ + "name": "entry", + "version": "1.0.0", + "lockfileVersion": 1 +} diff --git a/entry/package.json b/entry/package.json new file mode 100644 index 0000000..fbf1c05 --- /dev/null +++ b/entry/package.json @@ -0,0 +1,14 @@ +{ + "license":"ISC", + "devDependencies":{}, + "name":"entry", + "ohos":{ + "org":"huawei", + "directoryLevel":"module", + "buildTool":"hvigor" + }, + "description":"example description", + "repository":{}, + "version":"1.0.0", + "dependencies":{} +} \ No newline at end of file diff --git a/entry/src/main/ets/Application/AbilityStage.ts b/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 0000000..32dfe93 --- /dev/null +++ b/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,7 @@ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("[Demo] MyAbilityStage onCreate") + } +} \ No newline at end of file diff --git a/entry/src/main/ets/DataAbility/DataAbility.ts b/entry/src/main/ets/DataAbility/DataAbility.ts new file mode 100644 index 0000000..34d7a74 --- /dev/null +++ b/entry/src/main/ets/DataAbility/DataAbility.ts @@ -0,0 +1,77 @@ +import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' +import commonEvent from '@ohos.commonEvent' +import Want from '@ohos.application.Want' +import fileio from '@ohos.fileio'; +import dlpPermission from '@ohos.dlpPermission' + +var TAG = "[DLPManager DataAbility]" +var DATAEVENT = "usual.event.SANDBOX_PACKAGE_REMOVED" +export default class DataAbility extends ServiceExtensionAbility { + sandbox2linkFile: {[key: string]: [number, dlpPermission.DlpFile, string]} = {} + subscriber = null + subscribeCallback(err, data) { + if (err.code) { + console.error("subscribe failed " + JSON.stringify(err)) + return + } + if (data.event != DATAEVENT) { + return + } + var bundleName = data.bundleName + var sandboxAppIndex = data.parameters["sandbox_app_index"] + var key = bundleName + sandboxAppIndex + try { + if (key in globalThis.sandbox2linkFile) { + var linkFile = globalThis.sandbox2linkFile[key] + fileio.closeSync(linkFile[0]) + var dlpFile = linkFile[1] + dlpFile.deleteDlpLinkFile(linkFile[2]) + dlpFile.closeDlpFile() + delete globalThis.sandbox2linkFile[key] + console.error(TAG + "release resource successfully") + } + } catch (err) { + console.error(TAG + "release resource error: " + JSON.stringify(err)) + } + } + + createSubscriber() { + var subscribeInfo = { + events: ["usual.event.SANDBOX_PACKAGE_REMOVED"], + } + + commonEvent.createSubscriber(subscribeInfo, (err, subscriber) => { + if (err.code) { + console.error(TAG + `CreateSubscriberCallBack err = ${JSON.stringify(err)}`) + } else { + console.log(TAG + "CreateSubscriber") + this.subscriber = subscriber + commonEvent.subscribe(this.subscriber, this.subscribeCallback) + } + }) + } + + onCreate(want) { + globalThis.context = this.context + } + + onRequest(want: Want, startId: number) { + if(this.subscriber == null) { + this.createSubscriber() + } + } + + onDestroy() { + console.log(TAG + "onDestroy") + if (this.subscriber != null) { + commonEvent.unsubscribe(this.subscriber, (err) => { + if (err.code) { + console.error(TAG, `[CommonEvent]UnsubscribeCallBack err= = ${JSON.stringify(err)}`) + } else { + console.info(TAG, "[CommonEvent]Unsubscribe") + this.subscriber = null + } + }) + } + } +} \ No newline at end of file diff --git a/entry/src/main/ets/MainAbility/MainAbility.ts b/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 0000000..be117cd --- /dev/null +++ b/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,42 @@ +import Ability from '@ohos.application.Ability' +import window from '@ohos.window'; + +var TAG = "[DLPManager]" +let permissionList: Array = [ + "ohos.permission.READ_MEDIA", + "ohos.permission.WRITE_MEDIA", + "ohos.permission.FILE_ACCESS_MANAGER" +] + +export default class MainAbility extends Ability { + async onCreate(want, launchParam) { + console.log("[DLPManager] MainAbility onCreate") + globalThis.abilityWant = want; + globalThis.context = this.context + } + + onDestroy() { + console.log("[DLPManager] MainAbility onDestroy") + } + + async onWindowStageCreate(windowStage) { + console.log("[DLPManager] MainAbility onWindowStageCreate") + globalThis.context.requestPermissionsFromUser(permissionList) + windowStage.setUIContent(this.context, "pages/index", null) + windowStage.getMainWindow().then((win) => { + win.setBackgroundColor("#00FFFFFF") + }) + } + + onWindowStageDestroy() { + console.log(TAG + "MainAbility onWindowStageDestroy") + } + + onForeground() { + console.log(TAG + "[DLPManager] MainAbility onForeground") + } + + onBackground() { + console.log(TAG + "[DLPManager] MainAbility onBackground") + } +}; diff --git a/entry/src/main/ets/ViewAbility/ViewAbility.ts b/entry/src/main/ets/ViewAbility/ViewAbility.ts new file mode 100644 index 0000000..d7c3377 --- /dev/null +++ b/entry/src/main/ets/ViewAbility/ViewAbility.ts @@ -0,0 +1,139 @@ +import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' +import dlpPermission from '@ohos.dlpPermission' +import { getOsAccountInfo, getUserId, getAuthPerm, startAlertAbility } from '../common/utils' +import fileio from '@ohos.fileio'; +import Want from '@ohos.application.Want'; +import commonEvent from '@ohos.commonEvent'; +import Constants from '../common/constant' + +var TAG = "[DLPManager ViewAbility]" +export default class ViewAbility extends ServiceExtensionAbility { + linkFd: number = -1 + linkFileName: string = '' + linkFilePath: string = '' + sandboxIndex: number = -1 + dlpFile: dlpPermission.DlpFile = null + authPerm: dlpPermission.AuthPermType = dlpPermission.AuthPermType.READ_ONLY + sandboxBundleName: string = '' + sandboxAbilityName: string = '' + sandboxModuleName: string = '' + isCreated: boolean = false + + async onCreate(want) { + globalThis.context = this.context + if (!globalThis.sandbox2linkFile) { + globalThis.sandbox2linkFile = {} + } + } + + async startDataAbility() { + let want = { + bundleName: "com.ohos.dlpmanager", + abilityName: "DataAbility" + } + await globalThis.context.startAbility(want) + } + + startSandboxApp() { + let want: Want = { + bundleName: this.sandboxBundleName, + abilityName: this.sandboxAbilityName, + parameters: { + keyFd: { + type: "FD", value: this.linkFd + }, + "ohos.dlp.params.index": this.sandboxIndex, + "ohos.dlp.params.moduleName": this.sandboxModuleName, + "ohos.dlp.params.securityFlag": this.authPerm == + dlpPermission.AuthPermType.FULL_CONTROL ? false : true + } + } + globalThis.context.startAbility(want, async (err, data) => { + if (err && err.code != 0) { + console.error(TAG + "startSandboxApp failed, error" + JSON.stringify(err)) + try { + fileio.closeSync(this.linkFd) + await this.dlpFile.deleteDlpLinkFile(this.linkFileName) + this.dlpFile.closeDlpFile() + startAlertAbility(Constants.APP_ERROR, Constants.APP_SANDBOX_ERROR) + } catch (err) { + console.log(TAG + "deleteDlpLinkFile failed, error" + JSON.stringify(err)) + } + } else { + globalThis.sandbox2linkFile[this.sandboxBundleName + this.sandboxIndex] = + [this.linkFd, this.dlpFile, this.linkFileName] + await this.startDataAbility() + } + globalThis.context.terminateSelf() + }) + } + + async onRequest(want: Want, startId: number) { + try { + var srcFd = want.parameters.keyFd.value + this.sandboxBundleName = want.parameters["ohos.dlp.params.bundleName"] + this.sandboxAbilityName = want.parameters["ohos.dlp.params.abilityName"] + this.sandboxModuleName = want.parameters["ohos.dlp.params.moduleName"] + } catch (err) { + console.log(TAG + "parse parameters failed, error: " + JSON.stringify(err)) + startAlertAbility(Constants.APP_ERROR, Constants.APP_PARAM_ERROR) + return + } + try { + var accountInfo = await getOsAccountInfo() + var userId = await getUserId() + console.log(TAG + "account name: " + + accountInfo.distributedInfo.name + ", userId: " + userId) + } catch (err) { + console.log(TAG + "get account info failed, error: " + JSON.stringify(err)) + startAlertAbility(Constants.APP_ERROR, Constants.APP_GET_ACCOUNT_ERROR) + return + } + try { + this.dlpFile = await dlpPermission.openDlpFile(srcFd) + } catch (err) { + console.log(TAG + "openDlpFile failed, error: " + JSON.stringify(err)) + if (err.code == 1 && err.extra != undefined) { + startAlertAbility(Constants.APP_VISIT_FILE_ERROR, + Constants.APP_NOT_HAVE_PERM_VISIT + err.extra) + } else { + startAlertAbility(Constants.APP_DLP_ERROR,Constants.APP_FILE_PARAM_ERROR ) + } + return + } + this.authPerm = getAuthPerm(accountInfo.distributedInfo.name, this.dlpFile.dlpProperty) + try { + this.sandboxIndex = await dlpPermission.installDlpSandbox(this.sandboxBundleName, + this.authPerm, userId) + } catch (err) { + console.log(TAG + "installDlpSandbox failed, error: " + JSON.stringify(err)) + this.dlpFile.closeDlpFile() + if (err.code == 8519807) { + startAlertAbility(Constants.APP_ERROR, Constants.APP_SANDBOX_LIMIT_MAX) + } else { + startAlertAbility(Constants.APP_ERROR, Constants.APP_INSTALL_SANDBOX_ERROR) + } + return + } + var date = new Date() + var timestamp = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), + date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getMilliseconds()).getTime() + this.linkFileName = this.sandboxBundleName + this.sandboxIndex + timestamp + ".dlp.link" + try { + await this.dlpFile.addDlpLinkFile(this.linkFileName) + } catch (err) { + console.log(TAG + "addDlpLinkFile failed, error: " + JSON.stringify(err)) + this.dlpFile.closeDlpFile() + startAlertAbility(Constants.APP_ERROR, Constants.APP_LINK_FILE_ERROR) + return + } + this.linkFilePath = "/data/fuse/" + this.linkFileName + if (this.authPerm == dlpPermission.AuthPermType.READ_ONLY) { + this.linkFd = fileio.openSync(this.linkFilePath, 0o100, 0o666) + } + else if (this.authPerm == dlpPermission.AuthPermType.FULL_CONTROL) { + this.linkFd = fileio.openSync(this.linkFilePath, 0o102, 0o666) + } + this.startSandboxApp() + } +} diff --git a/entry/src/main/ets/common/components/authorizer_panel.ets b/entry/src/main/ets/common/components/authorizer_panel.ets new file mode 100644 index 0000000..4025bc9 --- /dev/null +++ b/entry/src/main/ets/common/components/authorizer_panel.ets @@ -0,0 +1,193 @@ +import dlpPermission from '@ohos.dlpPermission' +import {DlpAlertDialog} from '../components/dlp_alert_dialog' +import Constants from'../constant' + +var TAG = "DLPManager: " +@Component +struct AuthorizerPanel { + scroller: Scroller = new Scroller() + contactToAdd : string = '' + dlpAlertDialog : CustomDialogController + @Link authPerm : number + @Link isChanged : boolean + @State showContacts : boolean = true + @State contacts: { [key: string]: string} = {} + @Link dlpFile : dlpPermission.DlpFile + @State contactList: string[] = [] + + updateContactList () { + this.contactList = [] + for (var item in this.contacts) { + this.contactList.push(item) + } + this.dlpFile.dlpProperty.contractAccount = this.contactList.join(";") + } + + aboutToAppear() { + if (this.dlpFile.dlpProperty.contractAccount.length == 0) { + return + } + this.contactList = this.dlpFile.dlpProperty.contractAccount.split(';') + for (var i = 0; i < this.contactList.length; ++i) { + this.contacts[this.contactList[i]] = '' + } + } + + @Builder ListItemLayout(item: string) { + ListItem() { + Column() { + Row() { + Text(item) + .maxLines(Constants.AP_TEXT_MAX_LINE) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .fontSize(Constants.AP_TEXT_FONT_SIZE) + .fontWeight(FontWeight.Medium) + .fontFamily($r('app.string.typeface')) + .lineHeight(Constants.AP_TEXT_LINE_HEIGHT) + .width(Constants.AP_TEXT_WIDTH) + .padding({right: Constants.AP_TEXT_PAD_RIGHT}) + .align(Alignment.Start) + Image($r('app.media.ic_public_delete')) + .enabled(this.authPerm == 2 ? true : false) + .width(Constants.PP_IMAGE_WIDTH) + .height(Constants.PP_IMAGE_HEIGHT) + .padding(Constants.PP_IMAGE_PAD) + .onClick((event) => { + delete this.contacts[item] + this.updateContactList() + this.isChanged = true + }) + } + .height(Constants.PP_ROW_HEIGHT) + Line() + .width(Constants.PP_LINE_WIDTH) + .height(Constants.PP_LINE_HEIGHT) + .backgroundColor($r('app.color.pp_line_background_color')) + } + .height(Constants.AP_COLUMN_HEIGHT) + .alignItems(HorizontalAlign.Start) + } + } + + build() { + Column() { + Row() { + Text($r('app.string.authorizer_panel_title')) + .fontColor($r("app.color.text_color")) + .fontFamily($r('app.string.typeface')) + .fontWeight(FontWeight.Regular) + .fontSize(Constants.AP_TEXT_FONT_SIZE) + .lineHeight(Constants.AP_TEXT_LINE_HEIGHT) + .margin({top: Constants.AP_MARGIN_TOP}) + .width(Constants.PP_TEXT_WIDTH_FULL) + .align(Alignment.Start) + } + .height(Constants.AP_COLUMN_HEIGHT) + .opacity(Constants.AP_COLUMN_OPACITY) + if (this.showContacts) { + if (this.contactList.length > 0) { + Scroll(this.scroller) { + List() { + ForEach(this.contactList, (item) => { + this.ListItemLayout(item) + }) + } + } + .height(Constants.AP_LIST_HEIGHT) + .width(Constants.PP_TEXT_WIDTH_FULL) + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarWidth(Constants.AP_LIST_BAR_WIDTH) + } + Row() { + Button($r('app.string.button_add_user')) + .enabled(this.authPerm == 2 ? true : false) + .fontSize(Constants.AP_TEXT_FONT_SIZE) + .fontColor($r('app.color.button_color')) + .fontFamily($r('app.string.typeface')) + .fontWeight(FontWeight.Medium) + .focusable(false) + .height(Constants.AP_BUTTON_HEIGHT) + .backgroundColor($r('app.color.pp_button_background_color')) + .padding(Constants.AP_BUTTON_PAD) + .onClick((event) => { + this.showContacts = false + }) + } + .align(Alignment.Start) + .width(Constants.PP_TEXT_WIDTH_FULL) + .height(Constants.AP_ROW_HEIGHT) + } else { + Row() { + TextInput() + .height(Constants.AP_TEXT_INPUT_HEIGHT) + .padding({top: Constants.AP_TEXT_PAD_TOP, bottom: Constants.AP_TEXT_PAD_BOTTOM}) + .fontSize(Constants.AP_TEXT_FONT_SIZE) + .borderRadius(Constants.AP_ROW_RADIUS) + .backgroundColor($r('app.color.pp_row_background_color')) + .fontFamily($r('app.string.typeface')) + .fontWeight(FontWeight.Regular) + .onChange((value: string) => { + this.contactToAdd = value + }) + } + .padding({right: Constants.AP_ROW_PAD_RIGHT}) + Line() + .width(Constants.AP_LINE_WIDTH) + .height(Constants.AP_LINE_HEIGHT) + .backgroundColor($r('app.color.pp_line_background_color')) + Row() { + Button($r('app.string.add')) + .fontSize(Constants.AP_TEXT_FONT_SIZE) + .fontColor($r('app.color.button_color')) + .fontFamily('app.string.HarmonyHeiTi') + .fontWeight(FontWeight.Medium) + .height(Constants.AP_BUTTON_HEIGHT) + .padding(Constants.AP_BUTTON_PAD) + .backgroundColor($r('app.color.button_background_color')) + .onClick((event) => { + if (this.contactToAdd.length > 1024) { + this.dlpAlertDialog = new CustomDialogController({ + builder: DlpAlertDialog({ + title: Constants.PP_TITLE, + message: Constants.PP_MESSAGE, + }), + autoCancel: false, + customStyle: true + }) + this.dlpAlertDialog.open() + return + } + if (this.contactToAdd.length != 0) { + this.contacts[this.contactToAdd] = "" + this.updateContactList() + } + this.contactToAdd = '' + this.showContacts = true + this.isChanged = true + }) + Button($r('app.string.cancel')) + .fontSize(Constants.AP_BUTTON_FONT_SIZE) + .fontColor($r('app.color.button_color')) + .fontFamily('app.string.HarmonyHeiTi') + .fontWeight(FontWeight.Medium) + .height(Constants.AP_BUTTON_HEIGHT) + .padding(Constants.AP_BUTTON_PAD) + .margin({left: Constants.AP_BUTTON_MARGIN_LEFT}) + .focusable(false) + .backgroundColor($r('app.color.pp_button_background_color')) + .onClick((event) => { + this.showContacts = true + }) + } + .width(Constants.PP_TEXT_WIDTH_FULL) + .height(Constants.AP_ROW_HEIGHT) + .align(Alignment.Start) + } + } + .padding({left: Constants.AP_COLUMN_PAD_LEFT, right:Constants.AP_COLUMN_PAD_RIGHT}) + .alignItems(HorizontalAlign.Start) + } +} + +export {AuthorizerPanel} \ No newline at end of file diff --git a/entry/src/main/ets/common/components/del_user_alert.ets b/entry/src/main/ets/common/components/del_user_alert.ets new file mode 100644 index 0000000..2b30aa4 --- /dev/null +++ b/entry/src/main/ets/common/components/del_user_alert.ets @@ -0,0 +1,78 @@ +import Constants from'../constant' + +@CustomDialog +struct DelUserAlertDialog { + controller : CustomDialogController + cancel: () => void + confirm: () => void + build() { + Column() { + Row() { + Text($r('app.string.del_usr')) + .lineHeight(Constants.DU_TEXT_LINE_HEIGHT) + .width(Constants.DU_WIDTH_FULL) + .fontFamily($r('app.string.typeface')) + .fontSize(Constants.DU_TEXT_FONT_SIZE) + .fontColor($r('app.color.pp_text_fontcolor')) + .fontWeight(FontWeight.Medium) + } + .height(Constants.DU_ROW_HEIGHT) + .width(Constants.DU_ROW_WIDTH) + Row() { + Scroll() { + Text($r('app.string.del_text1')) + .lineHeight(Constants.DU_SCROLL_LINE_HEIGHT) + .width(Constants.DU_WIDTH_FULL) + .fontFamily('app.string.HarmonyHeiTi') + .fontSize(Constants.DU_SCROLL_FONT_SIZE) + .fontColor($r('app.color.del_scroll_font_color')) + .fontWeight(FontWeight.Regular) + } + .scrollBarColor(Color.Gray).scrollBarWidth(Constants.DU_SCROLL_BAR_WIDTH) + .constraintSize({maxHeight: Constants.DU_CONS_MAX_HEIGHT}) + } + .margin({top: Constants.DU_MARGIN_TOP}) + .width(Constants.DU_ROW_WIDTH) + Row() { + Button($r('app.string.cancel')) + .width(Constants.DU_WIDTH_SPE) + .height(Constants.DU_BUTTON_HEIGHT) + .fontSize(Constants.DU_BUTTON_FONT_SIZE) + .fontFamily($r('app.string.typeface')) + .fontWeight(FontWeight.Medium) + .fontColor($r("app.color.button_color")) + .backgroundColor($r('app.color.pp_button_background_color')) + .onClick(() => { + this.controller.close() + }) + Line() + .width(Constants.DU_LINE_WIDTH) + .height(Constants.DU_LINE_HEIGHT) + .margin({top: Constants.DU_LINE_MARGIN_TOP}) + .backgroundColor($r('app.color.pp_line_background_color')) + Button($r('app.string.button_del')) + .width(Constants.DU_BUTTON_WIDTH) + .height(Constants.DU_BUTTON_HEIGHT) + .fontSize(Constants.DU_BUTTON_FONT_SIZE) + .fontFamily($r('app.string.typeface')) + .fontWeight(FontWeight.Medium) + .fontColor($r('app.color.del_button_font_color')) + .backgroundColor($r('app.color.pp_button_background_color')) + .onClick(() => { + this.controller.close() + this.confirm() + }) + } + .width(Constants.DU_ROW_WIDTH2) + .alignItems(VerticalAlign.Top) + .margin({ top: Constants.DU_LINE_MARGIN_TOP2 }) + .height(Constants.DU_ROW_HEIGHT) + } + .width(Constants.DU_ROW_WIDTH3) + .backgroundColor($r('app.color.pp_row_background_color')) + .borderRadius(Constants.DU_BORDER_RADIUS) + .alignItems(HorizontalAlign.Center) + } +} + +export {DelUserAlertDialog} diff --git a/entry/src/main/ets/common/components/dlp_alert_dialog.ets b/entry/src/main/ets/common/components/dlp_alert_dialog.ets new file mode 100644 index 0000000..4ab10e8 --- /dev/null +++ b/entry/src/main/ets/common/components/dlp_alert_dialog.ets @@ -0,0 +1,66 @@ +import Constants from'../constant' + +@CustomDialog +struct DlpAlertDialog { + controller : CustomDialogController + title: string + message: string + action: () => void = null + build() { + Column() { + Row() { + Text(this.title) + .lineHeight(Constants.DA_TEXT_LINE_HEIGHT) + .width(Constants.DU_WIDTH_FULL) + .fontFamily($r('app.string.typeface')) + .fontSize(Constants.DA_FONT_SIZE) + .fontColor($r('app.color.da_font_color')) + .fontWeight(FontWeight.Medium) + } + .height(Constants.DA_ROW_HEIGHT) + .width(Constants.DA_ROW_WIDTH) + Row() { + Scroll() { + Text(this.message) + .lineHeight(Constants.DA_SCROLL_LINE_HEIGHT) + .width(Constants.DU_WIDTH_FULL) + .fontFamily($r('app.string.typeface')) + .fontSize(Constants.DA_SCROLL_FONT_SIZE) + .fontColor($r('app.color.da_scroll_font_color')) + .fontWeight(FontWeight.Regular) + } + .scrollBarColor(Color.Gray).scrollBarWidth(Constants.DA_SCROLL_BAR_WIDTH) + .constraintSize({maxHeight: Constants.DA_STRAIN_SIZE_MA_HEIGHT}) + } + .margin({top: Constants.DA_MARGIN_TOP}) + .width(Constants.DA_SCROLL_WIDTH); + Row() { + Button($r('app.string.da_buttion')) + .width(Constants.ROW_BUTTON_WIDTH) + .height(Constants.ROW_BUTTON_HEIGHT) + .fontSize(Constants.ROW_FONT_SIZE) + .fontFamily($r('app.string.typeface')) + .fontWeight(FontWeight.Medium) + .fontColor($r("app.color.button_color")) + .backgroundColor($r('app.color.da_background_color')) + .onClick(() => { + this.controller.close() + if (this.action != null) { + this.action() + } else { + globalThis.context.terminateSelf() + } + }) + } + .alignItems(VerticalAlign.Top) + .margin({ top: Constants.ROW_MARGIN_TOP }) + .height(Constants.DA_ROW_HEIGHT) + } + .width(Constants.DA_COLOUM_WIDTH) + .backgroundColor($r('app.color.da_background_color')) + .borderRadius(Constants.DA_COLOUM_RADIUS) + .alignItems(HorizontalAlign.Center) + } +} + +export {DlpAlertDialog} \ No newline at end of file diff --git a/entry/src/main/ets/common/components/footer.ets b/entry/src/main/ets/common/components/footer.ets new file mode 100644 index 0000000..0c66cb4 --- /dev/null +++ b/entry/src/main/ets/common/components/footer.ets @@ -0,0 +1,173 @@ +import dlpPermission from '@ohos.dlpPermission' +import fileio from "@ohos.fileio"; +import dataShare from '@ohos.data.dataShare'; +import datafile from '@ohos.data.fileAccess'; +import Constants from '../constant' + +var TAG: string = "DLPManager: " + +var filePickerWant = { + bundleName: "com.ohos.filepicker", + abilityName: "MainAbility", + parameters: { + 'startMode': 'save', + 'saveFile': '', + } +} + +var filePickerOptions = { + windowMode: 102 +} +var suffix_length = 4; +@Component +struct Footer { + srcFilename: string + srcFd: number + isDlpFile: boolean + @Link isChanged: boolean + @Link dlpFile: dlpPermission.DlpFile + @Link needProtect: boolean + + async postProcessForSetting() { + var filename = this.srcFilename.substr(0, this.srcFilename.length - suffix_length) + if (this.needProtect) { + try { + var filePath = globalThis.context.filesDir + "/" + filename + (new Date().getTime()) + var tempFd = fileio.openSync(filePath, 0o102, 0o666) + await this.dlpFile.recoverDlpFile(tempFd) + console.info(TAG + "filePath" + filePath + ", DlpProperty: " + JSON.stringify(this.dlpFile.dlpProperty)) + await this.dlpFile.closeDlpFile() + this.dlpFile = await dlpPermission.generateDlpFile(tempFd, this.srcFd, this.dlpFile.dlpProperty) + fileio.closeSync(tempFd) + fileio.unlinkSync(filePath) + await this.dlpFile.closeDlpFile() + globalThis.context.terminateSelf() + } catch (err) { + console.error(TAG + "error: " + JSON.stringify(err)) + } + } else { + filePickerWant.parameters.saveFile = filename + globalThis.context.startAbilityForResult(filePickerWant, filePickerOptions, async (error, data) => { + console.log(TAG + JSON.stringify(error) + ", data: " + JSON.stringify(data)) + var uri = data.want.parameters.result + try { + var dsHelper = await datafile.createFileAccessHelper(globalThis.context) + } catch (err) { + console.error(TAG + "createFileAccessHelper error: " + JSON.stringify(err)) + } + try { + var dstFd = await dsHelper.openFile(uri, 0o2) + } catch (err) { + console.error(TAG + "openFile error: " + JSON.stringify(err)) + } + try { + await this.dlpFile.recoverDlpFile(dstFd) + } catch (err) { + console.error(TAG + "recoverDlpFile error: " + JSON.stringify(err)) + } + try { + await this.dlpFile.closeDlpFile() + globalThis.context.terminateSelf() + } catch (err) { + console.error(TAG + "closeDlpFile error: " + JSON.stringify(err)) + } + }) + } + } + + postProcessForEncrypting() { + if (!this.needProtect || this.srcFilename == undefined || this.srcFilename.length == 0) { + console.log("DlpManager no need to be protected") + globalThis.context.terminateSelf() + return + } + filePickerWant.parameters.saveFile = this.srcFilename + '.dlp' + globalThis.context.startAbilityForResult(filePickerWant, filePickerOptions, async (error, data) => { + console.log(TAG + JSON.stringify(error) + ", data: " + JSON.stringify(data)) + var uri: string = data.want.parameters.result + if (uri.length == 0) { + return + } + try { + var dsHelper = await datafile.createFileAccessHelper(globalThis.context) + } catch (err) { + console.error(TAG + "createFileAccessHelper error: " + JSON.stringify(err)) + return + } + try { + var dstFd = await dsHelper.openFile(uri, 0o2) + } catch (err) { + console.error(TAG + "openFile error: " + JSON.stringify(err)) + return + } + try { + this.dlpFile = await dlpPermission.generateDlpFile(this.srcFd, dstFd, this.dlpFile.dlpProperty) + } catch (err) { + console.error(TAG + "generateDlpFile error: " + JSON.stringify(err)) + return + } + try { + await this.dlpFile.closeDlpFile() + globalThis.context.terminateSelf() + } catch (err) { + console.error(TAG + "closeDlpFile error: " + JSON.stringify(err)) + } + }) + } + + build() { + Row() { + Button($r('app.string.ban'), { type: ButtonType.Normal }) + .fontColor($r('app.color.button_color')) + .fontFamily($r('app.string.typeface')) + .backgroundColor($r("app.color.button_background_color")) + .width(Constants.FOOTER_WIDTH) + .focusable(false) + .height(Constants.FOOTER_HEIGHT) + .onClick(async (event) => { + if (this.isDlpFile) { + try { + await this.dlpFile.closeDlpFile() + } catch (err) { + console.error(TAG + "error: " + JSON.stringify(err)) + } + } + globalThis.context.terminateSelf() + }) + Line() + .width(Constants.FOOTER_LINE_WIDTH) + .height(Constants.FOOTER_LINE_HEIGHT) + .backgroundColor($r('app.color.footer_line_background_color')) + Button(this.needProtect ? $r('app.string.save') : $r('app.string.sure'), { type: ButtonType.Normal }) + .fontColor($r('app.color.button_color')) + .fontFamily($r('app.string.typeface')) + .backgroundColor($r("app.color.button_background_color")) + .width(Constants.FOOTER_BUTTON_WIDTH) + .focusable(false) + .enabled((this.needProtect || this.isDlpFile)) + .opacity((this.needProtect || this.isDlpFile) ? + Constants.FOOTER_OPACITY_ONE : Constants.FOOTER_OPACITY_SEPC) + .height(Constants.FOOTER_BUTTON_HEIGHT) + .onClick((event) => { + if (this.dlpFile.dlpProperty.contractAccount.length == 0) { + this.dlpFile.dlpProperty.contractAccount = globalThis.accountInfo.distributedInfo.name + } + if (this.isDlpFile) { + this.postProcessForSetting() + } else { + this.postProcessForEncrypting() + } + }) + } + .width(Constants.FOOTER_ROW_WIDTH) + .height(Constants.FOOTER_ROW_HEIGHT) + .margin({ top: Constants.FOOTER_ROW_MARGIN }) + .padding({ + bottom: Constants.FOOTER_ROW_PAD_BOTTOM, + left: Constants.FOOTER_ROW_PAD_LEFT, + right: Constants.FOOTER_ROW_PAD_RIGHT + }) + } +} + +export { Footer } \ No newline at end of file diff --git a/entry/src/main/ets/common/components/header.ets b/entry/src/main/ets/common/components/header.ets new file mode 100644 index 0000000..7b6db47 --- /dev/null +++ b/entry/src/main/ets/common/components/header.ets @@ -0,0 +1,53 @@ +import dlpPermission from '@ohos.dlpPermission' +import Constants from '../constant' + +@Component +struct Header { + @Link authPerm : number + @Link needProtect : boolean + build() { + Column() { + Column({}) { + Text($r('app.string.header_title')) + .fontWeight(FontWeight.Bold) + .fontFamily($r('app.string.typeface')) + .fontColor($r('app.color.text_color')) + .fontSize(Constants.HEADER_TEXT_FRONT_SIZE) + .lineHeight(Constants.HEADER_TEXT_LINE_HEIGHT) + .margin({top: Constants.HEADER_TEXT_MARGIN_TOP}) + .width(Constants.HEADER_TEXT_WIDTH) + .align(Alignment.Start) + } + .width(Constants.HEADER_COLUMN_WIDTH) + .height(Constants.HEADER_COLUMN_HEIGHT) + .padding({left: Constants.HEADER_COLUMN_PAD_LEFT, right: Constants.HEADER_COLUMN_PAD_RIGHT}) + Row() { + Flex({justifyContent: FlexAlign.SpaceBetween}) { + Row() { + Text($r('app.string.toggle_title')) + .fontFamily($r('app.string.typeface')) + .fontWeight(FontWeight.Medium) + .fontColor($r('app.color.text_color')) + .fontSize(Constants.HEADER_ROW_FONT_SIZE) + .lineHeight(Constants.HEADER_ROW_LINE_HEIGHT) + } + .alignItems(VerticalAlign.Center) + Toggle({ type: ToggleType.Switch, isOn: this.needProtect}) + .enabled(this.authPerm == 2 ? true : false) + .selectedColor($r("app.color.toggle_color")) + .width(Constants.HEADER_TOGGLE_WIDTH) + .height(Constants.HEADER_TOGGLE_HEIGHT) + .focusable(false) + .onChange((isOn) => { + this.needProtect = isOn ? true : false + }) + } + } + .height(Constants.HEADER_ROW_HEIGHT) + .margin({top: Constants.HEADER_ROW_MARGIN_TOP}) + .padding({left: Constants.HEADER_ROW_PAD_LEFT, right: Constants. HEADER_ROW_PAD_RIGHT}) + } + } +} + +export {Header} \ No newline at end of file diff --git a/entry/src/main/ets/common/components/permission_panel.ets b/entry/src/main/ets/common/components/permission_panel.ets new file mode 100644 index 0000000..aec0a2a --- /dev/null +++ b/entry/src/main/ets/common/components/permission_panel.ets @@ -0,0 +1,273 @@ +import dlpPermission from '@ohos.dlpPermission' +import {DelUserAlertDialog} from '../components/del_user_alert' +import {DlpAlertDialog} from '../components/dlp_alert_dialog' +import Constants from'../constant' + +var TAG = "DLPManager: " +@Component +struct PermissionPanel { + scroller: Scroller = new Scroller() + account : string = '' + radioImg = [$r('app.media.radiodefault'), $r('app.media.radio_selected')] + delUserDialogController: CustomDialogController + dlpAlertDialog: CustomDialogController + @Link authPerm: number + @Link isChanged: boolean + @Link dlpFile: dlpPermission.DlpFile + @State authUserMap: { [key: string] : dlpPermission.AuthUser } = {} + @State authUsers: Array = [] + @State showAuthUsers : boolean = true + + updateAuthUsers() { + this.authUsers = [] + this.dlpFile.dlpProperty.authUsers = [] + for (var item in this.authUserMap) { + let authUser = this.authUserMap[item] + this.authUsers.push(authUser) + this.dlpFile.dlpProperty.authUsers.push(authUser) + } + } + + aboutToAppear() { + this.authUsers = this.dlpFile.dlpProperty.authUsers + for (var i = 0; i < this.authUsers.length; ++i) { + var authUser = this.authUsers[i] + this.authUserMap[authUser.authAccount] = authUser + } + } + + @Builder ListItemLayout(item: dlpPermission.AuthUser) { + ListItem() { + Column() { + Row() { + Text(item.authAccount) + .maxLines(Constants.PP_TEXT_MAX_LINE) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .fontSize(Constants.PP_TEXT_FONT_SIZE) + .fontWeight(FontWeight.Medium) + .fontFamily($r('app.string.typeface')) + .lineHeight(Constants.PP_TEXT_LINE_HEIGHT) + .width(Constants.PP_TEXT_WIDTH) + .padding({right: Constants.PP_TEXT_PAD_RIGHT}) + Image(this.radioImg[2 - item.authPerm]) + .enabled(this.authPerm == 2 ? true : false) + .width(Constants.PP_IMAGE_WIDTH) + .height(Constants.PP_IMAGE_HEIGHT) + .padding(Constants.PP_IMAGE_PAD) + .onClick((event) => { + var authUser = this.authUserMap[item.authAccount] + authUser.authPerm = dlpPermission.AuthPermType.READ_ONLY + authUser.permExpiryTime = Date.UTC(2023, 1, 1) + this.updateAuthUsers() + }) + Column() { + Image(this.radioImg[item.authPerm - 1]) + .enabled(this.authPerm == 2 ? true : false) + .width(Constants.PP_IMAGE_WIDTH) + .height(Constants.PP_IMAGE_HEIGHT) + .padding(Constants.PP_IMAGE_PAD) + .onClick((event) => { + var authUser = this.authUserMap[item.authAccount] + authUser.authPerm = dlpPermission.AuthPermType.FULL_CONTROL + authUser.permExpiryTime = Date.UTC(2023, 1, 1) + this.updateAuthUsers() + }) + } + .alignItems(HorizontalAlign.Center) + .width(Constants.PP_COLUMN_WIDTH) + .margin({ left: Constants.PP_COLUMN_MARGIN_LEFT, right: Constants.PP_COLUMN_MARGIN_RIGHT }) + Image($r('app.media.ic_public_delete')) + .enabled(this.authPerm == 2 ? true : false) + .width(Constants.PP_IMAGE_WIDTH) + .height(Constants.PP_IMAGE_HEIGHT) + .padding(Constants.PP_IMAGE_PAD) + .onClick((event) => { + this.delUserDialogController = new CustomDialogController({ + builder: DelUserAlertDialog({ cancel: null, confirm: () => { + delete this.authUserMap[item.authAccount] + this.updateAuthUsers() + this.isChanged = true + } }), + autoCancel: true, + customStyle: true + }) + this.delUserDialogController.open() + }) + } + .height(Constants.PP_ROW_HEIGHT) + Line() + .width(Constants.PP_LINE_WIDTH) + .height(Constants.PP_LINE_HEIGHT) + .backgroundColor($r('app.color.pp_line_background_color')) + } + .alignItems(HorizontalAlign.Start) + } + } + + build() { + Column() { + Row() { + Text($r('app.string.toggle_tip')) + .fontColor($r("app.color.text_color")) + .fontWeight(FontWeight.Regular) + .fontFamily($r('app.string.typeface')) + .fontSize(Constants.PP_TEXT_FONT_SIZE) + .lineHeight(Constants.PP_TEXT_LINE_HEIGHT) + .align(Alignment.Start) + .width(Constants.PP_TEXT_WIDTH_FULL) + } + .height(Constants.PP_TEXT_HEIGHT) + .opacity(Constants.PP_TEXT_OPACITY) + Row () { + Text($r('app.string.perm_panel_title')) + .fontColor($r("app.color.text_color")) + .fontFamily($r('app.string.typeface')) + .fontWeight(FontWeight.Regular) + .width(Constants.PP_TEXT_WIDTH_FULL) + .lineHeight(Constants.PP_TEXT_LINE_HEIGHT) + .margin({top: Constants.PP_TEXT_MARGIN_TOP}) + .align(Alignment.Start) + .fontSize(Constants.PP_TEXT_FONT_SIZE) + } + .margin({top: Constants.PP_ROW_MARGIN_TOP}) + .height(Constants.PP_ROW_HEIGHT2) + .opacity(Constants.PP_TEXT_OPACITY) + if (this.showAuthUsers) { + if (this.authUsers.length > 0) { + Row() { + Text($r('app.string.perm_list_title_user_name')) + .fontSize(Constants.PP_TEXT_FONT_SIZE2) + .fontFamily($r('app.string.typeface')) + .fontWeight(FontWeight.Medium) + .lineHeight(Constants.PP_TEXT_LINE_HEIGHT2) + .width(Constants.PP_TEXT_WIDTH) + Text($r('app.string.perm_list_title_read_only')) + .fontSize(Constants.PP_TEXT_FONT_SIZE2) + .fontFamily($r('app.string.typeface')) + .fontWeight(FontWeight.Medium) + .fontColor($r('app.color.pp_text_fontcolor')) + .lineHeight(Constants.PP_TEXT_LINE_HEIGHT2) + .width(Constants.PP_IMAGE_WIDTH) + Text($r('app.string.perm_list_title_full_control')) + .fontSize(Constants.PP_TEXT_FONT_SIZE2) + .fontFamily($r('app.string.typeface')) + .fontWeight(FontWeight.Medium) + .fontColor($r('app.color.pp_text_fontcolor')) + .lineHeight(Constants.PP_TEXT_LINE_HEIGHT2) + .width(Constants.PP_TEXT_WIDTH2) + .margin({ left: Constants.PP_TEXT_MARGIN_LEFT, right: Constants.PP_TEXT_MARGIN_RIGHT }) + Text() + .width(Constants.PP_TEXT_WIDTH3) + } + .height(Constants.PP_ROW_HEIGHT3) + } + Scroll(this.scroller) { + List() { + ForEach(this.authUsers, (item) => { + this.ListItemLayout(item) + }) + } + } + .width(Constants.PP_TEXT_WIDTH_FULL) + .align(Alignment.Top) + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarWidth(Constants.PP_SCROLL_BAR_WIDTH) + .constraintSize({maxHeight: Constants.PP_SCROLL_MAX_HEIGHT}) + Row() { + Button($r('app.string.button_add_user')) + .enabled(this.authPerm == 2 ? true : false) + .fontSize(Constants.PP_BUTTON_FONT_SIZE) + .fontColor($r('app.color.button_color')) + .fontFamily($r('app.string.typeface')) + .fontWeight(FontWeight.Medium) + .height(Constants.PP_BUTTON_HEIGHT) + .padding(Constants.PP_BUTTON_PAD) + .focusable(false) + .backgroundColor($r('app.color.pp_button_background_color')) + .onClick((event) => { + this.showAuthUsers = false + }) + } + .align(Alignment.Start) + .width(Constants.PP_TEXT_WIDTH_FULL) + .height(Constants.PP_ROW_HEIGHT2) + } else { + Row() { + TextInput() + .height(Constants.PP_TEXT_INPUT) + .padding({top: Constants.PP_ROW_PAD_TOP, bottom: Constants.PP_ROW_PAD_BOTTOM}) + .fontSize(Constants.PP_TEXT_FONT_SIZE) + .fontFamily($r('app.string.typeface')) + .fontWeight(FontWeight.Regular) + .borderRadius(Constants.PP_ROW_RADIUS) + .backgroundColor($r('app.color.pp_row_background_color')) + .onChange((value: string) => { + this.account = value + }) + } + .padding({right: Constants.PP_ROW_PAD_RIGHT}) + Line() + .width(Constants.PP_LINE_WIDTH) + .height(Constants.PP_LINE_HEIGHT2) + .backgroundColor($r('app.color.pp_text_fontcolor')) + Row() { + Button($r('app.string.add')) + .fontSize(Constants.PP_BUTTON_FONT_SIZE) + .fontColor($r('app.color.button_color')) + .fontFamily($r('app.string.typeface')) + .fontWeight(FontWeight.Medium) + .height(Constants.PP_BUTTON_HEIGHT) + .padding(Constants.PP_BUTTON_PAD) + .backgroundColor($r('app.color.pp_button_background_color')) + .onClick((event) => { + if (this.account.length > Constants.ACCOUNT_LENGTH_MAX ) { + this.dlpAlertDialog = new CustomDialogController({ + builder: DlpAlertDialog({ + title:Constants.PP_TITLE, + message: Constants.PP_MESSAGE, + }), + autoCancel: false, + customStyle: true + }) + this.dlpAlertDialog.open() + return + } + if (this.account.length != 0 && this.authUserMap[this.account] == undefined) { + this.authUserMap[this.account] = { + authAccount: this.account, + authPerm: dlpPermission.AuthPermType.READ_ONLY, + permExpiryTime: Date.UTC(2023, 1, 1), + authAccountType: dlpPermission.AccountType.CLOUD_ACCOUNT + } + this.updateAuthUsers() + this.isChanged = true + } + this.account = '' + this.showAuthUsers = true + }) + Button($r('app.string.cancel')) + .fontSize(Constants.PP_BUTTON_FONT_SIZE) + .fontColor($r('app.color.button_color')) + .fontFamily('app.string.HarmonyHeiTi') + .fontWeight(FontWeight.Medium) + .height(Constants.PP_BUTTON_HEIGHT) + .padding(Constants.PP_BUTTON_PAD) + .margin({left: Constants.PP_BUTTON_MARGIN_LEFT}) + .focusable(false) + .backgroundColor($r('app.color.pp_button_background_color')) + .onClick((event) => { + this.showAuthUsers = true + }) + } + .align(Alignment.Start) + .width(Constants.PP_TEXT_WIDTH_FULL) + .height(Constants.PP_ROW_HEIGHT2) + } + } + .padding({left: Constants.PP_COLUMN_MARGIN_LEFT2, right: Constants.PP_COLUMN_MARGIN_RIGHT2}) + .alignItems(HorizontalAlign.Start) + } +} + +export {PermissionPanel} \ No newline at end of file diff --git a/entry/src/main/ets/common/constant.ets b/entry/src/main/ets/common/constant.ets new file mode 100644 index 0000000..9442209 --- /dev/null +++ b/entry/src/main/ets/common/constant.ets @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2021-2022 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. + */ + +export default class Constants { + static INDEX_COLUMN_WIDTH = 360; + static INDEX_BORDER_RADIUS = 24; + static FOOTER_WIDTH = '49%'; + static FOOTER_HEIGHT = 40; + static FOOTER_LINE_WIDTH= 0.5; + static FOOTER_LINE_HEIGHT= 24; + static FOOTER_BUTTON_WIDTH = '50%'; + static FOOTER_BUTTON_HEIGHT = 40; + static FOOTER_ROW_WIDTH= '100%'; + static FOOTER_ROW_HEIGHT= 56; + static FOOTER_ROW_MARGIN = 8; + static FOOTER_ROW_PAD_BOTTOM= 16; + static FOOTER_ROW_PAD_LEFT= 16; + static FOOTER_ROW_PAD_RIGHT= 16; + static HEADER_TEXT_FRONT_SIZE= 20; + static HEADER_TEXT_LINE_HEIGHT = 28; + static HEADER_TEXT_MARGIN_TOP = 18; + static HEADER_TEXT_WIDTH= '100%'; + static HEADER_COLUMN_WIDTH= '100%'; + static HEADER_COLUMN_HEIGHT= 56; + static HEADER_COLUMN_PAD_LEFT= 20; + static HEADER_COLUMN_PAD_RIGHT= 20; + static HEADER_ROW_FONT_SIZE = 16 ; + static HEADER_ROW_LINE_HEIGHT = 22 ; + static HEADER_TOGGLE_WIDTH= 36; + static HEADER_TOGGLE_HEIGHT= 20; + static HEADER_ROW_HEIGHT= 48; + static HEADER_ROW_MARGIN_TOP = 12; + static HEADER_ROW_PAD_LEFT= 22; + static HEADER_ROW_PAD_RIGHT= 22; + static PP_TEXT_MAX_LINE = 1; + static PP_TEXT_FONT_SIZE = 16; + static PP_TEXT_LINE_HEIGHT = 22; + static PP_TEXT_WIDTH = 200; + static PP_TEXT_PAD_RIGHT= 4; + static PP_IMAGE_WIDTH = 24; + static PP_IMAGE_HEIGHT = 24; + static PP_IMAGE_PAD = 2; + static PP_COLUMN_WIDTH = 48; + static PP_COLUMN_MARGIN_LEFT= 9; + static PP_COLUMN_MARGIN_RIGHT= 9; + static PP_ROW_HEIGHT = 47.5; + static PP_LINE_WIDTH = 312; + static PP_LINE_HEIGHT = 0.5; + static PP_TEXT_WIDTH_FULL = '100%'; + static PP_TEXT_HEIGHT = 44; + static PP_TEXT_OPACITY= 0.6; + static PP_TEXT_MARGIN_TOP= 19; + static PP_ROW_MARGIN_TOP = 12; + static PP_ROW_HEIGHT2 = 48; + static PP_TEXT_FONT_SIZE2= 12; + static PP_TEXT_LINE_HEIGHT2= 17; + static PP_TEXT_WIDTH2= 48; + static PP_TEXT_MARGIN_LEFT = 8 ; + static PP_TEXT_MARGIN_RIGHT = 8; + static PP_TEXT_WIDTH3= 24; + static PP_ROW_HEIGHT3= 19; + static PP_SCROLL_BAR_WIDTH= 4; + static PP_SCROLL_MAX_HEIGHT= 144; + static PP_BUTTON_FONT_SIZE = 16; + static PP_BUTTON_HEIGHT= 22; + static PP_BUTTON_PAD= 0; + static PP_TEXT_INPUT= 47; + static PP_ROW_PAD_TOP= 13; + static PP_ROW_PAD_BOTTOM = 12; + static PP_ROW_RADIUS= 0; + static PP_ROW_PAD_RIGHT= 14; + static PP_LINE_HEIGHT2= 1; + static PP_TITLE = "帐号名不合法"; + static PP_MESSAGE = "帐号长度应小于等于1024"; + static PP_BUTTON_MARGIN_LEFT = 16; + static PP_COLUMN_MARGIN_LEFT2= 24; + static PP_COLUMN_MARGIN_RIGHT2 = 10; + static AP_TEXT_MAX_LINE = 1; + static AP_TEXT_FONT_SIZE = 16; + static AP_TEXT_LINE_HEIGHT = 22; + static AP_TEXT_WIDTH = 290; + static AP_TEXT_PAD_RIGHT = 4; + static AP_COLUMN_HEIGHT= 48; + static AP_MARGIN_TOP = 19; + static AP_COLUMN_OPACITY= 0.6; + static AP_LIST_HEIGHT = 48; + static AP_LIST_BAR_WIDTH= 4; + static AP_BUTTON_HEIGHT = 22; + static AP_BUTTON_PAD= 0; + static AP_ROW_HEIGHT= 48; + static AP_TEXT_INPUT_HEIGHT = 47; + static AP_TEXT_PAD_TOP= 13; + static AP_TEXT_PAD_BOTTOM= 12; + static AP_ROW_RADIUS= 0; + static AP_ROW_PAD_RIGHT= 14; + static AP_LINE_WIDTH = 312; + static AP_LINE_HEIGHT = 1; + static AP_BUTTON_FONT_SIZE= 16; + static AP_BUTTON_MARGIN_LEFT= 16; + static AP_COLUMN_PAD_LEFT= 24; + static AP_COLUMN_PAD_RIGHT= 10; + static DU_TEXT_LINE_HEIGHT = 28; + static DU_WIDTH_FULL= '100%'; + static DU_TEXT_FONT_SIZE = 20; + static DU_ROW_HEIGHT= 56; + static DU_ROW_WIDTH= 288; + static DU_SCROLL_LINE_HEIGHT = 16; + static DU_SCROLL_FONT_SIZE = 14; + static DU_SCROLL_BAR_WIDTH = 5; + static DU_CONS_MAX_HEIGHT = 500; + static DU_MARGIN_TOP = 12; + static DU_WIDTH_SPE= '49%'; + static DU_BUTTON_HEIGHT= 40; + static DU_BUTTON_FONT_SIZE = 16 + static DU_LINE_WIDTH= 0.5; + static DU_LINE_HEIGHT = 22; + static DU_LINE_MARGIN_TOP = 9; + static DU_BUTTON_WIDTH = '50%'; + static DU_ROW_WIDTH2= 304; + static DU_LINE_MARGIN_TOP2 = 8; + static DU_ROW_WIDTH3 = 336; + static DU_BORDER_RADIUS = 24; + static DA_FONT_SIZE= 20; + static DA_ROW_HEIGHT = 56; + static DA_ROW_WIDTH = 288; + static DA_TEXT_LINE_HEIGHT = 28; + static DA_SCROLL_LINE_HEIGHT = 16; + static DA_SCROLL_FONT_SIZE = 14; + static DA_SCROLL_BAR_WIDTH = 5; + static DA_STRAIN_SIZE_MA_HEIGHT = 500; + static DA_MARGIN_TOP = 12; + static DA_SCROLL_WIDTH = 288; + static ROW_BUTTON_WIDTH = 304; + static ROW_BUTTON_HEIGHT = 40; + static ROW_FONT_SIZE = 16; + static ROW_MARGIN_TOP= 8; + static DA_COLOUM_WIDTH = 336; + static DA_COLOUM_RADIUS = 24; + static APP_PARAM_ERROR = '参数异常,请重试。'; + static APP_ERROR = '应用异常'; + static APP_GET_ACCOUNT_ERROR = '获取帐号信息失败,请重试。'; + static APP_SANDBOX_ERROR= '启动应用沙箱失败,请重试。'; + static APP_VISIT_FILE_ERROR= '无法访问此文件'; + static APP_NOT_HAVE_PERM_VISIT = '您没有访问权限。请向下列用户申请授权:\n'; + static APP_DLP_ERROR = 'DLP格式错误'; + static APP_FILE_PARAM_ERROR = '您打开的文档格式不正确,请重试。'; + static APP_SANDBOX_LIMIT_MAX = '沙箱应用数量超出上限,请卸载后重试。'; + static APP_INSTALL_SANDBOX_ERROR = '安装沙箱应用失败,请重试。'; + static APP_LINK_FILE_ERROR = '添加链接文件失败,请重试。'; + static FOOTER_OPACITY_ONE = 1; + static FOOTER_OPACITY_SEPC= 0.6; + static ACCOUNT_LENGTH_MAX = 1024; +} diff --git a/entry/src/main/ets/common/utils.ets b/entry/src/main/ets/common/utils.ets new file mode 100644 index 0000000..ab652ff --- /dev/null +++ b/entry/src/main/ets/common/utils.ets @@ -0,0 +1,65 @@ +import account_distributedAccount from '@ohos.account.distributedAccount'; +import account_osAccount from '@ohos.account.osAccount'; +import dlpPermission from '@ohos.dlpPermission'; + +var TAG = "[DLPManager]" +async function getDistributedAccountInfo() : Promise { + var distAbility = account_distributedAccount.getDistributedAccountAbility() + return distAbility.queryOsAccountDistributedInfo() +} + +async function getOsAccountInfo() : Promise { + var accountMgr = account_osAccount.getAccountManager() + return accountMgr.queryCurrentOsAccount() +} + +async function getUserId() : Promise { + var accountMgr = account_osAccount.getAccountManager() + return accountMgr.getOsAccountLocalIdFromProcess() +} + +async function getDomainId() : Promise { + var accountMgr = account_osAccount.getAccountManager() + return accountMgr.queryCurrentOsAccount() +} + +function getAuthPerm(accountName, dlpProperty) : number { + if (accountName == dlpProperty.ownerAccount) { + return dlpPermission.AuthPermType.FULL_CONTROL + } + for (var i = 0; i < dlpProperty.authUsers.length; ++i) { + var authUser = dlpProperty.authUsers[i] + if (authUser.authAccount == accountName) { + return authUser.authPerm + } + } + return -1 +} + +function terminateSelfWithResult(resultCode: number, result: string) : void { + var abilityResult = { + resultCode: resultCode, + want: { + parameters: { + result: result + } + } + } + globalThis.context.terminateSelfWithResult(abilityResult) +} + +function startAlertAbility(title, message) { + globalThis.context.startAbility({ + bundleName: "com.ohos.dlpmanager", + abilityName: "AlertAbility", + parameters: { + title: title, + message: message, + } + }, async (err, data) => { + console.log(TAG + "start AlertAbility err: " + JSON.stringify(err)) + globalThis.context.terminateSelf() + }) +} + +export {getDistributedAccountInfo, getOsAccountInfo, getUserId, getAuthPerm, terminateSelfWithResult, startAlertAbility} \ No newline at end of file diff --git a/entry/src/main/ets/pages/alert.ets b/entry/src/main/ets/pages/alert.ets new file mode 100644 index 0000000..c9be860 --- /dev/null +++ b/entry/src/main/ets/pages/alert.ets @@ -0,0 +1,24 @@ +import {DlpAlertDialog} from '../common/components/dlp_alert_dialog' + +@Entry +@Component +struct Index { + alertDialogController: CustomDialogController = new CustomDialogController({ + builder: DlpAlertDialog({ + title: globalThis.abilityWant.parameters.title, + message: globalThis.abilityWant.parameters.message + }), + autoCancel: false, + cancel: () => { + globalThis.context.terminateSelf() + }, + alignment: DialogAlignment.Center, + customStyle: true + }) + + aboutToAppear() { + this.alertDialogController.open() + } + + build() {} +} \ No newline at end of file diff --git a/entry/src/main/ets/pages/index.ets b/entry/src/main/ets/pages/index.ets new file mode 100644 index 0000000..e95cbe5 --- /dev/null +++ b/entry/src/main/ets/pages/index.ets @@ -0,0 +1,147 @@ +import { Header } from '../common/components/header' +import { PermissionPanel } from '../common/components/permission_panel' +import { AuthorizerPanel } from '../common/components/authorizer_panel' +import { Footer } from '../common/components/footer' +import dlpPermission from '@ohos.dlpPermission' +import { getAuthPerm } from '../common/utils' +import { DlpAlertDialog } from '../common/components/dlp_alert_dialog' +import { KeyCode } from '@ohos.multimodalInput.keyCode' +import { getOsAccountInfo, terminateSelfWithResult } from '../common/utils' +import Constants from '../common/constant' + +var TAG = "[DLPManager]" + +var defaultDlpProperty: dlpPermission.DlpProperty = { + ownerAccount: '', + ownerAccountType: 1, + authUsers: [], + contractAccount: '' +} + +var defaultDlpFile: dlpPermission.DlpFile = { + dlpProperty: defaultDlpProperty, + recoverDlpFile: null, + closeDlpFile: null, + addDlpLinkFile: null, + deleteDlpLinkFile: null +} + +@Component +struct DlpDialog { + isDlpFile: boolean = false + dlpAlertDialog: CustomDialogController + @State authPerm: number = 2 + @State isShow: boolean = false + @State isChanged: boolean = false + @State dlpFile: dlpPermission.DlpFile = defaultDlpFile + @State needProtect: boolean = false + + showDlpAlertDialog(title, message) { + this.dlpAlertDialog = new CustomDialogController({ + builder: DlpAlertDialog({ + title: title, + message: message + }), + autoCancel: false, + customStyle: true + }) + this.dlpAlertDialog.open() + } + + async checkAndOpenDlpFile(filename: string, fd: number): Promise { + console.info(TAG + "checkAndOpenDlpFile") + this.dlpFile.dlpProperty.ownerAccount = globalThis.accountInfo.distributedInfo.name + this.dlpFile.dlpProperty.contractAccount = globalThis.accountInfo.distributedInfo.name + var isDlpSuffix: boolean = filename.endsWith(".dlp") + if (!isDlpSuffix) { + console.info(TAG + "input file is not a dlp file") + this.isShow = true + return + } + try { + this.dlpFile = await dlpPermission.openDlpFile(fd) + } catch (err) { + console.error(TAG + "openDlpFile error: " + JSON.stringify(err)) + if (err.code == 1 && err.extra != undefined) { + this.showDlpAlertDialog(Constants.APP_VISIT_FILE_ERROR, Constants.APP_NOT_HAVE_PERM_VISIT + err.extra) + } else { + this.showDlpAlertDialog(Constants.APP_DLP_ERROR, Constants.APP_FILE_PARAM_ERROR) + } + return + } + this.authPerm = getAuthPerm(globalThis.accountInfo.distributedInfo.name, this.dlpFile.dlpProperty) + this.isDlpFile = true + this.needProtect = true + this.isShow = true + } + + async aboutToAppear() { + console.info(TAG + "aboutToAppear") + try { + globalThis.accountInfo = await getOsAccountInfo() + console.log(TAG + "accountInfo: " + JSON.stringify(globalThis.accountInfo)) + } catch (err) { + console.info(TAG + "getOsAccountInfo error: " + JSON.stringify(err)) + terminateSelfWithResult(100, "get account info failed") + } + try { + globalThis.srcFilename = globalThis.abilityWant.parameters.fileName.name + globalThis.srcFd = globalThis.abilityWant.parameters.keyFd.value + console.log(TAG + "srcFilename: " + globalThis.srcFilename + ", srcFd: " + globalThis.srcFd) + } catch (err) { + console.error(TAG + "get parameters error") + terminateSelfWithResult(100, "get parameters failed, fileName and keyFd is required") + } + this.checkAndOpenDlpFile(globalThis.srcFilename, globalThis.srcFd) + } + + build() { + if (this.isShow) { + Column() { + Row() { + Header({ authPerm: $authPerm, needProtect: $needProtect }) + } + + if (this.needProtect) { + Row() { + PermissionPanel({ authPerm: $authPerm, dlpFile: $dlpFile, isChanged: $isChanged }) + } + + Row() { + AuthorizerPanel({ authPerm: $authPerm, dlpFile: $dlpFile, isChanged: $isChanged }) + } + } + Row() { + Footer({ + srcFilename: globalThis.srcFilename, + srcFd: globalThis.srcFd, + isDlpFile: this.isDlpFile, + isChanged: $isChanged, + dlpFile: $dlpFile, + needProtect: $needProtect + }) + } + } + .width(Constants.INDEX_COLUMN_WIDTH) + .backgroundColor($r('app.color.index_background_color')) + .borderRadius(Constants.INDEX_BORDER_RADIUS) + } + } +} + +@Entry +@Component +struct Index { + aboutToAppear() { + } + + build() { + Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center, + direction: FlexDirection.Column }) { + Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center, + direction: FlexDirection.Row }) { + DlpDialog() + } + } + } +} \ No newline at end of file diff --git a/entry/src/main/module.json b/entry/src/main/module.json new file mode 100644 index 0000000..f9d83a4 --- /dev/null +++ b/entry/src/main/module.json @@ -0,0 +1,66 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:entry_desc", + "mainElement": "MainAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "uiSyntax": "ets", + "abilities": [ + { + "name": "MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:MainAbility_desc", + "icon": "$media:icon", + "label": "$string:MainAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:white", + "visible": true + } + ], + "extensionAbilities": [ + { + "name": "ViewAbility", + "srcEntrance": "./ets/ViewAbility/ViewAbility.ts", + "icon": "$media:icon", + "description": "$string:ViewAbility_desc", + "type": "service", + "visible": true + }, + { + "name": "DataAbility", + "srcEntrance": "./ets/DataAbility/DataAbility.ts", + "icon": "$media:icon", + "description": "$string:ViewAbility_desc", + "type": "service" + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.READ_MEDIA" + }, + { + "name": "ohos.permission.WRITE_MEDIA" + }, + { + "name": "ohos.permission.ACCESS_DLP_FILE" + }, + { + "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS" + }, + { + "name":"ohos.permission.FILE_ACCESS_MANAGER" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + } + ] + } +} \ No newline at end of file diff --git a/entry/src/main/resources/base/element/color.json b/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000..578ffab --- /dev/null +++ b/entry/src/main/resources/base/element/color.json @@ -0,0 +1,76 @@ +{ + "color": [ + { + "name": "white", + "value": "#FFFFFF" + }, + { + "name": "text_color", + "value": "#182431" + }, + { + "name": "divider_color", + "value": "#f3f4f6" + }, + { + "name": "default_background_color", + "value": "#ffffff" + }, + { + "name": "button_color", + "value": "#FF007DFF" + }, + { + "name": "button_background_color", + "value": "#FFF" + }, + { + "name": "toggle_color", + "value": "#007DFF" + }, + { + "name": "index_background_color", + "value": "#FFF" + }, + { + "name": "footer_line_background_color", + "value": "#18243133" + }, + { + "name": "pp_line_background_color", + "value": "#18243133" + }, + { + "name": "pp_text_fontcolor", + "value": "#182431" + }, + { + "name": "pp_button_background_color", + "value": "#fff" + }, + { + "name": "pp_row_background_color", + "value": "#fff" + }, + { + "name": "del_scroll_font_color", + "value": "#E6000000" + }, + { + "name": "del_button_font_color", + "value": "#FA2A2D" + }, + { + "name": "da_font_color", + "value": "#182431" + }, + { + "name": "da_scroll_font_color", + "value": "#E6000000" + }, + { + "name": "da_background_color", + "value": "#fff" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000..4e5c899 --- /dev/null +++ b/entry/src/main/resources/base/element/string.json @@ -0,0 +1,104 @@ +{ + "string": [ + { + "name": "entry_desc", + "value": "description" + }, + { + "name": "MainAbility_desc", + "value": "DLPManager" + }, + { + "name": "MainAbility_label", + "value": "DLPManager" + }, + { + "name": "ViewAbility_desc", + "value": "DLPViewer" + }, + { + "name": "AlertAbility_desc", + "value": "description" + }, + { + "name": "AlertAbility_label", + "value": "label" + }, + { + "name": "ban", + "value": "取消" + }, + { + "name": "typeface", + "value": "HarmonyHeiTi" + }, + { + "name": "save", + "value": "保存" + }, + { + "name": "sure", + "value": "确定" + }, + { + "name": "header_title", + "value": "加密保护" + }, + { + "name": "toggle_title", + "value": "保护此文件" + }, + { + "name": "toggle_tip", + "value": "开启保护后,将在您选择的位置生成一个新的\".dlp\"格式加密文件。" + }, + { + "name": "perm_panel_title", + "value": "授权其他用户可访问:" + }, + { + "name": "perm_list_title_user_name", + "value": "用户名" + }, + { + "name": "perm_list_title_read_only", + "value": "只读" + }, + { + "name": "perm_list_title_full_control", + "value": "完全控制" + }, + { + "name": "button_add_user", + "value": "添加用户" + }, + { + "name": "add", + "value": "添加" + }, + { + "name": "cancel", + "value": "取消" + }, + { + "name": "authorizer_panel_title", + "value": "允许向以下用户申请权限:" + }, + { + "name": "del_usr", + "value": "删除用户" + }, + { + "name": "del_text1", + "value": "删除后此用户将无法访问这个文件,如需恢复请重新添加此用户。是否删除?" + }, + { + "name": "button_del", + "value": "删除" + }, + { + "name": "da_buttion", + "value": "知道了" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/base/media/ic_public_delete.png b/entry/src/main/resources/base/media/ic_public_delete.png new file mode 100644 index 0000000..217c029 Binary files /dev/null and b/entry/src/main/resources/base/media/ic_public_delete.png differ diff --git a/entry/src/main/resources/base/media/ic_radio_unselected.png b/entry/src/main/resources/base/media/ic_radio_unselected.png new file mode 100644 index 0000000..30fc8a6 Binary files /dev/null and b/entry/src/main/resources/base/media/ic_radio_unselected.png differ diff --git a/entry/src/main/resources/base/media/icon.png b/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000..ce307a8 Binary files /dev/null and b/entry/src/main/resources/base/media/icon.png differ diff --git a/entry/src/main/resources/base/media/radio_selected.png b/entry/src/main/resources/base/media/radio_selected.png new file mode 100644 index 0000000..5018f70 Binary files /dev/null and b/entry/src/main/resources/base/media/radio_selected.png differ diff --git a/entry/src/main/resources/base/media/radioactive.jpg b/entry/src/main/resources/base/media/radioactive.jpg new file mode 100644 index 0000000..55e2ade Binary files /dev/null and b/entry/src/main/resources/base/media/radioactive.jpg differ diff --git a/entry/src/main/resources/base/media/radiodefault.jpg b/entry/src/main/resources/base/media/radiodefault.jpg new file mode 100644 index 0000000..189d3ae Binary files /dev/null and b/entry/src/main/resources/base/media/radiodefault.jpg differ diff --git a/entry/src/main/resources/base/profile/main_pages.json b/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000..4f52aac --- /dev/null +++ b/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,6 @@ +{ + "src": [ + "pages/index", + "pages/alert" + ] +} diff --git a/hvigorfile.js b/hvigorfile.js new file mode 100644 index 0000000..586ced9 --- /dev/null +++ b/hvigorfile.js @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +module.exports = require('@ohos/hvigor-ohos-plugin').appTasks \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..470222e --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1227 @@ +{ + "name": "dlpmanager", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@ohos/hos-sdkmanager-common": { + "version": "1.0.2", + "resolved": "https://cmc.centralrepo.rnd.huawei.com/artifactory/api/npm/product_npm/@ohos/hos-sdkmanager-common/-/@ohos/hos-sdkmanager-common-1.0.2.tgz", + "integrity": "sha512-CVaQO95NoAt8zLHosUlW7hV/EcnY5FF0rhH7qWE5yGA/kCyqmgBGKzJEzCvz6/pf1zEHaCAthauYZHzksB1rUg==", + "requires": { + "@ohos/sdkmanager-common": "^1.1.6" + } + }, + "@ohos/hvigor": { + "version": "1.1.5-rc2", + "resolved": "https://cmc.centralrepo.rnd.huawei.com/artifactory/api/npm/product_npm/@ohos/hvigor/-/@ohos/hvigor-1.1.5-rc2.tgz", + "integrity": "sha512-8dIFIUvcsF9PgCpeyZNFvQb3XqcBxA0k8p3RsFNjvCOKlyNp8NUK9Fw3rjK1NxuB+ZzYpWgdL6P7LZ8JpB+qCQ==", + "requires": { + "@ohos/hvigor-base": "1.1.5-rc2", + "fs-extra": "10.0.0", + "interpret": "1.4.0", + "liftoff": "4.0.0", + "mute-stdout": "1.0.0", + "pretty-hrtime": "1.0.0", + "v8flags": "3.2.0", + "yargs": "7.1.2" + } + }, + "@ohos/hvigor-base": { + "version": "1.1.5-rc2", + "resolved": "https://cmc.centralrepo.rnd.huawei.com/artifactory/api/npm/product_npm/@ohos/hvigor-base/-/@ohos/hvigor-base-1.1.5-rc2.tgz", + "integrity": "sha512-G1DPLBpON1CTV68LHKLjZzF/PzlWFI/qYZaPRMnjKk5pt+TNvMH/adXPEH0GDsthEDvK8FEAJglUgJ8ZVo7Mrg==", + "requires": { + "json5": "2.2.0", + "log4js": "6.4.1", + "once": "1.4.0", + "pretty-hrtime": "1.0.0" + } + }, + "@ohos/hvigor-ohos-plugin": { + "version": "1.1.5-rc2", + "resolved": "https://cmc.centralrepo.rnd.huawei.com/artifactory/api/npm/product_npm/@ohos/hvigor-ohos-plugin/-/@ohos/hvigor-ohos-plugin-1.1.5-rc2.tgz", + "integrity": "sha512-VykS0GkQ7UdXEcc/P9W73nw6aadTijgBn50MmMeo4p3KKN1iy44v7shuyaPPe/CHE5/iGMu7AQQljbZMCJUF6Q==", + "requires": { + "@ohos/hos-sdkmanager-common": "1.0.2", + "@ohos/hvigor-base": "1.1.5-rc2", + "@ohos/sdkmanager-common": "1.1.6", + "adm-zip": "0.5.9", + "ajv": "8.10.0", + "execa": "5.1.1", + "fast-xml-parser": "4.0.3", + "fs-extra": "10.0.0", + "glob": "7.2.0", + "iconv-lite": "0.6.3", + "json5": "2.2.0", + "lodash": "4.17.21", + "pretty-hrtime": "1.0.3", + "resolve-package-path": "4.0.3" + }, + "dependencies": { + "pretty-hrtime": { + "version": "1.0.3", + "resolved": "http://mirrors.tools.huawei.com/npm/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "integrity": "sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==" + } + } + }, + "@ohos/hypium": { + "version": "1.0.0", + "resolved": "https://repo.harmonyos.com/npm/@ohos/hypium/-/@ohos/hypium-1.0.0.tgz", + "integrity": "sha512-NhL78mNNQXhZPTt+wfRktVJldXQ76l1GkS3N/KiNSLOFY1OC/gWeO22gp9uPmYntwLVOJm5h+ei2fe51ofyHWw==" + }, + "@ohos/sdkmanager-common": { + "version": "1.1.6", + "resolved": "https://cmc.centralrepo.rnd.huawei.com/artifactory/api/npm/product_npm/@ohos/sdkmanager-common/-/@ohos/sdkmanager-common-1.1.6.tgz", + "integrity": "sha512-QgL54eY1KpvcwY2QQiaaa7dh9/XSZ3fN1AiOY895gUq/8xJiph8fFKisgOQNbMzu++GXoTz345dFmdmFvOvF3Q==" + }, + "adm-zip": { + "version": "0.5.9", + "resolved": "http://mirrors.tools.huawei.com/npm/adm-zip/-/adm-zip-0.5.9.tgz", + "integrity": "sha512-s+3fXLkeeLjZ2kLjCBwQufpI5fuN+kIGBxu6530nVQZGVol0d7Y/M88/xw9HGGUcJjKf8LutN3VPRUBq6N7Ajg==" + }, + "ajv": { + "version": "8.10.0", + "resolved": "http://mirrors.tools.huawei.com/npm/ajv/-/ajv-8.10.0.tgz", + "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "http://mirrors.tools.huawei.com/npm/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==" + }, + "array-each": { + "version": "1.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==" + }, + "array-slice": { + "version": "1.1.0", + "resolved": "http://mirrors.tools.huawei.com/npm/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==" + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "http://mirrors.tools.huawei.com/npm/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "http://mirrors.tools.huawei.com/npm/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "http://mirrors.tools.huawei.com/npm/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, + "call-bind": { + "version": "1.0.2", + "resolved": "http://mirrors.tools.huawei.com/npm/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "camelcase": { + "version": "3.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==" + }, + "cliui": { + "version": "3.2.0", + "resolved": "http://mirrors.tools.huawei.com/npm/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "http://mirrors.tools.huawei.com/npm/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "http://mirrors.tools.huawei.com/npm/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "http://mirrors.tools.huawei.com/npm/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "date-format": { + "version": "4.0.13", + "resolved": "http://mirrors.tools.huawei.com/npm/date-format/-/date-format-4.0.13.tgz", + "integrity": "sha512-bnYCwf8Emc3pTD8pXnre+wfnjGtfi5ncMDKy7+cWZXbmRAsdWkOQHrfC1yz/KiwP5thDp2kCHWYWKBX4HP1hoQ==" + }, + "debug": { + "version": "4.3.4", + "resolved": "http://mirrors.tools.huawei.com/npm/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "http://mirrors.tools.huawei.com/npm/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==" + }, + "define-properties": { + "version": "1.1.4", + "resolved": "http://mirrors.tools.huawei.com/npm/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "requires": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + } + }, + "detect-file": { + "version": "1.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==" + }, + "error-ex": { + "version": "1.3.2", + "resolved": "http://mirrors.tools.huawei.com/npm/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "execa": { + "version": "5.1.1", + "resolved": "http://mirrors.tools.huawei.com/npm/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + } + }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "http://mirrors.tools.huawei.com/npm/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==", + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "http://mirrors.tools.huawei.com/npm/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "http://mirrors.tools.huawei.com/npm/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "fast-xml-parser": { + "version": "4.0.3", + "resolved": "http://mirrors.tools.huawei.com/npm/fast-xml-parser/-/fast-xml-parser-4.0.3.tgz", + "integrity": "sha512-xhQbg3a/EYNHwK0cxIG1nZmVkHX/0tWihamn5pU4Mhd9KEVE2ga8ZJiqEUgB2sApElvAATOdMTLjgqIpvYDUkQ==", + "requires": { + "strnum": "^1.0.5" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "http://mirrors.tools.huawei.com/npm/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "findup-sync": { + "version": "5.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/findup-sync/-/findup-sync-5.0.0.tgz", + "integrity": "sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==", + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.3", + "micromatch": "^4.0.4", + "resolve-dir": "^1.0.1" + } + }, + "fined": { + "version": "2.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/fined/-/fined-2.0.0.tgz", + "integrity": "sha512-OFRzsL6ZMHz5s0JrsEr+TpdGNCtrVtnuG3x1yzGNiQHT0yaDnXAj8V/lWcpJVrnoDpcwXcASxAZYbuXda2Y82A==", + "requires": { + "expand-tilde": "^2.0.2", + "is-plain-object": "^5.0.0", + "object.defaults": "^1.1.0", + "object.pick": "^1.3.0", + "parse-filepath": "^1.0.2" + } + }, + "flagged-respawn": { + "version": "2.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/flagged-respawn/-/flagged-respawn-2.0.0.tgz", + "integrity": "sha512-Gq/a6YCi8zexmGHMuJwahTGzXlAZAOsbCVKduWXC6TlLCjjFRlExMJc4GC2NYPYZ0r/brw9P7CpRgQmlPVeOoA==" + }, + "flatted": { + "version": "3.2.7", + "resolved": "http://mirrors.tools.huawei.com/npm/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==" + }, + "for-in": { + "version": "1.0.2", + "resolved": "http://mirrors.tools.huawei.com/npm/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==" + }, + "for-own": { + "version": "1.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==", + "requires": { + "for-in": "^1.0.1" + } + }, + "fs-extra": { + "version": "10.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/fs-extra/-/fs-extra-10.0.0.tgz", + "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "dependencies": { + "jsonfile": { + "version": "6.1.0", + "resolved": "http://mirrors.tools.huawei.com/npm/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + } + }, + "universalify": { + "version": "2.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" + } + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "http://mirrors.tools.huawei.com/npm/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "http://mirrors.tools.huawei.com/npm/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + }, + "get-intrinsic": { + "version": "1.1.2", + "resolved": "http://mirrors.tools.huawei.com/npm/get-intrinsic/-/get-intrinsic-1.1.2.tgz", + "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + } + }, + "get-stream": { + "version": "6.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==" + }, + "glob": { + "version": "7.2.0", + "resolved": "http://mirrors.tools.huawei.com/npm/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "global-modules": { + "version": "1.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "requires": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "http://mirrors.tools.huawei.com/npm/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==", + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + } + }, + "graceful-fs": { + "version": "4.2.10", + "resolved": "http://mirrors.tools.huawei.com/npm/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + }, + "has": { + "version": "1.0.3", + "resolved": "http://mirrors.tools.huawei.com/npm/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-property-descriptors": { + "version": "1.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "requires": { + "get-intrinsic": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "http://mirrors.tools.huawei.com/npm/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "homedir-polyfill": { + "version": "1.0.3", + "resolved": "http://mirrors.tools.huawei.com/npm/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "requires": { + "parse-passwd": "^1.0.0" + } + }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "http://mirrors.tools.huawei.com/npm/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" + }, + "human-signals": { + "version": "2.1.0", + "resolved": "http://mirrors.tools.huawei.com/npm/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" + }, + "iconv-lite": { + "version": "0.6.3", + "resolved": "http://mirrors.tools.huawei.com/npm/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "http://mirrors.tools.huawei.com/npm/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "http://mirrors.tools.huawei.com/npm/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ini": { + "version": "1.3.8", + "resolved": "http://mirrors.tools.huawei.com/npm/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "interpret": { + "version": "1.4.0", + "resolved": "http://mirrors.tools.huawei.com/npm/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==" + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==" + }, + "is-absolute": { + "version": "1.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "requires": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "http://mirrors.tools.huawei.com/npm/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" + }, + "is-core-module": { + "version": "2.10.0", + "resolved": "http://mirrors.tools.huawei.com/npm/is-core-module/-/is-core-module-2.10.0.tgz", + "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", + "requires": { + "has": "^1.0.3" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "http://mirrors.tools.huawei.com/npm/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-glob": { + "version": "4.0.3", + "resolved": "http://mirrors.tools.huawei.com/npm/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "is-plain-object": { + "version": "5.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" + }, + "is-relative": { + "version": "1.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "requires": { + "is-unc-path": "^1.0.0" + } + }, + "is-stream": { + "version": "2.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" + }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "requires": { + "unc-path-regex": "^0.1.2" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "http://mirrors.tools.huawei.com/npm/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==" + }, + "is-windows": { + "version": "1.0.2", + "resolved": "http://mirrors.tools.huawei.com/npm/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + }, + "isexe": { + "version": "2.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "isobject": { + "version": "3.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==" + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "json5": { + "version": "2.2.0", + "resolved": "http://mirrors.tools.huawei.com/npm/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "requires": { + "minimist": "^1.2.5" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "http://mirrors.tools.huawei.com/npm/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" + }, + "lcid": { + "version": "1.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==", + "requires": { + "invert-kv": "^1.0.0" + } + }, + "liftoff": { + "version": "4.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/liftoff/-/liftoff-4.0.0.tgz", + "integrity": "sha512-rMGwYF8q7g2XhG2ulBmmJgWv25qBsqRbDn5gH0+wnuyeFt7QBJlHJmtg5qEdn4pN6WVAUMgXnIxytMFRX9c1aA==", + "requires": { + "extend": "^3.0.2", + "findup-sync": "^5.0.0", + "fined": "^2.0.0", + "flagged-respawn": "^2.0.0", + "is-plain-object": "^5.0.0", + "object.map": "^1.0.1", + "rechoir": "^0.8.0", + "resolve": "^1.20.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "http://mirrors.tools.huawei.com/npm/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "http://mirrors.tools.huawei.com/npm/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "log4js": { + "version": "6.4.1", + "resolved": "http://mirrors.tools.huawei.com/npm/log4js/-/log4js-6.4.1.tgz", + "integrity": "sha512-iUiYnXqAmNKiIZ1XSAitQ4TmNs8CdZYTAWINARF3LjnsLN8tY5m0vRwd6uuWj/yNY0YHxeZodnbmxKFUOM2rMg==", + "requires": { + "date-format": "^4.0.3", + "debug": "^4.3.3", + "flatted": "^3.2.4", + "rfdc": "^1.3.0", + "streamroller": "^3.0.2" + } + }, + "make-iterator": { + "version": "1.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", + "requires": { + "kind-of": "^6.0.2" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "http://mirrors.tools.huawei.com/npm/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==" + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + }, + "micromatch": { + "version": "4.0.5", + "resolved": "http://mirrors.tools.huawei.com/npm/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "http://mirrors.tools.huawei.com/npm/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + }, + "minimatch": { + "version": "3.1.2", + "resolved": "http://mirrors.tools.huawei.com/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.6", + "resolved": "http://mirrors.tools.huawei.com/npm/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + }, + "ms": { + "version": "2.1.2", + "resolved": "http://mirrors.tools.huawei.com/npm/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "mute-stdout": { + "version": "1.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/mute-stdout/-/mute-stdout-1.0.0.tgz", + "integrity": "sha512-MaSQenn0f9oxIjtCufclpV00MuYTiHaXPbdcfPIM+quMqoa8cXywjHHx4LhhIAZlXqPWMdcUpYviajfmHtHRJw==" + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "http://mirrors.tools.huawei.com/npm/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "requires": { + "path-key": "^3.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==" + }, + "object-keys": { + "version": "1.1.1", + "resolved": "http://mirrors.tools.huawei.com/npm/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, + "object.assign": { + "version": "4.1.4", + "resolved": "http://mirrors.tools.huawei.com/npm/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + } + }, + "object.defaults": { + "version": "1.1.0", + "resolved": "http://mirrors.tools.huawei.com/npm/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==", + "requires": { + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "object.map": { + "version": "1.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w==", + "requires": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "http://mirrors.tools.huawei.com/npm/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==", + "requires": { + "isobject": "^3.0.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "http://mirrors.tools.huawei.com/npm/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "http://mirrors.tools.huawei.com/npm/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "os-locale": { + "version": "1.4.0", + "resolved": "http://mirrors.tools.huawei.com/npm/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==", + "requires": { + "lcid": "^1.0.0" + } + }, + "parse-filepath": { + "version": "1.0.2", + "resolved": "http://mirrors.tools.huawei.com/npm/parse-filepath/-/parse-filepath-1.0.2.tgz", + "integrity": "sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==", + "requires": { + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "http://mirrors.tools.huawei.com/npm/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", + "requires": { + "error-ex": "^1.2.0" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==" + }, + "path-exists": { + "version": "2.1.0", + "resolved": "http://mirrors.tools.huawei.com/npm/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + }, + "path-key": { + "version": "3.1.1", + "resolved": "http://mirrors.tools.huawei.com/npm/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "path-parse": { + "version": "1.0.7", + "resolved": "http://mirrors.tools.huawei.com/npm/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "path-root": { + "version": "0.1.1", + "resolved": "http://mirrors.tools.huawei.com/npm/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg==", + "requires": { + "path-root-regex": "^0.1.0" + } + }, + "path-root-regex": { + "version": "0.1.2", + "resolved": "http://mirrors.tools.huawei.com/npm/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ==" + }, + "path-type": { + "version": "1.1.0", + "resolved": "http://mirrors.tools.huawei.com/npm/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "picomatch": { + "version": "2.3.1", + "resolved": "http://mirrors.tools.huawei.com/npm/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, + "pify": { + "version": "2.3.0", + "resolved": "http://mirrors.tools.huawei.com/npm/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==" + }, + "pinkie": { + "version": "2.0.4", + "resolved": "http://mirrors.tools.huawei.com/npm/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==" + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", + "requires": { + "pinkie": "^2.0.0" + } + }, + "pretty-hrtime": { + "version": "1.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/pretty-hrtime/-/pretty-hrtime-1.0.0.tgz", + "integrity": "sha512-CU2l5CYUAptUYq/671ajexQfXuxJFwwg0n243Kdkx8bTjeenedsWgu8TGHPm03vLfNtk3aTXgySKPp3Usykudw==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "http://mirrors.tools.huawei.com/npm/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "http://mirrors.tools.huawei.com/npm/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "rechoir": { + "version": "0.8.0", + "resolved": "http://mirrors.tools.huawei.com/npm/rechoir/-/rechoir-0.8.0.tgz", + "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", + "requires": { + "resolve": "^1.20.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "http://mirrors.tools.huawei.com/npm/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "http://mirrors.tools.huawei.com/npm/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==" + }, + "resolve": { + "version": "1.22.1", + "resolved": "http://mirrors.tools.huawei.com/npm/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "requires": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==", + "requires": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + } + }, + "resolve-package-path": { + "version": "4.0.3", + "resolved": "http://mirrors.tools.huawei.com/npm/resolve-package-path/-/resolve-package-path-4.0.3.tgz", + "integrity": "sha512-SRpNAPW4kewOaNUt8VPqhJ0UMxawMwzJD8V7m1cJfdSTK9ieZwS6K7Dabsm4bmLFM96Z5Y/UznrpG5kt1im8yA==", + "requires": { + "path-root": "^0.1.1" + } + }, + "rfdc": { + "version": "1.3.0", + "resolved": "http://mirrors.tools.huawei.com/npm/rfdc/-/rfdc-1.3.0.tgz", + "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "http://mirrors.tools.huawei.com/npm/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "semver": { + "version": "5.7.1", + "resolved": "http://mirrors.tools.huawei.com/npm/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "http://mirrors.tools.huawei.com/npm/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "http://mirrors.tools.huawei.com/npm/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "http://mirrors.tools.huawei.com/npm/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.12", + "resolved": "http://mirrors.tools.huawei.com/npm/spdx-license-ids/-/spdx-license-ids-3.0.12.tgz", + "integrity": "sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==" + }, + "streamroller": { + "version": "3.1.2", + "resolved": "http://mirrors.tools.huawei.com/npm/streamroller/-/streamroller-3.1.2.tgz", + "integrity": "sha512-wZswqzbgGGsXYIrBYhOE0yP+nQ6XRk7xDcYwuQAGTYXdyAUmvgVFE0YU1g5pvQT0m7GBaQfYcSnlHbapuK0H0A==", + "requires": { + "date-format": "^4.0.13", + "debug": "^4.3.4", + "fs-extra": "^8.1.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "http://mirrors.tools.huawei.com/npm/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + } + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "http://mirrors.tools.huawei.com/npm/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" + }, + "strnum": { + "version": "1.0.5", + "resolved": "http://mirrors.tools.huawei.com/npm/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==" + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "http://mirrors.tools.huawei.com/npm/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==" + }, + "universalify": { + "version": "0.1.2", + "resolved": "http://mirrors.tools.huawei.com/npm/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + }, + "uri-js": { + "version": "4.4.1", + "resolved": "http://mirrors.tools.huawei.com/npm/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + } + }, + "v8flags": { + "version": "3.2.0", + "resolved": "http://mirrors.tools.huawei.com/npm/v8flags/-/v8flags-3.2.0.tgz", + "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "http://mirrors.tools.huawei.com/npm/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "which": { + "version": "1.3.1", + "resolved": "http://mirrors.tools.huawei.com/npm/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "http://mirrors.tools.huawei.com/npm/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ==" + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "http://mirrors.tools.huawei.com/npm/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "http://mirrors.tools.huawei.com/npm/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "y18n": { + "version": "3.2.2", + "resolved": "http://mirrors.tools.huawei.com/npm/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==" + }, + "yargs": { + "version": "7.1.2", + "resolved": "http://mirrors.tools.huawei.com/npm/yargs/-/yargs-7.1.2.tgz", + "integrity": "sha512-ZEjj/dQYQy0Zx0lgLMLR8QuaqTihnxirir7EwUHp1Axq4e3+k8jXU5K0VLbNvedv1f4EWtBonDIZm0NUr+jCcA==", + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^5.0.1" + } + }, + "yargs-parser": { + "version": "5.0.1", + "resolved": "http://mirrors.tools.huawei.com/npm/yargs-parser/-/yargs-parser-5.0.1.tgz", + "integrity": "sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==", + "requires": { + "camelcase": "^3.0.0", + "object.assign": "^4.1.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..45031e8 --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "license":"ISC", + "devDependencies":{}, + "name":"dlpmanager", + "ohos":{ + "org":"huawei", + "directoryLevel":"project", + "buildTool":"hvigor" + }, + "description":"example description", + "repository":{}, + "version":"1.0.0", + "dependencies":{ + "@ohos/hypium":"1.0.0", + "@ohos/hvigor-ohos-plugin":"1.1.5-rc2", + "@ohos/hvigor":"1.1.5-rc2" + } +} \ No newline at end of file diff --git a/signature/dlpmanager.p7b b/signature/dlpmanager.p7b new file mode 100644 index 0000000..1ae3a20 Binary files /dev/null and b/signature/dlpmanager.p7b differ