test
Signed-off-by: liushuling <liushuling1@huawei.com> Change-Id: I5ae1e91017751876ade34130ab7076c5090c7c05
15
AppScope/app.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
"app": {
|
||||||
|
"bundleName": "com.ohos.permissionmanager",
|
||||||
|
"vendor": "example",
|
||||||
|
"versionCode": 1000000,
|
||||||
|
"versionName": "1.0.0",
|
||||||
|
"icon": "$media:app_icon",
|
||||||
|
"label": "$string:app_name",
|
||||||
|
"distributedNotificationEnabled": true,
|
||||||
|
"minAPIVersion":9,
|
||||||
|
"targetAPIVersion":9
|
||||||
|
}
|
||||||
|
}
|
8
AppScope/resources/base/element/string.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"string": [
|
||||||
|
{
|
||||||
|
"name": "app_name",
|
||||||
|
"value": "权限管理"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
BIN
AppScope/resources/base/media/app_icon.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
29
BUILD.gn
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import("//build/ohos.gni")
|
||||||
|
|
||||||
|
ohos_hap("pm") {
|
||||||
|
hap_profile = "entry/src/main/module.json"
|
||||||
|
deps = [
|
||||||
|
":permission_manager_js_assets",
|
||||||
|
":permission_manager_resources",
|
||||||
|
]
|
||||||
|
certificate_profile = "signature/pm_5.p7b"
|
||||||
|
hap_name = "pm"
|
||||||
|
part_name = "prebuilt_hap"
|
||||||
|
subsystem_name = "applications"
|
||||||
|
}
|
||||||
|
|
||||||
|
ohos_app_scope("permission_manager_app_profile") {
|
||||||
|
app_profile = "AppScope/app.json"
|
||||||
|
sources = [ "AppScope/resources" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
ohos_js_assets("permission_manager_js_assets") {
|
||||||
|
ets2abc = true
|
||||||
|
source_dir = "entry/src/main/ets"
|
||||||
|
}
|
||||||
|
|
||||||
|
ohos_resources("permission_manager_resources") {
|
||||||
|
sources = [ "entry/src/main/resources" ]
|
||||||
|
deps = [ ":permission_manager_app_profile" ]
|
||||||
|
hap_profile = "entry/src/main/module.json"
|
||||||
|
}
|
177
LICENSE
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
83
OAT.xml
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- 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.
|
||||||
|
|
||||||
|
This is the configuration file template for OpenHarmony OSS Audit Tool, please copy it to your project root dir and modify it refer to OpenHarmony/tools_oat/README.
|
||||||
|
All configurations in this file will be merged to OAT-Default.xml, if you have any questions or concerns, please create issue in OpenHarmony/tools_oat and @jalenchen or chenyaxun.
|
||||||
|
|
||||||
|
licensefile:
|
||||||
|
1.If the project don't have "LICENSE" in root dir, please define all the license files in this project in , OAT will check license files according to this rule.
|
||||||
|
|
||||||
|
policylist:
|
||||||
|
1. policy: If the OAT-Default.xml policies do not meet your requirements, please add policies here.
|
||||||
|
2. policyitem: The fields type, name, path, desc is required, and the fields rule, group, filefilter is optional,the default value is:
|
||||||
|
<policyitem type="" name="" path="" desc="" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter"/>
|
||||||
|
3. policyitem type:
|
||||||
|
"compatibility" is used to check license compatibility in the specified path;
|
||||||
|
"license" is used to check source license header in the specified path;
|
||||||
|
"copyright" is used to check source copyright header in the specified path;
|
||||||
|
"import" is used to check source dependency in the specified path, such as import ... ,include ...
|
||||||
|
"filetype" is used to check file type in the specified path, supported file types: archive, binary
|
||||||
|
"filename" is used to check whether the specified file exists in the specified path(projectroot means the root dir of the project), supported file names: LICENSE, README, README.OpenSource
|
||||||
|
4. policyitem name: This field is used for define the license, copyright, "*" means match all, the "!" prefix means could not match this value. For example, "!GPL" means can not use GPL license.
|
||||||
|
5. policyitem path: This field is used for define the source file scope to apply this policyitem, the "!" prefix means exclude the files. For example, "!.*/lib/.*" means files in lib dir will be exclude while process this policyitem.
|
||||||
|
6. policyitem rule and group: These two fields are used together to merge policy results. "may" policyitems in the same group means any one in this group passed, the result will be passed.
|
||||||
|
7. policyitem filefilter: Used to bind filefilter which define filter rules.
|
||||||
|
7. policyitem desc: Used to describe the reason of this policy item, committers will check this while merging the code.
|
||||||
|
8. filefilter: Filter rules, the type filename is used to filter file name, the type filepath is used to filter file path.
|
||||||
|
|
||||||
|
Note:If the text contains special characters, please escape them according to the following rules:
|
||||||
|
" == "
|
||||||
|
& == &
|
||||||
|
' == '
|
||||||
|
< == <
|
||||||
|
> == >
|
||||||
|
-->
|
||||||
|
|
||||||
|
<configuration>
|
||||||
|
<oatconfig>
|
||||||
|
<licensefile></licensefile>
|
||||||
|
<policylist>
|
||||||
|
<policy name="projectPolicy" desc="">
|
||||||
|
<!--policyitem type="compatibility" name="GPL-2.0+" path=".*" desc="Process that runs independently, invoked by the X process."/-->
|
||||||
|
<!--policyitem type="license" name="LGPL" path=".*" desc="Dynamically linked by module X"/-->
|
||||||
|
<!--policyitem type="copyright" name="xxx" path=".*" rule="may" group="defaultGroup" filefilter="copyrightPolicyFilter" desc="Developed by X Company"/-->
|
||||||
|
</policy>
|
||||||
|
</policylist>
|
||||||
|
|
||||||
|
<filefilterlist>
|
||||||
|
<filefilter name="defaultFilter" desc="Files not to check">
|
||||||
|
<filteritem type="filename" name="*.iml|*.json|*.txt" desc="desc files"/>
|
||||||
|
<filteritem type="filepath" name="target/.*" desc="Compile output files"/>
|
||||||
|
<filteritem type="filepath" name="out/.*" desc="Compile output files"/>
|
||||||
|
<filteritem type="filepath" name="log/.*" desc="log files"/>
|
||||||
|
<filteritem type="filepath" name=".idea/.*" desc="IDE temp files"/>
|
||||||
|
<filteritem type="filepath" name="projectroot/[a-zA-Z0-9]{20,}.sh" desc="Temp files"/>
|
||||||
|
<filteritem type="filepath" name="src/test/.*" desc="Test files"/>
|
||||||
|
</filefilter>
|
||||||
|
<filefilter name="defaultPolicyFilter" desc="Filters for compatibility,license header policies">
|
||||||
|
<filteritem type="filepath" name="src/main/java/ohos/oat/analysis/headermatcher/.*" desc="License matcher rules, not license header"/>
|
||||||
|
</filefilter>
|
||||||
|
<filefilter name="copyrightPolicyFilter" desc="Filters for copyright header policies">
|
||||||
|
</filefilter>
|
||||||
|
<filefilter name="licenseFileNamePolicyFilter" desc="Filters for LICENSE file policies">
|
||||||
|
</filefilter>
|
||||||
|
<filefilter name="readmeFileNamePolicyFilter" desc="Filters for README file policies">
|
||||||
|
</filefilter>
|
||||||
|
<filefilter name="readmeOpenSourcefileNamePolicyFilter" desc="Filters for README.OpenSource file policies">
|
||||||
|
</filefilter>
|
||||||
|
<filefilter name="binaryFileTypePolicyFilter" desc="Filters for binary file policies">
|
||||||
|
</filefilter>
|
||||||
|
</filefilterlist>
|
||||||
|
</oatconfig>
|
||||||
|
</configuration>
|
67
build-profile.json5
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
{
|
||||||
|
"app": {
|
||||||
|
"compileSdkVersion": 9,
|
||||||
|
"compatibleSdkVersion": 9,
|
||||||
|
"products": [
|
||||||
|
{
|
||||||
|
"name": "default",
|
||||||
|
"signingConfig": "default"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"signingConfigs": [
|
||||||
|
{
|
||||||
|
"name": "default",
|
||||||
|
"material": {
|
||||||
|
"storePassword": "00000018696E371C175AF00C64950E33E3CC1A8BAF912DDF5AFF91F37C54F75068F765867F383828",
|
||||||
|
"certpath": "C:/Users/shuling/Desktop/pm/pm/pm.cer",
|
||||||
|
"keyAlias": "pm",
|
||||||
|
"keyPassword": "0000001838E443A71A0A95663A34E7D49B8D1BF20E20A97E8F11050CE5E3C5FFD11CBF738EBDA6B9",
|
||||||
|
"profile": "C:/Users/shuling/Desktop/pm/pm/pm_5.p7b",
|
||||||
|
"signAlg": "SHA256withECDSA",
|
||||||
|
"storeFile": "C:/Users/shuling/Desktop/pm/pm/pm.p12"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"modules": [
|
||||||
|
{
|
||||||
|
"name": "entry",
|
||||||
|
"srcPath": "./entry",
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"name": "default",
|
||||||
|
"applyToProducts": [
|
||||||
|
"default"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "permissionmanager",
|
||||||
|
"srcPath": "./permissionmanager",
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"name": "default",
|
||||||
|
"applyToProducts": [
|
||||||
|
"default"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
28
entry/build-profile.json5
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
{
|
||||||
|
"apiType": 'stageMode',
|
||||||
|
"buildOption": {
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"name": "default",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ohosTest",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
2
entry/hvigorfile.js
Normal file
@ -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
|
5
entry/package-lock.json
generated
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"name": "entry",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"lockfileVersion": 1
|
||||||
|
}
|
14
entry/package.json
Normal file
@ -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":{}
|
||||||
|
}
|
7
entry/src/main/ets/Application/AbilityStage.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import AbilityStage from "@ohos.application.AbilityStage"
|
||||||
|
|
||||||
|
export default class MyAbilityStage extends AbilityStage {
|
||||||
|
onCreate() {
|
||||||
|
console.log("[Demo] MyAbilityStage onCreate")
|
||||||
|
}
|
||||||
|
}
|
34
entry/src/main/ets/MainAbility/MainAbility.ts
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import Ability from '@ohos.application.Ability'
|
||||||
|
|
||||||
|
export default class MainAbility extends Ability {
|
||||||
|
onCreate(want, launchParam) {
|
||||||
|
console.log("[Demo] MainAbility onCreate")
|
||||||
|
globalThis.abilityWant = want;
|
||||||
|
}
|
||||||
|
|
||||||
|
onDestroy() {
|
||||||
|
console.log("[Demo] MainAbility onDestroy")
|
||||||
|
}
|
||||||
|
|
||||||
|
onWindowStageCreate(windowStage) {
|
||||||
|
// Main window is created, set main page for this ability
|
||||||
|
console.log("[Demo] MainAbility onWindowStageCreate")
|
||||||
|
|
||||||
|
windowStage.setUIContent(this.context, "pages/index", null)
|
||||||
|
}
|
||||||
|
|
||||||
|
onWindowStageDestroy() {
|
||||||
|
// Main window is destroyed, release UI related resources
|
||||||
|
console.log("[Demo] MainAbility onWindowStageDestroy")
|
||||||
|
}
|
||||||
|
|
||||||
|
onForeground() {
|
||||||
|
// Ability has brought to foreground
|
||||||
|
console.log("[Demo] MainAbility onForeground")
|
||||||
|
}
|
||||||
|
|
||||||
|
onBackground() {
|
||||||
|
// Ability has back to background
|
||||||
|
console.log("[Demo] MainAbility onBackground")
|
||||||
|
}
|
||||||
|
};
|
32
entry/src/main/ets/pages/index.ets
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Entry
|
||||||
|
@Component
|
||||||
|
struct Index {
|
||||||
|
@State message: string = 'Hello World'
|
||||||
|
|
||||||
|
build() {
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Text(this.message)
|
||||||
|
.fontSize(50)
|
||||||
|
.fontWeight(FontWeight.Bold)
|
||||||
|
}
|
||||||
|
.width('100%')
|
||||||
|
}
|
||||||
|
.height('100%')
|
||||||
|
}
|
||||||
|
}
|
37
entry/src/main/module.json
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
{
|
||||||
|
"module": {
|
||||||
|
"name": "entry",
|
||||||
|
"type": "entry",
|
||||||
|
"srcEntrance": "./ets/Application/AbilityStage.ts",
|
||||||
|
"description": "$string:entry_desc",
|
||||||
|
"mainElement": "MainAbility",
|
||||||
|
"deviceTypes": [
|
||||||
|
"phone"
|
||||||
|
],
|
||||||
|
"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",
|
||||||
|
"visible": true,
|
||||||
|
"skills": [
|
||||||
|
{
|
||||||
|
"entities": [
|
||||||
|
"entity.system.home"
|
||||||
|
],
|
||||||
|
"actions": [
|
||||||
|
"action.system.home"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
16
entry/src/main/resources/base/element/string.json
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"string": [
|
||||||
|
{
|
||||||
|
"name": "entry_desc",
|
||||||
|
"value": "description"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "MainAbility_desc",
|
||||||
|
"value": "description"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "MainAbility_label",
|
||||||
|
"value": "label"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
BIN
entry/src/main/resources/base/media/icon.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
5
entry/src/main/resources/base/profile/main_pages.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"src": [
|
||||||
|
"pages/index"
|
||||||
|
]
|
||||||
|
}
|
2
hvigorfile.js
Normal file
@ -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
|
10
local.properties
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# This file is automatically generated by DevEco Studio.
|
||||||
|
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||||
|
#
|
||||||
|
# This file should *NOT* be checked into Version Control Systems,
|
||||||
|
# as it contains information specific to your local configuration.
|
||||||
|
#
|
||||||
|
# For customization when using a Version Control System, please read the header note.
|
||||||
|
sdk.dir=C:/Users/shuling/AppData/Local/OpenHarmony/Sdk
|
||||||
|
nodejs.dir=C:/Program Files/Huawei/DevEco Studio 3.0.0.900/tools/nodejs
|
||||||
|
npm.dir=C:/Program Files/Huawei/DevEco Studio 3.0.0.900/tools/nodejs
|
1643
package-lock.json
generated
Normal file
18
package.json
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"license":"ISC",
|
||||||
|
"devDependencies":{},
|
||||||
|
"name":"permissionmanager",
|
||||||
|
"ohos":{
|
||||||
|
"org":"huawei",
|
||||||
|
"directoryLevel":"project",
|
||||||
|
"buildTool":"hvigor"
|
||||||
|
},
|
||||||
|
"description":"example description",
|
||||||
|
"repository":{},
|
||||||
|
"version":"1.0.0",
|
||||||
|
"dependencies":{
|
||||||
|
"@ohos/hvigor-ohos-plugin":"1.0.6",
|
||||||
|
"hypium":"^1.0.0",
|
||||||
|
"@ohos/hvigor":"1.0.6"
|
||||||
|
}
|
||||||
|
}
|
3
permissionmanager/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/node_modules
|
||||||
|
/.preview
|
||||||
|
/build
|
29
permissionmanager/BUILD.gn
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import("//build/ohos.gni")
|
||||||
|
|
||||||
|
ohos_hap("pm_really") {
|
||||||
|
hap_profile = "src/main/module.json"
|
||||||
|
deps = [
|
||||||
|
":permission_manager_js_assets",
|
||||||
|
":permission_manager_resources",
|
||||||
|
]
|
||||||
|
certificate_profile = "../signature/pm_5.p7b"
|
||||||
|
hap_name = "pm_really"
|
||||||
|
part_name = "prebuilt_hap"
|
||||||
|
subsystem_name = "applications"
|
||||||
|
}
|
||||||
|
|
||||||
|
ohos_app_scope("permission_manager_app_profile") {
|
||||||
|
app_profile = "../AppScope/app.json"
|
||||||
|
sources = [ "../AppScope/resources" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
ohos_js_assets("permission_manager_js_assets") {
|
||||||
|
ets2abc = true
|
||||||
|
source_dir = "src/main/ets"
|
||||||
|
}
|
||||||
|
|
||||||
|
ohos_resources("permission_manager_resources") {
|
||||||
|
sources = [ "src/main/resources" ]
|
||||||
|
deps = [ ":permission_manager_app_profile" ]
|
||||||
|
hap_profile = "src/main/module.json"
|
||||||
|
}
|
28
permissionmanager/build-profile.json5
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
{
|
||||||
|
"apiType": 'stageMode',
|
||||||
|
"buildOption": {
|
||||||
|
},
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"name": "default",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ohosTest",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
2
permissionmanager/hvigorfile.js
Normal file
@ -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
|
5
permissionmanager/package-lock.json
generated
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"name": "permissionmanager",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"lockfileVersion": 1
|
||||||
|
}
|
14
permissionmanager/package.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"license":"ISC",
|
||||||
|
"devDependencies":{},
|
||||||
|
"name":"permissionmanager",
|
||||||
|
"ohos":{
|
||||||
|
"org":"huawei",
|
||||||
|
"directoryLevel":"module",
|
||||||
|
"buildTool":"hvigor"
|
||||||
|
},
|
||||||
|
"description":"example description",
|
||||||
|
"repository":{},
|
||||||
|
"version":"1.0.0",
|
||||||
|
"dependencies":{}
|
||||||
|
}
|
24
permissionmanager/src/main/ets/Application/AbilityStage.ts
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import AbilityStage from "@ohos.application.AbilityStage"
|
||||||
|
|
||||||
|
var TAG = "PermissionManager_MainAbility:"
|
||||||
|
|
||||||
|
export default class MyAbilityStage extends AbilityStage {
|
||||||
|
onCreate() {
|
||||||
|
console.log(TAG + "MyAbilityStage onCreate.")
|
||||||
|
}
|
||||||
|
}
|
55
permissionmanager/src/main/ets/MainAbility/MainAbility.ts
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import Ability from '@ohos.application.Ability';
|
||||||
|
|
||||||
|
var TAG = "PermissionManager_MainAbility:";
|
||||||
|
|
||||||
|
export default class MainAbility extends Ability {
|
||||||
|
onCreate(want, launchParam) {
|
||||||
|
console.log(TAG + "MainAbility onCreate, ability name is " + want.abilityName + ".");
|
||||||
|
globalThis.context = this.context;
|
||||||
|
}
|
||||||
|
|
||||||
|
onWindowStageCreate(windowStage) {
|
||||||
|
// Main window is created, set main page for this ability
|
||||||
|
console.log(TAG + "MainAbility onWindowStageCreate.");
|
||||||
|
|
||||||
|
globalThis.context = this.context;
|
||||||
|
|
||||||
|
windowStage.setUIContent(this.context, "pages/authority-management", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
onForeground() {
|
||||||
|
// Ability has brought to foreground
|
||||||
|
console.log(TAG + "MainAbility onForeground.");
|
||||||
|
}
|
||||||
|
|
||||||
|
onBackground() {
|
||||||
|
// Ability has back to background
|
||||||
|
console.log(TAG + "MainAbility onBackground.");
|
||||||
|
|
||||||
|
// this.context.terminateSelf();
|
||||||
|
}
|
||||||
|
|
||||||
|
onDestroy() {
|
||||||
|
console.log(TAG + "MainAbility onDestroy.");
|
||||||
|
}
|
||||||
|
|
||||||
|
onWindowStageDestroy() {
|
||||||
|
// Main window is destroyed, release UI related resources
|
||||||
|
console.log(TAG + "MainAbility onWindowStageDestroy.");
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,81 @@
|
|||||||
|
/*
|
||||||
|
* 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 extension from '@ohos.application.ServiceExtensionAbility';
|
||||||
|
import window from '@ohos.window';
|
||||||
|
import display from '@ohos.display';
|
||||||
|
|
||||||
|
var TAG = "PermissionManager_Log:";
|
||||||
|
const MAX_WIDTH = 790;
|
||||||
|
const MAX_HEIGHT = 1100;
|
||||||
|
|
||||||
|
export default class ServiceExtensionAbility extends extension {
|
||||||
|
/**
|
||||||
|
* Lifecycle function, called back when a service extension is started for initialization.
|
||||||
|
*/
|
||||||
|
onCreate(want) {
|
||||||
|
console.info(TAG + "ServiceExtensionAbility onCreate, ability name is " + want.abilityName);
|
||||||
|
|
||||||
|
globalThis.extensionContext = this.context;
|
||||||
|
globalThis.windowNum = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lifecycle function, called back when a service extension is started or recall.
|
||||||
|
*/
|
||||||
|
onRequest(want, startId) {
|
||||||
|
globalThis.abilityWant = want
|
||||||
|
console.info(TAG + "ServiceExtensionAbility onRequest. start id is " + startId);
|
||||||
|
console.info(TAG + "want: " + JSON.stringify(want))
|
||||||
|
|
||||||
|
display.getDefaultDisplay().then(dis => {
|
||||||
|
let navigationBarRect = {
|
||||||
|
left: (dis.width - MAX_WIDTH)/2,
|
||||||
|
top: (dis.height - MAX_HEIGHT)/2,
|
||||||
|
width: MAX_WIDTH,
|
||||||
|
height: MAX_HEIGHT
|
||||||
|
}
|
||||||
|
this.createWindow("permissionDialog" + startId, window.WindowType.TYPE_DIALOG, navigationBarRect)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lifecycle function, called back before a service extension is destroyed.
|
||||||
|
*/
|
||||||
|
onDestroy() {
|
||||||
|
console.info(TAG + "ServiceExtensionAbility onDestroy.");
|
||||||
|
}
|
||||||
|
|
||||||
|
private async createWindow(name: string, windowType: number, rect) {
|
||||||
|
console.info(TAG + "create window")
|
||||||
|
try {
|
||||||
|
const win = await window.create(globalThis.extensionContext, name, windowType)
|
||||||
|
globalThis.extensionWin = win
|
||||||
|
await win.bindDialogTarget(globalThis.abilityWant.parameters['ohos.ability.params.token'].value, () => {
|
||||||
|
win.destroy()
|
||||||
|
globalThis.windowNum --
|
||||||
|
if(globalThis.windowNum == 0) this.context.terminateSelf()
|
||||||
|
})
|
||||||
|
await win.moveTo(rect.left, rect.top)
|
||||||
|
await win.resetSize(rect.width, rect.height)
|
||||||
|
await win.loadContent('pages/dialogPlus')
|
||||||
|
await win.setBackgroundColor('#00000000')
|
||||||
|
await win.show()
|
||||||
|
globalThis.windowNum ++
|
||||||
|
} catch {
|
||||||
|
console.info(TAG + "window create failed!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,77 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import Constants from '../utils/constant';
|
||||||
|
|
||||||
|
@Component
|
||||||
|
export struct alphabetIndexerComponent {
|
||||||
|
private value: string[] = [
|
||||||
|
'#',
|
||||||
|
'A',
|
||||||
|
'B',
|
||||||
|
'C',
|
||||||
|
'D',
|
||||||
|
'E',
|
||||||
|
'F',
|
||||||
|
'G',
|
||||||
|
'H',
|
||||||
|
'I',
|
||||||
|
'J',
|
||||||
|
'K',
|
||||||
|
'L',
|
||||||
|
'M',
|
||||||
|
'N',
|
||||||
|
'O',
|
||||||
|
'P',
|
||||||
|
'Q',
|
||||||
|
'R',
|
||||||
|
'S',
|
||||||
|
'T',
|
||||||
|
'U',
|
||||||
|
'V',
|
||||||
|
'W',
|
||||||
|
'X',
|
||||||
|
'Y',
|
||||||
|
'Z'
|
||||||
|
]; // Array of alphabetically indexed names
|
||||||
|
@Link applicationItem: any; // application info array
|
||||||
|
@Link oldApplicationItem: any; // Original application information array
|
||||||
|
@State index: number = 0; // alphabetical index
|
||||||
|
|
||||||
|
build() {
|
||||||
|
AlphabetIndexer({ arrayValue: this.value, selected: this.index })
|
||||||
|
.selectedColor($r('app.color.selected_Color')) // selected color
|
||||||
|
.popupColor($r('app.color.popup_Color')) // popover color
|
||||||
|
.selectedBackgroundColor($r('app.color.selected_Background_Color')) // Check background color
|
||||||
|
.popupBackground($r('app.color.popup_Background_Color')) // popover background color
|
||||||
|
.usingPopup(true) // whether to show a popup
|
||||||
|
.selectedFont({ size: Constants.ALPHABETINDEXER_SELECTEDFONT_SIZE, weight: FontWeight.Bolder }) // selected style
|
||||||
|
.popupFont({ size: Constants.ALPHABETINDEXER_POPUPFONT_SIZE, weight: FontWeight.Bolder }) // Demo of the popup
|
||||||
|
.itemSize(Constants.ALPHABETINDEXER_ITEMSIZE) // size square of each item
|
||||||
|
.alignStyle(IndexerAlign.Left) // Align left
|
||||||
|
.onSelected((index: number) => {
|
||||||
|
this.index = index;
|
||||||
|
if (this.value[index] === '#' || this.value[index] === '☆') {
|
||||||
|
this.applicationItem = this.oldApplicationItem;
|
||||||
|
} else {
|
||||||
|
this.applicationItem = this.oldApplicationItem.filter((item) => {
|
||||||
|
return item.alphabeticalIndex.toUpperCase() === this.value[index];
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.height(Constants.ALPHABETINDEXER_HEIGHT)
|
||||||
|
.width(Constants.ALPHABETINDEXER_WIDTH)
|
||||||
|
}
|
||||||
|
}
|
78
permissionmanager/src/main/ets/common/components/backBar.ets
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import router from '@system.router';
|
||||||
|
import Resmgr from '@ohos.resourceManager'
|
||||||
|
import Constants from '../utils/constant';
|
||||||
|
|
||||||
|
@Component
|
||||||
|
export struct backBar {
|
||||||
|
@Prop title: string; // return title name
|
||||||
|
@Prop recordable: boolean
|
||||||
|
@State record: string = ''
|
||||||
|
|
||||||
|
build() {
|
||||||
|
Column() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
|
||||||
|
Image($r('app.media.left'))
|
||||||
|
.objectFit(ImageFit.Contain)
|
||||||
|
.height(Constants.BACKBAR_IMAGE_HEIGHT)
|
||||||
|
.width(Constants.BACKBAR_IMAGE_WIDTH)
|
||||||
|
.margin({
|
||||||
|
top: Constants.BACKBAR_IMAGE_MARGIN_TOP,
|
||||||
|
left: Constants.BACKBAR_IMAGE_MARGIN_LEFT,
|
||||||
|
right: Constants.BACKBAR_IMAGE_MARGIN_RIGHT
|
||||||
|
})
|
||||||
|
.onClick(() => {
|
||||||
|
var length = router.getLength()
|
||||||
|
Number(length) == 1 ? globalThis.context.terminateSelf() : router.back()
|
||||||
|
})
|
||||||
|
Text(JSON.parse(this.title))
|
||||||
|
.fontColor($r('app.color.text_color'))
|
||||||
|
.fontSize(Constants.BACKBAR_TEXT_FONT_SIZE)
|
||||||
|
.flexGrow(Constants.BACKBAR_TEXT_FLEX_GROW)
|
||||||
|
.fontWeight(FontWeight.Bold)
|
||||||
|
.margin({ top: Constants.BACKBAR_TEXT_MARGIN_TOP })
|
||||||
|
if(this.recordable) {
|
||||||
|
Image($r("app.media.gongneng_dian"))
|
||||||
|
.objectFit(ImageFit.Contain)
|
||||||
|
.height(Constants.BACKBAR_IMAGE_HEIGHT)
|
||||||
|
.width(Constants.BACKBAR_IMAGE_WIDTH)
|
||||||
|
.margin({ top: Constants.BACKBAR_TEXT_MARGIN_TOP, right: Constants.BACKBAR_IMAGE_MARGIN_RIGHT })
|
||||||
|
.bindMenu([
|
||||||
|
{
|
||||||
|
value: this.record,
|
||||||
|
action: () => {
|
||||||
|
router.push({ uri: 'pages/permission-access-record' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.height(Constants.BACKBAR_HEIGHT)
|
||||||
|
.constraintSize({ minHeight: Constants.BACKBAR_MINHEIGHT })
|
||||||
|
.alignItems(HorizontalAlign.Start)
|
||||||
|
.backgroundColor($r('app.color.background_color'))
|
||||||
|
}
|
||||||
|
|
||||||
|
aboutToAppear() {
|
||||||
|
Resmgr.getResourceManager(globalThis.context, Constants.BUNDLE_NAME).then(item => {
|
||||||
|
item.getString($r("app.string.permission_access_record").id, (err, val) => {
|
||||||
|
this.record = val
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
40
permissionmanager/src/main/ets/common/components/dialog.ets
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import Constants from '../utils/constant';
|
||||||
|
|
||||||
|
@CustomDialog
|
||||||
|
export struct authorizeDialog {
|
||||||
|
controller: CustomDialogController;
|
||||||
|
cancel: () => void;
|
||||||
|
confirm: () => void;
|
||||||
|
|
||||||
|
build() {
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Center }) {
|
||||||
|
Text($r("app.string.Authorization_failed")).fontSize(Constants.DIALOG_TEXT_FONT_SIZE)
|
||||||
|
.margin({
|
||||||
|
top: Constants.DIALOG_TEXT_MARGIN_TOP
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.backgroundColor($r('app.color.default_background_color'))
|
||||||
|
.borderRadius(Constants.DIALOG_BORDER_RADIUS)
|
||||||
|
.height(Constants.DIALOG_HEIGHT)
|
||||||
|
.width(Constants.DIALOG_WIDTH)
|
||||||
|
}
|
||||||
|
}
|
63
permissionmanager/src/main/ets/common/components/search.ets
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import Constants from '../utils/constant';
|
||||||
|
|
||||||
|
@Component
|
||||||
|
export struct textInput {
|
||||||
|
@Prop placeholder: string; // Prompt text when no input
|
||||||
|
@Link applicationItem: any; // application info array
|
||||||
|
@Link oldApplicationItem: any; // Original application information array
|
||||||
|
@Link searchResult: boolean; // search results
|
||||||
|
|
||||||
|
build() {
|
||||||
|
Column() {
|
||||||
|
Flex({ alignContent: FlexAlign.Start }) {
|
||||||
|
TextInput({ placeholder: this.placeholder })
|
||||||
|
.backgroundColor($r('app.color.default_background_color'))
|
||||||
|
.padding({ left: Constants.TEXTINPUT_PADDING_LEFT })
|
||||||
|
.type(InputType.Normal)
|
||||||
|
.border({ width: Constants.TEXTINPUT_BORDER_WIDTH, color: $r("app.color.label_color_20"), radius: Constants.TEXTINPUT_BORDER_RADIUS })
|
||||||
|
.placeholderColor(Color.Grey)
|
||||||
|
.placeholderFont({ size: Constants.TEXTINPUT_PLACEHOLDER_Font_SIZE, weight: FontWeight.Normal, family: "sans-serif", style: FontStyle.Normal })
|
||||||
|
.caretColor($r('app.color.secondary_font_color'))
|
||||||
|
.height(Constants.TEXTINPUT_HEIGHT)
|
||||||
|
.onChange((value: string) => {
|
||||||
|
if (value === '' || value === null) {
|
||||||
|
this.applicationItem = this.oldApplicationItem;
|
||||||
|
} else {
|
||||||
|
this.applicationItem = this.oldApplicationItem.filter((item) => {
|
||||||
|
return item.labelId.indexOf(value) > -1;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (this.applicationItem.length) {
|
||||||
|
this.searchResult = true;
|
||||||
|
} else {
|
||||||
|
this.searchResult = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.onSubmit((enterKey) => {
|
||||||
|
})
|
||||||
|
.onEditChanged((isEditing) => {
|
||||||
|
})
|
||||||
|
Image($r('app.media.search'))
|
||||||
|
.objectFit(ImageFit.Contain)
|
||||||
|
.width(Constants.TEXTINPUT_IMAGE_WIDTH)
|
||||||
|
.height(Constants.TEXTINPUT_IMAGE_HEIGHT)
|
||||||
|
.position({ x: Constants.TEXTINPUT_IMAGE_MARGIN_LEFT, y: Constants.TEXTINPUT_IMAGE_MARGIN_TOP })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
38
permissionmanager/src/main/ets/common/model/bundle.ets
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* 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 const BundleFlag = {
|
||||||
|
GET_BUNDLE_DEFAULT : 0x00000000,
|
||||||
|
GET_BUNDLE_WITH_ABILITIES : 0x00000001,
|
||||||
|
GET_ABILITY_INFO_WITH_PERMISSION : 0x00000002,
|
||||||
|
GET_ABILITY_INFO_WITH_APPLICATION : 0x00000004,
|
||||||
|
GET_APPLICATION_INFO_WITH_PERMISSION : 0x00000008,
|
||||||
|
GET_BUNDLE_WITH_REQUESTED_PERMISSION : 0x00000010,
|
||||||
|
GET_ALL_APPLICATION_INFO : 0xFFFF0000,
|
||||||
|
/**
|
||||||
|
* @since 8
|
||||||
|
*/
|
||||||
|
GET_ABILITY_INFO_WITH_METADATA : 0x00000020,
|
||||||
|
/**
|
||||||
|
* @since 8
|
||||||
|
*/
|
||||||
|
GET_APPLICATION_INFO_WITH_METADATA : 0x00000040,
|
||||||
|
/**
|
||||||
|
* @since 8
|
||||||
|
*/
|
||||||
|
GET_ABILITY_INFO_SYSTEMAPP_ONLY : 0x00000080
|
||||||
|
}
|
||||||
|
|
||||||
|
export const USER_ID: number = 100
|
512
permissionmanager/src/main/ets/common/model/permissionGroup.ets
Normal file
@ -0,0 +1,512 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const permissionGroups: any[] = [
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.LOCATION_IN_BACKGROUND",
|
||||||
|
"groupName": "LOCATION",
|
||||||
|
"label": "后台定位权限",
|
||||||
|
"description": "允许应用在后台运行时获取位置信息。",
|
||||||
|
"groupId": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.LOCATION",
|
||||||
|
"groupName": "LOCATION",
|
||||||
|
"label": "前台定位权限",
|
||||||
|
"description": "允许应用在前台运行时获取位置信息。",
|
||||||
|
"groupId": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.CAMERA",
|
||||||
|
"groupName": "CAMERA",
|
||||||
|
"label": "拍摄照片和录制视频",
|
||||||
|
"description": "允许应用拍摄照片和视频。",
|
||||||
|
"groupId": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.MICROPHONE",
|
||||||
|
"groupName": "MICROPHONE",
|
||||||
|
"label": "录制音频",
|
||||||
|
"description": "允许应用打开或关闭录音通路。",
|
||||||
|
"groupId": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.ANSWER_CALL",
|
||||||
|
"groupName": "PHONE",
|
||||||
|
"label": "接听电话",
|
||||||
|
"description": "允许应用接听电话。",
|
||||||
|
"groupId": 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.MANAGE_VOICEMAIL",
|
||||||
|
"groupName": "PHONE",
|
||||||
|
"label": "语音信箱",
|
||||||
|
"description": "允许应用管理语音信箱。",
|
||||||
|
"groupId": 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.READ_CELL_MESSAGES",
|
||||||
|
"groupName": "SMS",
|
||||||
|
"label": "读取小区广播",
|
||||||
|
"description": "允许应用读取设备接收的小区广播信息。",
|
||||||
|
"groupId": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.READ_MESSAGES",
|
||||||
|
"groupName": "SMS",
|
||||||
|
"label": "读取短彩信",
|
||||||
|
"description": "允许应用读取设备接收的短彩信信息。",
|
||||||
|
"groupId": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.RECEIVE_MMS",
|
||||||
|
"groupName": "SMS",
|
||||||
|
"label": "接收彩信",
|
||||||
|
"description": "允许应用接收彩信。",
|
||||||
|
"groupId": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.RECEIVE_SMS",
|
||||||
|
"groupName": "SMS",
|
||||||
|
"label": "接收短信",
|
||||||
|
"description": "允许应用接收短信。",
|
||||||
|
"groupId": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.RECEIVE_WAP_MESSAGES",
|
||||||
|
"groupName": "SMS",
|
||||||
|
"label": "接收WAP消息",
|
||||||
|
"description": "允许应用接收和处理WAP消息。",
|
||||||
|
"groupId": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.SEND_MESSAGES",
|
||||||
|
"groupName": "SMS",
|
||||||
|
"label": "发送短彩信",
|
||||||
|
"description": "允许应用发送短彩信",
|
||||||
|
"groupId": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.READ_CONTACTS",
|
||||||
|
"groupName": "CONTACTS",
|
||||||
|
"label": "读取通讯录",
|
||||||
|
"description": "允许应用读取设备上存储的联系人信息。",
|
||||||
|
"groupId": 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.WRITE_CONTACTS",
|
||||||
|
"groupName": "CONTACTS",
|
||||||
|
"label": "新建/修改/删除通讯录",
|
||||||
|
"description": "允许应用新建/修改/删除设备上存储的联系人信息。",
|
||||||
|
"groupId": 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.READ_CALL_LOG",
|
||||||
|
"groupName": "CALL_LOG",
|
||||||
|
"label": "读取通话记录",
|
||||||
|
"description": "允许应用读取设备上的通话记录信息。",
|
||||||
|
"groupId": 6
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.WRITE_CALL_LOG",
|
||||||
|
"groupName": "CALL_LOG",
|
||||||
|
"label": "新建/修改/删除通话记录",
|
||||||
|
"description": "允许新建/修改/删除设备上的通话记录信息。",
|
||||||
|
"groupId": 6
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.MEDIA_LOCATION",
|
||||||
|
"groupName": "MEDIA",
|
||||||
|
"label": "允许应用访问拍摄位置",
|
||||||
|
"description": "应用访问用户媒体文件中的拍摄位置信息如经纬度信息。",
|
||||||
|
"groupId": 7
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.READ_MEDIA",
|
||||||
|
"groupName": "MEDIA",
|
||||||
|
"label": "允许应用读取媒体文件",
|
||||||
|
"description": "允许应用访问户媒体文件,如视频、音频、图片等。",
|
||||||
|
"groupId": 7
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.WRITE_MEDIA",
|
||||||
|
"groupName": "MEDIA",
|
||||||
|
"label": "允许应用读写媒体文件",
|
||||||
|
"description": "允许应用读写户媒体文件,如视频、音频、图片等。",
|
||||||
|
"groupId": 7
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.READ_CALENDAR",
|
||||||
|
"groupName": "CALENDAR",
|
||||||
|
"label": "读取日历",
|
||||||
|
"description": "允许应用读取日历。",
|
||||||
|
"groupId": 8
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.WRITE_CALENDAR",
|
||||||
|
"groupName": "CALENDAR",
|
||||||
|
"label": "新建/修改/删除日历",
|
||||||
|
"description": "允许应用新建/修改/删除日历。",
|
||||||
|
"groupId": 8
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.ACTIVITY_MOTION",
|
||||||
|
"groupName": "SPORT",
|
||||||
|
"label": "读取用户的运动状态",
|
||||||
|
"description": "允许应用程序读取用户的运动状态。",
|
||||||
|
"groupId": 9
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.READ_HEALTH_DATA",
|
||||||
|
"groupName": "HEALTH",
|
||||||
|
"label": "读取用户的健康数据",
|
||||||
|
"description": "允许应用程序读取用户的健康数据。",
|
||||||
|
"groupId": 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"permissionName": "ohos.permission.DISTRIBUTED_DATASYNC",
|
||||||
|
"groupName": "OTHER",
|
||||||
|
"icon": $r("app.media.ic_multi_device_vector"),
|
||||||
|
"text": "使用多设备协同?",
|
||||||
|
"label": "多设备协同",
|
||||||
|
"description": "发现并访问其他设备。",
|
||||||
|
"groupId": 11
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
export const groups: any[] = [
|
||||||
|
{
|
||||||
|
"name": "LOCATION",
|
||||||
|
"groupName": "位置信息",
|
||||||
|
"icon": $r('app.media.ic_public_gps'),
|
||||||
|
"description": "",
|
||||||
|
"label": "访问位置信息?",
|
||||||
|
"permissions": [
|
||||||
|
"ohos.permission.LOCATION_IN_BACKGROUND",
|
||||||
|
"ohos.permission.LOCATION"
|
||||||
|
],
|
||||||
|
"isShow":true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "CAMERA",
|
||||||
|
"groupName": "相机",
|
||||||
|
"icon": $r('app.media.ic_public_camera'),
|
||||||
|
"label": "使用相机?",
|
||||||
|
"description": "",
|
||||||
|
"permissions": [
|
||||||
|
"ohos.permission.CAMERA"
|
||||||
|
],
|
||||||
|
"isShow":true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "MICROPHONE",
|
||||||
|
"groupName": "麦克风",
|
||||||
|
"icon": $r('app.media.ic_public_voice'),
|
||||||
|
"label": "使用麦克风?",
|
||||||
|
"description": "",
|
||||||
|
"permissions": [
|
||||||
|
"ohos.permission.MICROPHONE"
|
||||||
|
],
|
||||||
|
"isShow":true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PHONE",
|
||||||
|
"groupName": "电话",
|
||||||
|
"icon": $r('app.media.ic_public_phone'),
|
||||||
|
"label": "使用拨打电话?",
|
||||||
|
"description": "",
|
||||||
|
"permissions": [
|
||||||
|
"ohos.permission.ANSWER_CALL",
|
||||||
|
"ohos.permission.MANAGE_VOICEMAIL"
|
||||||
|
],
|
||||||
|
"isShow":false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SMS",
|
||||||
|
"groupName": "信息",
|
||||||
|
"icon": $r('app.media.ic_public_message'),
|
||||||
|
"label": "访问信息?",
|
||||||
|
"description": "",
|
||||||
|
"permissions": [
|
||||||
|
"ohos.permission.READ_CELL_MESSAGES",
|
||||||
|
"ohos.permission.READ_MESSAGES",
|
||||||
|
"ohos.permission.RECEIVE_MMS",
|
||||||
|
"ohos.permission.RECEIVE_SMS",
|
||||||
|
"ohos.permission.RECEIVE_WAP_MESSAGES",
|
||||||
|
"ohos.permission.SEND_MESSAGES"
|
||||||
|
],
|
||||||
|
"isShow":false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "CONTACTS",
|
||||||
|
"groupName": "通讯录",
|
||||||
|
"icon": $r('app.media.ic_public_contacts_group'),
|
||||||
|
"label": "访问通讯录?",
|
||||||
|
"description": "",
|
||||||
|
"permissions": [
|
||||||
|
"ohos.permission.READ_CONTACTS",
|
||||||
|
"ohos.permission.WRITE_CONTACTS"
|
||||||
|
],
|
||||||
|
"isShow":false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "CALL_LOG",
|
||||||
|
"groupName": "通话记录",
|
||||||
|
"icon": $r('app.media.ic_call_logs'),
|
||||||
|
"label": "访问通话记录?",
|
||||||
|
"description": "",
|
||||||
|
"permissions": [
|
||||||
|
"ohos.permission.READ_CALL_LOG",
|
||||||
|
"ohos.permission.WRITE_CALL_LOG"
|
||||||
|
],
|
||||||
|
"isShow":false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "MEDIA",
|
||||||
|
"groupName": "媒体和文件",
|
||||||
|
"icon": $r('app.media.ic_public_folder'),
|
||||||
|
"description": "",
|
||||||
|
"label": "访问媒体和文件?",
|
||||||
|
"permissions": [
|
||||||
|
"ohos.permission.MEDIA_LOCATION",
|
||||||
|
"ohos.permission.READ_MEDIA",
|
||||||
|
"ohos.permission.WRITE_MEDIA"
|
||||||
|
],
|
||||||
|
"isShow":true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "CALENDAR",
|
||||||
|
"groupName": "日历",
|
||||||
|
"icon": $r('app.media.ic_public_calendar'),
|
||||||
|
"label": "访问日历?",
|
||||||
|
"description": "",
|
||||||
|
"permissions": [
|
||||||
|
"ohos.permission.READ_CALENDAR",
|
||||||
|
"ohos.permission.WRITE_CALENDAR"
|
||||||
|
],
|
||||||
|
"isShow":true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SPORT",
|
||||||
|
"groupName": "健身运动",
|
||||||
|
"icon": $r('app.media.ic_sport'),
|
||||||
|
"label": "访问健身运动?",
|
||||||
|
"description": "",
|
||||||
|
"permissions": [
|
||||||
|
"ohos.permission.ACTIVITY_MOTION"
|
||||||
|
],
|
||||||
|
"isShow":true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "HEALTH",
|
||||||
|
"groupName": "身体传感器",
|
||||||
|
"icon": $r('app.media.ic_ssensor'),
|
||||||
|
"label": "使用身体传感器?",
|
||||||
|
"description": "",
|
||||||
|
"permissions": [
|
||||||
|
"ohos.permission.READ_HEALTH_DATA"
|
||||||
|
],
|
||||||
|
"isShow":true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "OTHER",
|
||||||
|
"groupName": "其他权限",
|
||||||
|
"icon": $r('app.media.ic_more'),
|
||||||
|
"description": "",
|
||||||
|
"permissions": [
|
||||||
|
"ohos.permission.DISTRIBUTED_DATASYNC"
|
||||||
|
],
|
||||||
|
"isShow":false
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
export const permissionGroupPermissions: object = {
|
||||||
|
"LOCATION": [
|
||||||
|
"ohos.permission.LOCATION_IN_BACKGROUND",
|
||||||
|
"ohos.permission.LOCATION"
|
||||||
|
],
|
||||||
|
"CAMERA": [
|
||||||
|
"ohos.permission.CAMERA"
|
||||||
|
],
|
||||||
|
"MICROPHONE": [
|
||||||
|
"ohos.permission.MICROPHONE"
|
||||||
|
],
|
||||||
|
"PHONE": [
|
||||||
|
"ohos.permission.ANSWER_CALL",
|
||||||
|
"ohos.permission.MANAGE_VOICEMAIL"
|
||||||
|
],
|
||||||
|
"SMS": [
|
||||||
|
"ohos.permission.READ_CELL_MESSAGES",
|
||||||
|
"ohos.permission.READ_MESSAGES",
|
||||||
|
"ohos.permission.RECEIVE_MMS",
|
||||||
|
"ohos.permission.RECEIVE_SMS",
|
||||||
|
"ohos.permission.RECEIVE_WAP_MESSAGES",
|
||||||
|
"ohos.permission.SEND_MESSAGES"
|
||||||
|
],
|
||||||
|
"CONTACTS": [
|
||||||
|
"ohos.permission.READ_CONTACTS",
|
||||||
|
"ohos.permission.WRITE_CONTACTS"
|
||||||
|
],
|
||||||
|
"CALL_LOG": [
|
||||||
|
"ohos.permission.READ_CALL_LOG",
|
||||||
|
"ohos.permission.WRITE_CALL_LOG"
|
||||||
|
],
|
||||||
|
"MEDIA": [
|
||||||
|
"ohos.permission.MEDIA_LOCATION",
|
||||||
|
"ohos.permission.READ_MEDIA",
|
||||||
|
"ohos.permission.WRITE_MEDIA"
|
||||||
|
],
|
||||||
|
"CALENDAR": [
|
||||||
|
"ohos.permission.READ_CALENDAR",
|
||||||
|
"ohos.permission.WRITE_CALENDAR"
|
||||||
|
],
|
||||||
|
"SPORT": [
|
||||||
|
"ohos.permission.ACTIVITY_MOTION"
|
||||||
|
],
|
||||||
|
"HEALTH": [
|
||||||
|
"ohos.permission.READ_HEALTH_DATA"
|
||||||
|
],
|
||||||
|
"OTHER": [
|
||||||
|
"ohos.permission.DISTRIBUTED_DATASYNC"
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export const userGrantPermissions: string[] = [
|
||||||
|
"ohos.permission.LOCATION_IN_BACKGROUND",
|
||||||
|
"ohos.permission.LOCATION",
|
||||||
|
"ohos.permission.CAMERA",
|
||||||
|
"ohos.permission.MICROPHONE",
|
||||||
|
"ohos.permission.ANSWER_CALL",
|
||||||
|
"ohos.permission.MANAGE_VOICEMAIL",
|
||||||
|
"ohos.permission.READ_CELL_MESSAGES",
|
||||||
|
"ohos.permission.READ_MESSAGES",
|
||||||
|
"ohos.permission.RECEIVE_MMS",
|
||||||
|
"ohos.permission.RECEIVE_SMS",
|
||||||
|
"ohos.permission.RECEIVE_WAP_MESSAGES",
|
||||||
|
"ohos.permission.SEND_MESSAGES",
|
||||||
|
"ohos.permission.READ_CONTACTS",
|
||||||
|
"ohos.permission.WRITE_CONTACTS",
|
||||||
|
"ohos.permission.READ_CALL_LOG",
|
||||||
|
"ohos.permission.WRITE_CALL_LOG",
|
||||||
|
"ohos.permission.MEDIA_LOCATION",
|
||||||
|
"ohos.permission.READ_MEDIA",
|
||||||
|
"ohos.permission.WRITE_MEDIA",
|
||||||
|
"ohos.permission.READ_CALENDAR",
|
||||||
|
"ohos.permission.WRITE_CALENDAR",
|
||||||
|
"ohos.permission.ACTIVITY_MOTION",
|
||||||
|
"ohos.permission.READ_HEALTH_DATA",
|
||||||
|
"ohos.permission.DISTRIBUTED_DATASYNC"
|
||||||
|
];
|
||||||
|
|
||||||
|
export const permissionDescriptions: object = {
|
||||||
|
"位置信息": "允许应用在后台运行时获取位置信息。" ,
|
||||||
|
"相机": "允许应用拍摄照片和视频。" ,
|
||||||
|
"麦克风": "允许应用打开或关闭录音通路。" ,
|
||||||
|
"电话": "允许应用接听电话。" ,
|
||||||
|
"信息": "允许应用发送短彩信。" ,
|
||||||
|
"通讯录": "允许应用新建/修改/删除设备上存储的联系人信息。" ,
|
||||||
|
"通话记录": "允许新建/修改/删除设备上的通话记录信息。" ,
|
||||||
|
"媒体和文件": "允许应用访问户媒体文件,如视频、音频、图片等。" ,
|
||||||
|
"日历": "允许应用新建/修改/删除日历。" ,
|
||||||
|
"健身运动": "允许应用程序读取用户的运动状态。" ,
|
||||||
|
"身体传感器": "允许应用程序读取用户的健康数据。" ,
|
||||||
|
"其他权限": "允许应用与远程设备交换用户数据(如图片、音乐、视频、及应用数据等)。"
|
||||||
|
};
|
||||||
|
|
||||||
|
export const permissionPermissionGroup: object = {
|
||||||
|
"ohos.permission.LOCATION_IN_BACKGROUND": "LOCATION",
|
||||||
|
"ohos.permission.LOCATION": "LOCATION",
|
||||||
|
"ohos.permission.CAMERA": "CAMERA",
|
||||||
|
"ohos.permission.MICROPHONE": "MICROPHONE",
|
||||||
|
"ohos.permission.ANSWER_CALL": "PHONE",
|
||||||
|
"ohos.permission.MANAGE_VOICEMAIL": "PHONE",
|
||||||
|
"ohos.permission.READ_CELL_MESSAGES": "SMS",
|
||||||
|
"ohos.permission.READ_MESSAGES": "SMS",
|
||||||
|
"ohos.permission.RECEIVE_MMS": "SMS",
|
||||||
|
"ohos.permission.RECEIVE_SMS": "SMS",
|
||||||
|
"ohos.permission.RECEIVE_WAP_MESSAGES": "SMS",
|
||||||
|
"ohos.permission.SEND_MESSAGES": "SMS",
|
||||||
|
"ohos.permission.READ_CONTACTS": "CONTACTS",
|
||||||
|
"ohos.permission.WRITE_CONTACTS": "CONTACTS",
|
||||||
|
"ohos.permission.READ_CALL_LOG": "CALL_LOG",
|
||||||
|
"ohos.permission.WRITE_CALL_LOG": "CALL_LOG",
|
||||||
|
"ohos.permission.MEDIA_LOCATION": "MEDIA",
|
||||||
|
"ohos.permission.READ_MEDIA": "MEDIA",
|
||||||
|
"ohos.permission.WRITE_MEDIA": "MEDIA",
|
||||||
|
"ohos.permission.READ_CALENDAR": "CALENDAR",
|
||||||
|
"ohos.permission.WRITE_CALENDAR": "CALENDAR",
|
||||||
|
"ohos.permission.ACTIVITY_MOTION": "SPORT",
|
||||||
|
"ohos.permission.READ_HEALTH_DATA": "HEALTH",
|
||||||
|
"ohos.permission.DISTRIBUTED_DATASYNC": "OTHER"
|
||||||
|
};
|
||||||
|
|
||||||
|
export const permissionGroupIds: object = {
|
||||||
|
"ohos.permission.LOCATION_IN_BACKGROUND": "0",
|
||||||
|
"ohos.permission.LOCATION": "0",
|
||||||
|
"ohos.permission.CAMERA": "1",
|
||||||
|
"ohos.permission.MICROPHONE": "2",
|
||||||
|
"ohos.permission.ANSWER_CALL": "3",
|
||||||
|
"ohos.permission.MANAGE_VOICEMAIL": "3",
|
||||||
|
"ohos.permission.READ_CELL_MESSAGES": "4",
|
||||||
|
"ohos.permission.READ_MESSAGES": "4",
|
||||||
|
"ohos.permission.RECEIVE_MMS": "4",
|
||||||
|
"ohos.permission.RECEIVE_SMS": "4",
|
||||||
|
"ohos.permission.RECEIVE_WAP_MESSAGES": "4",
|
||||||
|
"ohos.permission.SEND_MESSAGES": "4",
|
||||||
|
"ohos.permission.READ_CONTACTS": "5",
|
||||||
|
"ohos.permission.WRITE_CONTACTS": "5",
|
||||||
|
"ohos.permission.READ_CALL_LOG": "6",
|
||||||
|
"ohos.permission.WRITE_CALL_LOG": "6",
|
||||||
|
"ohos.permission.MEDIA_LOCATION": "7",
|
||||||
|
"ohos.permission.READ_MEDIA": "7",
|
||||||
|
"ohos.permission.WRITE_MEDIA": "7",
|
||||||
|
"ohos.permission.READ_CALENDAR": "8",
|
||||||
|
"ohos.permission.WRITE_CALENDAR": "8",
|
||||||
|
"ohos.permission.ACTIVITY_MOTION": "9",
|
||||||
|
"ohos.permission.READ_HEALTH_DATA": "10",
|
||||||
|
"ohos.permission.DISTRIBUTED_DATASYNC": "11"
|
||||||
|
};
|
||||||
|
|
||||||
|
export const orderGroup: string[] = [
|
||||||
|
"位置信息",
|
||||||
|
"相机",
|
||||||
|
"麦克风",
|
||||||
|
"电话",
|
||||||
|
"信息",
|
||||||
|
"通讯录",
|
||||||
|
"通话记录",
|
||||||
|
"媒体和文件",
|
||||||
|
"日历",
|
||||||
|
"健身运动",
|
||||||
|
"身体传感器",
|
||||||
|
"其他权限"
|
||||||
|
];
|
||||||
|
|
||||||
|
export const otherPermissionsLabel: object = {
|
||||||
|
"ohos.permission.DISTRIBUTED_DATASYNC": "多设备协同"
|
||||||
|
};
|
||||||
|
|
||||||
|
export const noNeedDisplayApp: string[] = [
|
||||||
|
"com.ohos.launcher"
|
||||||
|
]
|
||||||
|
|
||||||
|
export const showSubpermissionsGrop: string[] = [
|
||||||
|
"电话",
|
||||||
|
"日历",
|
||||||
|
"信息",
|
||||||
|
"通讯录",
|
||||||
|
"通话记录"
|
||||||
|
];
|
349
permissionmanager/src/main/ets/common/utils/constant.ets
Normal file
@ -0,0 +1,349 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default class Constants {
|
||||||
|
// alphabetIndexer
|
||||||
|
static ALPHABETINDEXER_SELECTEDFONT_SIZE = 12;
|
||||||
|
static ALPHABETINDEXER_POPUPFONT_SIZE = 30;
|
||||||
|
static ALPHABETINDEXER_ITEMSIZE = 16;
|
||||||
|
static ALPHABETINDEXER_HEIGHT = 448;
|
||||||
|
static ALPHABETINDEXER_WIDTH = 36;
|
||||||
|
|
||||||
|
// backBar
|
||||||
|
static BACKBAR_HEIGHT = 56;
|
||||||
|
static BACKBAR_MINHEIGHT = 56;
|
||||||
|
|
||||||
|
// image of backBar
|
||||||
|
static BACKBAR_IMAGE_HEIGHT = 24;
|
||||||
|
static BACKBAR_IMAGE_WIDTH = 24;
|
||||||
|
static BACKBAR_IMAGE_MARGIN_TOP = 17;
|
||||||
|
static BACKBAR_IMAGE_MARGIN_LEFT = 12;
|
||||||
|
static BACKBAR_IMAGE_MARGIN_RIGHT = 15;
|
||||||
|
|
||||||
|
// text of backBar
|
||||||
|
static BACKBAR_TEXT_FONT_SIZE = 20;
|
||||||
|
static BACKBAR_TEXT_FLEX_GROW = 1;
|
||||||
|
static BACKBAR_TEXT_MARGIN_TOP = 17;
|
||||||
|
|
||||||
|
// dialog
|
||||||
|
static DIALOG_BORDER_RADIUS = 24;
|
||||||
|
static DIALOG_HEIGHT = 70;
|
||||||
|
static DIALOG_WIDTH = 336;
|
||||||
|
|
||||||
|
// text of dialog
|
||||||
|
static DIALOG_TEXT_FONT_SIZE = 20;
|
||||||
|
static DIALOG_TEXT_MARGIN_TOP = 25;
|
||||||
|
|
||||||
|
// search textInput
|
||||||
|
static TEXTINPUT_PADDING_LEFT = 36;
|
||||||
|
static TEXTINPUT_BORDER_RADIUS = 20;
|
||||||
|
static TEXTINPUT_BORDER_WIDTH = 1.5;
|
||||||
|
static TEXTINPUT_PLACEHOLDER_Font_SIZE = 16;
|
||||||
|
static TEXTINPUT_HEIGHT = 40;
|
||||||
|
static TEXTINPUT_IMAGE_WIDTH = 16;
|
||||||
|
static TEXTINPUT_IMAGE_HEIGHT = 16;
|
||||||
|
static TEXTINPUT_IMAGE_MARGIN_LEFT = 12;
|
||||||
|
static TEXTINPUT_IMAGE_MARGIN_TOP = 12;
|
||||||
|
|
||||||
|
// grid useSizeType
|
||||||
|
static GRID_MARGIN = '0vp';
|
||||||
|
static GUTTER = 0;
|
||||||
|
static LEFT_XS_SPAN = 0;
|
||||||
|
static LEFT_XS_OFFSET = 0;
|
||||||
|
static LEFT_SM_SPAN = 0;
|
||||||
|
static LEFT_SM_OFFSET = 0;
|
||||||
|
static LEFT_MD_SPAN = 0;
|
||||||
|
static LEFT_MD_OFFSET = 0;
|
||||||
|
static LEFT_LG_SPAN = 2;
|
||||||
|
static LEFT_LG_OFFSET = 0;
|
||||||
|
static MIDDLE_XS_SPAN = 2;
|
||||||
|
static MIDDLE_XS_OFFSET = 0;
|
||||||
|
static MIDDLE_SM_SPAN = 4;
|
||||||
|
static MIDDLE_SM_OFFSET = 0;
|
||||||
|
static MIDDLE_MD_SPAN = 8;
|
||||||
|
static MIDDLE_MD_OFFSET = 0;
|
||||||
|
static MIDDLE_LG_SPAN = 8;
|
||||||
|
static MIDDLE_LG_OFFSET = 2;
|
||||||
|
static RIGHT_XS_SPAN = 0;
|
||||||
|
static RIGHT_XS_OFFSET = 2;
|
||||||
|
static RIGHT_SM_SPAN = 0;
|
||||||
|
static RIGHT_SM_OFFSET = 4;
|
||||||
|
static RIGHT_MD_SPAN = 0;
|
||||||
|
static RIGHT_MD_OFFSET = 8;
|
||||||
|
static RIGHT_LG_SPAN = 2;
|
||||||
|
static RIGHT_LG_OFFSET = 10;
|
||||||
|
|
||||||
|
// 100% width,height
|
||||||
|
static FULL_WIDTH = '100%';
|
||||||
|
static FULL_HEIGHT = '100%';
|
||||||
|
|
||||||
|
// public property style
|
||||||
|
static PERMISSION = 1;
|
||||||
|
static APPLICATION = 0;
|
||||||
|
static LAYOUT_WEIGHT = 1;
|
||||||
|
static FLEX_GROW = 1;
|
||||||
|
static TEXT_DECORATION_HEIGHT = 1;
|
||||||
|
static TEXT_MIDDLE_FONT_SIZE = 16;
|
||||||
|
static TEXT_SMAL_FONT_SIZE = 14;
|
||||||
|
static TEXT_SMALLER_FONT_SIZE = 12;
|
||||||
|
static TEXT_LINE_HEIGHT = 22;
|
||||||
|
static TEXT_SMALL_LINE_HEIGHT = 19;
|
||||||
|
static CONSTRAINTSIZE_MINHEIGHT = 48;
|
||||||
|
static LISTITEM_ROW_HEIGHT = 48;
|
||||||
|
static LISTITEM_PADDING_LEFT = 24;
|
||||||
|
static LIST_PADDING_LEFT = 12
|
||||||
|
static LISTITEM_PADDING_RIGHT = 24;
|
||||||
|
static LISTITEM_PADDING_LEFT_RECORD = 32;
|
||||||
|
static LISTITEM_MARGIN_BOTTOM = 12;
|
||||||
|
static LISTITEM_MARGIN_BOTTOM_PERMISSION = 14;
|
||||||
|
static LISTITEM_MARGIN_BOTTOM_APPLICATION = 10;
|
||||||
|
static LISTITEM_HEIGHT_PERMISSION = 64;
|
||||||
|
static LISTITEM_HEIGHT_APPLICATION = 72;
|
||||||
|
static IMAGE_HEIGHT = 24;
|
||||||
|
static IMAGE_WIDTH = 12;
|
||||||
|
static IMAGE_HEIGHT_RECORD = 12;
|
||||||
|
static IMAGE_WIDTH_RECORD = 24;
|
||||||
|
static IMAGE_HEIGHT_RECORD_APPLICATION = 16;
|
||||||
|
static IMAGE_WIDTH_RECORD_APPLICATION = 16;
|
||||||
|
static BORDER_RADIUS = 24;
|
||||||
|
static TITLE_MARGIN_BOTTOM = 16;
|
||||||
|
static SUBTITLE_MIN_HEIGHT = 48;
|
||||||
|
static SUBTITLE_LINE_HEIGHT = 24;
|
||||||
|
static SUBTITLE_PADDING_TOP = 16;
|
||||||
|
static SUBTITLE_PADDING_BOTTOM = 8;
|
||||||
|
static TAB_HEIGHT = 56;
|
||||||
|
static TAB_DECORATION_HEIGHT = 2;
|
||||||
|
static TAB_DECORATION_POSITION_Y = 46;
|
||||||
|
static DEFAULT_PADDING_START = 12;
|
||||||
|
static DEFAULT_PADDING_END = 12;
|
||||||
|
|
||||||
|
// application-secondary, authority-secondary
|
||||||
|
static FLEX_MARGIN_TOP = 8;
|
||||||
|
static FLEX_MARGIN_BOTTOM = 8;
|
||||||
|
static LIST_PADDING_TOP = 4;
|
||||||
|
static LIST_PADDING_BOTTOM = 4;
|
||||||
|
static LIST_MARGIN_BOTTOM = 12;
|
||||||
|
static ROW_MARGIN_TOP = 9;
|
||||||
|
static SECONDARY_TEXT_MARGIN_TOP = 19.5;
|
||||||
|
static SECONDARY_TEXT_MARGIN_LEFT = 24;
|
||||||
|
static SECONDARY_LIST_PADDING_LEFT = 12;
|
||||||
|
static SECONDARY_LIST_PADDING_RIGHT = 12;
|
||||||
|
|
||||||
|
// application-tertiary
|
||||||
|
static TERTIARY_IMAGE_WIDTH = 64;
|
||||||
|
static TERTIARY_IMAGE_HEIGHT = 64;
|
||||||
|
static TERTIARY_IMAGE_MARGIN_LEFT = 12;
|
||||||
|
static TERTIARY_IMAGE_MARGIN_RIGHT = 12;
|
||||||
|
static TERTIARY_LABEL_MARGIN_BOTTOM = 2;
|
||||||
|
static TERTIARY_MARGIN_LEFT = 12;
|
||||||
|
static TERTIARY_TEXT_MARGIN_LEFT = 24;
|
||||||
|
static TERTIARY_HALF_WIDTH = '50%';
|
||||||
|
static TERTIARY_ROW_MARGIN_TOP = 24;
|
||||||
|
static TERTIARY_PERMISSION_ROW_MARGIN_TOP = 12;
|
||||||
|
static TERTIARY_RADIO_IMAGE_WIDTH = 24;
|
||||||
|
static TERTIARY_RADIO_IMAGE_HEIGHT = 24;
|
||||||
|
static TERTIARY_RADIO_IMAGE_MARGIN_TOP = 4;
|
||||||
|
static TERTIARY_LISTITEM_PADDING_LEFT = 24;
|
||||||
|
static TERTIARY_LISTITEM_PADDING_RIGHT = 24;
|
||||||
|
static TERTIARY_LISTITEM_MARGIN_TOP = 1;
|
||||||
|
static TERTIARY_LIST_PADDING_LEFT = 12;
|
||||||
|
static TERTIARY_LIST_PADDING_RIGHT = 12;
|
||||||
|
static TERTIARY_LIST_PADDING_TOP = 4;
|
||||||
|
static TERTIARY_LIST_PADDING_BOTTOM = 4;
|
||||||
|
|
||||||
|
// authority-tertiary
|
||||||
|
static AUTHORITY_IMAGE_WIDTH = 40;
|
||||||
|
static AUTHORITY_IMAGE_HEIGHT = 40;
|
||||||
|
static AUTHORITY_IMAGE_MARGIN_RIGHT = 16;
|
||||||
|
static AUTHORITY_TOGGLE_WIDTH = 36;
|
||||||
|
static AUTHORITY_TOGGLE_HEIGHT = 20;
|
||||||
|
static AUTHORITY_ROW_HEIGHT = 72;
|
||||||
|
static AUTHORITY_CONSTRAINTSIZE_MINHEIGHT = 72;
|
||||||
|
static AUTHORITY_LISTITEM_PADDING_LEFT = 12;
|
||||||
|
static AUTHORITY_LISTITEM_PADDING_RIGHT = 12;
|
||||||
|
static AUTHORITY_TEXTINPUT_PADDING_LEFT = 12;
|
||||||
|
static AUTHORITY_TEXTINPUT_PADDING_RIGHT = 24;
|
||||||
|
static AUTHORITY_TEXT_MARGIN_TOP = 24;
|
||||||
|
static AUTHORITY_TEXT_MARGIN_LEFT = 0;
|
||||||
|
static AUTHORITY_ROW_MARGIN_TOP = 24;
|
||||||
|
static NORECORD_IMAGE_WIDTH = 120;
|
||||||
|
static NORECORD_IMAGE_HEIGHT = 120;
|
||||||
|
static NORECORD_IMAGE_MARGIN_LEFT = 40;
|
||||||
|
static SEARCHNORESULT_IMAGE_WIDTH = 200;
|
||||||
|
static SEARCHNORESULT_IMAGE_HEIGHT = 200;
|
||||||
|
static AUTHORITY_COLUMN_HEIGHT = '95%';
|
||||||
|
static AUTHORITY_ALPHABETINDEX_WIDTH = 24;
|
||||||
|
static AUTHORITY_ALPHABETINDEX_PADDING_TOP = 16;
|
||||||
|
static AUTHORITY_TEXT_DECORATION_WIDTH = '86%';
|
||||||
|
static AUTHORITY_TEXT_DECORATION_MARGIN_LEFT = 53;
|
||||||
|
|
||||||
|
// authority-management
|
||||||
|
static MANAGEMENT_IMAGE_WIDTH = 24;
|
||||||
|
static MANAGEMENT_IMAGE_HEIGHT = 24;
|
||||||
|
static MANAGEMENT_IMAGE_MARGIN_RIGHT = 16;
|
||||||
|
static MANAGEMENT_IMAGE_MARGIN_RIGHT_RECORD = 24;
|
||||||
|
static MANAGEMENT_IMAGE_MARGIN_LEFT = 8;
|
||||||
|
static MANAGEMENT_ROW_HEIGHT = 56;
|
||||||
|
static MANAGEMENT_TEXT_DECORATION_WIDTH = '95%';
|
||||||
|
static MANAGEMENT_TEXT_DECORATION_MARGIN_LEFT = 40;
|
||||||
|
static MANAGEMENT_LODING_IMAGE_WIDTH = 48;
|
||||||
|
static MANAGEMENT_LODING_IMAGE_HEIGHT = 48;
|
||||||
|
static MANAGEMENT_LODING_ROW_HEIGHT = '90%';
|
||||||
|
static MANAGEMENT_ROW_PADDING_LEFT = 12;
|
||||||
|
static MANAGEMENT_ROW_PADDING_RIGHT = 12;
|
||||||
|
static MANAGEMENT_ROW_PADDING_TOP = 8;
|
||||||
|
static MANAGEMENT_ROW_MARGIN_TOP = 12;
|
||||||
|
static MANAGEMENT_TRANSPARENCY = 0.8;
|
||||||
|
static APPLICATION_IMAGE_WIDTH = 40;
|
||||||
|
static APPLICATION_IMAGE_HEIGHT = 40;
|
||||||
|
static APPLICATION_IMAGE_MARGIN_RIGHT = 16;
|
||||||
|
static APPLICATION_TEXT_MARGIN_RIGHT = 4;
|
||||||
|
static APPLICATION_LIST_PADDING_LEFT = 12;
|
||||||
|
static APPLICATION_LIST_PADDING_RIGHT = 12;
|
||||||
|
static APPLICATION_LIST_MARGIN_BOTTOM = 50;
|
||||||
|
static APPLICATION_LISTITEM_PADDING_LEFT = 12;
|
||||||
|
static APPLICATION_LISTITEM_PADDING_RIGHT = 12;
|
||||||
|
static APPLICATION_TEXTINPUT_PADDING_LEFT = 12;
|
||||||
|
static APPLICATION_TEXTINPUT_PADDING_TOP = 8;
|
||||||
|
static APPLICATION_TEXTINPUT_PADDING_RIGHT = 24;
|
||||||
|
static APPLICATION_COLUMN_HEIGHT = '93%';
|
||||||
|
static APPLICATION_ALPHABETINDEX_MARGIN_TOP = 12;
|
||||||
|
static APPLICATION_ALPHABETINDEX_WIDTH = 24;
|
||||||
|
static APPLICATION_TEXT_DECORATION_WIDTH = '90%';
|
||||||
|
static APPLICATION_TEXT_DECORATION_MARGIN_LEFT = 56;
|
||||||
|
static LOADING_WIDTH = 100;
|
||||||
|
|
||||||
|
// slice
|
||||||
|
static SLICE_START = 0;
|
||||||
|
static SLICE_END = -1;
|
||||||
|
static SLICE_START_INDEX = 0;
|
||||||
|
static SLICE_END_INDEX = 1;
|
||||||
|
|
||||||
|
//group number
|
||||||
|
static FIXED_GROUP = 1;
|
||||||
|
static CHANGE_GROUP = 2;
|
||||||
|
static OTHER_GROUP = 3;
|
||||||
|
|
||||||
|
// tabBar
|
||||||
|
static BAR_WIDTH = 285;
|
||||||
|
|
||||||
|
// setTimeout
|
||||||
|
static DELAY_TIME = 1000;
|
||||||
|
static DELAY_TIME_MAX = 2000;
|
||||||
|
|
||||||
|
// radio
|
||||||
|
static RADIO_ALLOW_NAME = '允许';
|
||||||
|
static RADIO_ALLOW_INDEX = 0;
|
||||||
|
static RADIO_ALLOW_GROUP_NAME = 'radio';
|
||||||
|
static RADIO_BAN_NAME = '禁止';
|
||||||
|
static RADIO_BAN_INDEX = 1;
|
||||||
|
static RADIO_BAN_GROUP_NAME = 'radio';
|
||||||
|
|
||||||
|
//shape
|
||||||
|
static SHAPE_DIA = 24;
|
||||||
|
static SHAPE_BAN_DIA = 23;
|
||||||
|
static SHAPE_BIG_DIA = 48;
|
||||||
|
static SHAPE_OFFSET_X = -24;
|
||||||
|
static SHAPE_BAN_OFFSET = .5;
|
||||||
|
static SHAPE_ALLOW_DIA = 16;
|
||||||
|
static SHAPE_ALLOW_OFFSET = 4;
|
||||||
|
static SHAPE_ZINDEX = 10;
|
||||||
|
|
||||||
|
// utils
|
||||||
|
static CHAR_CODE = 0;
|
||||||
|
static UNI_MAX = 40869;
|
||||||
|
static UNI_MIN = 19968;
|
||||||
|
|
||||||
|
static PARMETER_BUNDLE_FLAG = 16;
|
||||||
|
static USERID = 100;
|
||||||
|
|
||||||
|
static PERMISSION_INDEX = 0;
|
||||||
|
|
||||||
|
static PERMISSION_NUM = 0;
|
||||||
|
|
||||||
|
static PERMISSION_FLAG = 2;
|
||||||
|
static API_VERSION_SUPPORT_STAGE = 9;
|
||||||
|
|
||||||
|
static PRE_AUTHORIZATION_NOT_MODIFIED = 4;
|
||||||
|
|
||||||
|
static BUNDLE_NAME = 'com.ohos.permissionmanager'
|
||||||
|
|
||||||
|
static START_SUBSCRIPT = 0
|
||||||
|
static END_SUBSCRIPT = 500
|
||||||
|
|
||||||
|
static RECORD_PADDING_BOTTOM = '20%'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////
|
||||||
|
// icon of dialog
|
||||||
|
static DIALOG_ICON_WIDTH = 24;
|
||||||
|
static DIALOG_ICON_HEIGHT = 24;
|
||||||
|
static DIALOG_ICON_MARGIN_TOP = 23;
|
||||||
|
|
||||||
|
// label text of dialog
|
||||||
|
static DIALOG_LABEL_FONT_SIZE = 10;
|
||||||
|
static DIALOG_LABEL_MARGIN_TOP = 2;
|
||||||
|
static DIALOG_LABEL_LINE_HEIGHT = 14;
|
||||||
|
|
||||||
|
// request text of dialog
|
||||||
|
static DIALOG_REQ_FONT_SIZE = 16;
|
||||||
|
static DIALOG_REQ_MARGIN_TOP = 16;
|
||||||
|
static DIALOG_REQ_MARGIN_LEFT = 24;
|
||||||
|
static DIALOG_REQ_LINE_HEIGHT = 22;
|
||||||
|
|
||||||
|
// description text of dialog
|
||||||
|
static DIALOG_DESP_FONT_SIZE = 14;
|
||||||
|
static DIALOG_DESP_MARGIN_TOP = 2;
|
||||||
|
static DIALOG_DESP_MARGIN_LEFT = 24;
|
||||||
|
static DIALOG_DESP_MARGIN_RIGHT = 24;
|
||||||
|
static DIALOG_DESP_MARGIN_BOTTOM = 8;
|
||||||
|
static DIALOG_DESP_LINE_HEIGHT = 19;
|
||||||
|
|
||||||
|
static BUTTON_FONT_SIZE = 16;
|
||||||
|
static BUTTON_DIVIDER_FONT_SIZE = 24;
|
||||||
|
static BUTTON_MARGIN_TOP = 8;
|
||||||
|
static BUTTON_MARGIN_BOTTOM = 16;
|
||||||
|
static BUTTON_MARGIN_LEFT = 16;
|
||||||
|
static BUTTON_MARGIN_RIGHT = 16;
|
||||||
|
static BUTTON_HEIGHT = 40;
|
||||||
|
static BUTTON_WIDTH = 177;
|
||||||
|
|
||||||
|
static DIALOG_PRIVACY_BORDER_RADIUS = 32;
|
||||||
|
static DIALOG_PRIVACY_WIDTH = 395;
|
||||||
|
static DIALOG_PADDING_BOTTOM = 16;
|
||||||
|
|
||||||
|
// initial check status
|
||||||
|
static INIT_NEED_TO_WAIT = 0
|
||||||
|
static INIT_NEED_TO_VERIFY = 1
|
||||||
|
static INIT_NEED_TO_TERMINATED = 2
|
||||||
|
static INIT_NEED_TO_REFRESH = 3
|
||||||
|
|
||||||
|
static RESULT_SUCCESS = 1
|
||||||
|
static RESULT_FAILURE = 0
|
||||||
|
static RESULT_CODE = 0
|
||||||
|
|
||||||
|
//
|
||||||
|
static SETTING_OPER = -1
|
||||||
|
static PASS_OPER = 0
|
||||||
|
static DYNAMIC_OPER = 1
|
||||||
|
static INVALID_OPER = 2
|
||||||
|
|
||||||
|
//
|
||||||
|
static INITIAL_INDEX = 10
|
||||||
|
static ACCESS_TOKEN = 'ohos.security.accesstoken.tokencallback'
|
||||||
|
|
||||||
|
}
|
427
permissionmanager/src/main/ets/common/utils/utils.ets
Normal file
@ -0,0 +1,427 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import Resmgr from '@ohos.resourceManager';
|
||||||
|
import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
|
||||||
|
|
||||||
|
import { permissionGroups, groups } from "../model/permissionGroup";
|
||||||
|
import Constants from '../utils/constant';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get app name resource
|
||||||
|
* @param {Number} labelId app name id
|
||||||
|
* @param {String} bundleName Package names
|
||||||
|
*/
|
||||||
|
export function getAppLabel(labelId, bundleName) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
Resmgr.getResourceManager(globalThis.context, bundleName).then(item => {
|
||||||
|
item.getString(labelId, (error, value) => {
|
||||||
|
resolve(value);
|
||||||
|
})
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('Resmgr.getResourceManager failed. Cause: ' + JSON.stringify(error));
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get app icon resources
|
||||||
|
* @param {Number} iconId app icon id
|
||||||
|
* @param {String} bundleName Package names
|
||||||
|
*/
|
||||||
|
export function getAppIcon(iconId, bundleName) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
Resmgr.getResourceManager(globalThis.context, bundleName).then(item => {
|
||||||
|
item.getMediaBase64(iconId, (error, value) => {
|
||||||
|
resolve(value);
|
||||||
|
})
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('Resmgr.getResourceManager failed. Cause: ' + JSON.stringify(error));
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* verify permission
|
||||||
|
* @param {Number} accessTokenId
|
||||||
|
* @param {String} permission permission name
|
||||||
|
*/
|
||||||
|
export function verifyAccessToken(accessTokenId, permission) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
abilityAccessCtrl.createAtManager().verifyAccessToken(accessTokenId, permission).then((res) => {
|
||||||
|
return resolve(res);
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('verifyAccessToken failed. Cause: ' + JSON.stringify(error));
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Let arkui detect changes in array index assignments。
|
||||||
|
*/
|
||||||
|
export function changeIndexValue(stateList, changeItem){
|
||||||
|
// copy array
|
||||||
|
let result = stateList.slice(0);
|
||||||
|
for (let i = 0 ; i < changeItem.length; i++) {
|
||||||
|
let item = changeItem[i];
|
||||||
|
if (!Array.isArray(item)) {
|
||||||
|
throw new Error("error");
|
||||||
|
}
|
||||||
|
let index = item[0];
|
||||||
|
let value = item[1];
|
||||||
|
if (index == undefined || value == undefined) {
|
||||||
|
throw new Error("error");
|
||||||
|
}
|
||||||
|
if (index < 0 || index > stateList.length - 1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
let start = result.slice(0, index);
|
||||||
|
start = start.concat([value]);
|
||||||
|
result = start.concat(result.slice(index + 1));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// List of Chinese Pinyin Initials
|
||||||
|
let strChineseFirstPY = "YDYQSXMWZSSXJBYMGCCZQPSSQBYCDSCDQLDYLYBSSJGYZZJJFKCCLZDHWDWZJLJPFYYNWJJTMYHZWZHFLZPPQHGSC" +
|
||||||
|
"YYYNJQYXXGJHHSDSJNKKTMOMLCRXYPSNQSECCQZGGLLYJLMYZZSECYKYYHQWJSSGGYXYZYJWWKDJHYCHMYXJTLXJYQBYXZLDWRDJRWYSRLDZJPCBZ" +
|
||||||
|
"JJBRCFTLECZSTZFXXZHTRQHYBDLYCZSSYMMRFMYQZPWWJJYFCRWFDFZQPYDDWYXKYJAWJFFXYPSFTZYHHYZYSWCJYXSCLCXXWZZXNBGNNXBXLZSZS" +
|
||||||
|
"BSGPYSYZDHMDZBQBZCWDZZYYTZHBTSYYBZGNTNXQYWQSKBPHHLXGYBFMJEBJHHGQTJCYSXSTKZHLYCKGLYSMZXYALMELDCCXGZYRJXSDLTYZCQKCN" +
|
||||||
|
"NJWHJTZZCQLJSTSTBNXBTYXCEQXGKWJYFLZQLYHYXSPSFXLMPBYSXXXYDJCZYLLLSJXFHJXPJBTFFYABYXBHZZBJYZLWLCZGGBTSSMDTJZXPTHYQT" +
|
||||||
|
"GLJSCQFZKJZJQNLZWLSLHDZBWJNCJZYZSQQYCQYRZCJJWYBRTWPYFTWEXCSKDZCTBZHYZZYYJXZCFFZZMJYXXSDZZOTTBZLQWFCKSZSXFYRLNYJMB" +
|
||||||
|
"DTHJXSQQCCSBXYYTSYFBXDZTGBCNSLCYZZPSAZYZZSCJCSHZQYDXLBPJLLMQXTYDZXSQJTZPXLCGLQTZWJBHCTSYJSFXYEJJTLBGXSXJMYJQQPFZA" +
|
||||||
|
"SYJNTYDJXKJCDJSZCBARTDCLYJQMWNQNCLL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RXXZCLHNELJJTJTPWJYBJJBXJJTJ" +
|
||||||
|
"TEEKHWSLJPLPSFYZPQQBDLQJJTYYQLYZKDKSQJYYQZLDQTGJQYZJSUCMRYQTHTEJMFCTYHYPKMHYZWJDQFHYYXWSHCTXRLJHQXHCCYYYJLTKTTYTM" +
|
||||||
|
"XGTCJTZAYYOCZLYLBSZYWJYTSJYHBYSHFJLYGJXXTMZYYLTXXYPZLXYJZYZYYPNHMYMDYYLBLHLSYYQQLLNJJYMSOYQBZGDLYXYLCQYXTSZEGXHZG" +
|
||||||
|
"LHWBLJHEYXTWQMAKBPQCGYSHHEGQCMWYYWLJYJHYYZLLJJYLHZYHMGSLJLJXCJJYCLYCJPCPZJZJMMYLCQLNQLJQJSXYJMLSZLJQLYCMMHCFMMFPQ" +
|
||||||
|
"QMFYLQMCFFQMMMMHMZNFHHJGTTHHKHSLNCHHYQDXTMMQDCYZYXYQMYQYLTDCYYYZAZZCYMZYDLZFFFMMYCQZWZZMABTBYZTDMNZZGGDFTYPCGQYTT" +
|
||||||
|
"SSFFWFDTZQSSYSTWXJHXYTSXXYLBYQHWWKXHZXWZNNZZJZJJQJCCCHYYXBZXZCYZTLLCQXYNJYCYYCYNZZQYYYEWYCZDCJYCCHYJLBTZYYCQWMPWP" +
|
||||||
|
"YMLGKDLDLGKQQBGYCHJXY";
|
||||||
|
// 375 polyphonic words are included here
|
||||||
|
let oMultiDiff = { "19969": "DZ", "19975": "WM", "19988": "QJ", "20048": "YL", "20056": "SC", "20060": "NM",
|
||||||
|
"20094": "QG", "20127": "QJ", "20167": "QC", "20193": "YG", "20250": "KH", "20256": "ZC", "20282": "SC",
|
||||||
|
"20285": "QJG", "20291": "TD", "20314": "YD", "20340": "NE", "20375": "TD", "20389": "YJ", "20391": "CZ",
|
||||||
|
"20415": "PB", "20446": "YS", "20447": "SQ", "20504": "TC", "20608": "KG", "20854": "QJ", "20857": "ZC",
|
||||||
|
"20911": "PF", "20985": "AW", "21032": "PB", "21048": "XQ", "21049": "SC", "21089": "YS", "21119": "JC",
|
||||||
|
"21242": "SB", "21273": "SC", "21305": "YP", "21306": "QO", "21330": "ZC", "21333": "SDC", "21345": "QK",
|
||||||
|
"21378": "CA", "21397": "SC", "21414": "XS", "21442": "SC", "21477": "JG", "21480": "TD", "21484": "ZS",
|
||||||
|
"21494": "YX", "21505": "YX", "21512": "HG", "21523": "XH", "21537": "PB", "21542": "PF", "21549": "KH",
|
||||||
|
"21571": "E", "21574": "DA", "21588": "TD", "21589": "O", "21618": "ZC", "21621": "KHA", "21632": "ZJ",
|
||||||
|
"21654": "KG", "21679": "LKG", "21683": "KH", "21710": "A", "21719": "YH", "21734": "WOE", "21769": "A",
|
||||||
|
"21780": "WN", "21804": "XH", "21834": "A", "21899": "ZD", "21903": "RN", "21908": "WO", "21939": "ZC",
|
||||||
|
"21956": "SA", "21964": "YA", "21970": "TD", "22003": "A", "22031": "JG", "22040": "XS", "22060": "ZC",
|
||||||
|
"22066": "ZC", "22079": "MH", "22129": "XJ", "22179": "XA", "22237": "NJ", "22244": "TD", "22280": "JQ",
|
||||||
|
"22300": "YH", "22313": "XW", "22331": "YQ", "22343": "YJ", "22351": "PH", "22395": "DC", "22412": "TD",
|
||||||
|
"22484": "PB", "22500": "PB", "22534": "ZD", "22549": "DH", "22561": "PB", "22612": "TD", "22771": "KQ",
|
||||||
|
"22831": "HB", "22841": "JG", "22855": "QJ", "22865": "XQ", "23013": "ML", "23081": "WM", "23487": "SX",
|
||||||
|
"23558": "QJ", "23561": "YW", "23586": "YW", "23614": "YW", "23615": "SN", "23631": "PB", "23646": "ZS",
|
||||||
|
"23663": "ZT", "23673": "YG", "23762": "TD", "23769": "ZS", "23780": "QJ", "23884": "QK", "24055": "XH",
|
||||||
|
"24113": "DC", "24162": "ZC", "24191": "GA", "24273": "QJ", "24324": "NL", "24377": "TD", "24378": "QJ",
|
||||||
|
"24439": "PF", "24554": "ZS", "24683": "TD", "24694": "WE", "24733": "LK", "24925": "TN", "25094": "ZG",
|
||||||
|
"25100": "XQ", "25103": "XH", "25153": "PB", "25170": "PB", "25179": "KG", "25203": "PB", "25240": "ZS",
|
||||||
|
"25282": "FB", "25303": "NA", "25324": "KG", "25341": "ZY", "25373": "WZ", "25375": "XJ", "25384": "A",
|
||||||
|
"25457": "A", "25528": "SD", "25530": "SC", "25552": "TD", "25774": "ZC", "25874": "ZC", "26044": "YW",
|
||||||
|
"26080": "WM", "26292": "PB", "26333": "PB", "26355": "ZY", "26366": "CZ", "26397": "ZC", "26399": "QJ",
|
||||||
|
"26415": "ZS", "26451": "SB", "26526": "ZC", "26552": "JG", "26561": "TD", "26588": "JG", "26597": "CZ",
|
||||||
|
"26629": "ZS", "26638": "YL", "26646": "XQ", "26653": "KG", "26657": "XJ", "26727": "HG", "26894": "ZC",
|
||||||
|
"26937": "ZS", "26946": "ZC", "26999": "KJ", "27099": "KJ", "27449": "YQ", "27481": "XS", "27542": "ZS",
|
||||||
|
"27663": "ZS", "27748": "TS", "27784": "SC", "27788": "ZD", "27795": "TD", "27812": "O", "27850": "PB",
|
||||||
|
"27852": "MB", "27895": "SL", "27898": "PL", "27973": "QJ", "27981": "KH", "27986": "HX", "27994": "XJ",
|
||||||
|
"28044": "YC", "28065": "WG", "28177": "SM", "28267": "QJ", "28291": "KH", "28337": "ZQ", "28463": "TL",
|
||||||
|
"28548": "DC", "28601": "TD", "28689": "PB", "28805": "JG", "28820": "QG", "28846": "PB", "28952": "TD",
|
||||||
|
"28975": "ZC", "29100": "A", "29325": "QJ", "29575": "SL", "29602": "FB", "30010": "TD", "30044": "CX",
|
||||||
|
"30058": "PF", "30091": "YSP", "30111": "YN", "30229": "XJ", "30427": "SC", "30465": "SX", "30631": "YQ",
|
||||||
|
"30655": "QJ", "30684": "QJG", "30707": "SD", "30729": "XH", "30796": "LG", "30917": "PB", "31074": "NM",
|
||||||
|
"31085": "JZ", "31109": "SC", "31181": "ZC", "31192": "MLB", "31293": "JQ", "31400": "YX", "31584": "YJ",
|
||||||
|
"31896": "ZN", "31909": "ZY", "31995": "XJ", "32321": "PF", "32327": "ZY", "32418": "HG", "32420": "XQ",
|
||||||
|
"32421": "HG", "32438": "LG", "32473": "GJ", "32488": "TD", "32521": "QJ", "32527": "PB", "32562": "ZSQ",
|
||||||
|
"32564": "JZ", "32735": "ZD", "32793": "PB", "33071": "PF", "33098": "XL", "33100": "YA", "33152": "PB",
|
||||||
|
"33261": "CX", "33324": "BP", "33333": "TD", "33406": "YA", "33426": "WM", "33432": "PB", "33445": "JG",
|
||||||
|
"33486": "ZN", "33493": "TS", "33507": "QJ", "33540": "QJ", "33544": "ZC", "33564": "XQ", "33617": "YT",
|
||||||
|
"33632": "QJ", "33636": "XH", "33637": "YX", "33694": "WG", "33705": "PF", "33728": "YW", "33882": "SR",
|
||||||
|
"34067": "WM", "34074": "YW", "34121": "QJ", "34255": "ZC", "34259": "XL", "34425": "JH", "34430": "XH",
|
||||||
|
"34485": "KH", "34503": "YS", "34532": "HG", "34552": "XS", "34558": "YE", "34593": "ZL", "34660": "YQ",
|
||||||
|
"34892": "XH", "34928": "SC", "34999": "QJ", "35048": "PB", "35059": "SC", "35098": "ZC", "35203": "TQ",
|
||||||
|
"35265": "JX", "35299": "JX", "35782": "SZ", "35828": "YS", "35830": "E", "35843": "TD", "35895": "YG",
|
||||||
|
"35977": "MH", "36158": "JG", "36228": "QJ", "36426": "XQ", "36466": "DC", "36710": "JC", "36711": "ZYG",
|
||||||
|
"36767": "PB", "36866": "SK", "36951": "YW", "37034": "YX", "37063": "XH", "37218": "ZC", "37325": "ZC",
|
||||||
|
"38063": "PB", "38079": "TD", "38085": "QY", "38107": "DC", "38116": "TD", "38123": "YD", "38224": "HG",
|
||||||
|
"38241": "XTC", "38271": "ZC", "38415": "YE", "38426": "KH", "38461": "YD", "38463": "AE", "38466": "PB",
|
||||||
|
"38477": "XJ", "38518": "YT", "38551": "WK", "38585": "ZC", "38704": "XS", "38739": "LJ", "38761": "GJ",
|
||||||
|
"38808": "SQ", "39048": "JG", "39049": "XJ", "39052": "HG", "39076": "CZ", "39271": "XT", "39534": "TD",
|
||||||
|
"39552": "TD", "39584": "PB", "39647": "SB", "39730": "LG", "39748": "TPB", "40109": "ZQ", "40479": "ND",
|
||||||
|
"40516": "HG", "40536": "HG", "40583": "QJ", "40765": "YQ", "40784": "QJ", "40840": "YK", "40863": "QJG" };
|
||||||
|
|
||||||
|
// Program that returns the first letter array of Chinese characters
|
||||||
|
export function makePy(str) {
|
||||||
|
if (typeof(str) != "string")
|
||||||
|
throw new Error("函数makePy需要字符串类型参数!");
|
||||||
|
var arrResult = [];
|
||||||
|
// Convert string to array
|
||||||
|
for (var i = 0, len = str.length; i < len; i++) {
|
||||||
|
var ch = str.charAt(i);
|
||||||
|
arrResult.push(checkCh(ch));
|
||||||
|
}
|
||||||
|
return mkRslt(arrResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check processing Chinese characters
|
||||||
|
function checkCh(ch) {
|
||||||
|
var uni = ch.charCodeAt(Constants.CHAR_CODE);
|
||||||
|
// If it is not within the scope of Chinese character processing, return the original character, and you can also call your own processing function
|
||||||
|
if (uni > Constants.UNI_MAX || uni < Constants.UNI_MIN)
|
||||||
|
return ch; //dealWithOthers(ch);
|
||||||
|
// Check whether it is a polyphonic word, it is processed as a polyphonic word, if not, just find the corresponding first letter in the strChineseFirstPY string.
|
||||||
|
return (oMultiDiff[uni] ? oMultiDiff[uni] : (strChineseFirstPY.charAt(uni - Constants.UNI_MIN)));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process the characters and return an array of letters
|
||||||
|
function mkRslt(arr) {
|
||||||
|
var arrRslt = [""];
|
||||||
|
for (var i = 0, len = arr.length; i < len; i++) {
|
||||||
|
var str = arr[i];
|
||||||
|
var strlen = str.length;
|
||||||
|
if (strlen == 1) {
|
||||||
|
for (var k = 0; k < arrRslt.length; k++) {
|
||||||
|
arrRslt[k] += str;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var tmpArr = arrRslt.slice(0);
|
||||||
|
arrRslt = [];
|
||||||
|
for (k = 0; k < strlen; k++) {
|
||||||
|
// Copy an identical arrRslt
|
||||||
|
var tmp = tmpArr.slice(0);
|
||||||
|
// Add the current character str[k] to the end of each element
|
||||||
|
for (var j = 0; j < tmp.length; j++) {
|
||||||
|
tmp[j] += str.charAt(k);
|
||||||
|
}
|
||||||
|
// Concatenate the copied and modified array to arrRslt
|
||||||
|
arrRslt = arrRslt.concat(tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return arrRslt;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the corresponding permission group id according to the permission
|
||||||
|
* @param {String} permission app name id
|
||||||
|
* @return {Number} groupId
|
||||||
|
*/
|
||||||
|
export function getPermissionGroup(permission: string) {
|
||||||
|
for (var i = 0; i < permissionGroups.length; i++) {
|
||||||
|
if (permissionGroups[i].permissionName == permission) {
|
||||||
|
if(permissionGroups[i].groupName == 'OTHER') {
|
||||||
|
return {
|
||||||
|
"name": permissionGroups[i].groupName,
|
||||||
|
"groupName": permissionGroups[i].label,
|
||||||
|
"label": permissionGroups[i].text,
|
||||||
|
"icon": permissionGroups[i].icon,
|
||||||
|
"description": '',
|
||||||
|
"permissions": [
|
||||||
|
permissionGroups[i].permissionName
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return groups[permissionGroups[i].groupId]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const TAG = 'PermissionManager_Log';
|
||||||
|
|
||||||
|
export class Log {
|
||||||
|
static info(log) {
|
||||||
|
console.info(`Info: ${TAG} ${log}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
static error(log) {
|
||||||
|
console.error(`Error: ${TAG} ${log}`)
|
||||||
|
}
|
||||||
|
}
|
346
permissionmanager/src/main/ets/pages/application-secondary.ets
Normal file
@ -0,0 +1,346 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { backBar } from "../common/components/backBar";
|
||||||
|
import router from '@system.router';
|
||||||
|
import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
|
||||||
|
import { groups } from "../common/model/permissionGroup";
|
||||||
|
import Constants from '../common/utils/constant';
|
||||||
|
|
||||||
|
var TAG = 'PermissionManager_MainAbility:'
|
||||||
|
|
||||||
|
const allowedStatus = 0; // Status: Allowed
|
||||||
|
const bannedStatus = 1; // Status: Banned
|
||||||
|
|
||||||
|
class AllowedObj {
|
||||||
|
groupName: string;
|
||||||
|
permission: string[];
|
||||||
|
constructor(groupName: string, permission: string[]) {
|
||||||
|
this.groupName = groupName;
|
||||||
|
this.permission = permission;
|
||||||
|
}
|
||||||
|
} // Class Allowed
|
||||||
|
class BannedObj {
|
||||||
|
groupName: string;
|
||||||
|
permission: string[];
|
||||||
|
constructor(groupName: string, permission: string[]) {
|
||||||
|
this.groupName = groupName;
|
||||||
|
this.permission = permission;
|
||||||
|
}
|
||||||
|
} // Class Banned
|
||||||
|
|
||||||
|
@Entry
|
||||||
|
@Component
|
||||||
|
struct appNamePlusPage {
|
||||||
|
@State allowedListItem: AllowedObj[] = []; // Array of allowed permissions
|
||||||
|
@State bannedListItem: BannedObj[] = []; // array of forbidden permissions
|
||||||
|
private routerData = router.getParams().routerData; // Routing jump data
|
||||||
|
|
||||||
|
@Builder ListItemLayout(item, index, status) {
|
||||||
|
ListItem() {
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
|
||||||
|
Row() {
|
||||||
|
Text(item.groupName)
|
||||||
|
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.text_color'))
|
||||||
|
.fontWeight(FontWeight.Medium)
|
||||||
|
.flexGrow(Constants.FLEX_GROW)
|
||||||
|
Image($r('app.media.rightarrow'))
|
||||||
|
.objectFit(ImageFit.Contain)
|
||||||
|
.height(Constants.IMAGE_HEIGHT)
|
||||||
|
.width(Constants.IMAGE_WIDTH)
|
||||||
|
}
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.LISTITEM_ROW_HEIGHT)
|
||||||
|
}
|
||||||
|
if (!index) {
|
||||||
|
Row() {
|
||||||
|
Column()
|
||||||
|
.backgroundColor($r('app.color.text_decoration_color'))
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.TEXT_DECORATION_HEIGHT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.onClick(() => {
|
||||||
|
if (status === 'allow') {
|
||||||
|
if (item.groupName == "其他权限") {
|
||||||
|
router.push({
|
||||||
|
uri: 'pages/other-permissions',
|
||||||
|
params: {
|
||||||
|
routerData: this.routerData.bundleName,
|
||||||
|
backTitle: item.groupName,
|
||||||
|
permission: item.permission,
|
||||||
|
status: allowedStatus,
|
||||||
|
tokenId: this.routerData.tokenId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
router.push({
|
||||||
|
uri: 'pages/application-tertiary',
|
||||||
|
params: {
|
||||||
|
routerData: this.routerData.bundleName,
|
||||||
|
backTitle: item.groupName,
|
||||||
|
permission: item.permission,
|
||||||
|
status: allowedStatus
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (status === 'banned') {
|
||||||
|
if (item.groupName == "其他权限") {
|
||||||
|
router.push({
|
||||||
|
uri: 'pages/other-permissions',
|
||||||
|
params: {
|
||||||
|
routerData: this.routerData.bundleName,
|
||||||
|
backTitle: item.groupName,
|
||||||
|
permission: item.permission,
|
||||||
|
status: bannedStatus,
|
||||||
|
tokenId: this.routerData.tokenId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
router.push({
|
||||||
|
uri: 'pages/application-tertiary',
|
||||||
|
params: {
|
||||||
|
routerData: this.routerData.bundleName,
|
||||||
|
backTitle: item.groupName,
|
||||||
|
permission: item.permission,
|
||||||
|
status: bannedStatus
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}.padding({ left: Constants.DEFAULT_PADDING_START, right: Constants.DEFAULT_PADDING_END })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize permission status information and group permission information
|
||||||
|
*/
|
||||||
|
async initialPermissions() {
|
||||||
|
var reqPermissions = this.routerData.permissions;
|
||||||
|
var reqGroupIds = this.routerData.groupId;
|
||||||
|
|
||||||
|
if (!reqGroupIds.length) {
|
||||||
|
this.allowedListItem = [];
|
||||||
|
this.bannedListItem = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 0; i < reqGroupIds.length; i++) {
|
||||||
|
let id = reqGroupIds[i];
|
||||||
|
let groupName = groups[id].groupName;
|
||||||
|
let groupReqPermissons = [];
|
||||||
|
for (let j = 0; j < reqPermissions.length; j++) {
|
||||||
|
let permission = reqPermissions[j];
|
||||||
|
if (groups[id].permissions.indexOf(permission) != -1) {
|
||||||
|
groupReqPermissons.push(permission)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let isGranted = true;
|
||||||
|
for (let i = 0; i < groupReqPermissons.length; i++) {
|
||||||
|
let permission = groupReqPermissons[i]
|
||||||
|
let res = await abilityAccessCtrl.createAtManager().verifyAccessToken(
|
||||||
|
this.routerData.tokenId, permission);
|
||||||
|
if (res != 0) {
|
||||||
|
isGranted = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isGranted) {
|
||||||
|
this.allowedListItem.push(new AllowedObj(groupName, groupReqPermissons));
|
||||||
|
} else {
|
||||||
|
this.bannedListItem.push(new BannedObj(groupName, groupReqPermissons));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lifecycle function, triggered once when this page is displayed
|
||||||
|
*/
|
||||||
|
onPageShow() {
|
||||||
|
console.log(TAG + 'onPageShow application-secondary')
|
||||||
|
this.initialPermissions();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lifecycle function, triggered once when this page disappears
|
||||||
|
*/
|
||||||
|
onPageHide() {
|
||||||
|
console.log(TAG + 'onPageHide application-secondary')
|
||||||
|
setTimeout(()=> {
|
||||||
|
this.allowedListItem = [];
|
||||||
|
this.bannedListItem = [];
|
||||||
|
}, Constants.DELAY_TIME)
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
Column(){
|
||||||
|
GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) {
|
||||||
|
Row({}) {
|
||||||
|
Row()
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.LEFT_XS_SPAN, offset: Constants.LEFT_XS_OFFSET },
|
||||||
|
sm: { span: Constants.LEFT_SM_SPAN, offset: Constants.LEFT_SM_OFFSET },
|
||||||
|
md: { span: Constants.LEFT_MD_SPAN, offset: Constants.LEFT_MD_OFFSET },
|
||||||
|
lg: { span: Constants.LEFT_LG_SPAN, offset: Constants.LEFT_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
backBar({ title: JSON.stringify(this.routerData.labelId), recordable: false })
|
||||||
|
}
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
if (!this.allowedListItem.length && !this.bannedListItem.length) {
|
||||||
|
Row() {
|
||||||
|
List() {
|
||||||
|
ListItem() {
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
|
||||||
|
Text($r('app.string.no_permission'))
|
||||||
|
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.text_color'))
|
||||||
|
}.margin({ top: Constants.FLEX_MARGIN_TOP, bottom: Constants.FLEX_MARGIN_BOTTOM })
|
||||||
|
}.height(Constants.FULL_HEIGHT)
|
||||||
|
}.flexGrow(Constants.FLEX_GROW)
|
||||||
|
.constraintSize({minHeight: Constants.CONSTRAINTSIZE_MINHEIGHT })
|
||||||
|
}
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.LISTITEM_ROW_HEIGHT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.padding({ left: Constants.LISTITEM_PADDING_LEFT, right: Constants.LISTITEM_PADDING_RIGHT })
|
||||||
|
}
|
||||||
|
.backgroundColor($r('app.color.default_background_color'))
|
||||||
|
.borderRadius(Constants.BORDER_RADIUS)
|
||||||
|
.padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM })
|
||||||
|
}.margin({ top: Constants.ROW_MARGIN_TOP })
|
||||||
|
.padding({ left: Constants.SECONDARY_LIST_PADDING_LEFT, right: Constants.SECONDARY_LIST_PADDING_RIGHT })
|
||||||
|
} else {
|
||||||
|
Scroll() {
|
||||||
|
List() {
|
||||||
|
if (this.allowedListItem.length) {
|
||||||
|
ListItem() {
|
||||||
|
Row() {
|
||||||
|
Text($r('app.string.allowed'))
|
||||||
|
.fontSize(Constants.TEXT_SMAL_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.label_color_light'))
|
||||||
|
.fontWeight(FontWeight.Medium)
|
||||||
|
.lineHeight(Constants.SUBTITLE_LINE_HEIGHT)
|
||||||
|
}.constraintSize({ minHeight: Constants.SUBTITLE_MIN_HEIGHT })
|
||||||
|
.padding({ top: Constants.SUBTITLE_PADDING_TOP, bottom: Constants.SUBTITLE_PADDING_BOTTOM,
|
||||||
|
left: Constants.SECONDARY_TEXT_MARGIN_LEFT})
|
||||||
|
}
|
||||||
|
|
||||||
|
ListItem() {
|
||||||
|
Row() {
|
||||||
|
List() {
|
||||||
|
ForEach(this.allowedListItem.slice(Constants.SLICE_START, this.allowedListItem.length - 1),
|
||||||
|
(item) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_START_INDEX, 'allow')
|
||||||
|
}, item => item.toString())
|
||||||
|
ForEach(this.allowedListItem.slice(Constants.SLICE_END), (item, index) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_END_INDEX, 'allow')
|
||||||
|
}, item => item.toString())
|
||||||
|
}
|
||||||
|
.backgroundColor($r('app.color.default_background_color'))
|
||||||
|
.borderRadius(Constants.BORDER_RADIUS)
|
||||||
|
.padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM })
|
||||||
|
}.margin({ top: Constants.ROW_MARGIN_TOP })
|
||||||
|
.padding({
|
||||||
|
left: Constants.SECONDARY_LIST_PADDING_LEFT,
|
||||||
|
right: Constants.SECONDARY_LIST_PADDING_RIGHT
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.bannedListItem.length) {
|
||||||
|
ListItem() {
|
||||||
|
Row() {
|
||||||
|
Text($r('app.string.banned'))
|
||||||
|
.fontSize(Constants.TEXT_SMAL_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.label_color_light'))
|
||||||
|
.fontWeight(FontWeight.Medium)
|
||||||
|
.lineHeight(Constants.SUBTITLE_LINE_HEIGHT)
|
||||||
|
}.constraintSize({ minHeight: Constants.SUBTITLE_MIN_HEIGHT })
|
||||||
|
.padding({ top: Constants.SUBTITLE_PADDING_TOP, bottom: Constants.SUBTITLE_PADDING_BOTTOM,
|
||||||
|
left: Constants.SECONDARY_TEXT_MARGIN_LEFT})
|
||||||
|
}
|
||||||
|
|
||||||
|
ListItem() {
|
||||||
|
Row() {
|
||||||
|
List() {
|
||||||
|
ForEach(this.bannedListItem.slice(Constants.SLICE_START, this.bannedListItem.length - 1),
|
||||||
|
(item) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_START_INDEX, 'banned')
|
||||||
|
}, item => item.toString())
|
||||||
|
ForEach(this.bannedListItem.slice(Constants.SLICE_END), (item) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_END_INDEX, 'banned')
|
||||||
|
}, item => item.toString())
|
||||||
|
}
|
||||||
|
.backgroundColor($r('app.color.default_background_color'))
|
||||||
|
.borderRadius(Constants.BORDER_RADIUS)
|
||||||
|
.padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM })
|
||||||
|
}.margin({ top: Constants.ROW_MARGIN_TOP })
|
||||||
|
.padding({
|
||||||
|
left: Constants.SECONDARY_LIST_PADDING_LEFT,
|
||||||
|
right: Constants.SECONDARY_LIST_PADDING_RIGHT
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.scrollBar(BarState.Off)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
}
|
||||||
|
.layoutWeight(Constants.LAYOUT_WEIGHT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.MIDDLE_XS_SPAN, offset: Constants.MIDDLE_XS_OFFSET },
|
||||||
|
sm: { span: Constants.MIDDLE_SM_SPAN, offset: Constants.MIDDLE_SM_OFFSET },
|
||||||
|
md: { span: Constants.MIDDLE_MD_SPAN, offset: Constants.MIDDLE_MD_OFFSET },
|
||||||
|
lg: { span: Constants.MIDDLE_LG_SPAN, offset: Constants.MIDDLE_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
Row()
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.RIGHT_XS_SPAN, offset: Constants.RIGHT_XS_OFFSET },
|
||||||
|
sm: { span: Constants.RIGHT_SM_SPAN, offset: Constants.RIGHT_SM_OFFSET },
|
||||||
|
md: { span: Constants.RIGHT_MD_SPAN, offset: Constants.RIGHT_MD_OFFSET },
|
||||||
|
lg: { span: Constants.RIGHT_LG_SPAN, offset: Constants.RIGHT_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
}
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.backgroundColor($r("sys.color.ohos_id_color_sub_background"))
|
||||||
|
.opacity(Constants.MANAGEMENT_TRANSPARENCY)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
431
permissionmanager/src/main/ets/pages/application-tertiary.ets
Normal file
@ -0,0 +1,431 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { backBar } from "../common/components/backBar";
|
||||||
|
import router from '@system.router';
|
||||||
|
import bundle from "@ohos.bundle";
|
||||||
|
import { getAppLabel, getAppIcon, verifyAccessToken } from "../common/utils/utils";
|
||||||
|
import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
|
||||||
|
import Resmgr from '@ohos.resourceManager'
|
||||||
|
import { authorizeDialog } from "../common/components/dialog";
|
||||||
|
import { permissionDescriptions, permissionGroups, showSubpermissionsGrop } from "../common/model/permissionGroup";
|
||||||
|
import Constants from '../common/utils/constant';
|
||||||
|
|
||||||
|
var TAG = 'PermissionManager_MainAbility:'
|
||||||
|
|
||||||
|
let routerData = router.getParams().routerData; // Routing jump data
|
||||||
|
let backTitle = router.getParams().backTitle; // return title name
|
||||||
|
let status = router.getParams().status; // Status: Allowed, Forbidden
|
||||||
|
let permissions = router.getParams().permission; // permissions name
|
||||||
|
let nowGrantResult = Constants.PERMISSION_NUM; // Authorization results now
|
||||||
|
let nowRevokeResult = Constants.PERMISSION_NUM; // Now deauthorize results
|
||||||
|
let GrantResultFlag = []; // Authorization result Flag
|
||||||
|
let RevokeResultFlag = []; // Cancel authorization result Flag
|
||||||
|
let reason = null // Authorized reason
|
||||||
|
class MeidaDocObj {
|
||||||
|
name: string
|
||||||
|
index: number
|
||||||
|
groupName: string
|
||||||
|
accessTokenId: string
|
||||||
|
permissions: []
|
||||||
|
constructor(
|
||||||
|
name: string,
|
||||||
|
index: number,
|
||||||
|
groupName: string,
|
||||||
|
accessTokenId: string,
|
||||||
|
permissions: []
|
||||||
|
) {
|
||||||
|
this.name = name
|
||||||
|
this.index = index
|
||||||
|
this.groupName = groupName
|
||||||
|
this.accessTokenId = accessTokenId
|
||||||
|
this.permissions = permissions
|
||||||
|
}
|
||||||
|
}; // permission information class
|
||||||
|
class MediaListObj {
|
||||||
|
labelId: string
|
||||||
|
iconId: string
|
||||||
|
versionName: string
|
||||||
|
description: string
|
||||||
|
constructor(
|
||||||
|
labelId: string,
|
||||||
|
iconId: string,
|
||||||
|
versionName: string,
|
||||||
|
description: string
|
||||||
|
) {
|
||||||
|
this.labelId = labelId
|
||||||
|
this.iconId = iconId
|
||||||
|
this.versionName = versionName
|
||||||
|
this.description = description
|
||||||
|
}
|
||||||
|
}; // Permission application information class
|
||||||
|
|
||||||
|
@Entry
|
||||||
|
@Component
|
||||||
|
struct mediaDocumentPage {
|
||||||
|
build() {
|
||||||
|
Column() {
|
||||||
|
GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) {
|
||||||
|
Row() {
|
||||||
|
Row()
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.LEFT_XS_SPAN, offset: Constants.LEFT_XS_OFFSET },
|
||||||
|
sm: { span: Constants.LEFT_SM_SPAN, offset: Constants.LEFT_SM_OFFSET },
|
||||||
|
md: { span: Constants.LEFT_MD_SPAN, offset: Constants.LEFT_MD_OFFSET },
|
||||||
|
lg: { span: Constants.LEFT_LG_SPAN, offset: Constants.LEFT_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
backBar({ title: JSON.stringify(backTitle), recordable: false })
|
||||||
|
}
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
mediaDocumentItem()
|
||||||
|
}.width(Constants.FULL_WIDTH)
|
||||||
|
}
|
||||||
|
.margin({ top: Constants.TITLE_MARGIN_BOTTOM })
|
||||||
|
.layoutWeight(Constants.LAYOUT_WEIGHT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.MIDDLE_XS_SPAN, offset: Constants.MIDDLE_XS_OFFSET },
|
||||||
|
sm: { span: Constants.MIDDLE_SM_SPAN, offset: Constants.MIDDLE_SM_OFFSET },
|
||||||
|
md: { span: Constants.MIDDLE_MD_SPAN, offset: Constants.MIDDLE_MD_OFFSET },
|
||||||
|
lg: { span: Constants.MIDDLE_LG_SPAN, offset: Constants.MIDDLE_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
Row()
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.RIGHT_XS_SPAN, offset: Constants.RIGHT_XS_OFFSET },
|
||||||
|
sm: { span: Constants.RIGHT_SM_SPAN, offset: Constants.RIGHT_SM_OFFSET },
|
||||||
|
md: { span: Constants.RIGHT_MD_SPAN, offset: Constants.RIGHT_MD_OFFSET },
|
||||||
|
lg: { span: Constants.RIGHT_LG_SPAN, offset: Constants.RIGHT_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
}
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.backgroundColor($r("sys.color.ohos_id_color_sub_background"))
|
||||||
|
.opacity(Constants.MANAGEMENT_TRANSPARENCY)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component
|
||||||
|
struct mediaDocumentItem {
|
||||||
|
@State mediaDocListItem: MeidaDocObj[] = []; // Permission information array
|
||||||
|
@State mediaListItem: MediaListObj = {
|
||||||
|
labelId: '',
|
||||||
|
iconId: '',
|
||||||
|
versionName: '',
|
||||||
|
description: ''
|
||||||
|
}; // application info array
|
||||||
|
@State isCheckList: boolean[] = []; // Permission status array
|
||||||
|
|
||||||
|
authorizeDialogController: CustomDialogController = new CustomDialogController({
|
||||||
|
builder: authorizeDialog({ }),
|
||||||
|
autoCancel: true,
|
||||||
|
alignment: DialogAlignment.Center
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Grant permissions to the app
|
||||||
|
* @param {Number} accessTokenId
|
||||||
|
* @param {String} permission permission name
|
||||||
|
*/
|
||||||
|
grantUserGrantedPermission(accessTokenId, permission) {
|
||||||
|
abilityAccessCtrl.createAtManager().grantUserGrantedPermission(
|
||||||
|
accessTokenId, permission, Constants.PERMISSION_FLAG).then((result) => {
|
||||||
|
nowGrantResult = result;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error(TAG + 'grantUserGrantedPermission failed. Cause: ' + JSON.stringify(error));
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deauthorize the app
|
||||||
|
* @param {Number} accessTokenId
|
||||||
|
* @param {String} permission permission name
|
||||||
|
*/
|
||||||
|
revokeUserGrantedPermission(accessTokenId, permission) {
|
||||||
|
abilityAccessCtrl.createAtManager().revokeUserGrantedPermission(
|
||||||
|
accessTokenId, permission, Constants.PERMISSION_FLAG).then((result) => {
|
||||||
|
nowRevokeResult = result;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error(TAG + 'revokeUserGrantedPermission failed. Cause: ' + JSON.stringify(error));
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lifecycle function, executed when the page is initialized
|
||||||
|
*/
|
||||||
|
aboutToAppear() {
|
||||||
|
let permissionDescription = permissionDescriptions[backTitle];
|
||||||
|
if(showSubpermissionsGrop.indexOf(backTitle) != -1) {
|
||||||
|
reason = []
|
||||||
|
permissions.forEach(permission => {
|
||||||
|
permissionGroups.forEach(permissionGroup => {
|
||||||
|
if(permissionGroup.permissionName == permission) {
|
||||||
|
reason.push(permissionGroup.label)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
Resmgr.getResourceManager(globalThis.context, Constants.BUNDLE_NAME).then(item => {
|
||||||
|
Promise.all([item.getString($r("app.string.separator").id),
|
||||||
|
item.getString($r("app.string.reason_suffix").id)])
|
||||||
|
.then(values => {
|
||||||
|
reason = reason.join(values[0])
|
||||||
|
reason += values[1]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}else {
|
||||||
|
reason = ''
|
||||||
|
}
|
||||||
|
let hasReason = false
|
||||||
|
bundle.getBundleInfo(routerData, Constants.PARMETER_BUNDLE_FLAG).then(res => {
|
||||||
|
permissions.forEach(permission => {
|
||||||
|
res.reqPermissionDetails.forEach(reqPermissionDetail => {
|
||||||
|
if(reqPermissionDetail.name == permission) {
|
||||||
|
Resmgr.getResourceManager(globalThis.context, routerData).then(item => {
|
||||||
|
item.getString(reqPermissionDetail.reasonId, (err, value) => {
|
||||||
|
if (value !== undefined && !hasReason) {
|
||||||
|
reason += value.slice(Constants.START_SUBSCRIPT, Constants.END_SUBSCRIPT)
|
||||||
|
hasReason = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
Promise.all([getAppLabel(res.appInfo.labelId, res.name),
|
||||||
|
getAppIcon(res.appInfo.iconId, res.name)])
|
||||||
|
.then((values) => {
|
||||||
|
this.mediaListItem = new MediaListObj(
|
||||||
|
String(values[0]), String(values[1]), res.versionName, permissionDescription);
|
||||||
|
})
|
||||||
|
this.mediaDocListItem.push(
|
||||||
|
new MeidaDocObj(
|
||||||
|
Constants.RADIO_ALLOW_NAME,
|
||||||
|
Constants.RADIO_ALLOW_INDEX,
|
||||||
|
Constants.RADIO_ALLOW_GROUP_NAME,
|
||||||
|
res.appInfo.accessTokenId,
|
||||||
|
permissions
|
||||||
|
)
|
||||||
|
);
|
||||||
|
this.mediaDocListItem.push(
|
||||||
|
new MeidaDocObj(
|
||||||
|
Constants.RADIO_BAN_NAME,
|
||||||
|
Constants.RADIO_BAN_INDEX,
|
||||||
|
Constants.RADIO_BAN_GROUP_NAME,
|
||||||
|
res.appInfo.accessTokenId,
|
||||||
|
permissions
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error(TAG + 'bundle.getBundleInfo failed. Cause: ' + JSON.stringify(error));
|
||||||
|
this.mediaListItem = new MediaListObj('', '', '', permissionDescription);
|
||||||
|
this.mediaDocListItem.push(
|
||||||
|
new MeidaDocObj(Constants.RADIO_ALLOW_NAME, Constants.RADIO_ALLOW_INDEX,
|
||||||
|
Constants.RADIO_ALLOW_GROUP_NAME, '', permissions)
|
||||||
|
);
|
||||||
|
this.mediaDocListItem.push(
|
||||||
|
new MeidaDocObj(Constants.RADIO_BAN_NAME, Constants.RADIO_BAN_INDEX,
|
||||||
|
Constants.RADIO_BAN_GROUP_NAME, '', permissions)
|
||||||
|
);
|
||||||
|
})
|
||||||
|
// Get permission status
|
||||||
|
if (!status) {
|
||||||
|
this.isCheckList = [true, false];
|
||||||
|
} else {
|
||||||
|
this.isCheckList = [false, true];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
build(){
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
|
||||||
|
Image(this.mediaListItem.iconId)
|
||||||
|
.width(Constants.TERTIARY_IMAGE_WIDTH)
|
||||||
|
.height(Constants.TERTIARY_IMAGE_HEIGHT)
|
||||||
|
.margin({ left: Constants.TERTIARY_IMAGE_MARGIN_LEFT, right: Constants.TERTIARY_IMAGE_MARGIN_RIGHT })
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
Text(this.mediaListItem.labelId)
|
||||||
|
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.label_color'))
|
||||||
|
.fontWeight(FontWeight.Bold)
|
||||||
|
.textAlign(TextAlign.Start)
|
||||||
|
}
|
||||||
|
.width(Constants.TERTIARY_HALF_WIDTH)
|
||||||
|
.margin({ bottom: Constants.TERTIARY_LABEL_MARGIN_BOTTOM })
|
||||||
|
Row() {
|
||||||
|
Text(this.mediaListItem.versionName)
|
||||||
|
.fontSize(Constants.TEXT_SMAL_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.label_color_light'))
|
||||||
|
.textAlign(TextAlign.Start)
|
||||||
|
}
|
||||||
|
.width(Constants.TERTIARY_HALF_WIDTH)
|
||||||
|
}
|
||||||
|
}.margin({ left: Constants.TERTIARY_MARGIN_LEFT })
|
||||||
|
}
|
||||||
|
if(reason) {
|
||||||
|
Row() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
|
||||||
|
Row() {
|
||||||
|
Text(reason)
|
||||||
|
.fontSize(Constants.TEXT_SMAL_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.label_color_light'))
|
||||||
|
.textAlign(TextAlign.Start)
|
||||||
|
}.margin({ left: Constants.TERTIARY_IMAGE_MARGIN_LEFT, right: Constants.TERTIARY_IMAGE_MARGIN_RIGHT })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.margin({ top: Constants.TERTIARY_ROW_MARGIN_TOP, left: Constants.TERTIARY_MARGIN_LEFT })
|
||||||
|
}
|
||||||
|
Row() {
|
||||||
|
Text(backTitle)
|
||||||
|
.fontSize(Constants.TEXT_SMAL_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.label_color_light'))
|
||||||
|
.fontWeight(FontWeight.Medium)
|
||||||
|
.textAlign(TextAlign.Start)
|
||||||
|
.lineHeight(Constants.SUBTITLE_LINE_HEIGHT)
|
||||||
|
Text($r('app.string.access_permission'))
|
||||||
|
.fontSize(Constants.TEXT_SMAL_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.label_color_light'))
|
||||||
|
.fontWeight(FontWeight.Medium)
|
||||||
|
.textAlign(TextAlign.Start)
|
||||||
|
.lineHeight(Constants.SUBTITLE_LINE_HEIGHT)
|
||||||
|
}.width(Constants.FULL_WIDTH)
|
||||||
|
.constraintSize({ minHeight: Constants.SUBTITLE_MIN_HEIGHT })
|
||||||
|
.padding({ top: Constants.SUBTITLE_PADDING_TOP, bottom: Constants.SUBTITLE_PADDING_BOTTOM,
|
||||||
|
left: Constants.TERTIARY_TEXT_MARGIN_LEFT, right: Constants.TERTIARY_IMAGE_MARGIN_RIGHT})
|
||||||
|
.margin({ top: Constants.TERTIARY_PERMISSION_ROW_MARGIN_TOP })
|
||||||
|
Column() {
|
||||||
|
List() {
|
||||||
|
ForEach(this.mediaDocListItem, (item) => {
|
||||||
|
ListItem() {
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
|
||||||
|
Row() {
|
||||||
|
Text(item.name)
|
||||||
|
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.label_color'))
|
||||||
|
.fontWeight(FontWeight.Medium)
|
||||||
|
.flexGrow(Constants.FLEX_GROW)
|
||||||
|
if (this.isCheckList[item.index] === true) {
|
||||||
|
Shape() {
|
||||||
|
Circle().width(Constants.SHAPE_DIA).height(Constants.SHAPE_DIA)
|
||||||
|
.fill($r("app.color.shape_allow_color")).offset({ x: 0, y: 0 })
|
||||||
|
Circle().width(Constants.SHAPE_ALLOW_DIA).height(Constants.SHAPE_ALLOW_DIA)
|
||||||
|
.fill($r("app.color.default_background_color"))
|
||||||
|
.offset({ x: Constants.SHAPE_ALLOW_OFFSET, y: Constants.SHAPE_ALLOW_OFFSET })
|
||||||
|
}
|
||||||
|
} else if (this.isCheckList[item.index] === false) {
|
||||||
|
Shape() {
|
||||||
|
Circle().width(Constants.SHAPE_DIA).height(Constants.SHAPE_DIA)
|
||||||
|
.fill($r("app.color.shape_ban_color")).offset({ x: 0, y: 0 })
|
||||||
|
Circle().width(Constants.SHAPE_BAN_DIA).height(Constants.SHAPE_BAN_DIA)
|
||||||
|
.fill($r("app.color.default_background_color"))
|
||||||
|
.offset({ x: Constants.SHAPE_BAN_OFFSET, y: Constants.SHAPE_BAN_OFFSET })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.LISTITEM_ROW_HEIGHT)
|
||||||
|
.onClick(() => {
|
||||||
|
item.permissions.forEach((permission) => {
|
||||||
|
if (!item.index) {
|
||||||
|
this.grantUserGrantedPermission(item.accessTokenId, permission)
|
||||||
|
if (nowGrantResult != Constants.PERMISSION_INDEX) {
|
||||||
|
GrantResultFlag.push(-1)
|
||||||
|
}else{
|
||||||
|
GrantResultFlag.push(0)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.revokeUserGrantedPermission(item.accessTokenId, permission)
|
||||||
|
if (nowRevokeResult != Constants.PERMISSION_INDEX) {
|
||||||
|
RevokeResultFlag.push(-1)
|
||||||
|
this.authorizeDialogController.open();
|
||||||
|
setTimeout(()=> {
|
||||||
|
this.authorizeDialogController.close();
|
||||||
|
}, Constants.DELAY_TIME)
|
||||||
|
}else{
|
||||||
|
RevokeResultFlag.push(0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (!item.index) {
|
||||||
|
if(GrantResultFlag.indexOf(-1) > -1){
|
||||||
|
this.authorizeDialogController.open();
|
||||||
|
setTimeout(()=> {
|
||||||
|
this.authorizeDialogController.close();
|
||||||
|
}, Constants.DELAY_TIME)
|
||||||
|
}else{
|
||||||
|
this.isCheckList = [true, false];
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (RevokeResultFlag.indexOf(-1) > -1){
|
||||||
|
this.authorizeDialogController.open();
|
||||||
|
setTimeout(()=> {
|
||||||
|
this.authorizeDialogController.close();
|
||||||
|
}, Constants.DELAY_TIME)
|
||||||
|
}else{
|
||||||
|
this.isCheckList = [false, true];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!item.index) {
|
||||||
|
Row() {
|
||||||
|
Column()
|
||||||
|
.backgroundColor($r('app.color.text_decoration_color'))
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.TEXT_DECORATION_HEIGHT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.onClick(() => {
|
||||||
|
})
|
||||||
|
}
|
||||||
|
.padding({
|
||||||
|
left: Constants.DEFAULT_PADDING_START,
|
||||||
|
right: Constants.DEFAULT_PADDING_END
|
||||||
|
})
|
||||||
|
.margin({ top: Constants.TERTIARY_LISTITEM_MARGIN_TOP })
|
||||||
|
}, item => item.toString())
|
||||||
|
}
|
||||||
|
.borderRadius(Constants.BORDER_RADIUS)
|
||||||
|
.backgroundColor($r('app.color.default_background_color'))
|
||||||
|
.padding({
|
||||||
|
top: Constants.TERTIARY_LIST_PADDING_TOP, bottom: Constants.TERTIARY_LIST_PADDING_BOTTOM
|
||||||
|
})
|
||||||
|
}
|
||||||
|
.padding({
|
||||||
|
left: Constants.LIST_PADDING_LEFT,
|
||||||
|
right: Constants.LIST_PADDING_LEFT
|
||||||
|
})
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
}
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
}
|
||||||
|
}
|
715
permissionmanager/src/main/ets/pages/authority-management.ets
Normal file
@ -0,0 +1,715 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { backBar } from "../common/components/backBar";
|
||||||
|
import { alphabetIndexerComponent } from "../common/components/alphabeticalIndex";
|
||||||
|
import { textInput } from "../common/components/search";
|
||||||
|
import router from '@system.router';
|
||||||
|
import bundle from "@ohos.bundle";
|
||||||
|
import Resmgr from '@ohos.resourceManager';
|
||||||
|
import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
|
||||||
|
import { groups, userGrantPermissions, permissionGroupPermissions, noNeedDisplayApp } from "../common/model/permissionGroup";
|
||||||
|
import { permissionGroups, permissionPermissionGroup, permissionGroupIds } from "../common/model/permissionGroup";
|
||||||
|
import { makePy } from "../common/utils/utils";
|
||||||
|
import Constants from '../common/utils/constant';
|
||||||
|
|
||||||
|
var TAG = 'PermissionManager_MainAbility:'
|
||||||
|
|
||||||
|
@Extend(Image) function customizeImage(width: number, height: number) {
|
||||||
|
.objectFit(ImageFit.Contain)
|
||||||
|
.width(width)
|
||||||
|
.height(height)
|
||||||
|
};
|
||||||
|
|
||||||
|
interface applicationPermissions {
|
||||||
|
'bundleName': string,
|
||||||
|
'iconId': string,
|
||||||
|
'permissions': string[],
|
||||||
|
'labelId': string,
|
||||||
|
'tokenId': number,
|
||||||
|
'groupId': number[]
|
||||||
|
};
|
||||||
|
|
||||||
|
interface permissionApplications {
|
||||||
|
'permission': string,
|
||||||
|
'groupName': string,
|
||||||
|
'bundleNames': string[],
|
||||||
|
'icon': string
|
||||||
|
};
|
||||||
|
|
||||||
|
interface groupPermission {
|
||||||
|
'group': string,
|
||||||
|
'permissions': string[],
|
||||||
|
'groupName': string,
|
||||||
|
'icon': string,
|
||||||
|
'isShow':boolean
|
||||||
|
};
|
||||||
|
|
||||||
|
let bundleInfosList: any[] = []; // Permission information array
|
||||||
|
let textInput_placeholder: any = ''
|
||||||
|
|
||||||
|
@Entry
|
||||||
|
@Component
|
||||||
|
struct authorityManagementPage {
|
||||||
|
@Builder ListItemLayout(item, index) {
|
||||||
|
ListItem() {
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
|
||||||
|
Row() {
|
||||||
|
Image(item.icon)
|
||||||
|
.customizeImage(Constants.MANAGEMENT_IMAGE_WIDTH, Constants.MANAGEMENT_IMAGE_HEIGHT)
|
||||||
|
.margin({ right: Constants.MANAGEMENT_IMAGE_MARGIN_RIGHT })
|
||||||
|
Text(item.groupName)
|
||||||
|
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||||
|
.fontWeight(FontWeight.Medium)
|
||||||
|
.fontColor($r('app.color.label_color'))
|
||||||
|
.flexGrow(Constants.FLEX_GROW)
|
||||||
|
Image($r('app.media.rightarrow'))
|
||||||
|
.customizeImage(Constants.IMAGE_WIDTH, Constants.IMAGE_HEIGHT)
|
||||||
|
}
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.MANAGEMENT_ROW_HEIGHT)
|
||||||
|
}
|
||||||
|
if (!index) {
|
||||||
|
Row() {
|
||||||
|
Flex() {
|
||||||
|
Column().width(Constants.MANAGEMENT_TEXT_DECORATION_MARGIN_LEFT)
|
||||||
|
Column()
|
||||||
|
.backgroundColor($r('app.color.text_decoration_color'))
|
||||||
|
.height(Constants.TEXT_DECORATION_HEIGHT)
|
||||||
|
.flexGrow(Constants.FLEX_GROW)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.onClick(() => {
|
||||||
|
if (item.groupName === '其他权限' || item.groupName === '电话' || item.groupName === '通讯录' || item.groupName === '信息'
|
||||||
|
|| item.groupName === '通话记录' || item.groupName === '日历') {
|
||||||
|
router.push({
|
||||||
|
uri: 'pages/authority-secondary',
|
||||||
|
params: { routerData: this.allPermissionApplications, backTitle: item.groupName }
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
var dataList = this.allPermissionApplications.filter((ele) => {
|
||||||
|
return ele.groupName === item.group
|
||||||
|
})
|
||||||
|
|
||||||
|
router.push({
|
||||||
|
uri: 'pages/authority-tertiary-groups',
|
||||||
|
params: { routerData: dataList, backTitle: item.groupName }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}.padding({ left: Constants.DEFAULT_PADDING_START, right: Constants.DEFAULT_PADDING_END })
|
||||||
|
}
|
||||||
|
|
||||||
|
@State allApplicationPermissions: applicationPermissions[] = []; // All permissions apply
|
||||||
|
@State allPermissions: string[] = []; // All permissions
|
||||||
|
@State allSystemPermissions: string[] = []; // All system permissions
|
||||||
|
@State allUserPermissions: string[] = []; // All user rights
|
||||||
|
@State allPermissionApplications: permissionApplications [] = [] // All app permissions
|
||||||
|
@State allGroups: string[] = [] // All groups
|
||||||
|
@State allGroupPermission: groupPermission[] = [] // All group permissions
|
||||||
|
@State currentIndex: number = 0
|
||||||
|
@Builder TabBuilder(index: number) {
|
||||||
|
Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
||||||
|
Text(index ? $r('app.string.application') : $r('app.string.authority'))
|
||||||
|
.fontColor(this.currentIndex == index ? $r('app.color.button_color') : $r('app.color.label_color'))
|
||||||
|
.fontWeight(this.currentIndex == index ? FontWeight.Bold : FontWeight.Regular)
|
||||||
|
.lineHeight(Constants.TEXT_LINE_HEIGHT)
|
||||||
|
if(this.currentIndex == index) {
|
||||||
|
Row().width(Constants.FULL_WIDTH).height(Constants.TAB_DECORATION_HEIGHT)
|
||||||
|
.backgroundColor($r('app.color.button_color'))
|
||||||
|
.position({ y: Constants.TAB_DECORATION_POSITION_Y })
|
||||||
|
}
|
||||||
|
}.height(Constants.TAB_HEIGHT)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the permission array into key, value key-value objects for easy sorting
|
||||||
|
* @param {Array} order User rights
|
||||||
|
* @return {Object} return the processed object
|
||||||
|
*/
|
||||||
|
orderDict(order) {
|
||||||
|
let result = {};
|
||||||
|
for (let i = 0; i < order.length; i++) {
|
||||||
|
let key = order[i];
|
||||||
|
result[key] = i;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compare and sort the permission array according to the permission key value
|
||||||
|
* @param {String} prop Sort by permission
|
||||||
|
* @param {Object} orderSort objects to be sorted
|
||||||
|
* @return {Array} Returns a sorted array of permissions
|
||||||
|
*/
|
||||||
|
compare(prop, orderSort) {
|
||||||
|
return function(a, b) {
|
||||||
|
let aSortValue = orderSort[a[prop]];
|
||||||
|
let bSortValue = orderSort[b[prop]];
|
||||||
|
if (aSortValue == undefined) {
|
||||||
|
throw new Error('当前的字段不在排序列表里:' + a[prop]);
|
||||||
|
}
|
||||||
|
if (bSortValue == undefined) {
|
||||||
|
throw new Error('当前的字段不在排序列表里:' + b[prop]);
|
||||||
|
}
|
||||||
|
return aSortValue - bSortValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all app permission information
|
||||||
|
* @param {Array} allPermissions All permissions
|
||||||
|
* @param {Object} allApplicationPermissions All app permissions
|
||||||
|
*/
|
||||||
|
getAllBundlePermissions(allPermissions: string[], allApplicationPermissions: applicationPermissions[]) {
|
||||||
|
bundle.getAllBundleInfo(Constants.PARMETER_BUNDLE_FLAG).then(async(res) => {
|
||||||
|
const bundleInfos = res;
|
||||||
|
var count = bundleInfos.length;
|
||||||
|
if (count <= 0) {
|
||||||
|
console.info(TAG + 'bundle.getAllBundleInfo result.length less than or equal to zero');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var infoIndex = 0;
|
||||||
|
for (let i = 0; i < count; i++) {
|
||||||
|
var info = bundleInfos[i];
|
||||||
|
// Filter blank icon icon and text label resources
|
||||||
|
try {
|
||||||
|
const ret = await bundle.queryAbilityByWant({
|
||||||
|
bundleName: info.name,
|
||||||
|
action: "action.system.home",
|
||||||
|
entities: ["entity.system.home"]
|
||||||
|
}, bundle.BundleFlag.GET_ABILITY_INFO_WITH_APPLICATION, Constants.USERID);
|
||||||
|
} catch(e) {
|
||||||
|
console.log(TAG + 'queryAbilityByWant catch error: ' + JSON.stringify(e))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (noNeedDisplayApp.indexOf(info.name) != -1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
await this.deduplicationPermissions(info, allPermissions, allApplicationPermissions);
|
||||||
|
this.updateAppLabel(infoIndex, info.name, info.appInfo.label);
|
||||||
|
this.updateAppIcon(infoIndex, info.name);
|
||||||
|
infoIndex = infoIndex + 1;
|
||||||
|
}
|
||||||
|
this.getAllPermissionApplications();
|
||||||
|
let orderSort = this.orderDict(userGrantPermissions);
|
||||||
|
this.allPermissionApplications.sort(this.compare('permission', orderSort));
|
||||||
|
this.getAllGroupPermission();
|
||||||
|
bundleInfosList = this.allApplicationPermissions;
|
||||||
|
bundleInfosList.forEach((item) => {
|
||||||
|
if (!isNaN(item.labelId)) {
|
||||||
|
item.alphabeticalIndex = '';
|
||||||
|
} else {
|
||||||
|
item.alphabeticalIndex = makePy(item.labelId)[0].slice(0, 1); // Get the first letter in the returned initials array
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error(TAG + 'bundle.getAllBundleInfo failed. Cause: ' + JSON.stringify(error));
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the corresponding permission group id according to the permission
|
||||||
|
* @param {String} permission app name id
|
||||||
|
* @return {Number} groupId
|
||||||
|
*/
|
||||||
|
getPermissionGroupByPermission(permission: string) {
|
||||||
|
for (let i = 0; i < permissionGroups.length; i++) {
|
||||||
|
if (permissionGroups[i].permissionName == permission) {
|
||||||
|
return groups[permissionGroups[i].groupId];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all app permission information
|
||||||
|
*/
|
||||||
|
getAllPermissionApplications() {
|
||||||
|
const this_ = this;
|
||||||
|
var leng = this_.allPermissions.length;
|
||||||
|
if (leng > 0) {
|
||||||
|
for (let i = 0; i < leng; i++) {
|
||||||
|
if (userGrantPermissions.indexOf(this_.allPermissions[i]) == -1) {
|
||||||
|
this_.allSystemPermissions.push(this_.allPermissions[i]);
|
||||||
|
} else {
|
||||||
|
this_.allUserPermissions.push(this_.allPermissions[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let i = 0; i < this_.allUserPermissions.length; i++) {
|
||||||
|
var permissionGroup = this_.getPermissionGroupByPermission(this_.allUserPermissions[i]);
|
||||||
|
var icon: string = permissionGroup.icon;
|
||||||
|
var bundleNames: string[] = [];
|
||||||
|
for (let j = 0; j < this_.allApplicationPermissions.length; j++) {
|
||||||
|
if (this_.allApplicationPermissions[j].permissions.indexOf(this_.allUserPermissions[i]) != -1) {
|
||||||
|
bundleNames.push(this_.allApplicationPermissions[j].bundleName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var pa: permissionApplications = {
|
||||||
|
'permission': this_.allUserPermissions[i],
|
||||||
|
'groupName': permissionGroup.name,
|
||||||
|
'bundleNames': bundleNames,
|
||||||
|
'icon': icon
|
||||||
|
};
|
||||||
|
this_.allPermissionApplications.push(pa);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get permission group information
|
||||||
|
*/
|
||||||
|
getAllGroupPermission() {
|
||||||
|
const this_ = this;
|
||||||
|
var temp1 = [];
|
||||||
|
temp1 = ["LOCATION","CAMERA","MICROPHONE","MEDIA","CALENDAR","SPORT","HEALTH"];
|
||||||
|
groups.forEach((item) => {
|
||||||
|
if (temp1.indexOf(item.name) > -1) {
|
||||||
|
var gp: groupPermission = {
|
||||||
|
"group": item.name,
|
||||||
|
"permissions": item.permissions,
|
||||||
|
'groupName': item.groupName,
|
||||||
|
'icon': item.icon,
|
||||||
|
'isShow': item.isShow
|
||||||
|
};
|
||||||
|
this_.allGroupPermission.push(gp);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
let temp2 = [];
|
||||||
|
groups.forEach((item) => {
|
||||||
|
if (item.isShow && temp1.indexOf(item.name) === -1) {
|
||||||
|
var gp: groupPermission = {
|
||||||
|
"group": item.name,
|
||||||
|
"permissions": item.permissions,
|
||||||
|
'groupName': item.groupName,
|
||||||
|
'icon': item.icon,
|
||||||
|
'isShow': item.isShow
|
||||||
|
};
|
||||||
|
temp2.push(item.name);
|
||||||
|
this_.allGroupPermission.push(gp);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
for (let i = 0; i < this_.allPermissionApplications.length; i++) {
|
||||||
|
if (this_.allGroups.indexOf(this_.allPermissionApplications[i].groupName) == -1
|
||||||
|
&& temp1.indexOf(this_.allPermissionApplications[i].groupName) == -1) {
|
||||||
|
this_.allGroups.push(this_.allPermissionApplications[i].groupName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Permission layout
|
||||||
|
var temp = this_.allGroups;
|
||||||
|
temp = temp.filter(function(item) {
|
||||||
|
return temp1.indexOf(item) == -1 && temp2.indexOf(item) == -1;
|
||||||
|
});
|
||||||
|
if (temp.indexOf("OTHER") > -1) {
|
||||||
|
temp.splice(temp.indexOf("OTHER"),1);
|
||||||
|
temp.push("OTHER");
|
||||||
|
}else {
|
||||||
|
temp.push("OTHER");
|
||||||
|
}
|
||||||
|
this_.allGroups = temp;
|
||||||
|
for (let i = 0; i < this_.allGroups.length; i++) {
|
||||||
|
var permissions: string[] = permissionGroupPermissions[this_.allGroups[i]];
|
||||||
|
var gp: groupPermission = {
|
||||||
|
"group": this_.allGroups[i],
|
||||||
|
"permissions": permissions,
|
||||||
|
'groupName': '',
|
||||||
|
'icon': '',
|
||||||
|
'isShow': false
|
||||||
|
};
|
||||||
|
this_.allGroupPermission.push(gp);
|
||||||
|
}
|
||||||
|
this.allGroupPermission.forEach((ele) => {
|
||||||
|
groups.forEach((item) => {
|
||||||
|
if (ele.group === item.name) {
|
||||||
|
ele.groupName = item.groupName;
|
||||||
|
ele.icon = item.icon;
|
||||||
|
ele.isShow = item.isShow;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deduplicate permission information and permission group information
|
||||||
|
* @param {Object} info bundleInfos Application Information
|
||||||
|
* @param {Array} allPermissions All permissions
|
||||||
|
* @param {Array} allApplicationPermissions All permissions apply
|
||||||
|
*/
|
||||||
|
async deduplicationPermissions(info, allPermissions, allApplicationPermissions) {
|
||||||
|
var reqPermissionsLen = info.reqPermissions.length;
|
||||||
|
var reqUserPermissions: string[] = [];
|
||||||
|
var acManager = abilityAccessCtrl.createAtManager()
|
||||||
|
if (reqPermissionsLen > 0) {
|
||||||
|
for (let j = 0; j < info.reqPermissions.length; j++) {
|
||||||
|
var permission = info.reqPermissions[j];
|
||||||
|
var flag = await acManager.getPermissionFlags(info.appInfo.accessTokenId, permission)
|
||||||
|
if(flag == Constants.PRE_AUTHORIZATION_NOT_MODIFIED) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if (allPermissions.indexOf(permission) == -1) {
|
||||||
|
allPermissions.push(permission);
|
||||||
|
}
|
||||||
|
if (userGrantPermissions.indexOf(permission) != -1) {
|
||||||
|
reqUserPermissions.push(permission);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let dePermissions = [];
|
||||||
|
let groupIds = [];
|
||||||
|
for (let i = 0; i < reqUserPermissions.length; i++) {
|
||||||
|
if(dePermissions.indexOf(permissionPermissionGroup[reqUserPermissions[i]]) == -1){
|
||||||
|
dePermissions.push(permissionPermissionGroup[reqUserPermissions[i]]);
|
||||||
|
}
|
||||||
|
if(groupIds.indexOf(permissionGroupIds[reqUserPermissions[i]]) == -1){
|
||||||
|
groupIds.push(permissionGroupIds[reqUserPermissions[i]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// adapt different api
|
||||||
|
if (info.compatibleVersion >= Constants.API_VERSION_SUPPORT_STAGE) {
|
||||||
|
info.appInfo.iconId = info.hapModuleInfos[0].abilityInfo[0].iconId;
|
||||||
|
}
|
||||||
|
|
||||||
|
var ap: applicationPermissions = {
|
||||||
|
'bundleName': info.name,
|
||||||
|
'tokenId': info.appInfo.accessTokenId,
|
||||||
|
'iconId': info.appInfo.iconId,
|
||||||
|
'labelId': info.appInfo.labelId,
|
||||||
|
'permissions': reqUserPermissions,
|
||||||
|
'groupId': groupIds
|
||||||
|
};
|
||||||
|
allApplicationPermissions.push(ap);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get app name resource
|
||||||
|
* @param {Number} index index of all app permissions array
|
||||||
|
* @param {String} bundleName Package names
|
||||||
|
* @param {String} labelName Application Name
|
||||||
|
*/
|
||||||
|
updateAppLabel(index, bundleName, labelName) {
|
||||||
|
Resmgr.getResourceManager(globalThis.context, bundleName).then(item => {
|
||||||
|
if (index >= this.allApplicationPermissions.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var info = this.allApplicationPermissions[index];
|
||||||
|
item.getString(info['labelId'], (error, value) => {
|
||||||
|
if (value == undefined) {
|
||||||
|
info['labelId'] = labelName;
|
||||||
|
} else {
|
||||||
|
info['labelId'] = value;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).catch(error => {
|
||||||
|
console.error(TAG + 'Resmgr.getResourceManager failed. Cause: ' + JSON.stringify(error));
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get app icon resources
|
||||||
|
* @param {Number} index index of all app permissions array
|
||||||
|
* @param {String} bundleName Package names
|
||||||
|
*/
|
||||||
|
updateAppIcon(index, bundleName) {
|
||||||
|
Resmgr.getResourceManager(globalThis.context, bundleName).then(item => {
|
||||||
|
if (index >= this.allApplicationPermissions.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var info = this.allApplicationPermissions[index];
|
||||||
|
item.getMediaBase64(info['iconId'], (error, value) => {
|
||||||
|
info['iconId'] = value;
|
||||||
|
})
|
||||||
|
}).catch(error => {
|
||||||
|
console.error(TAG + 'Resmgr.getResourceManager failed. Cause: ' + JSON.stringify(error));
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lifecycle function, executed when the page is initialized
|
||||||
|
*/
|
||||||
|
aboutToAppear() {
|
||||||
|
console.log(TAG + 'on aboutToAppear, version 1.01');
|
||||||
|
this.getAllBundlePermissions(this.allPermissions, this.allApplicationPermissions);
|
||||||
|
Resmgr.getResourceManager(globalThis.context, Constants.BUNDLE_NAME).then(item => {
|
||||||
|
item.getString($r("app.string.textInput_placeholder").id, (err, val) => {
|
||||||
|
textInput_placeholder = val
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
getPermissionGroup(allGroup, order) {
|
||||||
|
var fixedName: string[] = ['LOCATION', 'CAMERA', 'MICROPHONE']
|
||||||
|
var fixedGroup: any[] = []
|
||||||
|
var changeGroup: any[] = []
|
||||||
|
var otherGroup: any[] = []
|
||||||
|
|
||||||
|
allGroup.forEach(group => {
|
||||||
|
if(fixedName.indexOf(group.group) !== -1) {
|
||||||
|
fixedGroup.push(group)
|
||||||
|
}else if(group.group == 'OTHER') {
|
||||||
|
otherGroup.push(group)
|
||||||
|
}else {
|
||||||
|
changeGroup.push(group)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if(order == Constants.FIXED_GROUP){
|
||||||
|
return fixedGroup
|
||||||
|
}else if(order == Constants.CHANGE_GROUP) {
|
||||||
|
return changeGroup
|
||||||
|
}else if(order == Constants.OTHER_GROUP) {
|
||||||
|
return otherGroup
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) {
|
||||||
|
Row() {
|
||||||
|
Row()
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.LEFT_XS_SPAN, offset: Constants.LEFT_XS_OFFSET },
|
||||||
|
sm: { span: Constants.LEFT_SM_SPAN, offset: Constants.LEFT_SM_OFFSET },
|
||||||
|
md: { span: Constants.LEFT_MD_SPAN, offset: Constants.LEFT_MD_OFFSET },
|
||||||
|
lg: { span: Constants.LEFT_LG_SPAN, offset: Constants.LEFT_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
backBar( { title: JSON.stringify($r('app.string.authority_management')), recordable: true })
|
||||||
|
}
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Column() {
|
||||||
|
Stack() {
|
||||||
|
if(this.allGroupPermission.length) {
|
||||||
|
Tabs() {
|
||||||
|
TabContent() {
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Scroll() {
|
||||||
|
Column() {
|
||||||
|
List() {
|
||||||
|
ListItem() {
|
||||||
|
List() {
|
||||||
|
ForEach(this.getPermissionGroup(this.allGroupPermission, Constants.FIXED_GROUP).slice(Constants.SLICE_START,
|
||||||
|
this.getPermissionGroup(this.allGroupPermission, Constants.FIXED_GROUP).length - 1), (item) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_START_INDEX)
|
||||||
|
}, item => item.toString())
|
||||||
|
ForEach(this.getPermissionGroup(this.allGroupPermission, Constants.FIXED_GROUP).slice(Constants.SLICE_END), (item, index) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_END_INDEX)
|
||||||
|
}, item => item.toString())
|
||||||
|
}.backgroundColor($r('app.color.default_background_color'))
|
||||||
|
.borderRadius(Constants.BORDER_RADIUS)
|
||||||
|
.padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM })
|
||||||
|
.margin({ bottom: Constants.LIST_MARGIN_BOTTOM })
|
||||||
|
}
|
||||||
|
|
||||||
|
ListItem() {
|
||||||
|
List() {
|
||||||
|
ForEach(this.getPermissionGroup(this.allGroupPermission, Constants.CHANGE_GROUP).slice(Constants.SLICE_START,
|
||||||
|
this.getPermissionGroup(this.allGroupPermission, Constants.CHANGE_GROUP).length - 1), (item) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_START_INDEX)
|
||||||
|
}, item => item.toString())
|
||||||
|
ForEach(this.getPermissionGroup(this.allGroupPermission, Constants.CHANGE_GROUP).slice(Constants.SLICE_END), (item, index) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_END_INDEX)
|
||||||
|
}, item => item.toString())
|
||||||
|
}.backgroundColor($r('app.color.default_background_color'))
|
||||||
|
.borderRadius(Constants.BORDER_RADIUS)
|
||||||
|
.padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM })
|
||||||
|
.margin({ bottom: Constants.LIST_MARGIN_BOTTOM })
|
||||||
|
}
|
||||||
|
|
||||||
|
ListItem() {
|
||||||
|
List() {
|
||||||
|
ForEach(this.getPermissionGroup(this.allGroupPermission, Constants.OTHER_GROUP), (item) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_END_INDEX)
|
||||||
|
}, item => item.toString())
|
||||||
|
}.backgroundColor($r('app.color.default_background_color'))
|
||||||
|
.borderRadius(Constants.BORDER_RADIUS)
|
||||||
|
.padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM })
|
||||||
|
}
|
||||||
|
}.height(Constants.FULL_HEIGHT)
|
||||||
|
.borderRadius(Constants.BORDER_RADIUS)
|
||||||
|
.clip(true)
|
||||||
|
}.padding({
|
||||||
|
left: Constants.MANAGEMENT_ROW_PADDING_LEFT,
|
||||||
|
right: Constants.MANAGEMENT_ROW_PADDING_RIGHT,
|
||||||
|
})
|
||||||
|
}.scrollBar(BarState.Off)
|
||||||
|
.margin({ top: Constants.MANAGEMENT_ROW_PADDING_TOP })
|
||||||
|
}.width(Constants.FULL_WIDTH)
|
||||||
|
}
|
||||||
|
}.tabBar(this.TabBuilder(0))
|
||||||
|
TabContent() {
|
||||||
|
applicationItem()
|
||||||
|
}.tabBar(this.TabBuilder(1))
|
||||||
|
}
|
||||||
|
.barWidth(Constants.BAR_WIDTH)
|
||||||
|
.barMode(BarMode.Fixed)
|
||||||
|
.onChange((index) => {
|
||||||
|
this.currentIndex = index
|
||||||
|
})
|
||||||
|
}else {
|
||||||
|
LoadingProgress().width(Constants.LOADING_WIDTH)
|
||||||
|
}
|
||||||
|
}.height(Constants.FULL_HEIGHT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.layoutWeight(Constants.LAYOUT_WEIGHT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.MIDDLE_XS_SPAN, offset: Constants.MIDDLE_XS_OFFSET },
|
||||||
|
sm: { span: Constants.MIDDLE_SM_SPAN, offset: Constants.MIDDLE_SM_OFFSET },
|
||||||
|
md: { span: Constants.MIDDLE_MD_SPAN, offset: Constants.MIDDLE_MD_OFFSET },
|
||||||
|
lg: { span: Constants.MIDDLE_LG_SPAN, offset: Constants.MIDDLE_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
Row()
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.RIGHT_XS_SPAN, offset: Constants.RIGHT_XS_OFFSET },
|
||||||
|
sm: { span: Constants.RIGHT_SM_SPAN, offset: Constants.RIGHT_SM_OFFSET },
|
||||||
|
md: { span: Constants.RIGHT_MD_SPAN, offset: Constants.RIGHT_MD_OFFSET },
|
||||||
|
lg: { span: Constants.RIGHT_LG_SPAN, offset: Constants.RIGHT_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
}
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.backgroundColor($r("sys.color.ohos_id_color_sub_background"))
|
||||||
|
.opacity(Constants.MANAGEMENT_TRANSPARENCY)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component
|
||||||
|
struct applicationItem {
|
||||||
|
@State applicationItem: any[] = bundleInfosList // application info array
|
||||||
|
@State oldApplicationItem: any[] = bundleInfosList // Original application information array
|
||||||
|
@State searchResult: boolean = true // search results
|
||||||
|
|
||||||
|
@Builder ListItemLayout(item, index) {
|
||||||
|
ListItem() {
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
|
||||||
|
Row() {
|
||||||
|
Image(item.iconId)
|
||||||
|
.customizeImage(Constants.APPLICATION_IMAGE_WIDTH, Constants.APPLICATION_IMAGE_HEIGHT)
|
||||||
|
.margin({ right: Constants.APPLICATION_IMAGE_MARGIN_RIGHT })
|
||||||
|
Text(item.labelId)
|
||||||
|
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||||
|
.fontWeight(FontWeight.Medium)
|
||||||
|
.fontColor($r('app.color.label_color'))
|
||||||
|
.flexGrow(Constants.FLEX_GROW)
|
||||||
|
Text(item.groupId.length + '项权限')
|
||||||
|
.fontSize(Constants.TEXT_SMAL_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.label_color_lighter'))
|
||||||
|
.margin({ right: Constants.APPLICATION_TEXT_MARGIN_RIGHT })
|
||||||
|
Image($r('app.media.rightarrow'))
|
||||||
|
.customizeImage(Constants.IMAGE_WIDTH, Constants.IMAGE_HEIGHT)
|
||||||
|
}
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.AUTHORITY_ROW_HEIGHT)
|
||||||
|
.constraintSize({ minHeight: Constants.AUTHORITY_CONSTRAINTSIZE_MINHEIGHT })
|
||||||
|
}
|
||||||
|
if (!index) {
|
||||||
|
Row() {
|
||||||
|
Flex() {
|
||||||
|
Column().width(Constants.APPLICATION_TEXT_DECORATION_MARGIN_LEFT)
|
||||||
|
Column()
|
||||||
|
.backgroundColor($r('app.color.text_decoration_color'))
|
||||||
|
.height(Constants.TEXT_DECORATION_HEIGHT)
|
||||||
|
.flexGrow(Constants.FLEX_GROW)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.onClick(() => {
|
||||||
|
router.push({
|
||||||
|
uri: 'pages/application-secondary',
|
||||||
|
params: { routerData: item }
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}.padding({
|
||||||
|
left: Constants.DEFAULT_PADDING_START,
|
||||||
|
right: Constants.DEFAULT_PADDING_END
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
textInput({
|
||||||
|
placeholder: textInput_placeholder,
|
||||||
|
applicationItem: $applicationItem,
|
||||||
|
oldApplicationItem: $oldApplicationItem,
|
||||||
|
searchResult: $searchResult
|
||||||
|
})
|
||||||
|
}.padding({
|
||||||
|
left: Constants.APPLICATION_TEXTINPUT_PADDING_LEFT,
|
||||||
|
top: Constants.APPLICATION_TEXTINPUT_PADDING_TOP,
|
||||||
|
right: Constants.APPLICATION_TEXTINPUT_PADDING_RIGHT
|
||||||
|
})
|
||||||
|
Row() {
|
||||||
|
Flex({ alignItems: ItemAlign.Start }) {
|
||||||
|
Column() {
|
||||||
|
Column() {
|
||||||
|
if (!this.applicationItem.length) {
|
||||||
|
Row() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||||
|
Image($r('app.media.searchnoresult'))
|
||||||
|
.customizeImage(Constants.SEARCHNORESULT_IMAGE_WIDTH, Constants.SEARCHNORESULT_IMAGE_HEIGHT)
|
||||||
|
}
|
||||||
|
}.margin({ top: Constants.MANAGEMENT_ROW_MARGIN_TOP })
|
||||||
|
.padding({ left: Constants.MANAGEMENT_ROW_PADDING_LEFT })
|
||||||
|
} else {
|
||||||
|
Row() {
|
||||||
|
Scroll() {
|
||||||
|
List() {
|
||||||
|
ForEach(this.applicationItem.slice(Constants.SLICE_START, this.applicationItem.length - 1),
|
||||||
|
(item) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_START_INDEX)
|
||||||
|
}, item => item.toString())
|
||||||
|
ForEach(this.applicationItem.slice(Constants.SLICE_END), (item, index) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_END_INDEX)
|
||||||
|
}, item => item.toString())
|
||||||
|
}.backgroundColor($r('app.color.default_background_color'))
|
||||||
|
.borderRadius(Constants.BORDER_RADIUS)
|
||||||
|
.padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM })
|
||||||
|
}.scrollBar(BarState.Off)
|
||||||
|
}.margin({ left: Constants.MANAGEMENT_ROW_PADDING_LEFT })
|
||||||
|
.borderRadius(Constants.BORDER_RADIUS)
|
||||||
|
.clip(true)
|
||||||
|
}
|
||||||
|
}.backgroundColor($r('app.color.background_color'))
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
}.margin({ top: Constants.MANAGEMENT_ROW_MARGIN_TOP, bottom: Constants.APPLICATION_LIST_MARGIN_BOTTOM })
|
||||||
|
Column() {
|
||||||
|
alphabetIndexerComponent({ applicationItem: $applicationItem, oldApplicationItem: $oldApplicationItem })
|
||||||
|
}.margin({ top: Constants.APPLICATION_ALPHABETINDEX_MARGIN_TOP })
|
||||||
|
.width(Constants.APPLICATION_ALPHABETINDEX_WIDTH)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
177
permissionmanager/src/main/ets/pages/authority-secondary.ets
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { backBar } from "../common/components/backBar";
|
||||||
|
import { permissionGroups, groups } from "../common/model/permissionGroup";
|
||||||
|
import router from '@system.router';
|
||||||
|
import Constants from '../common/utils/constant';
|
||||||
|
|
||||||
|
var TAG = 'PermissionManager_MainAbility:'
|
||||||
|
|
||||||
|
class CalendarObj {
|
||||||
|
permissionName: string
|
||||||
|
groupName: string
|
||||||
|
description: string
|
||||||
|
label: string
|
||||||
|
index: number
|
||||||
|
constructor(permissionName: string, groupName: string, description: string, label: string, index: number) {
|
||||||
|
this.permissionName = permissionName
|
||||||
|
this.groupName = groupName
|
||||||
|
this.description = description
|
||||||
|
this.label = label
|
||||||
|
this.index = index
|
||||||
|
}
|
||||||
|
} // Permission management secondary interface data class
|
||||||
|
|
||||||
|
@Entry
|
||||||
|
@Component
|
||||||
|
struct appNamePage {
|
||||||
|
private backTitle = router.getParams().backTitle; // return title name
|
||||||
|
|
||||||
|
build() {
|
||||||
|
GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) {
|
||||||
|
Row() {
|
||||||
|
Row()
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.LEFT_XS_SPAN, offset: Constants.LEFT_XS_OFFSET },
|
||||||
|
sm: { span: Constants.LEFT_SM_SPAN, offset: Constants.LEFT_SM_OFFSET },
|
||||||
|
md: { span: Constants.LEFT_MD_SPAN, offset: Constants.LEFT_MD_OFFSET },
|
||||||
|
lg: { span: Constants.LEFT_LG_SPAN, offset: Constants.LEFT_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
backBar({ title: JSON.stringify(this.backTitle), recordable: false })
|
||||||
|
}
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Scroll() {
|
||||||
|
appNameItem()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.layoutWeight(Constants.LAYOUT_WEIGHT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.MIDDLE_XS_SPAN, offset: Constants.MIDDLE_XS_OFFSET },
|
||||||
|
sm: { span: Constants.MIDDLE_SM_SPAN, offset: Constants.MIDDLE_SM_OFFSET },
|
||||||
|
md: { span: Constants.MIDDLE_MD_SPAN, offset: Constants.MIDDLE_MD_OFFSET },
|
||||||
|
lg: { span: Constants.MIDDLE_LG_SPAN, offset: Constants.MIDDLE_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
Row()
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.RIGHT_XS_SPAN, offset: Constants.RIGHT_XS_OFFSET },
|
||||||
|
sm: { span: Constants.RIGHT_SM_SPAN, offset: Constants.RIGHT_SM_OFFSET },
|
||||||
|
md: { span: Constants.RIGHT_MD_SPAN, offset: Constants.RIGHT_MD_OFFSET },
|
||||||
|
lg: { span: Constants.RIGHT_LG_SPAN, offset: Constants.RIGHT_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
}
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.backgroundColor($r("sys.color.ohos_id_color_sub_background"))
|
||||||
|
.opacity(Constants.MANAGEMENT_TRANSPARENCY)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component
|
||||||
|
struct appNameItem {
|
||||||
|
@State calendarListItem: CalendarObj[] = []; // Permission management secondary interface data array
|
||||||
|
private routerData = router.getParams().routerData; // Routing jump data
|
||||||
|
private backTitle = router.getParams().backTitle; // return title name
|
||||||
|
private allPermissionApplications = router.getParams().allPermissionApplications; // Array of all app permission names
|
||||||
|
|
||||||
|
@Builder ListItemLayout(item, index) {
|
||||||
|
ListItem() {
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
|
||||||
|
Row() {
|
||||||
|
Text(item.label)
|
||||||
|
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.label_color'))
|
||||||
|
.fontWeight(FontWeight.Medium)
|
||||||
|
.flexGrow(Constants.FLEX_GROW)
|
||||||
|
Image($r('app.media.rightarrow'))
|
||||||
|
.objectFit(ImageFit.Contain)
|
||||||
|
.height(Constants.IMAGE_HEIGHT)
|
||||||
|
.width(Constants.IMAGE_WIDTH)
|
||||||
|
}
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.LISTITEM_ROW_HEIGHT)
|
||||||
|
}
|
||||||
|
if (!index) {
|
||||||
|
Row() {
|
||||||
|
Column()
|
||||||
|
.backgroundColor($r('app.color.text_decoration_color'))
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.TEXT_DECORATION_HEIGHT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.onClick(() => {
|
||||||
|
var dataList = this.routerData.filter((ele) => {
|
||||||
|
return ele.groupName === item.groupName;
|
||||||
|
})
|
||||||
|
router.push({
|
||||||
|
uri: 'pages/authority-tertiary',
|
||||||
|
params: { routerData: [dataList[item.index]], backTitle: item.label }
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}.padding({ left: Constants.DEFAULT_PADDING_START, right: Constants.DEFAULT_PADDING_END })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lifecycle function, executed when the page is initialized
|
||||||
|
*/
|
||||||
|
aboutToAppear() {
|
||||||
|
var permissionsList = groups.filter((item) => {
|
||||||
|
return item.groupName === this.backTitle
|
||||||
|
})
|
||||||
|
for (let i = 0; i < permissionsList[0].permissions.length; i++) {
|
||||||
|
permissionGroups.forEach((item) => {
|
||||||
|
if (item.permissionName === permissionsList[0].permissions[i]) {
|
||||||
|
this.calendarListItem.push(
|
||||||
|
new CalendarObj(item.permissionName, item.groupName, item.description, item.label, i)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
List() {
|
||||||
|
ForEach(this.calendarListItem.slice(Constants.SLICE_START, this.calendarListItem.length - 1), (item) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_START_INDEX)
|
||||||
|
}, item => item.toString())
|
||||||
|
ForEach(this.calendarListItem.slice(Constants.SLICE_END), (item, index) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_END_INDEX)
|
||||||
|
}, item => item.toString())
|
||||||
|
}.backgroundColor($r('app.color.default_background_color')).borderRadius(Constants.BORDER_RADIUS)
|
||||||
|
.padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM })
|
||||||
|
}.margin({ top: Constants.ROW_MARGIN_TOP })
|
||||||
|
.padding({ left: Constants.LIST_PADDING_LEFT, right: Constants.LISTITEM_PADDING_RIGHT })
|
||||||
|
}
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,403 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { backBar } from "../common/components/backBar";
|
||||||
|
import { alphabetIndexerComponent } from "../common/components/alphabeticalIndex";
|
||||||
|
import { textInput } from "../common/components/search";
|
||||||
|
import router from '@system.router';
|
||||||
|
import bundle from "@ohos.bundle";
|
||||||
|
import Resmgr from '@ohos.resourceManager';
|
||||||
|
import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
|
||||||
|
import { getAppLabel, getAppIcon, verifyAccessToken} from "../common/utils/utils";
|
||||||
|
import { makePy } from "../common/utils/utils";
|
||||||
|
import { authorizeDialog } from "../common/components/dialog";
|
||||||
|
import Constants from '../common/utils/constant';
|
||||||
|
|
||||||
|
var TAG = 'PermissionManager_MainAbility:'
|
||||||
|
|
||||||
|
@Extend(Image) function customizeImage(width: number, height: number) {
|
||||||
|
.objectFit(ImageFit.Contain)
|
||||||
|
.width(width)
|
||||||
|
.height(height)
|
||||||
|
}
|
||||||
|
|
||||||
|
let routerData = router.getParams().routerData; // Routing jump data
|
||||||
|
let backTitle = router.getParams().backTitle; // return title name
|
||||||
|
let nowGrantResult = Constants.PERMISSION_NUM; // Authorization results now
|
||||||
|
let nowRevokeResult = Constants.PERMISSION_NUM; // Now deauthorize results
|
||||||
|
let GrantResultFlag = []; // Authorization result Flag
|
||||||
|
let RevokeResultFlag = []; // Cancel authorization result Flag
|
||||||
|
|
||||||
|
class ApplicationObj {
|
||||||
|
labelId: string
|
||||||
|
iconId: string
|
||||||
|
index: number
|
||||||
|
accessTokenId: number
|
||||||
|
permission: string
|
||||||
|
alphabeticalIndex: string
|
||||||
|
constructor(
|
||||||
|
labelId: string,
|
||||||
|
iconId: string,
|
||||||
|
index: number,
|
||||||
|
accessTokenId: number,
|
||||||
|
permission: string,
|
||||||
|
alphabeticalIndex: string) {
|
||||||
|
this.labelId = labelId
|
||||||
|
this.iconId = iconId
|
||||||
|
this.index = index
|
||||||
|
this.accessTokenId = accessTokenId
|
||||||
|
this.permission = permission
|
||||||
|
this.alphabeticalIndex = alphabeticalIndex
|
||||||
|
}
|
||||||
|
} // application information
|
||||||
|
|
||||||
|
@Entry
|
||||||
|
@Component
|
||||||
|
struct locationInfoPage {
|
||||||
|
build() {
|
||||||
|
GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) {
|
||||||
|
Row() {
|
||||||
|
Row()
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.LEFT_XS_SPAN, offset: Constants.LEFT_XS_OFFSET },
|
||||||
|
sm: { span: Constants.LEFT_SM_SPAN, offset: Constants.LEFT_SM_OFFSET },
|
||||||
|
md: { span: Constants.LEFT_MD_SPAN, offset: Constants.LEFT_MD_OFFSET },
|
||||||
|
lg: { span: Constants.LEFT_LG_SPAN, offset: Constants.LEFT_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
backBar({ title: JSON.stringify(backTitle), recordable: false })
|
||||||
|
}
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
applicationItem()
|
||||||
|
|
||||||
|
}.width(Constants.FULL_WIDTH)
|
||||||
|
}
|
||||||
|
.layoutWeight(Constants.LAYOUT_WEIGHT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.MIDDLE_XS_SPAN, offset: Constants.MIDDLE_XS_OFFSET },
|
||||||
|
sm: { span: Constants.MIDDLE_SM_SPAN, offset: Constants.MIDDLE_SM_OFFSET },
|
||||||
|
md: { span: Constants.MIDDLE_MD_SPAN, offset: Constants.MIDDLE_MD_OFFSET },
|
||||||
|
lg: { span: Constants.MIDDLE_LG_SPAN, offset: Constants.MIDDLE_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
Row()
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.RIGHT_XS_SPAN, offset: Constants.RIGHT_XS_OFFSET },
|
||||||
|
sm: { span: Constants.RIGHT_SM_SPAN, offset: Constants.RIGHT_SM_OFFSET },
|
||||||
|
md: { span: Constants.RIGHT_MD_SPAN, offset: Constants.RIGHT_MD_OFFSET },
|
||||||
|
lg: { span: Constants.RIGHT_LG_SPAN, offset: Constants.RIGHT_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
}
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.backgroundColor($r("sys.color.ohos_id_color_sub_background"))
|
||||||
|
.opacity(Constants.MANAGEMENT_TRANSPARENCY)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component
|
||||||
|
struct applicationItem {
|
||||||
|
@State permissionNum: number = Constants.PERMISSION_NUM; // permission num
|
||||||
|
@State toggleIsOn: object = {}; // toggle switch state array
|
||||||
|
@State applicationList: ApplicationObj[] = []; // application info array
|
||||||
|
@State oldApplicationItem: ApplicationObj[] = []; // Original application information array
|
||||||
|
@State searchResult: boolean = true; // search results
|
||||||
|
@State placeholder: string = ''
|
||||||
|
|
||||||
|
authorizeDialogController: CustomDialogController = new CustomDialogController({
|
||||||
|
builder: authorizeDialog({ }),
|
||||||
|
autoCancel: true,
|
||||||
|
alignment: DialogAlignment.Center
|
||||||
|
});
|
||||||
|
|
||||||
|
@Builder ListItemLayout(item, index) {
|
||||||
|
ListItem() {
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
|
||||||
|
Row() {
|
||||||
|
Image(item.iconId)
|
||||||
|
.customizeImage(Constants.AUTHORITY_IMAGE_WIDTH, Constants.AUTHORITY_IMAGE_HEIGHT)
|
||||||
|
.margin({ right: Constants.AUTHORITY_IMAGE_MARGIN_RIGHT })
|
||||||
|
Text(item.labelId)
|
||||||
|
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.text_color'))
|
||||||
|
.flexGrow(Constants.FLEX_GROW)
|
||||||
|
Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn[item.index] })
|
||||||
|
.selectedColor($r('app.color.toggle_color'))
|
||||||
|
.width(Constants.AUTHORITY_TOGGLE_WIDTH)
|
||||||
|
.height(Constants.AUTHORITY_TOGGLE_HEIGHT)
|
||||||
|
.onChange((isOn: boolean) => {
|
||||||
|
if (item.accessTokenId === '' || item.permission === '') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let _this = this;
|
||||||
|
if (isOn) {
|
||||||
|
let promises = routerData.map(it => new Promise((resolve, reject) => {
|
||||||
|
_this.grantUserGrantedPermission(item.accessTokenId, it.permission, item.index, resolve);
|
||||||
|
}));
|
||||||
|
Promise.all(promises).then(function(results) {
|
||||||
|
if(results.indexOf(-1) != -1) {
|
||||||
|
_this.authorizeDialogController.open();
|
||||||
|
_this.toggleIsOn[item.index] = false;
|
||||||
|
setTimeout(()=> {
|
||||||
|
_this.authorizeDialogController.close();
|
||||||
|
}, Constants.DELAY_TIME)
|
||||||
|
} else {
|
||||||
|
_this.toggleIsOn[item.index] = true;
|
||||||
|
}
|
||||||
|
let num = Constants.PERMISSION_NUM;
|
||||||
|
for(let key in _this.toggleIsOn){
|
||||||
|
if(_this.toggleIsOn[key]){
|
||||||
|
num++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_this.permissionNum = num;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
let promises = routerData.map(it => new Promise((resolve, reject) => {
|
||||||
|
_this.revokeUserGrantedPermission(item.accessTokenId, it.permission, item.index, resolve);
|
||||||
|
}));
|
||||||
|
Promise.all(promises).then(function(results) {
|
||||||
|
if(results.indexOf(-1) != -1) {
|
||||||
|
_this.authorizeDialogController.open();
|
||||||
|
_this.toggleIsOn[item.index] = true;
|
||||||
|
setTimeout(()=> {
|
||||||
|
_this.authorizeDialogController.close();
|
||||||
|
}, Constants.DELAY_TIME)
|
||||||
|
} else {
|
||||||
|
_this.toggleIsOn[item.index] = false;
|
||||||
|
}
|
||||||
|
let num = Constants.PERMISSION_NUM;
|
||||||
|
for(let key in _this.toggleIsOn){
|
||||||
|
if(_this.toggleIsOn[key]){
|
||||||
|
num++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_this.permissionNum = num;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.AUTHORITY_ROW_HEIGHT)
|
||||||
|
.constraintSize({ minHeight: Constants.AUTHORITY_CONSTRAINTSIZE_MINHEIGHT })
|
||||||
|
}
|
||||||
|
if (!index) {
|
||||||
|
Row() {
|
||||||
|
Flex() {
|
||||||
|
Column().width(Constants.APPLICATION_TEXT_DECORATION_MARGIN_LEFT)
|
||||||
|
Column()
|
||||||
|
.backgroundColor($r('app.color.text_decoration_color'))
|
||||||
|
.height(Constants.TEXT_DECORATION_HEIGHT)
|
||||||
|
.flexGrow(Constants.FLEX_GROW)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.onClick(() => {
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}.padding({ left: Constants.DEFAULT_PADDING_START, right: Constants.DEFAULT_PADDING_END })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Grant permissions to the app
|
||||||
|
* @param {Number} accessTokenId
|
||||||
|
* @param {String} permission permission name
|
||||||
|
* @param {Number} index Array index to modify permission status
|
||||||
|
*/
|
||||||
|
grantUserGrantedPermission(accessTokenId, permission, index, resolve) {
|
||||||
|
abilityAccessCtrl.createAtManager().grantUserGrantedPermission(
|
||||||
|
accessTokenId, permission, Constants.PERMISSION_FLAG).then(result => {
|
||||||
|
// result: 0 Authorization succeeded; result: -1 Authorization failed
|
||||||
|
resolve(result);
|
||||||
|
}).catch(error => {
|
||||||
|
resolve(-1);
|
||||||
|
console.error(TAG + 'abilityAccessCtrl.createAtManager.grantUserGrantedPermission failed. Cause: ' + JSON.stringify(error));
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deauthorize the app
|
||||||
|
* @param {Number} accessTokenId
|
||||||
|
* @param {String} permission permission name
|
||||||
|
* @param {Number} index Array index to modify permission status
|
||||||
|
*/
|
||||||
|
revokeUserGrantedPermission(accessTokenId, permission, index, resolve) {
|
||||||
|
abilityAccessCtrl.createAtManager().revokeUserGrantedPermission(
|
||||||
|
accessTokenId, permission, Constants.PERMISSION_FLAG).then(result => {
|
||||||
|
// result: 0 successfully cancel the authorization; result: -1 cancel the authorization failed
|
||||||
|
resolve(result);
|
||||||
|
}).catch(error => {
|
||||||
|
resolve(-1);
|
||||||
|
console.error(TAG + 'abilityAccessCtrl.createAtManager.revokeUserGrantedPermission failed. Cause: ' + JSON.stringify(error));
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lifecycle function, executed when the page is initialized
|
||||||
|
*/
|
||||||
|
aboutToAppear() {
|
||||||
|
var bundleNames = []
|
||||||
|
routerData.forEach(permissionmanager => {
|
||||||
|
permissionmanager.bundleNames.forEach( bundleName => {
|
||||||
|
if (bundleNames.indexOf(bundleName) == -1) {
|
||||||
|
bundleNames.push(bundleName)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
Resmgr.getResourceManager(globalThis.context, Constants.BUNDLE_NAME).then(item => {
|
||||||
|
item.getString($r("app.string.textInput_placeholder").id, (err, val) => {
|
||||||
|
this.placeholder = val
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// initial then fill values when sync return which may cause sync panic
|
||||||
|
for (let i = 0; i < bundleNames.length; i++) {
|
||||||
|
this.applicationList.push(
|
||||||
|
new ApplicationObj('', '', i, 0, '', ''));
|
||||||
|
this.oldApplicationItem.push(
|
||||||
|
new ApplicationObj('', '', i, 0, '', ''));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 0; i < bundleNames.length; i++) {
|
||||||
|
// Get BundleInfo based on bundle name
|
||||||
|
bundle.getBundleInfo(bundleNames[i], Constants.PARMETER_BUNDLE_FLAG).then(res => {
|
||||||
|
Promise.all([getAppLabel(res.appInfo.labelId, res.name),
|
||||||
|
getAppIcon(res.appInfo.iconId, res.name)
|
||||||
|
])
|
||||||
|
.then((values) => {
|
||||||
|
this.applicationList[i] = (
|
||||||
|
new ApplicationObj(
|
||||||
|
String(values[0]),
|
||||||
|
String(values[1]),
|
||||||
|
i,
|
||||||
|
res.appInfo.accessTokenId,
|
||||||
|
routerData[0].permission,
|
||||||
|
makePy(values[0])[0].slice(0, 1)) // Get the first letter in the returned initials array
|
||||||
|
);
|
||||||
|
this.oldApplicationItem[i] = (
|
||||||
|
new ApplicationObj(
|
||||||
|
String(values[0]),
|
||||||
|
String(values[1]),
|
||||||
|
i,
|
||||||
|
res.appInfo.accessTokenId,
|
||||||
|
routerData[0].permission,
|
||||||
|
makePy(values[0])[0].slice(0, 1)) // Get the first letter in the returned initials array
|
||||||
|
);
|
||||||
|
});
|
||||||
|
// 0: have permission; -1: no permission
|
||||||
|
var boole = true;
|
||||||
|
this.permissionNum++;
|
||||||
|
for (let j = 0; j < routerData.length; j++) {
|
||||||
|
if (res.reqPermissions.indexOf(routerData[j].permission) == -1) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
verifyAccessToken(res.appInfo.accessTokenId, routerData[j].permission).then((access) => {
|
||||||
|
if (Number(access) === Constants.PERMISSION_INDEX) {
|
||||||
|
if(boole){
|
||||||
|
this.toggleIsOn[i] = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(boole){
|
||||||
|
this.permissionNum--
|
||||||
|
}
|
||||||
|
boole = false;
|
||||||
|
this.toggleIsOn[i] = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
console.log(TAG + bundleNames[i] + "getBundleInfo failed, cause: " + JSON.stringify(error));
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
textInput({
|
||||||
|
placeholder: this.placeholder,
|
||||||
|
applicationItem: $applicationList,
|
||||||
|
oldApplicationItem: $oldApplicationItem,
|
||||||
|
searchResult: $searchResult
|
||||||
|
})
|
||||||
|
}.padding({
|
||||||
|
left: Constants.AUTHORITY_TEXTINPUT_PADDING_LEFT,
|
||||||
|
right: Constants.AUTHORITY_TEXTINPUT_PADDING_RIGHT
|
||||||
|
})
|
||||||
|
Row() {
|
||||||
|
Flex({ alignItems:ItemAlign.Start, justifyContent: FlexAlign.Start }) {
|
||||||
|
Column() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start }) {
|
||||||
|
Text(this.permissionNum + '个应用获取此权限')
|
||||||
|
.fontSize(Constants.TEXT_SMAL_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.secondary_font_color'))
|
||||||
|
.margin({ top: Constants.AUTHORITY_TEXT_MARGIN_TOP, left: Constants.AUTHORITY_TEXT_MARGIN_LEFT })
|
||||||
|
}
|
||||||
|
Scroll() {
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
if (!this.applicationList.length) {
|
||||||
|
if (this.searchResult) {
|
||||||
|
Row() {
|
||||||
|
}.margin({ top: Constants.AUTHORITY_ROW_MARGIN_TOP })
|
||||||
|
} else {
|
||||||
|
Row() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||||
|
Image($r('app.media.searchnoresult'))
|
||||||
|
.customizeImage(Constants.SEARCHNORESULT_IMAGE_WIDTH, Constants.SEARCHNORESULT_IMAGE_HEIGHT)
|
||||||
|
}
|
||||||
|
}.margin({ top: Constants.AUTHORITY_ROW_MARGIN_TOP })
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Row() {
|
||||||
|
List() {
|
||||||
|
ForEach(this.applicationList.slice(Constants.SLICE_START, this.applicationList.length - 1),
|
||||||
|
(item) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_START_INDEX)
|
||||||
|
}, item => item.toString())
|
||||||
|
ForEach(this.applicationList.slice(Constants.SLICE_END), (item, index) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_END_INDEX)
|
||||||
|
}, item => item.toString())
|
||||||
|
}
|
||||||
|
.backgroundColor($r('app.color.default_background_color'))
|
||||||
|
.borderRadius(Constants.BORDER_RADIUS)
|
||||||
|
.padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM })
|
||||||
|
}.margin({ top: Constants.AUTHORITY_ROW_MARGIN_TOP })
|
||||||
|
}
|
||||||
|
}.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.AUTHORITY_COLUMN_HEIGHT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.padding({ left: Constants.AUTHORITY_LISTITEM_PADDING_LEFT })
|
||||||
|
Column() {
|
||||||
|
alphabetIndexerComponent({ applicationItem: $applicationList, oldApplicationItem: $oldApplicationItem })
|
||||||
|
}.width(Constants.AUTHORITY_ALPHABETINDEX_WIDTH)
|
||||||
|
.padding({ top: Constants.AUTHORITY_ALPHABETINDEX_PADDING_TOP })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
363
permissionmanager/src/main/ets/pages/authority-tertiary.ets
Normal file
@ -0,0 +1,363 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { backBar } from "../common/components/backBar";
|
||||||
|
import { alphabetIndexerComponent } from "../common/components/alphabeticalIndex";
|
||||||
|
import { textInput } from "../common/components/search";
|
||||||
|
import router from '@system.router';
|
||||||
|
import bundle from "@ohos.bundle";
|
||||||
|
import Resmgr from '@ohos.resourceManager';
|
||||||
|
import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
|
||||||
|
import { getAppLabel, getAppIcon, verifyAccessToken } from "../common/utils/utils";
|
||||||
|
import { makePy } from "../common/utils/utils";
|
||||||
|
import { authorizeDialog } from "../common/components/dialog";
|
||||||
|
import Constants from '../common/utils/constant';
|
||||||
|
|
||||||
|
var TAG = 'PermissionManager_MainAbility:'
|
||||||
|
|
||||||
|
@Extend(Image) function customizeImage(width: number, height: number) {
|
||||||
|
.objectFit(ImageFit.Contain)
|
||||||
|
.width(width)
|
||||||
|
.height(height)
|
||||||
|
}
|
||||||
|
|
||||||
|
let routerData = router.getParams().routerData; // Routing jump data
|
||||||
|
let backTitle = router.getParams().backTitle; // return title name
|
||||||
|
class ApplicationObj {
|
||||||
|
labelId: string
|
||||||
|
iconId: string
|
||||||
|
index: number
|
||||||
|
accessTokenId: number
|
||||||
|
permission: string
|
||||||
|
alphabeticalIndex: string
|
||||||
|
constructor(
|
||||||
|
labelId: string,
|
||||||
|
iconId: string,
|
||||||
|
index: number,
|
||||||
|
accessTokenId: number,
|
||||||
|
permission: string,
|
||||||
|
alphabeticalIndex: string) {
|
||||||
|
this.labelId = labelId
|
||||||
|
this.iconId = iconId
|
||||||
|
this.index = index
|
||||||
|
this.accessTokenId = accessTokenId
|
||||||
|
this.permission = permission
|
||||||
|
this.alphabeticalIndex = alphabeticalIndex
|
||||||
|
}
|
||||||
|
} // application information
|
||||||
|
|
||||||
|
@Entry
|
||||||
|
@Component
|
||||||
|
struct locationInfoPage {
|
||||||
|
build() {
|
||||||
|
GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) {
|
||||||
|
Row() {
|
||||||
|
Row()
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.LEFT_XS_SPAN, offset: Constants.LEFT_XS_OFFSET },
|
||||||
|
sm: { span: Constants.LEFT_SM_SPAN, offset: Constants.LEFT_SM_OFFSET },
|
||||||
|
md: { span: Constants.LEFT_MD_SPAN, offset: Constants.LEFT_MD_OFFSET },
|
||||||
|
lg: { span: Constants.LEFT_LG_SPAN, offset: Constants.LEFT_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
backBar({ title: JSON.stringify(backTitle), recordable: false })
|
||||||
|
}
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
applicationItem()
|
||||||
|
|
||||||
|
}.width(Constants.FULL_WIDTH)
|
||||||
|
}
|
||||||
|
.layoutWeight(Constants.LAYOUT_WEIGHT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.MIDDLE_XS_SPAN, offset: Constants.MIDDLE_XS_OFFSET },
|
||||||
|
sm: { span: Constants.MIDDLE_SM_SPAN, offset: Constants.MIDDLE_SM_OFFSET },
|
||||||
|
md: { span: Constants.MIDDLE_MD_SPAN, offset: Constants.MIDDLE_MD_OFFSET },
|
||||||
|
lg: { span: Constants.MIDDLE_LG_SPAN, offset: Constants.MIDDLE_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
Row()
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.RIGHT_XS_SPAN, offset: Constants.RIGHT_XS_OFFSET },
|
||||||
|
sm: { span: Constants.RIGHT_SM_SPAN, offset: Constants.RIGHT_SM_OFFSET },
|
||||||
|
md: { span: Constants.RIGHT_MD_SPAN, offset: Constants.RIGHT_MD_OFFSET },
|
||||||
|
lg: { span: Constants.RIGHT_LG_SPAN, offset: Constants.RIGHT_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
}
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.backgroundColor($r("sys.color.ohos_id_color_sub_background"))
|
||||||
|
.opacity(Constants.MANAGEMENT_TRANSPARENCY)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component
|
||||||
|
struct applicationItem {
|
||||||
|
@State permissionNum: number = Constants.PERMISSION_NUM; // permission num
|
||||||
|
@State toggleIsOn: object = {}; // toggle switch state array
|
||||||
|
@State applicationList: ApplicationObj[] = []; // application info array
|
||||||
|
@State oldApplicationItem: ApplicationObj[] = []; // Original application information array
|
||||||
|
@State searchResult: boolean = true; // search results
|
||||||
|
@State placeholder: string = ''
|
||||||
|
|
||||||
|
authorizeDialogController: CustomDialogController = new CustomDialogController({
|
||||||
|
builder: authorizeDialog({ }),
|
||||||
|
autoCancel: true,
|
||||||
|
alignment: DialogAlignment.Center
|
||||||
|
});
|
||||||
|
|
||||||
|
@Builder ListItemLayout(item, index) {
|
||||||
|
ListItem() {
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
|
||||||
|
Row() {
|
||||||
|
Image(item.iconId)
|
||||||
|
.customizeImage(Constants.AUTHORITY_IMAGE_WIDTH, Constants.AUTHORITY_IMAGE_HEIGHT)
|
||||||
|
.margin({ right: Constants.AUTHORITY_IMAGE_MARGIN_RIGHT })
|
||||||
|
Text(item.labelId)
|
||||||
|
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||||
|
.fontWeight(FontWeight.Medium)
|
||||||
|
.fontColor($r('app.color.label_color'))
|
||||||
|
.flexGrow(Constants.FLEX_GROW)
|
||||||
|
Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn[item.index] })
|
||||||
|
.selectedColor($r('app.color.toggle_color'))
|
||||||
|
.width(Constants.AUTHORITY_TOGGLE_WIDTH)
|
||||||
|
.height(Constants.AUTHORITY_TOGGLE_HEIGHT)
|
||||||
|
.onChange((isOn: boolean) => {
|
||||||
|
if (item.accessTokenId === '' || item.permission === '') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (isOn) {
|
||||||
|
this.grantUserGrantedPermission(item.accessTokenId, item.permission, item.index);
|
||||||
|
} else {
|
||||||
|
this.revokeUserGrantedPermission(item.accessTokenId, item.permission, item.index);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.AUTHORITY_ROW_HEIGHT)
|
||||||
|
.constraintSize({ minHeight: Constants.AUTHORITY_CONSTRAINTSIZE_MINHEIGHT })
|
||||||
|
}
|
||||||
|
if (!index) {
|
||||||
|
Row() {
|
||||||
|
Flex() {
|
||||||
|
Column().width(Constants.APPLICATION_TEXT_DECORATION_MARGIN_LEFT)
|
||||||
|
Column()
|
||||||
|
.backgroundColor($r('app.color.text_decoration_color'))
|
||||||
|
.height(Constants.TEXT_DECORATION_HEIGHT)
|
||||||
|
.flexGrow(Constants.FLEX_GROW)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.onClick(() => {
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}.padding({ left: Constants.DEFAULT_PADDING_START, right: Constants.DEFAULT_PADDING_END })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Grant permissions to the app
|
||||||
|
* @param {Number} accessTokenId
|
||||||
|
* @param {String} permission permission name
|
||||||
|
* @param {Number} index Array index to modify permission status
|
||||||
|
*/
|
||||||
|
grantUserGrantedPermission(accessTokenId, permission, index) {
|
||||||
|
abilityAccessCtrl.createAtManager().grantUserGrantedPermission(
|
||||||
|
accessTokenId, permission, Constants.PERMISSION_FLAG).then(result => {
|
||||||
|
// result: 0 Authorization succeeded; result: -1 Authorization failed
|
||||||
|
if (result !== Constants.PERMISSION_INDEX) {
|
||||||
|
this.authorizeDialogController.open();
|
||||||
|
this.toggleIsOn[index] = false;
|
||||||
|
setTimeout(()=> {
|
||||||
|
this.authorizeDialogController.close();
|
||||||
|
}, Constants.DELAY_TIME)
|
||||||
|
} else {
|
||||||
|
this.toggleIsOn[index] = true;
|
||||||
|
}
|
||||||
|
let num = Constants.PERMISSION_NUM;
|
||||||
|
for(let key in this.toggleIsOn){
|
||||||
|
if(this.toggleIsOn[key]){
|
||||||
|
num++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.permissionNum = num;
|
||||||
|
}).catch(error => {
|
||||||
|
console.error(TAG + 'abilityAccessCtrl.createAtManager.grantUserGrantedPermission failed. Cause: ' + JSON.stringify(error));
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deauthorize the app
|
||||||
|
* @param {Number} accessTokenId
|
||||||
|
* @param {String} permission permission name
|
||||||
|
* @param {Number} index Array index to modify permission status
|
||||||
|
*/
|
||||||
|
revokeUserGrantedPermission(accessTokenId, permission, index) {
|
||||||
|
abilityAccessCtrl.createAtManager().revokeUserGrantedPermission(
|
||||||
|
accessTokenId, permission, Constants.PERMISSION_FLAG).then(result => {
|
||||||
|
// result: 0 successfully cancel the authorization; result: -1 cancel the authorization failed
|
||||||
|
if (result !== Constants.PERMISSION_INDEX) {
|
||||||
|
this.authorizeDialogController.open();
|
||||||
|
this.toggleIsOn[index] = true;
|
||||||
|
setTimeout(()=> {
|
||||||
|
this.authorizeDialogController.close();
|
||||||
|
}, Constants.DELAY_TIME)
|
||||||
|
} else {
|
||||||
|
this.toggleIsOn[index] = false;
|
||||||
|
}
|
||||||
|
let num = Constants.PERMISSION_NUM;
|
||||||
|
for(let key in this.toggleIsOn){
|
||||||
|
if(this.toggleIsOn[key]){
|
||||||
|
num++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.permissionNum = num;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lifecycle function, executed when the page is initialized
|
||||||
|
*/
|
||||||
|
aboutToAppear() {
|
||||||
|
let bundleNames = routerData[0].bundleNames;
|
||||||
|
|
||||||
|
Resmgr.getResourceManager(globalThis.context, Constants.BUNDLE_NAME).then(item => {
|
||||||
|
item.getString($r("app.string.textInput_placeholder").id, (err, val) => {
|
||||||
|
this.placeholder = val
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// initial then fill values when sync return which may cause sync panic
|
||||||
|
for (let i = 0; i < bundleNames.length; i++) {
|
||||||
|
this.applicationList.push(
|
||||||
|
new ApplicationObj('', '', i, 0, '', ''));
|
||||||
|
this.oldApplicationItem.push(
|
||||||
|
new ApplicationObj('', '', i, 0, '', ''));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 0; i < bundleNames.length; i++) {
|
||||||
|
// Get BundleInfo based on bundle name
|
||||||
|
bundle.getBundleInfo(bundleNames[i], Constants.PARMETER_BUNDLE_FLAG).then(res => {
|
||||||
|
Promise.all([getAppLabel(res.appInfo.labelId, res.name),
|
||||||
|
getAppIcon(res.appInfo.iconId, res.name),
|
||||||
|
verifyAccessToken(res.appInfo.accessTokenId, routerData[0].permission)])
|
||||||
|
.then((values) => {
|
||||||
|
this.applicationList[i] = (
|
||||||
|
new ApplicationObj(
|
||||||
|
String(values[0]),
|
||||||
|
String(values[1]),
|
||||||
|
i,
|
||||||
|
res.appInfo.accessTokenId,
|
||||||
|
routerData[0].permission,
|
||||||
|
makePy(values[0])[0].slice(0, 1)) // Get the first letter in the returned initials array
|
||||||
|
);
|
||||||
|
this.oldApplicationItem[i] = (
|
||||||
|
new ApplicationObj(
|
||||||
|
String(values[0]),
|
||||||
|
String(values[1]),
|
||||||
|
i,
|
||||||
|
res.appInfo.accessTokenId,
|
||||||
|
routerData[0].permission,
|
||||||
|
makePy(values[0])[0].slice(0, 1)) // Get the first letter in the returned initials array
|
||||||
|
);
|
||||||
|
// 0: have permission; -1: no permission
|
||||||
|
if (values[2] === Constants.PERMISSION_INDEX) {
|
||||||
|
this.toggleIsOn[i] = true;
|
||||||
|
this.permissionNum++;
|
||||||
|
} else {
|
||||||
|
this.toggleIsOn[i] = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).catch(error => {
|
||||||
|
console.log(TAG + bundleNames[i] + "getBundleInfo failed, cause: " + JSON.stringify(error));
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
textInput({
|
||||||
|
placeholder: this.placeholder,
|
||||||
|
applicationItem: $applicationList,
|
||||||
|
oldApplicationItem: $oldApplicationItem,
|
||||||
|
searchResult: $searchResult
|
||||||
|
})
|
||||||
|
}.padding({
|
||||||
|
left: Constants.AUTHORITY_TEXTINPUT_PADDING_LEFT,
|
||||||
|
right: Constants.AUTHORITY_TEXTINPUT_PADDING_RIGHT
|
||||||
|
})
|
||||||
|
Row() {
|
||||||
|
Flex({ alignItems:ItemAlign.Start, justifyContent: FlexAlign.Start }) {
|
||||||
|
Column() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start }) {
|
||||||
|
Text(this.permissionNum + '个应用获取此权限')
|
||||||
|
.fontSize(Constants.TEXT_SMAL_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.secondary_font_color'))
|
||||||
|
.margin({ top: Constants.AUTHORITY_TEXT_MARGIN_TOP, left: Constants.AUTHORITY_TEXT_MARGIN_LEFT })
|
||||||
|
}
|
||||||
|
Scroll() {
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
if (!this.applicationList.length) {
|
||||||
|
if (this.searchResult) {
|
||||||
|
Row() {
|
||||||
|
}.margin({ top: Constants.AUTHORITY_ROW_MARGIN_TOP })
|
||||||
|
} else {
|
||||||
|
Row() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||||
|
Image($r('app.media.searchnoresult'))
|
||||||
|
.customizeImage(Constants.SEARCHNORESULT_IMAGE_WIDTH, Constants.SEARCHNORESULT_IMAGE_HEIGHT)
|
||||||
|
}
|
||||||
|
}.margin({ top: Constants.AUTHORITY_ROW_MARGIN_TOP })
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Row() {
|
||||||
|
List() {
|
||||||
|
ForEach(this.applicationList.slice(Constants.SLICE_START, this.applicationList.length - 1),
|
||||||
|
(item) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_START_INDEX)
|
||||||
|
}, item => item.toString())
|
||||||
|
ForEach(this.applicationList.slice(Constants.SLICE_END), (item, index) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_END_INDEX)
|
||||||
|
}, item => item.toString())
|
||||||
|
}
|
||||||
|
.backgroundColor($r('app.color.default_background_color'))
|
||||||
|
.borderRadius(Constants.BORDER_RADIUS)
|
||||||
|
.padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM })
|
||||||
|
}.margin({ top: Constants.AUTHORITY_ROW_MARGIN_TOP })
|
||||||
|
}
|
||||||
|
}.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.AUTHORITY_COLUMN_HEIGHT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.padding({ left: Constants.AUTHORITY_LISTITEM_PADDING_LEFT })
|
||||||
|
Column() {
|
||||||
|
alphabetIndexerComponent({ applicationItem: $applicationList, oldApplicationItem: $oldApplicationItem })
|
||||||
|
}.width(Constants.AUTHORITY_ALPHABETINDEX_WIDTH)
|
||||||
|
.padding({ top: Constants.AUTHORITY_ALPHABETINDEX_PADDING_TOP })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
344
permissionmanager/src/main/ets/pages/dialogPlus.ets
Normal file
@ -0,0 +1,344 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
|
||||||
|
import bundle from '@ohos.bundle';
|
||||||
|
import Resmgr from '@ohos.resourceManager'
|
||||||
|
import rpc from '@ohos.rpc';
|
||||||
|
import { Log, getPermissionGroup } from '../common/utils/utils'
|
||||||
|
import Constants from '../common/utils/constant'
|
||||||
|
import { BundleFlag } from '../common/model/bundle'
|
||||||
|
import { permissionGroups, showSubpermissionsGrop } from '../common/model/permissionGroup'
|
||||||
|
|
||||||
|
@Extend(Button) function customizeButton() {
|
||||||
|
.backgroundColor($r('app.color.default_background_color'))
|
||||||
|
.fontColor($r('app.color.button_color'))
|
||||||
|
.fontWeight(FontWeight.Medium)
|
||||||
|
.height(Constants.BUTTON_HEIGHT)
|
||||||
|
.width(Constants.BUTTON_WIDTH)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Entry
|
||||||
|
@Component
|
||||||
|
struct dialogPlusPage {
|
||||||
|
@State count: number = 0
|
||||||
|
@State result: Array<any> = []
|
||||||
|
@State accessTokenId: number = 0
|
||||||
|
@State initStatus: number = Constants.INIT_NEED_TO_WAIT
|
||||||
|
@State reqPerms: Array<string> = []
|
||||||
|
@State grantGroups: Array<any> = []
|
||||||
|
@State userFixedFlag: number = 2 // means user fixed
|
||||||
|
@State appName: string = ""
|
||||||
|
@State win: any = ""
|
||||||
|
@State proxy: any = ''
|
||||||
|
|
||||||
|
build() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||||
|
Column() {
|
||||||
|
if ((this.initStatus != Constants.INIT_NEED_TO_WAIT) && this.verify()) {
|
||||||
|
Image(this.grantGroups[this.count].icon)
|
||||||
|
.width(Constants.DIALOG_ICON_WIDTH)
|
||||||
|
.height(Constants.DIALOG_ICON_HEIGHT)
|
||||||
|
.fillColor($r("app.color.first_font_color"))
|
||||||
|
.margin({
|
||||||
|
top: Constants.DIALOG_ICON_MARGIN_TOP
|
||||||
|
})
|
||||||
|
Text(`${this.count + 1} / ${this.grantGroups.length}`)
|
||||||
|
.fontSize(Constants.DIALOG_LABEL_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.text_secondary_color'))
|
||||||
|
.lineHeight(Constants.DIALOG_LABEL_LINE_HEIGHT)
|
||||||
|
.margin({
|
||||||
|
top: Constants.DIALOG_LABEL_MARGIN_TOP
|
||||||
|
})
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start }) {
|
||||||
|
Text("是否允许" + this.appName +
|
||||||
|
this.grantGroups[this.count].label)
|
||||||
|
.fontSize(Constants.DIALOG_REQ_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.first_font_color'))
|
||||||
|
.fontWeight(FontWeight.Medium)
|
||||||
|
.fontSize(Constants.DIALOG_REQ_FONT_SIZE)
|
||||||
|
.lineHeight(Constants.DIALOG_REQ_LINE_HEIGHT)
|
||||||
|
.margin({
|
||||||
|
top: Constants.DIALOG_REQ_MARGIN_TOP,
|
||||||
|
left: Constants.DIALOG_REQ_MARGIN_LEFT
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start }) {
|
||||||
|
Text(this.grantGroups[this.count].description)
|
||||||
|
.fontSize(Constants.DIALOG_DESP_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.text_secondary_color'))
|
||||||
|
.fontSize(Constants.DIALOG_DESP_FONT_SIZE)
|
||||||
|
.lineHeight(Constants.DIALOG_DESP_LINE_HEIGHT)
|
||||||
|
.margin({
|
||||||
|
top: Constants.DIALOG_DESP_MARGIN_TOP,
|
||||||
|
left: Constants.DIALOG_DESP_MARGIN_LEFT,
|
||||||
|
right: Constants.DIALOG_DESP_MARGIN_RIGHT,
|
||||||
|
bottom: Constants.DIALOG_DESP_MARGIN_BOTTOM
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Row() {
|
||||||
|
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
|
||||||
|
Button('禁止')
|
||||||
|
.fontSize(Constants.BUTTON_FONT_SIZE)
|
||||||
|
.onClick(() => {
|
||||||
|
this.privacyCancel(this.grantGroups[this.count], this.accessTokenId, this.reqPerms, this.userFixedFlag)
|
||||||
|
}).customizeButton().margin({ left: Constants.BUTTON_MARGIN_LEFT })
|
||||||
|
Text('|').fontSize(Constants.BUTTON_DIVIDER_FONT_SIZE).fontColor($r('app.color.divider_color'))
|
||||||
|
Button('允许')
|
||||||
|
.fontSize(Constants.BUTTON_FONT_SIZE)
|
||||||
|
.onClick(() => {
|
||||||
|
this.privacyAccept(this.grantGroups[this.count], this.accessTokenId, this.reqPerms, this.userFixedFlag)
|
||||||
|
}).customizeButton().margin({ right: Constants.BUTTON_MARGIN_RIGHT })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.backgroundColor($r('app.color.default_background_color'))
|
||||||
|
.borderRadius(Constants.DIALOG_PRIVACY_BORDER_RADIUS)
|
||||||
|
.width(Constants.DIALOG_PRIVACY_WIDTH)
|
||||||
|
.padding({ bottom: Constants.DIALOG_PADDING_BOTTOM })
|
||||||
|
}.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
}
|
||||||
|
|
||||||
|
verify() {
|
||||||
|
if((this.initStatus == Constants.INIT_NEED_TO_TERMINATED) || (this.count >= this.grantGroups.length)) {
|
||||||
|
this.answerRequest()
|
||||||
|
this.initStatus = Constants.INIT_NEED_TO_WAIT
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
answerRequest() {
|
||||||
|
var ret: number = Constants.RESULT_SUCCESS
|
||||||
|
if (this.initStatus == Constants.INIT_NEED_TO_TERMINATED) {
|
||||||
|
ret = Constants.RESULT_FAILURE
|
||||||
|
}
|
||||||
|
this.answer(ret, this.reqPerms)
|
||||||
|
}
|
||||||
|
|
||||||
|
answer(ret, reqPerms) {
|
||||||
|
Log.info("code:" + ret + ", perms="+ JSON.stringify(reqPerms) +", result=" + JSON.stringify(this.result))
|
||||||
|
var perms = []
|
||||||
|
var results = []
|
||||||
|
reqPerms.forEach(perm => {
|
||||||
|
perms.push(perm)
|
||||||
|
})
|
||||||
|
this.result.forEach(result => {
|
||||||
|
results.push(result)
|
||||||
|
})
|
||||||
|
let option = new rpc.MessageOption()
|
||||||
|
let data = new rpc.MessageParcel()
|
||||||
|
let reply = new rpc.MessageParcel()
|
||||||
|
Promise.all([data.writeInterfaceToken(Constants.ACCESS_TOKEN),
|
||||||
|
data.writeStringArray(perms),
|
||||||
|
data.writeIntArray(results)
|
||||||
|
]).then(() => {
|
||||||
|
this.proxy.sendRequest(Constants.RESULT_CODE, data, reply, option)
|
||||||
|
this.destruction()
|
||||||
|
}).catch(() => {
|
||||||
|
Log.error('write result failed!')
|
||||||
|
this.destruction()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
destruction() {
|
||||||
|
this.win.destroy()
|
||||||
|
globalThis.windowNum --
|
||||||
|
Log.info("windowNum:" + globalThis.windowNum)
|
||||||
|
if(globalThis.windowNum == 0) {
|
||||||
|
globalThis.extensionContext.terminateSelf()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async privacyAccept(group, accessTokenId, permissionList, userFixedFlag) {
|
||||||
|
var acManager = abilityAccessCtrl.createAtManager()
|
||||||
|
var num = 0
|
||||||
|
group.permissions.forEach(async permission => {
|
||||||
|
let result
|
||||||
|
if(showSubpermissionsGrop.indexOf(group.groupName) == -1) {
|
||||||
|
result = await acManager.grantUserGrantedPermission(accessTokenId, permission, userFixedFlag)
|
||||||
|
}else {
|
||||||
|
if(permissionList.includes(permission)) {
|
||||||
|
result = await acManager.grantUserGrantedPermission(accessTokenId, permission, userFixedFlag)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
num ++
|
||||||
|
Log.info("grant permission result:" + result + "permission" + permission)
|
||||||
|
if (result == abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED) {
|
||||||
|
permissionList.forEach((req, idx) => {
|
||||||
|
if(req == permission) {
|
||||||
|
this.result[idx] = abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
Log.info("grant permission success:" + permission)
|
||||||
|
} else {
|
||||||
|
Log.error("failed to grant permission:" + permission + " ret:" + result)
|
||||||
|
}
|
||||||
|
if(num == group.permissions.length) {
|
||||||
|
this.count ++
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async privacyCancel(group, accessTokenId, permissionList, userFixedFlag) {
|
||||||
|
var acManager = abilityAccessCtrl.createAtManager()
|
||||||
|
group.permissions.forEach(async permission => {
|
||||||
|
let result
|
||||||
|
if(showSubpermissionsGrop.indexOf(group.groupName) == -1) {
|
||||||
|
result = await acManager.revokeUserGrantedPermission(accessTokenId, permission, userFixedFlag)
|
||||||
|
}else {
|
||||||
|
if(permissionList.includes(permission)) {
|
||||||
|
result = await acManager.revokeUserGrantedPermission(accessTokenId, permission, userFixedFlag)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Log.info("revoke permission result:" + result + "permission" + permission);
|
||||||
|
})
|
||||||
|
this.count ++
|
||||||
|
}
|
||||||
|
|
||||||
|
getgrantGroups(stateGroup) {
|
||||||
|
this.reqPerms.forEach((permission, idx) => {
|
||||||
|
//已授权
|
||||||
|
if(stateGroup[idx] == Constants.PASS_OPER) {
|
||||||
|
Log.info("permission has been fixed:" + permission)
|
||||||
|
this.result[idx] = abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED;
|
||||||
|
//待授权
|
||||||
|
}else if(stateGroup[idx] == Constants.DYNAMIC_OPER) {
|
||||||
|
var group = getPermissionGroup(permission)
|
||||||
|
if(!group) {
|
||||||
|
Log.info("permission not find:" + permission)
|
||||||
|
}else {
|
||||||
|
var exist = this.grantGroups.find(grantGroup => grantGroup.name == group.name)
|
||||||
|
//判断是否为需要展示子权限的权限组
|
||||||
|
if(showSubpermissionsGrop.indexOf(group.groupName) != -1) {
|
||||||
|
var permissionDetail
|
||||||
|
permissionGroups.forEach(permissionGroup => {
|
||||||
|
if(permissionGroup.permissionName == permission) {
|
||||||
|
//获取授权的权限信息
|
||||||
|
permissionDetail = permissionGroup
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//权限组已存在的情况
|
||||||
|
if(!exist) {
|
||||||
|
group.description = [permissionDetail.label]
|
||||||
|
this.grantGroups.push(group)
|
||||||
|
}else {
|
||||||
|
if(exist.description.indexOf(permissionDetail.label) == -1) {
|
||||||
|
exist.description.push(permissionDetail.label)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
if(!exist) {
|
||||||
|
this.grantGroups.push(group)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.initStatus = Constants.INIT_NEED_TO_VERIFY
|
||||||
|
}
|
||||||
|
|
||||||
|
getApplicationName(uid) {
|
||||||
|
bundle.getNameForUid(uid).then((data) => {
|
||||||
|
Log.info("getApplicationName bundleName:" + data)
|
||||||
|
Log.info("getApplicationName userId:" + Math.floor(uid/200000))
|
||||||
|
bundle.getApplicationInfo(data, BundleFlag.GET_BUNDLE_DEFAULT, Math.floor(uid/200000)).then(applicationInfo => {
|
||||||
|
Resmgr.getResourceManager(globalThis.extensionContext, data).then(item => {
|
||||||
|
item.getString(applicationInfo.labelId, (err, value) => {
|
||||||
|
if (value == undefined) {
|
||||||
|
this.appName = applicationInfo.label
|
||||||
|
} else {
|
||||||
|
this.appName = value
|
||||||
|
}
|
||||||
|
Log.info("hap label:" + applicationInfo.label + ", value:"+this.appName)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}).catch(err => {
|
||||||
|
Log.error("applicationInfo error :" + err)
|
||||||
|
this.initStatus = Constants.INIT_NEED_TO_TERMINATED
|
||||||
|
})
|
||||||
|
bundle.getBundleInfo(data, Constants.PARMETER_BUNDLE_FLAG).then(bundleInfo => {
|
||||||
|
this.grantGroups.forEach((group, idx) => {
|
||||||
|
if(group.description) {
|
||||||
|
Resmgr.getResourceManager(globalThis.extensionContext, Constants.BUNDLE_NAME).then(item => {
|
||||||
|
Promise.all([item.getString($r("app.string.separator").id),
|
||||||
|
item.getString($r("app.string.reason_suffix").id)])
|
||||||
|
.then(values => {
|
||||||
|
group.description = group.description.join(values[0])
|
||||||
|
group.description += values[1]
|
||||||
|
this.getReason(group, bundleInfo, data)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}else {
|
||||||
|
this.getReason(group, bundleInfo, data)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}).catch(err => {
|
||||||
|
Log.error("getNameForUid error :" + JSON.stringify(err))
|
||||||
|
this.initStatus = Constants.INIT_NEED_TO_TERMINATED
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
getReason(group, bundleInfo, bundleName) {
|
||||||
|
group.permissions.forEach(permission => {
|
||||||
|
if(this.reqPerms.indexOf(permission) != -1) {
|
||||||
|
bundleInfo.reqPermissionDetails.forEach(reqPermissionDetail => {
|
||||||
|
if(reqPermissionDetail.name == permission) {
|
||||||
|
Resmgr.getResourceManager(globalThis.extensionContext, bundleName).then(item => {
|
||||||
|
item.getString(reqPermissionDetail.reasonId, (err, value) => {
|
||||||
|
this.initStatus = Constants.INIT_NEED_TO_REFRESH
|
||||||
|
if (value !== undefined && !group.hasReason) {
|
||||||
|
group.description += value.slice(Constants.START_SUBSCRIPT, Constants.END_SUBSCRIPT)
|
||||||
|
group.hasReason = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
aboutToAppear() {
|
||||||
|
this.count = 0;
|
||||||
|
this.initStatus = Constants.INIT_NEED_TO_WAIT
|
||||||
|
this.result = []
|
||||||
|
this.reqPerms = globalThis.abilityWant.parameters['ohos.user.grant.permission']
|
||||||
|
this.accessTokenId = globalThis.abilityWant.parameters['ohos.aafwk.param.callerToken']
|
||||||
|
this.proxy = globalThis.abilityWant.parameters['ohos.ability.params.callback'].value
|
||||||
|
this.win = globalThis.extensionWin
|
||||||
|
if (this.reqPerms == undefined || this.accessTokenId == undefined || this.reqPerms.length == 0) {
|
||||||
|
Log.info("invalid parameters")
|
||||||
|
this.initStatus = Constants.INIT_NEED_TO_TERMINATED
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Log.info("request permission=" + JSON.stringify(this.reqPerms) + ", tokenId = " + this.accessTokenId)
|
||||||
|
Log.info("permission state=" + JSON.stringify(globalThis.abilityWant.parameters['ohos.user.grant.permission.state']));
|
||||||
|
this.result = new Array(this.reqPerms.length).fill(-1);
|
||||||
|
this.getgrantGroups(globalThis.abilityWant.parameters['ohos.user.grant.permission.state']);
|
||||||
|
this.getApplicationName(globalThis.abilityWant.parameters['ohos.aafwk.param.callerUid'])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
170
permissionmanager/src/main/ets/pages/other-permissions.ets
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { backBar } from "../common/components/backBar";
|
||||||
|
import router from '@system.router';
|
||||||
|
import Constants from '../common/utils/constant';
|
||||||
|
import { otherPermissionsLabel } from '../common/model/permissionGroup'
|
||||||
|
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
|
||||||
|
|
||||||
|
var TAG = 'PermissionManager_MainAbility:'
|
||||||
|
|
||||||
|
let routerData = router.getParams().routerData; // Routing jump data
|
||||||
|
let tokenId: any = router.getParams().tokenId; // tokenId for verify permission
|
||||||
|
let backTitle = router.getParams().backTitle; // return title name
|
||||||
|
let status = router.getParams().status; // Status: Allowed, Forbidden
|
||||||
|
let permissions: any = router.getParams().permission; // permissions name
|
||||||
|
let otherPermissionList = []; // otherPermission List
|
||||||
|
for (let i = 0; i < permissions.length; i++) {
|
||||||
|
otherPermissionList.push({
|
||||||
|
permissionLabel: otherPermissionsLabel[permissions[i]],
|
||||||
|
permission: permissions[i]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
@Entry
|
||||||
|
@Component
|
||||||
|
struct appNamePage {
|
||||||
|
build() {
|
||||||
|
GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) {
|
||||||
|
Row() {
|
||||||
|
Row()
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.LEFT_XS_SPAN, offset: Constants.LEFT_XS_OFFSET },
|
||||||
|
sm: { span: Constants.LEFT_SM_SPAN, offset: Constants.LEFT_SM_OFFSET },
|
||||||
|
md: { span: Constants.LEFT_MD_SPAN, offset: Constants.LEFT_MD_OFFSET },
|
||||||
|
lg: { span: Constants.LEFT_LG_SPAN, offset: Constants.LEFT_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
backBar({ title: JSON.stringify(backTitle), recordable: false })
|
||||||
|
}
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Scroll() {
|
||||||
|
appNameItem()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.layoutWeight(Constants.LAYOUT_WEIGHT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.MIDDLE_XS_SPAN, offset: Constants.MIDDLE_XS_OFFSET },
|
||||||
|
sm: { span: Constants.MIDDLE_SM_SPAN, offset: Constants.MIDDLE_SM_OFFSET },
|
||||||
|
md: { span: Constants.MIDDLE_MD_SPAN, offset: Constants.MIDDLE_MD_OFFSET },
|
||||||
|
lg: { span: Constants.MIDDLE_LG_SPAN, offset: Constants.MIDDLE_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
Row()
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.RIGHT_XS_SPAN, offset: Constants.RIGHT_XS_OFFSET },
|
||||||
|
sm: { span: Constants.RIGHT_SM_SPAN, offset: Constants.RIGHT_SM_OFFSET },
|
||||||
|
md: { span: Constants.RIGHT_MD_SPAN, offset: Constants.RIGHT_MD_OFFSET },
|
||||||
|
lg: { span: Constants.RIGHT_LG_SPAN, offset: Constants.RIGHT_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
}
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.backgroundColor($r("sys.color.ohos_id_color_sub_background"))
|
||||||
|
.opacity(Constants.MANAGEMENT_TRANSPARENCY)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lifecycle function, triggered once when this page is displayed
|
||||||
|
*/
|
||||||
|
onPageShow() {
|
||||||
|
console.log(TAG + 'onPageShow other-permissions')
|
||||||
|
let isGranted = true;
|
||||||
|
permissions.forEach(permission => {
|
||||||
|
abilityAccessCtrl.createAtManager().verifyAccessToken(tokenId, permission).then(res => {
|
||||||
|
status = res;
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(TAG + 'verifyAccessToken occure error: ' + JSON.stringify(err))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component
|
||||||
|
struct appNameItem {
|
||||||
|
@State otherPermissionListItem: string[] = otherPermissionList; // Other permission interface data array
|
||||||
|
@Builder ListItemLayout(item, index) {
|
||||||
|
ListItem() {
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
|
||||||
|
Row() {
|
||||||
|
Text(item.permissionLabel)
|
||||||
|
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.text_color'))
|
||||||
|
.flexGrow(Constants.FLEX_GROW)
|
||||||
|
Image($r('app.media.rightarrow'))
|
||||||
|
.objectFit(ImageFit.Contain)
|
||||||
|
.height(Constants.IMAGE_HEIGHT)
|
||||||
|
.width(Constants.IMAGE_WIDTH)
|
||||||
|
}
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.LISTITEM_ROW_HEIGHT)
|
||||||
|
}
|
||||||
|
if (!index) {
|
||||||
|
Row() {
|
||||||
|
Column()
|
||||||
|
.backgroundColor($r('app.color.text_decoration_color'))
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.TEXT_DECORATION_HEIGHT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.onClick(() => {
|
||||||
|
router.push({
|
||||||
|
uri: 'pages/application-tertiary',
|
||||||
|
params: {
|
||||||
|
routerData: routerData,
|
||||||
|
backTitle: item.permissionLabel,
|
||||||
|
permission: [item.permission],
|
||||||
|
status: status
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}.padding({ left: Constants.DEFAULT_PADDING_START, right: Constants.DEFAULT_PADDING_END })
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
List() {
|
||||||
|
ForEach(this.otherPermissionListItem.slice(Constants.SLICE_START, this.otherPermissionListItem.length - 1),
|
||||||
|
(item) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_START_INDEX)
|
||||||
|
}, item => item.toString())
|
||||||
|
ForEach(this.otherPermissionListItem.slice(Constants.SLICE_END), (item, index) => {
|
||||||
|
this.ListItemLayout(item, Constants.SLICE_END_INDEX)
|
||||||
|
}, item => item.toString())
|
||||||
|
}.backgroundColor($r('app.color.default_background_color')).borderRadius(Constants.BORDER_RADIUS)
|
||||||
|
.padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM })
|
||||||
|
}.margin({ top: Constants.ROW_MARGIN_TOP })
|
||||||
|
.padding({ left: Constants.LIST_PADDING_LEFT, right: Constants.LISTITEM_PADDING_RIGHT })
|
||||||
|
}
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,533 @@
|
|||||||
|
/*
|
||||||
|
* 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 bundle from '@ohos.bundle';
|
||||||
|
import router from '@system.router';
|
||||||
|
import Resmgr from '@ohos.resourceManager'
|
||||||
|
import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
|
||||||
|
import privacyManager from '@ohos.privacyManager'
|
||||||
|
import { backBar } from "../common/components/backBar";
|
||||||
|
import Constants from '../common/utils/constant';
|
||||||
|
import { noNeedDisplayApp, userGrantPermissions, permissionGroupIds } from "../common/model/permissionGroup";
|
||||||
|
import { getPermissionGroup } from '../common/utils/utils'
|
||||||
|
|
||||||
|
var TAG = 'PermissionManager_MainAbility:'
|
||||||
|
|
||||||
|
@Extend(Image) function customizeImage(width: number, height: number) {
|
||||||
|
.objectFit(ImageFit.Contain)
|
||||||
|
.width(width)
|
||||||
|
.height(height)
|
||||||
|
};
|
||||||
|
|
||||||
|
@Entry
|
||||||
|
@Component
|
||||||
|
struct permissionRecordPage {
|
||||||
|
@State groups: any[] = []
|
||||||
|
@State applicationInfos: any[] = []
|
||||||
|
@State permissionApplications: any[] = []
|
||||||
|
@State permissionIndex: number = -1
|
||||||
|
@State applicationIndex: number = -1
|
||||||
|
@State strings: any = {}
|
||||||
|
@State currentIndex: number = 0
|
||||||
|
@Builder TabBuilder(index: number) {
|
||||||
|
Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
||||||
|
Text(index ? $r('app.string.application') : $r('app.string.authority'))
|
||||||
|
.fontColor(this.currentIndex == index ? $r('app.color.button_color') : $r('app.color.label_color'))
|
||||||
|
.fontWeight(this.currentIndex == index ? FontWeight.Bold : FontWeight.Regular)
|
||||||
|
.lineHeight(Constants.TEXT_LINE_HEIGHT)
|
||||||
|
if(this.currentIndex == index) {
|
||||||
|
Row().width(Constants.FULL_WIDTH).height(Constants.TAB_DECORATION_HEIGHT)
|
||||||
|
.backgroundColor($r('app.color.button_color'))
|
||||||
|
.position({ y: Constants.TAB_DECORATION_POSITION_Y })
|
||||||
|
}
|
||||||
|
}.height(Constants.TAB_HEIGHT)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Builder ListItemLayout(item, index, dimension) {
|
||||||
|
ListItem() {
|
||||||
|
Column() {
|
||||||
|
Column() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
|
||||||
|
Row() {
|
||||||
|
if(dimension) {
|
||||||
|
Image(item.icon)
|
||||||
|
.customizeImage(Constants.MANAGEMENT_IMAGE_WIDTH, Constants.MANAGEMENT_IMAGE_HEIGHT)
|
||||||
|
.margin({ right: Constants.MANAGEMENT_IMAGE_MARGIN_RIGHT_RECORD, left: Constants.MANAGEMENT_IMAGE_MARGIN_LEFT })
|
||||||
|
}else {
|
||||||
|
Image(item.icon)
|
||||||
|
.customizeImage(Constants.APPLICATION_IMAGE_WIDTH, Constants.APPLICATION_IMAGE_HEIGHT)
|
||||||
|
.margin({ right: Constants.MANAGEMENT_IMAGE_MARGIN_RIGHT })
|
||||||
|
}
|
||||||
|
Column() {
|
||||||
|
Text(item.groupName)
|
||||||
|
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||||
|
.fontWeight(FontWeight.Medium)
|
||||||
|
.fontColor($r('app.color.label_color'))
|
||||||
|
.lineHeight(Constants.TEXT_LINE_HEIGHT)
|
||||||
|
.margin({ bottom: Constants.TERTIARY_LABEL_MARGIN_BOTTOM })
|
||||||
|
if(dimension) {
|
||||||
|
Text(this.strings.visits + item.sum)
|
||||||
|
.fontSize(Constants.TEXT_SMAL_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.label_color_light'))
|
||||||
|
.lineHeight(Constants.TEXT_SMALL_LINE_HEIGHT)
|
||||||
|
}else {
|
||||||
|
Row() {
|
||||||
|
if (item.permissions) {
|
||||||
|
ForEach(item.permissions, permission => {
|
||||||
|
Image(permission.icon)
|
||||||
|
.customizeImage(Constants.IMAGE_WIDTH_RECORD_APPLICATION, Constants.IMAGE_HEIGHT_RECORD_APPLICATION)
|
||||||
|
.margin({ right: Constants.APPLICATION_TEXT_MARGIN_RIGHT })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.flexGrow(Constants.FLEX_GROW)
|
||||||
|
.alignItems(HorizontalAlign.Start)
|
||||||
|
if(dimension) {
|
||||||
|
if(index == this.permissionIndex) {
|
||||||
|
Image($r('app.media.xiangshangjiantou'))
|
||||||
|
.customizeImage(Constants.IMAGE_WIDTH_RECORD, Constants.IMAGE_HEIGHT_RECORD)
|
||||||
|
}else {
|
||||||
|
Image($r('app.media.xiangxiajiantou'))
|
||||||
|
.customizeImage(Constants.IMAGE_WIDTH_RECORD, Constants.IMAGE_HEIGHT_RECORD)
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
if(index == this.applicationIndex) {
|
||||||
|
Image($r('app.media.xiangshangjiantou'))
|
||||||
|
.customizeImage(Constants.IMAGE_WIDTH_RECORD, Constants.IMAGE_HEIGHT_RECORD)
|
||||||
|
}else {
|
||||||
|
Image($r('app.media.xiangxiajiantou'))
|
||||||
|
.customizeImage(Constants.IMAGE_WIDTH_RECORD, Constants.IMAGE_HEIGHT_RECORD)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.height(dimension ? Constants.LISTITEM_HEIGHT_PERMISSION : Constants.LISTITEM_HEIGHT_APPLICATION)
|
||||||
|
}
|
||||||
|
}.onClick(() => {
|
||||||
|
dimension ?
|
||||||
|
(this.permissionIndex = this.permissionIndex == index ? -1 : index) :
|
||||||
|
(this.applicationIndex = this.applicationIndex == index ? -1 : index)
|
||||||
|
if(dimension) {
|
||||||
|
this.permissionApplications = this.applicationInfos.filter(appInfo => {
|
||||||
|
return appInfo.groupNames.includes(item.groupName)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if(dimension && (index == this.permissionIndex)) {
|
||||||
|
List() {
|
||||||
|
ForEach(this.permissionApplications, (permissionApplication) => {
|
||||||
|
ListItem() {
|
||||||
|
Row() {
|
||||||
|
Image(permissionApplication.icon)
|
||||||
|
.customizeImage(Constants.APPLICATION_IMAGE_WIDTH, Constants.APPLICATION_IMAGE_HEIGHT)
|
||||||
|
.margin({ right: Constants.MANAGEMENT_IMAGE_MARGIN_RIGHT })
|
||||||
|
Column() {
|
||||||
|
Row().width(Constants.FULL_WIDTH).height(Constants.TEXT_DECORATION_HEIGHT)
|
||||||
|
.backgroundColor($r("app.color.label_color_lightest"))
|
||||||
|
.margin({ bottom: Constants.LISTITEM_MARGIN_BOTTOM_PERMISSION })
|
||||||
|
Text(permissionApplication.groupName)
|
||||||
|
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||||
|
.fontWeight(FontWeight.Medium)
|
||||||
|
.fontColor($r('app.color.label_color'))
|
||||||
|
.lineHeight(Constants.TEXT_LINE_HEIGHT)
|
||||||
|
.margin({ bottom: Constants.TERTIARY_LABEL_MARGIN_BOTTOM })
|
||||||
|
Text(this.strings.visits + this.getAppRecords(permissionApplication, item.groupName, true) +
|
||||||
|
this.strings.recent_visit + this.getTime(this.getAppRecords(permissionApplication, item.groupName, false)))
|
||||||
|
.fontSize(Constants.TEXT_SMAL_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.label_color_light'))
|
||||||
|
.lineHeight(Constants.TEXT_SMALL_LINE_HEIGHT)
|
||||||
|
}.alignItems(HorizontalAlign.Start)
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
}
|
||||||
|
}.height(Constants.LISTITEM_HEIGHT_APPLICATION)
|
||||||
|
.onClick(() => {
|
||||||
|
router.push({
|
||||||
|
uri: 'pages/application-secondary',
|
||||||
|
params: { routerData: {
|
||||||
|
'bundleName': permissionApplication.name,
|
||||||
|
'tokenId': permissionApplication.accessTokenId,
|
||||||
|
'iconId': permissionApplication.icon,
|
||||||
|
'labelId': permissionApplication.groupName,
|
||||||
|
'permissions': permissionApplication.reqUserPermissions,
|
||||||
|
'groupId': permissionApplication.groupIds
|
||||||
|
} }
|
||||||
|
});
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!dimension && (index == this.applicationIndex)) {
|
||||||
|
List() {
|
||||||
|
ForEach(item.permissions, (permission) => {
|
||||||
|
ListItem() {
|
||||||
|
Row() {
|
||||||
|
Image(permission.icon)
|
||||||
|
.customizeImage(Constants.MANAGEMENT_IMAGE_WIDTH, Constants.MANAGEMENT_IMAGE_HEIGHT)
|
||||||
|
.margin({ right: Constants.MANAGEMENT_IMAGE_MARGIN_RIGHT_RECORD, left: Constants.MANAGEMENT_IMAGE_MARGIN_LEFT })
|
||||||
|
Column() {
|
||||||
|
Row().width(Constants.FULL_WIDTH).height(Constants.TEXT_DECORATION_HEIGHT)
|
||||||
|
.backgroundColor($r("app.color.label_color_lightest"))
|
||||||
|
.margin({ bottom: Constants.LISTITEM_MARGIN_BOTTOM_APPLICATION })
|
||||||
|
Text(permission.groupName)
|
||||||
|
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||||
|
.fontWeight(FontWeight.Medium)
|
||||||
|
.fontColor($r('app.color.label_color'))
|
||||||
|
.lineHeight(Constants.TEXT_LINE_HEIGHT)
|
||||||
|
.margin({ bottom: Constants.TERTIARY_LABEL_MARGIN_BOTTOM })
|
||||||
|
Text(this.strings.visits + permission['count' + item.accessTokenId]
|
||||||
|
+ this.strings.recent_visit + this.getTime(permission['lastTime' + item.accessTokenId]))
|
||||||
|
.fontSize(Constants.TEXT_SMAL_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.label_color_light'))
|
||||||
|
.lineHeight(Constants.TEXT_SMALL_LINE_HEIGHT)
|
||||||
|
}.alignItems(HorizontalAlign.Start)
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
}
|
||||||
|
}.height(Constants.LISTITEM_HEIGHT_PERMISSION)
|
||||||
|
.onClick(() => {
|
||||||
|
router.push({
|
||||||
|
uri: 'pages/application-secondary',
|
||||||
|
params: { routerData: {
|
||||||
|
'bundleName': item.name,
|
||||||
|
'tokenId': item.accessTokenId,
|
||||||
|
'iconId': item.icon,
|
||||||
|
'labelId': item.groupName,
|
||||||
|
'permissions': item.reqUserPermissions,
|
||||||
|
'groupId': item.groupIds
|
||||||
|
} }
|
||||||
|
});
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.padding({ left: Constants.DEFAULT_PADDING_START, right: Constants.DEFAULT_PADDING_END,
|
||||||
|
top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM })
|
||||||
|
.margin({ bottom: Constants.LISTITEM_MARGIN_BOTTOM })
|
||||||
|
.backgroundColor($r('app.color.default_background_color'))
|
||||||
|
.borderRadius(Constants.BORDER_RADIUS)
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) {
|
||||||
|
Row() {
|
||||||
|
Row()
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.LEFT_XS_SPAN, offset: Constants.LEFT_XS_OFFSET },
|
||||||
|
sm: { span: Constants.LEFT_SM_SPAN, offset: Constants.LEFT_SM_OFFSET },
|
||||||
|
md: { span: Constants.LEFT_MD_SPAN, offset: Constants.LEFT_MD_OFFSET },
|
||||||
|
lg: { span: Constants.LEFT_LG_SPAN, offset: Constants.LEFT_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
backBar( { title: JSON.stringify($r('app.string.permission_access_record')), recordable: false })
|
||||||
|
}
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Column() {
|
||||||
|
Flex({ justifyContent: FlexAlign.Start }) {
|
||||||
|
Text($r('app.string.record_time_limit'))
|
||||||
|
.margin({ left: Constants.BACKBAR_IMAGE_MARGIN_LEFT })
|
||||||
|
.fontSize(Constants.TEXT_SMAL_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.label_color_light'))
|
||||||
|
.lineHeight(Constants.SUBTITLE_LINE_HEIGHT)
|
||||||
|
}.constraintSize({ minHeight: Constants.SUBTITLE_MIN_HEIGHT })
|
||||||
|
.padding({ top: Constants.SUBTITLE_PADDING_TOP, bottom: Constants.SUBTITLE_PADDING_BOTTOM })
|
||||||
|
if(this.groups.length) {
|
||||||
|
Stack() {
|
||||||
|
Tabs() {
|
||||||
|
TabContent() {
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Scroll() {
|
||||||
|
Row() {
|
||||||
|
List() {
|
||||||
|
ForEach(this.groups, (item, index) => {
|
||||||
|
this.ListItemLayout(item, index, Constants.PERMISSION)
|
||||||
|
}, item => item.toString())
|
||||||
|
}.padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM })
|
||||||
|
}.padding({
|
||||||
|
left: Constants.MANAGEMENT_ROW_PADDING_LEFT,
|
||||||
|
right: Constants.MANAGEMENT_ROW_PADDING_RIGHT,
|
||||||
|
top: Constants.MANAGEMENT_ROW_PADDING_TOP
|
||||||
|
})
|
||||||
|
}.scrollBar(BarState.Off)
|
||||||
|
}.width(Constants.FULL_WIDTH)
|
||||||
|
}
|
||||||
|
}.tabBar(this.TabBuilder(0))
|
||||||
|
TabContent() {
|
||||||
|
Row() {
|
||||||
|
Column() {
|
||||||
|
Scroll() {
|
||||||
|
Row() {
|
||||||
|
List() {
|
||||||
|
ForEach(this.applicationInfos, (item, index) => {
|
||||||
|
this.ListItemLayout(item, index, Constants.APPLICATION)
|
||||||
|
}, item => item.toString())
|
||||||
|
}.padding({ top: Constants.LIST_PADDING_TOP, bottom: Constants.LIST_PADDING_BOTTOM })
|
||||||
|
}.padding({
|
||||||
|
left: Constants.MANAGEMENT_ROW_PADDING_LEFT,
|
||||||
|
right: Constants.MANAGEMENT_ROW_PADDING_RIGHT,
|
||||||
|
top: Constants.MANAGEMENT_ROW_PADDING_TOP
|
||||||
|
})
|
||||||
|
}.scrollBar(BarState.Off)
|
||||||
|
}.width(Constants.FULL_WIDTH)
|
||||||
|
}
|
||||||
|
}.tabBar(this.TabBuilder(1))
|
||||||
|
}
|
||||||
|
.barWidth(Constants.BAR_WIDTH)
|
||||||
|
.barMode(BarMode.Fixed)
|
||||||
|
.onChange((index) => {
|
||||||
|
this.currentIndex = index
|
||||||
|
})
|
||||||
|
}.height(Constants.FULL_HEIGHT)
|
||||||
|
}else {
|
||||||
|
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center, direction: FlexDirection.Column }) {
|
||||||
|
Image($r('app.media.noRecord'))
|
||||||
|
.customizeImage(Constants.NORECORD_IMAGE_WIDTH, Constants.NORECORD_IMAGE_HEIGHT)
|
||||||
|
.margin({ left: Constants.NORECORD_IMAGE_MARGIN_LEFT })
|
||||||
|
Text($r('app.string.no_record')).margin({ top: Constants.DIALOG_REQ_MARGIN_TOP })
|
||||||
|
.fontSize(Constants.TEXT_SMAL_FONT_SIZE)
|
||||||
|
.fontColor($r('app.color.label_color_light'))
|
||||||
|
}.width(Constants.FULL_WIDTH).height(Constants.FULL_HEIGHT)
|
||||||
|
.padding({ bottom: Constants.RECORD_PADDING_BOTTOM })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.layoutWeight(Constants.LAYOUT_WEIGHT)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.MIDDLE_XS_SPAN, offset: Constants.MIDDLE_XS_OFFSET },
|
||||||
|
sm: { span: Constants.MIDDLE_SM_SPAN, offset: Constants.MIDDLE_SM_OFFSET },
|
||||||
|
md: { span: Constants.MIDDLE_MD_SPAN, offset: Constants.MIDDLE_MD_OFFSET },
|
||||||
|
lg: { span: Constants.MIDDLE_LG_SPAN, offset: Constants.MIDDLE_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
Row()
|
||||||
|
.useSizeType({
|
||||||
|
xs: { span: Constants.RIGHT_XS_SPAN, offset: Constants.RIGHT_XS_OFFSET },
|
||||||
|
sm: { span: Constants.RIGHT_SM_SPAN, offset: Constants.RIGHT_SM_OFFSET },
|
||||||
|
md: { span: Constants.RIGHT_MD_SPAN, offset: Constants.RIGHT_MD_OFFSET },
|
||||||
|
lg: { span: Constants.RIGHT_LG_SPAN, offset: Constants.RIGHT_LG_OFFSET }
|
||||||
|
})
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
}
|
||||||
|
.height(Constants.FULL_HEIGHT)
|
||||||
|
.width(Constants.FULL_WIDTH)
|
||||||
|
.backgroundColor($r("sys.color.ohos_id_color_sub_background"))
|
||||||
|
.opacity(Constants.MANAGEMENT_TRANSPARENCY)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get time
|
||||||
|
* @param {Number} The time stamp
|
||||||
|
*/
|
||||||
|
getTime(time, format='MM月DD日 NNHH:mm') {
|
||||||
|
if(this.strings.morning == 'am') { format = 'MM/DD HH:mm NN' }
|
||||||
|
let date = new Date(time * 1000)
|
||||||
|
let config = {
|
||||||
|
MM: date.getMonth() + 1,
|
||||||
|
DD: date.getDate(),
|
||||||
|
NN: date.getHours() >= 12 ? this.strings.afternoon : this.strings.morning,
|
||||||
|
HH: date.getHours() >= 12 ? date.getHours() - 12 : date.getHours(),
|
||||||
|
mm: date.getMinutes() > 10 ? date.getMinutes() : '0' + date.getMinutes(),
|
||||||
|
}
|
||||||
|
|
||||||
|
for(const key in config){
|
||||||
|
format = format.replace(key,config[key])
|
||||||
|
}
|
||||||
|
return format
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get application record info
|
||||||
|
* @param {Object} application info
|
||||||
|
* @param {String} groupName
|
||||||
|
* @param {Boolean} true: count, false: lastTime
|
||||||
|
*/
|
||||||
|
getAppRecords(appInfo, groupName, option) {
|
||||||
|
var record = appInfo.permissions.filter(permission => {
|
||||||
|
return permission.groupName == groupName
|
||||||
|
})
|
||||||
|
return option ? record[0]['count' + appInfo.accessTokenId] : record[0]['lastTime' + appInfo.accessTokenId]
|
||||||
|
}
|
||||||
|
|
||||||
|
getStrings() {
|
||||||
|
Resmgr.getResourceManager(globalThis.context, Constants.BUNDLE_NAME).then(item => {
|
||||||
|
item.getString($r("app.string.visits").id, (err, val) => {
|
||||||
|
this.strings.visits = val
|
||||||
|
})
|
||||||
|
item.getString($r("app.string.recent_visit").id, (err, val) => {
|
||||||
|
this.strings.recent_visit = val
|
||||||
|
})
|
||||||
|
item.getString($r("app.string.morning").id, (err, val) => {
|
||||||
|
this.strings.morning = val
|
||||||
|
})
|
||||||
|
item.getString($r("app.string.afternoon").id, (err, val) => {
|
||||||
|
this.strings.afternoon = val
|
||||||
|
})
|
||||||
|
}).catch(error => {
|
||||||
|
console.error(TAG + 'Resmgr.getResourceManager failed. Cause: ' + JSON.stringify(error));
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
getInfo(record, sortFlag) {
|
||||||
|
bundle.getBundleInfo(record.bundleName, Constants.PARMETER_BUNDLE_FLAG).then(async info => {
|
||||||
|
var reqUserPermissions: string[] = [];
|
||||||
|
var reqUserRecords: any[] = [];
|
||||||
|
var permissionGroups: any[] = [];
|
||||||
|
var acManager = abilityAccessCtrl.createAtManager()
|
||||||
|
var appInfo: any = {}
|
||||||
|
for (let j = 0; j < record.permissionRecords.length; j++) {
|
||||||
|
var permission = record.permissionRecords[j].permissionName;
|
||||||
|
var flag = await acManager.getPermissionFlags(info.appInfo.accessTokenId, permission)
|
||||||
|
if(flag == Constants.PRE_AUTHORIZATION_NOT_MODIFIED) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if (userGrantPermissions.indexOf(permission) != -1) {
|
||||||
|
reqUserRecords.push(record.permissionRecords[j])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let k = 0; k < info.reqPermissions.length; k++) {
|
||||||
|
var reqPermission = info.reqPermissions[k];
|
||||||
|
var reqFlag = await acManager.getPermissionFlags(info.appInfo.accessTokenId, reqPermission)
|
||||||
|
if(reqFlag == Constants.PRE_AUTHORIZATION_NOT_MODIFIED) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if (userGrantPermissions.indexOf(reqPermission) != -1) {
|
||||||
|
reqUserPermissions.push(reqPermission);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let groupNames = [];
|
||||||
|
let appLastTime = 0;
|
||||||
|
reqUserRecords.forEach(reqUserRecord => {
|
||||||
|
var group = getPermissionGroup(reqUserRecord.permissionName)
|
||||||
|
if(!group) {
|
||||||
|
console.info(TAG + "permission not find:" + reqUserRecord.permissionName)
|
||||||
|
}else {
|
||||||
|
var existing = permissionGroups.find(permissionGroup => permissionGroup.name == group.name)
|
||||||
|
var lastTime = reqUserRecord.lastAccessTime
|
||||||
|
lastTime > appLastTime ? appLastTime = lastTime : ''
|
||||||
|
if(!existing) {
|
||||||
|
group['count' + record.tokenId] = reqUserRecord.accessCount
|
||||||
|
group['lastTime' + record.tokenId] = lastTime
|
||||||
|
permissionGroups.push(group)
|
||||||
|
groupNames.push(group.groupName)
|
||||||
|
}else {
|
||||||
|
existing['count' + record.tokenId] += reqUserRecord.accessCount
|
||||||
|
lastTime > existing['lastTime' + record.tokenId] ? existing['lastTime' + record.tokenId] = lastTime : ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
let groupIds = [];
|
||||||
|
for (let i = 0; i < reqUserPermissions.length; i++) {
|
||||||
|
if(groupIds.indexOf(permissionGroupIds[reqUserPermissions[i]]) == -1){
|
||||||
|
groupIds.push(permissionGroupIds[reqUserPermissions[i]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await Resmgr.getResourceManager(globalThis.context, info.name).then(item => {
|
||||||
|
item.getString(info.appInfo['labelId'], (error, value) => {
|
||||||
|
if (value == undefined) {
|
||||||
|
appInfo['groupName'] = info.appInfo.label;
|
||||||
|
} else {
|
||||||
|
appInfo['groupName'] = value;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
item.getMediaBase64(info.appInfo['iconId'], (error, value) => {
|
||||||
|
appInfo['icon'] = value;
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
appInfo.name = info.appInfo.name
|
||||||
|
appInfo.accessTokenId = info.appInfo.accessTokenId
|
||||||
|
appInfo.reqUserPermissions = reqUserPermissions
|
||||||
|
appInfo.permissions = permissionGroups
|
||||||
|
appInfo.groupNames = groupNames
|
||||||
|
appInfo.groupIds = groupIds
|
||||||
|
appInfo.appLastTime = appLastTime
|
||||||
|
this.applicationInfos.push(appInfo)
|
||||||
|
if(sortFlag) {
|
||||||
|
var appInfos: any[] = []
|
||||||
|
this.applicationInfos.forEach(item => { appInfos.push(item) })
|
||||||
|
appInfos.sort((a, b) => { return b.appLastTime - a.appLastTime })
|
||||||
|
this.applicationInfos = appInfos
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
getAllRecords() {
|
||||||
|
let request = {
|
||||||
|
"tokenId": 0,
|
||||||
|
"isRemote": false,
|
||||||
|
"permissionNames": [],
|
||||||
|
"beginTime": 0,
|
||||||
|
"endTime": 0,
|
||||||
|
"flag": 1
|
||||||
|
}
|
||||||
|
privacyManager.getPermissionUsedRecords(request).then(async records => {
|
||||||
|
console.info(TAG + "records: " + JSON.stringify(records.bundleRecords))
|
||||||
|
var groupArray: any[] = []
|
||||||
|
for (let i = 0; i < records.bundleRecords.length; i++) {
|
||||||
|
var record = records.bundleRecords[i]
|
||||||
|
try {
|
||||||
|
const ret = await bundle.queryAbilityByWant({
|
||||||
|
bundleName: record.bundleName,
|
||||||
|
action: "action.system.home",
|
||||||
|
entities: ["entity.system.home"]
|
||||||
|
}, bundle.BundleFlag.GET_ABILITY_INFO_WITH_APPLICATION, Constants.USERID);
|
||||||
|
} catch(e) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (noNeedDisplayApp.indexOf(record.bundleName) != -1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
console.info(TAG + "record: " + JSON.stringify(record))
|
||||||
|
this.getInfo(record, (i + 1) == records.bundleRecords.length)
|
||||||
|
|
||||||
|
record.permissionRecords.forEach(permissionRecord => {
|
||||||
|
var group = getPermissionGroup(permissionRecord.permissionName)
|
||||||
|
if(group) {
|
||||||
|
var exist = groupArray.find(permissionGroup => permissionGroup.name == group.name)
|
||||||
|
var lastTime = permissionRecord.lastAccessTime
|
||||||
|
if(!exist) {
|
||||||
|
group.sum = permissionRecord.accessCount
|
||||||
|
group.recentVisit = lastTime
|
||||||
|
groupArray.push(group)
|
||||||
|
}else {
|
||||||
|
exist.sum += permissionRecord.accessCount
|
||||||
|
lastTime > exist.recentVisit ? exist.recentVisit = lastTime : ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
groupArray.sort((a, b) => { return b.recentVisit - a.recentVisit })
|
||||||
|
this.groups = groupArray
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
aboutToAppear() {
|
||||||
|
this.getStrings()
|
||||||
|
this.getAllRecords()
|
||||||
|
}
|
||||||
|
}
|
58
permissionmanager/src/main/module.json
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
"module": {
|
||||||
|
"name": "permissionmanager",
|
||||||
|
"type": "feature",
|
||||||
|
"srcEntrance": "./ets/Application/AbilityStage.ts",
|
||||||
|
"description": "$string:permissionmanager_desc",
|
||||||
|
"mainElement": "MainAbility",
|
||||||
|
"deviceTypes": [
|
||||||
|
"phone"
|
||||||
|
],
|
||||||
|
"deliveryWithInstall": true,
|
||||||
|
"installationFree": false,
|
||||||
|
"pages": "$profile:main_pages",
|
||||||
|
"uiSyntax": "ets",
|
||||||
|
"abilities": [
|
||||||
|
{
|
||||||
|
"name": "com.ohos.permissionmanager.MainAbility",
|
||||||
|
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
|
||||||
|
"description": "$string:MainAbility_desc",
|
||||||
|
"icon": "$media:icon",
|
||||||
|
"label": "$string:MainAbility_label",
|
||||||
|
"visible": true,
|
||||||
|
"launchType": "standard"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extensionAbilities": [
|
||||||
|
{
|
||||||
|
"icon": "$media:icon",
|
||||||
|
"name": "com.ohos.permissionmanager.GrantAbility",
|
||||||
|
"srcEntrance": "./ets/ServiceExtAbility/ServiceExtAbility.ts",
|
||||||
|
"type": "service",
|
||||||
|
"visible": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"requestPermissions": [
|
||||||
|
{
|
||||||
|
"name": "ohos.permission.GET_SENSITIVE_PERMISSIONS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ohos.permission.GET_BUNDLE_INFO"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ohos.permission.PERMISSION_USED_STATS"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
14
permissionmanager/src/main/resources/ar/profile/string.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"strings": {
|
||||||
|
"app_name": "CategoryPage",
|
||||||
|
"describe": "describe",
|
||||||
|
"category": "Category",
|
||||||
|
"itemChild": "ItemChild",
|
||||||
|
"item": "Item",
|
||||||
|
"search": "search...",
|
||||||
|
"you_search": "You search ",
|
||||||
|
"you_clicked": "You clicked ",
|
||||||
|
"tab": "Tab",
|
||||||
|
"more": "< more"
|
||||||
|
}
|
||||||
|
}
|
112
permissionmanager/src/main/resources/base/element/color.json
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
{
|
||||||
|
"color": [
|
||||||
|
{
|
||||||
|
"name": "text_color",
|
||||||
|
"value": "#E5000000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "label_color",
|
||||||
|
"value": "#182431"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "label_color_light",
|
||||||
|
"value": "#99182431"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "label_color_lighter",
|
||||||
|
"value": "#66182431"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "label_color_20",
|
||||||
|
"value": "#33182431"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "label_color_lightest",
|
||||||
|
"value": "#0D182431"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "background_color",
|
||||||
|
"value": "#F4F5F7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "list_background_color",
|
||||||
|
"value": "#FDFDFD"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "text_secondary_color",
|
||||||
|
"value": "#99000000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "active_background_color",
|
||||||
|
"value": "#e5f3ff"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "divider_color",
|
||||||
|
"value": "#f3f4f6"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "text_decoration_color",
|
||||||
|
"value": "#f3f4f6"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "default_background_color",
|
||||||
|
"value": "#ffffff"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "button_color",
|
||||||
|
"value": "#007DFF"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "shape_allow_color",
|
||||||
|
"value": "#1856D4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "shape_ban_color",
|
||||||
|
"value": "#000000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "first_font_color",
|
||||||
|
"value": "#E6000000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "secondary_font_color",
|
||||||
|
"value": "#66000000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "toggle_color",
|
||||||
|
"value": "#409eff"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "color_Primary",
|
||||||
|
"value": "#E5000000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "color_Secondary",
|
||||||
|
"value": "#99000000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "color_Tertiary",
|
||||||
|
"value": "#66000000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "color_Fourth",
|
||||||
|
"value": "#33000000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "selected_Color",
|
||||||
|
"value": "#ffffff"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "popup_Color",
|
||||||
|
"value": "#FFFAF0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "selected_Background_Color",
|
||||||
|
"value": "#CCCCCC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "popup_Background_Color",
|
||||||
|
"value": "#D2B48C"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,92 @@
|
|||||||
|
{
|
||||||
|
"string": [
|
||||||
|
{
|
||||||
|
"name": "permissionmanager_desc",
|
||||||
|
"value": "permissionmanager"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "MainAbility_desc",
|
||||||
|
"value": "manage the permissions of all applications from the permission and application dimensions"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "MainAbility_label",
|
||||||
|
"value": "permission manage"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "no_permission",
|
||||||
|
"value": "no permission"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "access_permission",
|
||||||
|
"value": "access permission"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "permission_access_record",
|
||||||
|
"value": "permission access record"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "authority_management",
|
||||||
|
"value": "authority management"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "other_permissions",
|
||||||
|
"value": "other permissions"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "application",
|
||||||
|
"value": "application"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "authority",
|
||||||
|
"value": "authority"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "textInput_placeholder",
|
||||||
|
"value": "search application"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "allowed",
|
||||||
|
"value": "allowed"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "banned",
|
||||||
|
"value": "banned"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Authorization_failed",
|
||||||
|
"value": "Authorization failure!"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "reason_suffix",
|
||||||
|
"value": " and other permissions."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "separator",
|
||||||
|
"value": ","
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "visits",
|
||||||
|
"value": "Number of visits:"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "recent_visit",
|
||||||
|
"value": ";Recent visits:"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "morning",
|
||||||
|
"value": "am"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "afternoon",
|
||||||
|
"value": "pm"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "no_record",
|
||||||
|
"value": "No permission access record"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "record_time_limit",
|
||||||
|
"value": "Access records in the last 7 days"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#E5000000" d="M162.5 749c28 0 51.7 9.8 71 29.5 19.4 19.7 29.1 43.2 29.1 70.6s-9.8 50.8-29.5 70.2c-19.7 19.3-43.2 29-70.6 29s-50.8-9.7-70.2-29c-19.4-19.4-29-42.7-29-70.2s9.7-50.9 29-70.6c19.4-19.7 42.8-29.5 70.2-29.5z m2.2-672.8c27.5 0 51 9.7 70.5 29.2 19.4 19.5 29.2 43 29.2 70.5s-9.7 51-29.2 70.5-43 29.2-70.5 29.2-51-9.7-70.5-29.2c-19.4-19.5-29.2-43-29.2-70.6 0-27.5 9.7-51 29.2-70.5 19.4-19.4 42.9-29.1 70.5-29.1zM857.5 749c28 0 51.7 9.8 71 29.5 19.4 19.7 29.1 43.2 29.1 70.6s-9.8 50.8-29.5 70.2c-19.7 19.3-43.2 29-70.6 29s-50.8-9.7-70.2-29c-19.4-19.4-29-42.7-29-70.2s9.7-50.9 29-70.6c19.5-19.7 42.8-29.5 70.2-29.5z m2.2-672.8c27.5 0 51 9.7 70.5 29.2 19.4 19.5 29.2 43 29.2 70.5s-9.7 51-29.2 70.5-43 29.2-70.5 29.2-51-9.7-70.5-29.2C769.7 227 760 203.5 760 175.9c0-27.5 9.7-51 29.2-70.5s43-29.2 70.5-29.2z" /></svg>
|
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
viewBox="0 0 96 96" style="enable-background:new 0 0 96 96;" xml:space="preserve" fill="#99000000">
|
||||||
|
<path d="M88.7,14.6c0-1.7-1.3-3-3-3H50.1c-1.7,0-3,1.3-3,3s1.3,3,3,3h35.6C87.4,17.6,88.7,16.3,88.7,14.6z"/>
|
||||||
|
<path d="M85.7,26.2H58.5c-1.7,0-3,1.3-3,3s1.3,3,3,3h27.2c1.7,0,3-1.3,3-3S87.4,26.2,85.7,26.2z"/>
|
||||||
|
<path d="M85.7,40.7H66.9c-1.7,0-3,1.3-3,3s1.3,3,3,3h18.8c1.7,0,3-1.3,3-3S87.4,40.7,85.7,40.7z"/>
|
||||||
|
<path d="M9.4,29.1C7,22.9,9.6,15.3,15.1,11.4l2.2-1.5c0.2-0.1,0.3-0.2,0.5-0.3c4-2.4,9.2-1.1,11.7,2.9l10.2,16.9
|
||||||
|
c1.7,2.8,1.6,6.3-0.1,9l-2.3,4.2c-1.1,1.7-0.9,3.4,0.8,5.9c1.3,1.9,2.9,3.8,4.6,5.5c1.7,1.7,3.7,3.5,6.1,5.1c2,1.5,4.2,1.8,5.8,0.8
|
||||||
|
l4.2-2.3c2.7-1.8,6.2-1.8,9-0.1l16.9,10.2c4,2.4,5.3,7.6,2.9,11.7c-0.1,0.2-0.2,0.3-0.3,0.5l-1.5,2.2C81.7,87.4,74.1,90,68,87.6
|
||||||
|
c-8-3.1-14.2-6-18.6-8.7c-5.9-3.6-11.7-8.3-17.2-14c-5.7-5.6-10.3-11.4-14-17.3C15.5,43.2,12.5,37,9.4,29.1z M45.2,63.9
|
||||||
|
c-2.6-1.9-4.9-3.8-6.9-5.8c-1.9-2-3.7-4.1-5.2-6.3c-2.9-4.3-3.5-8.4-1-12.4l2.3-4.2l0.1-0.2c0.5-0.8,0.5-1.8,0-2.6L24.3,15.5
|
||||||
|
c-0.7-1.2-2.2-1.6-3.4-0.8l-0.1,0.1l-2.2,1.5c-3.4,2.4-4.9,7.1-3.6,10.6c3,7.7,5.8,13.6,8.3,17.6C26.7,50,31,55.3,36.4,60.7
|
||||||
|
c5.3,5.3,10.7,9.7,16.1,13.1c4,2.5,9.9,5.3,17.6,8.3c3.5,1.4,8.2-0.2,10.6-3.6l1.5-2.2l0.1-0.1c0.7-1.2,0.3-2.7-0.8-3.4L64.6,62.5
|
||||||
|
c-0.8-0.5-1.8-0.5-2.6,0l-0.2,0.1L57.6,65C53.7,67.4,49,66.7,45.2,63.9z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>IC/ic_floatingwindow</title>
|
||||||
|
<defs>
|
||||||
|
<path d="M12,3.5 L12,5 L9.32305804,5.001658 L8.89267325,5.01171091 C8.03615135,5.04387413 7.64900152,5.14557932 7.25370688,5.3569852 C6.86325774,5.56579969 6.56579969,5.86325774 6.3569852,6.25370688 C6.09290159,6.74750032 6,7.22858421 6,8.6277704 L6.001658,16.676942 L6.01171091,17.1073267 C6.04387413,17.9638487 6.14557932,18.3509985 6.3569852,18.7462931 C6.56579969,19.1367423 6.86325774,19.4342003 7.25370688,19.6430148 C7.69153706,19.8771689 8.11937528,19.9767436 9.18606965,19.9963062 L9.6277704,20 L13.8722296,20 L14.3557064,19.9954923 C15.3918853,19.9740999 15.8142239,19.874088 16.2462931,19.6430148 C16.6367423,19.4342003 16.9342003,19.1367423 17.1430148,18.7462931 C17.3771689,18.3084629 17.4767436,17.8806247 17.4963062,16.8139303 L17.5,16.3722296 L17.5,14 L19,14 L18.9989932,16.5937657 C18.9859758,17.9884263 18.8469417,18.6407938 18.5946788,19.1943859 L18.4657346,19.4536914 C18.1337211,20.0745027 17.6538954,20.5680807 17.0458564,20.9148264 L16.9536914,20.9657346 C16.3018396,21.3143488 15.6552671,21.5 13.8722296,21.5 L9.6277704,21.5 L9.40623426,21.4989932 C8.01157373,21.4859758 7.35920618,21.3469417 6.80561415,21.0946788 L6.54630859,20.9657346 C5.92549731,20.6337211 5.43191931,20.1538954 5.08517358,19.5458564 L5.03426541,19.4536914 C4.68565122,18.8018396 4.5,18.1552671 4.5,16.3722296 L4.5,8.6277704 C4.5,6.97961992 4.65862462,6.30249093 4.957955,5.69465027 L5.03426541,5.54630859 C5.36627892,4.92549731 5.84610464,4.43191931 6.4541436,4.08517358 L6.54630859,4.03426541 C7.16385245,3.70399934 7.77665804,3.51999365 9.35551601,3.5015395 L12,3.5 Z M17.9361148,2 C18.8276335,2 19.1509198,2.09282561 19.4768457,2.2671327 C19.8027716,2.4414398 20.0585602,2.69722837 20.2328673,3.0231543 C20.4071744,3.34908022 20.5,3.67236646 20.5,4.5638852 L20.5,10.4361148 C20.5,11.3276335 20.4071744,11.6509198 20.2328673,11.9768457 C20.0585602,12.3027716 19.8027716,12.5585602 19.4768457,12.7328673 C19.1509198,12.9071744 18.8276335,13 17.9361148,13 L15.5638852,13 C14.6723665,13 14.3490802,12.9071744 14.0231543,12.7328673 C13.6972284,12.5585602 13.4414398,12.3027716 13.2671327,11.9768457 C13.0928256,11.6509198 13,11.3276335 13,10.4361148 L13,4.5638852 C13,3.67236646 13.0928256,3.34908022 13.2671327,3.0231543 C13.4414398,2.69722837 13.6972284,2.4414398 14.0231543,2.2671327 C14.3490802,2.09282561 14.6723665,2 15.5638852,2 L17.9361148,2 Z" id="path-1"></path>
|
||||||
|
</defs>
|
||||||
|
<g id="IC/ic_floatingwindow" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="symbol/frame/symbol_grid24"></g>
|
||||||
|
<mask id="mask-2" fill="white">
|
||||||
|
<use xlink:href="#path-1"></use>
|
||||||
|
</mask>
|
||||||
|
<g id="形状结合" fill-rule="nonzero"></g>
|
||||||
|
<g id="编组" mask="url(#mask-2)" fill="#000000" fill-opacity="0.9">
|
||||||
|
<g id="color/#000000">
|
||||||
|
<rect x="0" y="0" width="24" height="24"></rect>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 3.1 KiB |
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
viewBox="0 0 96 96" style="enable-background:new 0 0 96 96;" xml:space="preserve">
|
||||||
|
<path d="M78.2,10.6c-1.5,3.7-5.6,5.4-9.3,3.9C65.3,13,63.5,8.8,65,5.2c1.5-3.7,5.6-5.4,9.3-3.9C77.9,2.8,79.6,7,78.2,10.6z
|
||||||
|
M5.3,68.8L5.3,68.8l25-3.4c0,0,0.1,0,0.1-0.1L38.2,54c0.6,1.6,1.6,3.1,3.2,4.4c0.7,0.6,3,2.2,5.7,4.2l-8.5,10.6
|
||||||
|
c-0.7,1-1.8,1.8-3.2,2.2c-0.6,0.2-1.2,0.2-1.8,0.2l-28.1-1l0,0c-0.2,0-0.4,0-0.5-0.1c-1.5-0.4-2.5-1.9-2.1-3.4
|
||||||
|
C3.2,69.8,4.1,68.9,5.3,68.8z M91.7,45.6C91.6,45.7,91.6,45.7,91.7,45.6l-18.4,4.3l0,0c-0.1,0-0.2,0-0.3,0c-1.7,0.1-3.3-0.8-4.1-2.3
|
||||||
|
l0,0l-2-4.5c2.2-3.3,4.5-6.9,6-9.8l2.3,8.3l15.9-0.3c0.3,0,0.7,0,1,0.2c1.1,0.5,1.6,1.7,1.2,2.8C92.8,45,92.3,45.5,91.7,45.6z
|
||||||
|
M32.4,49.8c-0.1,0.3-0.3,0.6-0.6,0.9c-0.9,0.8-2.2,0.7-3-0.1c-0.5-0.5-0.6-1.2-0.5-1.8l0,0l5.2-21l0,0c0-0.2,0.1-0.3,0.1-0.5
|
||||||
|
c0.4-1.1,1.2-2,2.2-2.4v-0.1l21.2-8l0,0c2.2-0.7,4.6-0.7,6.9,0.2c5.1,2.1,7.5,7.9,5.5,13.1c0,0.1-0.3,0.7-0.4,0.9
|
||||||
|
c-2.8,6.2-11.5,18-11.5,18L72,61l0.1,0.1c0.7,0.6,1.3,1.4,1.6,2.3v0.1l0.1,0.4c0,0.1,0,0.1,0,0.2L81,91.8l0,0c0,0.1,0,0.2,0,0.4
|
||||||
|
c0.1,1.6-1.1,2.9-2.6,3.1c-1.2,0.1-2.3-0.6-2.8-1.7l0,0c-1.8-3.8-11.7-24.4-11.7-24.4S46.2,56.8,44.1,55c-0.3-0.2-0.5-0.4-0.7-0.7
|
||||||
|
c-1.9-2-2.5-5-1.4-7.7c0.1-0.2,0.1-0.3,0.2-0.5c0-0.1,0-0.1,0-0.1l4.4-11.6c0.9-0.6,1.7-1.1,2.3-1.4c1.8-0.7,5.4-2.9,5-4
|
||||||
|
c-0.5-1.1-11.4,3-12.9,3.6l-0.3,0.1L32.4,49.8L32.4,49.8z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
viewBox="0 0 96 96" style="enable-background:new 0 0 96 96;" xml:space="preserve">
|
||||||
|
<g>
|
||||||
|
<path d="M26.7,49.7c-0.4,1-0.8,2.1-1.1,3.2c-0.4,1.4,0.2,2.9,1.5,3.5c0.4,0.2,0.9,0.3,1.4,0.3c0.9,0,1.8-0.4,2.4-1.1
|
||||||
|
c0.6-0.7,1.1-1.4,1.7-2c2.8-3,6-5.6,9.4-7.6c5.7-3.4,12-4.8,22.5-5.2v8.7c0,1.2,0.7,2.3,1.8,2.7c1.1,0.5,2.3,0.3,3.2-0.5L90.6,33
|
||||||
|
c0.6-0.6,1-1.4,1-2.2s-0.4-1.7-1-2.2l-21.3-19c-0.9-0.8-2.1-1-3.2-0.5s-1.8,1.6-1.8,2.7v9.7C47.5,23.1,32.7,34.2,26.7,49.7z
|
||||||
|
M64.9,27.5l2.7-0.3c1.5-0.1,2.7-1.4,2.7-3v-5.8l13.8,12.2L70.3,43v-5.1c0-0.8-0.3-1.6-0.9-2.2c-0.6-0.5-1.3-0.8-2.1-0.8h-0.1
|
||||||
|
L64.1,35c-11.4,0.4-18.7,2.2-25.2,6C45.4,33.4,54.7,28.5,64.9,27.5z"/>
|
||||||
|
<path d="M89,45c-1.7,0-3,1.3-3,3v23c0,3.9-3.1,7-7,7H17c-3.9,0-7-3.1-7-7V25c0-3.9,3.1-7,7-7h35.3c1.7,0,3-1.3,3-3s-1.3-3-3-3H17
|
||||||
|
C9.8,12,4,17.8,4,25v46c0,7.2,5.8,13,13,13h62c7.2,0,13-5.8,13-13V48C92,46.4,90.7,45,89,45z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.0 KiB |
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>HM/ic/24x24/more1.5</title>
|
||||||
|
<g id="HM/ic/24x24/more1.5" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<path d="M14.97495,2.5 C18.6252,2.5 21.57495,5.45 21.57495,9.075 C21.57495,12.7 18.6252,15.65 15.0002,15.65 C13.72495,15.65 12.54995,15.3 11.54995,14.675 L11.54995,14.675 L10.94995,15.275 L11.04995,16.125 C11.04995,16.5 10.89995,16.825 10.64995,17.05 L10.64995,17.05 L9.94995,17.75 C9.6762,18.02375 9.3687,18.15 9.04995,18.15 L9.04995,18.15 L8.97495,18.15 L8.19995,18.05 L7.59995,18.65 L7.67495,19.225 C7.69995,19.325 7.69995,19.4 7.69995,19.5 C7.69995,19.8 7.59995,20.05 7.42495,20.275 L7.42495,20.275 L6.54995,21.175 C6.29995,21.45 6.02495,21.55 5.49995,21.55 L5.49995,21.55 L3.77495,21.55 C2.99995,21.55 2.49995,20.9 2.49995,20.325 L2.49995,20.325 L2.49995,17.9 L8.87495,11.5 C8.57495,10.75 8.39995,9.925 8.39995,9.075 C8.39995,5.45 11.34995,2.5 14.97495,2.5 Z M14.97495,4 C12.17495,4 9.89995,6.275 9.89995,9.075 C9.89995,10.075 10.19995,11 10.69995,11.8 L10.69995,11.8 L3.97495,18.5 L3.97495,20.05 L5.54995,20.05 L6.17495,19.425 C6.17495,19.425 6.09995,19 6.07495,18.725 C6.02495,18.35 6.14995,17.975 6.39995,17.725 C6.54995,17.575 7.14995,16.95 7.24995,16.875 C7.39995,16.7 7.79995,16.5 8.19995,16.55 C8.54995,16.6 8.94995,16.65 8.94995,16.65 L8.94995,16.65 L9.54995,16.05 C9.54995,16.05 9.47495,15.55 9.42495,15.325 C9.37495,14.925 9.54995,14.525 9.79995,14.3 C9.89995,14.2 11.42495,12.7 11.42495,12.7 C12.32495,13.6 13.57495,14.15 14.97495,14.15 C17.79995,14.15 20.04995,11.875 20.04995,9.075 C20.04995,6.275 17.77495,4 14.97495,4 Z M15.07505,7.374975 C16.0138,7.374975 16.77505,8.135975 16.77505,9.074975 C16.77505,10.013975 16.0138,10.774975 15.07505,10.774975 C14.13605,10.774975 13.37505,10.013975 13.37505,9.074975 C13.37505,8.135975 14.13605,7.374975 15.07505,7.374975 Z" id="Combined-Shape" fill="#99000000"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.0 KiB |
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>HM/ic/24x24/Multi-device vector</title>
|
||||||
|
<g id="HM/ic/24x24/Multi-device-vector" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<path d="M19.6588576,7.3125 C20.4946564,7.3125 20.7977373,7.39952401 21.1032928,7.56293691 C21.4088484,7.72634981 21.6486502,7.9661516 21.8120631,8.27170715 L21.8372288,8.32001023 C21.9843953,8.61064163 22.0625,8.92433297 22.0625,9.71614237 L22.0625,11.84375 C22.235089,11.84375 22.375,11.983661 22.375,12.15625 L22.375,13.40625 C22.375,13.578839 22.235089,13.71875 22.0625,13.71875 L22.0617784,19.4114769 C22.053128,20.1515665 21.9668753,20.4388192 21.8120631,20.7282928 C21.6486502,21.0338484 21.4088484,21.2736502 21.1032928,21.4370631 L21.0549898,21.4622288 C20.7643584,21.6093953 20.450667,21.6875 19.6588576,21.6875 L16.2135231,21.6867784 C15.4734335,21.678128 15.1861808,21.5918753 14.8967072,21.4370631 C14.5911516,21.2736502 14.3513498,21.0338484 14.1879369,20.7282928 L14.1627712,20.6799898 C14.0156047,20.3893584 13.9375,20.075667 13.9375,19.2838576 L13.9375,9.71614237 C13.9375,8.88034356 14.024524,8.57726271 14.1879369,8.27170715 C14.3513498,7.9661516 14.5911516,7.72634981 14.8967072,7.56293691 L14.9450102,7.53777123 C15.2356416,7.39060465 15.549333,7.3125 16.3411424,7.3125 L19.6588576,7.3125 Z M16.3411424,8.8125 C15.9303677,8.8125 15.7697305,8.82642519 15.687621,8.8492988 L15.6380813,8.86805408 L15.6041054,8.88565671 C15.5599526,8.90926991 15.5342699,8.9349526 15.5106567,8.97910544 C15.494721,9.00890257 15.4877579,9.02331282 15.4822764,9.04312475 L15.474229,9.07949249 C15.4554896,9.17653291 15.4424763,9.33186667 15.4386591,9.56602452 L15.4375,19.2838576 C15.4375,19.6946323 15.4514252,19.8552695 15.4742988,19.937379 L15.4930541,19.9869187 L15.5106567,20.0208946 C15.5342699,20.0650474 15.5599526,20.0907301 15.6041054,20.1143433 L15.6688856,20.1430773 C15.7282488,20.1633475 15.8095538,20.1749073 15.9764945,20.1813308 L16.3411424,20.1875 L19.6588576,20.1875 C20.0696323,20.1875 20.2302695,20.1735748 20.312379,20.1507012 L20.3619187,20.1319459 L20.3958946,20.1143433 C20.4400474,20.0907301 20.4657301,20.0650474 20.4893433,20.0208946 L20.5180773,19.9561144 C20.5383475,19.8967512 20.5499073,19.8154462 20.5563308,19.6485055 L20.5625,19.2838576 L20.5625,9.71614237 C20.5625,9.30536767 20.5485748,9.14473053 20.5257012,9.06262098 L20.5069459,9.01308133 L20.4893433,8.97910544 C20.4657301,8.9349526 20.4400474,8.90926991 20.3958946,8.88565671 C20.3660974,8.86972103 20.3516872,8.8627579 20.3318752,8.8572764 L20.2955075,8.84922901 C20.1984671,8.83048964 20.0431333,8.8174763 19.8089755,8.81365905 L16.3411424,8.8125 Z M17.2291667,2.46875 C18.3792596,2.46875 19.321062,3.36054828 19.4007837,4.49035493 L19.40625,4.64583333 L19.40575,5.81175 L17.90575,5.81175 L17.90625,4.64583333 C17.90625,4.30588533 17.6557206,4.0244516 17.3292211,3.97609132 L17.2291667,3.96875 L3.77083333,3.96875 C3.43088533,3.96875 3.1494516,4.21927937 3.10109132,4.54577892 L3.09375,4.64583333 L3.09375,13.3541667 C3.09375,13.6941147 3.34427937,13.9755484 3.67077892,14.0239087 L3.77083333,14.03125 L12.43675,14.03075 L12.43675,15.53075 L3.77083333,15.53125 C2.62074036,15.53125 1.67893804,14.6394517 1.59921628,13.5096451 L1.59375,13.3541667 L1.59375,4.64583333 C1.59375,3.49574036 2.48554828,2.55393804 3.61535493,2.47421628 L3.77083333,2.46875 L17.2291667,2.46875 Z" id="形状结合" fill="#99000000"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 3.5 KiB |
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>HM/ic/24x24/ic_nearby</title>
|
||||||
|
<g id="HM/ic/24x24/ic_nearby" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" fill-opacity="0.9">
|
||||||
|
<path d="M12,1 C14.9437925,1 17.7055736,2.16266222 19.752529,4.19626361 C20.0202839,4.46227172 20.0452692,4.88001852 19.8270348,5.17433848 L19.7542674,5.25865649 L16.5608852,8.45349449 C16.5258891,8.52237714 16.4795684,8.58698148 16.4219251,8.64453927 C16.3642819,8.70209706 16.2996089,8.74832189 16.2306744,8.78321581 L13.8275423,11.1863159 C13.9383848,11.4348944 14,11.7102517 14,12 C14,13.1045695 13.1045695,14 12,14 C10.8954305,14 10,13.1045695 10,12 C10,10.8954305 10.8954305,10 12,10 C12.2640695,10 12.5161858,10.0511779 12.7469714,10.1441562 L14.7579106,8.13187506 C13.9642117,7.56455608 13.0076029,7.25 12,7.25 C9.37664744,7.25 7.25,9.37664744 7.25,12 C7.25,14.6233526 9.37664744,16.75 12,16.75 C14.6233526,16.75 16.75,14.6233526 16.75,12 C16.75,11.733302 16.7280951,11.4696976 16.6848687,11.2108711 C16.6166361,10.8023161 16.892522,10.4158034 17.301077,10.3475709 C17.709632,10.2793383 18.0961447,10.5552242 18.1643772,10.9637792 C18.2212276,11.3041811 18.25,11.6504302 18.25,12 C18.25,15.4517797 15.4517797,18.25 12,18.25 C8.54822031,18.25 5.75,15.4517797 5.75,12 C5.75,8.54822031 8.54822031,5.75 12,5.75 C13.4102831,5.75 14.7474594,6.21997228 15.8290828,7.05978622 L18.139,4.751 L17.9728918,4.61183304 C16.3857713,3.32623459 14.4198236,2.57734388 12.3308269,2.5056688 L12,2.5 C6.75329488,2.5 2.5,6.75329488 2.5,12 C2.5,17.2467051 6.75329488,21.5 12,21.5 C17.2467051,21.5 21.5,17.2467051 21.5,12 C21.5,10.438282 21.1233622,8.9324315 20.4124178,7.58178142 C20.2194832,7.21524478 20.3602155,6.76170371 20.7267521,6.56876909 C21.0932887,6.37583447 21.5468298,6.51656672 21.7397644,6.88310336 C22.5634355,8.44791126 23,10.1933572 23,12 C23,18.0751322 18.0751322,23 12,23 C5.92486775,23 1,18.0751322 1,12 C1,5.92486775 5.92486775,1 12,1 Z" id="形状结合" fill="#000000"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.1 KiB |
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>Public/ic_public_calendar</title>
|
||||||
|
<defs>
|
||||||
|
<path d="M16.25,1 C16.7628358,1 17.1855072,1.38604019 17.2432723,1.88337887 L17.25,2 L17.25,4 C17.25,4.55228475 16.8022847,5 16.25,5 C15.6977153,5 15.25,4.55228475 15.25,4 L15.25,3.5 L8.75,3.5 L8.75,4 C8.75,4.55228475 8.30228475,5 7.75,5 C7.19771525,5 6.75,4.55228475 6.75,4 L6.75,3.5 L6,3.5 C4.64269002,3.5 3.53801707,4.5816677 3.50096045,5.93002379 L3.5,7.5 L20.5,7.5 L20.5,6 C20.5,4.70385488 19.5136228,3.6380905 18.250561,3.51239958 L18.2509202,2.00774235 C20.3431683,2.13724416 22,3.87513518 22,6 L22,18 C22,20.209139 20.209139,22 18,22 L6,22 C3.790861,22 2,20.209139 2,18 L2,6 C2,3.790861 3.790861,2 6,2 L6.75,2 C6.75,1.44771525 7.19771525,1 7.75,1 C8.30228475,1 8.75,1.44771525 8.75,2 L15.25,2 C15.25,1.44771525 15.6977153,1 16.25,1 Z M20.5,9 L3.5,9 L3.5,18 C3.5,19.35731 4.5816677,20.4619829 5.93002379,20.4990396 L6,20.5 L18,20.5 C19.35731,20.5 20.4619829,19.4183323 20.4990396,18.0699762 L20.5,18 L20.5,9 Z" id="path-1"></path>
|
||||||
|
</defs>
|
||||||
|
<g id="Public/ic_public_calendar" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<mask id="mask-2" fill="white">
|
||||||
|
<use xlink:href="#path-1"></use>
|
||||||
|
</mask>
|
||||||
|
<use id="形状结合" fill="#99000000" fill-rule="nonzero" xlink:href="#path-1"></use>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>Public/ic_public_camera</title>
|
||||||
|
<defs>
|
||||||
|
<path d="M15.1205992,3 C15.7758689,3 16.3895761,3.32098956 16.7633392,3.85920838 L17.9027778,5.5 L20,5.5 C21.6568542,5.5 23,6.84314575 23,8.5 L23,17.5 C23,19.1568542 21.6568542,20.5 20,20.5 L4,20.5 C2.34314575,20.5 1,19.1568542 1,17.5 L1,8.5 C1,6.84314575 2.34314575,5.5 4,5.5 L6.09722222,5.5 L7.23666085,3.85920838 C7.61042392,3.32098956 8.22413111,3 8.87940078,3 L15.1205992,3 Z M15.1205992,4.5 L8.87940078,4.5 C8.71558336,4.5 8.56215656,4.58024739 8.4687158,4.7148021 L6.88177281,7 L4,7 C3.17157288,7 2.5,7.67157288 2.5,8.5 L2.5,17.5 C2.5,18.3284271 3.17157288,19 4,19 L20,19 C20.8284271,19 21.5,18.3284271 21.5,17.5 L21.5,8.5 C21.5,7.67157288 20.8284271,7 20,7 L17.1182272,7 L15.5312842,4.7148021 C15.4378434,4.58024739 15.2844166,4.5 15.1205992,4.5 Z M12,7.75 C14.6233526,7.75 16.75,9.87664744 16.75,12.5 C16.75,15.1233526 14.6233526,17.25 12,17.25 C9.37664744,17.25 7.25,15.1233526 7.25,12.5 C7.25,9.87664744 9.37664744,7.75 12,7.75 Z M12,9.25 C10.2050746,9.25 8.75,10.7050746 8.75,12.5 C8.75,14.2949254 10.2050746,15.75 12,15.75 C13.7949254,15.75 15.25,14.2949254 15.25,12.5 C15.25,10.7050746 13.7949254,9.25 12,9.25 Z" id="path-1"></path>
|
||||||
|
</defs>
|
||||||
|
<g id="Public/ic_public_camera" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<mask id="mask-2" fill="white">
|
||||||
|
<use xlink:href="#path-1"></use>
|
||||||
|
</mask>
|
||||||
|
<use id="合并形状" fill="#99000000" fill-rule="nonzero" xlink:href="#path-1"></use>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.7 KiB |
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>Public/ic_public_contacts_group</title>
|
||||||
|
<defs>
|
||||||
|
<path d="M11,2.5 C13.8994949,2.5 16.25,4.85050506 16.25,7.75 C16.25,9.51473805 15.3792831,11.0761093 14.0440228,12.0279401 C17.516287,13.2752612 20,16.5975795 20,20.5 C20,20.9142136 19.6642136,21.25 19.25,21.25 C18.8357864,21.25 18.5,20.9142136 18.5,20.5 C18.5,16.3578644 15.1421356,13 11,13 C6.85786438,13 3.5,16.3578644 3.5,20.5 C3.5,20.8796958 3.21784612,21.193491 2.85177056,21.2431534 L2.75,21.25 L2.75,21.25 C2.33578644,21.25 2,20.9142136 2,20.5 C2,16.5975795 4.48371302,13.2752612 7.95660209,12.0275821 C6.62071692,11.0761093 5.75,9.51473805 5.75,7.75 C5.75,4.85050506 8.10050506,2.5 11,2.5 Z M16.8455126,11.990365 L16.9001786,11.9998698 L16.9001786,11.9998698 C20.1151694,13.1058156 21.5244976,15.7436283 21.9852941,16.7777778 C22.1978509,17.2548115 22.3699793,17.8850275 22.5016794,18.6684258 C22.6803621,19.731297 21.9852991,20.7391431 20.939535,20.957517 C20.9790064,20.8115098 21,20.6582066 21,20.5 L20.9991975,20.3725581 C20.9583277,17.1285533 19.3592048,14.1922682 16.8371835,12.3780488 C16.8267847,12.3705684 16.8087299,12.357267 16.7830192,12.3381447 L16.7386575,12.3051674 C16.6613354,12.2473649 16.6455116,12.1378247 16.7033141,12.0605026 C16.7374229,12.0148754 16.790703,11.989685 16.8455126,11.990365 Z M11,4 C8.92893219,4 7.25,5.67893219 7.25,7.75 C7.25,9.82106781 8.92893219,11.5 11,11.5 C13.0710678,11.5 14.75,9.82106781 14.75,7.75 C14.75,5.67893219 13.0710678,4 11,4 Z M14.3933827,2.26605683 C16.8326968,2.46603293 18.75,4.50911139 18.75,7 C18.75,8.63466202 17.9242699,10.0764644 16.6671636,10.9310533 L16.6534314,10.9403132 L16.6534314,10.9403132 L16.6390036,10.9498595 C16.582224,10.9872983 16.505845,10.9716194 16.4684062,10.9148398 C16.4515547,10.8892829 16.445116,10.8588907 16.4493121,10.8295803 L16.4636103,10.7871659 L16.4636103,10.7871659 C16.9705014,9.8763586 17.25,8.83638014 17.25,7.75 C17.25,5.54150753 16.1045197,3.60055631 14.3752757,2.48882859 C14.3740147,2.48801791 14.3670156,2.48382955 14.3542783,2.4762635 L14.3308634,2.4623901 C14.2806258,2.43263244 14.2640236,2.36778346 14.2937812,2.31754587 C14.3143973,2.28274139 14.3530659,2.26275164 14.3933827,2.26605683 Z" id="path-1"></path>
|
||||||
|
</defs>
|
||||||
|
<g id="Public/ic_public_contacts_group" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<mask id="mask-2" fill="white">
|
||||||
|
<use xlink:href="#path-1"></use>
|
||||||
|
</mask>
|
||||||
|
<use id="蒙版" fill="#99000000" fill-rule="nonzero" xlink:href="#path-1"></use>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.6 KiB |
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>Public/ic_public_folder</title>
|
||||||
|
<defs>
|
||||||
|
<path d="M7.37867966,3 C7.77650439,3 8.15803526,3.15803526 8.43933983,3.43933983 L11.7071068,6.70710678 C11.8946432,6.89464316 12.1489971,7 12.4142136,7 L19,7 C19.149679,7 19.2974379,7.00822125 19.4428497,7.02423682 C19.2349828,6.16929644 18.4757047,5.5288976 17.5622948,5.50095171 L17.5,5.5 L11.957,5.49986632 L10.45675,3.99986632 L17.5,4 C19.4329966,4 21,5.56700338 21,7.5 L21.0001204,7.53519846 C22.1956568,8.22683444 23,9.51948501 23,11 L23,17 C23,19.209139 21.209139,21 19,21 L5,21 C2.790861,21 1,19.209139 1,17 L1,7 C1,4.790861 2.790861,3 5,3 L7.37867966,3 Z M7.37867966,4.5 L5,4.5 C3.64269002,4.5 2.53801707,5.5816677 2.50096045,6.93002379 L2.5,17 C2.5,18.35731 3.5816677,19.4619829 4.93002379,19.4990396 L5,19.5 L19,19.5 C20.35731,19.5 21.4619829,18.4183323 21.4990396,17.0699762 L21.5,17 L21.5,11 C21.5,9.64269002 20.4183323,8.53801707 19.0699762,8.50096045 L12.4142136,8.5 C11.7787991,8.5 11.1683251,8.25809996 10.7059116,7.82529783 L10.6464466,7.76776695 L7.37867966,4.5 Z" id="path-1"></path>
|
||||||
|
</defs>
|
||||||
|
<g id="Public/ic_public_folder" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<mask id="mask-2" fill="white">
|
||||||
|
<use xlink:href="#path-1"></use>
|
||||||
|
</mask>
|
||||||
|
<use id="形状结合" fill="#99000000" fill-rule="nonzero" xlink:href="#path-1"></use>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>Public/ic_public_gps</title>
|
||||||
|
<defs>
|
||||||
|
<path d="M12,0.890443665 C17.1054507,0.890443665 21.25,4.95664638 21.25,9.97979602 C21.25,11.9360332 20.6574499,13.8475128 19.5576286,15.7794054 C18.8729064,16.982155 18.0501448,18.1145504 16.9608635,19.4075471 L16.9608635,19.4075471 L16.694253,19.7210681 L16.4170134,20.0414657 C16.3227849,20.1494899 16.226719,20.2587783 16.1287501,20.3694494 C15.9102985,20.6162244 15.6650022,20.8755327 15.3927717,21.1475453 L15.3927717,21.1475453 L15.1835472,21.3539395 C15.0406956,21.4931272 14.8911049,21.6355018 14.7347638,21.7810844 L14.7347638,21.7810844 L14.495188,22.0018672 L14.495188,22.0018672 L14.3716004,22.1140683 L14.1168206,22.3420995 C14.0302033,22.4189177 13.941895,22.4965447 13.8518942,22.5749831 L13.8518942,22.5749831 L13.576813,22.812735 C12.7041229,23.5609204 11.420977,23.5841619 10.509368,22.8615879 L10.509368,22.8615879 L10.4382537,22.8023123 L10.1073598,22.5137335 L9.90321903,22.3340223 L9.61389638,22.0766955 L9.34473731,21.8339368 L9.09562633,21.6056114 L8.86644795,21.3915843 L8.724679,21.2567766 L8.59168343,21.1282238 L8.46742704,21.005886 L8.35187559,20.8897232 L8.24499487,20.7796955 C8.22790207,20.7618666 8.21116914,20.7442916 8.19479534,20.7269698 L8.19479534,20.7269698 L8.10085655,20.6260697 L7.86894106,20.3672896 L7.61273271,20.0767393 C7.57055128,20.0285012 7.5286302,19.9803553 7.48697003,19.9322997 L7.48697003,19.9322997 L7.24014438,19.6450348 L6.99960722,19.3598463 L6.99960722,19.3598463 L6.88170517,19.2180024 L6.65065082,18.9357582 L6.42595171,18.6553632 C4.02623205,15.6274382 2.75,12.9090303 2.75,9.97979602 C2.75,4.99342455 6.70791088,0.971543045 11.7334486,0.891584596 L11.7334486,0.891584596 L11.8799375,0.890443665 Z M12,2.39041996 L11.8859001,2.39041996 L11.751346,2.39146593 C7.55083692,2.4583177 4.25,5.81250514 4.25,9.97979602 C4.25,12.896509 5.7991974,15.7221073 8.73645395,19.0830958 L8.73645395,19.0830958 L8.98797346,19.3684114 L9.21242661,19.6189224 C9.22500367,19.6326529 9.23793618,19.6466487 9.25122371,19.6609093 L9.25122371,19.6609093 L9.33520518,19.7496461 L9.42768459,19.8447124 L9.52863979,19.9460825 L9.69591626,20.1099012 L9.88213873,20.2877593 L10.0872325,20.4795705 L10.2344088,20.6151536 L10.4707886,20.8300276 L10.7258404,21.058624 L10.9994895,21.3008564 L11.4099685,21.659761 L11.4539143,21.6964471 C11.7903355,21.963019 12.2735456,21.9542667 12.6005016,21.6739567 L12.6005016,21.6739567 L12.8630218,21.4470837 L13.1154007,21.2252993 C13.1978358,21.152221 13.2785793,21.0799935 13.3576298,21.0086194 L13.3576298,21.0086194 L13.5897008,20.7970601 L13.8116053,20.5906375 L14.0233349,20.3893676 L14.2248812,20.1932664 C14.5195589,19.9029991 14.7798395,19.6302305 15.0055957,19.3752039 C15.0481588,19.3271223 15.0904304,19.279197 15.1324106,19.2314252 L15.1324106,19.2314252 L15.3807972,18.9466135 C15.4216128,18.8994442 15.4621375,18.8524226 15.5023714,18.8055459 L15.5023714,18.8055459 L15.7402879,18.5260009 L15.9712367,18.2497939 C16.1228823,18.066738 16.2698895,17.8858152 16.4122716,17.7068412 L16.4122716,17.7068412 L16.6223776,17.4398186 C18.723223,14.739479 19.75,12.4708886 19.75,9.97979602 C19.75,5.7915486 16.2833634,2.39041996 12,2.39041996 L12,2.39041996 Z M12,7.75 C13.2426407,7.75 14.25,8.75735931 14.25,10 C14.25,11.2426407 13.2426407,12.25 12,12.25 C10.7573593,12.25 9.75,11.2426407 9.75,10 C9.75,8.75735931 10.7573593,7.75 12,7.75 Z" id="path-1"></path>
|
||||||
|
</defs>
|
||||||
|
<g id="Public/ic_public_gps" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<mask id="mask-2" fill="white">
|
||||||
|
<use xlink:href="#path-1"></use>
|
||||||
|
</mask>
|
||||||
|
<use id="蒙版" fill="#99000000" fill-rule="nonzero" xlink:href="#path-1"></use>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 3.8 KiB |
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>Public/ic_public_message</title>
|
||||||
|
<defs>
|
||||||
|
<path d="M15.75,3 C19.7140238,3 22.9350055,6.18134145 22.9990287,10.130108 L23,10.25 L23,10.5 C23,14.4640238 19.8186586,17.6850055 15.869892,17.7490287 L15.75,17.75 L13.8105,17.75 L9.78033009,21.7803301 C9.4991526,22.0615076 9.05026186,22.0727547 8.75566731,21.8140714 L8.71966991,21.7803301 C8.43849242,21.4991526 8.42724532,21.0502619 8.68592862,20.7556673 L8.71966991,20.7196699 L12.9696699,16.4696699 C13.0986012,16.3407387 13.2696414,16.2635976 13.4504659,16.2516361 L13.5,16.25 L15.75,16.25 C18.8938809,16.25 21.4484526,13.7268671 21.4992297,10.5950868 L21.5,10.5 L21.5,10.25 C21.5,7.10611906 18.9768671,4.55154738 15.8450868,4.50077034 L15.75,4.5 L8.25,4.5 C5.10611906,4.5 2.55154738,7.02313287 2.50077034,10.1549132 L2.5,10.25 L2.5,10.5 C2.5,13.6438809 5.02313287,16.1984526 8.15491324,16.2492297 L8.25,16.25 L9.25,16.25 C9.66421356,16.25 10,16.5857864 10,17 C10,17.3994202 9.68777001,17.7259152 9.2940682,17.7487268 L9.25,17.75 L8.25,17.75 C4.28597621,17.75 1.06499452,14.5686586 1.00097129,10.619892 L1,10.5 L1,10.25 C1,6.28597621 4.18134145,3.06499452 8.13010799,3.00097129 L8.25,3 L15.75,3 Z" id="path-1"></path>
|
||||||
|
</defs>
|
||||||
|
<g id="Public/ic_public_message" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<mask id="mask-2" fill="white">
|
||||||
|
<use xlink:href="#path-1"></use>
|
||||||
|
</mask>
|
||||||
|
<use id="路径" fill="#99000000" fill-rule="nonzero" xlink:href="#path-1"></use>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.7 KiB |
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>Public/ic_public_phone</title>
|
||||||
|
<defs>
|
||||||
|
<path d="M5.16720725,2.15694972 C4.57981912,2.29147814 4.01663811,2.67469617 3.45795888,3.28222699 L3.40000863,3.34652585 L3.41706088,3.3290245 C2.31983567,4.41733995 1.86268744,5.99225358 2.20824887,7.49585665 C2.84070426,10.2182299 4.91223973,13.4662736 7.70579392,16.2883966 C10.5332577,19.0872915 13.7813017,21.1588206 16.5019346,21.7908739 L16.5941801,21.8110531 C18.0405745,22.1115169 19.5405408,21.676154 20.6032636,20.6488379 L20.6530605,20.5992242 L20.6367826,20.6144113 C21.3182937,20.0075363 21.7360372,19.3963547 21.858708,18.7555609 C22.0403569,17.8066839 21.6727677,16.8312994 20.9172668,16.2234479 L18.8910284,14.5810212 L18.8910284,14.5810212 C17.9729968,13.7661146 16.5931939,13.7836376 15.699312,14.6157694 L15.6477052,14.665379 L15.6228063,14.690554 L14.686639,15.6828975 C14.5546026,15.8149102 14.3280746,15.8409839 14.1527582,15.7314508 C13.3172557,15.2120891 12.1303644,14.1987708 10.9802683,13.0284399 L10.7611357,12.8108428 C9.67601351,11.7221684 8.75502696,10.6301338 8.26897505,9.84821364 C8.15853902,9.67144831 8.18461264,9.44492031 8.33152313,9.29843477 L9.30896885,8.37671655 L9.33414385,8.35181763 L9.37464007,8.30982875 C10.2003067,7.42306041 10.2324768,6.07746659 9.46508279,5.162393 L9.3537796,5.03091264 L8.22723777,3.64204688 C8.07133397,3.44889272 7.91700627,3.25742016 7.77607494,3.08225607 C7.16822347,2.32675513 6.19283903,1.95916594 5.243962,2.14081487 L5.16720725,2.15694972 Z M20.3854606,18.4735287 C20.3347566,18.7383909 20.0964509,19.087045 19.6392388,19.4941853 L19.6055231,19.5261346 C18.8823263,20.255252 17.8371496,20.5586342 16.839641,20.3293845 C14.4293391,19.7694247 11.4077574,17.8423281 8.7664403,15.2277501 C6.15720291,12.5917737 4.23009995,9.57019147 3.66973827,7.15815029 C3.44742729,6.19082408 3.72736923,5.17688065 4.41193762,4.45676796 L4.50533759,4.36028407 C4.91247789,3.90307193 5.26113202,3.66476633 5.52599414,3.61406226 C5.92515246,3.53764911 6.34435194,3.69563113 6.60738014,4.02254988 L8.02359877,5.77349596 L8.33190757,6.14585543 C8.59711542,6.47956509 8.58061124,6.96151558 8.28584937,7.27815087 L8.26649427,7.29801532 L7.28729807,8.22179031 C6.630534,8.87624912 6.51580142,9.8730476 6.99594523,10.641556 C7.58651914,11.5916262 8.67168241,12.862672 9.91964876,14.08906 L10.1558071,14.3268132 C11.2995201,15.4658 12.4692794,16.45116 13.3594158,17.0044806 L13.4145885,17.0377028 C14.1737396,17.4779592 15.1385121,17.3537064 15.7632834,16.7271225 L16.7010407,15.7332689 L16.7309899,15.7045601 C17.0383508,15.4185862 17.5199701,15.4023958 17.8559701,15.669668 L18.0404137,15.8240228 C18.3872561,16.1094041 19.2522673,16.8090681 19.976973,17.3921427 C20.3038918,17.6551709 20.4618738,18.0743704 20.3854606,18.4735287 Z" id="path-1"></path>
|
||||||
|
</defs>
|
||||||
|
<g id="Public/ic_public_phone" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<mask id="mask-2" fill="white">
|
||||||
|
<use xlink:href="#path-1"></use>
|
||||||
|
</mask>
|
||||||
|
<use id="形状" fill="#99000000" fill-rule="nonzero" xlink:href="#path-1"></use>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 3.2 KiB |
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>Public/ic_public_voice</title>
|
||||||
|
<defs>
|
||||||
|
<path d="M18.75,10.5 C19.1642136,10.5 19.5,10.8357864 19.5,11.25 C19.5,15.1388445 16.5402456,18.3364013 12.750487,18.7129202 L12.75,21.25 C12.75,21.6642136 12.4142136,22 12,22 C11.6005798,22 11.2740848,21.68777 11.2512732,21.2940682 L11.25,21.25 L11.2505192,18.7130201 C7.46027831,18.3369673 4.5,15.1391887 4.5,11.25 C4.5,10.8357864 4.83578644,10.5 5.25,10.5 C5.66421356,10.5 6,10.8357864 6,11.25 C6,14.5637085 8.6862915,17.25 12,17.25 C15.3137085,17.25 18,14.5637085 18,11.25 C18,10.8357864 18.3357864,10.5 18.75,10.5 Z M12,2 C14.209139,2 16,3.790861 16,6 L16,6 L16,11.25 C16,13.459139 14.209139,15.25 12,15.25 C9.790861,15.25 8,13.459139 8,11.25 L8,11.25 L8,6 C8,3.790861 9.790861,2 12,2 Z M12,3.5 C10.6192881,3.5 9.5,4.61928813 9.5,6 L9.5,6 L9.5,11.25 C9.5,12.6307119 10.6192881,13.75 12,13.75 C13.3807119,13.75 14.5,12.6307119 14.5,11.25 L14.5,11.25 L14.5,6 C14.5,4.61928813 13.3807119,3.5 12,3.5 Z" id="path-1"></path>
|
||||||
|
</defs>
|
||||||
|
<g id="Public/ic_public_voice" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<mask id="mask-2" fill="white">
|
||||||
|
<use xlink:href="#path-1"></use>
|
||||||
|
</mask>
|
||||||
|
<use id="形状结合" fill="#99000000" fill-rule="nonzero" xlink:href="#path-1"></use>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 6.5 KiB |
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24px" height="24px" viewBox="0 0 22 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>HM/ic/24x24/ssensor</title>
|
||||||
|
<g id="Phone" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="HM/ic/24x24/h1.5" transform="translate(-1.000000, -3.000000)" fill="#99000000" fill-rule="nonzero">
|
||||||
|
<path d="M6.88520113,3.25665375 C8.20110847,3.2441055 9.45423321,3.70191516 10.4382279,4.52818986 L10.6448894,4.71085136 L10.6448894,4.71085136 L10.8307509,4.8921425 L12.976,7.22140244 L11.9770711,8.2105109 L9.75814072,5.94071648 C9.06143139,5.22803664 8.12676193,4.80899735 7.13043906,4.7610321 L6.89923552,4.7565881 C4.73297495,4.77685708 2.9442573,6.6249968 3.00133068,8.77403723 C3.01513617,9.28969008 3.12229988,9.78243475 3.31369779,10.2240841 C3.55588591,10.7815376 3.99804021,11.4975524 4.5646206,12.2655031 L8.48955036,12.2661597 L9.06590376,10.5234792 C9.28460194,9.86221647 10.1997769,9.80984134 10.4924878,10.4418363 L11.7838314,13.2299896 L13.5515924,8.29791662 C13.78546,7.64542344 14.6956603,7.6118272 14.9769941,8.24530387 L16.516272,11.7112816 L19.8146263,11.7107293 C20.1891539,11.168373 20.4721867,10.6724268 20.6751555,10.2113872 C20.9634789,9.55619284 21.0621436,8.84144072 20.962039,8.11014604 C20.7254198,6.38058715 19.2884683,4.98260785 17.5331805,4.78304299 C16.4453685,4.65947728 15.2702156,5.04996218 14.401689,5.81822352 L14.2321887,5.97687243 L14.155,6.05240244 L13.08,5.00540244 L13.176616,4.9111491 C14.3686991,3.73042013 16.0743524,3.107687 17.7024783,3.29262753 C20.1396687,3.5697203 22.1186199,5.49780703 22.4481955,7.90682646 C22.5860683,8.91402884 22.4474129,9.90814878 22.0480988,10.8155617 C21.963373,11.0080146 21.867777,11.2043805 21.7605257,11.4054465 L21.5908092,11.710669 L21.5552268,11.7717417 C21.4057908,12.0263345 21.2380086,12.2887519 21.0504191,12.5604591 C21.0279954,12.5929382 21.0052615,12.6255886 20.9822414,12.6583747 C20.943106,12.7141083 20.9034812,12.7697659 20.863031,12.8258208 L20.7916816,12.9239381 L20.7916816,12.9239381 L20.7788785,12.9413885 C20.7124801,13.0317681 20.6439566,13.1231816 20.573259,13.215678 C20.5653999,13.2259611 20.5571383,13.2367469 20.5488471,13.2475476 C19.8353467,14.1769973 18.902944,15.2157708 17.7024783,16.4131641 C16.3656625,17.7465587 14.7925137,19.1395141 12.9830318,20.5920303 C12.4519735,21.018324 11.7129601,21.0518761 11.1489587,20.6909917 L11.0220856,20.6007081 L9.65556885,19.5121388 C9.4833887,19.372194 9.3561404,19.2664956 9.27382393,19.1950436 L9.22982587,19.156282 C8.42735825,18.436006 7.65565362,17.7313751 6.92454102,17.0507199 L6.2441969,16.4131641 C5.51617255,15.7262006 4.825114,14.9817787 4.21136312,14.243737 L3.85271226,13.8021883 C3.63212339,13.5240162 3.42383242,13.2486023 3.23004481,12.9794365 C3.2090598,12.9502912 3.18782453,12.9206286 3.16676924,12.8910469 C3.13931405,12.8524721 3.11238967,12.8143555 3.08577271,12.7763846 C2.97266522,12.6150295 2.86508583,12.4562675 2.76355384,12.3009163 C2.75616605,12.2896136 2.74842237,12.2777321 2.7407144,12.2658709 C2.39391679,11.7321258 2.11983051,11.2404862 1.93792765,10.8217935 C1.66957051,10.2025634 1.52079316,9.52106177 1.50186798,8.81418212 C1.42255575,5.82776195 3.87928317,3.28477913 6.88520113,3.25665375 Z M14.3510337,10.6216115 L12.597787,15.5131894 C12.3659036,16.1601468 11.4662288,16.2004707 11.1773975,15.576852 L9.91471062,12.8505717 L9.77410978,13.2756969 C9.67006241,13.5902978 9.37603547,13.8027451 9.04467524,13.8027451 L5.8084156,13.8018219 C6.19037386,14.2352275 6.5949595,14.6633794 7.00971748,15.0686972 L7.41179063,15.45234 L8.49212243,16.4581803 C8.67772418,16.6292924 8.86601563,16.8020655 9.0568715,16.976387 L10.2317773,18.0399965 C10.3152935,18.1149586 10.5226799,18.2857329 10.8442125,18.5440027 L11.9506809,19.4226967 C11.9781034,19.4443132 12.0168168,19.4441419 12.044047,19.4222836 C13.8134328,18.0019534 15.3466495,16.6443562 16.643178,15.3511458 C17.4119101,14.5843812 18.0650527,13.887249 18.6144238,13.2478559 L16.016827,13.247867 C15.7131288,13.247867 15.4379315,13.0689692 15.3146653,12.7914119 L14.3510337,10.6216115 Z" id="形状结合"></path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 4.1 KiB |
BIN
permissionmanager/src/main/resources/base/media/icon.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 8.5 KiB |
BIN
permissionmanager/src/main/resources/base/media/left.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
permissionmanager/src/main/resources/base/media/loading.gif
Normal file
After Width: | Height: | Size: 3.8 KiB |
20
permissionmanager/src/main/resources/base/media/noRecord.svg
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="89px" height="100px" viewBox="0 0 89 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>EmptyPage/04 NoRecord</title>
|
||||||
|
<g id="页面-3" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="编组" transform="translate(-26.000000, -10.000000)" fill="#A1A7B3">
|
||||||
|
<g transform="translate(25.110000, 10.000000)">
|
||||||
|
<g id="board" transform="translate(0.699850, 0.000000)">
|
||||||
|
<ellipse id="椭圆形" opacity="0.15" cx="33.6169259" cy="97.7931677" rx="33.3235423" ry="2.09054905"></ellipse>
|
||||||
|
<path d="M15.6566517,7.68481948 C14.8320038,8.84653907 14.3086539,10.237133 14.2005157,11.7426876 L9.37355468,11.7427205 C8.86071884,11.7427205 8.43804752,12.1287607 8.38028241,12.6260993 L8.37355468,12.7427205 L8.37355468,80.4445085 C8.37355468,80.9573443 8.75959487,81.3800156 9.25693355,81.4377807 L9.37355468,81.4445085 L55.9597787,81.4445085 C56.4726145,81.4445085 56.8952858,81.0584683 56.9530509,80.5611296 L56.9597787,80.4445085 L56.9591918,59.4642467 C58.2354881,58.6963697 59.5848521,57.8715818 60.9689698,57.0202918 C61.872061,56.4648531 62.7610143,55.9245256 63.6374278,55.3893306 L63.6365385,89.1456801 C63.6365385,91.3548191 61.8456775,93.1456801 59.6365385,93.1456801 L5.41431625,93.1456801 C3.20517725,93.1456801 1.41431625,91.3548191 1.41431625,89.1456801 L1.41431625,11.6865305 C1.41431625,9.47739154 3.20517725,7.68653054 5.41431625,7.68653054 L15.6566517,7.68481948 Z M49.6766817,7.68481948 L59.6365385,7.68653054 C61.8456775,7.68653054 63.6365385,9.47739154 63.6365385,11.6865305 L63.6371125,41.7414945 C61.4081436,43.9658433 59.103154,46.6784541 56.9601952,49.4365519 L56.9597787,12.7427205 C56.9597787,12.1904357 56.5120634,11.7427205 55.9597787,11.7427205 L51.1328176,11.7426876 C51.0246794,10.237133 50.5013296,8.84653907 49.6766817,7.68481948 Z" id="形状结合" opacity="0.600000024"></path>
|
||||||
|
<path d="M1.42842215,88.034569 C1.42842215,90.243708 3.21928315,92.034569 5.42842215,92.034569 L5.42842215,92.034569 L59.6506444,92.034569 C61.8597834,92.034569 63.6506444,90.243708 63.6506444,88.034569 L63.6506444,88.034569 L63.6506444,89.1456801 C63.6506444,91.3548191 61.8597834,93.1456801 59.6506444,93.1456801 L5.42842215,93.1456801 C3.21928315,93.1456801 1.42842215,91.3548191 1.42842215,89.1456801 Z" id="bolder" opacity="0.300000012"></path>
|
||||||
|
<path d="M56.9591918,59.4642467 L56.9597787,80.4445085 C56.9597787,80.9967932 56.5120634,81.4445085 55.9597787,81.4445085 L9.37355468,81.4445085 C8.86071884,81.4445085 8.43804752,81.0584683 8.38028241,80.5611296 L8.37409683,80.4451067 C8.39228046,80.997099 8.85449933,81.4298363 9.40649115,81.4116402 C36.410719,80.5220714 50.9667056,79.0071163 53.074451,76.866775 C54.0969746,75.8284382 54.9268724,70.3057364 55.5641443,60.2986697 C56.0174001,60.0290696 56.4832148,59.7506158 56.9591918,59.4642467 Z M55.9597787,11.7427205 C56.5120634,11.7427205 56.9597787,12.1904357 56.9597787,12.7427205 L56.9601952,49.4365519 C56.6579918,49.8255032 56.3590107,50.215359 56.0639196,50.6048777 C56.4662846,41.0062372 56.7563626,28.7933575 56.9341716,13.9668335 L56.9483896,12.754852 L56.9484554,12.7433799 C56.9484554,12.2305185 56.562396,11.8078261 56.0650326,11.750098 L55.9484056,11.7433799 L55.9597787,11.7427205 Z" id="形状结合" opacity="0.800000012"></path>
|
||||||
|
<path d="M14.2004684,11.7433459 L14.1902746,11.909269 L14.1902746,11.909269 L14.1834578,12.076084 L14.1804818,12.2778365 L51.153554,12.2779649 C51.1524982,12.0982019 51.1455335,11.9198392 51.1328445,11.7430614 L55.9484056,11.7433799 C56.5007179,11.7433301 56.9484554,12.1910676 56.9484554,12.7433799 L56.9483896,12.754852 C56.7720078,28.1295003 56.4771782,40.7466641 56.063901,50.6063433 C52.4333112,55.3973618 49.392156,60.1376676 48.1823636,62.5154382 L48.1823636,62.5154382 L33.652283,76.54691 L31.2131832,79.5271207 C31.1615524,79.5902057 31.1586794,79.6800882 31.2061761,79.7463417 C31.2513374,79.8093376 31.3378528,79.8260652 31.4032416,79.7844441 L31.4032416,79.7844441 L34.6497457,77.7179883 L49.0240891,63.8205749 C50.4317295,63.253589 52.7668367,61.9562089 55.563735,60.2980309 C54.9268558,70.305847 54.0969644,75.8284486 53.074451,76.866775 C50.9667056,79.0071163 36.410719,80.5220714 9.40649115,81.4116402 C8.85449933,81.4298363 8.39228046,80.997099 8.37409683,80.4451067 L8.37355468,12.7433799 C8.37355468,12.1910951 8.82126993,11.7433799 9.37355468,11.7433799 L14.2004684,11.7433459 Z M51.1542828,12.8843279 L14.1802255,12.8843279 L14.1802255,13.6297163 C14.1802255,13.9328527 14.401392,14.1843328 14.6911658,14.2315975 L14.7900888,14.2395796 L50.5444195,14.2395796 C50.8475559,14.2395796 51.0990361,14.0184131 51.1463007,13.7286393 L51.1542828,13.6297163 L51.1542828,12.8843279 Z" id="形状结合" opacity="0.200000003"></path>
|
||||||
|
<path d="M14.2004684,11.7433459 L14.1902746,11.909269 L14.1902746,11.909269 L14.1834578,12.076084 L14.1804818,12.2778365 L51.153554,12.2779649 C51.1524982,12.0982019 51.1455335,11.9198392 51.1328445,11.7430614 L55.9484056,11.7433799 C56.5007179,11.7433301 56.9484554,12.1910676 56.9484554,12.7433799 L56.9483896,12.754852 C56.7720078,28.1295003 56.4771782,40.7466641 56.063901,50.6063433 C52.4333112,55.3973618 49.392156,60.1376676 48.1823636,62.5154382 L48.1823636,62.5154382 L33.652283,76.54691 L31.2131832,79.5271207 C31.1615524,79.5902057 31.1586794,79.6800882 31.2061761,79.7463417 C31.2513374,79.8093376 31.3378528,79.8260652 31.4032416,79.7844441 L31.4032416,79.7844441 L34.6497457,77.7179883 L49.0240891,63.8205749 C50.4317295,63.253589 52.7668367,61.9562089 55.563735,60.2980309 C54.9268558,70.305847 54.0969644,75.8284486 53.074451,76.866775 C50.9667056,79.0071163 36.410719,80.5220714 9.40649115,81.4116402 C8.85449933,81.4298363 8.39228046,80.997099 8.37409683,80.4451067 L8.37355468,12.7433799 C8.37355468,12.1910951 8.82126993,11.7433799 9.37355468,11.7433799 L14.2004684,11.7433459 Z M51.1542828,12.8843279 L14.1802255,12.8843279 L14.1802255,13.6297163 C14.1802255,13.9328527 14.401392,14.1843328 14.6911658,14.2315975 L14.7900888,14.2395796 L50.5444195,14.2395796 C50.8475559,14.2395796 51.0990361,14.0184131 51.1463007,13.7286393 L51.1542828,13.6297163 L51.1542828,12.8843279 Z" id="形状结合" opacity="0.1"></path>
|
||||||
|
<path d="M51.1542828,12.8843279 L51.1542828,13.6297163 C51.1542828,13.9665345 50.8812377,14.2395796 50.5444195,14.2395796 L14.7900888,14.2395796 C14.4532706,14.2395796 14.1802255,13.9665345 14.1802255,13.6297163 L14.1802255,12.8843279 L51.1542828,12.8843279 Z M32.6666667,0.409947594 C35.3390122,0.409947594 36.4844182,2.04054424 37.559354,4.09230166 L37.6666667,4.29883648 L43.1264189,4.29883648 C47.5437009,4.29883648 51.1276453,7.86677865 51.153554,12.2779649 L14.1804818,12.2778365 L14.1834578,12.076084 C14.315557,7.75842984 17.85722,4.29883648 22.2069144,4.29883648 L27.6666667,4.29883648 C28.6150174,2.15106246 29.9052429,0.409947594 32.6666667,0.409947594 Z M32.6666667,2.78115151 C31.3120837,2.78115151 30.2139772,3.87925801 30.2139772,5.23384102 C30.2139772,6.58842404 31.3120837,7.68653054 32.6666667,7.68653054 C34.0212497,7.68653054 35.1193562,6.58842404 35.1193562,5.23384102 C35.1193562,3.87925801 34.0212497,2.78115151 32.6666667,2.78115151 Z" id="形状结合" opacity="0.600000024"></path>
|
||||||
|
</g>
|
||||||
|
<path d="M97.6761419,40.2903995 C99.7517293,42.2127197 89.9389235,49.9460736 81.8339935,53.1136911 C73.7290635,56.2813086 66.9727037,56.5237494 59.1503546,57.1521926 C53.2024735,57.6300421 47.8343942,58.0022314 45.4201241,57.7884268 L26.3031966,63.6452975 L22.472389,64.0126411 C22.3952315,64.0200399 22.32574,63.9658583 22.3141005,63.8892258 C22.3018591,63.8086304 22.3452247,63.7298488 22.4198681,63.6970795 L25.9461093,62.1490205 L45.2626608,56.2434061 C49.0125662,53.5156053 60.9326362,46.9400314 69.6983687,44.3686601 C71.5385763,43.828847 73.5142111,43.2968003 75.534509,42.7957409 L76.344795,42.5970249 C76.7509139,42.4985483 77.1583353,42.401435 77.566333,42.3058708 L78.3828816,42.1168629 C78.5190294,42.0857242 78.6551875,42.0547713 78.7913289,42.0240113 L79.6077626,41.8418191 C88.037734,39.9842067 96.1969822,38.9204761 97.6761419,40.2903995 Z M73.8198845,49.3904138 C72.844215,49.2292085 71.2184974,48.6857103 71.4069642,49.2618687 C71.595431,49.838027 73.5434796,50.6831254 77.9582298,50.9219131 C82.1364755,51.1479085 80.9884089,50.5768282 79.1725031,50.2294564 L78.9643262,50.1911419 L78.9643262,50.1911419 L78.8585674,50.1728042 C76.8757611,49.8359846 74.795554,49.5516191 73.8198845,49.3904138 Z M77.6121891,47.055513 C76.7867087,46.8700867 75.9819316,46.7044908 76.1176277,47.1193248 C76.3060945,47.6954831 78.2541431,48.5405815 82.6688933,48.7793692 C87.0836434,49.0181568 85.552037,48.3670799 83.5692308,48.0302603 C81.5864245,47.6934407 79.5062174,47.4090752 78.5305479,47.2478699 C78.335414,47.2156288 78.1142782,47.1680961 77.8868543,47.1172872 Z M83.0030573,44.6437142 C82.2282905,44.4723045 81.5175691,44.346363 81.6457265,44.7381507 C81.8341933,45.314309 83.7822419,46.1594075 88.1969921,46.3981951 C92.3752378,46.6241905 91.2271711,46.0531102 89.4112654,45.7057385 L89.2030885,45.6674239 L89.2030885,45.6674239 L89.0973296,45.6490862 C87.1145234,45.3122666 85.0343163,45.0279011 84.0586468,44.8666958 C83.8635129,44.8344547 83.6423771,44.786922 83.4149532,44.7361131 Z" id="pencil" opacity="0.5" transform="translate(60.134884, 51.841162) rotate(-27.000000) translate(-60.134884, -51.841162) "></path>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 9.4 KiB |
After Width: | Height: | Size: 12 KiB |
@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>EmptyPage/18 NoPermission</title>
|
||||||
|
<g id="EmptyPage/18-NoPermission" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<path d="M59.4581299,16 C86.6146598,16 109.038027,36.2650767 112.430732,62.4977292 L108.637493,61.8229287 L105.06218,61.1707783 L101.778945,60.5538938 L99.2660295,60.0667626 L97.4017358,59.6946907 L95.2539169,59.2516419 L93.3089293,58.8330833 L91.5667729,58.4390149 L90.3190864,58.1413932 L89.4685106,57.9284627 L88.6909541,57.7243488 L87.9864169,57.5290513 L77.8677758,54.5731447 L66.7894981,51.1680269 L57.9371338,48.4139094 C56.7942297,48.0539454 55.7030916,47.859825 54.6733965,47.7962595 L54.2491555,47.7754726 L54.0682228,47.7621595 L54.0682228,47.7621595 L53.9027597,47.7528092 L53.6171458,47.7440478 L53.4309435,47.7444286 L53.2277586,47.752122 L53.0955308,47.7629891 L52.4582603,47.8593968 L52.1089448,47.9071648 L52.1089448,47.9071648 L51.7674991,47.9652318 L49.3823353,48.3248282 L44.3676854,49.0591119 L39.7137617,49.7130263 L36.6988963,50.1196502 L35.3959471,50.290406 L33.9121451,50.4806179 L31.628643,50.7630268 L30.0300679,50.951742 L29.2503825,51.0405566 C22.8538019,51.759555 15.6292591,53.6294398 7.57675411,56.6502109 C13.299677,33.3135469 34.3570057,16 59.4581299,16 Z" id="bg" fill="#A1A7B3" opacity="0.200000003"></path>
|
||||||
|
<path d="M56.8271484,48.2007747 C58.8140613,48.6552252 62.1843262,49.7802408 66.1083984,51.0405566 C70.0324707,52.3008723 77.4980715,54.4672541 87.7677976,57.4659114 C91.7729665,58.6353806 99.9677379,60.3126532 112.352112,62.4977292 L113.475677,69.947845 L105.420284,69.947845 C105.515503,69.947845 81.2993409,72.2327726 81.6954859,74.5301224 C82.0916308,76.8274722 99.3699996,76.0025743 98.9824309,82.4701437 C98.5948622,88.9377131 77.9556254,86.2999254 71.3243189,90.3372515 C64.6930124,94.3745777 89.5466966,98.1225156 85.080416,101.653566 C80.6141354,105.184617 69.0001029,104.951003 52.8399857,104.951003 C36.6798686,104.951003 17.283563,100.959176 15.6241654,95.3548112 C14.5080002,91.5851318 20.9160791,89.1698933 30.6138684,87.0230943 L30.6150805,94.3332156 C30.6150805,94.8460515 31.0011207,95.2687228 31.4984593,95.3264879 L31.6150805,95.3332156 L33.7889935,95.3332156 C34.3018293,95.3332156 34.7245007,94.9471754 34.7822658,94.4498368 L34.7889935,94.3332156 L34.7881583,86.150266 C38.4629761,85.4191098 42.4680589,84.7024891 46.6230204,83.9541417 C64.3101133,80.7685311 87.9965907,82.2080371 88.7730009,80.9913581 C89.5494111,79.7746792 84.6584513,78.9375381 81.276188,78.050091 C77.8939247,77.1626438 73.419899,76.2773181 75.5919383,73.7000727 C77.3259385,71.642585 85.4099044,70.4103211 94.893497,69.9149371 C84.3665458,69.8744702 66.3423173,69.7969031 40.8210864,69.6822087 L37.254428,66.1155433 L42.9469177,60.4239462 C42.9469773,60.4238867 42.9470368,60.4238272 42.9470963,60.4237677 L43.0816197,60.2809349 C44.2026486,59.0165661 44.1578074,57.0814762 42.9470963,55.870765 C41.6896864,54.6133552 39.6510515,54.6132602 38.3935245,55.870553 L38.3935245,55.870553 L32.7017559,61.5612613 L27.0104691,55.8706333 C25.7529995,54.6133092 23.7143746,54.6133682 22.4569777,55.870765 C21.1995808,57.1281619 21.1995218,59.1667868 22.4568459,60.4242565 L22.4568459,60.4242565 L28.147474,66.1155433 L24.6552847,69.6091481 C18.757625,69.5823599 12.539196,69.5539829 6,69.5240168 L7.57675411,56.6502109 C15.3903507,53.656294 22.6148935,51.7864092 29.2503825,51.0405566 C39.203616,49.9217776 53.0230713,47.7725114 53.0230713,47.7725114 C53.0230713,47.7725114 54.1008813,47.5772176 56.8271484,48.2007747 Z" id="形状结合" fill="#A1A7B3" opacity="0.300000012"></path>
|
||||||
|
<path d="M44.8846961,53.1949619 C44.3221238,51.6576356 49.8259865,45.8592581 57.9371338,48.4139094 C63.3445653,50.1170103 72.8644831,53.0117247 86.4968872,57.0980525 C91.4632081,58.326879 95.4767173,59.2578279 98.5374146,59.8908992 C101.598112,60.5239704 106.229218,61.3929138 112.430732,62.4977292 L113.475677,69.947845 L35.3018692,63.7473708 C46.6103424,60.9097092 52.264579,58.7408478 52.264579,57.2407866 C52.264579,54.9906948 45.4472685,54.7322883 44.8846961,53.1949619 Z" id="mountain-1" fill="#A1A7B3" opacity="0.100000001"></path>
|
||||||
|
<circle id="椭圆形" fill="#A1A7B3" opacity="0.100000001" transform="translate(80.939087, 37.304934) rotate(-360.000000) translate(-80.939087, -37.304934) " cx="80.9390869" cy="37.3049335" r="8.34782609"></circle>
|
||||||
|
<circle id="椭圆形" fill="#A1A7B3" opacity="0.100000001" transform="translate(80.939087, 37.304934) rotate(-360.000000) translate(-80.939087, -37.304934) " cx="80.9390869" cy="37.3049335" r="5.93745541"></circle>
|
||||||
|
<circle id="椭圆形" fill="#A1A7B3" opacity="0.200000003" transform="translate(80.939087, 37.304934) rotate(-360.000000) translate(-80.939087, -37.304934) " cx="80.9390869" cy="37.3049335" r="3.07462134"></circle>
|
||||||
|
<path d="M34.7889095,94.3226088 C38.3894263,94.4384424 41.0498631,94.8469929 41.0498631,95.3332156 C41.0498631,95.9095128 37.312414,96.3766939 32.702037,96.3766939 L32.3890794,96.3759742 C27.9237064,96.355402 24.3542109,95.8964151 24.3542109,95.3332156 C24.3542109,94.8470322 27.0142171,94.4385085 30.6142905,94.3226369 L30.6150805,94.3332156 C30.6150805,94.8855004 31.0627957,95.3332156 31.6150805,95.3332156 L31.6150805,95.3332156 L33.7889935,95.3332156 C34.3412783,95.3332156 34.7889935,94.8855004 34.7889935,94.3332156 L34.7889935,94.3332156 Z" id="形状结合" fill-opacity="0.2" fill="#A1A7B3"></path>
|
||||||
|
<path d="M34.7882277,84.5512153 L34.7889935,94.3332156 C34.7889935,94.8855004 34.3412783,95.3332156 33.7889935,95.3332156 L31.6150805,95.3332156 C31.0627957,95.3332156 30.6150805,94.8855004 30.6150805,94.3332156 L30.6142277,85.3622153 L34.7882277,84.5512153 Z M32.7017559,70.6682153 L34.7882277,72.7552153 L34.7882277,78.1722153 L30.6142277,78.9842153 L30.6142277,72.7552153 L32.7017559,70.6682153 Z" id="形状结合" fill-opacity="0.6" fill="#A1A7B3"></path>
|
||||||
|
<path d="M42.9470963,55.870765 C44.2043732,57.128042 44.2043732,59.1664907 42.9470963,60.4237677 C42.9470368,60.4238272 42.9469773,60.4238867 42.9469177,60.4239462 L37.254428,66.1155433 L37.254428,66.1155433 L42.9469981,71.8076222 C44.2043736,73.0648892 44.2044616,75.1034098 42.9471945,76.3607854 C42.9471617,76.3608181 42.947129,76.3608509 42.9470963,76.3608836 C41.689775,77.6182049 39.6512543,77.6182049 38.393933,76.3608836 C38.3939003,76.3608509 38.3938675,76.3608181 38.3938348,76.3607854 L32.7017559,70.6682153 L32.7017559,70.6682153 L27.0101588,76.3607051 C25.7529805,77.6180806 23.7145318,77.6182405 22.4571562,76.3610621 C22.4570967,76.3610026 22.4570372,76.3609431 22.4569777,76.3608836 C21.1995678,75.1034738 21.1994729,73.0648389 22.4567656,71.8073119 L28.147474,66.1155433 L28.147474,66.1155433 L22.4568459,60.4242565 C21.1995218,59.1667868 21.1995808,57.1281619 22.4569777,55.870765 C23.7143746,54.6133682 25.7529995,54.6133092 27.0104691,55.8706333 L32.7017559,61.5612613 L32.7017559,61.5612613 L38.3935245,55.870553 C39.6510515,54.6132602 41.6896864,54.6133552 42.9470963,55.870765 Z" id="路径" fill-opacity="0.8" fill="#A1A7B3"></path>
|
||||||
|
<path d="M26.3976892,78.6375635 L39.0063848,78.6375635 C39.5586696,78.6375635 40.0063848,79.0852787 40.0063848,79.6375635 L40.0063848,83.898433 C40.0063848,84.4507178 39.5586696,84.898433 39.0063848,84.898433 L26.3976892,84.898433 C25.8454044,84.898433 25.3976892,84.4507178 25.3976892,83.898433 L25.3976892,79.6375635 C25.3976892,79.0852787 25.8454044,78.6375635 26.3976892,78.6375635 Z" id="矩形" fill="#A1A7B3" opacity="0.4" transform="translate(32.702037, 81.767998) rotate(-11.000000) translate(-32.702037, -81.767998) "></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 7.6 KiB |
BIN
permissionmanager/src/main/resources/base/media/radioactive.jpg
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
permissionmanager/src/main/resources/base/media/radiodefault.jpg
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
permissionmanager/src/main/resources/base/media/rightarrow.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
permissionmanager/src/main/resources/base/media/search.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title>EmptyPage/05 SearchNoResult</title>
|
||||||
|
<g id="EmptyPage/05-SearchNoResult" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="编组" transform="translate(5.442857, 14.967857)" fill="#A1A7B3">
|
||||||
|
<path d="M66.8745113,81.5472546 C68.4251242,81.5636925 72.8283566,82.1579284 74.7670742,75.8215255 C81.2263534,77.2078831 85.3071429,79.2496947 85.3071429,81.5261746 C85.3071429,85.7075122 71.5398989,89.0971561 54.5571429,89.0971561 C37.5743868,89.0971561 23.8071429,85.7075122 23.8071429,81.5261746 L23.8081429,81.5465255 Z" id="shadow" opacity="0.15"></path>
|
||||||
|
<g id="名单">
|
||||||
|
<path d="M84.184284,0.477047294 C89.175101,0.477047294 92.6887483,4.78091008 92.6887483,9.57246878 C92.6887483,9.67270637 92.687082,9.77254693 92.6837761,9.8719632 L92.6887483,9.87163721 L92.6887483,18.8466902 L75.6798198,18.8466902 L75.6798198,9.87163721 C75.6814861,9.77254693 75.6798198,9.67270637 75.6798198,9.57246878 C75.6798198,4.78091008 79.1934671,0.477047294 84.184284,0.477047294 Z" id="形状结合" opacity="0.600000024"></path>
|
||||||
|
<path d="M84.3111383,0.62870946 C80.9446833,0.62870946 78.7389646,2.38998069 77.6240825,3.93452927 C76.2145162,5.88733097 75.7261838,7.6891589 75.7030018,9.34458111 C75.6926987,10.0803243 75.6892643,10.8102482 75.6926987,11.5343527 L75.7030018,12.6161449 L75.7029342,36.4757346 C67.4304629,38.2636106 61.2321429,45.6233507 61.2321429,54.4307861 C61.2321429,63.1562984 67.3156909,70.4609219 75.4726349,72.3345045 C74.2667871,82.3567138 68.6662522,81.5662487 66.8745113,81.5472546 L19.890534,81.5469229 L19.8901769,81.5257095 L7.84059012,81.5261746 C6.84986747,81.5261746 3.6925978,79.2739018 1.8922999,75.705109 C0.692101303,73.3259139 0.115621403,69.7952744 0.1628602,65.1131905 L19.8901769,65.1127095 L19.890534,10.5261956 C19.890534,5.491719 22.2927014,2.22433678 27.0970361,0.724048984 L27.413768,0.62870946 L84.3111383,0.62870946 Z" id="形状结合" opacity="0.300000012"></path>
|
||||||
|
<path d="M0.1628602,65.1131905 L57.2866489,65.1131905 C56.909716,70.8184653 57.6384432,74.8662764 59.4728305,77.2566241 C61.3072179,79.6469717 64.0232696,81.0701552 67.6209856,81.5261746 C28.4278704,81.5261746 8.50107189,81.5261746 7.84059012,81.5261746 C6.84986747,81.5261746 3.6925978,79.2739018 1.8922999,75.705109 C0.692101303,73.3259139 0.115621403,69.7952744 0.1628602,65.1131905 Z" id="矩形" opacity="0.400000006"></path>
|
||||||
|
</g>
|
||||||
|
<g id="放大镜" transform="translate(61.232143, 36.058929)">
|
||||||
|
<path d="M31.8552859,30.8429902 L35.4226083,34.4104671 C36.3682462,34.0276822 37.4921636,34.2196849 38.2589537,34.986475 L47.5001621,44.2276834 C48.5230917,45.250613 48.5230917,46.9091095 47.5001621,47.932039 L47.247423,48.1847781 C46.2244935,49.2077077 44.5659969,49.2077077 43.5430674,48.1847781 L34.301859,38.9435698 C33.5352083,38.176919 33.343136,37.053271 33.7256423,36.1077402 L30.1144064,32.4948519 C30.7300227,31.9824198 31.3116118,31.4305033 31.8552859,30.8429902 Z" id="形状结合" opacity="0.600000024"></path>
|
||||||
|
<path d="M18.3696429,0 C28.5149165,0 36.7392857,8.22436925 36.7392857,18.3696429 C36.7392857,28.5149165 28.5149165,36.7392857 18.3696429,36.7392857 C8.22436925,36.7392857 0,28.5149165 0,18.3696429 C0,8.22436925 8.22436925,0 18.3696429,0 Z M18.3696429,4.08214286 C10.4788745,4.08214286 4.08214286,10.4788745 4.08214286,18.3696429 C4.08214286,26.2604112 10.4788745,32.6571429 18.3696429,32.6571429 C26.2604112,32.6571429 32.6571429,26.2604112 32.6571429,18.3696429 C32.6571429,10.4788745 26.2604112,4.08214286 18.3696429,4.08214286 Z" id="形状结合" opacity="0.5"></path>
|
||||||
|
<circle id="椭圆形" opacity="0.200000003" cx="18.3696429" cy="18.3696429" r="14.2875"></circle>
|
||||||
|
<rect id="矩形" opacity="0.200000003" transform="translate(27.039014, 19.156542) rotate(-255.000000) translate(-27.039014, -19.156542) " x="22.9568713" y="18.4761844" width="8.16428571" height="1.36071429" rx="0.680357143"></rect>
|
||||||
|
<rect id="矩形备份" opacity="0.200000003" transform="translate(24.997943, 14.394042) rotate(-255.000000) translate(-24.997943, -14.394042) " x="22.9568713" y="13.7136844" width="4.08214286" height="1.36071429" rx="0.680357143"></rect>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<path d="M54.3825439,48.1498383 L56.2216997,55.0136613 C56.4162027,55.7395562 55.9854244,56.4856861 55.2595294,56.6801891 C54.5336345,56.8746921 53.7875046,56.4439138 53.5930016,55.7180188 L51.7538458,48.8541959 C51.5593428,48.1283009 51.9901211,47.382171 52.7160161,47.187668 C53.441911,46.9931651 54.188041,47.4239434 54.3825439,48.1498383 Z M72.6464342,47.187668 C73.3723292,47.382171 73.8031075,48.1283009 73.6086045,48.8541959 L71.7694487,55.7180188 C71.5749457,56.4439138 70.8288158,56.8746921 70.1029209,56.6801891 C69.3770259,56.4856861 68.9462476,55.7395562 69.1407506,55.0136613 L70.9799064,48.1498383 C71.1744093,47.4239434 71.9205393,46.9931651 72.6464342,47.187668 Z M63.0592013,46.2642857 C63.8107031,46.2642857 64.4199156,46.8734983 64.4199156,47.625 L64.4199156,54.7309524 C64.4199156,55.4824541 63.8107031,56.0916667 63.0592013,56.0916667 C62.3076996,56.0916667 61.6984871,55.4824541 61.6984871,54.7309524 L61.6984871,47.625 C61.6984871,46.8734983 62.3076996,46.2642857 63.0592013,46.2642857 Z" id="形状结合" fill="#A1A7B3" opacity="0.300000012" transform="translate(62.681225, 51.495589) rotate(-53.000000) translate(-62.681225, -51.495589) "></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 5.6 KiB |
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#b5b5b5" d="M966.4 668.8l-435.2-432c-9.6-9.6-25.6-9.6-35.2 0l-441.6 432c-9.6 9.6-9.6 25.6 0 35.2 9.6 9.6 25.6 9.6 35.2 0l425.6-416 416 416c9.6 9.6 25.6 9.6 35.2 0S976 678.4 966.4 668.8z" /></svg>
|
After Width: | Height: | Size: 465 B |
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#b5b5b5" d="M966.4 323.2c-9.6-9.6-25.6-9.6-35.2 0l-416 416-425.6-416c-9.6-9.6-25.6-9.6-35.2 0-9.6 9.6-9.6 25.6 0 35.2l441.6 432c9.6 9.6 25.6 9.6 35.2 0l435.2-432C976 345.6 976 332.8 966.4 323.2z" /></svg>
|
After Width: | Height: | Size: 471 B |
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"src": [
|
||||||
|
"pages/authority-management",
|
||||||
|
"pages/application-secondary",
|
||||||
|
"pages/authority-secondary",
|
||||||
|
"pages/authority-tertiary",
|
||||||
|
"pages/application-tertiary",
|
||||||
|
"pages/other-permissions",
|
||||||
|
"pages/authority-tertiary-groups",
|
||||||
|
"pages/permission-access-record",
|
||||||
|
"pages/dialogPlus"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"colors": {
|
||||||
|
"colorSubBackground": "#000000",
|
||||||
|
"appbar_subtitle_color": "#99ffffff",
|
||||||
|
"text_color": "#ffffff"
|
||||||
|
}
|
||||||
|
}
|
14
permissionmanager/src/main/resources/en/profile/string.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"strings": {
|
||||||
|
"app_name": "CategoryPage",
|
||||||
|
"describe": "describe",
|
||||||
|
"category": "Category",
|
||||||
|
"itemChild": "ItemChild",
|
||||||
|
"item": "Item",
|
||||||
|
"search": "search...",
|
||||||
|
"you_search": "You search ",
|
||||||
|
"you_clicked": "You clicked ",
|
||||||
|
"tab": "Tab",
|
||||||
|
"more": "more >"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"colors": {
|
||||||
|
"colorSubBackground": "#f1f3f5",
|
||||||
|
"appbar_subtitle_color": "#99000000",
|
||||||
|
"text_color": "#000000"
|
||||||
|
}
|
||||||
|
}
|
14
permissionmanager/src/main/resources/zh/profile/string.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"strings": {
|
||||||
|
"app_name": "分类页",
|
||||||
|
"describe": "描述",
|
||||||
|
"category": "分类",
|
||||||
|
"itemChild": "子类",
|
||||||
|
"item": "类型",
|
||||||
|
"search": "搜索...",
|
||||||
|
"you_search": "你搜索了",
|
||||||
|
"you_clicked": "你点击了",
|
||||||
|
"tab": "分页",
|
||||||
|
"more": "更多 >"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,92 @@
|
|||||||
|
{
|
||||||
|
"string": [
|
||||||
|
{
|
||||||
|
"name": "permissionmanager_desc",
|
||||||
|
"value": "权限管理"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "MainAbility_desc",
|
||||||
|
"value": "从权限和应用两个维度来管理所有应用申请的权限。"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "MainAbility_label",
|
||||||
|
"value": "权限管理"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "no_permission",
|
||||||
|
"value": "暂无权限"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "access_permission",
|
||||||
|
"value": "访问权限"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "permission_access_record",
|
||||||
|
"value": "权限访问记录"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "authority_management",
|
||||||
|
"value": "权限管理"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "other_permissions",
|
||||||
|
"value": "其它权限"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "application",
|
||||||
|
"value": "应用"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "authority",
|
||||||
|
"value": "权限"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "textInput_placeholder",
|
||||||
|
"value": "搜索应用"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "allowed",
|
||||||
|
"value": "已允许"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "banned",
|
||||||
|
"value": "已禁止"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Authorization_failed",
|
||||||
|
"value": "授权失败!"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "reason_suffix",
|
||||||
|
"value": "等权限。"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "separator",
|
||||||
|
"value": "、"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "visits",
|
||||||
|
"value": "访问次数:"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "recent_visit",
|
||||||
|
"value": ";最近访问:"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "morning",
|
||||||
|
"value": "上午"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "afternoon",
|
||||||
|
"value": "下午"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "no_record",
|
||||||
|
"value": "没有权限访问记录"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "record_time_limit",
|
||||||
|
"value": "近7天访问记录"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|