diff --git a/test/native/USBTestDemoNew/USBTestApp/.gitignore b/test/native/USBTestDemoNew/USBTestApp/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..d2ff20141ceed86d87c0ea5d99481973005bab2b --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/.gitignore @@ -0,0 +1,12 @@ +/node_modules +/oh_modules +/local.properties +/.idea +**/build +/.hvigor +.cxx +/.clangd +/.clang-format +/.clang-tidy +**/.test +/.appanalyzer \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/AppScope/app.json5 b/test/native/USBTestDemoNew/USBTestApp/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..0a23fb8002d1a0b12fe1897e8cebb630a9c0a387 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "ohos.samples.usb.test", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/test/native/USBTestDemoNew/USBTestApp/AppScope/resources/base/element/string.json b/test/native/USBTestDemoNew/USBTestApp/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..092e7ab704dd2286dac803b2d234c3b0d0b449c3 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "USBTestApp" + } + ] +} diff --git a/test/native/USBTestDemoNew/USBTestApp/AppScope/resources/base/media/app_icon.png b/test/native/USBTestDemoNew/USBTestApp/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a39445dc87828b76fed6d2ec470dd455c45319e3 Binary files /dev/null and b/test/native/USBTestDemoNew/USBTestApp/AppScope/resources/base/media/app_icon.png differ diff --git a/test/native/USBTestDemoNew/USBTestApp/build-profile.json5 b/test/native/USBTestDemoNew/USBTestApp/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..493abd5d64fd2895f3e7bcad2dafad2539e72343 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/build-profile.json5 @@ -0,0 +1,55 @@ +{ + "app": { + "signingConfigs": [ + { + "name": "default", + "type": "HarmonyOS", + "material": { + "certpath": "C:\\Users\\isuser\\.ohos\\config\\default_USBTestApp_h0n8FS23nwBAkTBeiliBhRbRTONXa0jr5RaJCjIyZKQ=.cer", + "storePassword": "0000001B55D0437B2D0F17258FBA423988601DA60D54E00EC66845B08A9AB55B3C8122438E011F16FEFFE8", + "keyAlias": "debugKey", + "keyPassword": "0000001B65CCDDA3E987D0265BDE7901FEEE9F1A60690B969AF583133E5D5DAE678288D7C47395B1D45A11", + "profile": "C:\\Users\\isuser\\.ohos\\config\\default_USBTestApp_h0n8FS23nwBAkTBeiliBhRbRTONXa0jr5RaJCjIyZKQ=.p7b", + "signAlg": "SHA256withECDSA", + "storeFile": "C:\\Users\\isuser\\.ohos\\config\\default_USBTestApp_h0n8FS23nwBAkTBeiliBhRbRTONXa0jr5RaJCjIyZKQ=.p12" + } + } + ], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS", + "buildOption": { + "strictMode": { + "caseSensitiveCheck": true, + "useNormalizedOHMUrl": true + } + } + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/code-linter.json5 b/test/native/USBTestDemoNew/USBTestApp/code-linter.json5 new file mode 100644 index 0000000000000000000000000000000000000000..77b31b517a3e5c2f34c3ae1bf44083c0c06cbd6d --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/code-linter.json5 @@ -0,0 +1,20 @@ +{ + "files": [ + "**/*.ets" + ], + "ignore": [ + "**/src/ohosTest/**/*", + "**/src/test/**/*", + "**/src/mock/**/*", + "**/node_modules/**/*", + "**/oh_modules/**/*", + "**/build/**/*", + "**/.preview/**/*" + ], + "ruleSet": [ + "plugin:@performance/recommended", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + } +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/.gitignore b/test/native/USBTestDemoNew/USBTestApp/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e2713a2779c5a3e0eb879efe6115455592caeea5 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/.gitignore @@ -0,0 +1,6 @@ +/node_modules +/oh_modules +/.preview +/build +/.cxx +/.test \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/build-profile.json5 b/test/native/USBTestDemoNew/USBTestApp/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..dfb34f7b9ee6d4be47467380bc43fb8019f98e17 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": false, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/hvigorfile.ts b/test/native/USBTestDemoNew/USBTestApp/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6edcd90486dd5a853cf7d34c8647f08414ca7a3 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/obfuscation-rules.txt b/test/native/USBTestDemoNew/USBTestApp/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..272efb6ca3f240859091bbbfc7c5802d52793b0b --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/obfuscation-rules.txt @@ -0,0 +1,23 @@ +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope + +-enable-property-obfuscation +-enable-toplevel-obfuscation +-enable-filename-obfuscation +-enable-export-obfuscation \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/oh-package.json5 b/test/native/USBTestDemoNew/USBTestApp/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..2959d78c50285f912adb2cdff9f613df9a503b44 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/common/CheckEmptyUtils.ets b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/common/CheckEmptyUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..7d87b7a475fbf405f24032e431c48f602c0a7f86 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/common/CheckEmptyUtils.ets @@ -0,0 +1,56 @@ +/* + * 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 default class CheckEmptyUtils{ + + /** + * Check obj is empty. + * + * @param {object} obj + * @return {boolean} true(empty) + */ + isEmpty(obj: Object) { + return (typeof obj === 'undefined' || obj == null || obj === ''); + }; + + /** + * Check str is empty. + * + * @param {string} str + * @return {boolean} true(empty) + */ + checkStrIsEmpty(str: String) { + return str.trim().length == 0; + }; + + /** + * Check array is empty. + * + * @param {Array}arr + * @return {boolean} true(empty) + */ + isEmptyArr(arr: Array) { + return arr.length == 0; + } + /** + * Sleep. + * + * @param {Array}arr + * @return {boolean} true(empty) + */ + sleep(ms: number): Promise { + return new Promise(resolve => setTimeout(resolve, ms)); + } +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/common/DateAndTimeUtil.ets b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/common/DateAndTimeUtil.ets new file mode 100644 index 0000000000000000000000000000000000000000..fa62f3272ba001af4a290e579b869886f227f673 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/common/DateAndTimeUtil.ets @@ -0,0 +1,114 @@ +/** + * Copyright (c) 2024 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. + */ +const twelve = 12; +/** + * date package tool class + */ +export default class DateAndTimeUtil{ + constructor() { + }; + /** + * + * Get the current time + */ + // now() { + // const datetime = new Date(); + // const hours = datetime.getHours(); + // const minutes = datetime.getMinutes(); + // return this.concatTime(hours, minutes); + // }; + + /** + * + * Get the current time + */ + nowWithSeconds() { + const datetime = new Date(); + const hours = datetime.getHours(); + const minutes = datetime.getMinutes(); + const seconds = datetime.getMilliseconds() + console.info("now: " + hours + ":" + minutes + ":" + seconds) + const now = this.concatTimeWithSeconds(hours, minutes, seconds); + console.info("now concat: " + now); + return now; + }; + + /** + * format + * @param value + * @return + */ + fill(value: Number) { + return (value > 9 ? "" : "0") + value; + }; + /** + * concat date + * @param year m d + * @return + */ + // concatDate(year: Number, month: Number, date: Number) { + // return year + this.year + month + this.month + date + this.day; + // }; + + concatTime(hours: Number, minutes: Number) { + return `${this.fill(hours)}:${this.fill(minutes)}`; + }; + + concatTimeWithSeconds(hours: Number, minutes: Number, milliseconds: Number) { + return `${this.fill(hours)}:${this.fill(minutes)}:${this.fill(milliseconds)}`; + }; + /** + * Turn to 24-hour clock + * @param str + * @return + */ + // transform24(str: String) { + // const timeFlag = str.substr(0, 2); + // if (timeFlag == this.morning) { + // const h = str.substr(2).split(":")[0]; + // if (h == twelve) { + // const time = "0" + ":" + str.substr(2).split(":")[1]; + // return time; + // } else { + // return h + ":" + str.substr(2).split(":")[1]; + // } + // } else { + // const h = str.substr(2).split(":")[0]; + // const h1 = parseInt(h) + twelve; + // if (h != twelve) { + // const time = h1 + ":" + str.substr(2).split(":")[1]; + // return time; + // } + // } + // }; + /** + * Turn to 12-hour clock + * @param str + * @return + */ + // transform12(str: String) { + // const hours = str.substring(0, str.indexOf(":")); + // const minutes = str.split(":")[1]; + // if (hours < twelve) { + // return this.morning.concat(`${hours}:${minutes}`); + // } + // if (hours == twelve) { + // return this.afternoon.concat(`${hours}:${minutes}`); + // } else { + // const reduceHours = parseInt(hours) - twelve; + // return this.afternoon.concat(`${reduceHours}:${minutes}`); + // } + // }; +} diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/common/DirectoryList.ets b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/common/DirectoryList.ets new file mode 100644 index 0000000000000000000000000000000000000000..b64a97262fe7b8c623fdc94874b6b0ba257ad082 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/common/DirectoryList.ets @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router' + +class DirectoryItem { + title: Resource | string = ''; + uri: string = ''; + id: string = ''; +} + +@Component +struct DirectoryList { + private directory: DirectoryItem[]=[]; + private title?: Resource; + + build() { + Scroll() { + Column() { + Flex({ direction: FlexDirection.Row }) { + Column() { + Button("返回").fontSize(11) + .height(30) + .width('100%') + .backgroundColor('#007DFF') + .margin({top: 30}) + .onClick(() => { + this.routerBack(); + }); + }.width('20%').height('100%'); + + Column() { + Text(this.title) + .fontSize(18) + .fontWeight(FontWeight.Bold) + .height(70) + .align(Alignment.Center); + }.width('60%').height('100%'); + + }.width('100%').height(100); + + + ForEach(this.directory, (item : DirectoryItem) => { + Button(item.title) + .id(item.id) + .fontSize(20) + .width('90%') + .height(55) + .margin(12) + .backgroundColor('#007DFF') + .onClick(() => { + router.pushUrl({ + url: item.uri + }) + }); + },(item:DirectoryItem)=>JSON.stringify(item)); + } + } + .width('100%') + .padding({left: 10, right: 10, bottom: 100}); + } + + routerBack(){ + router.back(); + } + +} + +export { DirectoryItem, DirectoryList } \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/common/EventConstants.ets b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/common/EventConstants.ets new file mode 100644 index 0000000000000000000000000000000000000000..df492841dae3c516c5264fe125138256a71da522 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/common/EventConstants.ets @@ -0,0 +1,66 @@ +/* + * 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. + */ + +/** + * Constants of events that will be registered to system. + */ + class EventConstants { + /** + * Bitmask used for extracting the USBEndpoint type from it's address + */ + USB_ENDPOINT_XFERTYPE_MASK = 0x03; + + /** + * Control USBEndpoint type + */ + USB_ENDPOINT_XFER_CONTROL = 0; + + /** + * Isochronous USBEndpoint type + */ + USB_ENDPOINT_XFER_ISOC = 1; + + /** + * Bulk USBEndpoint type + */ + USB_ENDPOINT_XFER_BULK = 2; + + /** + * Interrupt USBEndpoint type + */ + USB_ENDPOINT_XFER_INT = 3; + + /** + * Bitmask used for extracting the USBEndpoint number from it's address + */ + USB_ENDPOINT_NUMBER_MASK = 0x0f; + + /** + * Bitmask used for extracting the USBEndpoint direction from it's address + */ + USB_ENDPOINT_DIR_MASK = 0x80; + + /** + * Used to signify direction of data for USBEndpoint is OUT, host to device + */ + USB_ENDPOINT_DIR_OUT = 0; + + /** + * Used to signify direction of data for USBEndpoint is IN, device to host + */ + USB_ENDPOINT_DIR_IN = 0x80; +} + +export default EventConstants; \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/common/FileUtils.ets b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/common/FileUtils.ets new file mode 100644 index 0000000000000000000000000000000000000000..b88620bbf03f6cf8e863a9b0b0fe54bc74e42373 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/common/FileUtils.ets @@ -0,0 +1,138 @@ +// import Fileio from '@ohos.fileio'; +// +// const baseFilePath = "/data/accounts/account_0/applications/ohos.samples.jshelloworld/ohos.samples.jshelloworld/assets/entry/resources/rawfile/"; +// const dataFile = "/data/accounts/account_0/appdata/ohos.samples.jshelloworld/cache/"; +// const fileName = "test_file.txt"; +// const READ_DATA_SIZE = 4096; +// +// export default class FileUtils{ +// +// readTestFile() { +// console.info("test usb FileUtil readJsonObj start execution"); +// let filePath = dataFile + fileName; +// return this.readFile(filePath); +// }; +// +// readFile(path) { +// let readStreamSync = null; +// try { +// readStreamSync = Fileio.Stream.createStreamSync(path, "r"); +// let content = this.getContent(readStreamSync); +// console.info("test usb FileUtil readJsonFile finish execution" + content); +// return content; +// } catch (e) { +// console.info("test usb FileUtil readJsonFile " + e); +// } finally { +// readStreamSync.closeSync(); +// } +// }; +// +// writeTestFile(content) { +// console.info("test usb FileUtil writeJsonObj start execution"); +// let filePath = dataFile + fileName; +// let writeStreamSync = null; +// try { +// writeStreamSync = Fileio.Stream.createStreamSync(filePath, "w+"); +// writeStreamSync.writeSync(content); +// } catch (e) { +// console.info("test usb FileUtil writeJsonObj error: " + e); +// } finally { +// writeStreamSync.closeSync(); +// console.info("test usb FileUtil writeJsonObj close sync"); +// } +// }; +// +// /** +// * Read String from disk by bundleName. +// * +// * @param {string} bundleName - bundleName as target file name +// * @return {string} - read string from file +// */ +// readStringFromFile(bundleName) { +// console.info("test usb FileUtil readStringFromFile start execution"); +// let filePath = baseFilePath + bundleName + ".json"; +// try { +// var readStreamSync = Fileio.Stream.createStreamSync(filePath, "r"); +// let content = this.getContent(readStreamSync); +// console.info("test usb FileUtil readStringFromFile finish execution" + content); +// return content; +// } catch (e) { +// console.info("test usb FileUtil readStringFromFile " + e); +// } finally { +// readStreamSync.closeSync(); +// } +// }; +// +// /** +// * Write string to a file. +// * +// * @param {string} string - target string will be written to file +// * @param {string} bundleName - bundleName as target file name +// */ +// writeStringToFile(string: String, bundleName: String) { +// console.info("test usb FileUtil writeStringToFile start execution"); +// let filePath = baseFilePath + bundleName + ".json"; +// try { +// var writeStreamSync = Fileio.createStreamSync(filePath, "w+"); +// writeStreamSync.writeSync(string); +// } catch (e) { +// console.info("test usb FileUtil writeStringToFile error: " + e); +// } finally { +// writeStreamSync.closeSync(); +// console.info("test usb FileUtil writeStringToFile close sync"); +// } +// }; +// +// /** +// * Read JSON object from a file. +// * +// * @param {object} readStreamSync - stream of target file +// * @return {object} - object read from file stream +// */ +// getContent(readStreamSync: Object) { +// console.info("test usb getContent start"); +// let bufArray = []; +// let totalLength = 0; +// let buf = new ArrayBuffer(READ_DATA_SIZE); +// let len = readStreamSync.readSync(buf); +// while (len != 0) { +// console.info("test usb FileUtil getContent FileIO reading " + len); +// totalLength += len; +// if (len < READ_DATA_SIZE) { +// buf = buf.slice(0, len); +// bufArray.push(buf); +// break; +// } +// bufArray.push(buf); +// buf = new ArrayBuffer(READ_DATA_SIZE); +// len = readStreamSync.readSync(buf); +// } +// console.info("test usb FileUtil getContent read finished " + totalLength); +// let contentBuf = new Uint8Array(totalLength); +// let offset = 0; +// for (let bufArr of bufArray) { +// console.info("test usb FileUtil getContent collecting " + offset); +// let uInt8Arr = new Uint8Array(bufArr); +// contentBuf.set(uInt8Arr, offset); +// offset += uInt8Arr.byteLength; +// } +// let content = String.fromCharCode.apply(null, new Uint8Array(contentBuf)); +// return content; +// }; +// +// /** +// * Remove file. +// * +// * @param {string} bundleName - bundleName as target file name +// */ +// removeFile(bundleName: String) { +// try { +// console.info("test usb FileUtil removeFile") +// //remove file,key : bundlename +// Fileio.unlinkSync(baseFilePath + fileName) +// } catch (e) { +// console.error("test usb FileUtil removeFile delete has failed for " + e) +// } +// } +// } +// \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/entryability/EntryAbility.ets b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..58056ae24532a3848b65321a2fb6ab4148c21acf --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,41 @@ +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..b72fc477d96447e221cf45c9c6671c8018ae05f3 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,12 @@ +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(0x0000, 'testTag', 'onBackup ok'); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + } +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/main/module.json5 b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..addfdfed0ccd728008e0794586edfcb8a523a61a --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/module.json5 @@ -0,0 +1,66 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default", + "phone", + "tablet", + "2in1", + "car" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:startIcon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:startIcon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "name": "EntryBackupAbility", + "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", + "type": "backup", + "exported": false, + "metadata": [ + { + "name": "ohos.extension.backup", + "resource": "$profile:backup_config" + } + ], + } + ], + "requestPermissions": [ + { + "name": "ohos.permission.MANAGE_USB_CONFIG", + "reason": "$string:reason_usb", + "usedScene": { + "abilities": [ + "EntryAbility" + ], + "when": "inuse" + } + } + ] + } +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/element/color.json b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/element/string.json b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..82fb07f6cefd70309450792cd7580956eb5ce9d3 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/element/string.json @@ -0,0 +1,96 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "USB_test" + }, + { + "name": "reason_usb", + "value": "Usb test" + }, + { + "name": "home_title", + "value": "USB service testing" + }, + { + "name": "function_testing", + "value": "function testing" + }, + { + "name": "stability_testing", + "value": "Stability testing" + }, + { + "name": "xts_testing", + "value": "XTS testing" + }, + { + "name": "hostFunction_testing", + "value": "Host function" + }, + { + "name": "deviceFunction_testing", + "value": "Device function" + }, + { + "name": "common_testing", + "value": "General functions of Host and Device" + }, + { + "name": "port_manager", + "value": "Port Management" + }, + { + "name": "devicePermission_manager", + "value": "Device permission management" + }, + { + "name": "usbFunction_manager", + "value": "USB Function Function" + }, + { + "name": "unplug_event_Notice", + "value": "Unplug Event Notice" + }, + { + "name": "get_device_information", + "value": "Get Device Information" + }, + { + "name": "device_open_function", + "value": "USB Device Open Function" + }, + { + "name": "transfer_control_function", + "value": "Transfer&Control Function" + }, + { + "name": "xts_acts_hats_testing", + "value": "XTS_Acts_Hats testing" + }, + { + "name": "XTS_Execution", + "value": "XTS Execution" + }, + { + "name": "USB_stability_testing", + "value": "USB stability_testing" + }, + { + "name": "USB_func_unplug_stability_testing", + "value": "func_unplug_stability_testing" + }, + { + "name": "async_transfer_function", + "value": "async_transfer_function" + } + ] +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/media/background.png b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..f939c9fa8cc8914832e602198745f592a0dfa34d Binary files /dev/null and b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/media/background.png differ diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/media/foreground.png b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..4483ddad1f079e1089d685bd204ee1cfe1d01902 Binary files /dev/null and b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/media/foreground.png differ diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/media/layered_image.json b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/media/layered_image.json @@ -0,0 +1,7 @@ +{ + "layered-image": + { + "background" : "$media:background", + "foreground" : "$media:foreground" + } +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/media/startIcon.png b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/media/startIcon.png differ diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/profile/backup_config.json b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..d742c2f96e7dd0f406f499941f3147345e998f95 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/profile/main_pages.json b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..57a906d7e76cbc2c4a993fa21d5da7836c202770 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,21 @@ +{ + "src": [ + "pages/Index", + "pages/functionTest/FunctionTest", + "pages/functionTest/deviceFunctionTest/DeviceFunctionTest", + "pages/functionTest/deviceFunctionTest/usbFunctionTest/UsbFunctionTest", + "pages/functionTest/hostFunctionTest/HostFunctionTest", + "pages/functionTest/hostFunctionTest/hostManager/DevicePermissionManager", + "pages/functionTest/hostDeviceCommonFunctionTest/HostDeviceCommonFunctionTest", + "pages/functionTest/hostDeviceCommonFunctionTest/commonFunctionTest/PortFunctionManager", + "pages/functionTest/hostDeviceCommonFunctionTest/commonFunctionTest/UnplugEventNotice", + "pages/functionTest/hostFunctionTest/hostManager/GetDeviceInformation", + "pages/functionTest/hostFunctionTest/hostManager/DeviceOpenFunction", + "pages/functionTest/hostFunctionTest/hostManager/TransferAndControlFunction", + "pages/functionTest/hostFunctionTest/hostManager/AsyncTransferFunction", + "pages/stabilityTest/FunctionStabilityTest", + "pages/stabilityTest/FunctionStability/DeviceFunctionStabilityTest", + "pages/xtsTest/XTSTest", + "pages/xtsTest/actsAndHatsTest/ActsAndHatsTest" + ] +} diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/en_US/element/string.json b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..82fb07f6cefd70309450792cd7580956eb5ce9d3 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,96 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "USB_test" + }, + { + "name": "reason_usb", + "value": "Usb test" + }, + { + "name": "home_title", + "value": "USB service testing" + }, + { + "name": "function_testing", + "value": "function testing" + }, + { + "name": "stability_testing", + "value": "Stability testing" + }, + { + "name": "xts_testing", + "value": "XTS testing" + }, + { + "name": "hostFunction_testing", + "value": "Host function" + }, + { + "name": "deviceFunction_testing", + "value": "Device function" + }, + { + "name": "common_testing", + "value": "General functions of Host and Device" + }, + { + "name": "port_manager", + "value": "Port Management" + }, + { + "name": "devicePermission_manager", + "value": "Device permission management" + }, + { + "name": "usbFunction_manager", + "value": "USB Function Function" + }, + { + "name": "unplug_event_Notice", + "value": "Unplug Event Notice" + }, + { + "name": "get_device_information", + "value": "Get Device Information" + }, + { + "name": "device_open_function", + "value": "USB Device Open Function" + }, + { + "name": "transfer_control_function", + "value": "Transfer&Control Function" + }, + { + "name": "xts_acts_hats_testing", + "value": "XTS_Acts_Hats testing" + }, + { + "name": "XTS_Execution", + "value": "XTS Execution" + }, + { + "name": "USB_stability_testing", + "value": "USB stability_testing" + }, + { + "name": "USB_func_unplug_stability_testing", + "value": "func_unplug_stability_testing" + }, + { + "name": "async_transfer_function", + "value": "async_transfer_function" + } + ] +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/zh_CN/element/string.json b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..12335d8b3c570f7e76b0de7feb042903c7df872e --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,96 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "USB_test" + }, + { + "name": "reason_usb", + "value": "Usb 测试" + }, + { + "name": "home_title", + "value": "USB服务测试" + }, + { + "name": "function_testing", + "value": "功能测试" + }, + { + "name": "stability_testing", + "value": "稳定性测试" + }, + { + "name": "xts_testing", + "value": "XTS 测试" + }, + { + "name": "hostFunction_testing", + "value": "Host功能" + }, + { + "name": "deviceFunction_testing", + "value": "Device功能" + }, + { + "name": "common_testing", + "value": "Host、Device通用功能" + }, + { + "name": "port_manager", + "value": "port端口管理" + }, + { + "name": "devicePermission_manager", + "value": "设备权限管理" + }, + { + "name": "usbFunction_manager", + "value": "Usb Function功能" + }, + { + "name": "unplug_event_Notice", + "value": "插拔事件通知" + }, + { + "name": "get_device_information", + "value": "获取设备信息" + }, + { + "name": "device_open_function", + "value": "USB设备打开功能" + }, + { + "name": "transfer_control_function", + "value": "数据&控制传输功能" + }, + { + "name": "xts_acts_hats_testing", + "value": "Act和Hats仓测试套测试" + }, + { + "name": "XTS_Execution", + "value": "XTS 执行" + }, + { + "name": "USB_stability_testing", + "value": "USB 稳定性测试" + }, + { + "name": "USB_func_unplug_stability_testing", + "value": "function设置&拔插稳定性测试" + }, + { + "name": "async_transfer_function", + "value": "异步传输功能" + } + ] +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/mock/mock-config.json5 b/test/native/USBTestDemoNew/USBTestApp/entry/src/mock/mock-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7a73a41bfdf76d6f793007240d80983a52f15f97 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/mock/mock-config.json5 @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/ohosTest/ets/test/Ability.test.ets b/test/native/USBTestDemoNew/USBTestApp/entry/src/ohosTest/ets/test/Ability.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..0ca16f428824c4bdfd79e48e6fc462c4f9562ed6 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/ohosTest/ets/test/Ability.test.ets @@ -0,0 +1,38 @@ +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import { asset } from '@kit.AssetStoreKit'; + +export default function abilityTest() { + describe('ActsAbilityTest', () => { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(() => { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. + }) + beforeEach(() => { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }) + afterEach(() => { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }) + afterAll(() => { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }) + it('assertContain', 0, () => { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); + let a = 'abc'; + let b = 'b'; + String(1) + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b); + expect(a).assertEqual(a); + }) + + }) +} diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/ohosTest/ets/test/List.test.ets b/test/native/USBTestDemoNew/USBTestApp/entry/src/ohosTest/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..794c7dc4ed66bd98fa3865e07922906e2fcef545 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/ohosTest/ets/test/List.test.ets @@ -0,0 +1,5 @@ +import abilityTest from './Ability.test'; + +export default function testsuite() { + abilityTest(); +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/ohosTest/module.json5 b/test/native/USBTestDemoNew/USBTestApp/entry/src/ohosTest/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..8fc8224dcf755b082c6df19d86267cb8be3c8c77 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/ohosTest/module.json5 @@ -0,0 +1,14 @@ +{ + "module": { + "name": "entry_test", + "type": "feature", + "deviceTypes": [ + "phone", + "tablet", + "2in1", + "car" + ], + "deliveryWithInstall": true, + "installationFree": false + } +} diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/test/List.test.ets b/test/native/USBTestDemoNew/USBTestApp/entry/src/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..bb5b5c3731e283dd507c847560ee59bde477bbc7 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/test/List.test.ets @@ -0,0 +1,5 @@ +import localUnitTest from './LocalUnit.test'; + +export default function testsuite() { + localUnitTest(); +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/entry/src/test/LocalUnit.test.ets b/test/native/USBTestDemoNew/USBTestApp/entry/src/test/LocalUnit.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..165fc1615ee8618b4cb6a622f144a9a707eee99f --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/entry/src/test/LocalUnit.test.ets @@ -0,0 +1,33 @@ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; + +export default function localUnitTest() { + describe('localUnitTest', () => { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(() => { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. + }); + beforeEach(() => { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }); + afterEach(() => { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }); + afterAll(() => { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }); + it('assertContain', 0, () => { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + let a = 'abc'; + let b = 'b'; + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b); + expect(a).assertEqual(a); + }); + }); +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/hvigor/hvigor-config.json5 b/test/native/USBTestDemoNew/USBTestApp/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..e0bd0d82696bcd6337fc106180834b6a9ac56a5d --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/hvigor/hvigor-config.json5 @@ -0,0 +1,22 @@ +{ + "modelVersion": "5.0.0", + "dependencies": { + }, + "execution": { + // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */ + // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */ + // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */ + // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */ + }, + "nodeOptions": { + // "maxOldSpaceSize": 8192 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/ + // "exposeGC": true /* Enable to trigger garbage collection explicitly. Default: true*/ + } +} diff --git a/test/native/USBTestDemoNew/USBTestApp/hvigorfile.ts b/test/native/USBTestDemoNew/USBTestApp/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3cb9f1a87a81687554a76283af8df27d8bda775 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/hvigorfile.ts @@ -0,0 +1,6 @@ +import { appTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/test/native/USBTestDemoNew/USBTestApp/oh-package-lock.json5 b/test/native/USBTestDemoNew/USBTestApp/oh-package-lock.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7881b4786a345baa51093806bef721c04732cfcc --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/oh-package-lock.json5 @@ -0,0 +1,27 @@ +{ + "meta": { + "stableOrder": true + }, + "lockfileVersion": 3, + "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", + "specifiers": { + "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", + "@ohos/hypium@1.0.19": "@ohos/hypium@1.0.19" + }, + "packages": { + "@ohos/hamock@1.0.0": { + "name": "@ohos/hamock", + "version": "1.0.0", + "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", + "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hamock/-/hamock-1.0.0.har", + "registryType": "ohpm" + }, + "@ohos/hypium@1.0.19": { + "name": "@ohos/hypium", + "version": "1.0.19", + "integrity": "sha512-cEjDgLFCm3cWZDeRXk7agBUkPqjWxUo6AQeiu0gEkb3J8ESqlduQLSIXeo3cCsm8U/asL7iKjF85ZyOuufAGSQ==", + "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.19.har", + "registryType": "ohpm" + } + } +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/USBTestApp/oh-package.json5 b/test/native/USBTestDemoNew/USBTestApp/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..dd6b0d408799801607b2f5b3256b2a4969d90e02 --- /dev/null +++ b/test/native/USBTestDemoNew/USBTestApp/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.19", + "@ohos/hamock": "1.0.0" + } +} diff --git a/test/native/USBTestDemoNew/signature/@install.bat b/test/native/USBTestDemoNew/signature/@install.bat new file mode 100644 index 0000000000000000000000000000000000000000..0d9fdad6ddc6b9a180f27b3b3a1a390e28aa528f --- /dev/null +++ b/test/native/USBTestDemoNew/signature/@install.bat @@ -0,0 +1,4 @@ + +hdc install E:\OpenHarmony\Usb\Code\USB_TestApp\signature\usb_testApp_1.0.hap + +pause \ No newline at end of file diff --git a/test/native/USBTestDemoNew/signature/OpenHarmony.p12 b/test/native/USBTestDemoNew/signature/OpenHarmony.p12 new file mode 100644 index 0000000000000000000000000000000000000000..60f9bb48e677960e9dd7257e9f55c80915417ecf Binary files /dev/null and b/test/native/USBTestDemoNew/signature/OpenHarmony.p12 differ diff --git a/test/native/USBTestDemoNew/signature/OpenHarmonyApplication.pem b/test/native/USBTestDemoNew/signature/OpenHarmonyApplication.pem new file mode 100644 index 0000000000000000000000000000000000000000..825abdc7bcc5f019625e6a438074375a8e891d14 --- /dev/null +++ b/test/native/USBTestDemoNew/signature/OpenHarmonyApplication.pem @@ -0,0 +1,44 @@ +-----BEGIN CERTIFICATE----- +MIICRDCCAcmgAwIBAgIED+E4izAMBggqhkjOPQQDAwUAMGgxCzAJBgNVBAYTAkNO +MRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh +bTEoMCYGA1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTAeFw0y +MTAyMDIxMjE0MThaFw00OTEyMzExMjE0MThaMGgxCzAJBgNVBAYTAkNOMRQwEgYD +VQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVhbTEoMCYG +A1UEAxMfT3Blbkhhcm1v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diff --git a/test/native/USBTestDemoNew/signature/OpenHarmonyProfileDebug.pem b/test/native/USBTestDemoNew/signature/OpenHarmonyProfileDebug.pem new file mode 100644 index 0000000000000000000000000000000000000000..3bccf71913116eaad7775be916d8d1e4f6d8e32b --- /dev/null +++ b/test/native/USBTestDemoNew/signature/OpenHarmonyProfileDebug.pem @@ -0,0 +1,44 @@ +-----BEGIN CERTIFICATE----- +MIICRDCCAcmgAwIBAgIED+E4izAMBggqhkjOPQQDAwUAMGgxCzAJBgNVBAYTAkNO +MRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh +bTEoMCYGA1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTAeFw0y +MTAyMDIxMjE0MThaFw00OTEyMzExMjE0MThaMGgxCzAJBgNVBAYTAkNOMRQwEgYD +VQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVhbTEoMCYG +A1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTB2MBAGByqGSM49 +AgEGBSuBBAAiA2IABE023XmRaw2DnO8NSsb+KG/uY0FtS3u5LQucdr3qWVnRW5ui +QIL6ttNZBEeLTUeYcJZCpayg9Llf+1SmDA7dY4iP2EcRo4UN3rilovtfFfsmH4ty +3SApHVFzWUl+NwdH8KNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFBc6EKGrGXzlAE+s0Zgnsphadw7NMAwGCCqGSM49BAMDBQAD +ZwAwZAIwd1p3JzHN93eoPped1li0j64npgqNzwy4OrkehYAqNXpcpaEcLZ7UxW8E +I2lZJ3SbAjAkqySHb12sIwdSFKSN9KCMMEo/eUT5dUXlcKR2nZz0MJdxT5F51qcX +1CumzkcYhgU= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICYTCCAeWgAwIBAgIEHmXAP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jMxMTIyMTI1WjBuMQswCQYDVQQGEwJDTjEUMBIGA1UEChML +T3Blbkhhcm1vbnkxGTAXBgNVBAsTEE9wZW5IYXJtb255IFRlYW0xLjAsBgNVBAMT +JU9wZW5IYXJtb255IEFwcGxpY2F0aW9uIFByb2ZpbGUgRGVidWcwWTATBgcqhkjO +PQIBBggqhkjOPQMBBwNCAATZNH/LPiyU8ar4uBIFyi40yCUTX1nqsXExvaDVHkC+ +ZZT+6D+gVK+Dxz1fH0lCt1IgTAxQBd0OVTM9i+PJIE3ao1IwUDAfBgNVHSMEGDAW +gBTbhrciFtULoUu33SV7ufEFfaItRzAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0OBBYE +FFQ8O5FRWjHrsdwhrA15sSEVovdyMAwGCCqGSM49BAMDBQADZwAwZAIweioYr8UT +KDiyo2PQPHqgsyVsNPVk9kZaC9yrpIawN+55fevOXzFiuGP0IjCLhCFSAjA+69aB +La2cynFQtEOk59rSD5v0ZHIgzJX4L+ROAumr/qt1O14yWTJA7jzZuHPIT3c= +-----END CERTIFICATE----- diff --git a/test/native/USBTestDemoNew/signature/OpenHarmonyProfileRelease.pem b/test/native/USBTestDemoNew/signature/OpenHarmonyProfileRelease.pem new file mode 100644 index 0000000000000000000000000000000000000000..129a1378fa2301a3eeea6cf356ecf8841e8909f0 --- /dev/null +++ b/test/native/USBTestDemoNew/signature/OpenHarmonyProfileRelease.pem @@ -0,0 +1,44 @@ +-----BEGIN CERTIFICATE----- +MIICRDCCAcmgAwIBAgIED+E4izAMBggqhkjOPQQDAwUAMGgxCzAJBgNVBAYTAkNO +MRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh +bTEoMCYGA1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTAeFw0y +MTAyMDIxMjE0MThaFw00OTEyMzExMjE0MThaMGgxCzAJBgNVBAYTAkNOMRQwEgYD +VQQKEwtPcGVuSGF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qdAjEA +oIZqet/+DDpB7CRdTAUhisGmgE8w3ETgiibdUhrAAUOo6SSzozUQeKn+c37l5A+z +-----END CERTIFICATE----- diff --git a/test/native/USBTestDemoNew/signature/README_ZH.md b/test/native/USBTestDemoNew/signature/README_ZH.md new file mode 100644 index 0000000000000000000000000000000000000000..ebd49f9557dcb5f9b622b2110bb5952c180f7024 --- /dev/null +++ b/test/native/USBTestDemoNew/signature/README_ZH.md @@ -0,0 +1,24 @@ +签名二进制hap-sign-tool.jar预编译工具说明 +==================================================== + +1. 本地配置Gradle环境,要求Gradle7.1以上,查看版本命令如下: + +``` +gradle -v +``` + +2. 构建指导 +------------------ + +``` +# 获取代码 +git clone https://gitee.com/openharmony/developtools_hapsigner.git + +# 进入路径developtools_hapsigner/hapsigntool +cd developtools_hapsigner/hapsigntool + +# 编译签名工具 +gradle build 或者 gradle jar + +# 编译后二进制文件位置: ./hap_sign_tool/build/libs/hap-sign-tool.jar +``` \ No newline at end of file diff --git a/test/native/USBTestDemoNew/signature/SgnedReleaseProfileTemplate.p7b b/test/native/USBTestDemoNew/signature/SgnedReleaseProfileTemplate.p7b new file mode 100644 index 0000000000000000000000000000000000000000..af377d495857f9f72e016690df3320cb26682190 Binary files /dev/null and b/test/native/USBTestDemoNew/signature/SgnedReleaseProfileTemplate.p7b differ diff --git a/test/native/USBTestDemoNew/signature/UnsgnedDebugProfileTemplate.json b/test/native/USBTestDemoNew/signature/UnsgnedDebugProfileTemplate.json new file mode 100644 index 0000000000000000000000000000000000000000..1860b8bd5bb3ef3c21338ea6ce7075efd968815a --- /dev/null +++ b/test/native/USBTestDemoNew/signature/UnsgnedDebugProfileTemplate.json @@ -0,0 +1,35 @@ +{ + "version-name": "2.0.0", + "version-code": 2, + "uuid": "fe686e1b-3770-4824-a938-961b140a7c98", + "validity": { + "not-before": 1610519532, + "not-after": 1705127532 + }, + "type": "debug", + "bundle-info": { + "developer-id": "OpenHarmony", + "development-certificate": "-----BEGIN CERTIFICATE-----\nMIICMzCCAbegAwIBAgIEaOC/zDAMBggqhkjOPQQDAwUAMGMxCzAJBgNVBAYTAkNO\nMRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh\nbTEjMCEGA1UEAxMaT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gQ0EwHhcNMjEwMjAy\nMTIxOTMxWhcNNDkxMjMxMTIxOTMxWjBoMQswCQYDVQQGEwJDTjEUMBIGA1UEChML\nT3Blbkhhcm1vbnkxGTAXBgNVBAsTEE9wZW5IYXJtb255IFRlYW0xKDAmBgNVBAMT\nH09wZW5IYXJtb255IEFwcGxpY2F0aW9uIFJlbGVhc2UwWTATBgcqhkjOPQIBBggq\nhkjOPQMBBwNCAATbYOCQQpW5fdkYHN45v0X3AHax12jPBdEDosFRIZ1eXmxOYzSG\nJwMfsHhUU90E8lI0TXYZnNmgM1sovubeQqATo1IwUDAfBgNVHSMEGDAWgBTbhrci\nFtULoUu33SV7ufEFfaItRzAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0OBBYEFPtxruhl\ncRBQsJdwcZqLu9oNUVgaMAwGCCqGSM49BAMDBQADaAAwZQIxAJta0PQ2p4DIu/ps\nLMdLCDgQ5UH1l0B4PGhBlMgdi2zf8nk9spazEQI/0XNwpft8QAIwHSuA2WelVi/o\nzAlF08DnbJrOOtOnQq5wHOPlDYB4OtUzOYJk9scotrEnJxJzGsh/\n-----END CERTIFICATE-----\n", + "bundle-name": "com.OpenHarmony.app.test", + "apl": "normal", + "app-feature": "hos_normal_app" + }, + "acls": { + "allowed-acls": [ + "" + ] + }, + "permissions": { + "restricted-permissions": [ + "" + ] + }, + "debug-info": { + "device-ids": [ + "69C7505BE341BDA5948C3C0CB44ABCD530296054159EFE0BD16A16CD0129CC42", + "7EED06506FCE6325EB2E2FAA019458B856AB10493A6718C7679A73F958732865" + ], + "device-id-type": "udid" + }, + "issuer": "pki_internal" +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/signature/UnsgnedReleasedProfileTemplate.json b/test/native/USBTestDemoNew/signature/UnsgnedReleasedProfileTemplate.json new file mode 100644 index 0000000000000000000000000000000000000000..118883b9796e243da0186a22cc5f39ad15e4663d --- /dev/null +++ b/test/native/USBTestDemoNew/signature/UnsgnedReleasedProfileTemplate.json @@ -0,0 +1,27 @@ +{ + "version-name": "2.0.0", + "version-code": 2, + "app-distribution-type": "os_integration", + "uuid": "5027b99e-5f9e-465d-9508-a9e0134ffe18", + "validity": { + "not-before": 1594865258, + "not-after": 1689473258 + }, + "type": "release", + "bundle-info": { + "developer-id": "OpenHarmony", + "distribution-certificate": "-----BEGIN CERTIFICATE-----\nMIICMzCCAbegAwIBAgIEaOC/zDAMBggqhkjOPQQDAwUAMGMxCzAJBgNVBAYTAkNO\nMRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh\nbTEjMCEGA1UEAxMaT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gQ0EwHhcNMjEwMjAy\nMTIxOTMxWhcNNDkxMjMxMTIxOTMxWjBoMQswCQYDVQQGEwJDTjEUMBIGA1UEChML\nT3Blbkhhcm1vbnkxGTAXBgNVBAsTEE9wZW5IYXJtb255IFRlYW0xKDAmBgNVBAMT\nH09wZW5IYXJtb255IEFwcGxpY2F0aW9uIFJlbGVhc2UwWTATBgcqhkjOPQIBBggq\nhkjOPQMBBwNCAATbYOCQQpW5fdkYHN45v0X3AHax12jPBdEDosFRIZ1eXmxOYzSG\nJwMfsHhUU90E8lI0TXYZnNmgM1sovubeQqATo1IwUDAfBgNVHSMEGDAWgBTbhrci\nFtULoUu33SV7ufEFfaItRzAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0OBBYEFPtxruhl\ncRBQsJdwcZqLu9oNUVgaMAwGCCqGSM49BAMDBQADaAAwZQIxAJta0PQ2p4DIu/ps\nLMdLCDgQ5UH1l0B4PGhBlMgdi2zf8nk9spazEQI/0XNwpft8QAIwHSuA2WelVi/o\nzAlF08DnbJrOOtOnQq5wHOPlDYB4OtUzOYJk9scotrEnJxJzGsh/\n-----END CERTIFICATE-----\n", + "bundle-name": "ohos.samples.usb.test", + "apl": "normal", + "app-feature": "hos_system_app" + }, + "acls": { + "allowed-acls": [ + "ohos.permission.MANAGE_USB_CONFIG" + ] + }, + "permissions": { + "restricted-permissions": [] + }, + "issuer": "pki_internal" +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/signature/entry-default-unsigned.hap b/test/native/USBTestDemoNew/signature/entry-default-unsigned.hap new file mode 100644 index 0000000000000000000000000000000000000000..d2fd5a8cb1519f959d6dedb8d57fd179ad4f463b Binary files /dev/null and b/test/native/USBTestDemoNew/signature/entry-default-unsigned.hap differ diff --git a/test/native/USBTestDemoNew/signature/hap-sign-tool.jar b/test/native/USBTestDemoNew/signature/hap-sign-tool.jar new file mode 100644 index 0000000000000000000000000000000000000000..7fdf3daeea9364bed640271de11a89a2fcd23f25 Binary files /dev/null and b/test/native/USBTestDemoNew/signature/hap-sign-tool.jar differ diff --git a/test/native/USBTestDemoNew/signature/push.bat b/test/native/USBTestDemoNew/signature/push.bat new file mode 100644 index 0000000000000000000000000000000000000000..d1de940d657593c47e66d4f7826f1c036e8e4fea --- /dev/null +++ b/test/native/USBTestDemoNew/signature/push.bat @@ -0,0 +1,2 @@ +hdc shell mount -o rw,remount / +hdc file send share_picker_dialog.hap /system/app/com.ohos.sharepickerdialog/ \ No newline at end of file diff --git a/test/native/USBTestDemoNew/signature/release.cer b/test/native/USBTestDemoNew/signature/release.cer new file mode 100644 index 0000000000000000000000000000000000000000..b0e958a64718e915e93717767e7c097f0b50adf0 --- /dev/null +++ b/test/native/USBTestDemoNew/signature/release.cer @@ -0,0 +1,3 @@ +-----BEGIN CERTIFICATE----- +MIICMzCCAbegAwIBAgIEaOC/zDAMBggqhkjOPQQDAwUAMGMxCzAJBgNVBAYTAkNO\nMRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh\nbTEjMCEGA1UEAxMaT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gQ0EwHhcNMjEwMjAy\nMTIxOTMxWhcNNDkxMjMxMTIxOTMxWjBoMQswCQYDVQQGEwJDTjEUMBIGA1UEChML\nT3Blbkhhcm1vbnkxGTAXBgNVBAsTEE9wZW5IYXJtb255IFRlYW0xKDAmBgNVBAMT\nH09wZW5IYXJtb255IEFwcGxpY2F0aW9uIFJlbGVhc2UwWTATBgcqhkjOPQIBBggq\nhkjOPQMBBwNCAATbYOCQQpW5fdkYHN45v0X3AHax12jPBdEDosFRIZ1eXmxOYzSG\nJwMfsHhUU90E8lI0TXYZnNmgM1sovubeQqATo1IwUDAfBgNVHSMEGDAWgBTbhrci\nFtULoUu33SV7ufEFfaItRzAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0OBBYEFPtxruhl\ncRBQsJdwcZqLu9oNUVgaMAwGCCqGSM49BAMDBQADaAAwZQIxAJta0PQ2p4DIu/ps\nLMdLCDgQ5UH1l0B4PGhBlMgdi2zf8nk9spazEQI/0XNwpft8QAIwHSuA2WelVi/o\nzAlF08DnbJrOOtOnQq5wHOPlDYB4OtUzOYJk9scotrEnJxJzGsh/ +-----END CERTIFICATE----- diff --git a/test/native/USBTestDemoNew/signature/sign_hap.bat b/test/native/USBTestDemoNew/signature/sign_hap.bat new file mode 100644 index 0000000000000000000000000000000000000000..06f3fc3c8c98e7c1aec4a8f25da772e5b22a5a1f --- /dev/null +++ b/test/native/USBTestDemoNew/signature/sign_hap.bat @@ -0,0 +1,2 @@ +java -jar hap-sign-tool.jar sign-app -keyAlias "openharmony application release" -signAlg "SHA256withECDSA" -mode "localSign" -appCertFile "OpenHarmonyApplication.pem" -profileFile "SgnedReleaseProfileTemplate.p7b" -inFile "entry-default-unsigned.hap" -keystoreFile "OpenHarmony.p12" -outFile "usb_testApp_1.0.hap" -keyPwd "123456" -keystorePwd "123456" +pause \ No newline at end of file diff --git a/test/native/USBTestDemoNew/signature/sign_profile.bat b/test/native/USBTestDemoNew/signature/sign_profile.bat new file mode 100644 index 0000000000000000000000000000000000000000..faf88813f32180c048087572de1749233b5794e2 --- /dev/null +++ b/test/native/USBTestDemoNew/signature/sign_profile.bat @@ -0,0 +1 @@ +java -jar hap-sign-tool.jar sign-profile -keyAlias "openharmony application profile release" -signAlg "SHA256withECDSA" -mode "localSign" -profileCertFile "OpenHarmonyProfileRelease.pem" -inFile "UnsgnedReleasedProfileTemplate.json" -keystoreFile "OpenHarmony.p12" -outFile "SgnedReleaseProfileTemplate.p7b" -keyPwd "123456" -keystorePwd "123456" \ No newline at end of file diff --git a/test/native/USBTestDemoNew/signature/usb_testApp_1.0.hap b/test/native/USBTestDemoNew/signature/usb_testApp_1.0.hap new file mode 100644 index 0000000000000000000000000000000000000000..38e429bc527662154f934468760fddebfd7dfa31 Binary files /dev/null and b/test/native/USBTestDemoNew/signature/usb_testApp_1.0.hap differ diff --git a/test/native/USBTestDemoNew/signature_normal/@install.bat b/test/native/USBTestDemoNew/signature_normal/@install.bat new file mode 100644 index 0000000000000000000000000000000000000000..480644b30cc91c0ca6d0b12fd0aaaf8460c04e64 --- /dev/null +++ b/test/native/USBTestDemoNew/signature_normal/@install.bat @@ -0,0 +1,4 @@ + +hdc install E:\OpenHarmony\Usb\Code\USB_TestApp\signature_normal\usb_testNormalApp_1.0.hap + +pause \ No newline at end of file diff --git a/test/native/USBTestDemoNew/signature_normal/OpenHarmony.p12 b/test/native/USBTestDemoNew/signature_normal/OpenHarmony.p12 new file mode 100644 index 0000000000000000000000000000000000000000..60f9bb48e677960e9dd7257e9f55c80915417ecf Binary files /dev/null and b/test/native/USBTestDemoNew/signature_normal/OpenHarmony.p12 differ diff --git a/test/native/USBTestDemoNew/signature_normal/OpenHarmonyApplication.pem b/test/native/USBTestDemoNew/signature_normal/OpenHarmonyApplication.pem new file mode 100644 index 0000000000000000000000000000000000000000..825abdc7bcc5f019625e6a438074375a8e891d14 --- /dev/null +++ b/test/native/USBTestDemoNew/signature_normal/OpenHarmonyApplication.pem @@ -0,0 +1,44 @@ +-----BEGIN CERTIFICATE----- +MIICRDCCAcmgAwIBAgIED+E4izAMBggqhkjOPQQDAwUAMGgxCzAJBgNVBAYTAkNO +MRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh +bTEoMCYGA1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTAeFw0y +MTAyMDIxMjE0MThaFw00OTEyMzExMjE0MThaMGgxCzAJBgNVBAYTAkNOMRQwEgYD +VQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVhbTEoMCYG +A1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTB2MBAGByqGSM49 +AgEGBSuBBAAiA2IABE023XmRaw2DnO8NSsb+KG/uY0FtS3u5LQucdr3qWVnRW5ui +QIL6ttNZBEeLTUeYcJZCpayg9Llf+1SmDA7dY4iP2EcRo4UN3rilovtfFfsmH4ty +3SApHVFzWUl+NwdH8KNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFBc6EKGrGXzlAE+s0Zgnsphadw7NMAwGCCqGSM49BAMDBQAD +ZwAwZAIwd1p3JzHN93eoPped1li0j64npgqNzwy4OrkehYAqNXpcpaEcLZ7UxW8E +I2lZJ3SbAjAkqySHb12sIwdSFKSN9KCMMEo/eUT5dUXlcKR2nZz0MJdxT5F51qcX +1CumzkcYhgU= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICYTCCAeWgAwIBAgIEHmXAPTAMBggqhkjOPQQDAwUAMGgxCzAJBgNVBAYTAkNO +MRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh +bTEoMCYGA1UEAxMfT3Blbkhhcm1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Y2F0aW9uIFJlbGVhc2UwWTATBgcqhkjOPQIBBggq +hkjOPQMBBwNCAATbYOCQQpW5fdkYHN45v0X3AHax12jPBdEDosFRIZ1eXmxOYzSG +JwMfsHhUU90E8lI0TXYZnNmgM1sovubeQqATo1IwUDAfBgNVHSMEGDAWgBTbhrci +FtULoUu33SV7ufEFfaItRzAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0OBBYEFPtxruhl +cRBQsJdwcZqLu9oNUVgaMAwGCCqGSM49BAMDBQADaAAwZQIxAJta0PQ2p4DIu/ps +LMdLCDgQ5UH1l0B4PGhBlMgdi2zf8nk9spazEQI/0XNwpft8QAIwHSuA2WelVi/o +zAlF08DnbJrOOtOnQq5wHOPlDYB4OtUzOYJk9scotrEnJxJzGsh/ +-----END CERTIFICATE----- diff --git a/test/native/USBTestDemoNew/signature_normal/OpenHarmonyProfileDebug.pem b/test/native/USBTestDemoNew/signature_normal/OpenHarmonyProfileDebug.pem new file mode 100644 index 0000000000000000000000000000000000000000..3bccf71913116eaad7775be916d8d1e4f6d8e32b --- /dev/null +++ b/test/native/USBTestDemoNew/signature_normal/OpenHarmonyProfileDebug.pem @@ -0,0 +1,44 @@ +-----BEGIN CERTIFICATE----- +MIICRDCCAcmgAwIBAgIED+E4izAMBggqhkjOPQQDAwUAMGgxCzAJBgNVBAYTAkNO +MRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh +bTEoMCYGA1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTAeFw0y +MTAyMDIxMjE0MThaFw00OTEyMzExMjE0MThaMGgxCzAJBgNVBAYTAkNOMRQwEgYD +VQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVhbTEoMCYG +A1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTB2MBAGByqGSM49 +AgEGBSuBBAAiA2IABE023XmRa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tUL +oUu33SV7ufEFfaItRzAMBggqhkjOPQQDAwUAA2gAMGUCMG3cXjiDmXTvf7D4Omhf +qcc2nuO+EMfWE+N9ZhBP5UhV34mAGWi3SfLU6rcV0urWEQIxAMYIb3epOnKhUrcm +Lfu1WKzFlpYQwmw73RaCHP2I3k6NcuWOYeNwWXSNZ8o0nzvaLg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICODCCAb2gAwIBAgIEFKYJUDAMBggqhkjOPQQDAwUAMGMxCzAJBgNVBAYTAkNO +MRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh +bTEjMCEGA1UEAxMaT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gQ0EwHhcNMjEwMjAy +MTIyMTI1WhcNNDkxMjMxMTIyMTI1WjBuMQswCQYDVQQGEwJDTjEUMBIGA1UEChML +T3Blbkhhcm1vbnkxGTAXBgNVBAsTEE9wZW5IYXJtb255IFRlYW0xLjAsBgNVBAMT +JU9wZW5IYXJtb255IEFwcGxpY2F0aW9uIFByb2ZpbGUgRGVidWcwWTATBgcqhkjO +PQIBBggqhkjOPQMBBwNCAATZNH/LPiyU8ar4uBIFyi40yCUTX1nqsXExvaDVHkC+ +ZZT+6D+gVK+Dxz1fH0lCt1IgTAxQBd0OVTM9i+PJIE3ao1IwUDAfBgNVHSMEGDAW +gBTbhrciFtULoUu33SV7ufEFfaItRzAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0OBBYE +FFQ8O5FRWjHrsdwhrA15sSEVovdyMAwGCCqGSM49BAMDBQADZwAwZAIweioYr8UT +KDiyo2PQPHqgsyVsNPVk9kZaC9yrpIawN+55fevOXzFiuGP0IjCLhCFSAjA+69aB +La2cynFQtEOk59rSD5v0ZHIgzJX4L+ROAumr/qt1O14yWTJA7jzZuHPIT3c= +-----END CERTIFICATE----- diff --git a/test/native/USBTestDemoNew/signature_normal/OpenHarmonyProfileRelease.pem b/test/native/USBTestDemoNew/signature_normal/OpenHarmonyProfileRelease.pem new file mode 100644 index 0000000000000000000000000000000000000000..129a1378fa2301a3eeea6cf356ecf8841e8909f0 --- /dev/null +++ b/test/native/USBTestDemoNew/signature_normal/OpenHarmonyProfileRelease.pem @@ -0,0 +1,44 @@ +-----BEGIN CERTIFICATE----- +MIICRDCCAcmgAwIBAgIED+E4izAMBggqhkjOPQQDAwUAMGgxCzAJBgNVBAYTAkNO +MRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh +bTEoMCYGA1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTAeFw0y +MTAyMDIxMjE0MThaFw00OTEyMzExMjE0MThaMGgxCzAJBgNVBAYTAkNOMRQwEgYD +VQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVhbTEoMCYG +A1UEAxMfT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gUm9vdCBDQTB2MBAGByqGSM49 +AgEGBSuBBAAiA2IABE023XmRaw2DnO8NSsb+KG/uY0FtS3u5LQucdr3qWVnRW5ui +QIL6ttNZBEeLTUeYcJZCpayg9Llf+1SmDA7dY4iP2EcRo4UN3rilovtfFfsmH4ty +3SApHVFzWUl+NwdH8KNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFBc6EKGrGXzlAE+s0Zgnsphadw7NMAwGCCqGSM49BAMDBQAD +ZwAwZAIwd1p3JzHN93eoPped1li0j64npgqNzwy4OrkehYAqNXpcpaEcLZ7UxW8E +I2lZJ3SbAjAkqySHb12sIwdSFKSN9KCMMEo/eUT5dUXlcKR2nZz0MJdxT5F51qcX +1CumzkcYhgU= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICYTCCAeWgAwIBAgIEHmXAPTAMBggqhkjOPQQDAwUAMGgxCzAJBgNVBAYTAkNO +MRQw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ChML +T3Blbkhhcm1vbnkxGTAXBgNVBAsTEE9wZW5IYXJtb255IFRlYW0xMDAuBgNVBAMT +J09wZW5IYXJtb255IEFwcGxpY2F0aW9uIFByb2ZpbGUgUmVsZWFzZTBZMBMGByqG +SM49AgEGCCqGSM49AwEHA0IABFfPAuu5prLiQXG+FcmSKJqtRjeDDZgfAeitKsSM +3tzhHk2oN/UD0vHGbgIrVD8fv8igUZEJFsOTNM4DbovGGJqjUjBQMB8GA1UdIwQY +MBaAFNuGtyIW1QuhS7fdJXu58QV9oi1HMA4GA1UdDwEB/wQEAwIHgDAdBgNVHQ4E +FgQUy2Hpvad6TtTPlbOE7AX99l8NAVIwDAYIKoZIzj0EAwMFAANpADBmAjEArI6u +CYJiea5IJBFC7JBluWgGshKdEHdGPv3sopi34kKPZNxm9eGn9OGNBjZg/qqdAjEA +oIZqet/+DDpB7CRdTAUhisGmgE8w3ETgiibdUhrAAUOo6SSzozUQeKn+c37l5A+z +-----END CERTIFICATE----- diff --git a/test/native/USBTestDemoNew/signature_normal/README_ZH.md b/test/native/USBTestDemoNew/signature_normal/README_ZH.md new file mode 100644 index 0000000000000000000000000000000000000000..ebd49f9557dcb5f9b622b2110bb5952c180f7024 --- /dev/null +++ b/test/native/USBTestDemoNew/signature_normal/README_ZH.md @@ -0,0 +1,24 @@ +签名二进制hap-sign-tool.jar预编译工具说明 +==================================================== + +1. 本地配置Gradle环境,要求Gradle7.1以上,查看版本命令如下: + +``` +gradle -v +``` + +2. 构建指导 +------------------ + +``` +# 获取代码 +git clone https://gitee.com/openharmony/developtools_hapsigner.git + +# 进入路径developtools_hapsigner/hapsigntool +cd developtools_hapsigner/hapsigntool + +# 编译签名工具 +gradle build 或者 gradle jar + +# 编译后二进制文件位置: ./hap_sign_tool/build/libs/hap-sign-tool.jar +``` \ No newline at end of file diff --git a/test/native/USBTestDemoNew/signature_normal/SgnedReleaseProfileTemplate.p7b b/test/native/USBTestDemoNew/signature_normal/SgnedReleaseProfileTemplate.p7b new file mode 100644 index 0000000000000000000000000000000000000000..e0f1c90c44e8740034a90c23295dc8691ad0346f Binary files /dev/null and b/test/native/USBTestDemoNew/signature_normal/SgnedReleaseProfileTemplate.p7b differ diff --git a/test/native/USBTestDemoNew/signature_normal/UnsgnedDebugProfileTemplate.json b/test/native/USBTestDemoNew/signature_normal/UnsgnedDebugProfileTemplate.json new file mode 100644 index 0000000000000000000000000000000000000000..b5d7a9c38171155f7b9d90469767a187eadae0d8 --- /dev/null +++ b/test/native/USBTestDemoNew/signature_normal/UnsgnedDebugProfileTemplate.json @@ -0,0 +1,35 @@ +{ + "version-name": "2.0.0", + "version-code": 2, + "uuid": "fe686e1b-3770-4824-a938-961b140a7c98", + "validity": { + "not-before": 1610519532, + "not-after": 1705127532 + }, + "type": "debug", + "bundle-info": { + "developer-id": "OpenHarmony", + "development-certificate": "-----BEGIN CERTIFICATE-----\nMIICMzCCAbegAwIBAgIEaOC/zDAMBggqhkjOPQQDAwUAMGMxCzAJBgNVBAYTAkNO\nMRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh\nbTEjMCEGA1UEAxMaT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gQ0EwHhcNMjEwMjAy\nMTIxOTMxWhcNNDkxMjMxMTIxOTMxWjBoMQswCQYDVQQGEwJDTjEUMBIGA1UEChML\nT3Blbkhhcm1vbnkxGTAXBgNVBAsTEE9wZW5IYXJtb255IFRlYW0xKDAmBgNVBAMT\nH09wZW5IYXJtb255IEFwcGxpY2F0aW9uIFJlbGVhc2UwWTATBgcqhkjOPQIBBggq\nhkjOPQMBBwNCAATbYOCQQpW5fdkYHN45v0X3AHax12jPBdEDosFRIZ1eXmxOYzSG\nJwMfsHhUU90E8lI0TXYZnNmgM1sovubeQqATo1IwUDAfBgNVHSMEGDAWgBTbhrci\nFtULoUu33SV7ufEFfaItRzAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0OBBYEFPtxruhl\ncRBQsJdwcZqLu9oNUVgaMAwGCCqGSM49BAMDBQADaAAwZQIxAJta0PQ2p4DIu/ps\nLMdLCDgQ5UH1l0B4PGhBlMgdi2zf8nk9spazEQI/0XNwpft8QAIwHSuA2WelVi/o\nzAlF08DnbJrOOtOnQq5wHOPlDYB4OtUzOYJk9scotrEnJxJzGsh/\n-----END CERTIFICATE-----\n", + "bundle-name": "com.OpenHarmony.app.test", + "apl": "normal", + "app-feature": "hos_system_app" + }, + "acls": { + "allowed-acls": [ + "" + ] + }, + "permissions": { + "restricted-permissions": [ + "" + ] + }, + "debug-info": { + "device-ids": [ + "69C7505BE341BDA5948C3C0CB44ABCD530296054159EFE0BD16A16CD0129CC42", + "7EED06506FCE6325EB2E2FAA019458B856AB10493A6718C7679A73F958732865" + ], + "device-id-type": "udid" + }, + "issuer": "pki_internal" +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/signature_normal/UnsgnedReleasedProfileTemplate.json b/test/native/USBTestDemoNew/signature_normal/UnsgnedReleasedProfileTemplate.json new file mode 100644 index 0000000000000000000000000000000000000000..74801881e6aec84f52a36595ddbdc68fb2ddca9e --- /dev/null +++ b/test/native/USBTestDemoNew/signature_normal/UnsgnedReleasedProfileTemplate.json @@ -0,0 +1,27 @@ +{ + "version-name": "2.0.0", + "version-code": 2, + "app-distribution-type": "os_integration", + "uuid": "5027b99e-5f9e-465d-9508-a9e0134ffe18", + "validity": { + "not-before": 1594865258, + "not-after": 1689473258 + }, + "type": "release", + "bundle-info": { + "developer-id": "OpenHarmony", + "distribution-certificate": "-----BEGIN CERTIFICATE-----\nMIICMzCCAbegAwIBAgIEaOC/zDAMBggqhkjOPQQDAwUAMGMxCzAJBgNVBAYTAkNO\nMRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh\nbTEjMCEGA1UEAxMaT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gQ0EwHhcNMjEwMjAy\nMTIxOTMxWhcNNDkxMjMxMTIxOTMxWjBoMQswCQYDVQQGEwJDTjEUMBIGA1UEChML\nT3Blbkhhcm1vbnkxGTAXBgNVBAsTEE9wZW5IYXJtb255IFRlYW0xKDAmBgNVBAMT\nH09wZW5IYXJtb255IEFwcGxpY2F0aW9uIFJlbGVhc2UwWTATBgcqhkjOPQIBBggq\nhkjOPQMBBwNCAATbYOCQQpW5fdkYHN45v0X3AHax12jPBdEDosFRIZ1eXmxOYzSG\nJwMfsHhUU90E8lI0TXYZnNmgM1sovubeQqATo1IwUDAfBgNVHSMEGDAWgBTbhrci\nFtULoUu33SV7ufEFfaItRzAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0OBBYEFPtxruhl\ncRBQsJdwcZqLu9oNUVgaMAwGCCqGSM49BAMDBQADaAAwZQIxAJta0PQ2p4DIu/ps\nLMdLCDgQ5UH1l0B4PGhBlMgdi2zf8nk9spazEQI/0XNwpft8QAIwHSuA2WelVi/o\nzAlF08DnbJrOOtOnQq5wHOPlDYB4OtUzOYJk9scotrEnJxJzGsh/\n-----END CERTIFICATE-----\n", + "bundle-name": "ohos.samples.usb.normal.test", + "apl": "normal", + "app-feature": "hos_normal_app" + }, + "acls": { + "allowed-acls": [ + "" + ] + }, + "permissions": { + "restricted-permissions": [] + }, + "issuer": "pki_internal" +} \ No newline at end of file diff --git a/test/native/USBTestDemoNew/signature_normal/entry-default-unsigned.hap b/test/native/USBTestDemoNew/signature_normal/entry-default-unsigned.hap new file mode 100644 index 0000000000000000000000000000000000000000..08f9f8aa138ee566d6b654afb66c661c34f87619 Binary files /dev/null and b/test/native/USBTestDemoNew/signature_normal/entry-default-unsigned.hap differ diff --git a/test/native/USBTestDemoNew/signature_normal/hap-sign-tool.jar b/test/native/USBTestDemoNew/signature_normal/hap-sign-tool.jar new file mode 100644 index 0000000000000000000000000000000000000000..7fdf3daeea9364bed640271de11a89a2fcd23f25 Binary files /dev/null and b/test/native/USBTestDemoNew/signature_normal/hap-sign-tool.jar differ diff --git a/test/native/USBTestDemoNew/signature_normal/push.bat b/test/native/USBTestDemoNew/signature_normal/push.bat new file mode 100644 index 0000000000000000000000000000000000000000..d1de940d657593c47e66d4f7826f1c036e8e4fea --- /dev/null +++ b/test/native/USBTestDemoNew/signature_normal/push.bat @@ -0,0 +1,2 @@ +hdc shell mount -o rw,remount / +hdc file send share_picker_dialog.hap /system/app/com.ohos.sharepickerdialog/ \ No newline at end of file diff --git a/test/native/USBTestDemoNew/signature_normal/release.cer b/test/native/USBTestDemoNew/signature_normal/release.cer new file mode 100644 index 0000000000000000000000000000000000000000..b0e958a64718e915e93717767e7c097f0b50adf0 --- /dev/null +++ b/test/native/USBTestDemoNew/signature_normal/release.cer @@ -0,0 +1,3 @@ +-----BEGIN CERTIFICATE----- +MIICMzCCAbegAwIBAgIEaOC/zDAMBggqhkjOPQQDAwUAMGMxCzAJBgNVBAYTAkNO\nMRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh\nbTEjMCEGA1UEAxMaT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gQ0EwHhcNMjEwMjAy\nMTIxOTMxWhcNNDkxMjMxMTIxOTMxWjBoMQswCQYDVQQGEwJDTjEUMBIGA1UEChML\nT3Blbkhhcm1vbnkxGTAXBgNVBAsTEE9wZW5IYXJtb255IFRlYW0xKDAmBgNVBAMT\nH09wZW5IYXJtb255IEFwcGxpY2F0aW9uIFJlbGVhc2UwWTATBgcqhkjOPQIBBggq\nhkjOPQMBBwNCAATbYOCQQpW5fdkYHN45v0X3AHax12jPBdEDosFRIZ1eXmxOYzSG\nJwMfsHhUU90E8lI0TXYZnNmgM1sovubeQqATo1IwUDAfBgNVHSMEGDAWgBTbhrci\nFtULoUu33SV7ufEFfaItRzAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0OBBYEFPtxruhl\ncRBQsJdwcZqLu9oNUVgaMAwGCCqGSM49BAMDBQADaAAwZQIxAJta0PQ2p4DIu/ps\nLMdLCDgQ5UH1l0B4PGhBlMgdi2zf8nk9spazEQI/0XNwpft8QAIwHSuA2WelVi/o\nzAlF08DnbJrOOtOnQq5wHOPlDYB4OtUzOYJk9scotrEnJxJzGsh/ +-----END CERTIFICATE----- diff --git a/test/native/USBTestDemoNew/signature_normal/sign_hap.bat b/test/native/USBTestDemoNew/signature_normal/sign_hap.bat new file mode 100644 index 0000000000000000000000000000000000000000..8d60e08b447152823e53fcf0e34410213388cc38 --- /dev/null +++ b/test/native/USBTestDemoNew/signature_normal/sign_hap.bat @@ -0,0 +1,2 @@ +java -jar hap-sign-tool.jar sign-app -keyAlias "openharmony application release" -signAlg "SHA256withECDSA" -mode "localSign" -appCertFile "OpenHarmonyApplication.pem" -profileFile "SgnedReleaseProfileTemplate.p7b" -inFile "entry-default-unsigned.hap" -keystoreFile "OpenHarmony.p12" -outFile "usb_testNormalApp_1.0.hap" -keyPwd "123456" -keystorePwd "123456" +pause \ No newline at end of file diff --git a/test/native/USBTestDemoNew/signature_normal/sign_profile.bat b/test/native/USBTestDemoNew/signature_normal/sign_profile.bat new file mode 100644 index 0000000000000000000000000000000000000000..faf88813f32180c048087572de1749233b5794e2 --- /dev/null +++ b/test/native/USBTestDemoNew/signature_normal/sign_profile.bat @@ -0,0 +1 @@ +java -jar hap-sign-tool.jar sign-profile -keyAlias "openharmony application profile release" -signAlg "SHA256withECDSA" -mode "localSign" -profileCertFile "OpenHarmonyProfileRelease.pem" -inFile "UnsgnedReleasedProfileTemplate.json" -keystoreFile "OpenHarmony.p12" -outFile "SgnedReleaseProfileTemplate.p7b" -keyPwd "123456" -keystorePwd "123456" \ No newline at end of file diff --git a/test/native/USBTestDemoNew/signature_normal/usb_testNormalApp_1.0.hap b/test/native/USBTestDemoNew/signature_normal/usb_testNormalApp_1.0.hap new file mode 100644 index 0000000000000000000000000000000000000000..2234c6e08390b724b42463dbf2368cf4e18b74c6 Binary files /dev/null and b/test/native/USBTestDemoNew/signature_normal/usb_testNormalApp_1.0.hap differ