mirror of
https://gitee.com/openharmony/applications_permission_manager
synced 2024-11-26 20:50:48 +00:00
test
Signed-off-by: liushuling <liushuling1@huawei.com> Change-Id: Iaca319f116bca23ec132e9381097a6e3da4fc85f
This commit is contained in:
parent
38dc8e16db
commit
226791ec33
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/node_modules
|
||||
/local.properties
|
||||
/.idea
|
||||
**/build
|
@ -1,5 +1,4 @@
|
||||
|
||||
|
||||
{
|
||||
"app": {
|
||||
"bundleName": "com.ohos.permissionmanager",
|
||||
@ -8,8 +7,8 @@
|
||||
"versionName": "1.0.0",
|
||||
"icon": "$media:app_icon",
|
||||
"label": "$string:app_name",
|
||||
"distributedNotificationEnabled": true,
|
||||
"minAPIVersion":9,
|
||||
"targetAPIVersion":9
|
||||
"minAPIVersion": 9,
|
||||
"targetAPIVersion": 9,
|
||||
"distributedNotificationEnabled": true
|
||||
}
|
||||
}
|
||||
|
3
BUILD.gn
3
BUILD.gn
@ -6,10 +6,11 @@ ohos_hap("pm") {
|
||||
":permission_manager_js_assets",
|
||||
":permission_manager_resources",
|
||||
]
|
||||
certificate_profile = "signature/pm_5.p7b"
|
||||
certificate_profile = "signature/pm.p7b"
|
||||
hap_name = "pm"
|
||||
part_name = "prebuilt_hap"
|
||||
subsystem_name = "applications"
|
||||
js_build_mode = "debug"
|
||||
}
|
||||
|
||||
ohos_app_scope("permission_manager_app_profile") {
|
||||
|
@ -26,15 +26,6 @@
|
||||
"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"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
3
entry/.gitignore
vendored
Normal file
3
entry/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/node_modules
|
||||
/.preview
|
||||
/build
|
@ -1,14 +1,14 @@
|
||||
{
|
||||
"license":"ISC",
|
||||
"devDependencies":{},
|
||||
"name":"entry",
|
||||
"ohos":{
|
||||
"org":"huawei",
|
||||
"directoryLevel":"module",
|
||||
"buildTool":"hvigor"
|
||||
"license": "ISC",
|
||||
"devDependencies": {},
|
||||
"name": "entry",
|
||||
"ohos": {
|
||||
"org": "huawei",
|
||||
"directoryLevel": "module",
|
||||
"buildTool": "hvigor"
|
||||
},
|
||||
"description":"example description",
|
||||
"repository":{},
|
||||
"version":"1.0.0",
|
||||
"dependencies":{}
|
||||
}
|
||||
"description": "example description",
|
||||
"repository": {},
|
||||
"version": "1.0.0",
|
||||
"dependencies": {}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
|
||||
|
||||
{
|
||||
"module": {
|
||||
"name": "entry",
|
||||
|
@ -1,10 +0,0 @@
|
||||
# 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
|
@ -1,15 +1,16 @@
|
||||
import("//build/ohos.gni")
|
||||
|
||||
ohos_hap("pm_really") {
|
||||
ohos_hap("permission_manager") {
|
||||
hap_profile = "src/main/module.json"
|
||||
deps = [
|
||||
":permission_manager_js_assets",
|
||||
":permission_manager_resources",
|
||||
]
|
||||
certificate_profile = "../signature/pm_5.p7b"
|
||||
hap_name = "pm_really"
|
||||
certificate_profile = "../signature/pm.p7b"
|
||||
hap_name = "permission_manager"
|
||||
part_name = "prebuilt_hap"
|
||||
subsystem_name = "applications"
|
||||
js_build_mode = "debug"
|
||||
}
|
||||
|
||||
ohos_app_scope("permission_manager_app_profile") {
|
||||
|
@ -1,14 +1,14 @@
|
||||
{
|
||||
"license":"ISC",
|
||||
"devDependencies":{},
|
||||
"name":"permissionmanager",
|
||||
"ohos":{
|
||||
"org":"huawei",
|
||||
"directoryLevel":"module",
|
||||
"buildTool":"hvigor"
|
||||
"license": "ISC",
|
||||
"devDependencies": {},
|
||||
"name": "permissionmanager",
|
||||
"ohos": {
|
||||
"org": "huawei",
|
||||
"directoryLevel": "module",
|
||||
"buildTool": "hvigor"
|
||||
},
|
||||
"description":"example description",
|
||||
"repository":{},
|
||||
"version":"1.0.0",
|
||||
"dependencies":{}
|
||||
}
|
||||
"description": "example description",
|
||||
"repository": {},
|
||||
"version": "1.0.0",
|
||||
"dependencies": {}
|
||||
}
|
||||
|
@ -18,8 +18,7 @@ import window from '@ohos.window';
|
||||
import display from '@ohos.display';
|
||||
|
||||
var TAG = "PermissionManager_Log:";
|
||||
const MAX_WIDTH = 790;
|
||||
const MAX_HEIGHT = 1100;
|
||||
const BG_COLOR = '#33000000'
|
||||
|
||||
export default class ServiceExtensionAbility extends extension {
|
||||
/**
|
||||
@ -42,10 +41,10 @@ export default class ServiceExtensionAbility extends extension {
|
||||
|
||||
display.getDefaultDisplay().then(dis => {
|
||||
let navigationBarRect = {
|
||||
left: (dis.width - MAX_WIDTH)/2,
|
||||
top: (dis.height - MAX_HEIGHT)/2,
|
||||
width: MAX_WIDTH,
|
||||
height: MAX_HEIGHT
|
||||
left: 0,
|
||||
top: 0,
|
||||
width: dis.width,
|
||||
height: dis.height
|
||||
}
|
||||
this.createWindow("permissionDialog" + startId, window.WindowType.TYPE_DIALOG, navigationBarRect)
|
||||
})
|
||||
@ -71,7 +70,7 @@ export default class ServiceExtensionAbility extends extension {
|
||||
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.setBackgroundColor(BG_COLOR)
|
||||
await win.show()
|
||||
globalThis.windowNum ++
|
||||
} catch {
|
||||
|
@ -14,7 +14,6 @@
|
||||
*/
|
||||
|
||||
import router from '@system.router';
|
||||
import Resmgr from '@ohos.resourceManager'
|
||||
import Constants from '../utils/constant';
|
||||
|
||||
@Component
|
||||
@ -40,6 +39,7 @@ export struct backBar {
|
||||
Number(length) == 1 ? globalThis.context.terminateSelf() : router.back()
|
||||
})
|
||||
Text(JSON.parse(this.title))
|
||||
.align(Alignment.Start)
|
||||
.fontColor($r('app.color.text_color'))
|
||||
.fontSize(Constants.BACKBAR_TEXT_FONT_SIZE)
|
||||
.flexGrow(Constants.BACKBAR_TEXT_FLEX_GROW)
|
||||
@ -65,14 +65,12 @@ export struct backBar {
|
||||
.height(Constants.BACKBAR_HEIGHT)
|
||||
.constraintSize({ minHeight: Constants.BACKBAR_MINHEIGHT })
|
||||
.alignItems(HorizontalAlign.Start)
|
||||
.backgroundColor($r('app.color.background_color'))
|
||||
.backgroundColor($r("sys.color.ohos_id_color_sub_background"))
|
||||
}
|
||||
|
||||
aboutToAppear() {
|
||||
Resmgr.getResourceManager(globalThis.context, Constants.BUNDLE_NAME).then(item => {
|
||||
item.getString($r("app.string.permission_access_record").id, (err, val) => {
|
||||
this.record = val
|
||||
})
|
||||
globalThis.context.resourceManager.getString($r("app.string.permission_access_record").id).then(val => {
|
||||
this.record = val
|
||||
})
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
/*
|
||||
* 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 Constants from '../utils/constant';
|
||||
|
||||
@Extend(Button) function locationButton() {
|
||||
.backgroundColor($r('app.color.default_background_color'))
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.fontSize(Constants.TEXT_SMALLER_FONT_SIZE)
|
||||
.height(Constants.LOCATION_BUTTON_HEIGHT)
|
||||
.width(Constants.LOCATION_BUTTON_WIDTH)
|
||||
.borderRadius(Constants.LOCATION_BUTTON_RADIUS)
|
||||
.position({ x: Constants.LOCATION_BUTTON_POSITION_X, y: Constants.LOCATION_BUTTON_POSITION_Y })
|
||||
}
|
||||
|
||||
@Component
|
||||
export struct LocationCanvas {
|
||||
@Link locationFlag: any
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
Image($r('app.media.img_location_map'))
|
||||
.width(Constants.FULL_WIDTH)
|
||||
.height(Constants.FULL_HEIGHT)
|
||||
.scale({ x: ((this.locationFlag == Constants.LOCATION_UPGRADE) || (this.locationFlag == Constants.LOCATION_BOTH_PRECISE))
|
||||
? Constants.LOCATION_CANVAS_ZOOM_SCALE : Constants.LOCATION_CANVAS_INITIAL_SCALE,
|
||||
y: ((this.locationFlag == Constants.LOCATION_UPGRADE) || (this.locationFlag == Constants.LOCATION_BOTH_PRECISE))
|
||||
? Constants.LOCATION_CANVAS_ZOOM_SCALE : Constants.LOCATION_CANVAS_INITIAL_SCALE })
|
||||
.animation({
|
||||
duration: Constants.LOCATION_ANIMATION_DURATION, // Animation duration
|
||||
curve: Curve.Smooth, // The animation curve
|
||||
playMode: PlayMode.Normal // The animation mode
|
||||
})
|
||||
Image($r('app.media.ic_public_gps_filled'))
|
||||
.fillColor($r('sys.color.ohos_id_color_emphasize'))
|
||||
.width(Constants.LOCATION_ICON_WIDTH)
|
||||
.height(Constants.LOCATION_ICON_HEIGHT)
|
||||
.position({ x: Constants.LOCATION_ICON_POSITION_X, y: Constants.LOCATION_ICON_POSITION_Y })
|
||||
.opacity(((this.locationFlag == Constants.LOCATION_UPGRADE) || (this.locationFlag == Constants.LOCATION_BOTH_PRECISE)) ? 1 : 0)
|
||||
.scale({ x: ((this.locationFlag == Constants.LOCATION_UPGRADE) || (this.locationFlag == Constants.LOCATION_BOTH_PRECISE)) ? 1 : 0.8,
|
||||
y: ((this.locationFlag == Constants.LOCATION_UPGRADE) || (this.locationFlag == Constants.LOCATION_BOTH_PRECISE)) ? 1 : 0.8 })
|
||||
.animation({
|
||||
duration: Constants.LOCATION_ANIMATION_DURATION / 2, // Animation duration
|
||||
delay: this.locationFlag == Constants.LOCATION_BOTH_PRECISE ? (Constants.LOCATION_ANIMATION_DURATION / 2) : 0,
|
||||
curve: Curve.Smooth, // The animation curve
|
||||
playMode: PlayMode.Normal // The animation mode
|
||||
})
|
||||
Circle({ width: Constants.LOCATION_CIRCLE_DIA, height: Constants.LOCATION_CIRCLE_DIA })
|
||||
.position({ x: Constants.LOCATION_CIRCLE_POSITION_X, y: Constants.LOCATION_CIRCLE_POSITION_Y })
|
||||
.fill($r('app.color.location_circle_color'))
|
||||
.fillOpacity(Constants.LOCATION_CIRCLE_OPACITY)
|
||||
.stroke($r('app.color.location_circle_color'))
|
||||
.scale({ x: ((this.locationFlag == Constants.LOCATION_UPGRADE) || (this.locationFlag == Constants.LOCATION_BOTH_PRECISE)) ? 0 : 1,
|
||||
y: ((this.locationFlag == Constants.LOCATION_UPGRADE) || (this.locationFlag == Constants.LOCATION_BOTH_PRECISE)) ? 0 : 1 })
|
||||
.animation({
|
||||
duration: Constants.LOCATION_ANIMATION_DURATION, // Animation duration
|
||||
curve: Curve.Smooth, // The animation curve
|
||||
playMode: PlayMode.Normal // The animation mode
|
||||
})
|
||||
if(this.locationFlag == Constants.LOCATION_BOTH_PRECISE) {
|
||||
Button($r('app.string.precise_location_on'))
|
||||
.locationButton()
|
||||
.fontColor($r('app.color.button_color'))
|
||||
.onClick(() => { this.locationFlag = Constants.LOCATION_BOTH_FUZZY })
|
||||
}
|
||||
if(this.locationFlag == Constants.LOCATION_BOTH_FUZZY) {
|
||||
Button($r('app.string.precise_location_off'))
|
||||
.locationButton()
|
||||
.fontColor($r('app.color.label_color_light'))
|
||||
.onClick(() => { this.locationFlag = Constants.LOCATION_BOTH_PRECISE })
|
||||
}
|
||||
}.width(Constants.FULL_WIDTH)
|
||||
.height(Constants.LOCATION_CANVAS_HEIGHT)
|
||||
.margin({ top: Constants.LOCATION_CANVAS_MARGIN_TOP, bottom: Constants.LOCATION_CANVAS_MARGIN_BOTTOM })
|
||||
.clip(true)
|
||||
}
|
||||
}
|
@ -21,6 +21,13 @@ export const permissionGroups: any[] = [
|
||||
"description": "允许应用在后台运行时获取位置信息。",
|
||||
"groupId": 0
|
||||
},
|
||||
{
|
||||
"permissionName": "ohos.permission.APPROXIMATELY_LOCATION",
|
||||
"groupName": "LOCATION",
|
||||
"label": "模糊位置权限",
|
||||
"description": "允许应用获取模糊位置信息。",
|
||||
"groupId": 0
|
||||
},
|
||||
{
|
||||
"permissionName": "ohos.permission.LOCATION",
|
||||
"groupName": "LOCATION",
|
||||
@ -195,8 +202,9 @@ export const groups: any[] = [
|
||||
"label": "访问位置信息?",
|
||||
"permissions": [
|
||||
"ohos.permission.LOCATION_IN_BACKGROUND",
|
||||
"ohos.permission.LOCATION"
|
||||
"ohos.permission.APPROXIMATELY_LOCATION"
|
||||
],
|
||||
"specialPermission": 'ohos.permission.LOCATION',
|
||||
"isShow":true
|
||||
},
|
||||
{
|
||||
@ -335,6 +343,7 @@ export const groups: any[] = [
|
||||
export const permissionGroupPermissions: object = {
|
||||
"LOCATION": [
|
||||
"ohos.permission.LOCATION_IN_BACKGROUND",
|
||||
"ohos.permission.APPROXIMATELY_LOCATION",
|
||||
"ohos.permission.LOCATION"
|
||||
],
|
||||
"CAMERA": [
|
||||
@ -386,6 +395,7 @@ export const permissionGroupPermissions: object = {
|
||||
|
||||
export const userGrantPermissions: string[] = [
|
||||
"ohos.permission.LOCATION_IN_BACKGROUND",
|
||||
"ohos.permission.APPROXIMATELY_LOCATION",
|
||||
"ohos.permission.LOCATION",
|
||||
"ohos.permission.CAMERA",
|
||||
"ohos.permission.MICROPHONE",
|
||||
@ -411,50 +421,9 @@ export const userGrantPermissions: string[] = [
|
||||
"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.APPROXIMATELY_LOCATION": "0",
|
||||
"ohos.permission.LOCATION": "0",
|
||||
"ohos.permission.CAMERA": "1",
|
||||
"ohos.permission.MICROPHONE": "2",
|
||||
@ -480,25 +449,6 @@ export const permissionGroupIds: object = {
|
||||
"ohos.permission.DISTRIBUTED_DATASYNC": "11"
|
||||
};
|
||||
|
||||
export const orderGroup: string[] = [
|
||||
"位置信息",
|
||||
"相机",
|
||||
"麦克风",
|
||||
"电话",
|
||||
"信息",
|
||||
"通讯录",
|
||||
"通话记录",
|
||||
"媒体和文件",
|
||||
"日历",
|
||||
"健身运动",
|
||||
"身体传感器",
|
||||
"其他权限"
|
||||
];
|
||||
|
||||
export const otherPermissionsLabel: object = {
|
||||
"ohos.permission.DISTRIBUTED_DATASYNC": "多设备协同"
|
||||
};
|
||||
|
||||
export const noNeedDisplayApp: string[] = [
|
||||
"com.ohos.launcher"
|
||||
]
|
||||
@ -509,4 +459,8 @@ export const showSubpermissionsGrop: string[] = [
|
||||
"信息",
|
||||
"通讯录",
|
||||
"通话记录"
|
||||
];
|
||||
];
|
||||
|
||||
export const polymorphismGroup: string[] = [
|
||||
"LOCATION"
|
||||
]
|
@ -162,6 +162,8 @@ export default class Constants {
|
||||
static TERTIARY_LIST_PADDING_RIGHT = 12;
|
||||
static TERTIARY_LIST_PADDING_TOP = 4;
|
||||
static TERTIARY_LIST_PADDING_BOTTOM = 4;
|
||||
static LOCATION_MARGIN_TOP = 12;
|
||||
static LOCATION_MARGIN_BOTTOM = 8;
|
||||
|
||||
// authority-tertiary
|
||||
static AUTHORITY_IMAGE_WIDTH = 40;
|
||||
@ -252,14 +254,11 @@ export default class Constants {
|
||||
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;
|
||||
static SHAPE_DIA = 20;
|
||||
static SHAPE_BAN_DIA = 18;
|
||||
static SHAPE_BAN_OFFSET = 1;
|
||||
static SHAPE_ALLOW_DIA = 10;
|
||||
static SHAPE_ALLOW_OFFSET = 5;
|
||||
|
||||
// utils
|
||||
static CHAR_CODE = 0;
|
||||
@ -336,6 +335,34 @@ export default class Constants {
|
||||
static RESULT_FAILURE = 0
|
||||
static RESULT_CODE = 0
|
||||
|
||||
//location status
|
||||
static LOCATION_NONE = 0
|
||||
static LOCATION_FUZZY = 1
|
||||
static LOCATION_UPGRADE = 2
|
||||
static LOCATION_BOTH_PRECISE = 3
|
||||
static LOCATION_BOTH_FUZZY = 4
|
||||
|
||||
//location canvas
|
||||
static LOCATION_CANVAS_HEIGHT = 172;
|
||||
static LOCATION_CANVAS_MARGIN_TOP = 4;
|
||||
static LOCATION_CANVAS_MARGIN_BOTTOM = 8;
|
||||
static LOCATION_CANVAS_INITIAL_SCALE = 1;
|
||||
static LOCATION_CANVAS_ZOOM_SCALE = 1.3;
|
||||
static LOCATION_BUTTON_WIDTH = 120;
|
||||
static LOCATION_BUTTON_HEIGHT = 32;
|
||||
static LOCATION_BUTTON_RADIUS = 16;
|
||||
static LOCATION_BUTTON_POSITION_X = 137.5;
|
||||
static LOCATION_BUTTON_POSITION_Y = 16;
|
||||
static LOCATION_ICON_POSITION_X = 228;
|
||||
static LOCATION_ICON_POSITION_Y = 86.5;
|
||||
static LOCATION_CIRCLE_POSITION_X = 194;
|
||||
static LOCATION_CIRCLE_POSITION_Y = 62.5;
|
||||
static LOCATION_ICON_WIDTH = 24;
|
||||
static LOCATION_ICON_HEIGHT = 29;
|
||||
static LOCATION_CIRCLE_DIA = 94;
|
||||
static LOCATION_CIRCLE_OPACITY = 0.3;
|
||||
static LOCATION_ANIMATION_DURATION = 400;
|
||||
|
||||
//
|
||||
static SETTING_OPER = -1
|
||||
static PASS_OPER = 0
|
||||
|
@ -26,10 +26,9 @@ import Constants from '../utils/constant';
|
||||
*/
|
||||
export function getAppLabel(labelId, bundleName) {
|
||||
return new Promise((resolve) => {
|
||||
Resmgr.getResourceManager(globalThis.context, bundleName).then(item => {
|
||||
item.getString(labelId, (error, value) => {
|
||||
resolve(value);
|
||||
})
|
||||
let context = globalThis.context.createBundleContext(bundleName)
|
||||
context.resourceManager.getString(labelId).then(value => {
|
||||
resolve(value);
|
||||
}).catch(error => {
|
||||
console.error('Resmgr.getResourceManager failed. Cause: ' + JSON.stringify(error));
|
||||
})
|
||||
@ -43,10 +42,9 @@ export function getAppLabel(labelId, bundleName) {
|
||||
*/
|
||||
export function getAppIcon(iconId, bundleName) {
|
||||
return new Promise((resolve) => {
|
||||
Resmgr.getResourceManager(globalThis.context, bundleName).then(item => {
|
||||
item.getMediaBase64(iconId, (error, value) => {
|
||||
resolve(value);
|
||||
})
|
||||
let context = globalThis.context.createBundleContext(bundleName)
|
||||
context.resourceManager.getMediaBase64(iconId).then(value => {
|
||||
resolve(value);
|
||||
}).catch(error => {
|
||||
console.error('Resmgr.getResourceManager failed. Cause: ' + JSON.stringify(error));
|
||||
})
|
||||
|
@ -23,30 +23,23 @@ var TAG = 'PermissionManager_MainAbility:'
|
||||
|
||||
const allowedStatus = 0; // Status: Allowed
|
||||
const bannedStatus = 1; // Status: Banned
|
||||
|
||||
class AllowedObj {
|
||||
class permissionObj {
|
||||
groupName: string;
|
||||
permission: string[];
|
||||
constructor(groupName: string, permission: string[]) {
|
||||
group: string;
|
||||
constructor(groupName: string, permission: string[], group: string) {
|
||||
this.groupName = groupName;
|
||||
this.permission = permission;
|
||||
this.group = group
|
||||
}
|
||||
} // 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
|
||||
@State allowedListItem: permissionObj[] = []; // Array of allowed permissions
|
||||
@State bannedListItem: permissionObj[] = []; // array of forbidden permissions
|
||||
private routerData: any = router.getParams().routerData; // Routing jump data
|
||||
|
||||
@Builder ListItemLayout(item, index, status) {
|
||||
ListItem() {
|
||||
@ -76,6 +69,7 @@ struct appNamePlusPage {
|
||||
}
|
||||
}
|
||||
}.onClick(() => {
|
||||
globalThis.currentPermissionGroup = item.group
|
||||
if (status === 'allow') {
|
||||
if (item.groupName == "其他权限") {
|
||||
router.push({
|
||||
@ -145,6 +139,7 @@ struct appNamePlusPage {
|
||||
for (let i = 0; i < reqGroupIds.length; i++) {
|
||||
let id = reqGroupIds[i];
|
||||
let groupName = groups[id].groupName;
|
||||
let group = groups[id].name;
|
||||
let groupReqPermissons = [];
|
||||
for (let j = 0; j < reqPermissions.length; j++) {
|
||||
let permission = reqPermissions[j];
|
||||
@ -163,9 +158,9 @@ struct appNamePlusPage {
|
||||
}
|
||||
|
||||
if (isGranted) {
|
||||
this.allowedListItem.push(new AllowedObj(groupName, groupReqPermissons));
|
||||
this.allowedListItem.push(new permissionObj(groupName, groupReqPermissons, group));
|
||||
} else {
|
||||
this.bannedListItem.push(new BannedObj(groupName, groupReqPermissons));
|
||||
this.bannedListItem.push(new permissionObj(groupName, groupReqPermissons, group));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -251,6 +246,7 @@ struct appNamePlusPage {
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.lineHeight(Constants.SUBTITLE_LINE_HEIGHT)
|
||||
}.constraintSize({ minHeight: Constants.SUBTITLE_MIN_HEIGHT })
|
||||
.width(Constants.FULL_WIDTH)
|
||||
.padding({ top: Constants.SUBTITLE_PADDING_TOP, bottom: Constants.SUBTITLE_PADDING_BOTTOM,
|
||||
left: Constants.SECONDARY_TEXT_MARGIN_LEFT})
|
||||
}
|
||||
@ -262,7 +258,7 @@ struct appNamePlusPage {
|
||||
(item) => {
|
||||
this.ListItemLayout(item, Constants.SLICE_START_INDEX, 'allow')
|
||||
}, item => item.toString())
|
||||
ForEach(this.allowedListItem.slice(Constants.SLICE_END), (item, index) => {
|
||||
ForEach(this.allowedListItem.slice(Constants.SLICE_END), (item) => {
|
||||
this.ListItemLayout(item, Constants.SLICE_END_INDEX, 'allow')
|
||||
}, item => item.toString())
|
||||
}
|
||||
@ -285,6 +281,7 @@ struct appNamePlusPage {
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.lineHeight(Constants.SUBTITLE_LINE_HEIGHT)
|
||||
}.constraintSize({ minHeight: Constants.SUBTITLE_MIN_HEIGHT })
|
||||
.width(Constants.FULL_WIDTH)
|
||||
.padding({ top: Constants.SUBTITLE_PADDING_TOP, bottom: Constants.SUBTITLE_PADDING_BOTTOM,
|
||||
left: Constants.SECONDARY_TEXT_MARGIN_LEFT})
|
||||
}
|
||||
|
@ -16,35 +16,37 @@
|
||||
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 { getAppLabel, getAppIcon } 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 { permissionGroups, showSubpermissionsGrop, polymorphismGroup } 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 routerData: any = router.getParams().routerData; // Routing jump data
|
||||
let backTitle: any = router.getParams().backTitle; // return title name
|
||||
let status = router.getParams().status; // Status: Allowed, Forbidden
|
||||
let permissions = router.getParams().permission; // permissions name
|
||||
let permissions: any = 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
|
||||
let bundleInfo: any = {}
|
||||
const PRECISE_LOCATION_PERMISSION = 'ohos.permission.LOCATION'
|
||||
class MeidaDocObj {
|
||||
name: string
|
||||
index: number
|
||||
groupName: string
|
||||
accessTokenId: string
|
||||
accessTokenId: any
|
||||
permissions: []
|
||||
constructor(
|
||||
name: string,
|
||||
index: number,
|
||||
groupName: string,
|
||||
accessTokenId: string,
|
||||
accessTokenId: any,
|
||||
permissions: []
|
||||
) {
|
||||
this.name = name
|
||||
@ -58,17 +60,10 @@ class MediaListObj {
|
||||
labelId: string
|
||||
iconId: string
|
||||
versionName: string
|
||||
description: string
|
||||
constructor(
|
||||
labelId: string,
|
||||
iconId: string,
|
||||
versionName: string,
|
||||
description: string
|
||||
) {
|
||||
constructor(labelId: string, iconId: string, versionName: string,) {
|
||||
this.labelId = labelId
|
||||
this.iconId = iconId
|
||||
this.versionName = versionName
|
||||
this.description = description
|
||||
}
|
||||
}; // Permission application information class
|
||||
|
||||
@ -133,9 +128,10 @@ struct mediaDocumentItem {
|
||||
labelId: '',
|
||||
iconId: '',
|
||||
versionName: '',
|
||||
description: ''
|
||||
}; // application info array
|
||||
@State isCheckList: boolean[] = []; // Permission status array
|
||||
@State accurateIsOn: boolean = true;
|
||||
@State reqPermissions: any = []
|
||||
|
||||
authorizeDialogController: CustomDialogController = new CustomDialogController({
|
||||
builder: authorizeDialog({ }),
|
||||
@ -177,7 +173,6 @@ struct mediaDocumentItem {
|
||||
* Lifecycle function, executed when the page is initialized
|
||||
*/
|
||||
aboutToAppear() {
|
||||
let permissionDescription = permissionDescriptions[backTitle];
|
||||
if(showSubpermissionsGrop.indexOf(backTitle) != -1) {
|
||||
reason = []
|
||||
permissions.forEach(permission => {
|
||||
@ -187,38 +182,41 @@ struct mediaDocumentItem {
|
||||
}
|
||||
})
|
||||
})
|
||||
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]
|
||||
})
|
||||
})
|
||||
Promise.all([globalThis.context.resourceManager.getString($r("app.string.separator").id),
|
||||
globalThis.context.resourceManager.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 => {
|
||||
this.reqPermissions = res.reqPermissions
|
||||
bundleInfo = 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) => {
|
||||
let context = globalThis.context.createBundleContext(routerData)
|
||||
context.resourceManager.getString(reqPermissionDetail.reasonId).then(value => {
|
||||
if (value !== undefined && !hasReason) {
|
||||
reason += value.slice(Constants.START_SUBSCRIPT, Constants.END_SUBSCRIPT)
|
||||
hasReason = true
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
var acManager = abilityAccessCtrl.createAtManager()
|
||||
acManager.verifyAccessToken(res.appInfo.accessTokenId, PRECISE_LOCATION_PERMISSION).then(accurateStatus => {
|
||||
accurateStatus == abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED ? this.accurateIsOn = true : this.accurateIsOn = false
|
||||
})
|
||||
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);
|
||||
String(values[0]), String(values[1]), res.versionName);
|
||||
})
|
||||
this.mediaDocListItem.push(
|
||||
new MeidaDocObj(
|
||||
@ -240,7 +238,7 @@ struct mediaDocumentItem {
|
||||
);
|
||||
}).catch((error) => {
|
||||
console.error(TAG + 'bundle.getBundleInfo failed. Cause: ' + JSON.stringify(error));
|
||||
this.mediaListItem = new MediaListObj('', '', '', permissionDescription);
|
||||
this.mediaListItem = new MediaListObj('', '', '');
|
||||
this.mediaDocListItem.push(
|
||||
new MeidaDocObj(Constants.RADIO_ALLOW_NAME, Constants.RADIO_ALLOW_INDEX,
|
||||
Constants.RADIO_ALLOW_GROUP_NAME, '', permissions)
|
||||
@ -352,6 +350,9 @@ struct mediaDocumentItem {
|
||||
.height(Constants.LISTITEM_ROW_HEIGHT)
|
||||
.onClick(() => {
|
||||
item.permissions.forEach((permission) => {
|
||||
if(permission == PRECISE_LOCATION_PERMISSION) {
|
||||
return false
|
||||
}
|
||||
if (!item.index) {
|
||||
this.grantUserGrantedPermission(item.accessTokenId, permission)
|
||||
if (nowGrantResult != Constants.PERMISSION_INDEX) {
|
||||
@ -418,6 +419,55 @@ struct mediaDocumentItem {
|
||||
.padding({
|
||||
top: Constants.TERTIARY_LIST_PADDING_TOP, bottom: Constants.TERTIARY_LIST_PADDING_BOTTOM
|
||||
})
|
||||
|
||||
if ((polymorphismGroup.indexOf(globalThis.currentPermissionGroup) !== -1) && (this.reqPermissions.includes(PRECISE_LOCATION_PERMISSION))) {
|
||||
Column() {
|
||||
Row() {
|
||||
Text($r('app.string.precise_location'))
|
||||
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||
.fontColor($r('app.color.label_color'))
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.flexGrow(Constants.FLEX_GROW)
|
||||
Toggle({ type: ToggleType.Switch, isOn: this.accurateIsOn })
|
||||
.selectedColor($r('app.color.button_color'))
|
||||
.switchPointColor($r('app.color.selected_Color'))
|
||||
.onChange((isOn: boolean) => {
|
||||
var acManager = abilityAccessCtrl.createAtManager()
|
||||
if (isOn) {
|
||||
acManager.grantUserGrantedPermission(bundleInfo.appInfo.accessTokenId, PRECISE_LOCATION_PERMISSION, Constants.PERMISSION_FLAG)
|
||||
.then((res) => { res == abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED ? this.accurateIsOn = true : this.accurateIsOn = false })
|
||||
.catch(() => { this.accurateIsOn = false })
|
||||
} else {
|
||||
acManager.revokeUserGrantedPermission(bundleInfo.appInfo.accessTokenId, PRECISE_LOCATION_PERMISSION, Constants.PERMISSION_FLAG)
|
||||
.then(() => { this.accurateIsOn = false })
|
||||
.catch(() => { this.accurateIsOn = true })
|
||||
}
|
||||
})
|
||||
.padding({ right: 0 })
|
||||
.enabled(this.isCheckList[0])
|
||||
}.width(Constants.FULL_WIDTH)
|
||||
.height(Constants.LISTITEM_ROW_HEIGHT)
|
||||
}.margin({ top: Constants.LOCATION_MARGIN_TOP, bottom: Constants.LOCATION_MARGIN_BOTTOM })
|
||||
.padding({
|
||||
left: Constants.DEFAULT_PADDING_START,
|
||||
right: Constants.DEFAULT_PADDING_END,
|
||||
top: Constants.TERTIARY_LIST_PADDING_TOP,
|
||||
bottom: Constants.TERTIARY_LIST_PADDING_BOTTOM
|
||||
})
|
||||
.borderRadius(Constants.BORDER_RADIUS)
|
||||
.backgroundColor($r('app.color.default_background_color'))
|
||||
|
||||
Row() {
|
||||
Text($r('app.string.get_the_exact_position'))
|
||||
.fontSize(Constants.TEXT_SMAL_FONT_SIZE)
|
||||
.fontColor($r('app.color.label_color_light'))
|
||||
.lineHeight(Constants.TEXT_SMALL_LINE_HEIGHT)
|
||||
}.width(Constants.FULL_WIDTH)
|
||||
.padding({
|
||||
left: Constants.DEFAULT_PADDING_START,
|
||||
right: Constants.DEFAULT_PADDING_END,
|
||||
})
|
||||
}
|
||||
}
|
||||
.padding({
|
||||
left: Constants.LIST_PADDING_LEFT,
|
||||
|
@ -18,10 +18,9 @@ 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 { permissionGroups, permissionGroupIds } from "../common/model/permissionGroup";
|
||||
import { makePy } from "../common/utils/utils";
|
||||
import Constants from '../common/utils/constant';
|
||||
|
||||
@ -106,6 +105,7 @@ struct authorityManagementPage {
|
||||
return ele.groupName === item.group
|
||||
})
|
||||
|
||||
globalThis.currentPermissionGroup = item.group
|
||||
router.push({
|
||||
uri: 'pages/authority-tertiary-groups',
|
||||
params: { routerData: dataList, backTitle: item.groupName }
|
||||
@ -374,8 +374,8 @@ struct authorityManagementPage {
|
||||
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(dePermissions.indexOf(groups[permissionGroupIds[reqUserPermissions[i]]].name) == -1){
|
||||
dePermissions.push(groups[permissionGroupIds[reqUserPermissions[i]]].name);
|
||||
}
|
||||
if(groupIds.indexOf(permissionGroupIds[reqUserPermissions[i]]) == -1){
|
||||
groupIds.push(permissionGroupIds[reqUserPermissions[i]]);
|
||||
@ -405,20 +405,17 @@ struct authorityManagementPage {
|
||||
* @param {String} labelName Application Name
|
||||
*/
|
||||
updateAppLabel(index, bundleName, labelName) {
|
||||
Resmgr.getResourceManager(globalThis.context, bundleName).then(item => {
|
||||
if (index >= this.allApplicationPermissions.length) {
|
||||
return;
|
||||
let context = globalThis.context.createBundleContext(bundleName)
|
||||
if (index >= this.allApplicationPermissions.length) {
|
||||
return;
|
||||
}
|
||||
var info = this.allApplicationPermissions[index];
|
||||
context.resourceManager.getString(info['labelId'], (error, value) => {
|
||||
if (value == undefined) {
|
||||
info['labelId'] = labelName;
|
||||
} else {
|
||||
info['labelId'] = value;
|
||||
}
|
||||
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));
|
||||
})
|
||||
}
|
||||
|
||||
@ -428,16 +425,13 @@ struct authorityManagementPage {
|
||||
* @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));
|
||||
let context = globalThis.context.createBundleContext(bundleName)
|
||||
if (index >= this.allApplicationPermissions.length) {
|
||||
return;
|
||||
}
|
||||
var info = this.allApplicationPermissions[index];
|
||||
context.resourceManager.getMediaBase64(info['iconId'], (error, value) => {
|
||||
info['iconId'] = value;
|
||||
})
|
||||
}
|
||||
|
||||
@ -447,10 +441,8 @@ struct authorityManagementPage {
|
||||
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
|
||||
})
|
||||
globalThis.context.resourceManager.getString($r("app.string.textInput_placeholder").id).then(val => {
|
||||
textInput_placeholder = val
|
||||
})
|
||||
}
|
||||
|
||||
@ -513,7 +505,7 @@ struct authorityManagementPage {
|
||||
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) => {
|
||||
ForEach(this.getPermissionGroup(this.allGroupPermission, Constants.FIXED_GROUP).slice(Constants.SLICE_END), (item) => {
|
||||
this.ListItemLayout(item, Constants.SLICE_END_INDEX)
|
||||
}, item => item.toString())
|
||||
}.backgroundColor($r('app.color.default_background_color'))
|
||||
@ -528,7 +520,7 @@ struct authorityManagementPage {
|
||||
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) => {
|
||||
ForEach(this.getPermissionGroup(this.allGroupPermission, Constants.CHANGE_GROUP).slice(Constants.SLICE_END), (item) => {
|
||||
this.ListItemLayout(item, Constants.SLICE_END_INDEX)
|
||||
}, item => item.toString())
|
||||
}.backgroundColor($r('app.color.default_background_color'))
|
||||
@ -660,7 +652,7 @@ struct applicationItem {
|
||||
Column() {
|
||||
Row() {
|
||||
textInput({
|
||||
placeholder: textInput_placeholder,
|
||||
placeholder: String(textInput_placeholder),
|
||||
applicationItem: $applicationItem,
|
||||
oldApplicationItem: $oldApplicationItem,
|
||||
searchResult: $searchResult
|
||||
@ -690,7 +682,7 @@ struct applicationItem {
|
||||
(item) => {
|
||||
this.ListItemLayout(item, Constants.SLICE_START_INDEX)
|
||||
}, item => item.toString())
|
||||
ForEach(this.applicationItem.slice(Constants.SLICE_END), (item, index) => {
|
||||
ForEach(this.applicationItem.slice(Constants.SLICE_END), (item) => {
|
||||
this.ListItemLayout(item, Constants.SLICE_END_INDEX)
|
||||
}, item => item.toString())
|
||||
}.backgroundColor($r('app.color.default_background_color'))
|
||||
|
@ -18,7 +18,6 @@ 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
|
||||
@ -92,7 +91,7 @@ struct appNamePage {
|
||||
@Component
|
||||
struct appNameItem {
|
||||
@State calendarListItem: CalendarObj[] = []; // Permission management secondary interface data array
|
||||
private routerData = router.getParams().routerData; // Routing jump data
|
||||
private routerData: any = 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
|
||||
|
||||
@ -162,7 +161,7 @@ struct appNameItem {
|
||||
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) => {
|
||||
ForEach(this.calendarListItem.slice(Constants.SLICE_END), (item) => {
|
||||
this.ListItemLayout(item, Constants.SLICE_END_INDEX)
|
||||
}, item => item.toString())
|
||||
}.backgroundColor($r('app.color.default_background_color')).borderRadius(Constants.BORDER_RADIUS)
|
||||
|
@ -18,12 +18,12 @@ 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';
|
||||
import { polymorphismGroup } from "../common/model/permissionGroup";
|
||||
|
||||
var TAG = 'PermissionManager_MainAbility:'
|
||||
|
||||
@ -33,12 +33,8 @@ var TAG = 'PermissionManager_MainAbility:'
|
||||
.height(height)
|
||||
}
|
||||
|
||||
let routerData = router.getParams().routerData; // Routing jump data
|
||||
let routerData: any = 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
|
||||
@ -66,6 +62,8 @@ class ApplicationObj {
|
||||
@Entry
|
||||
@Component
|
||||
struct locationInfoPage {
|
||||
@State polymorphismIsOn: Array<boolean> = []
|
||||
|
||||
build() {
|
||||
GridContainer({ gutter: Constants.GUTTER, margin: Constants.GRID_MARGIN }) {
|
||||
Row() {
|
||||
@ -84,7 +82,7 @@ struct locationInfoPage {
|
||||
}
|
||||
Row() {
|
||||
Column() {
|
||||
applicationItem()
|
||||
applicationItem({ polymorphismIsOn: $polymorphismIsOn })
|
||||
|
||||
}.width(Constants.FULL_WIDTH)
|
||||
}
|
||||
@ -113,6 +111,42 @@ struct locationInfoPage {
|
||||
.opacity(Constants.MANAGEMENT_TRANSPARENCY)
|
||||
}
|
||||
}
|
||||
|
||||
onPageShow() {
|
||||
console.log(TAG + "onPageShow");
|
||||
if (polymorphismGroup.indexOf(globalThis.currentPermissionGroup) !== -1) {
|
||||
var bundleNames = []
|
||||
routerData.forEach(permissionmanager => {
|
||||
permissionmanager.bundleNames.forEach( bundleName => {
|
||||
if (bundleNames.indexOf(bundleName) == -1) {
|
||||
bundleNames.push(bundleName)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
bundleNames.forEach((bundleName, index) => {
|
||||
bundle.getBundleInfo(bundleName, Constants.PARMETER_BUNDLE_FLAG).then(res => {
|
||||
// 0: have permission; -1: no permission
|
||||
this.polymorphismIsOn[index] = true
|
||||
for (let j = 0; j < routerData.length; j++) {
|
||||
if (routerData[j].permission == 'ohos.permission.LOCATION') {
|
||||
continue
|
||||
}
|
||||
if (res.reqPermissions.indexOf(routerData[j].permission) == -1) {
|
||||
continue
|
||||
}
|
||||
verifyAccessToken(res.appInfo.accessTokenId, routerData[j].permission).then((access) => {
|
||||
if (Number(access) === abilityAccessCtrl.GrantStatus.PERMISSION_DENIED) {
|
||||
this.polymorphismIsOn[index] = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(TAG + bundleName + "onPageShow getBundleInfo failed, cause: " + JSON.stringify(error));
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Component
|
||||
@ -123,6 +157,8 @@ struct applicationItem {
|
||||
@State oldApplicationItem: ApplicationObj[] = []; // Original application information array
|
||||
@State searchResult: boolean = true; // search results
|
||||
@State placeholder: string = ''
|
||||
@State bundleNameGroup: Array<string> = []
|
||||
@Link polymorphismIsOn: any
|
||||
|
||||
authorizeDialogController: CustomDialogController = new CustomDialogController({
|
||||
builder: authorizeDialog({ }),
|
||||
@ -143,61 +179,70 @@ struct applicationItem {
|
||||
.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++;
|
||||
if (polymorphismGroup.indexOf(globalThis.currentPermissionGroup) == -1) {
|
||||
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) => {
|
||||
_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;
|
||||
}
|
||||
}
|
||||
_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++;
|
||||
let num = Constants.PERMISSION_NUM;
|
||||
for(let key in _this.toggleIsOn){
|
||||
if(_this.toggleIsOn[key]){
|
||||
num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
_this.permissionNum = num;
|
||||
});
|
||||
}
|
||||
})
|
||||
_this.permissionNum = num;
|
||||
});
|
||||
} else {
|
||||
let promises = routerData.map(it => new Promise((resolve) => {
|
||||
_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;
|
||||
});
|
||||
}
|
||||
})
|
||||
}else {
|
||||
Text(this.polymorphismIsOn[item.index] ? $r('app.string.allow') : $r('app.string.ban'))
|
||||
.fontSize(Constants.TEXT_SMAL_FONT_SIZE)
|
||||
.fontColor($r('app.color.label_color_light'))
|
||||
.margin({ right: Constants.AUTHORITY_IMAGE_MARGIN_RIGHT })
|
||||
Image($r('app.media.rightarrow'))
|
||||
.customizeImage(Constants.IMAGE_WIDTH, Constants.IMAGE_HEIGHT)
|
||||
}
|
||||
}
|
||||
.width(Constants.FULL_WIDTH)
|
||||
.height(Constants.AUTHORITY_ROW_HEIGHT)
|
||||
@ -215,11 +260,38 @@ struct applicationItem {
|
||||
}
|
||||
}
|
||||
}.onClick(() => {
|
||||
if (polymorphismGroup.indexOf(globalThis.currentPermissionGroup) !== -1) {
|
||||
var permissions: any = []
|
||||
routerData.forEach(item => {
|
||||
permissions.push(item.permission)
|
||||
})
|
||||
router.push({
|
||||
uri: 'pages/application-tertiary',
|
||||
params: {
|
||||
routerData: this.bundleNameGroup[item.index],
|
||||
backTitle,
|
||||
permission: permissions,
|
||||
status: this.polymorphismIsOn[item.index] ? Constants.RADIO_ALLOW_INDEX : Constants.RADIO_BAN_INDEX
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
}.padding({ left: Constants.DEFAULT_PADDING_START, right: Constants.DEFAULT_PADDING_END })
|
||||
}
|
||||
|
||||
/**
|
||||
* Take the total number of access applications
|
||||
*/
|
||||
getGrantApplicationNumber() {
|
||||
if (polymorphismGroup.indexOf(globalThis.currentPermissionGroup) !== -1) {
|
||||
var sum = this.polymorphismIsOn.filter(item => item == true)
|
||||
return sum.length
|
||||
}else {
|
||||
return this.permissionNum
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Grant permissions to the app
|
||||
* @param {Number} accessTokenId
|
||||
@ -267,10 +339,8 @@ struct applicationItem {
|
||||
})
|
||||
})
|
||||
|
||||
Resmgr.getResourceManager(globalThis.context, Constants.BUNDLE_NAME).then(item => {
|
||||
item.getString($r("app.string.textInput_placeholder").id, (err, val) => {
|
||||
this.placeholder = val
|
||||
})
|
||||
globalThis.context.resourceManager.getString($r("app.string.textInput_placeholder").id).then(val => {
|
||||
this.placeholder = val
|
||||
})
|
||||
|
||||
// initial then fill values when sync return which may cause sync panic
|
||||
@ -279,6 +349,7 @@ struct applicationItem {
|
||||
new ApplicationObj('', '', i, 0, '', ''));
|
||||
this.oldApplicationItem.push(
|
||||
new ApplicationObj('', '', i, 0, '', ''));
|
||||
this.bundleNameGroup.push(bundleNames[i])
|
||||
}
|
||||
|
||||
for (let i = 0; i < bundleNames.length; i++) {
|
||||
@ -306,6 +377,7 @@ struct applicationItem {
|
||||
routerData[0].permission,
|
||||
makePy(values[0])[0].slice(0, 1)) // Get the first letter in the returned initials array
|
||||
);
|
||||
this.bundleNameGroup[i] = bundleNames[i]
|
||||
});
|
||||
// 0: have permission; -1: no permission
|
||||
var boole = true;
|
||||
@ -351,7 +423,7 @@ struct applicationItem {
|
||||
Flex({ alignItems:ItemAlign.Start, justifyContent: FlexAlign.Start }) {
|
||||
Column() {
|
||||
Flex({ justifyContent: FlexAlign.Start }) {
|
||||
Text(this.permissionNum + '个应用获取此权限')
|
||||
Text(this.getGrantApplicationNumber() + '个应用获取此权限')
|
||||
.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 })
|
||||
@ -378,7 +450,7 @@ struct applicationItem {
|
||||
(item) => {
|
||||
this.ListItemLayout(item, Constants.SLICE_START_INDEX)
|
||||
}, item => item.toString())
|
||||
ForEach(this.applicationList.slice(Constants.SLICE_END), (item, index) => {
|
||||
ForEach(this.applicationList.slice(Constants.SLICE_END), (item) => {
|
||||
this.ListItemLayout(item, Constants.SLICE_END_INDEX)
|
||||
}, item => item.toString())
|
||||
}
|
||||
|
@ -18,7 +18,6 @@ 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";
|
||||
@ -241,10 +240,8 @@ struct applicationItem {
|
||||
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
|
||||
})
|
||||
globalThis.context.resourceManager.getString($r("app.string.textInput_placeholder").id).then(val => {
|
||||
this.placeholder = val
|
||||
})
|
||||
|
||||
// initial then fill values when sync return which may cause sync panic
|
||||
@ -338,7 +335,7 @@ struct applicationItem {
|
||||
(item) => {
|
||||
this.ListItemLayout(item, Constants.SLICE_START_INDEX)
|
||||
}, item => item.toString())
|
||||
ForEach(this.applicationList.slice(Constants.SLICE_END), (item, index) => {
|
||||
ForEach(this.applicationList.slice(Constants.SLICE_END), (item) => {
|
||||
this.ListItemLayout(item, Constants.SLICE_END_INDEX)
|
||||
}, item => item.toString())
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ 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'
|
||||
import { LocationCanvas } from '../common/components/location'
|
||||
|
||||
@Extend(Button) function customizeButton() {
|
||||
.backgroundColor($r('app.color.default_background_color'))
|
||||
@ -30,6 +31,9 @@ import { permissionGroups, showSubpermissionsGrop } from '../common/model/permis
|
||||
.width(Constants.BUTTON_WIDTH)
|
||||
}
|
||||
|
||||
const FUZZY_LOCATION_PERMISSION = 'ohos.permission.APPROXIMATELY_LOCATION'
|
||||
const PRECISE_LOCATION_PERMISSION = 'ohos.permission.LOCATION'
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
struct dialogPlusPage {
|
||||
@ -43,6 +47,8 @@ struct dialogPlusPage {
|
||||
@State appName: string = ""
|
||||
@State win: any = ""
|
||||
@State proxy: any = ''
|
||||
@State locationFlag: number = Constants.LOCATION_NONE
|
||||
@State resource: any = {}
|
||||
|
||||
build() {
|
||||
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||
@ -65,8 +71,7 @@ struct dialogPlusPage {
|
||||
Column() {
|
||||
Row() {
|
||||
Flex({ justifyContent: FlexAlign.Start }) {
|
||||
Text("是否允许" + this.appName +
|
||||
this.grantGroups[this.count].label)
|
||||
Text(this.showTitle())
|
||||
.fontSize(Constants.DIALOG_REQ_FONT_SIZE)
|
||||
.fontColor($r('app.color.first_font_color'))
|
||||
.fontWeight(FontWeight.Medium)
|
||||
@ -81,7 +86,7 @@ struct dialogPlusPage {
|
||||
|
||||
Row() {
|
||||
Flex({ justifyContent: FlexAlign.Start }) {
|
||||
Text(this.grantGroups[this.count].description)
|
||||
Text(this.showReason())
|
||||
.fontSize(Constants.DIALOG_DESP_FONT_SIZE)
|
||||
.fontColor($r('app.color.text_secondary_color'))
|
||||
.fontSize(Constants.DIALOG_DESP_FONT_SIZE)
|
||||
@ -94,17 +99,21 @@ struct dialogPlusPage {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if(this.locationFlag > Constants.LOCATION_NONE) {
|
||||
LocationCanvas({ locationFlag: $locationFlag })
|
||||
}
|
||||
}
|
||||
}
|
||||
Row() {
|
||||
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
|
||||
Button('禁止')
|
||||
Button($r('app.string.ban'))
|
||||
.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('允许')
|
||||
Button($r('app.string.allow'))
|
||||
.fontSize(Constants.BUTTON_FONT_SIZE)
|
||||
.onClick(() => {
|
||||
this.privacyAccept(this.grantGroups[this.count], this.accessTokenId, this.reqPerms, this.userFixedFlag)
|
||||
@ -120,6 +129,27 @@ struct dialogPlusPage {
|
||||
.height(Constants.FULL_HEIGHT)
|
||||
}
|
||||
|
||||
showTitle() {
|
||||
if(this.grantGroups[this.count].name == 'LOCATION') {
|
||||
if(this.locationFlag == Constants.LOCATION_FUZZY) {
|
||||
return this.resource.whether_to_allow + this.appName + this.resource.access_general_location
|
||||
}
|
||||
if(this.locationFlag == Constants.LOCATION_UPGRADE) {
|
||||
return this.resource.whether_to_allow + this.appName + this.resource.fuzzy_to_exact
|
||||
}
|
||||
}
|
||||
return this.resource.whether_to_allow + this.appName + this.grantGroups[this.count].label
|
||||
}
|
||||
|
||||
showReason() {
|
||||
if(this.grantGroups[this.count].name == 'LOCATION') {
|
||||
if((this.locationFlag == Constants.LOCATION_FUZZY) || (this.locationFlag == Constants.LOCATION_BOTH_FUZZY)) {
|
||||
return $r('app.string.close_exact_position')
|
||||
}
|
||||
}
|
||||
return this.grantGroups[this.count].description
|
||||
}
|
||||
|
||||
verify() {
|
||||
if((this.initStatus == Constants.INIT_NEED_TO_TERMINATED) || (this.count >= this.grantGroups.length)) {
|
||||
this.answerRequest()
|
||||
@ -174,6 +204,14 @@ struct dialogPlusPage {
|
||||
async privacyAccept(group, accessTokenId, permissionList, userFixedFlag) {
|
||||
var acManager = abilityAccessCtrl.createAtManager()
|
||||
var num = 0
|
||||
if(group.name == 'LOCATION') {
|
||||
if((this.locationFlag == Constants.LOCATION_UPGRADE) ||
|
||||
(this.locationFlag == Constants.LOCATION_BOTH_PRECISE)) {
|
||||
await acManager.grantUserGrantedPermission(accessTokenId, PRECISE_LOCATION_PERMISSION, userFixedFlag)
|
||||
var preciseIndex = permissionList.indexOf(FUZZY_LOCATION_PERMISSION)
|
||||
this.result[preciseIndex] = abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED;
|
||||
}
|
||||
}
|
||||
group.permissions.forEach(async permission => {
|
||||
let result
|
||||
if(showSubpermissionsGrop.indexOf(group.groupName) == -1) {
|
||||
@ -203,6 +241,13 @@ struct dialogPlusPage {
|
||||
|
||||
async privacyCancel(group, accessTokenId, permissionList, userFixedFlag) {
|
||||
var acManager = abilityAccessCtrl.createAtManager()
|
||||
if(group.name == 'LOCATION') {
|
||||
if((this.locationFlag == Constants.LOCATION_UPGRADE) ||
|
||||
(this.locationFlag == Constants.LOCATION_BOTH_FUZZY) ||
|
||||
(this.locationFlag == Constants.LOCATION_BOTH_PRECISE)) {
|
||||
await acManager.revokeUserGrantedPermission(accessTokenId, PRECISE_LOCATION_PERMISSION, userFixedFlag)
|
||||
}
|
||||
}
|
||||
group.permissions.forEach(async permission => {
|
||||
let result
|
||||
if(showSubpermissionsGrop.indexOf(group.groupName) == -1) {
|
||||
@ -218,6 +263,18 @@ struct dialogPlusPage {
|
||||
}
|
||||
|
||||
getgrantGroups(stateGroup) {
|
||||
//Processing of positioning
|
||||
if(this.reqPerms.includes(FUZZY_LOCATION_PERMISSION)) {
|
||||
this.locationFlag = Constants.LOCATION_FUZZY
|
||||
if(this.reqPerms.includes(PRECISE_LOCATION_PERMISSION)) {
|
||||
this.locationFlag = Constants.LOCATION_BOTH_PRECISE
|
||||
var fuzzyIndex = this.reqPerms.indexOf(FUZZY_LOCATION_PERMISSION)
|
||||
if(stateGroup[fuzzyIndex] == Constants.PASS_OPER) {
|
||||
this.locationFlag = Constants.LOCATION_UPGRADE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.reqPerms.forEach((permission, idx) => {
|
||||
//已授权
|
||||
if(stateGroup[idx] == Constants.PASS_OPER) {
|
||||
@ -264,32 +321,29 @@ struct dialogPlusPage {
|
||||
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)
|
||||
})
|
||||
let context = globalThis.extensionContext.createBundleContext(data)
|
||||
context.resourceManager.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) => {
|
||||
this.grantGroups.forEach((group) => {
|
||||
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)
|
||||
})
|
||||
})
|
||||
Promise.all([globalThis.extensionContext.resourceManager.getString($r("app.string.separator").id),
|
||||
globalThis.extensionContext.resourceManager.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)
|
||||
}
|
||||
@ -306,14 +360,13 @@ struct dialogPlusPage {
|
||||
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
|
||||
}
|
||||
})
|
||||
let context = globalThis.extensionContext.createBundleContext(bundleName)
|
||||
context.resourceManager.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
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
@ -321,6 +374,18 @@ struct dialogPlusPage {
|
||||
})
|
||||
}
|
||||
|
||||
getStrings() {
|
||||
globalThis.extensionContext.resourceManager.getString($r("app.string.whether_to_allow").id, (err, val) => {
|
||||
this.resource.whether_to_allow = val
|
||||
})
|
||||
globalThis.extensionContext.resourceManager.getString($r("app.string.access_general_location").id, (err, val) => {
|
||||
this.resource.access_general_location = val
|
||||
})
|
||||
globalThis.extensionContext.resourceManager.getString($r("app.string.fuzzy_to_exact").id, (err, val) => {
|
||||
this.resource.fuzzy_to_exact = val
|
||||
})
|
||||
}
|
||||
|
||||
aboutToAppear() {
|
||||
this.count = 0;
|
||||
this.initStatus = Constants.INIT_NEED_TO_WAIT
|
||||
@ -337,6 +402,7 @@ struct dialogPlusPage {
|
||||
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.getStrings()
|
||||
this.getgrantGroups(globalThis.abilityWant.parameters['ohos.user.grant.permission.state']);
|
||||
this.getApplicationName(globalThis.abilityWant.parameters['ohos.aafwk.param.callerUid'])
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
import { backBar } from "../common/components/backBar";
|
||||
import router from '@system.router';
|
||||
import Constants from '../common/utils/constant';
|
||||
import { otherPermissionsLabel } from '../common/model/permissionGroup'
|
||||
import { permissionGroups } from '../common/model/permissionGroup'
|
||||
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
|
||||
|
||||
var TAG = 'PermissionManager_MainAbility:'
|
||||
@ -29,7 +29,7 @@ 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]],
|
||||
permissionLabel: permissionGroups.filter(item => item.permissionName == permissions[i])[0].label,
|
||||
permission: permissions[i]
|
||||
})
|
||||
}
|
||||
@ -90,7 +90,6 @@ struct appNamePage {
|
||||
*/
|
||||
onPageShow() {
|
||||
console.log(TAG + 'onPageShow other-permissions')
|
||||
let isGranted = true;
|
||||
permissions.forEach(permission => {
|
||||
abilityAccessCtrl.createAtManager().verifyAccessToken(tokenId, permission).then(res => {
|
||||
status = res;
|
||||
@ -155,7 +154,7 @@ struct appNameItem {
|
||||
(item) => {
|
||||
this.ListItemLayout(item, Constants.SLICE_START_INDEX)
|
||||
}, item => item.toString())
|
||||
ForEach(this.otherPermissionListItem.slice(Constants.SLICE_END), (item, index) => {
|
||||
ForEach(this.otherPermissionListItem.slice(Constants.SLICE_END), (item) => {
|
||||
this.ListItemLayout(item, Constants.SLICE_END_INDEX)
|
||||
}, item => item.toString())
|
||||
}.backgroundColor($r('app.color.default_background_color')).borderRadius(Constants.BORDER_RADIUS)
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
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";
|
||||
@ -370,21 +369,17 @@ struct permissionRecordPage {
|
||||
}
|
||||
|
||||
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));
|
||||
globalThis.context.resourceManager.getString($r("app.string.visits").id, (err, val) => {
|
||||
this.strings.visits = val
|
||||
})
|
||||
globalThis.context.resourceManager.getString($r("app.string.recent_visit").id, (err, val) => {
|
||||
this.strings.recent_visit = val
|
||||
})
|
||||
globalThis.context.resourceManager.getString($r("app.string.morning").id, (err, val) => {
|
||||
this.strings.morning = val
|
||||
})
|
||||
globalThis.context.resourceManager.getString($r("app.string.afternoon").id, (err, val) => {
|
||||
this.strings.afternoon = val
|
||||
})
|
||||
}
|
||||
|
||||
@ -445,18 +440,17 @@ struct permissionRecordPage {
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
})
|
||||
let context = globalThis.context.createBundleContext(info.name)
|
||||
await context.resourceManager.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;
|
||||
})
|
||||
await context.resourceManager.getMediaBase64(info.appInfo['iconId'], (error, value) => {
|
||||
appInfo['icon'] = value;
|
||||
})
|
||||
|
||||
appInfo.name = info.appInfo.name
|
||||
@ -481,6 +475,8 @@ struct permissionRecordPage {
|
||||
"tokenId": 0,
|
||||
"isRemote": false,
|
||||
"permissionNames": [],
|
||||
"deviceId":'',
|
||||
"bundleName":'',
|
||||
"beginTime": 0,
|
||||
"endTime": 0,
|
||||
"flag": 1
|
||||
|
@ -1,6 +1,16 @@
|
||||
|
||||
|
||||
{
|
||||
"app": {
|
||||
"bundleName": "com.ohos.permissionmanager",
|
||||
"vendor": "example",
|
||||
"versionCode": 1000000,
|
||||
"versionName": "1.0.0",
|
||||
"icon": "$media:app_icon",
|
||||
"label": "$string:app_name",
|
||||
"minAPIVersion": 9,
|
||||
"targetAPIVersion": 9,
|
||||
"distributedNotificationEnabled": true
|
||||
},
|
||||
"module": {
|
||||
"name": "permissionmanager",
|
||||
"type": "feature",
|
||||
|
@ -58,11 +58,19 @@
|
||||
},
|
||||
{
|
||||
"name": "shape_allow_color",
|
||||
"value": "#1856D4"
|
||||
"value": "#007DFF"
|
||||
},
|
||||
{
|
||||
"name": "location_circle_color",
|
||||
"value": "#254FF7"
|
||||
},
|
||||
{
|
||||
"name": "location_bgColor",
|
||||
"value": "#19596080"
|
||||
},
|
||||
{
|
||||
"name": "shape_ban_color",
|
||||
"value": "#000000"
|
||||
"value": "#66000000"
|
||||
},
|
||||
{
|
||||
"name": "first_font_color",
|
||||
|
@ -87,6 +87,46 @@
|
||||
{
|
||||
"name": "record_time_limit",
|
||||
"value": "Access records in the last 7 days"
|
||||
},
|
||||
{
|
||||
"name": "allow",
|
||||
"value": "allow"
|
||||
},
|
||||
{
|
||||
"name": "ban",
|
||||
"value": "ban"
|
||||
},
|
||||
{
|
||||
"name": "precise_location",
|
||||
"value": "Precise location"
|
||||
},
|
||||
{
|
||||
"name": "precise_location_on",
|
||||
"value": "Precise position: On"
|
||||
},
|
||||
{
|
||||
"name": "precise_location_off",
|
||||
"value": "Precise position: Off"
|
||||
},
|
||||
{
|
||||
"name": "get_the_exact_position",
|
||||
"value": "Allows the app to get your exact location. When closed, the location obtained by the application will be biased."
|
||||
},
|
||||
{
|
||||
"name": "close_exact_position",
|
||||
"value": "When Precise location is turned off, the location obtained by the application is biased."
|
||||
},
|
||||
{
|
||||
"name": "whether_to_allow",
|
||||
"value": "Whether to allow"
|
||||
},
|
||||
{
|
||||
"name": "access_general_location",
|
||||
"value": " access the general location?"
|
||||
},
|
||||
{
|
||||
"name": "fuzzy_to_exact",
|
||||
"value": " position access to change from \"APPROXIMATE POSITION\" to \"EXACT POSITION\"?"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="26px" height="31px" viewBox="0 0 26 31" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Public/ic_public_gps_filled</title>
|
||||
<defs>
|
||||
<path d="M16,1.18725822 C22.8072676,1.18725822 28.3333333,6.60886185 28.3333333,13.3063947 C28.3333333,15.9147109 27.5432665,18.4633504 26.0768381,21.0392072 C24.9447641,23.0277533 23.529691,24.8720637 21.5050001,27.1592659 C20.7404194,28.0229784 19.7292034,29.0018403 18.4691923,30.0999774 L18.4691923,30.0999774 L18.1024173,30.41698 C16.9388306,31.4145605 15.2279693,31.4455491 14.0124907,30.4821172 L14.0124907,30.4821172 L13.9176716,30.4030831 L13.4764798,30.0183114 C12.317265,29.0016899 11.472187,28.213354 10.9263938,27.6359597 L10.9263938,27.6359597 L10.8011421,27.5014263 L10.4919214,27.1563861 C6.05460508,22.1652966 3.66666667,17.9330827 3.66666667,13.3063947 C3.66666667,6.6578994 8.94388117,1.29539073 15.6445981,1.18877946 L15.6445981,1.18877946 L15.8399167,1.18725822 Z M16,10.3333333 C14.3431458,10.3333333 13,11.6764791 13,13.3333333 C13,14.9901876 14.3431458,16.3333333 16,16.3333333 C17.6568542,16.3333333 19,14.9901876 19,13.3333333 C19,11.6764791 17.6568542,10.3333333 16,10.3333333 Z" id="path-1"></path>
|
||||
</defs>
|
||||
<g id="页面-3" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Phone_精确位置备份" transform="translate(-209.000000, -634.000000)">
|
||||
<g id="Permissiondialog" transform="translate(12.000000, 412.000000)">
|
||||
<g id="编组-2" transform="translate(0.000000, 136.000000)">
|
||||
<g id="Public/ic_public_gps_filled" transform="translate(194.000000, 85.000000)">
|
||||
<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="Symbol/color-light/colorPrimary">
|
||||
<!-- <rect id="color/#000000" x="0" y="0" width="32" height="32"></rect>-->
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="336px" height="172px" viewBox="0 0 336 172" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>img_location_map</title>
|
||||
<defs>
|
||||
<rect id="path-1" x="0" y="0" width="336" height="172"></rect>
|
||||
</defs>
|
||||
<g id="img_location_map" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<mask id="mask-2" fill="white">
|
||||
<use xlink:href="#path-1"></use>
|
||||
</mask>
|
||||
<g id="蒙版"></g>
|
||||
<g mask="url(#mask-2)">
|
||||
<g transform="translate(-7.000000, -6.000000)">
|
||||
<g id="编组" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<polygon id="路径" fill="#596080" fill-rule="nonzero" opacity="0.1" points="0 178.5 346 178.5 348 0.5 2 0.5"></polygon>
|
||||
<g opacity="0.05" transform="translate(44.000000, 6.000000)" fill="#596080" fill-rule="nonzero">
|
||||
<polygon id="路径" points="21.4 0 0.1 13.4 27.1 56.6 88.2 18.5 76.6 0"></polygon>
|
||||
<path d="M164.7,58.5 C172.1,63.1 184.2,60.7 201,51.2 L288,0 L125.6,0 C133.2,10.6 138.1,18.3 140.3,23.2 C149.8,44 157.4,54 164.7,58.5 Z" id="路径"></path>
|
||||
<path d="M266.5,47.8 C241.8,53.2 218.4,66.2 196.1,86.5 C178.1,103 164.3,122.2 156.5,145.6 C154.7,151.1 152.7,160.2 151,172 L185,172 C184.5,167.7 186.8,158.1 193.1,144 C193.1,144 193.1,144 193.1,144 L193.1,144 C193.1,144 193.1,144 193.1,144 C199.6,146.9 205.7,151.4 211.4,157.3 C216.8,163 223,172 223,172 C223,172 224,172 226,172 L275,172 C275.8,170.1 271.9,161.5 263,144 C258.3,134.6 246.1,120.6 240,113.2 C236.7,109.2 231.9,104.7 225.7,99.7 C239,88.3 256.4,76.3 277.9,64 L266.5,47.8 Z M207.6,119.3 C203.7,124.6 199,132.6 193.5,143.2 L193.6,142.9 C195.1,139.5 196.9,135.9 198.8,131.9 C203.8,121.7 212.6,111 225.3,100 L225.6,99.7 C217.7,107.3 211.6,113.8 207.6,119.3 Z" id="形状"></path>
|
||||
</g>
|
||||
<g id="SVGID_1_-link" transform="translate(100.000000, 68.000000)" fill="#E9FCE6">
|
||||
<path d="M28.1,66.4 C30.1,65.9 33.1,62.9 37.3,57.5 C40.2,52.6 41.6,48.8 41.6,46.2 C41.6,43.6 37.1,37.2 28.1,27.1 L9.3,37.5 L0.5,41.6 L12.5,61.4 C21.6,65.1 26.8,66.7 28.1,66.4 Z M243,83 C243,77 242.6,63.5 243,37 L221.9,3.5 L198.4,18.3 C228.3,63.8 241,80 243,83 Z M110.5,29 C118.5,29 125,22.5 125,14.5 C125,6.5 118.5,0 110.5,0 C102.5,0 96,6.5 96,14.5 C96,22.5 102.5,29 110.5,29 Z" id="SVGID_1_"></path>
|
||||
</g>
|
||||
</g>
|
||||
<path d="M58.7,161.3 L63,167.2 L84.5,178 L91.2,178 L64.9,164.8 L60.1,158.3 C44.7,137.2 31.7,118.8 21.2,103.3 L74.1,70.3 L111.5,130.9 L94.4,178 L97.7,178 L114.2,132.6 L186.5,155.4 C184.4,163.1 181.8,170.6 178.7,178 L183,178 C187.8,166.2 191.4,154 193.7,141.3 L193.8,141 C201.1,121.3 216.1,99.8 238.9,76.4 L240.5,74.8 C246.2,69 253.8,63.3 264.2,56.7 C267,54.9 269.8,53.2 273.5,51 L283.6,45 C284.4,44.5 285.2,44 286,43.6 L288.6,42 C291.1,40.5 294.2,38.7 298,36.6 C301.2,42.1 304.4,47.5 307.6,52.9 C307.2,53 306.9,53.1 306.5,53.3 L293.8,57.4 L292.3,57.9 C284.3,60.6 279,62.7 274.7,65.1 C267.1,69.4 260.3,73.8 252,80.2 C239.7,89.8 228.5,100.9 218.9,113.9 C209.1,127.2 201.3,146 197.1,164.2 C195.9,169.2 195.1,173.9 194.7,178 L198.7,178 C199.1,174.2 199.9,169.8 201,165.1 C205.1,147.3 212.7,129 222.2,116.2 C231.6,103.5 242.6,92.6 254.6,83.3 C262.7,77 269.4,72.7 276.8,68.5 L277.5,68.1 C281.6,65.9 286.7,63.9 294.4,61.3 L305.8,57.7 C307.3,57.2 308.6,56.8 309.9,56.4 C311.7,59.5 313.6,62.5 315.5,65.5 L317.3,68.4 C317.8,69.2 318.2,69.9 318.7,70.7 C316,72.2 313.5,73.7 311.3,75 L300.8,81.5 C282,93.2 270.3,102.3 258.6,115.8 C242.4,134.5 232.7,153.6 229.5,170.1 C228.9,172.9 228.6,175.6 228.5,178.1 L231.5,178.1 C231.6,175.8 231.9,173.4 232.5,170.7 C233.6,164.9 235.6,158.8 238.4,152.4 C246.5,157.2 252.6,161.8 256.6,166.3 C259.8,169.9 262.5,173.8 264.7,178 L268.1,178 C265.7,173 262.6,168.4 258.9,164.2 C254.6,159.4 248.2,154.5 239.7,149.6 C244.6,139.3 251.7,128.4 261,117.7 C264,114.2 267.1,111 270.3,107.9 C279.5,115.6 289.4,127.1 300,142.3 C307.8,153.5 313.6,165.4 317.3,178 L320.4,178 C316.7,164.8 310.7,152.3 302.5,140.6 L301.3,138.9 C291.1,124.5 281.5,113.5 272.5,105.8 C279.6,99.3 287.5,93.5 297.5,87.1 L298.4,88.6 C304.3,98 312.6,110.3 323.2,125.5 L325,128 C331.4,137.1 337.5,145.5 343.4,153.1 L343.4,148.1 C338.1,141 332.5,133.3 326.6,125 L323.4,120.4 C313.6,106.3 305.9,94.8 300.4,86 L300.1,85.6 C300.6,85.3 301.1,85 301.6,84.7 L303.5,83.5 L312.7,77.9 C315,76.5 317.6,75 320.5,73.3 C329.3,87.4 337,98.9 343.4,107.7 L343.4,100.8 C337.8,92.8 331.3,83 324,71.3 C329.5,68.3 336,64.9 343.4,61.2 L343.4,57.8 C335.3,61.8 328.3,65.5 322.4,68.7 C321.3,67 320.2,65.2 319.1,63.4 C317.4,60.6 315.7,57.8 314,55.1 C314.9,54.8 315.8,54.5 316.7,54.1 L317.3,53.9 C327.7,50.1 336.3,46.1 343.4,41.3 L343.4,36.4 C336.4,41.6 327.6,45.9 316.8,49.8 L316,50.1 C314.7,50.6 313.3,51 311.9,51.5 C308.5,45.9 305.2,40.3 301.9,34.6 C311.9,29.3 325.8,22.4 343.4,14 L343.4,9.7 C324.9,18.5 310.4,25.7 299.9,31.2 C299.2,30 298.5,28.8 297.9,27.6 L334.9,6 L328.9,6 L296,25.1 C292.4,18.8 288.9,12.4 285.3,6 L280.7,6 C284.6,13.1 288.5,20.1 292.5,27.1 L281.7,33.4 C258.7,46.8 243.3,55.7 235.7,60.2 C225.9,66 217.3,66.6 209.9,63.2 C204.3,60.6 199.7,55.8 196.6,50.4 L196.1,49.4 C194.7,46.8 193.3,44 191.3,40 L188.2,33.5 L187.2,31.5 C184.5,26.1 182.4,22.1 179.9,18.4 L179.6,18 C177.4,14.7 174.4,10.7 170.7,6.1 L166.8,6.1 C171.2,11.5 174.6,16 177.1,19.7 L177.6,20.5 C180.1,24.4 182.4,28.7 185.4,34.9 L189,42.4 C191,46.5 192.4,49.2 194,52 C197.4,57.9 202.4,63.2 208.7,66.1 C217,70 226.7,69.3 237.3,63 L245.6,58.1 C254.6,52.8 267.9,45.1 285.6,34.8 L294.1,29.9 C294.8,31.1 295.4,32.2 296.1,33.3 C292.8,35.1 289.9,36.7 287.6,38.2 L284.1,40.3 C283.2,40.8 282.3,41.4 281.2,42 L271,47.9 C267.6,50 264.8,51.7 262.2,53.4 L260.7,54.4 C250.8,60.7 243.5,66.3 237.8,72.1 C218.7,91.4 204.8,109.6 196,126.7 C197.3,114.9 197.5,102.7 196.7,90.1 C194.6,57.8 183.8,29.8 164.1,6.1 L158.8,6.1 C159.1,6.4 159.3,6.7 159.6,7 L133.6,23.2 L123.2,6 L119.7,6 L130.9,24.6 L72.1,61.2 L46.2,19.2 L67.3,6 L61.4,6 L7,40 L7,43.7 L43.6,20.9 L72.6,67.9 L19.6,101 C14.9,93.8 10.7,87.4 7,81.6 L7,87.2 C10,91.9 13.4,97 17,102.4 L7,108.7 L7,112.2 L18.7,104.9 C29.5,120.8 42.8,139.6 58.7,161.3 Z M127.8,133.8 L114.2,129.5 L102.2,110.1 L127.6,97 L127.7,97.1 C132,101.7 135.7,106.5 139,111.5 C141.9,115.9 138.5,123.2 128.3,133.2 L127.8,133.8 Z M192.6,90.3 C193.7,107.7 192.8,124.4 189.9,140.3 L189.9,140.4 L189.9,140.4 C189.2,144.5 188.3,148.5 187.3,152.5 L131.1,134.8 C141.8,124 145.5,115.7 141.6,109.8 C138.4,104.9 134.7,100.1 130.5,95.5 L189,65.3 C190.9,73.3 192.1,81.6 192.6,90.3 Z M161.4,9.2 C174.5,25.1 183.5,43 188.4,62.8 L188.1,62.3 L164.4,74.5 L135,25.6 L161.4,9.2 Z M132.5,27.2 L161.9,75.9 L100.8,107.5 L101.1,108.1 L73.6,63.7 L132.5,27.2 Z" id="形状" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 6.8 KiB |
@ -87,6 +87,46 @@
|
||||
{
|
||||
"name": "record_time_limit",
|
||||
"value": "近7天访问记录"
|
||||
},
|
||||
{
|
||||
"name": "allow",
|
||||
"value": "允许"
|
||||
},
|
||||
{
|
||||
"name": "ban",
|
||||
"value": "禁止"
|
||||
},
|
||||
{
|
||||
"name": "precise_location",
|
||||
"value": "精确位置"
|
||||
},
|
||||
{
|
||||
"name": "precise_location_on",
|
||||
"value": "精确位置:开启"
|
||||
},
|
||||
{
|
||||
"name": "precise_location_off",
|
||||
"value": "精确位置:关闭"
|
||||
},
|
||||
{
|
||||
"name": "get_the_exact_position",
|
||||
"value": "允许该应用获取您的准确位置。关闭后,应用获取的位置会有偏差。"
|
||||
},
|
||||
{
|
||||
"name": "close_exact_position",
|
||||
"value": "关闭精确位置后,应用获取的位置会有偏差。"
|
||||
},
|
||||
{
|
||||
"name": "whether_to_allow",
|
||||
"value": "是否允许"
|
||||
},
|
||||
{
|
||||
"name": "access_general_location",
|
||||
"value": "访问大致位置?"
|
||||
},
|
||||
{
|
||||
"name": "fuzzy_to_exact",
|
||||
"value": "的位置访问权限从“大致位置”改为“精确位置”?"
|
||||
}
|
||||
]
|
||||
}
|
BIN
signature/pm.p7b
Normal file
BIN
signature/pm.p7b
Normal file
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user