modify codeCheck

Signed-off-by: eleli <liheng10@huawei.com>
This commit is contained in:
eleli
2022-03-14 15:43:09 +08:00
parent cd363c7a01
commit 9b72e1665e
53 changed files with 156 additions and 36 deletions
Executable → Regular
+15
View File
@@ -1,3 +1,18 @@
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
*.iml
.gradle
/local.properties
Executable → Regular
+1 -1
View File
@@ -1,4 +1,4 @@
Apache License
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Executable → Regular
+3 -3
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2021 Huawei Device Co., Ltd.
<!-- Copyright (c) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -12,8 +12,8 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This is the configuration file template for OpenHarmony OSS Audit Tool, please copy it to your project root dir and modify it refer to OpenHarmony/tools_oat/README.
-->
<!--This is the configuration file template for OpenHarmony OSS Audit Tool, please copy it to your project root dir and modify it refer to OpenHarmony/tools_oat/README.
All configurations in this file will be merged to OAT-Default.xml, if you have any questions or concerns, please create issue in OpenHarmony/tools_oat and @jalenchen or chenyaxun.
licensefile:
Executable → Regular
View File
Executable → Regular
+15
View File
@@ -1,3 +1,18 @@
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'com.huawei.ohos.app'
Executable → Regular
View File
Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 394 B

After

Width:  |  Height:  |  Size: 394 B

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 406 B

After

Width:  |  Height:  |  Size: 406 B

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 253 B

After

Width:  |  Height:  |  Size: 253 B

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

