diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/build.gradle b/frameworks/com.ohos.permissionmanager/build.gradle similarity index 65% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/build.gradle rename to frameworks/com.ohos.permissionmanager/build.gradle index 1a5f01714f24ceb8bfa91af60357eac583c9160f..d867e2f57fd1099393c59f2866a5ac59889c351b 100644 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/build.gradle +++ b/frameworks/com.ohos.permissionmanager/build.gradle @@ -5,13 +5,13 @@ apply plugin: 'com.huawei.ohos.app' ohos { signingConfigs { release { - storeFile file('D:\\myKey\\myApplication.p12') - storePassword '00000019158AC866FF55373F18ED315DEED8BB1B9C4423EEA7DA65E15E2C670DCF82991936587199A8' - keyAlias = 'fcx_app' - keyPassword '000000194B2CB7E4FF552AC3A6435D0061BD7A5A5357AECE4EDAD989D1B61DFEF758FCAB0B9DAADD63' + storeFile file('D:\\Huawei\\key\\permissionmanager\\permissionmanager.p12') + storePassword '0000001AA260E03E4EFC6DAE11257137D057327B7D76708207E97F857840A6BB0C3E2EDEBC8175EFE2D7' + keyAlias = 'zhouyan' + keyPassword '0000001ABE41800D8041F8025A346900B00C8D44BE5145EADC3F6C769D4F24BA17CD120C388C3E21659E' signAlg = 'SHA256withECDSA' - profile file('D:\\myKey\\myApplication_ohos_Provision.p7b') - certpath file('D:\\myKey\\myApplication_ohos.cer') + profile file('D:\\Huawei\\key\\permissionmanager\\permissionmanager.p7b') + certpath file('D:\\Huawei\\key\\permissionmanager\\permissionmanager.cer') } } compileSdkVersion 7 diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/.gitignore b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/.gitignore deleted file mode 100644 index b297692bedf04c7870a547564251df6228c9c74b..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -*.iml -.gradle -/local.properties -/.idea/caches -/.idea/libraries -/.idea/modules.xml -/.idea/workspace.xml -/.idea/navEditor.xml -/.idea/assetWizardSettings.xml -.DS_Store -/build -/captures -.externalNativeBuild -/entry/.preview -.cxx -/node_modules -**/.gradle -**/.idea - -/.idea/previewer/phone/ -/.idea/previewer/previewConfigV2.json diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/components/alphabeticalIndex.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/components/alphabeticalIndex.ets deleted file mode 100644 index 98e91a0d4adae61c993ab815bda7e5463aa10023..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/components/alphabeticalIndex.ets +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { applicationListItem } from "../model/authorityManagementList.ets" - -@Component -export struct alphabetIndexerComponent { - @State alphabeticalIndex: number = 0 - @Prop page: string - @Link applicationList: any[] - private value: string[] = ['#', '☆', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] - filterData(index) { - this.alphabeticalIndex = index - if (index === 0 || index === 1) { - this.applicationList = applicationListItem - } - else { - this.applicationList = applicationListItem.filter((item) => { - return item.alphabeticalIndex === this.value[index] - }) - } - } - - build() { - Flex({ justifyContent: FlexAlign.Start }) { - AlphabetIndexer({ ArrayValue: this.value, selected: this.alphabeticalIndex }) - .selectedColor(0xffffff) // 选中颜色 - .popupColor(0xFFFAF0) // 弹出框颜色 - .selectedBackgroundColor(0xCCCCCC) // 选中背景颜色 - .popupBackground(0xD2B48C) // 弹出框背景颜色 - .usingPopup(true) // 是否显示弹出框 - .selectedFont({ size: 12, weight: FontWeight.Bolder }) // 选中的样式 - .popupFont({ size: 30, weight: FontWeight.Bolder }) // 弹出框的演示 - .itemSize(16) // 每一项的大小正方形 - .alignStyle(IndexerAlign.Left) // 左对齐 - .onSelected((index: number) => { - if (this.page === 'location-info') { - this.filterData(index) - } - if (this.page === 'authority-management') { - this.filterData(index) - } - console.info(this.value[index] + '被选中了') // 选中的事件 - }) - .height(448) - .width(24) - } - } -} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/components/backBar.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/components/backBar.ets deleted file mode 100644 index cb999982bc5b72ec6d31f49ac1d779750e0493e0..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/components/backBar.ets +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import router from '@system.router' - -@Component -export struct backBar { - @Prop title: string - - build() { - Column() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - if (this.title == JSON.stringify($r('app.string.privacy'))) { - Text($r('app.string.privacy')) - .fontColor($r('app.color.title_text_color')) - .fontSize("20fp") - .margin({ - left: "15vp", - right: "24vp", - top: "17vp" - }) - } else { - Image($r('app.media.left')) - .objectFit(ImageFit.Contain) - .height(24) - .width(24) - .margin({ - top: "17vp", - left: "24vp", - right: "15vp" - }) - .onClick(() => { - router.back() - }) - Text(JSON.parse(this.title)) - .fontColor($r('app.color.title_text_color')) - .fontSize(20) - .flexGrow(1) - .margin({ top: "17vp" }) - if (false) { - Image($r('app.media.record')) - .objectFit(ImageFit.Contain) - .height(25) - .width(25) - .margin({ - right: "15vp", - top: "17vp" - }) - .onClick(() => { - router.push({ uri: "pages/permission-access-record" }) - }) - } - } - } - } - .height(56) - .constraintSize({ minHeight: "56vp" }) - .alignItems(HorizontalAlign.Start) - .backgroundColor($r('app.color.background_color')) - } -} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/components/search.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/components/search.ets deleted file mode 100644 index 30b56968979742fbf52c4a23c42642e455c2380b..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/components/search.ets +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@Component -export struct textInput { - @Prop placeholder: string - build() { - Column() { - Flex({ alignContent: FlexAlign.Start }) { - TextInput({ placeholder: this.placeholder }) - .padding({ left: 36 }) - .type(InputType.Normal) - .border({ radius: 20 }) - .placeholderColor($r('app.color.default_background_color')) - .placeholderFont({ size: '16vp', weight: FontWeight.Normal, family: "sans-serif", style: FontStyle.Normal }) - .caretColor($r('app.color.secondary_font_color')) - .backgroundColor($r('app.color.default_background_color')) - .height(40) - .onChange((value: string) => { - - }) - .onSubmit((enterKey) => { - - }) - .onEditChanged((isEditing) => { - - }) - Column() { - Image($r('app.media.search')) - .objectFit(ImageFit.Contain) - .width(16) - .height(16) - .margin({ left: -300, top: 12 }) - } - } - } - } -} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/appNameList.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/appNameList.ets deleted file mode 100644 index 5ac4cb35a0806f561a5145d6becbf7a1e3ad9701..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/appNameList.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export const calendarListItem: any[] = [ - { 'name': '读取日历', 'index': 1 }, - { 'name': '新建/修改/删除日历', 'index': 2 } -] -export const dynamicListItem: any[] = [ - { 'name': 'xxxxxx', 'index': 1 }, - { 'name': 'xxxxxx', 'index': 2 } -] -export const allowedListItem: any[] = [ - { 'name': '相机', 'index': 1, permission:'' }, - { 'name': '麦克风', 'index': 2, permission:'' }, - { 'name': '媒体和文件', 'index': 3, permission:'仅媒体' }, - { 'name': '日历', 'index': 4, permission:'读取日历' } -] -export const bannedListItem: any[] = [ - { 'name': '悬浮窗', 'index': 1 } -] \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/authorityManagementList.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/authorityManagementList.ets deleted file mode 100644 index f24fa36e97744f91d87a92dda960ed35e920049f..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/authorityManagementList.ets +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export const authorityListItem: any[] = [ - { 'name': '位置信息', 'index': 1, 'image': $r('app.media.ic_public_gps'), 'icon': $r('app.media.rightarrow'), version: '1.1.1', use: '用途001' }, - { 'name': '相机', 'index': 2, 'image': $r('app.media.ic_public_camera'), 'icon': $r('app.media.rightarrow'), version: '1.1.1', use: '用途001' }, - { 'name': '麦克风', 'index': 3, 'image': $r('app.media.ic_public_voice'), 'icon': $r('app.media.rightarrow'), version: '1.1.1', use: '用途001' }, -] -export const messageListItem: any[] = [ - { 'name': '媒体和文件', 'index': 1, 'image': $r('app.media.ic_public_folder'), 'icon': $r('app.media.rightarrow'), version: '1.1.1', use: '用途001' }, - { 'name': '日历', 'index': 2, 'image': $r('app.media.ic_public_calendar'), 'icon': $r('app.media.rightarrow'), version: '1.1.1', use: '用途001' }, - { 'name': '健身运动', 'index': 3, 'image': $r('app.media.ic_sport'), 'icon': $r('app.media.rightarrow'), version: '1.1.1', use: '用途001' }, - { 'name': '身体传感器', 'index': 4, 'image': $r('app.media.ic_ssensor'), 'icon': $r('app.media.rightarrow'), version: '1.1.1', use: '用途001' }, - { 'name': '多设备协同', 'index': 5, 'image': $r('app.media.ic_dropzone'), 'icon': $r('app.media.rightarrow'), version: '1.1.1', use: '用途001' } -] -export const applicationListItem: any[] = [ - { 'name': '备忘录', 'index': 1, 'image': $r('app.media.beiwanglu'), 'message': '6项权限', 'icon': $r('app.media.rightarrow'), alphabeticalIndex: 'B' }, - { 'name': '拨号权限', 'index': 2, 'image': $r('app.media.phone'), 'message': '5项权限', 'icon': $r('app.media.rightarrow'), alphabeticalIndex: 'B' }, - { 'name': '电子邮件', 'index': 3, 'image': $r('app.media.baiduwangpan'), 'message': '1项权限', 'icon': $r('app.media.rightarrow'), alphabeticalIndex: 'D' }, - { 'name': '华为视频', 'index': 4,'image': $r('app.media.bilibili'), 'message': '5项权限', 'icon': $r('app.media.rightarrow'), alphabeticalIndex: 'H' }, - { 'name': '联系人', 'index': 5, 'image': $r('app.media.tongxunlu'), 'message': '5项权限', 'icon': $r('app.media.rightarrow'), alphabeticalIndex: 'L' }, - { 'name': '日历', 'index': 6, 'image': $r('app.media.ic_public_calendar'), 'message': '5项权限', 'icon': $r('app.media.rightarrow'), alphabeticalIndex: 'R' }, - { 'name': '手机管家', 'index': 7, 'image': $r('app.media.weixin'), 'message': '5项权限', 'icon': $r('app.media.rightarrow'), alphabeticalIndex: 'S' }, - { 'name': '图库', 'index': 8, 'image': $r("app.media.photo"), 'message': '5项权限', 'icon': $r('app.media.rightarrow'), alphabeticalIndex: 'T' } -] diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/categoryList.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/categoryList.ets deleted file mode 100644 index bbeb6f392191717820487ba1344c228a5afc6219..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/categoryList.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export const categoryListItem: any[] = [ - { 'name': '声音和振动', 'index': 1, 'image': $r('app.media.shengyin'), 'icon': $r('app.media.rightarrow') }, - { 'name': '通知', 'index': 2, 'image': $r('app.media.tongzhi'), 'icon': $r('app.media.rightarrow') }, - { 'name': '生物识别', 'index': 3, 'image': $r('app.media.shibie'), 'icon': $r('app.media.rightarrow') }, - { 'name': '应用和服务', 'index': 4,'image': $r('app.media.yingyong'), 'icon': $r('app.media.rightarrow') }, - { 'name': '电池', 'index': 5, 'image': $r('app.media.dianchi'), 'icon': $r('app.media.rightarrow') }, - { 'name': '存储', 'index': 6, 'image': $r('app.media.cunchu'), 'icon': $r('app.media.rightarrow') }, - { 'name': '安全', 'index': 7, 'image': $r('app.media.anquan'), 'icon': $r('app.media.rightarrow') }, - { 'name': '隐私', 'index': 8, 'image': $r('app.media.yinsi'), 'icon': $r('app.media.rightarrow') }, - { 'name': '平板健康', 'index': 9, 'image': $r('app.media.jiankang'), 'icon': $r('app.media.rightarrow') }, - { 'name': '应用设置', 'index': 10, 'image': $r('app.media.shezhi'), 'icon': $r('app.media.rightarrow') } -] \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/definePermission.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/definePermission.ets deleted file mode 100644 index 3ec8b5776f9210bdec2d3abcb2924b3f9e337181..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/definePermission.ets +++ /dev/null @@ -1,753 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export const definePermissions: any[] = [ - { - "name": "ohos.permission.ANSWER_CALL", - "grantMode": "user_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_answer_call", - "description": "$string:ohos_desc_answer_call" - }, - { - "name": "ohos.permission.USE_BLUETOOTH", - "grantMode": "system_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.DISCOVER_BLUETOOTH", - "grantMode": "system_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_BLUETOOTH", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.INTERNET", - "grantMode": "system_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_internet", - "description": "$string:ohos_desc_internet" - }, - { - "name": "ohos.permission.MODIFY_AUDIO_SETTINGS", - "grantMode": "system_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_modify_audio_settings", - "description": "$string:ohos_desc_modify_audio_settings" - }, - { - "name": "ohos.permission.READ_CALENDAR", - "grantMode": "user_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_calendar", - "description": "$string:ohos_desc_read_calendar" - }, - { - "name": "ohos.permission.READ_CALL_LOG", - "grantMode": "user_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_call_log", - "description": "$string:ohos_desc_read_call_log" - }, - { - "name": "ohos.permission.READ_CELL_MESSAGES", - "grantMode": "user_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_cell_messages", - "description": "$string:ohos_desc_read_cell_messages" - }, - { - "name": "ohos.permission.READ_CONTACTS", - "grantMode": "user_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_contacts", - "description": "$string:ohos_desc_read_contacts" - }, - { - "name": "ohos.permission.GET_TELEPHONY_STATE", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_get_telephony_state", - "description": "$string:ohos_desc_get_telephony_state" - }, - { - "name": "ohos.permission.READ_MESSAGES", - "grantMode": "user_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_messages", - "description": "$string:ohos_desc_read_messages" - }, - { - "name": "ohos.permission.RECEIVE_MMS", - "grantMode": "user_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_receive_mms", - "description": "$string:ohos_desc_receive_mms" - }, - { - "name": "ohos.permission.RECEIVE_SMS", - "grantMode": "user_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_receive_sms", - "description": "$string:ohos_desc_receive_sms" - }, - { - "name": "ohos.permission.RECEIVE_WAP_MESSAGES", - "grantMode": "user_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_receive_wap_messages", - "description": "$string:ohos_desc_receive_wap_messages" - }, - { - "name": "ohos.permission.MICROPHONE", - "grantMode": "user_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_microphone", - "description": "$string:ohos_desc_microphone" - }, - { - "name": "ohos.permission.SEND_MESSAGES", - "grantMode": "user_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_send_messages", - "description": "$string:ohos_desc_send_messages" - }, - { - "name": "ohos.permission.WRITE_CALENDAR", - "grantMode": "user_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_write_calendar", - "description": "$string:ohos_desc_write_calendar" - }, - { - "name": "ohos.permission.WRITE_CALL_LOG", - "grantMode": "user_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_write_call_log", - "description": "$string:ohos_desc_write_call_log" - }, - { - "name": "ohos.permission.WRITE_CONTACTS", - "grantMode": "user_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_write_contacts", - "description": "$string:ohos_desc_write_contacts" - }, - { - "name": "ohos.permission.DISTRIBUTED_DATASYNC", - "grantMode": "user_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": true, - "label": "$string:ohos_lab_distributed_datasync", - "description": "$string:ohos_desc_distributed_datasync" - }, - { - "name": "ohos.permission.MANAGE_VOICEMAIL", - "grantMode": "user_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_manage_voicemail", - "description": "$string:ohos_desc_manage_voicemail" - }, - { - "name": "ohos.permission.REQUIRE_FORM", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.LOCATION_IN_BACKGROUND", - "grantMode": "user_grant", - "availableScope": "normal", - "provisionEnable": false, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_location_in_background", - "description": "$string:ohos_desc_location_in_background" - }, - { - "name": "ohos.permission.LOCATION", - "grantMode": "user_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": true, - "label": "$string:ohos_lab_location", - "description": "$string:ohos_desc_location" - }, - { - "name": "ohos.permission.MEDIA_LOCATION", - "grantMode": "user_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": true, - "label": "$string:ohos_lab_media_location", - "description": "$string:ohos_desc_media_location" - }, - { - "name": "ohos.permission.GET_NETWORK_INFO", - "grantMode": "system_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_get_network_info", - "description": "$string:ohos_desc_get_network_info" - }, - { - "name": "ohos.permission.PLACE_CALL", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": true, - "label": "$string:ohos_lab_place_call", - "description": "$string:ohos_desc_place_call" - }, - { - "name": "ohos.permission.CAMERA", - "grantMode": "user_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_camera", - "description": "$string:ohos_desc_camera" - }, - { - "name": "ohos.permission.SET_NETWORK_INFO", - "grantMode": "system_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_set_network_info", - "description": "$string:ohos_desc_set_network_info" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.READ_MEDIA", - "grantMode": "user_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": true, - "label": "$string:ohos_lab_read_media", - "description": "$string:ohos_desc_read_media" - }, - { - "name": "ohos.permission.REBOOT", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.RUNNING_LOCK", - "grantMode": "system_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.WRITE_MEDIA", - "grantMode": "user_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": true, - "label": "$string:ohos_lab_write_media", - "description": "$string:ohos_desc_write_media" - }, - { - "name": "com.huawei.permission.DISTRIBUTED_VIRTUALDEVICE", - "grantMode": "user_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_distributed_virtualdevice", - "description": "$string:ohos_desc_distributed_virtualdevice" - }, - { - "name": "ohos.permission.ENROLL_BIOMETRIC", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": false, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_enroll_biometric", - "description": "$string:ohos_desc_enroll_biometric" - }, - { - "name": "ohos.permission.ACCESS_BIOMETRIC", - "grantMode": "system_grant", - "availableScope": "normal", - "provisionEnable": false, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_access_biometric", - "description": "$string:ohos_desc_access_biometric" - }, - { - "name": "ohos.permission.ACCESS_BIOMETRIC_INTERNAL", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": false, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_access_biometric_internal", - "description": "$string:ohos_desc_access_biometric_internal" - }, - { - "name": "ohos.permission.RESET_BIOMETRIC_LOCKOUT", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": false, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_reset_biometric_lockout", - "description": "$string:ohos_desc_reset_biometric_lockout" - }, - { - "name": "ohos.permission.SET_TIME", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_set_time", - "description": "$string:ohos_desc_set_time" - }, - { - "name": "ohos.permission.SET_TIME_ZONE", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_set_time_zone", - "description": "$string:ohos_desc_set_time_zone" - }, - { - "name": "ohos.permission.DOWNLOAD_SESSION_MANAGER", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_download_session_manager", - "description": "$string:ohos_desc_download_session_manager" - }, - { - "name": "ohos.permission.COMMONEVENT_STICKY", - "grantMode": "system_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": true, - "label": "$string:ohos_lab_commonevent_sticky", - "description": "$string:ohos_desc_commonevent_sticky" - }, - { - "name": "ohos.permission.SYSTEM_FLOAT_WINDOW", - "grantMode": "system_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.POWER_MANAGER", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.REFRESH_USER_ACTION", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.POWER_OPTIMIZATION", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.REBOOT_RECOVERY", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_manage_local_accounts", - "description": "$string:ohos_desc_manage_local_accounts" - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_interact_across_local_accounts", - "description": "$string:ohos_desc_interact_across_local_accounts" - }, - { - "name": "ohos.permission.VIBRATE", - "grantMode": "system_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_vibrate", - "description": "$string:ohos_desc_vibrate" - }, - { - "name": "ohos.permission.ACTIVITY_MOTION", - "grantMode": "user_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_activity_motion", - "description": "$string:ohos_desc_activity_motion" - }, - { - "name": "ohos.permission.READ_HEALTH_DATA", - "grantMode": "user_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_read_health_data", - "description": "$string:ohos_desc_read_health_data" - }, - { - "name": "ohos.permission.CONNECT_IME_ABILITY", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_connect_ime_ability", - "description": "$string:ohos_desc_connect_ime_ability" - }, - { - "name": "ohos.permission.CONNECT_SCREEN_SAVER_ABILITY", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.READ_SCREEN_SAVER", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.WRITE_SCREEN_SAVER", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.SET_WALLPAPER", - "grantMode": "system_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_set_wallpaper", - "description": "$string:ohos_desc_set_wallpaper" - }, - { - "name": "ohos.permission.GET_WALLPAPER", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_get_wallpaper", - "description": "$string:ohos_desc_get_wallpaper" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCESS_MISSIONS", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "grantMode": "system_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.KEEP_BACKGROUND_RUNNING", - "grantMode": "system_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.UPDATE_CONFIGURATION", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_SENSITIVE_PERMISSIONS", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_interact_across_local_accounts_extension", - "description": "$string:ohos_desc_interact_across_local_accounts_extension" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO", - "grantMode": "system_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.ACCELEROMETER", - "grantMode": "system_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_accelerometer", - "description": "$string:ohos_desc_accelerometer" - }, - { - "name": "ohos.permission.GYROSCOPE", - "grantMode": "system_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_gyroscope", - "description": "$string:ohos_desc_gyroscope" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_SHORTCUTS", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.radio.ACCESS_FM_AM", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.SET_TELEPHONY_STATE", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_set_telephony_state", - "description": "$string:ohos_desc_set_telephony_state" - }, - { - "name": "ohos.permission.START_ABILIIES_FROM_BACKGROUND", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.BUNDLE_ACTIVE_INFO", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_bundle_active_info", - "description": "$string:ohos_desc_bundle_active_info" - }, - { - "name": "ohos.permission.START_INVISIBLE_ABILITY", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.sec.ACCESS_UDID", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.LAUNCH_DATA_PRIVACY_CENTER", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_MEDIA_RESOURCES", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.PUBLISH_AGENT_REMINDER", - "grantMode": "system_grant", - "availableScope": "normal", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_publish_agent_reminder", - "description": "$string:ohos_desc_publish_agent_reminder" - }, - { - "name": "ohos.permission.CONTROL_TASK_SYNC_ANIMATOR", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_control_task_sync_animator", - "description": "$string:ohos_desc_control_task_sync_animator" - }, - { - "name": "ohos.permission.INPUT_MONITORING", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.MANAGE_MISSIONS", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false - }, - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER", - "grantMode": "system_grant", - "availableScope": "system_core", - "provisionEnable": true, - "distributedSceneEnable": false, - "label": "$string:ohos_lab_notification_controller", - "description": "$string:ohos_desc_notification_controller" - }, - { - "name": "ohos.permission.CONNECTIVITY_INTERNAL", - "grantMode": "system_grant", - "availableScope": "system_basic", - "provisionEnable": true, - "distributedSceneEnable": false - } -] \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/dialogDataList.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/dialogDataList.ets deleted file mode 100644 index f6dbf9c9b22f7072a33813b3ce8e07677efb716e..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/dialogDataList.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export const dialogData: any[] = [ - { 'name': '权限1', 'index': 1, 'message1': '是否允许"XX"访问健身运动','message2': '用于XXXX', 'icon': $r("app.media.ic_exercise") }, - { 'name': '权限2', 'index': 2, 'message1': '内容2','message2': '内容二', 'icon': $r("app.media.ic_exercise") }, - { 'name': '权限3', 'index': 3, 'message1': '内容3','message2': '内容三', 'icon': $r("app.media.ic_exercise") }, - { 'name': '权限4', 'index': 4, 'message1': '内容4','message2': '内容四', 'icon': $r("app.media.ic_exercise") } -] \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/mediaDocList.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/mediaDocList.ets deleted file mode 100644 index 6bcb6341f7b37345af9bfc4223c0e049c550cfee..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/mediaDocList.ets +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export const mediaDocListItem: any[] = [ - { 'name': '允许', 'index': 1, groupName: 'radio' }, - { 'name': '禁止', 'index': 2, groupName: 'radio' } -] -export const mediaListItem: any[] = [ - { 'name': '相机', 'index': 2, 'image': $r('app.media.ic_public_camera'), 'icon': $r('app.media.rightarrow'), version: '1.1.1', use: '用途001' }, - { 'name': '麦克风', 'index': 3, 'image': $r('app.media.ic_public_voice'), 'icon': $r('app.media.rightarrow'), version: '1.1.1', use: '用途001' }, - { 'name': '媒体和文件', 'index': 5, 'image': $r('app.media.ic_public_folder'), 'icon': $r('app.media.rightarrow'), version: '1.1.1', use: '用途001' }, - { 'name': '日历', 'index': 6, 'image': $r('app.media.ic_public_calendar'), 'icon': $r('app.media.rightarrow'), version: '1.1.1', use: '用途001' } -] \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/otherPermissionsList.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/otherPermissionsList.ets deleted file mode 100644 index 893dbf0b702e12f604da947b51196d84e5395eae..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/otherPermissionsList.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export const otherPermissionsListItem: any[] = [ - { 'name': '生物识别', 'index': 1, 'icon': $r('app.media.rightarrow') }, - { 'name': '微博', 'index': 2, 'icon': $r('app.media.rightarrow') }, - { 'name': '附近设备', 'index': 3, 'icon': $r('app.media.rightarrow') }, -] \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/permissionAccessRecordList.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/permissionAccessRecordList.ets deleted file mode 100644 index eb67712768c662d218b567450e3a475563878cef..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/permissionAccessRecordList.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export const permissionAccessRecordListItem: any[] = [ - { 'name1': '微信', 'index': 1, 'image1': $r('app.media.weixin'), 'image2': $r('app.media.phone'), 'name2': '电话', 'visits': 16, 'lastVisitTime': '12月29日 上午12:22' }, - { 'name1': 'QQ', 'index': 2, 'image1': $r('app.media.qq'), 'image2': $r('app.media.phone'), 'name2': '电话', 'visits': 10, 'lastVisitTime': '12月30日 上午13:54' } -] \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/permissionGroup.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/permissionGroup.ets deleted file mode 100644 index e37aabf773b6093b2b4dbe07d3a3adcf9378beaa..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/model/permissionGroup.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export const permissionGroups: any[] = [ - { 'name': 'ohos.permission.READ_CALENDAR', "group": "CALENDAR"}, - { 'name': 'ohos.permission.WRITE_CALENDAR', "group": "CALENDAR"}, - { 'name': 'ohos.permission.READ_CALL_LOG', "group": "CALL_LOG"}, - { 'name': 'ohos.permission.WRITE_CALL_LOG', "group": "CALL_LOG"}, - { 'name': 'ohos.permission.READ_CONTACTS', "group": "CONTACTS"}, - { 'name': 'ohos.permission.WRITE_CONTACTS', "group": "CONTACTS"}, - { 'name': 'ohos.permission.ANSWER_CALL', "group": "PHONE"}, - { 'name': 'ohos.permission.MANAGE_VOICEMAIL', "group": "PHONE"}, - { 'name': 'ohos.permission.READ_CELL_MESSAGES', "group": "SMS"}, - { 'name': 'ohos.permission.READ_MESSAGES', "group": "SMS"}, - { 'name': 'ohos.permission.RECEIVE_MMS', "group": "SMS"}, - { 'name': 'ohos.permission.RECEIVE_SMS', "group": "SMS"}, - { 'name': 'ohos.permission.RECEIVE_WAP_MESSAGES', "group": "SMS"}, - { 'name': 'ohos.permission.SEND_MESSAGES', "group": "SMS"}, -] - -export const groups: any[] = [ - { 'name': 'CALENDAR', - "permissions": ["ohos.permission.READ_CALENDAR", 'ohos.permission.WRITE_CALENDAR'], - "groupName": '日历', - "description": '访问日历和活动' - }, - { 'name': 'CALL_LOG', - "permissions": ["ohos.permission.READ_CALL_LOG", 'ohos.permission.WRITE_CALL_LOG'], - "groupName": '通话记录', - "description": '读取和写入手机通话记录' - }, - { 'name': 'CONTACTS', - "permissions": ["ohos.permission.READ_CONTACTS", 'ohos.permission.WRITE_CONTACTS'], - "groupName": '通讯录', - "description": '访问您的通讯录' - }, - { 'name': 'PHONE', - "permissions": ["ohos.permission.ANSWER_CALL", 'ohos.permission.MANAGE_VOICEMAIL'], - "groupName": '电话', - "description": '拨打电话和管理通话' - }, - { 'name': 'SMS', - "permissions": ["ohos.permission.READ_CELL_MESSAGES", 'ohos.permission.READ_MESSAGES', 'ohos.permission.RECEIVE_MMS', 'ohos.permission.RECEIVE_SMS', 'ohos.permission.RECEIVE_WAP_MESSAGES', 'ohos.permission.SEND_MESSAGES'], - "groupName": '短信', - "description": '发送和查看短信' - }, -] \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/app-name-plus.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/app-name-plus.ets deleted file mode 100644 index a410d746623bc6183a8bba586973e19141dcd9b2..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/app-name-plus.ets +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { backBar } from "../common/components/backBar.ets" -import { allowedListItem, bannedListItem } from "../common/model/appNameList.ets" -import router from '@system.router' - -@Entry -@Component -struct appNamePlusPage { - private routerData = router.getParams().routerData - build() { - GridContainer({ gutter: 0 }) { - Row() { - Row() - .useSizeType({ - xs: { span: 1, offset: 0 }, sm: { span: 1, offset: 0 }, - md: { span: 1, offset: 0 }, lg: { span: 2, offset: 0 } - }) - .height("100%") - Row() { - Column() { - Row() { - backBar({ title: JSON.stringify(this.routerData.name) }) - } - Row() { - Column() { - Scroll() { - appNameItem({ - allowedListItem: allowedListItem, - bannedListItem: bannedListItem, - // buttonListItem: buttonListItem - }) - } - }.width('100%') - }.layoutWeight(1).width("100%") - } - } - .useSizeType({ - xs: { span: 1, offset: 1 }, sm: { span: 2, offset: 1 }, - md: { span: 6, offset: 1 }, lg: { span: 8, offset: 2 } - }) - .height("100%") - Row() - .useSizeType({ - xs: { span: 1, offset: 2 }, sm: { span: 1, offset: 3 }, - md: { span: 1, offset: 7 }, lg: { span: 2, offset: 10 } - }) - .height("100%") - } - .height('100%') - } - } -} - -@Component -struct appNameItem { - private routerData = router.getParams().routerData - private allowedListItem: any[] - private bannedListItem: any[] -// private buttonListItem: any[] - @State text: string = '' - @State fontColor: string = '' - - build() { - Row() { - Column() { - Row() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Text($r('app.string.allowed')) - .fontSize(14) - .margin({ top: 19.5, left: 48 }) - } - } - Row() { - List() { - ForEach(this.allowedListItem, (item) => { - ListItem() { - Row() { - Column() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Row() { - Column() { - if(item.permission != ''){ - Row() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Text(item.name) - .fontSize(16) - .fontColor($r('app.color.text_color')) - } - }.margin({ top: 8 }) - Row() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Text(item.permission) - .fontSize(14) - .fontColor($r('app.color.icon_color')) - } - }.margin({ bottom: 8 }) - }else{ - Row() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Text(item.name) - .fontSize(16) - .fontColor($r('app.color.text_color')) - }.margin({ top: 8, bottom: 8 }) - }.height('100%') - } - - }.flexGrow(1).constraintSize({ minHeight: "48vp" }) - Image($r('app.media.rightarrow')) - .objectFit(ImageFit.Contain) - .height(24) - .width(12) - } - .width('100%') - .height(48) - } - if (item.index !== this.allowedListItem.length) { - Row() { - Column() - .backgroundColor($r('app.color.text_decoration_color')) - .width('100%') - .height('2vp') - } - } - }.onClick(() => { - router.push({ - uri: 'pages/media-documents', - params: { routerData: item} - }) - }) - } - }.padding({ left: 24, right: 24 }) - }, item => item.toString()) - }.backgroundColor($r('app.color.default_background_color')).borderRadius(24).padding({ top: 4, bottom: 4 }) - }.margin({ top: 9 }).padding({ left: 24, right: 24 }) - Row() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Text($r('app.string.banned')) - .fontSize(14) - .margin({ top: 19.5, left: 48 }) - } - } - Row() { - List() { - ForEach(this.bannedListItem, (item) => { - ListItem() { - Row() { - Column() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Row() { - Text(item.name) - .fontSize(16) - .fontColor($r('app.color.text_color')) - .flexGrow(1) - Image($r('app.media.rightarrow')) - .objectFit(ImageFit.Contain) - .height(24) - .width(12) - } - .width('100%') - .height(48) - } - if (item.index !== this.bannedListItem.length) { - Row() { - Column() - .backgroundColor($r('app.color.text_decoration_color')) - .width('100%') - .height('2vp') - } - } - }.onClick(() => { - router.push({ - uri: 'pages/media-documents', - params: { routerData: item } - }) - }) - } - }.padding({ left: 24, right: 24 }) - }, item => item.toString()) - }.backgroundColor($r('app.color.default_background_color')).borderRadius(24).padding({ top: 4, bottom: 4 }) - }.margin({ top: 9 }).padding({ left: 24, right: 24 }) - Row() { -// if(this.buttonListItem[0]['name'] !== 'disabled' ) { -// Button('查看所有权限', { type: ButtonType.Capsule, stateEffect: false }) -// .fontColor($r('app.color.icon_color')) -// .backgroundColor($r('app.color.background_color')) -// .width(90) -// }else{ - Button('查看所有权限', { type: ButtonType.Capsule, stateEffect: true }) - .fontColor($r('app.color.button_color')) - .backgroundColor($r('app.color.background_color')) - .width(90).height(48) - .onTouch((event: TouchEvent) => { - if (event.type === TouchType.Down) { - } - if (event.type === TouchType.Up) { - router.push({ - uri: 'pages/app-name', - params: { routerData: this.routerData.name } - }) - } - if (event.type === TouchType.Move) { - if(event.touches[0].x < 0 || event.touches[0].x > 90 || event.touches[0].y > 0 || event.touches[0].y > 48) { - this.fontColor = $r('app.color.icon_color') + '' - } - } - }) -// } - }.margin({top:16}) - } - .width('100%') - .height('100%') - .backgroundColor($r('app.color.background_color')) - - } - } -} diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/app-name.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/app-name.ets deleted file mode 100644 index f26f8e8f645a6f918d826e145ece6ee7ee29bc01..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/app-name.ets +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { backBar } from "../common/components/backBar.ets" -import { calendarListItem, dynamicListItem } from "../common/model/appNameList.ets" -import router from '@system.router' -@Entry -@Component -struct appNamePage { - private routerData = router.getParams().routerData - build() { - GridContainer({ gutter: 0 }) { - Row() { - Row() - .useSizeType({ - xs: { span: 1, offset: 0 }, sm: { span: 1, offset: 0 }, - md: { span: 1, offset: 0 }, lg: { span: 2, offset: 0 } - }) - .height("100%") - Row() { - Column() { - Row() { - backBar({ title: JSON.stringify(this.routerData) }) - } - Row() { - Column() { - Scroll() { - appNameItem({ - calendarListItem: calendarListItem, - dynamicListItem: dynamicListItem - }) - } - } - }.layoutWeight(1).width("100%") - } - } - .useSizeType({ - xs: { span: 1, offset: 1 }, sm: { span: 2, offset: 1 }, - md: { span: 6, offset: 1 }, lg: { span: 8, offset: 2 } - }) - .height("100%") - Row() - .useSizeType({ - xs: { span: 1, offset: 2 }, sm: { span: 1, offset: 3 }, - md: { span: 1, offset: 7 }, lg: { span: 2, offset: 10 } - }) - .height("100%") - } - .height('100%') - } - } -} - -@Component -struct appNameItem { - private calendarListItem: any[] - private dynamicListItem: any[] - - build() { - Row() { - Column() { - Row() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Text($r('app.string.calendar')) - .fontSize(14) - .margin({ top: 19.5, left: 48 }) - } - } - Row() { - List() { - ForEach(this.calendarListItem, (item) => { - ListItem() { - Row() { - Column() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Row() { - Text(item.name) - .fontSize(16) - .fontColor($r('app.color.text_color')) - .flexGrow(1) - Toggle({ type: ToggleType.Switch, isOn: true }) - .selectedColor($r('app.color.toggle_color')) - .width(36) - .height(20) - .onChange((isOn: boolean) => { - }) - } - .width('100%') - .height(48) - } - if (item.index !== this.calendarListItem.length) { - Row() { - Column() - .backgroundColor($r('app.color.text_decoration_color')) - .width('100%') - .height('2vp') - } - } - }.onClick(() => { - }) - } - }.padding({ left: 24, right: 24 }) - }, item => item.toString()) - }.backgroundColor($r('app.color.default_background_color')).borderRadius(24).padding({ top: 4, bottom: 4 }) - }.margin({ top: 9 }).padding({ left: 24, right: 24 }) - Row() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Text('xxx') - .fontSize(14) - .margin({ top: 19.5, left: 48 }) - } - } - Row() { - List() { - ForEach(this.dynamicListItem, (item) => { - ListItem() { - Row() { - Column() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Row() { - Text(item.name) - .fontSize(16) - .fontColor($r('app.color.text_color')) - .flexGrow(1) - Toggle({ type: ToggleType.Switch, isOn: true }) - .selectedColor($r('app.color.toggle_color')) - .width(36) - .height(20) - .onChange((isOn: boolean) => { - }) - } - .width('100%') - .height(48) - } - if (item.index !== this.dynamicListItem.length) { - Row() { - Column() - .backgroundColor($r('app.color.text_decoration_color')) - .width('100%') - .height('2vp') - } - } - }.onClick(() => { - }) - } - }.padding({ left: 24, right: 24 }) - }, item => item.toString()) - }.backgroundColor($r('app.color.default_background_color')).borderRadius(24).padding({ top: 4, bottom: 4 }) - }.margin({ top: 9 }).padding({ left: 24, right: 24 }) - } - .width('100%') - .height('100%') - .backgroundColor($r('app.color.background_color')) - } - } -} diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/authority-management.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/authority-management.ets deleted file mode 100644 index 787fa6016b9d97d5cc2874f9033b7f7ecc4ce8c5..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/authority-management.ets +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { authorityListItem, messageListItem, applicationListItem } from "../common/model/authorityManagementList.ets" -import { backBar } from "../common/components/backBar.ets" -import { alphabetIndexerComponent } from "../common/components/alphabeticalIndex.ets" -import { textInput } from "../common/components/search.ets" -import router from '@system.router' -import bundle from "@ohos.bundle" - -@Extend(Text) function customizeText(fontSize: string) { - .fontSize(fontSize) - .fontColor($r('app.color.text_color')) -} -@Extend(Image) function customizeImage(width: number, height: number) { - .objectFit(ImageFit.Contain) - .width(width) - .height(height) -} -@Extend(Row) function customizeRow() { - .backgroundColor($r('app.color.default_background_color')) - .width('500%') - .height('7%') - .borderRadius('20px') - .margin({ - left: '10vp' - }) -} - -@Entry -@Component -struct authorityManagementPage { - - build() { - GridContainer({ gutter: 0 }) { - Row() { - Row() - .useSizeType({ - xs: { span: 1, offset: 0 }, sm: { span: 1, offset: 0 }, - md: { span: 1, offset: 0 }, lg: { span: 2, offset: 0 } - }) - .height("100%") - Row() { - Column() { - Row() { - backBar( { title: JSON.stringify($r('app.string.authority_management')) }) - } - Row() { - Column() { - Column() { - Stack() { - Tabs() { - TabContent() { - Scroll() { - authorityItem({ - authorityListItem: authorityListItem, - messageListItem: messageListItem - }) - } - }.tabBar('权限') - - TabContent() { - Scroll() { - applicationItem({ - applicationListItem: applicationListItem, - }) - } - }.tabBar('应用') - } - .backgroundColor($r('app.color.background_color')) - .barWidth(744) - .barMode(BarMode.Scrollable) - }.height('100%') - } - } - } - .layoutWeight(1) - } - } - .useSizeType({ - xs: { span: 1, offset: 1 }, sm: { span: 2, offset: 1 }, - md: { span: 6, offset: 1 }, lg: { span: 8, offset: 2 } - }) - .height("100%") - Row() - .useSizeType({ - xs: { span: 1, offset: 2 }, sm: { span: 1, offset: 3 }, - md: { span: 1, offset: 7 }, lg: { span: 2, offset: 10 } - }) - .height("100%") - } - .height('100%') - } - } -} - -@Component -struct authorityItem { - private authorityListItem: any[] - private messageListItem: any[] - @Builder ListItemLayout(item, list) { - ListItem() { - Row() { - Column() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Row() { - Image(item.image) - .customizeImage(24, 24) - .margin({ right: 16 }) - Text(item.name) - .fontSize(16) - .fontColor($r('app.color.text_color')) - .flexGrow(1) - Image(item.icon) - .customizeImage(12, 24) - } - .width('100%') - .height(56) - } - if (item.index !== list.length) { - Row() { - Column() - .backgroundColor($r('app.color.text_decoration_color')) - .width('100%') - .height('2vp') - } - } - }.onClick(() => { - if (item.name === '日历') { - router.push({ - uri: 'pages/calendar', - params: { routerData: item } - }) - } else { - router.push({ - uri: 'pages/location-info', - params: { routerData: item } - }) - } - - }) - } - }.padding({ left: 12, right: 12 }) -} - aboutToAppear() { - console.info("start run testcase!!!!") -// bundle.getAllApplicationInfo(0x00000000,1) -// .then((Want) => { -// console.info( "yanxi" + JSON.stringify(Want)); -// console.log( "yanxi" + JSON.stringify(Want)); -// }) -// .catch((error) => { -// console.error('Operation failed. Cause: ' + JSON.stringify(error)); -// }) - - } - build() { - Row() { - Column() { - Row() { - List() { - ForEach(this.authorityListItem, (item) => { - this.ListItemLayout(item, this.authorityListItem) - }, item => item.toString()) - }.backgroundColor($r('app.color.default_background_color')).borderRadius(24).padding({ top: 4, bottom: 4 }) - }.padding({ left: 12, right: 12, top: 8 }) - Row() { - List() { - ForEach(this.messageListItem, (item) => { - this.ListItemLayout(item, this.messageListItem) - }, item => item.toString()) - }.backgroundColor($r('app.color.default_background_color')).borderRadius(24).padding({ top: 4, bottom: 4 }) - }.margin({ top: 12 }).padding({ left: 12, right: 12 }) - }.width('100%') - .backgroundColor($r('app.color.background_color')) - } - } -} - -@Component -struct applicationItem { - @State applicationList: any[] = applicationListItem - private applicationListItem: any[] - - @Builder ListItemLayout(item, index) { - ListItem() { - Row() { - Column() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Row() { - Image(item.image) - .customizeImage(40, 40) - .margin({ right: 16 }) - Text(item.name) - .fontSize(16) - .fontColor($r('app.color.text_color')) - .flexGrow(1) - Text(item.message) - .fontSize(14) - .fontColor($r('app.color.icon_color')) - .margin({ right: 4 }) - Image(item.icon) - .customizeImage(12, 24) - } - .width('100%') - .height(72) - .constraintSize({ minHeight: "72vp" }) - } - if (index === 0) { - Row() { - Column() - .backgroundColor($r('app.color.text_decoration_color')) - .width('100%') - .height('2vp') - } - } - }.onClick(() => { - router.push({ - uri: 'pages/app-name-plus', - params: { routerData: item } - }) - }) - } - }.padding({ left: 12, right: 12 }) - } - build() { - Column() { - Row() { - textInput({ placeholder: '搜索应用' }) -// .width("100%") - }.padding({ left: 12, top: 8, right: 4 }) - Scroll() { - Row() { - Flex({ alignItems: ItemAlign.Start }) { - Column() { - Row() { - List() { - ForEach(this.applicationList.slice(0, this.applicationList.length - 1), (item) => { - this.ListItemLayout(item, 0) - }, item => item.toString()) - ForEach(this.applicationList.slice(-1), (item, index) => { - this.ListItemLayout(item, 1) - }, item => item.toString()) - }.backgroundColor($r('app.color.default_background_color')).borderRadius(24).padding({ top: 4, bottom: 4 }) - }.margin({ top: 12 }).padding({ left: 12 }) - } - .backgroundColor($r('app.color.background_color')) - .height("89%") - Column() { - alphabetIndexerComponent({ page: 'authority-management', applicationList: $applicationList }) - } - .margin({ top: 12 }) - .width(24) - } - } - } - } - } -} diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/calendar.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/calendar.ets deleted file mode 100644 index 7938a47a348a4185c0a571e765bdfcb5ccc0d767..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/calendar.ets +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { backBar } from "../common/components/backBar.ets" -import { calendarListItem } from "../common/model/appNameList.ets" -import router from '@system.router' -@Entry -@Component -struct appNamePage { - build() { - GridContainer({ gutter: 0 }) { - Row() { - Row() - .useSizeType({ - xs: { span: 1, offset: 0 }, sm: { span: 1, offset: 0 }, - md: { span: 1, offset: 0 }, lg: { span: 2, offset: 0 } - }) - .height("100%") - Row() { - Column() { - Row() { - backBar({title: JSON.stringify($r("app.string.calendar"))}) - } - Row() { - Column() { - Scroll() { - appNameItem({ - calendarListItem: calendarListItem, - }) - } - } - }.layoutWeight(1) - } - } - .useSizeType({ - xs: { span: 1, offset: 1 }, sm: { span: 2, offset: 1 }, - md: { span: 6, offset: 1 }, lg: { span: 8, offset: 2 } - }) - .height("100%") - Row() - .useSizeType({ - xs: { span: 1, offset: 2 }, sm: { span: 1, offset: 3 }, - md: { span: 1, offset: 7 }, lg: { span: 2, offset: 10 } - }) - .height("100%") - } - .height('100%') - } - } -} - -@Component -struct appNameItem { - private calendarListItem: any[] - - build() { - Row() { - Column() { - Row() { - List() { - ForEach(this.calendarListItem, (item) => { - ListItem() { - Row() { - Column() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Row() { - Text(item.name) - .fontSize(16) - .fontColor($r('app.color.text_color')) - .flexGrow(1) - Image($r('app.media.rightarrow')) - .objectFit(ImageFit.Contain) - .height(24) - .width(12) - } - .width('100%') - .height(48) - } - if (item.index !== this.calendarListItem.length) { - Row() { - Column() - .backgroundColor($r('app.color.text_decoration_color')) - .width('100%') - .height('2vp') - } - } - }.onClick(() => { - router.push({ - uri: 'pages/location-info', - params: { routerData: item } - }) - }) - } - }.padding({ left: 24, right: 24 }) - }, item => item.toString()) - }.backgroundColor($r('app.color.default_background_color')).borderRadius(24).padding({ top: 4, bottom: 4 }) - }.margin({ top: 9 }).padding({ left: 24, right: 24 }) - } - .width('100%') - .height('100%') - .backgroundColor($r('app.color.background_color')) - } - } -} diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/dialog.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/dialog.ets deleted file mode 100644 index 45ee546a706e3ae23b0852f1a1dfa088aab03435..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/dialog.ets +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { spaceDialog } from "../common/components/dialog.ets" - -@Entry -@Component -struct dialogPage { - spaceDialogController: CustomDialogController = new CustomDialogController({ - builder: spaceDialog({ cancel: this.spaceCancel, confirm: this.spaceAccept }), - cancel: this.spaceExist, - autoCancel: true, - alignment: DialogAlignment.Bottom, - offset: { dx: 0 , dy: -12 }, - customStyle: true - }) - spaceCancel() { - } - spaceAccept() { - } - spaceExist() { - } - aboutToAppear() { - this.spaceDialogController.open() - } - build() { - } -} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/dialogPlus.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/dialogPlus.ets deleted file mode 100644 index 0eb74ca8b03d431750b290a3b516cc170fb28e85..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/dialogPlus.ets +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { privacyDialog } from "../common/components/dialog.ets" -import { dialogData } from "../common/model/dialogDataList.ets" -import { permissionGroups, groups } from "../common/model/permissionGroup.ets" -import bundle from '@ohos.bundle'; -import prompt from '@system.prompt'; -import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; - -@Entry -@Component -struct dialogPlusPage { - @State count: number = 0 - @State userId: number = 0 - @State GET_BUNDLE_DEFAULT: number = 0x00000000 - privacyDialogController: CustomDialogController = new CustomDialogController({ - builder: privacyDialog({ cancel: this.privacyCancel, confirm: this.privacyAccept, count:this.count }), - cancel: this.privacyExist, - autoCancel: true, - alignment: DialogAlignment.Bottom, - offset: { dx: 0 , dy: -12 }, - customStyle: true - }) - privacyAccept() { - bundle.getApplicationInfo('com.example.myapplication', this.GET_BUNDLE_DEFAULT, this.userId).then(async res => { - var acManager = abilityAccessCtrl.createAtManager() - var verify = await acManager.verifyAccessToken(res.accessTokenId, res.permissions[this.count]) - if(verify) { - var permission = permissionGroups.filter(item => item.name == res.permissions[this.count]) - if(permission.length) { - var group = groups.filter(item => item.name == permission[0].group) - await group[0].permissions.forEach(async item => { - var permissionFlag = await acManager.getPermissionFlags(res.accessTokenId, item) - acManager.grantUserGrantedPermission(res.accessTokenId, item, permissionFlag).then(result => { - if(result !== 0) { - prompt.showToast({ - message: '授权信息失败', - duration: 2000, - }); - } - }) - }) - this.verify(res.accessTokenId, res.permissions[this.count]) - }else { - var permissionFlag = await acManager.getPermissionFlags(res.accessTokenId, res.permissions[this.count]) - acManager.grantUserGrantedPermission(res.accessTokenId, res.permissions[this.count], permissionFlag).then(result => { - if(result !== 0) { - prompt.showToast({ - message: '授权信息失败', - duration: 2000, - }); - } - this.verify(res.accessTokenId, res.permissions[this.count]) - }) - } - }else { - this.verify(res.accessTokenId, res.permissions[this.count]) - } - }).catch(() => { - this.count < dialogData.length ? this.count += 1 : '' - }) - - } - privacyCancel() { - bundle.getApplicationInfo('com.example.myapplication', this.GET_BUNDLE_DEFAULT, this.userId).then(async res => { - var acManager = abilityAccessCtrl.createAtManager() - var verify = await acManager.verifyAccessToken(res.accessTokenId, res.permissions[this.count]) - if(verify) { - var permission = permissionGroups.filter(item => item.name == res.permissions[this.count]) - if(permission.length) { - var group = groups.filter(item => item.name == permission[0].group) - await group[0].permissions.forEach(async item => { - var permissionFlag = await acManager.getPermissionFlags(res.accessTokenId, item) - acManager.revokeUserGrantedPermission(res.accessTokenId, item, permissionFlag).then(result => { - if(result !== 0) { - prompt.showToast({ - message: '授权信息失败', - duration: 2000, - }); - } - }) - }) - this.verify(res.accessTokenId, res.permissions[this.count]) - }else { - var permissionFlag = await acManager.getPermissionFlags(res.accessTokenId, res.permissions[this.count]) - acManager.revokeUserGrantedPermission(res.accessTokenId, res.permissions[this.count], permissionFlag).then(result => { - if(result !== 0) { - prompt.showToast({ - message: '授权信息失败', - duration: 2000, - }); - } - this.verify(res.accessTokenId, res.permissions[this.count]) - }) - } - }else { - this.verify(res.accessTokenId, res.permissions[this.count]) - } - }).catch(() => { - this.count < dialogData.length ? this.count += 1 : '' - }) - - } - async verify(tokenId, permissions) { - if(this.count < dialogData.length) { - this.count += 1 - var acManager = abilityAccessCtrl.createAtManager() - var verify = await acManager.verifyAccessToken(tokenId, permissions) - if (verify) { - this.verify(tokenId, permissions) - } - } - } - privacyExist() { - console.info("exist") - } - aboutToAppear() { - this.privacyDialogController.open() - } - build() { - } -} diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/location-info.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/location-info.ets deleted file mode 100644 index 23761a23bf1257eba26eea257042d97fede6f1f0..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/location-info.ets +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { applicationListItem } from "../common/model/authorityManagementList.ets" -import { backBar } from "../common/components/backBar.ets" -import { alphabetIndexerComponent } from "../common/components/alphabeticalIndex.ets" -import { textInput } from "../common/components/search.ets" -import router from '@system.router' - -@Extend(Text) function customizeText(fontSize: string) { - .fontSize(fontSize) - .fontColor($r('app.color.text_color')) -} -@Extend(Image) function customizeImage(width: number, height: number) { - .objectFit(ImageFit.Contain) - .width(width) - .height(height) -} -@Extend(Row) function customizeRow() { - .backgroundColor($r('app.color.default_background_color')) - .width('500%') - .height('7%') - .borderRadius('20px') - .margin({ - left: '10vp' - }) -} - -@Entry -@Component -struct locationInfoPage { - private routerData = router.getParams().routerData - build() { - GridContainer({ gutter: 0 }) { - Row() { - Row() - .useSizeType({ - xs: { span: 1, offset: 0 }, sm: { span: 1, offset: 0 }, - md: { span: 1, offset: 0 }, lg: { span: 2, offset: 0 } - }) - .height("100%") - Row() { - Column() { - Row() { - backBar({title: JSON.stringify(this.routerData.name)}) - } - Row() { - Column() { - applicationItem({ - applicationListItem: applicationListItem - }) - }.width("100%") - } - .layoutWeight(1) - } - } - .useSizeType({ - xs: { span: 1, offset: 1 }, sm: { span: 2, offset: 1 }, - md: { span: 6, offset: 1 }, lg: { span: 8, offset: 2 } - }) - .height("100%") - Row() - .useSizeType({ - xs: { span: 1, offset: 2 }, sm: { span: 1, offset: 3 }, - md: { span: 1, offset: 7 }, lg: { span: 2, offset: 10 } - }) - .height("100%") - } - .height('100%') - } - } -} - -@Component -struct applicationItem { - @State applicationList: any[] = applicationListItem - private applicationListItem: any[] - @Builder ListItemLayout(item, index) { - ListItem() { - Row() { - Column() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Row() { - Image(item.image) - .customizeImage(40, 40) - .margin({ right: 16 }) - Text(item.name) - .fontSize(16) - .fontColor($r('app.color.text_color')) - .flexGrow(1) - Toggle({ type: ToggleType.Switch, isOn: true }) - .selectedColor($r('app.color.toggle_color')) - .width(36) - .height(20) - .onChange((isOn: boolean) => { - }) - } - .width('100%') - .height(72) - .constraintSize({ minHeight: "72vp" }) - } - if (index === 0) { - Row() { - Column() - .backgroundColor($r('app.color.text_decoration_color')) - .width('100%') - .height('2vp') - } - } - }.onClick(() => { - }) - } - }.padding({ left: 12, right: 12 }) - } - build() { - Column() { - Row() { - textInput({ placeholder: '搜索应用' }) - }.padding({ left: 12, right: 4 }) - .backgroundColor($r('app.color.background_color')) - Row() { - Flex({ alignItems:ItemAlign.Start, justifyContent: FlexAlign.Start }) { - Column() { - Flex({ justifyContent: FlexAlign.Start }) { - Text($r('app.string.location_info_message')) - .fontSize(14) - .fontColor($r('app.color.secondary_font_color')) - .margin({ top: 24, left: 12 }) - } - Scroll() { - Row() { - Column() { - Row() { - List() { - ForEach(this.applicationList.slice(0, this.applicationList.length - 1), (item) => { - this.ListItemLayout(item, 0) - }, item => item.toString()) - ForEach(this.applicationList.slice(-1), (item, index) => { - this.ListItemLayout(item, 1) - }, item => item.toString()) - } - .backgroundColor($r('app.color.default_background_color')) - .borderRadius(24) - .padding({ top: 4, bottom: 4 }) - }.margin({ top: 24 }) - }.width('100%') - .height('95%') - .backgroundColor($r('app.color.background_color')) - } - } - }.padding({ left: 12 }) - Column() { - alphabetIndexerComponent({ page: 'location-info', applicationList: $applicationList }) - }.width(24).padding({ top: 16 }) - } - } - .backgroundColor($r('app.color.background_color')) - } - } -} diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/media-documents.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/media-documents.ets deleted file mode 100644 index 51173c37fbdaf3f8465bc50cf32eb188c96ccabb..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/media-documents.ets +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { backBar } from "../common/components/backBar.ets" -import { mediaDocListItem, mediaListItem } from "../common/model/mediaDocList.ets" -import router from '@system.router' -import AccessCtrl from "@ohos.abilityAccessCtrl" - -@Entry -@Component -struct mediaDocumentPage { - private routerData = router.getParams().routerData - build() { - GridContainer({ gutter: 0 }) { - Row() { - Row() - .useSizeType({ - xs: { span: 1, offset: 0 }, sm: { span: 1, offset: 0 }, - md: { span: 1, offset: 0 }, lg: { span: 2, offset: 0 } - }) - .height("100%") - Row() { - Column() { - Row() { - backBar({title: JSON.stringify(this.routerData.name)}) - } - Row() { - Column() { - Scroll() { - otherMediaDocItem({ - mediaDocListItem:mediaDocListItem, - mediaListItem:mediaListItem - }) - } - }.width("100%") - } - .layoutWeight(1) - } - } - .useSizeType({ - xs: { span: 1, offset: 1 }, sm: { span: 2, offset: 1 }, - md: { span: 6, offset: 1 }, lg: { span: 8, offset: 2 } - }) - .height("100%") - Row() - .useSizeType({ - xs: { span: 1, offset: 2 }, sm: { span: 1, offset: 3 }, - md: { span: 1, offset: 7 }, lg: { span: 2, offset: 10 } - }) - .height("100%") - } - .height('100%') - } - } -} - -@Component -struct otherMediaDocItem { - aboutToAppear() { - console.info("yanxi" + "start run testcase!!!!") - AccessCtrl.createAtManager().verifyAccessToken(0, 'ohos.permission.PLACE_CALL') - .then((Want) => { - console.info( "yanxi" + Want); - console.info( "yanxi" + Want); - }) - .catch((error) => { - console.error("yanxi" + 'Operation failed. Cause: ' + error); - }) - } - private routerData = router.getParams().routerData - @State checkList: any[] = [1, 0] - private mediaDocListItem: any[] - private mediaListItem: any[] - build() { - Column() { - Row() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { -// Text(this.mediaListItem[0].name) -// this.mediaListItem.filter(item => { -// -// }) - Image(this.mediaListItem[0].image) - .width(64) - .height(64) - .margin({left:24,right:12}) - Column() { - Row() { - Text(this.routerData.name) - .fontSize(16) - .fontColor("#182431") - } - Row() { - Text(this.routerData.version) - .fontSize(12) - } - } - } - } - Row() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Row() { - Text(this.routerData.use) - .fontSize(12) - }.margin({left:36,right:12}) - } - } - .margin({top:24}) - Row() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Row() { - Text(this.routerData.name + '访问权限') - .fontSize(16) - }.margin({left:36,right:12}) - } - } - .height(48) - .margin({top:12}) - Column() { - List() { - ForEach(this.mediaDocListItem, (item) => { - ListItem() { - Column() { - Row() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Row() { - Text(item.name) - .fontSize(16) - .fontColor($r('app.color.text_color')) - .flexGrow(1) - Radio({ group:item.groupName,value:item.index }) - .width(24) - .height(24) - .checked(this.checkList[item.index - 1]) - .onChange((isChecked) => { - if (item.index - 1) { - if (!isChecked) { - this.checkList[1] = 0 - } - this.checkList = [0, 1] - } else { - if (!isChecked) { - this.checkList[1] = 1 - } - this.checkList = [1, 0] - } - }) - }.backgroundColor($r('app.color.default_background_color')) - .width('100%') - .height('48') - } - } - } - .onClick(() => { - }) - } - .padding({ left: 12,right: 12 }) - .margin({ top: 1 }) - }, item => item.toString()) - } - .borderRadius(24) - .backgroundColor($r('app.color.default_background_color')) - .padding({ left: 12, right: 12, top: 3, bottom: 4 }) - } - .padding({ left: 24, right: 24 }) - .width('100%') - .height('100%') - .backgroundColor($r('app.color.background_color')) - } - .backgroundColor($r('app.color.background_color')) - } -} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/other-permissions.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/other-permissions.ets deleted file mode 100644 index be5c75a60d8dd3d92727ae0a9a6b3da078a1a392..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/other-permissions.ets +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { backBar } from "../common/components/backBar.ets" -import { otherPermissionsListItem } from "../common/model/otherPermissionsList.ets" -import router from '@system.router' -@Entry -@Component -struct permissionsPage { - build() { - GridContainer({ gutter: 0 }) { - Row() { - Row() - .useSizeType({ - xs: { span: 1, offset: 0 }, sm: { span: 1, offset: 0 }, - md: { span: 1, offset: 0 }, lg: { span: 2, offset: 0 } - }) - .height("100%") - Row() { - Column() { - Row() { - backBar({title: JSON.stringify($r("app.string.other_permissions"))}) - } - Row() { - Column() { - Scroll() { - otherPermissionsItem({ - otherPermissionsListItem: otherPermissionsListItem - }) - } - }.width("100%") - } - .layoutWeight(1) - } - } - .useSizeType({ - xs: { span: 1, offset: 1 }, sm: { span: 2, offset: 1 }, - md: { span: 6, offset: 1 }, lg: { span: 8, offset: 2 } - }) - .height("100%") - Row() - .useSizeType({ - xs: { span: 1, offset: 2 }, sm: { span: 1, offset: 3 }, - md: { span: 1, offset: 7 }, lg: { span: 2, offset: 10 } - }) - .height("100%") - } - .height('100%') - } - } -} - -@Component -struct otherPermissionsItem { - private otherPermissionsListItem: any[] - build() { - Row() { - Column() { - List() { - ForEach(this.otherPermissionsListItem, (item) => { - ListItem() { - Column() { - Row() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Row() { - Text(item.name) - .fontSize(16) - .fontColor($r('app.color.text_color')) - .flexGrow(1) - Image(item.icon) - .objectFit(ImageFit.Contain) - .height(24) - .width(12) - }.backgroundColor($r('app.color.default_background_color')) - .width('100%') - .height('48') - } - } - if (item.index !== this.otherPermissionsListItem.length) { - Row() { - Column() - .backgroundColor($r('app.color.text_decoration_color')) - .width('100%') - .height('2vp') - } - } - } - .onClick(() => { - }) - } - .padding({ left: 12,right: 12 }) - .margin({ top: 1 }) - }, item => item.toString()) - } - .margin({top:8}) - .borderRadius(24) - .backgroundColor($r('app.color.default_background_color')) - .padding({ left: 12, right: 12, top: 3, bottom: 4 }) - } - .padding({ left: 37, right: 37 }) - .width('100%') - .height('100%') - .backgroundColor($r('app.color.background_color')) - } - } -} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/permission-access-record.ets b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/permission-access-record.ets deleted file mode 100644 index 7467ff5d188d0f554292b705cc1790b436225389..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/pages/permission-access-record.ets +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { permissionAccessRecordListItem } from "../common/model/permissionAccessRecordList.ets" -import { backBar } from "../common/components/backBar.ets" -import router from '@system.router' - -@Extend(Text) function customizeText(fontSize: string) { - .fontSize(fontSize) - .fontColor($r('app.color.text_color')) -} -@Extend(Image) function customizeImage(width: number, height: number) { - .objectFit(ImageFit.Contain) - .width(width) - .height(height) -} - -@Entry -@Component -struct permissionAccessRecordPage { - build() { - GridContainer({ gutter: 0 }) { - Row() { - Row() - .useSizeType({ - xs: { span: 1, offset: 0 }, sm: { span: 1, offset: 0 }, - md: { span: 1, offset: 0 }, lg: { span: 2, offset: 0 } - }) - .height("100%") - Row() { - Column() { - Row() { - backBar({ title: JSON.stringify($r('app.string.permission_access_record'))}) - } - Row() { - Column() { - Column() { - Flex({ justifyContent: FlexAlign.Start }) { - Text($r('app.string.authority_message')) - .fontSize("16vp") - .margin({ - left: '15vp' - }) - } - .backgroundColor($r('app.color.background_color')) - Scroll() { - permissionAccessRecordItem({ - permissionAccessRecordListItem: permissionAccessRecordListItem, - }) - } - } - }.width("100%") - } - .layoutWeight(1) - } - } - .useSizeType({ - xs: { span: 1, offset: 1 }, sm: { span: 2, offset: 1 }, - md: { span: 6, offset: 1 }, lg: { span: 8, offset: 2 } - }) - .height("100%") - Row() - .useSizeType({ - xs: { span: 1, offset: 2 }, sm: { span: 1, offset: 3 }, - md: { span: 1, offset: 7 }, lg: { span: 2, offset: 10 } - }) - .height("100%") - } - .height('100%') - } - } -} - -@Component -struct permissionAccessRecordItem { - private permissionAccessRecordListItem: any[] - @State collapseList: boolean[] = new Array(permissionAccessRecordListItem.length).fill(false) - @State iconList: any[] = new Array(permissionAccessRecordListItem.length).fill($r('app.media.downarrow')) - build() { - Row() { - Column() { - List() { - ForEach(this.permissionAccessRecordListItem, (item) => { - ListItem() { - Column() { - Row() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Image(item.image1) - .customizeImage(40, 40) - .margin({ - left: "10vp", - right: "5vp" - }) - Column() { - Row() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Text(item.name1) - .customizeText('16vp') - } - .flexGrow(1) - Image(this.iconList[item.index - 1]) - .customizeImage(20, 20) - .margin({ - top: '20vp', - right: '40vp' - }) - } - Row() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Image(item.image2) - .customizeImage(20, 20) - .margin({ - top: '-8vp' - }) - } - } - } - } - .margin({ - top: '10vp', - bottom: '10vp' - }) - }.onClick(() => { - if (this.collapseList[item.index - 1]) { - this.collapseList[item.index - 1] = false - this.iconList[item.index - 1] = $r('app.media.downarrow') - } else { - this.collapseList[item.index - 1]= true - this.iconList[item.index - 1] = $r('app.media.uparrow') - } - }) - if (this.collapseList[item.index - 1]) { - Row() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Image(item.image2) - .customizeImage(30, 30) - .margin({ - left: "15vp", - right: "5vp" - }) - Column() { - Row() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Text(item.name2) - .customizeText('16vp') - .margin({ - top: '2vp' - }) - } - } - Row() { - Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Text("访问次数:" + item.visits + "; " + "最近访问:" + item.lastVisitTime) - .customizeText('16vp') - .margin({ - top: '2vp' - }) - } - } - } - } - }.margin({ - bottom: '20vp' - }) - } - }.backgroundColor($r('app.color.default_background_color')) - .borderRadius('25px') - .width('100%') - .margin({ - left: '10vp', - top: '10vp' - }).onClick(() => { - if (item.name === '权限管理') { - router.push({ uri: 'pages/authority_management' }) - } - }) - } - }, item => item.index.toString()) - } - } - .width('100%') - .height('100%') - .backgroundColor($r('app.color.background_color')) - } - } -} diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/ar/properties/string.json b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/ar/properties/string.json deleted file mode 100644 index c3a6df19ca632072f943b0fba85ac22aec902416..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/ar/properties/string.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "strings": { - "app_name": "CategoryPage", - "describe": "describe", - "category": "Category", - "itemChild": "ItemChild", - "item": "Item", - "search": "search...", - "you_search": "You search ", - "you_clicked": "You clicked ", - "tab": "Tab", - "more": "< more" - } -} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/dark/properties/string.json b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/dark/properties/string.json deleted file mode 100644 index ddc52a17f97a258671b91d1f14330a673df33285..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/dark/properties/string.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "colors": { - "colorSubBackground": "#000000", - "appbar_subtitle_color": "#99ffffff", - "text_color": "#ffffff" - } -} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/default/media/icon_actived.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/default/media/icon_actived.png deleted file mode 100644 index 49991d108d51f1803ff3dcadc8870d69977908e7..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/default/media/icon_actived.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/default/media/icon_normal.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/default/media/icon_normal.png deleted file mode 100644 index cdf5bb49392dfce97ea9fa1be0ace95715903498..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/default/media/icon_normal.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/default/properties/string.json b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/default/properties/string.json deleted file mode 100644 index 127f01aeb3e034b0bc10cfdb98e59160afc9f5de..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/default/properties/string.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "strings": { - "app_name": "CategoryPage", - "describe": "describe", - "category": "Category", - "itemChild": "ItemChild", - "item": "Item", - "search": "search...", - "you_search": "You search ", - "you_clicked": "You clicked ", - "tab": "Tab", - "more": "more >" - }, - "colors": { - "colorSubBackground": "#f1f3f5", - "appbar_subtitle_color": "#99000000", - "text_color": "#000000" - } -} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/en/properties/string.json b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/en/properties/string.json deleted file mode 100644 index 319b5d66eabfb2e956923d29ef1f267e48bafbc8..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/en/properties/string.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "strings": { - "app_name": "CategoryPage", - "describe": "describe", - "category": "Category", - "itemChild": "ItemChild", - "item": "Item", - "search": "search...", - "you_search": "You search ", - "you_clicked": "You clicked ", - "tab": "Tab", - "more": "more >" - } -} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/light/properties/string.json b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/light/properties/string.json deleted file mode 100644 index 4b9482c8f2954ce8b38cb37addef4d297b33a279..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/light/properties/string.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "colors": { - "colorSubBackground": "#f1f3f5", - "appbar_subtitle_color": "#99000000", - "text_color": "#000000" - } -} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/zh/properties/string.json b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/zh/properties/string.json deleted file mode 100644 index 4ca364c6261d5db6919dbaf791b5432bc0c7e0da..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/resources/zh/properties/string.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "strings": { - "app_name": "分类页", - "describe": "描述", - "category": "分类", - "itemChild": "子类", - "item": "类型", - "search": "搜索...", - "you_search": "你搜索了", - "you_clicked": "你点击了", - "tab": "分页", - "more": "更多 >" - } -} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/51cto.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/51cto.png deleted file mode 100644 index 091f4ce356fff5def14609457dc08b60f871acfd..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/51cto.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/aiqiyi.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/aiqiyi.png deleted file mode 100644 index 63f768db04b296dc1410b83c9bae3b17190f66b3..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/aiqiyi.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/anquan.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/anquan.png deleted file mode 100644 index b066018b5f8e283c684ca910f3ff36f8f8b05435..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/anquan.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/baiduwangpan.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/baiduwangpan.png deleted file mode 100644 index c7deac2c5ab48a13f5ec76db191d92e2f1aabd76..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/baiduwangpan.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/beifen.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/beifen.png deleted file mode 100644 index 134821a2410b9edb95d8773ee39ffea7b9100200..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/beifen.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/beiwanglu.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/beiwanglu.png deleted file mode 100644 index cbaae9431e381bf0be4750d0cbc2c8da264ea860..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/beiwanglu.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/bilibili.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/bilibili.png deleted file mode 100644 index 3c452548277ce8f73020cc50933fabb00056af07..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/bilibili.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/calendar.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/calendar.png deleted file mode 100644 index a9091cb1264a7219bb75e6234a0d4775bce11c54..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/calendar.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/cunchu.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/cunchu.png deleted file mode 100644 index a5e4b2f2dc5cc83ed34295773e6f8767048015e3..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/cunchu.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/dianchi.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/dianchi.png deleted file mode 100644 index cdcc8838746f71e1d0292869f014e03a1799820f..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/dianchi.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/downarrow.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/downarrow.png deleted file mode 100644 index 9ce2fb46e6ac7ac7431688041b964c37a49b051e..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/downarrow.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/gaodeditu.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/gaodeditu.png deleted file mode 100644 index 920931e140e722a5c69d6b745d5757dc355587f6..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/gaodeditu.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/jiankang.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/jiankang.png deleted file mode 100644 index 1f5004bdc946a5778b0b32bd41a51d5d3d98ffc2..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/jiankang.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/left.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/left.png deleted file mode 100644 index 3d2329c71504881e33df1d7a687002934cd01daa..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/left.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/maikefeng.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/maikefeng.png deleted file mode 100644 index a96d97d16b6dcdf41d8a412c9f4dc167d70acbc8..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/maikefeng.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/phone.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/phone.png deleted file mode 100644 index 6b55011ef5c00deeabbae47be3645185d08de008..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/phone.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/photo.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/photo.png deleted file mode 100644 index d74af434b8ab3b085003e4e8e0c8a6bc4503b78e..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/photo.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/qq.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/qq.png deleted file mode 100644 index ad0b28104f4f0233ce203879fa494ac7303177dc..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/qq.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/record.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/record.png deleted file mode 100644 index 47a8a52eeb77d2164fb63763c9a4145dfda384f6..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/record.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/rightarrow.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/rightarrow.png deleted file mode 100644 index 51aad9fae9c47616835ecc4841028e1c887565e8..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/rightarrow.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/search.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/search.png deleted file mode 100644 index 7f3716e47cc7db40b2b8a2b020ea0ec83fdf15a9..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/search.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/shengyin.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/shengyin.png deleted file mode 100644 index 3a388e5176556ebdb4218448e9690cf63cd76d22..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/shengyin.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/shezhi.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/shezhi.png deleted file mode 100644 index 18555bc6bbfd83caf4c7bf15b85766ab5243e152..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/shezhi.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/shibie.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/shibie.png deleted file mode 100644 index a5048f260a6433c47f69ad65de1f67021b01b061..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/shibie.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/tengxunshipin.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/tengxunshipin.png deleted file mode 100644 index 6aff0dea0b65ecbd59083b408a5a49740e0ff3ba..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/tengxunshipin.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/tongxunlu.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/tongxunlu.png deleted file mode 100644 index 772dab0fe8ff88f6a16fb0223358382bfba8390f..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/tongxunlu.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/tongzhi.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/tongzhi.png deleted file mode 100644 index 921bd1440ad5933af6385fb0af9c9a7bcbee5a21..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/tongzhi.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/uparrow.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/uparrow.png deleted file mode 100644 index dc004b22db3bf7eb1e9dc4ba9f0a15445fba0e2d..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/uparrow.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/weixin.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/weixin.png deleted file mode 100644 index 8fd7c418c1b3b07cb21376cb72b07bfabb421f10..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/weixin.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/yingyong.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/yingyong.png deleted file mode 100644 index becf91e80790597b9db1b05a022c55f926ce86bd..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/yingyong.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/yinsi.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/yinsi.png deleted file mode 100644 index b4b449fc49f6c89ab71a03fe29c7835c83b0e3da..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/yinsi.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/yuncunchu.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/yuncunchu.png deleted file mode 100644 index f2aa3269600eb74b1a67c576e7e3d2a725c623d6..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/yuncunchu.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/zhifubao.png b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/zhifubao.png deleted file mode 100644 index 4aa6a5d2bc9e9bb9a957bc20d3921610672535d1..0000000000000000000000000000000000000000 Binary files a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/zhifubao.png and /dev/null differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/settings.gradle b/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/settings.gradle deleted file mode 100644 index 4773db73233a570c2d0c01a22e75321acfbf7a07..0000000000000000000000000000000000000000 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':entry' diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/.gitignore b/frameworks/com.ohos.permissionmanager/entry/.gitignore similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/.gitignore rename to frameworks/com.ohos.permissionmanager/entry/.gitignore diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/build.gradle b/frameworks/com.ohos.permissionmanager/entry/build.gradle similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/build.gradle rename to frameworks/com.ohos.permissionmanager/entry/build.gradle diff --git a/frameworks/com.ohos.permissionmanager/entry/proguard-rules.pro b/frameworks/com.ohos.permissionmanager/entry/proguard-rules.pro new file mode 100644 index 0000000000000000000000000000000000000000..f7666e47561d514b2a76d5a7dfbb43ede86da92a --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/entry/proguard-rules.pro @@ -0,0 +1 @@ +# config module specific ProGuard rules here. \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/config.json b/frameworks/com.ohos.permissionmanager/entry/src/main/config.json similarity index 48% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/config.json rename to frameworks/com.ohos.permissionmanager/entry/src/main/config.json index 8b2995420f8c56723c50882c254c13b743349d32..165e0d3bd16be20696ddac1f4660634cb7ffb98f 100644 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/config.json +++ b/frameworks/com.ohos.permissionmanager/entry/src/main/config.json @@ -1,7 +1,7 @@ { "app": { - "bundleName": "com.example.myapplication", - "vendor": "example", + "bundleName": "com.ohos.permissionmanager", + "vendor": "ohos", "version": { "code": 1000000, "name": "1.0.0" @@ -9,11 +9,12 @@ }, "deviceConfig": {}, "module": { - "package": "com.example.myapplication", + "package": "com.ohos.permissionmanager", "name": ".MyApplication", - "mainAbility": "com.example.myapplication.MainAbility", + "mainAbility": "com.ohos.permissionmanager.MainAbility", "deviceType": [ - "phone" + "phone", + "tablet" ], "distro": { "deliveryWithInstall": true, @@ -33,29 +34,8 @@ ] } ], - "orientation": "portrait", "visible": true, - "name": "com.example.myapplication.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "portrait", - "visible": true, - "name": "com.example.myapplication.GrantAbility", + "name": "com.ohos.permissionmanager.MainAbility", "icon": "$media:icon", "description": "$string:mainability_description", "label": "$string:entry_MainAbility", @@ -70,16 +50,7 @@ "type": "pageAbility" }, "pages": [ - "pages/authority-management", - "pages/permission-access-record", - "pages/media-documents", - "pages/app-name", - "pages/location-info", - "pages/app-name-plus", - "pages/other-permissions", - "pages/calendar", - "pages/dialog", - "pages/dialogPlus" + "pages/index" ], "name": "default", "window": { diff --git a/frameworks/com.ohos.permissionmanager/entry/src/main/ets/default/app.ets b/frameworks/com.ohos.permissionmanager/entry/src/main/ets/default/app.ets new file mode 100644 index 0000000000000000000000000000000000000000..0be61a623b0216ebbfacf77d8871f2fcaf1de68e --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/entry/src/main/ets/default/app.ets @@ -0,0 +1,8 @@ +export default { + onCreate() { + console.info('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} diff --git a/frameworks/com.ohos.permissionmanager/entry/src/main/ets/default/pages/index.ets b/frameworks/com.ohos.permissionmanager/entry/src/main/ets/default/pages/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..59a509b6916de6425f7f7b0eadfe643da6908a4b --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/entry/src/main/ets/default/pages/index.ets @@ -0,0 +1,13 @@ +@Entry +@Component +struct Index { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/entry/src/main/java/com/ohos/permissionmanager/MainAbility.java b/frameworks/com.ohos.permissionmanager/entry/src/main/java/com/ohos/permissionmanager/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..5e73933e0b4c0b4d24db9021f2d89c66d6bbe8d9 --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/entry/src/main/java/com/ohos/permissionmanager/MainAbility.java @@ -0,0 +1,16 @@ +package com.ohos.permissionmanager; + +import ohos.ace.ability.AceAbility; +import ohos.aafwk.content.Intent; + +public class MainAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + } + + @Override + public void onStop() { + super.onStop(); + } +} diff --git a/frameworks/com.ohos.permissionmanager/entry/src/main/java/com/ohos/permissionmanager/MyApplication.java b/frameworks/com.ohos.permissionmanager/entry/src/main/java/com/ohos/permissionmanager/MyApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..8c75d4e56c1ee06e2ee83469c50be84ef00af14e --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/entry/src/main/java/com/ohos/permissionmanager/MyApplication.java @@ -0,0 +1,10 @@ +package com.ohos.permissionmanager; + +import ohos.aafwk.ability.AbilityPackage; + +public class MyApplication extends AbilityPackage { + @Override + public void onInitialize() { + super.onInitialize(); + } +} diff --git a/frameworks/com.ohos.permissionmanager/entry/src/main/resources/base/element/string.json b/frameworks/com.ohos.permissionmanager/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..bc3df790ef54add880b08cf9dbd43bc45a9137d4 --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "mainability_description", + "value": "eTS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/icon.png b/frameworks/com.ohos.permissionmanager/entry/src/main/resources/base/media/icon.png similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/icon.png rename to frameworks/com.ohos.permissionmanager/entry/src/main/resources/base/media/icon.png diff --git a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/app.ets b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/app.ets new file mode 100644 index 0000000000000000000000000000000000000000..8658c07ca25e8955158335fe74f49a74a52b72fd --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/app.ets @@ -0,0 +1,11 @@ +export default { + onCreate() { + console.info('Application onCreate') + }, + onShow() { + console.info('Application onShow') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} diff --git a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/i18n/en-US.json b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..55561b83737c3c31d082fbfa11e5fc987a351104 --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/i18n/en-US.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + }, + "Files": { + } +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/i18n/zh-CN.json b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..cce1af06761a42add0cac1a0567aa3237eda8cb4 --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/i18n/zh-CN.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + }, + "Files": { + } +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/pages/index/index.ets b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/pages/index/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..2bfa0eff1e790f2545358c9bc1c479f750b9fd7d --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/default/pages/index/index.ets @@ -0,0 +1,49 @@ +import {Core, ExpectExtend, InstrumentLog} from "deccjsunit/index" +import testsuite from "../../../test/List.test.ets" +import featureAbility from "@ohos.ability.featureAbility" + +@Entry +@Component +struct MyComponent { + aboutToAppear() { + console.info("start run testcase!!!!") + featureAbility.getWant() + .then((Want) => { + const core = Core.getInstance() + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }) + const instrumentLog = new InstrumentLog({ + 'id': 'report', 'unity': 'true' + }) + core.addService('expect', expectExtend) + core.addService('report', instrumentLog) + core.init() + core.subscribeEvent('spec', instrumentLog) + core.subscribeEvent('suite', instrumentLog) + core.subscribeEvent('task', instrumentLog) + const configService = core.getDefaultService('config') + configService.setConfig(Want.parameters) + testsuite() + core.execute() + console.info('Operation successful. Data: ' + JSON.stringify(Want)); + }) + .catch((error) => { + console.error('Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('Hello World') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/test/ExampleJsunit.test.ets b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/test/ExampleJsunit.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..018aba5e774064d954d53b8fbb3e1ed34f52590d --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/test/ExampleJsunit.test.ets @@ -0,0 +1,12 @@ +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import app from '@system.app' + +export default function exampleJsunit() { + describe('appInfoTest', function () { + it('app_info_test_001', 0, function () { + var info = app.getInfo() + expect("1.0").assertEqual('1.0') + expect(info.versionCode).assertEqual('3') + }) + }) +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/test/List.test.ets b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..c96221152225c7d3d4bc64859deed72bbee774c0 --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/ets/test/List.test.ets @@ -0,0 +1,5 @@ +import exampleJsunit from "../test/ExampleJsunit.test.ets" + +export default function testsuite() { + exampleJsunit() +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/java/com/ohos/permissionmanager/ExampleOhosTest.java b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/java/com/ohos/permissionmanager/ExampleOhosTest.java new file mode 100644 index 0000000000000000000000000000000000000000..9482d133c3b1866f581978213dce868e966f5e9d --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/java/com/ohos/permissionmanager/ExampleOhosTest.java @@ -0,0 +1,14 @@ +package com.ohos.permissionmanager; + +import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class ExampleOhosTest { + @Test + public void testBundleName() { + final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName(); + assertEquals("com.ohos.permissionmanager", actualBundleName); + } +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/resources/base/element/string.json b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..998415d3588045c96c5d9db329c45087769c1d92 --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "finalApplication" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} diff --git a/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/resources/base/media/icon.png b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/frameworks/com.ohos.permissionmanager/entry/src/ohosTest/resources/base/media/icon.png differ diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/gradle.properties b/frameworks/com.ohos.permissionmanager/gradle.properties similarity index 91% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/gradle.properties rename to frameworks/com.ohos.permissionmanager/gradle.properties index 1b57260a6277efaa592ab3c7f9f49601d3478a82..be492496f9a20ac2d980ef4fc30061f4184c1c40 100644 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/gradle.properties +++ b/frameworks/com.ohos.permissionmanager/gradle.properties @@ -10,5 +10,4 @@ # This function is enabled by default when the DevEco Studio builds the hap/app,if you need disable gradle parallel,you should set org.gradle.parallel false. # more information see https://docs.gradle.org/current/userguide/performance.html # org.gradle.parallel=false -# org.gradle.jvmargs=-Dfile.encoding=GBK -android.overridePathCheck=true \ No newline at end of file +# org.gradle.jvmargs=-Dfile.encoding=GBK \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/gradle/wrapper/gradle-wrapper.jar b/frameworks/com.ohos.permissionmanager/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..490fda8577df6c95960ba7077c43220e5bb2c0d9 Binary files /dev/null and b/frameworks/com.ohos.permissionmanager/gradle/wrapper/gradle-wrapper.jar differ diff --git a/frameworks/com.ohos.permissionmanager/gradle/wrapper/gradle-wrapper.properties b/frameworks/com.ohos.permissionmanager/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000000000000000000000000000000000..63c817f17998697c0097fa6399106b99591c77b9 --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://repo.huaweicloud.com/gradle/gradle-7.3-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/gradlew b/frameworks/com.ohos.permissionmanager/gradlew similarity index 38% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/gradlew rename to frameworks/com.ohos.permissionmanager/gradlew index 7d39bb885b8d60f4d29879de526ecf01af81dcfe..536f0272dd995f3afdb5e34e0f42bdf3d1986c22 100644 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/gradlew +++ b/frameworks/com.ohos.permissionmanager/gradlew @@ -1,13 +1,13 @@ #!/usr/bin/env sh # -# Copyright (c) 2021 Huawei Device Co., Ltd. +# Copyright 2015 the original author or authors. # # 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 +# https://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, @@ -26,22 +26,22 @@ # Resolve links: $0 may be a link PRG="$0" # Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +while [ -h "$PRG" ]; do + ls=$(ls -ld "$PRG") + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '/.*' >/dev/null; then + PRG="$link" + else + PRG=$(dirname "$PRG")"/$link" + fi done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" +SAVED="$(pwd)" +cd "$(dirname \"$PRG\")/" >/dev/null +APP_HOME="$(pwd -P)" cd "$SAVED" >/dev/null APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=$(basename "$0") # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' @@ -49,15 +49,15 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" -warn () { - echo "$*" +warn() { + echo "$*" } -die () { - echo - echo "$*" - echo - exit 1 +die() { + echo + echo "$*" + echo + exit 1 } # OS specific support (must be 'true' or 'false'). @@ -65,117 +65,117 @@ cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$(uname)" in +CYGWIN*) + cygwin=true + ;; +Darwin*) + darwin=true + ;; +MINGW*) + msys=true + ;; +NONSTOP*) + nonstop=true + ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME +if [ -n "$JAVA_HOME" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ]; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." - fi + fi else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ]; then + MAX_FD_LIMIT=$(ulimit -H -n) + if [ $? -eq 0 ]; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then + MAX_FD="$MAX_FD_LIMIT" fi + ulimit -n $MAX_FD + if [ $? -ne 0 ]; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi fi # For Darwin, add options to specify how the application appears in the dock if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" +if [ "$cygwin" = "true" -o "$msys" = "true" ]; then + APP_HOME=$(cygpath --path --mixed "$APP_HOME") + CLASSPATH=$(cygpath --path --mixed "$CLASSPATH") + JAVACMD=$(cygpath --unix "$JAVACMD") + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=$(find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null) + SEP="" + for dir in $ROOTDIRSRAW; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ]; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@"; do + CHECK=$(echo "$arg" | egrep -c "$OURCYGPATTERN" -) + CHECK2=$(echo "$arg" | egrep -c "^-") ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ]; then ### Added a condition + eval $(echo args$i)=$(cygpath --path --ignore --mixed "$arg") + else + eval $(echo args$i)="\"$arg\"" fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac + i=$(expr $i + 1) + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac fi # Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " +save() { + for i; do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/"; done + echo " " } -APP_ARGS=`save "$@"` +APP_ARGS=$(save "$@") # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/gradlew.bat b/frameworks/com.ohos.permissionmanager/gradlew.bat similarity index 96% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/gradlew.bat rename to frameworks/com.ohos.permissionmanager/gradlew.bat index acdc32e2dae3e8e42e391878d96766acce16af0a..62bd9b9ccefea2b65ae41e5d9a545e2021b90a1d 100644 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/gradlew.bat +++ b/frameworks/com.ohos.permissionmanager/gradlew.bat @@ -1,11 +1,11 @@ @rem -@rem Copyright (c) 2021 Huawei Device Co., Ltd. +@rem Copyright 2015 the original author or authors. @rem @rem Licensed under the Apache License, Version 2.0 (the "License"); @rem you may not use this file except in compliance with the License. @rem You may obtain a copy of the License at @rem -@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem https://www.apache.org/licenses/LICENSE-2.0 @rem @rem Unless required by applicable law or agreed to in writing, software @rem distributed under the License is distributed on an "AS IS" BASIS, diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/package.json b/frameworks/com.ohos.permissionmanager/package.json similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/package.json rename to frameworks/com.ohos.permissionmanager/package.json diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/.gitignore b/frameworks/com.ohos.permissionmanager/permissionmanager/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..7d5b7a94f4dcf381f03ff21f28f8a2494b58023f --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/.gitignore @@ -0,0 +1,2 @@ +/build +/node_modules diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/build.gradle b/frameworks/com.ohos.permissionmanager/permissionmanager/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..f6df7ecdb12da752cca18e02b7fa62b63bba70ed --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/build.gradle @@ -0,0 +1,28 @@ +apply plugin: 'com.huawei.ohos.hap' +apply plugin: 'com.huawei.ohos.decctest' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 7 + defaultConfig { + compatibleSdkVersion 7 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } + entryModules "entry" +} + +dependencies { + entryImplementation project(':entry') + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) + testImplementation 'junit:junit:4.13.1' + ohosTestImplementation 'com.huawei.ohos.testkit:runner:2.0.0.200' +} +decc { + supportType = ['html','xml'] +} diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/proguard-rules.pro b/frameworks/com.ohos.permissionmanager/permissionmanager/proguard-rules.pro new file mode 100644 index 0000000000000000000000000000000000000000..f7666e47561d514b2a76d5a7dfbb43ede86da92a --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/proguard-rules.pro @@ -0,0 +1 @@ +# config module specific ProGuard rules here. \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/config.json b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..5a463361f786ddc124c35c5ebc8fc21e834f919f --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/config.json @@ -0,0 +1,75 @@ +{ + "app": { + "bundleName": "com.ohos.permissionmanager", + "vendor": "ohos", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.ohos.permissionmanager", + "name": ".MyApplication", + "mainAbility": "com.ohos.permissionmanager.GrantAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "permissionmanager", + "moduleType": "feature", + "installationFree": false + }, + "abilities": [ + { + "visible": true, + "name": "com.ohos.permissionmanager.GrantAbility", + "icon": "$media:icon", + "description": "$string:grantability_description", + "label": "$string:permissionmanager_GrantAbility", + "type": "page", + "launchType": "standard", + "srcPath": "dynamic" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/dialogPlus" + ], + "name": "dynamic", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.GET_SENSITIVE_PERMISSIONS", + "reason": "get sensitive permissions" + }, + { + "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", + "reason": "grant sensitive permissions" + }, + { + "name": "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", + "reason": "revoke sensitive permissions" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason": "get bundle previleged info" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO", + "reason": "get bundle default info" + } + ] + } +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/app.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/app.ets new file mode 100644 index 0000000000000000000000000000000000000000..0be61a623b0216ebbfacf77d8871f2fcaf1de68e --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/default/app.ets @@ -0,0 +1,8 @@ +export default { + onCreate() { + console.info('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/app.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/app.ets new file mode 100644 index 0000000000000000000000000000000000000000..0be61a623b0216ebbfacf77d8871f2fcaf1de68e --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/app.ets @@ -0,0 +1,8 @@ +export default { + onCreate() { + console.info('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/components/dialog.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/components/dialog.ets similarity index 42% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/components/dialog.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/components/dialog.ets index 689f130db9178554e3fccc8902b89d88fba3e862..d8ece485681f452f834cb28c5a065b4966cef893 100644 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/components/dialog.ets +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/components/dialog.ets @@ -13,95 +13,40 @@ * limitations under the License. */ -import { dialogData } from "../model/dialogDataList.ets" -import { permissionGroups, groups } from "../model/permissionGroup.ets" +import { getPermissionGroup } from "../utils/utils.ets" +import { BundleFlag, userId } from "../model/bundle.ets" import bundle from '@ohos.bundle'; +import featureAbility from '@ohos.ability.featureAbility'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; @Extend(Button) function customizeButton() { .backgroundColor($r('app.color.default_background_color')) .fontColor($r('app.color.button_color')) } -@CustomDialog -export struct spaceDialog { - controller: CustomDialogController - cancel: () => void - confirm: () => void - - build() { - Column() { - Image($r('app.media.ic_ssensor')) - .width(24) - .height(24) - .margin({ - top: 24 - }) - Column() { - Row() { - Flex({ justifyContent: FlexAlign.Start }) { - Text('是否允许“XX”使用身体传感器?').fontSize(16) - .margin({ - top: 16, - left: 24 - }) - } - } - Row() { - Flex({ justifyContent: FlexAlign.Start }) { - Text('用于XXXX。').fontSize(14) - .fontColor($r('app.color.secondary_font_color')) - .margin({ - top: 2, - left: 24 - }) - } - } - } - Row() { - Flex({ justifyContent: FlexAlign.SpaceAround }) { - Button('禁止') - .fontSize(16) - .onClick(() => { - this.controller.close() - this.cancel() - }).customizeButton() - Text('|').fontSize(30).fontColor($r('app.color.divider_color')) - Button('允许') - .fontSize(16) - .onClick(() => { - this.controller.close() - this.confirm() - }).customizeButton() - }.margin({ - top: 8 - }) - } - } - .backgroundColor($r('app.color.default_background_color')) - .borderRadius(24) - .height(170) - .width(336) - } -} - @CustomDialog export struct privacyDialog { - @Prop count: number + @Link count: number + @Link result: Array controller: CustomDialogController - cancel: () => void - confirm: () => void - @State permissionList: Array = [] + cancel: (group, accessTokenId, permissionList, userFixedFlag) => void + confirm: (group, accessTokenId, permissionList, userFixedFlag) => void + @State accessTokenId: number = 0 + @State hasPrepared: boolean = false + @State reqPerms: Array = [] + @State grantGroups: Array = [] + @State userFixedFlag: number = 2 // means user fixed build() { Column() { - if (this.count < this.permissionList.length) { - Image(dialogData[this.count].icon) + if (this.hasPrepared && this.verify(this.reqPerms[this.count])) { + Image(this.grantGroups[this.count].icon) .width(24) .height(24) .margin({ top: 24 }) - Text(`${this.count + 1} / ${this.permissionList.length}`) + Text(`${this.count + 1} / ${this.reqPerms.length}`) .fontSize(14) .fontColor($r('app.color.secondary_font_color')) .margin({ @@ -110,7 +55,7 @@ export struct privacyDialog { Column() { Row() { Flex({ justifyContent: FlexAlign.Start }) { - Text("是否允许该应用访问" + this.current().groupName).fontSize(16) + Text("是否允许该应用访问" + this.grantGroups[this.count].groupName).fontSize(16) .margin({ top: 16, left: 24 @@ -119,7 +64,7 @@ export struct privacyDialog { } Row() { Flex({ justifyContent: FlexAlign.Start }) { - Text("用于" + this.current().description).fontSize(14) + Text("用于" + this.grantGroups[this.count].description).fontSize(14) .fontColor($r('app.color.secondary_font_color')) .margin({ top: 2, @@ -134,23 +79,19 @@ export struct privacyDialog { Button('禁止') .fontSize(16) .onClick(() => { - this.cancel() - setTimeout(() => { - if (this.count === this.permissionList.length) { - this.controller.close() - } - }, 1) + this.cancel(this.grantGroups[this.count], this.accessTokenId, this.reqPerms, this.userFixedFlag) + if (this.count === this.reqPerms.length) { + this.controller.close() + } }).customizeButton() Text('|').fontSize(30).fontColor($r('app.color.divider_color')) Button('允许') .fontSize(16) .onClick(() => { - this.confirm() - setTimeout(() => { - if (this.count === this.permissionList.length) { - this.controller.close() - } - }, 1) + this.confirm(this.grantGroups[this.count], this.accessTokenId, this.reqPerms, this.userFixedFlag) + if (this.count === this.reqPerms.length) { + this.controller.close() + } }).customizeButton() }.margin({ top: 8 @@ -162,16 +103,60 @@ export struct privacyDialog { .height(186) .width(336) } - current() { - var current = this.permissionList[this.count] - var permission = permissionGroups.filter(item => item.name == current) - var group = groups.filter(item => item.name == permission[0].group) - return group[0] + async verify(permission) { + if(this.count >= this.grantGroups.length) { + this.controller.close() + this.aboutToDisappear() + return false + } + if(this.grantGroups[this.count] == 0) { + this.result[this.count] = -1 + this.count ++ + return false + } + var acManager = abilityAccessCtrl.createAtManager() + var ret = await acManager.verifyAccessToken(this.accessTokenId, permission) + if(ret == 0) { + console.log("GrantAbility permission has already been granted:" + permission) + this.result[this.count] = 0 + this.count ++ + return false + } + this.result[this.count] = -1 + return true } aboutToAppear() { - bundle.getApplicationInfo('com.example.myapplication', 0x00000000, 0).then(res => { - this.permissionList = res.permissions + this.count = 0; + featureAbility.getWant((err, want) => { + this.reqPerms = want.parameters["ohos.user.grant.permission"] + console.log("GrantAbility request permission=" + JSON.stringify(this.reqPerms) + " bundleName=" + want.bundleName) + bundle.getApplicationInfo(want.bundleName, BundleFlag.GET_BUNDLE_DEFAULT, userId).then(res => { + this.accessTokenId = res.accessTokenId + }) + this.reqPerms.forEach(item => { + var group = getPermissionGroup(item) + if(!group) { + this.grantGroups.push(0) + console.log("GrantAbility permission not find:" + item) + }else { + this.grantGroups.push(group) + } + }) + this.hasPrepared = true; + }) + } + + aboutToDisappear() { + console.log("GrantAbility result=" + JSON.stringify(this.result)) + featureAbility.terminateSelfWithResult({ + resultCode: 1, + want: { + parameters: { + "ohos.user.grant.permission": this.reqPerms, + "ohos.user.grant.permission.result": this.result + } + } }) } } diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/app.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/model/bundle.ets similarity index 49% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/app.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/model/bundle.ets index 2a3b6238737330f469fc124b0669aacd9a376056..4530bc6fcfec5b16b97fc785a8743ba7b51339ad 100644 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/app.ets +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/model/bundle.ets @@ -13,11 +13,26 @@ * limitations under the License. */ -export default { - onCreate() { - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, +export const BundleFlag = { + GET_BUNDLE_DEFAULT : 0x00000000, + GET_BUNDLE_WITH_ABILITIES : 0x00000001, + GET_ABILITY_INFO_WITH_PERMISSION : 0x00000002, + GET_ABILITY_INFO_WITH_APPLICATION : 0x00000004, + GET_APPLICATION_INFO_WITH_PERMISSION : 0x00000008, + GET_BUNDLE_WITH_REQUESTED_PERMISSION : 0x00000010, + GET_ALL_APPLICATION_INFO : 0xFFFF0000, + /** + * @since 8 + */ + GET_ABILITY_INFO_WITH_METADATA : 0x00000020, + /** + * @since 8 + */ + GET_APPLICATION_INFO_WITH_METADATA : 0x00000040, + /** + * @since 8 + */ + GET_ABILITY_INFO_SYSTEMAPP_ONLY : 0x00000080 } +export const userId: number = 0 + diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/model/permissionGroup.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/model/permissionGroup.ets new file mode 100644 index 0000000000000000000000000000000000000000..3e25678d68bf407af1e515001697c37f135a8317 --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/model/permissionGroup.ets @@ -0,0 +1,335 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const permissionGroups: any[] = [ + { + "permissionName": "ohos.permission.LOCATION_IN_BACKGROUND", + "groupName": "LOCATION", + "label": "定位权限", + "description": "允许应用在后台运行时获取位置信息。", + "groupId": 0 + }, + { + "permissionName": "ohos.permission.LOCATION", + "groupName": "LOCATION", + "label": "定位权限", + "description": "允许应用在前台运行时获取位置信息。", + "groupId": 0 + }, + { + "permissionName": "ohos.permission.CAMERA", + "groupName": "CAMERA", + "label": "拍摄照片和录制视频", + "description": "允许应用拍摄照片和视频。", + "groupId": 1 + }, + { + "permissionName": "ohos.permission.MICROPHONE", + "groupName": "MICROPHONE", + "label": "录制音频", + "description": "允许应用打开或关闭录音通路。", + "groupId": 2 + }, + { + "permissionName": "ohos.permission.ANSWER_CALL", + "groupName": "PHONE", + "label": "接听电话", + "description": "允许应用接听电话。", + "groupId": 3 + }, + { + "permissionName": "ohos.permission.MANAGE_VOICEMAIL", + "groupName": "PHONE", + "label": "语音信箱", + "description": "允许应用管理语音信箱。", + "groupId": 3 + }, + { + "permissionName": "ohos.permission.READ_CELL_MESSAGES", + "groupName": "SMS", + "label": "读取小区广播", + "description": "允许应用读取设备接收的小区广播信息。", + "groupId": 4 + }, + { + "permissionName": "ohos.permission.READ_MESSAGES", + "groupName": "SMS", + "label": "读取短彩信", + "description": "允许应用读取设备接收的短彩信信息。", + "groupId": 4 + }, + { + "permissionName": "ohos.permission.RECEIVE_MMS", + "groupName": "SMS", + "label": "接收彩信", + "description": "允许应用接收彩信。", + "groupId": 4 + }, + { + "permissionName": "ohos.permission.RECEIVE_SMS", + "groupName": "SMS", + "label": "接收短信", + "description": "允许应用接收短信。", + "groupId": 4 + }, + { + "permissionName": "ohos.permission.RECEIVE_WAP_MESSAGES", + "groupName": "SMS", + "label": "接收WAP消息", + "description": "允许应用接收和处理WAP消息。", + "groupId": 4 + }, + { + "permissionName": "ohos.permission.SEND_MESSAGES", + "groupName": "SMS", + "label": "发送短彩信", + "description": "允许应用发送短彩信", + "groupId": 4 + }, + { + "permissionName": "ohos.permission.READ_CONTACTS", + "groupName": "CONTACTS", + "label": "读取通讯录", + "description": "允许应用读取设备上存储的联系人信息。", + "groupId": 5 + }, + { + "permissionName": "ohos.permission.WRITE_CONTACTS", + "groupName": "CONTACTS", + "label": "新建/修改/删除通讯录", + "description": "允许应用新建/修改/删除设备上存储的联系人信息。", + "groupId": 5 + }, + { + "permissionName": "ohos.permission.READ_CALL_LOG", + "groupName": "CALL_LOG", + "label": "读取通话记录", + "description": "允许应用读取设备上的通话记录信息。", + "groupId": 6 + }, + { + "permissionName": "ohos.permission.WRITE_CALL_LOG", + "groupName": "CALL_LOG", + "label": "新建/修改/删除通话记录", + "description": "允许新建/修改/删除设备上的通话记录信息。", + "groupId": 6 + }, + { + "permissionName": "ohos.permission.MEDIA_LOCATION", + "groupName": "MEDIA", + "label": "允许应用访问拍摄位置", + "description": "应用访问用户媒体文件中的拍摄位置信息如经纬度信息。", + "groupId": 7 + }, + { + "permissionName": "ohos.permission.READ_MEDIA", + "groupName": "MEDIA", + "label": "允许应用读取媒体文件", + "description": "允许应用访问户媒体文件,如视频、音频、图片等。", + "groupId": 7 + }, + { + "permissionName": "ohos.permission.WRITE_MEDIA", + "groupName": "MEDIA", + "label": "允许应用读写媒体文件", + "description": "允许应用读写户媒体文件,如视频、音频、图片等。", + "groupId": 7 + }, + { + "permissionName": "ohos.permission.READ_CALENDAR", + "groupName": "CALENDAR", + "label": "读取日历", + "description": "允许应用读取日历。", + "groupId": 8 + }, + { + "permissionName": "ohos.permission.WRITE_CALENDAR", + "groupName": "CALENDAR", + "label": "修建/修改/删除日历", + "description": "允许应用修建/修改/删除日历。", + "groupId": 8 + }, + { + "permissionName": "ohos.permission.ACTIVITY_MOTION", + "groupName": "SPORT", + "label": "读取用户的运动状态", + "description": "允许应用程序读取用户的运动状态。", + "groupId": 9 + }, + { + "permissionName": "ohos.permission.READ_HEALTH_DATA", + "groupName": "HEALTH", + "label": "读取用户的健康数据", + "description": "允许应用程序读取用户的健康数据。", + "groupId": 10 + }, + { + "permissionName": "ohos.permission.DISTRIBUTED_DATASYNC", + "groupName": "OTHER", + "label": "允许不同设备间数据交换", + "description": "允许应用与远程设备交换用户数据(如图片、音乐、视频、及应用数据等)。", + "groupId": 11 + } +] + +export const groups: any[] = [ + { + "name": "LOCATION", + "groupName": "位置信息", + "icon": $r('app.media.ic_public_gps'), + "description": "访问您的位置信息", + "permissions": [ + "ohos.permission.LOCATION_IN_BACKGROUND", + "ohos.permission.LOCATION" + ] + }, + { + "name": "CAMERA", + "groupName": "相机", + "icon": $r('app.media.ic_public_camera'), + "description": "访问您的相机", + "permissions": [ + "ohos.permission.CAMERA" + ] + }, + { + "name": "MICROPHONE", + "groupName": "麦克风", + "icon": $r('app.media.ic_public_voice'), + "description": "访问您的麦克风", + "permissions": [ + "ohos.permission.MICROPHONE" + ] + }, + { + "name": "PHONE", + "groupName": "电话", + "icon": $r('app.media.ic_public_phone'), + "description": "拨打电话和管理通话", + "permissions": [ + "ohos.permission.ANSWER_CALL", + "ohos.permission.MANAGE_VOICEMAIL" + ] + }, + { + "name": "SMS", + "groupName": "信息", + "icon": $r('app.media.ic_public_message'), + "description": "发送和查看短信", + "permissions": [ + "ohos.permission.READ_CELL_MESSAGES", + "ohos.permission.READ_MESSAGES", + "ohos.permission.RECEIVE_MMS", + "ohos.permission.RECEIVE_SMS", + "ohos.permission.RECEIVE_WAP_MESSAGES", + "ohos.permission.SEND_MESSAGES" + ] + }, + { + "name": "CONTACTS", + "groupName": "通讯录", + "icon": $r('app.media.ic_public_contacts_group'), + "description": "访问您的通讯录", + "permissions": [ + "ohos.permission.READ_CONTACTS", + "ohos.permission.WRITE_CONTACTS" + ] + }, + { + "name": "CALL_LOG", + "groupName": "通话记录", + "icon": $r('app.media.ic_call_logs'), + "description": "读取和写入手机通话记录", + "permissions": [ + "ohos.permission.READ_CALL_LOG", + "ohos.permission.WRITE_CALL_LOG" + ] + }, + { + "name": "MEDIA", + "groupName": "媒体和文件", + "icon": $r('app.media.ic_public_folder'), + "description": "访问您的媒体和文件", + "permissions": [ + "ohos.permission.MEDIA_LOCATION", + "ohos.permission.READ_MEDIA", + "ohos.permission.WRITE_MEDIA" + ] + }, + { + "name": "CALENDAR", + "groupName": "日历", + "icon": $r('app.media.ic_public_calendar'), + "description": "访问日历和活动", + "permissions": [ + "ohos.permission.READ_CALENDAR", + "ohos.permission.WRITE_CALENDAR" + ] + }, + { + "name": "SPORT", + "groupName": "健身运动", + "icon": $r('app.media.ic_sport'), + "description": "访问您的运动状态", + "permissions": [ + "ohos.permission.ACTIVITY_MOTION" + ] + }, + { + "name": "HEALTH", + "groupName": "身体传感器", + "icon": $r('app.media.ic_ssensor'), + "description": "访问您的健康数据", + "permissions": [ + "ohos.permission.READ_HEALTH_DATA" + ] + }, + { + "name": "OTHER", + "groupName": "其他权限", + "icon": $r('app.media.ic_more'), + "description": "访问您的位置信息", + "permissions": [ + "ohos.permission.DISTRIBUTED_DATASYNC" + ] + } +] + +export const userGrantPermissions: string[] = [ + "ohos.permission.LOCATION_IN_BACKGROUND", + "ohos.permission.LOCATION", + "ohos.permission.CAMERA", + "ohos.permission.MICROPHONE", + "ohos.permission.ANSWER_CALL", + "ohos.permission.MANAGE_VOICEMAIL", + "ohos.permission.READ_CELL_MESSAGES", + "ohos.permission.READ_MESSAGES", + "ohos.permission.RECEIVE_MMS", + "ohos.permission.RECEIVE_SMS", + "ohos.permission.RECEIVE_WAP_MESSAGES", + "ohos.permission.SEND_MESSAGES", + "ohos.permission.READ_CONTACTS", + "ohos.permission.WRITE_CONTACTS", + "ohos.permission.READ_CALL_LOG", + "ohos.permission.WRITE_CALL_LOG", + "ohos.permission.MEDIA_LOCATION", + "ohos.permission.READ_MEDIA", + "ohos.permission.WRITE_MEDIA", + "ohos.permission.READ_CALENDAR", + "ohos.permission.WRITE_CALENDAR", + "ohos.permission.ACTIVITY_MOTION", + "ohos.permission.READ_HEALTH_DATA", + "ohos.permission.DISTRIBUTED_DATASYNC" +] \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/utils/utils.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/utils/utils.ets similarity index 66% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/utils/utils.ets rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/utils/utils.ets index 2e73d04e2d256d634747c760dff96b97ec867529..7c28551a84183baa31366619d5d1092a396a72d1 100644 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/ets/default/common/utils/utils.ets +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/common/utils/utils.ets @@ -12,3 +12,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { permissionGroups, groups } from "../model/permissionGroup.ets" + +export function getPermissionGroup(permission: string) { + for (var i = 0; i < permissionGroups.length; i++) { + if (permissionGroups[i].permissionName == permission) { + return groups[permissionGroups[i].groupId] + } + } +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/pages/dialogPlus.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/pages/dialogPlus.ets new file mode 100644 index 0000000000000000000000000000000000000000..aa0784455f88201fb7365f93e7ad205b53657aaf --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/ets/dynamic/pages/dialogPlus.ets @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { privacyDialog } from "../common/components/dialog.ets" +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; + +@Entry +@Component +struct dialogPlusPage { + @State count: number = 0 + @State result: Array = [] + privacyDialogController: CustomDialogController = new CustomDialogController({ + builder: privacyDialog({ cancel: this.privacyCancel, confirm: this.privacyAccept, count:$count, result: $result }), + cancel: this.privacyExist, + autoCancel: true, + alignment: DialogAlignment.Center + }) + async privacyAccept(group, accessTokenId, permissionList, userFixedFlag) { + var acManager = abilityAccessCtrl.createAtManager() + group.permissions.forEach(async permission => { + const result = await acManager.grantUserGrantedPermission(accessTokenId, permission, userFixedFlag) + var index = permissionList.indexOf(permission) + if (index == -1) { + return; + } + if (result == 0) { + this.result[index] = 0 + console.log("GrantAbility grant permission:" + permission) + } else { + console.log("GrantAbility failed to grant permission:" + permission + " ret:" + result) + } + }) + this.count ++ + } + async privacyCancel(group, accessTokenId, permissionList, userFixedFlag) { + var acManager = abilityAccessCtrl.createAtManager() + group.permissions.forEach(async permission => { + const result = await acManager.revokeUserGrantedPermission(accessTokenId, permission, userFixedFlag) + var index = permissionList.indexOf(permission) + if (index != -1 && result == 0) { + this.result[index] = -1 + console.log("GrantAbility revoke permission:" + permission) + } + }) + this.count ++ + } + privacyExist() { + console.info("exist") + } + aboutToAppear() { + this.privacyDialogController.open() + } + build() { + } +} diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/java/com/ohos/permissionmanager/MainAbility.java b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/java/com/ohos/permissionmanager/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..7ef8838383eeac5dc9918221e9fa8bb06e6b5d0b --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/java/com/ohos/permissionmanager/MainAbility.java @@ -0,0 +1,17 @@ +package com.ohos.permissionmanager; + +import ohos.ace.ability.AceAbility; +import ohos.aafwk.content.Intent; + +public class MainAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + setInstanceName("main_ability"); + super.onStart(intent); + } + + @Override + public void onStop() { + super.onStop(); + } +} diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/java/com/ohos/permissionmanager/MyApplication.java b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/java/com/ohos/permissionmanager/MyApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..8c75d4e56c1ee06e2ee83469c50be84ef00af14e --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/java/com/ohos/permissionmanager/MyApplication.java @@ -0,0 +1,10 @@ +package com.ohos.permissionmanager; + +import ohos.aafwk.ability.AbilityPackage; + +public class MyApplication extends AbilityPackage { + @Override + public void onInitialize() { + super.onInitialize(); + } +} diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/element/color.json b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/element/color.json similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/element/color.json rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/element/color.json diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/element/string.json b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/element/string.json similarity index 68% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/element/string.json rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/element/string.json index bca2742b6b887c872f1f0412dd92a9fb79e059fd..854142d255e4c7e4f3adf55693abc13f92b74dc5 100644 --- a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/element/string.json +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/element/string.json @@ -1,5 +1,13 @@ { "string": [ + { + "name": "permissionmanager_MainAbility", + "value": "permissionmanager_MainAbility" + }, + { + "name": "mainability_description", + "value": "eTS_Empty Ability" + }, { "name": "entry_MainAbility", "value": "entry_MainAbility" @@ -8,6 +16,14 @@ "name": "mainability_description", "value": "ETS_Category Ability" }, + { + "name": "permissionmanager_GrantAbility", + "value": "permissionmanager_GrantAbility" + }, + { + "name": "permissionmanager_description", + "value": "eTS_Empty Ability" + }, { "name": "settings", "value": "设置" @@ -59,6 +75,14 @@ { "name": "location_info_message", "value": "系统定位服务开关开启时,已允许19个应用获取此设备的位置。" + }, + { + "name": "grantability_description", + "value": "eTS_Empty Ability" + }, + { + "name": "entry_GrantAbility", + "value": "entry_GrantAbility" } ] } \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_call_logs.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_call_logs.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_call_logs.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_call_logs.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_dropzone.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_dropzone.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_dropzone.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_dropzone.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_exercise.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_exercise.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_exercise.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_exercise.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_forward.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_forward.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_forward.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_forward.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_more.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_more.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_more.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_more.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_nearby.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_nearby.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_nearby.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_nearby.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_public_calendar.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_public_calendar.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_public_calendar.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_public_calendar.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_public_camera.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_public_camera.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_public_camera.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_public_camera.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_public_contacts_group.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_public_contacts_group.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_public_contacts_group.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_public_contacts_group.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_public_folder.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_public_folder.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_public_folder.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_public_folder.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_public_gps.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_public_gps.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_public_gps.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_public_gps.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_public_message.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_public_message.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_public_message.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_public_message.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_public_phone.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_public_phone.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_public_phone.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_public_phone.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_public_voice.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_public_voice.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_public_voice.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_public_voice.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_sport.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_sport.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_sport.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_sport.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_ssensor.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_ssensor.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/ic_ssensor.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/ic_ssensor.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/in_app_installations.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/in_app_installations.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/in_app_installations.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/in_app_installations.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/noinstallationpackage.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/noinstallationpackage.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/noinstallationpackage.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/noinstallationpackage.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/nopermission.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/nopermission.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/nopermission.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/nopermission.svg diff --git a/frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/searchnoresult.svg b/frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/searchnoresult.svg similarity index 100% rename from frameworks/com.ohos.permissionmanager/com.ohos.permissionmanager.MainAbility/entry/src/main/resources/base/media/searchnoresult.svg rename to frameworks/com.ohos.permissionmanager/permissionmanager/src/main/resources/base/media/searchnoresult.svg diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/app.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/app.ets new file mode 100644 index 0000000000000000000000000000000000000000..8658c07ca25e8955158335fe74f49a74a52b72fd --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/app.ets @@ -0,0 +1,11 @@ +export default { + onCreate() { + console.info('Application onCreate') + }, + onShow() { + console.info('Application onShow') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/i18n/en-US.json b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..55561b83737c3c31d082fbfa11e5fc987a351104 --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/i18n/en-US.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + }, + "Files": { + } +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/i18n/zh-CN.json b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..cce1af06761a42add0cac1a0567aa3237eda8cb4 --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/i18n/zh-CN.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + }, + "Files": { + } +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/pages/index/index.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/pages/index/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..2bfa0eff1e790f2545358c9bc1c479f750b9fd7d --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/default/pages/index/index.ets @@ -0,0 +1,49 @@ +import {Core, ExpectExtend, InstrumentLog} from "deccjsunit/index" +import testsuite from "../../../test/List.test.ets" +import featureAbility from "@ohos.ability.featureAbility" + +@Entry +@Component +struct MyComponent { + aboutToAppear() { + console.info("start run testcase!!!!") + featureAbility.getWant() + .then((Want) => { + const core = Core.getInstance() + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }) + const instrumentLog = new InstrumentLog({ + 'id': 'report', 'unity': 'true' + }) + core.addService('expect', expectExtend) + core.addService('report', instrumentLog) + core.init() + core.subscribeEvent('spec', instrumentLog) + core.subscribeEvent('suite', instrumentLog) + core.subscribeEvent('task', instrumentLog) + const configService = core.getDefaultService('config') + configService.setConfig(Want.parameters) + testsuite() + core.execute() + console.info('Operation successful. Data: ' + JSON.stringify(Want)); + }) + .catch((error) => { + console.error('Operation failed. Cause: ' + JSON.stringify(error)); + }) + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('Hello World') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/test/ExampleJsunit.test.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/test/ExampleJsunit.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..018aba5e774064d954d53b8fbb3e1ed34f52590d --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/test/ExampleJsunit.test.ets @@ -0,0 +1,12 @@ +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import app from '@system.app' + +export default function exampleJsunit() { + describe('appInfoTest', function () { + it('app_info_test_001', 0, function () { + var info = app.getInfo() + expect("1.0").assertEqual('1.0') + expect(info.versionCode).assertEqual('3') + }) + }) +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/test/List.test.ets b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..c96221152225c7d3d4bc64859deed72bbee774c0 --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/ets/test/List.test.ets @@ -0,0 +1,5 @@ +import exampleJsunit from "../test/ExampleJsunit.test.ets" + +export default function testsuite() { + exampleJsunit() +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/java/com/ohos/permissionmanager/ExampleOhosTest.java b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/java/com/ohos/permissionmanager/ExampleOhosTest.java new file mode 100644 index 0000000000000000000000000000000000000000..9482d133c3b1866f581978213dce868e966f5e9d --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/java/com/ohos/permissionmanager/ExampleOhosTest.java @@ -0,0 +1,14 @@ +package com.ohos.permissionmanager; + +import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class ExampleOhosTest { + @Test + public void testBundleName() { + final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName(); + assertEquals("com.ohos.permissionmanager", actualBundleName); + } +} \ No newline at end of file diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/resources/base/element/string.json b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..0ad161e668b74a19e5820d0d5f43d017b6d43173 --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "PermissionManager" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} diff --git a/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/resources/base/media/icon.png b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/frameworks/com.ohos.permissionmanager/permissionmanager/src/ohosTest/resources/base/media/icon.png differ diff --git a/frameworks/com.ohos.permissionmanager/settings.gradle b/frameworks/com.ohos.permissionmanager/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..4bc3f8f5570c80bbdafc2d541c60ae3cf2890248 --- /dev/null +++ b/frameworks/com.ohos.permissionmanager/settings.gradle @@ -0,0 +1 @@ +include ':entry', ':permissionmanager'