mirror of
https://gitee.com/openharmony/applications_permission_manager
synced 2024-11-23 03:09:41 +00:00
!200 挑单3.2Release:预防恶意应用名
Merge pull request !200 from fanchenxuan/OpenHarmony-3.2-Release
This commit is contained in:
commit
3eedb10af1
3
.gitignore
vendored
3
.gitignore
vendored
@ -2,4 +2,5 @@
|
||||
/local.properties
|
||||
/.idea
|
||||
**/build
|
||||
/.hvigor
|
||||
/.hvigor
|
||||
/oh_modules
|
@ -40,6 +40,7 @@ export struct backBar {
|
||||
})
|
||||
Text(JSON.parse(this.title))
|
||||
.align(Alignment.Start)
|
||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||
.fontColor($r('app.color.text_color'))
|
||||
.fontSize(Constants.BACKBAR_TEXT_FONT_SIZE)
|
||||
.flexGrow(Constants.BACKBAR_TEXT_FLEX_GROW)
|
||||
|
@ -312,6 +312,9 @@ export default class Constants {
|
||||
|
||||
static START_SUBSCRIPT = 0
|
||||
static END_SUBSCRIPT = 500
|
||||
static MAXIMUM_HEADER_WIDTH = 250
|
||||
static MAXIMUM_HEADER_HEIGHT = 500
|
||||
static MAXIMUM_HEADER_LENGTH = 1000
|
||||
|
||||
static RECORD_PADDING_BOTTOM = '20%'
|
||||
|
||||
|
@ -90,6 +90,21 @@ export function changeIndexValue(stateList, changeItem){
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Omit display when application name is too long
|
||||
* @param {String} Application name
|
||||
*/
|
||||
export function titleTrim(title) {
|
||||
const length = title.length;
|
||||
if (length > Constants.MAXIMUM_HEADER_LENGTH) {
|
||||
var str = '';
|
||||
str = title.substring(0, Constants.MAXIMUM_HEADER_LENGTH) + '...';
|
||||
return str;
|
||||
} else {
|
||||
return title;
|
||||
}
|
||||
}
|
||||
|
||||
// List of Chinese Pinyin Initials
|
||||
let strChineseFirstPY = "YDYQSXMWZSSXJBYMGCCZQPSSQBYCDSCDQLDYLYBSSJGYZZJJFKCCLZDHWDWZJLJPFYYNWJJTMYHZWZHFLZPPQHGSC" +
|
||||
"YYYNJQYXXGJHHSDSJNKKTMOMLCRXYPSNQSECCQZGGLLYJLMYZZSECYKYYHQWJSSGGYXYZYJWWKDJHYCHMYXJTLXJYQBYXZLDWRDJRWYSRLDZJPCBZ" +
|
||||
|
@ -279,6 +279,7 @@ struct mediaDocumentItem {
|
||||
Column() {
|
||||
Row() {
|
||||
Text(this.mediaListItem.labelId)
|
||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||
.fontColor($r('app.color.label_color'))
|
||||
.fontWeight(FontWeight.Bold)
|
||||
|
@ -588,6 +588,8 @@ struct applicationItem {
|
||||
.customizeImage(Constants.APPLICATION_IMAGE_WIDTH, Constants.APPLICATION_IMAGE_HEIGHT)
|
||||
.margin({ right: Constants.APPLICATION_IMAGE_MARGIN_RIGHT })
|
||||
Text(item.labelId)
|
||||
.width(Constants.MAXIMUM_HEADER_WIDTH)
|
||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.fontColor($r('app.color.label_color'))
|
||||
|
@ -184,6 +184,8 @@ struct applicationItem {
|
||||
.customizeImage(Constants.AUTHORITY_IMAGE_WIDTH, Constants.AUTHORITY_IMAGE_HEIGHT)
|
||||
.margin({ right: Constants.AUTHORITY_IMAGE_MARGIN_RIGHT })
|
||||
Text(item.labelId)
|
||||
.width(Constants.MAXIMUM_HEADER_WIDTH)
|
||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||
.fontColor($r('app.color.text_color'))
|
||||
.fontWeight(FontWeight.Medium)
|
||||
|
@ -132,6 +132,8 @@ struct applicationItem {
|
||||
.customizeImage(Constants.AUTHORITY_IMAGE_WIDTH, Constants.AUTHORITY_IMAGE_HEIGHT)
|
||||
.margin({ right: Constants.AUTHORITY_IMAGE_MARGIN_RIGHT })
|
||||
Text(item.labelId)
|
||||
.width(Constants.MAXIMUM_HEADER_WIDTH)
|
||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.fontColor($r('app.color.label_color'))
|
||||
|
@ -17,7 +17,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
|
||||
import bundle from '@ohos.bundle';
|
||||
import bundleManager from '@ohos.bundle.bundleManager';
|
||||
import rpc from '@ohos.rpc';
|
||||
import { Log, getPermissionGroup } from '../common/utils/utils'
|
||||
import { Log, getPermissionGroup, titleTrim } from '../common/utils/utils'
|
||||
import Constants from '../common/utils/constant'
|
||||
import { BundleFlag } from '../common/model/bundle'
|
||||
import { permissionGroups, showSubpermissionsGrop } from '../common/model/permissionGroup'
|
||||
@ -155,7 +155,7 @@ struct PermissionDialog {
|
||||
if(this.locationFlag > Constants.LOCATION_NONE) {
|
||||
LocationCanvas({ locationFlag: $locationFlag })
|
||||
}
|
||||
}
|
||||
}.constraintSize({ maxHeight: Constants.MAXIMUM_HEADER_HEIGHT })
|
||||
}
|
||||
Row() {
|
||||
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
|
||||
@ -372,9 +372,9 @@ struct PermissionDialog {
|
||||
let context = globalThis.extensionContext.createBundleContext(bundleName)
|
||||
context.resourceManager.getString(applicationInfo.labelId, (err, value) => {
|
||||
if (value == undefined) {
|
||||
this.appName = applicationInfo.label
|
||||
this.appName = titleTrim(applicationInfo.label);
|
||||
} else {
|
||||
this.appName = value
|
||||
this.appName = titleTrim(value);
|
||||
}
|
||||
Log.info("hap label:" + applicationInfo.label + ", value:"+this.appName)
|
||||
})
|
||||
|
@ -84,6 +84,8 @@ struct permissionRecordPage {
|
||||
}
|
||||
Column() {
|
||||
Text(item.groupName)
|
||||
.width(Constants.MAXIMUM_HEADER_WIDTH)
|
||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.fontColor($r('app.color.label_color'))
|
||||
@ -151,6 +153,8 @@ struct permissionRecordPage {
|
||||
.backgroundColor($r("app.color.label_color_lightest"))
|
||||
.margin({ bottom: Constants.LISTITEM_MARGIN_BOTTOM_PERMISSION })
|
||||
Text(permissionApplication.groupName)
|
||||
.width(Constants.MAXIMUM_HEADER_WIDTH)
|
||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||
.fontSize(Constants.TEXT_MIDDLE_FONT_SIZE)
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.fontColor($r('app.color.label_color'))
|
||||
|
Loading…
Reference in New Issue
Block a user