Executable → Regular
+15
View File
@@ -1,2 +1,17 @@
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/build
/node_modules
Executable → Regular
+15
View File
@@ -1,3 +1,18 @@
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply plugin: 'com.huawei.ohos.hap'
//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510
ohos {
Vendored Executable → Regular
+16 -1
View File
@@ -1 +1,16 @@
# config module specific ProGuard rules here.
#
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Configure module specific ProGuard rules here.
Executable → Regular
View File
View File
+9 -8
View File
@@ -32,7 +32,8 @@ export class AppDetailData {
public ret = { val: false };
async checkAppItem(elementNameVal) {
console.log('adminprovisioning checkAppItem in elementName:' + JSON.stringify(elementNameVal));
console.log('adminprovisioning checkAppItem in bundleName:' + elementNameVal.bundleName + ' | abilityName:' +
elementNameVal.abilityName);
let actionVal: string = 'ohos.action.ENT_ADMIN';
let wantTemp = { "action": actionVal };
let data = await bundle.queryAbilityByWant(wantTemp, bundle.BundleFlag.GET_BUNDLE_WITH_ABILITIES, baseData.USE_ID);
@@ -59,8 +60,8 @@ export class AppDetailData {
async getAppInfoLabel(resMgr, id) {
let label = await resMgr.getString(id);
console.log('adminprovisioning getAppInfoLabel start label:' + label);
if (label == null || label == undefined || label == '') {
return '';
if (label === null || label === undefined || label === baseData.EMPTY_STR) {
return baseData.EMPTY_STR;
}
return label;
}
@@ -68,8 +69,8 @@ export class AppDetailData {
async getAppInfoIcon(resMgr, id) {
let iconVal = await resMgr.getMediaBase64(id);
console.log('adminprovisioning getAppInfoIcon start iconVal:' + iconVal);
if (iconVal == null || iconVal == undefined || iconVal == '') {
return '';
if (iconVal === null || iconVal === undefined || iconVal === baseData.EMPTY_STR) {
return baseData.EMPTY_STR;
}
return iconVal;
}
@@ -91,7 +92,7 @@ export class AppDetailData {
if (appInfoTemp.iconId > 0) {
iconVal = await this.getAppInfoIcon(resMgr, appInfoTemp.iconId);
if (iconVal == '') {
if (iconVal === baseData.EMPTY_STR) {
appInfo.appIcon = icon_default;
appInfo.appTitle = label;
}
@@ -109,7 +110,7 @@ export class AppDetailData {
getPermissionInfoVal(permissionName): number {
for (let i = 0; i < permissionsDetailList.length; i++) {
if (permissionsDetailList[i].permissionName == permissionName) {
if (permissionsDetailList[i].permissionName === permissionName) {
return i;
}
}
@@ -118,7 +119,7 @@ export class AppDetailData {
async getPermissionList(data, appInfo) {
let permissions = data.reqPermissions;
if (permissions != null && permissions != []) {
if (permissions !== null && permissions !== []) {
console.log('adminprovisioning getPermissionList permission length:' + permissions.length);
for (var i = 0; i < permissions.length; i++) {
console.log('adminprovisioning getPermissionList permission is in val:' + permissions[i]);
+1
View File
@@ -17,6 +17,7 @@ export class BaseData {
USE_ID = 100;
SELF_BUNDLE_NAME = 'com.ohos.adminprovisioning';
MAX_LEN = 30;
EMPTY_STR = '';
}
let baseData = new BaseData();
+17 -17
View File
@@ -188,7 +188,7 @@ struct ApplicationInfo {
console.log('adminprovisioning ApplicationInfo onPageShow in');
this.isAdminActive();
console.log('adminprovisioning ApplicationInfo onPageShow isActiveState =' + isActiveState);
if (isActiveState == undefined || isActiveState == null) {
if (isActiveState === undefined || isActiveState === null) {
return;
}
this.isShowActive = isActiveState;
@@ -213,18 +213,18 @@ struct ApplicationInfo {
let retSuperState;
console.log('adminprovisioning isAdminActive elementNameVal.bundleName=' + elementNameVal.bundleName +
' | elementNameVal.abilityName=' + elementNameVal.abilityName);
if (elementNameVal.bundleName == '' || elementNameVal.abilityName == '') {
if (elementNameVal.bundleName === baseData.EMPTY_STR || elementNameVal.abilityName === baseData.EMPTY_STR) {
console.log('adminprovisioning isAdminActive elementNameVal is null');
return;
}
retAppState = await edmEnterpriseDeviceManager.isAdminAppActive(wantTemp);
retSuperState = await edmEnterpriseDeviceManager.isSuperAdmin(elementNameVal.bundleName);
if (retAppState == false) {
if (retAppState === false) {
this.isShowActive = false;
this.isEnableButton = true;
} else {
if (retSuperState == true) {
if (retSuperState === true) {
this.isEnableButton = false;
} else {
this.isEnableButton = true;
@@ -244,8 +244,8 @@ struct ApplicationInfo {
};
await this.isAdminActive();
let ret;
if (this.isShowActive == false) {
if (adminType == edmEnterpriseDeviceManager.AdminType.ADMIN_TYPE_NORMAL) {
if (this.isShowActive === false) {
if (adminType === edmEnterpriseDeviceManager.AdminType.ADMIN_TYPE_NORMAL) {
ret = await edmEnterpriseDeviceManager.activateAdmin(wantTemp,
{ name: enterInfo.name, description: enterInfo.description },
edmEnterpriseDeviceManager.AdminType.ADMIN_TYPE_NORMAL);
@@ -256,7 +256,7 @@ struct ApplicationInfo {
}
console.log('adminprovisioning activateAdmin Activate admin end');
} else {
if (this.isEnableButton == true) {
if (this.isEnableButton === true) {
ret = await edmEnterpriseDeviceManager.deactivateAdmin(wantTemp);
} else {
console.log('adminprovisioning activateAdmin not support super admin active');
@@ -271,8 +271,8 @@ struct ApplicationInfo {
console.log('adminprovisioning getSelfResourceVal in:');
let value = await item.getString(resource.id);
console.log('adminprovisioning getSelfResourceVal finish value:' + value);
if (value == undefined || value == null || value == '') {
return '';
if (value === undefined || value === null || value === baseData.EMPTY_STR) {
return baseData.EMPTY_STR;
}
return value;
}
@@ -284,8 +284,8 @@ struct ApplicationInfo {
let includeElementNameVal = Object.keys(data.parameters).indexOf('elementName');
let includeActiveTypeVal = Object.keys(data.parameters).indexOf('activeType');
let includeEnterpriseVal = Object.keys(data.parameters).indexOf('enterprise');
if (lengthVal == 0 || includeElementNameVal == -1 || includeActiveTypeVal == -1 ||
includeEnterpriseVal == -1) {
if (lengthVal === 0 || includeElementNameVal === -1 || includeActiveTypeVal === -1 ||
includeEnterpriseVal === -1) {
console.log('adminprovisioning data.parameters = ' + JSON.stringify(data.parameters));
return;
}
@@ -296,12 +296,12 @@ struct ApplicationInfo {
adminType.admintype = data.parameters.activeType;
AppStorage.SetOrCreate('activeType', adminType.admintype);
if (data.parameters.enterprise.name != null && data.parameters.enterprise.name != undefined) {
if (data.parameters.enterprise.name !== null && data.parameters.enterprise.name !== undefined) {
enterInfo.name = data.parameters.enterprise.name.substring(0, baseData.MAX_LEN);
}
if (data.parameters.enterprise.description != null &&
data.parameters.enterprise.description != undefined) {
if (data.parameters.enterprise.description !== null &&
data.parameters.enterprise.description !== undefined) {
enterInfo.description = data.parameters.enterprise.description.substring(0, baseData.MAX_LEN);
}
@@ -350,16 +350,16 @@ struct ApplicationInfo {
description: '',
};
if (this.isShowActive) {
console.log('adminprovisioning ApplicationInfo getCheckAbilityList getEnterInfo err=' + JSON.stringify(getEnterInfo));
console.log('adminprovisioning ApplicationInfo getCheckAbilityList get getEnterInfo');
getEnterInfo = await edmEnterpriseDeviceManager.getEnterpriseInfo(want);
}
console.log('adminprovisioning ApplicationInfo getCheckAbilityList enterpriseName=' + getEnterInfo.name
+ ' enterpriseDescription=' + getEnterInfo.description);
if (getEnterInfo.name != null && getEnterInfo.name != undefined) {
if (getEnterInfo.name !== null && getEnterInfo.name !== undefined) {
getName = getEnterInfo.name.substring(0, baseData.MAX_LEN);
}
if (getEnterInfo.description != null && getEnterInfo.description != undefined) {
if (getEnterInfo.description !== null && getEnterInfo.description !== undefined) {
getDescription = getEnterInfo.description.substring(0, baseData.MAX_LEN);
}
View File
View File
View File
View File
View File
View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

Before

Width:  |  Height:  |  Size: 421 B

After

Width:  |  Height:  |  Size: 421 B

View File
View File
View File

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Executable → Regular
+15
View File
@@ -1,3 +1,18 @@
#
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Project-wide Gradle settings.
# IDE (e.g. DevEco Studio) users:
# Gradle settings configured through the IDE *will override*
Vendored Executable → Regular
+2 -3
View File
@@ -1,13 +1,12 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
# 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,
Vendored Executable → Regular
+2 -3
View File
@@ -1,11 +1,10 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Copyright (c) 2022 Huawei Device Co., Ltd.
@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 https://www.apache.org/licenses/LICENSE-2.0
@rem http://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,
Executable → Regular
+15
View File
@@ -1,3 +1,18 @@
#
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
## This file is automatically generated by DevEco Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
Executable → Regular
View File
Executable → Regular
+15
View File
@@ -1 +1,16 @@
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
include ':entry'
Executable → Regular
View File