diff --git a/LiteWearable/entry/src/main/config.json b/LiteWearable/entry/src/main/config.json index 84e6fbb15516304ac16e6a2922e67258b54ea9f7..c0b16ac154a22808f3ac5b585fd233571c21d073 100644 --- a/LiteWearable/entry/src/main/config.json +++ b/LiteWearable/entry/src/main/config.json @@ -1,7 +1,7 @@ -// Start 1 -// Start 2 +// [Start 1] +// [Start 2] { - // StartExclude 2 + // [StartExclude 2] "app": { "bundleName": "com.example.litewearable", "vendor": "example", @@ -11,7 +11,7 @@ } }, "deviceConfig": {}, - // EndExclude 2 + // [EndExclude 2] "module": { "deviceType": [ "liteWearable" @@ -21,7 +21,7 @@ "moduleName": "entry", "moduleType": "entry" }, - // StartExclude 1 + // [StartExclude 1] "distroFilter": { "screenShape": { "policy": "include", @@ -36,8 +36,8 @@ ] } }, - // EndExclude 1 - // StartExclude 2 + // [EndExclude 1] + // [StartExclude 2] "abilities": [ { "name": ".MainAbility", @@ -53,7 +53,7 @@ { "pages": [ "pages/index/index", - // StartExclude 1 + // [StartExclude 1] "initpage/initpage", "style1/style1", "style2/style2", @@ -66,13 +66,13 @@ "security/security", "cryptoFramework/cryptoFramework", "screenLock/screenLock" - // EndExclude 1 + // [EndExclude 1] ], "name": ".MainAbility" } ] - // EndExclude 2 + // [EndExclude 2] } } -// End 1 -// End 2 \ No newline at end of file +// [End 1] +// [End 2] \ No newline at end of file diff --git a/LiteWearable/entry/src/main/js/MainAbility/cryptoFramework/cryptoFramework.js b/LiteWearable/entry/src/main/js/MainAbility/cryptoFramework/cryptoFramework.js index 04ed2ee98dcd038ead13214177b2328a84680232..168cbfcffde083ade81f70de9e937a6cf12fc7fe 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/cryptoFramework/cryptoFramework.js +++ b/LiteWearable/entry/src/main/js/MainAbility/cryptoFramework/cryptoFramework.js @@ -1,6 +1,6 @@ -// Start 1 +// [Start 1] import cryptoFramework from '@ohos.security.cryptoFramework'; -// StartExclude 1 +// [StartExclude 1] export default { data: { title: "" @@ -9,7 +9,7 @@ export default { this.title = "Hello World"; } }; -// EndExclude 1 +// [EndExclude 1] function stringToUint8Array(str) { let arr = []; for (let i = 0, j = str.length; i < j; ++i) { @@ -52,8 +52,8 @@ function doMd() { } console.info(`md len: ${mdLen}`); } -// End 1 -// Start 2 +// [End 1] +// [Start 2] function doRand() { let rand; let ret = true; @@ -89,4 +89,4 @@ function doRand() { return 'doRand error'; } } -// End 2 \ No newline at end of file +// [End 2] \ No newline at end of file diff --git a/LiteWearable/entry/src/main/js/MainAbility/detail/detail.js b/LiteWearable/entry/src/main/js/MainAbility/detail/detail.js index d8c94efa804b6cd9e5993730817b5eb9b6dd14a9..b89e21b7e998e39ff7a8fd278e4dfccfee9c930b 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/detail/detail.js +++ b/LiteWearable/entry/src/main/js/MainAbility/detail/detail.js @@ -1,4 +1,4 @@ -// Start 1 +// [Start 1] // index.js import router from '@ohos.router'; @@ -9,4 +9,4 @@ export default { }); } }; -// End 1 \ No newline at end of file +// [End 1] \ No newline at end of file diff --git a/LiteWearable/entry/src/main/js/MainAbility/details/details.js b/LiteWearable/entry/src/main/js/MainAbility/details/details.js index abe03e6d58e9ed5ecce8c03babfda11569b47e6f..549561a218711b04c5345ac3d810c2d339d65f03 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/details/details.js +++ b/LiteWearable/entry/src/main/js/MainAbility/details/details.js @@ -1,4 +1,4 @@ -// Start 1 +// [Start 1] // details.js import router from '@ohos.router'; @@ -9,4 +9,4 @@ export default { }); } }; -// End 1 \ No newline at end of file +// [End 1] \ No newline at end of file diff --git a/LiteWearable/entry/src/main/js/MainAbility/event/event.js b/LiteWearable/entry/src/main/js/MainAbility/event/event.js index 1db6a24ce28535499928453b3e09fc40b2cc2c35..4417284f4cecb65e91a07af4d9a95738af6d938b 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/event/event.js +++ b/LiteWearable/entry/src/main/js/MainAbility/event/event.js @@ -1,4 +1,4 @@ -// Start 1 +// [Start 1] // index.js: export default { data: { @@ -10,4 +10,4 @@ export default { this.fontColor = '#FFFFFF'; } }; -// End 1 \ No newline at end of file +// [End 1] \ No newline at end of file diff --git a/LiteWearable/entry/src/main/js/MainAbility/exit/exit.js b/LiteWearable/entry/src/main/js/MainAbility/exit/exit.js index 83a2985d9057dc73f7331718c7346a8fc2c2e04f..955eca4135b757015f993ef2b95988f2108176ca 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/exit/exit.js +++ b/LiteWearable/entry/src/main/js/MainAbility/exit/exit.js @@ -1,4 +1,4 @@ -// Start 1 +// [Start 1] // index.js import router from '@ohos.router'; // 导入app模块 @@ -19,4 +19,4 @@ export default { } } }; -// End 1 \ No newline at end of file +// [End 1] \ No newline at end of file diff --git a/LiteWearable/entry/src/main/js/MainAbility/screenLock/screenLock.js b/LiteWearable/entry/src/main/js/MainAbility/screenLock/screenLock.js index 41374e8726168c153a8097f223f50d8606cb32d3..d2db0a6782cfa21424ab8ea66c96e51beec58660 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/screenLock/screenLock.js +++ b/LiteWearable/entry/src/main/js/MainAbility/screenLock/screenLock.js @@ -1,7 +1,7 @@ -// Start 1 +// [Start 1] import screenLock from '@ohos.screenLock'; -// StartExclude 1 +// [StartExclude 1] export default { data: { title: "" @@ -11,7 +11,7 @@ export default { } }; -// EndExclude 1 +// [EndExclude 1] function unlockScreen() { let result; @@ -25,8 +25,8 @@ function unlockScreen() { return result; } -// End 1 -// Start 2 +// [End 1] +// [Start 2] function isScreenLocked() { let isLocked = false; let result; @@ -40,8 +40,8 @@ function isScreenLocked() { }); return result; } -// End 2 -// Start 3 +// [End 2] +// [Start 3] function isSecureMode() { let result; let isSafety = false; @@ -55,4 +55,4 @@ function isSecureMode() { }); return result; } -// End 3 \ No newline at end of file +// [End 3] \ No newline at end of file diff --git a/LiteWearable/entry/src/main/js/MainAbility/security/DES.js b/LiteWearable/entry/src/main/js/MainAbility/security/DES.js index 25f4199188fb04d95a260a7eecf0b27bbb9e49fa..fc44510ee251bf228ac306d1ce9539d34e66f017 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/security/DES.js +++ b/LiteWearable/entry/src/main/js/MainAbility/security/DES.js @@ -1,11 +1,11 @@ -// Start 1 +// [Start 1] import huks from '@ohos.security.huks'; -// Start 2 -// Start 3 +// [Start 2] +// [Start 3] // 别名,用于区分生成的KEY const DES_CBC_64_KEY_ALIAS = 'DesCBC64KeyAlias'; -// StartExclude 1 +// [StartExclude 1] // 三段式句柄,用于连接三段式上下文 let handle; let IV = '12345678'; @@ -13,10 +13,10 @@ let IV = '12345678'; let plainText = 'DESAAAdffssghCBC5612345612345L64'; // 密文,存放加密后数据 let cipherText = ''; -// EndExclude 1 +// [EndExclude 1] -// StartExclude 2 -// StartExclude 3 +// [StartExclude 2] +// [StartExclude 3] // 配置生成密钥所需的Tag function getDesGenProperties() { let properties = new Array(); @@ -53,8 +53,8 @@ function generateDESKey() { }); return huksInfo; } -// EndExclude 2 -// End 1 +// [EndExclude 2] +// [End 1] function getDesCBCEncryptProperties() { let properties = new Array(); let index = 0; @@ -171,7 +171,7 @@ function encryptDES() { return huksInfo; } -// EndExclude 3 +// [EndExclude 3] function stringToUint8Array(str) { let arr = []; for (let i = 0, j = str.length; i < j; ++i) { @@ -189,7 +189,7 @@ function uint8ArrayToString(fileData) { return dataString; } -// End 2 +// [End 2] function GetDesCBCDecryptProperties() { let properties = new Array(); @@ -302,4 +302,4 @@ function decryptDES() { return huksInfo; } -// End 3 \ No newline at end of file +// [End 3] \ No newline at end of file diff --git a/LiteWearable/entry/src/main/js/MainAbility/security/DesCBC64.js b/LiteWearable/entry/src/main/js/MainAbility/security/DesCBC64.js index a0e942cb53a9a88c7dc3faa76b9dc71bf9693f9b..7e86aca71fa2773d8473f30aaea77063f9d2dd09 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/security/DesCBC64.js +++ b/LiteWearable/entry/src/main/js/MainAbility/security/DesCBC64.js @@ -1,9 +1,9 @@ -// Start 1 -// Start 2 +// [Start 1] +// [Start 2] import huks from '@ohos.security.huks'; const KEY_ALIAS = 'DesCBC64KeyAlias'; -// StartExclude 2 +// [StartExclude 2] function isKeyItemExist() { let huksInfo; let emptyOptions = { @@ -20,8 +20,8 @@ function isKeyItemExist() { return huksInfo; } -// End 1 -// EndExclude 2 +// [End 1] +// [EndExclude 2] function deleteKeyProcess() { let huksInfo; let emptyOptions = { @@ -36,4 +36,4 @@ function deleteKeyProcess() { }) return huksInfo; } -// End 2 \ No newline at end of file +// [End 2] \ No newline at end of file diff --git a/LiteWearable/entry/src/main/js/MainAbility/security/HMAC.js b/LiteWearable/entry/src/main/js/MainAbility/security/HMAC.js index e7e6fcb9cfd5294ccd650a9e937508309f447738..e10810251c785c477a378e974da9a848e7edcbda 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/security/HMAC.js +++ b/LiteWearable/entry/src/main/js/MainAbility/security/HMAC.js @@ -1,18 +1,18 @@ -// Start 1 -// Start 2 +// [Start 1] +// [Start 2] import huks from '@ohos.security.huks'; // HMACKeyAlias 别名,用于区分生成的KEY const HMAC_KEY_ALIAS = 'HMACKeyAlias'; -// StartExclude 1 +// [StartExclude 1] // 明文,加密前数据 let plainText = "HMACSAdffssghABC5612345612345192"; // 密文,存放加密后数据 let cipherText = ''; // 操作句柄 let handle; -// EndExclude 1 -// StartExclude 2 +// [EndExclude 1] +// [StartExclude 2] function getHMACGenProperties() { let properties = new Array(); let index = 0; @@ -48,8 +48,8 @@ function generateHMACKey() { }); return huksInfo; } -// End 1 -// EndExclude 2 +// [End 1] +// [EndExclude 2] function uint8ArrayToString(fileData) { let dataString = ''; for (let i = 0; i < fileData.length; i++) { @@ -163,4 +163,4 @@ function HMACProcess() { } return huksInfo; } -// End 2 \ No newline at end of file +// [End 2] \ No newline at end of file diff --git a/LiteWearable/entry/src/main/js/MainAbility/security/KeyAlias.js b/LiteWearable/entry/src/main/js/MainAbility/security/KeyAlias.js index c1fb0db5bb20165779521914b6fa7159b58af44e..0016f1cb44d0a83d347b0b38f9a8ef80a2f5feba 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/security/KeyAlias.js +++ b/LiteWearable/entry/src/main/js/MainAbility/security/KeyAlias.js @@ -1,17 +1,17 @@ -// Start 1 -// Start 2 +// [Start 1] +// [Start 2] import huks from '@ohos.security.huks'; -// StartExclude 2 +// [StartExclude 2] // 密钥材料 let plainTextKey = new Uint8Array([ 0x1d, 0x2c, 0x3a, 0x4b, 0x5e, 0x6f, 0x7d, 0x8a, 0x9c, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xf1, 0x23 ]); -// EndExclude 2 +// [EndExclude 2] // 确定密钥别名 const KEY_ALIAS = 'keyAlias'; -// StartExclude 2 +// [StartExclude 2] // 封装密钥属性集和密钥材料 function getImportKeyProperties() { let properties = new Array(); @@ -62,8 +62,8 @@ function importKey() { return huksInfo + "导入成功"; } -// End 1 -// EndExclude 2 +// [End 1] +// [EndExclude 2] function exportKeyProcess() { let huksInfo; let emptyOptions = { @@ -80,4 +80,4 @@ function exportKeyProcess() { return huksInfo; } -// End 2 \ No newline at end of file +// [End 2] \ No newline at end of file diff --git a/LiteWearable/entry/src/main/js/MainAbility/security/RSA.js b/LiteWearable/entry/src/main/js/MainAbility/security/RSA.js index 611b1836ae25c9856fb64845aababf3a060f1b07..362044dd6d0ad7b10b8c845530cabd913b39b94b 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/security/RSA.js +++ b/LiteWearable/entry/src/main/js/MainAbility/security/RSA.js @@ -1,13 +1,13 @@ -// Start 1 -// Start 3 +// [Start 1] +// [Start 3] import huks from '@ohos.security.huks'; -// Start 2 +// [Start 2] // 别名,用于区分生成的KEY const RSA_KEY_ALIAS = 'RSAKeyAlias'; // 自定义密钥长度必须在1024 -2048之间,且是8的倍数 const HUKS_RSA_KEY_SIZE_1024 = 1024; -// StartExclude 1 +// [StartExclude 1] // 明文,加密前数据 let plainText = "RSASSAdffssghCBC5612345612345192"; // 明文,加密前数据的长度 @@ -17,9 +17,9 @@ let cipherText = ''; // 操作句柄 let handle; -// EndExclude 1 -// StartExclude 2 -// StartExclude 3 +// [EndExclude 1] +// [StartExclude 2] +// [StartExclude 3] function getRSAGenProperties() { let properties = new Array(); let index = 0; @@ -54,8 +54,8 @@ function generateRSAKey() { return huksInfo; } -// End 1 -// EndExclude 2 +// [End 1] +// [EndExclude 2] function getRSAEncryptProperties() { let properties = new Array(); let index = 0; @@ -172,8 +172,8 @@ function stringToUint8Array(str) { return new Uint8Array(arr); } -// End 2 -// EndExclude 3 +// [End 2] +// [EndExclude 3] function getRSADecryptProperties() { let properties = new Array(); let index = 0; @@ -282,4 +282,4 @@ function decryptProcess() { return huksInfo; } -// End 3 \ No newline at end of file +// [End 3] \ No newline at end of file diff --git a/LiteWearable/entry/src/main/js/MainAbility/style4/style4.js b/LiteWearable/entry/src/main/js/MainAbility/style4/style4.js index 1dbbe86e0f72075460206ed6d14102fbd2fda04d..cf458703c112f3d8c2d76e824399d81e54bb3ad7 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/style4/style4.js +++ b/LiteWearable/entry/src/main/js/MainAbility/style4/style4.js @@ -1,4 +1,4 @@ -// Start 1 +// [Start 1] // index.js: export default { data: { @@ -6,4 +6,4 @@ export default { fontColor: '#FF0000', } }; -// End 1 \ No newline at end of file +// [End 1] \ No newline at end of file