新增截屏权限

Signed-off-by: fanchenxuan <fanchenxuan@huawei.com>
This commit is contained in:
fanchenxuan 2024-11-04 11:00:26 +08:00
parent d434f27e5d
commit 98b635e574
12 changed files with 94 additions and 8 deletions

View File

@ -4,8 +4,8 @@
"app": {
"bundleName": "com.ohos.permissionmanager",
"vendor": "example",
"versionCode": 1000071,
"versionName": "1.7.1",
"versionCode": 1000072,
"versionName": "1.7.2",
"icon": "$media:app_icon",
"label": "$string:app_name",
"minAPIVersion": 14,

View File

@ -16,8 +16,8 @@
"app": {
"bundleName": "com.ohos.permissionmanager",
"vendor": "example",
"versionCode": 1000071,
"versionName": "1.7.1",
"versionCode": 1000072,
"versionName": "1.7.2",
"icon": "$media:app_icon",
"label": "$string:app_name",
"minAPIVersion": 14,

View File

@ -44,7 +44,8 @@ export enum Permission {
READ_WRITE_DOWNLOAD_DIRECTORY = 'ohos.permission.READ_WRITE_DOWNLOAD_DIRECTORY',
READ_WRITE_DESKTOP_DIRECTORY = 'ohos.permission.READ_WRITE_DESKTOP_DIRECTORY',
READ_WRITE_DOCUMENTS_DIRECTORY = 'ohos.permission.READ_WRITE_DOCUMENTS_DIRECTORY',
ACCESS_NEARLINK = 'ohos.permission.ACCESS_NEARLINK'
ACCESS_NEARLINK = 'ohos.permission.ACCESS_NEARLINK',
CUSTOM_SCREEN_CAPTURE = 'ohos.permission.CUSTOM_SCREEN_CAPTURE'
}
export enum PermissionGroup {
@ -65,6 +66,7 @@ export enum PermissionGroup {
PASTEBOARD = 'PASTEBOARD',
FOLDER = 'FOLDER',
NEARLINK = 'NEARLINK',
CUSTOM_SCREEN_CAPTURE = 'CUSTOM_SCREEN_CAPTURE',
OTHER = 'OTHER'
}

View File

@ -47,7 +47,8 @@ export const permissionGroups: PermissionInfo[] = [
new PermissionInfo(Permission.READ_WRITE_DOWNLOAD_DIRECTORY, PermissionGroup.FOLDER, $r('sys.string.ohos_lab_read_write_download_directory'), 16),
new PermissionInfo(Permission.READ_WRITE_DESKTOP_DIRECTORY, PermissionGroup.FOLDER, $r('sys.string.ohos_lab_read_write_desktop_directory'), 16),
new PermissionInfo(Permission.READ_WRITE_DOCUMENTS_DIRECTORY, PermissionGroup.FOLDER, $r('sys.string.ohos_lab_read_write_documents_directory'), 16),
new PermissionInfo(Permission.ACCESS_NEARLINK, PermissionGroup.NEARLINK, $r('sys.string.ohos_lab_access_nearlink'), 17)
new PermissionInfo(Permission.ACCESS_NEARLINK, PermissionGroup.NEARLINK, $r('sys.string.ohos_lab_access_nearlink'), 17),
new PermissionInfo(Permission.CUSTOM_SCREEN_CAPTURE, PermissionGroup.CUSTOM_SCREEN_CAPTURE, $r('sys.string.ohos_lab_custom_screen_capture'), 18)
]
export const groups: GroupInfo[] = [
@ -68,7 +69,8 @@ export const groups: GroupInfo[] = [
new GroupInfo(PermissionGroup.BLUETOOTH, $r('app.string.groupName_bluetooth'), 'app.string.group_label_bluetooth', $r('app.media.ic_public_bluetooth'), [], '', ['ohos.permission.ACCESS_BLUETOOTH'], [ButtonStatus.DENY, ButtonStatus.ALLOW], false, 'app.string.enable_description_bluetooth', $r('app.string.forbidden_description_bluetooth')),
new GroupInfo(PermissionGroup.PASTEBOARD, $r('app.string.groupName_pasteboard'), 'app.string.group_label_pasteboard', $r('app.media.ic_clipboard'), [], '', ['ohos.permission.READ_PASTEBOARD'], [ButtonStatus.DENY, ButtonStatus.THIS_TIME_ONLY], false, 'app.string.enable_description_pasteboard', $r('app.string.forbidden_description_pasteboard')),
new GroupInfo(PermissionGroup.FOLDER, $r('app.string.groupName_folder'), 'app.string.group_label_folder', $r('app.media.ic_public_folder'), [], '', ['ohos.permission.READ_WRITE_DOWNLOAD_DIRECTORY', 'ohos.permission.READ_WRITE_DESKTOP_DIRECTORY', 'ohos.permission.READ_WRITE_DOCUMENTS_DIRECTORY'], [ButtonStatus.DENY, ButtonStatus.ALLOW], false, 'app.string.enable_description_folder', $r('app.string.forbidden_description_folder')),
new GroupInfo(PermissionGroup.NEARLINK, $r('app.string.groupName_nearLink'), 'app.string.group_label_nearLink', $r('app.media.ic_nearLink'), [], '', ['ohos.permission.ACCESS_NEARLINK'], [ButtonStatus.DENY, ButtonStatus.ALLOW], false, 'app.string.enable_description_nearLink', $r('app.string.forbidden_description_nearLink'))
new GroupInfo(PermissionGroup.NEARLINK, $r('app.string.groupName_nearLink'), 'app.string.group_label_nearLink', $r('app.media.ic_nearLink'), [], '', ['ohos.permission.ACCESS_NEARLINK'], [ButtonStatus.DENY, ButtonStatus.ALLOW], false, 'app.string.enable_description_nearLink', $r('app.string.forbidden_description_nearLink')),
new GroupInfo(PermissionGroup.CUSTOM_SCREEN_CAPTURE, $r('app.string.groupName_screenCapture'), 'app.string.group_label_screenCapture', $r('app.media.ic_public_screen_capture'), [], '', ['ohos.permission.CUSTOM_SCREEN_CAPTURE'], [ButtonStatus.DENY, ButtonStatus.ALLOW], false, 'app.string.enable_description_screenCapture', $r('app.string.forbidden_description_screenCapture'))
];
export const userGrantPermissions: string[] = [
@ -102,7 +104,8 @@ export const userGrantPermissions: string[] = [
Permission.READ_WRITE_DOWNLOAD_DIRECTORY,
Permission.READ_WRITE_DESKTOP_DIRECTORY,
Permission.READ_WRITE_DOCUMENTS_DIRECTORY,
Permission.ACCESS_NEARLINK
Permission.ACCESS_NEARLINK,
Permission.CUSTOM_SCREEN_CAPTURE
];
export const buttonResource: Map<ButtonStatus, Resource> = new Map([

View File

@ -330,6 +330,10 @@
"name":"groupName_nearLink",
"value":"NearLink"
},
{
"name":"groupName_screenCapture",
"value":"Screen capture"
},
{
"name":"multi_device_collaboration",
"value":"Multi-device collaboration"
@ -471,6 +475,13 @@
"priority":"LT"
}
},
{
"name":"group_label_screenCapture",
"value":"Allow %s to capture your screen?",
"attr":{
"priority":"translate"
}
},
{
"name":"enable_description_location",
"value":"When the system location service is enabled, %s apps are allowed to obtain the location of the device."
@ -555,6 +566,10 @@
"name":"enable_description_nearLink",
"value":"%s apps have been allowed to access NearLink."
},
{
"name":"enable_description_screenCapture",
"value":"%s apps have been allowed to use screenshots."
},
{
"name":"forbidden_description_location",
"value":"When the system positioning service is enabled, applications are not allowed to obtain the location of the device."
@ -639,6 +654,10 @@
"name":"forbidden_description_nearLink",
"value":"Apps have been prohibited from accessing NearLink."
},
{
"name":"forbidden_description_screenCapture",
"value":"Screenshots have been disabled."
},
{
"name":"risk_warning",
"value":"Risk application does not obtain this permission"

View File

@ -0,0 +1,11 @@
<?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>截屏_面状</title>
<g id="截屏_面状" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="编组">
<!-- <rect id="矩形" x="0" y="0" width="24" height="24"></rect>-->
<path d="M19.352,1 C19.896,1 20.392,1.136 20.84,1.408 C21.288,1.68 21.644,2.04 21.908,2.488 C22.1342857,2.872 22.2635918,3.28538776 22.2959184,3.72816327 L22.304,3.952 L22.304,11.152 C22.304,11.696 22.168,12.192 21.896,12.64 C21.624,13.088 21.264,13.444 20.816,13.708 C20.432,13.9342857 20.0186122,14.0635918 19.5758367,14.0959184 L19.352,14.104 L16.4982667,14.104918 L16.156,14.001 L16.156,14.001 L15.37,13.2 L17.9419431,10.6299559 L18.0795238,10.4785548 L18.2099832,10.3007753 C18.4848225,9.89265413 18.616,9.46591106 18.616,9.004 L18.6087739,8.81881159 L18.5868036,8.63343032 C18.5165517,8.19887152 18.3259517,7.80823988 18.0283563,7.48897078 L17.8575557,7.31808295 C17.4896805,6.97510609 17.0315796,6.77562749 16.5300275,6.73553319 L16.3357641,6.728 L16.1400255,6.73638859 L15.9400526,6.76185016 L15.7429479,6.8050001 C15.3549646,6.90800943 15.0054327,7.11066833 14.7140505,7.40205051 L12.147,9.967 L9.56261466,7.39872687 L9.41447733,7.26440594 L9.2367753,7.13401679 C8.82865413,6.8591775 8.40191106,6.728 7.94,6.728 L7.75481159,6.73522606 L7.56943032,6.75719642 C7.13487152,6.82744833 6.74423988,7.01804826 6.42497078,7.31564365 L6.25408295,7.48644426 C5.86823399,7.90030396 5.664,8.42835535 5.664,9.004 L5.67238859,9.20397453 L5.69785016,9.4039474 L5.7410001,9.60105211 C5.84400943,9.98903537 6.04666833,10.3385673 6.33805051,10.6299495 L8.899,13.191 L8.0483277,14.042251 L7.841,14.104 L4.952,14.104 C4.48571429,14.104 4.05469388,14.0070204 3.65893878,13.8130612 L3.464,13.708 C3.016,13.444 2.66,13.088 2.396,12.64 C2.16971429,12.256 2.04040816,11.8367347 2.00808163,11.3822041 L2,11.152 L2,3.952 C2,3.424 2.132,2.936 2.396,2.488 C2.66,2.04 3.016,1.68 3.464,1.408 C3.848,1.17485714 4.26726531,1.04163265 4.72179592,1.00832653 L4.952,1 L19.352,1 Z" id="路径" fill="#000000" fill-rule="nonzero"></path>
<path d="M16.34,8.128 C16.588,8.128 16.792,8.216 16.952,8.392 C17.128,8.552 17.216,8.756 17.216,9.004 C17.216,9.21066667 17.1548889,9.39233333 17.0326667,9.549 L16.952,9.64 L13.4,13.192 L15.824,15.664 C16.304,15.376 16.808,15.232 17.336,15.232 C17.912,15.232 18.436,15.376 18.908,15.664 C19.38,15.952 19.76,16.332 20.048,16.804 C20.336,17.276 20.48,17.8 20.48,18.376 C20.48,18.952 20.336,19.476 20.048,19.948 C19.76,20.42 19.38,20.8 18.908,21.088 C18.436,21.376 17.912,21.52 17.336,21.52 C16.76,21.52 16.236,21.376 15.764,21.088 C15.292,20.8 14.912,20.42 14.624,19.948 C14.336,19.476 14.192,18.952 14.192,18.376 C14.192,17.8685714 14.2742857,17.4199184 14.4388571,17.0300408 L14.528,16.84 L12.152,14.464 L9.704,16.888 C9.848,17.128 9.952,17.372 10.016,17.62 C10.08,17.868 10.112,18.128 10.112,18.4 C10.112,18.976 9.968,19.5 9.68,19.972 C9.392,20.444 9.012,20.824 8.54,21.112 C8.068,21.4 7.544,21.544 6.968,21.544 C6.392,21.544 5.864,21.4 5.384,21.112 C4.904,20.824 4.524,20.444 4.244,19.972 C3.964,19.5 3.824,18.976 3.824,18.4 C3.824,17.824 3.964,17.296 4.244,16.816 C4.524,16.336 4.904,15.956 5.384,15.676 C5.864,15.396 6.392,15.256 6.968,15.256 C7.42057143,15.256 7.8437551,15.3500408 8.23755102,15.5381224 L8.432,15.64 L10.88,13.192 L7.328,9.64 C7.152,9.464 7.064,9.252 7.064,9.004 C7.064,8.756 7.152,8.552 7.328,8.392 C7.488,8.216 7.692,8.128 7.94,8.128 C8.14666667,8.128 8.32833333,8.18911111 8.485,8.31133333 L8.576,8.392 L12.152,11.944 L15.704,8.392 C15.88,8.216 16.092,8.128 16.34,8.128 Z M17.336,16.984 C16.952,16.984 16.624,17.116 16.352,17.38 C16.08,17.644 15.944,17.976 15.944,18.376 C15.944,18.776 16.076,19.112 16.34,19.384 C16.604,19.656 16.936,19.792 17.336,19.792 C17.736,19.792 18.072,19.656 18.344,19.384 C18.616,19.112 18.752,18.776 18.752,18.376 C18.752,17.976 18.616,17.644 18.344,17.38 C18.072,17.116 17.736,16.984 17.336,16.984 Z M6.968,16.984 C6.568,16.984 6.232,17.116 5.96,17.38 C5.688,17.644 5.552,17.976 5.552,18.376 C5.552,18.776 5.688,19.112 5.96,19.384 C6.232,19.656 6.568,19.792 6.968,19.792 C7.368,19.792 7.7,19.656 7.964,19.384 C8.228,19.112 8.36,18.776 8.36,18.376 C8.36,17.976 8.228,17.644 7.964,17.38 C7.7,17.116 7.368,16.984 6.968,16.984 Z" id="形状结合" fill="#000000" fill-rule="nonzero"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -280,6 +280,13 @@
"priority":"LT"
}
},
{
"name":"group_label_screenCapture",
"value":"༼%s༽ཡིས་ཁྱེད་ཀྱི་བརྙན་ཡོལ་གཅོད་ལེན་བྱ་ཆོག་པར་བྱེད་དམ།",
"attr":{
"priority":"translate"
}
},
{
"name":"pasteBoard_app",
"value":"ནང་དོན་༼%s༽ལས་འདྲ་བཤུས་བྱས། བཀག་རྗེས་ཉེར་སྤྱོད་དེས་དྲས་སྦྱར་པང་ལ་ལྟ་སྤྱོད་བྱ་མི་ཆོག",

View File

@ -280,6 +280,13 @@
"priority":"LT"
}
},
{
"name":"group_label_screenCapture",
"value":"\u200f«%s» ئېكران تۇتىدۇ، رۇخسەتمۇ؟",
"attr":{
"priority":"translate"
}
},
{
"name":"pasteBoard_app",
"value":"بۇ مەزمۇن «%s» دىن كەلگەن. چەكلىسىڭىز، بۇ ئەپ كېسىش تاختىسىنى زىيارەت قىلالمايدۇ.",

View File

@ -330,6 +330,10 @@
"name":"groupName_nearLink",
"value":"星闪"
},
{
"name":"groupName_screenCapture",
"value":"截屏"
},
{
"name":"multi_device_collaboration",
"value":"多设备协同"
@ -471,6 +475,13 @@
"priority":"translate"
}
},
{
"name":"group_label_screenCapture",
"value":"允许“%s”截取您的屏幕",
"attr":{
"priority":"translate"
}
},
{
"name":"enable_description_location",
"value":"系统定位服务开关开启时,已允许%s个应用获取此设备的位置。"
@ -555,6 +566,10 @@
"name":"enable_description_nearLink",
"value":"已允许%s个应用访问星闪。"
},
{
"name":"enable_description_screenCapture",
"value":"已允许%s个应用使用截屏。"
},
{
"name":"forbidden_description_location",
"value":"系统定位服务开关开启时,已禁止应用获取此设备的位置。"
@ -639,6 +654,10 @@
"name":"forbidden_description_nearLink",
"value":"已禁止应用访问星闪。"
},
{
"name":"forbidden_description_screenCapture",
"value":"已禁止应用使用截屏。"
},
{
"name":"risk_warning",
"value":"风险应用禁止获取该权限"

View File

@ -280,6 +280,13 @@
"priority":"LT"
}
},
{
"name":"group_label_screenCapture",
"value":"允許「%s」截取您的屏幕",
"attr":{
"priority":"translate"
}
},
{
"name":"pasteBoard_app",
"value":"複製內容來自「%s」。禁止後將不再允許此應用程式存取剪貼簿。",

View File

@ -280,6 +280,13 @@
"priority":"LT"
}
},
{
"name":"group_label_screenCapture",
"value":"允許「%s」擷取您的螢幕畫面",
"attr":{
"priority":"translate"
}
},
{
"name":"pasteBoard_app",
"value":"內容複製自「%s」。禁止後將不再允許此應用程式存取剪貼簿。",

View File

@ -160,6 +160,10 @@
"name":"group_label_audios",
"value":"[TS_950736]_Allow %s to access music and audio files on your device?"
},
{
"name":"group_label_screenCapture",
"value":"[TS_988622]_Allow %s to capture your screen?"
},
{
"name":"pasteBoard_app",
"value":"[TS_950726]_Content copied from %s. If you choose Deny, this app won't be able to access the clipboard."