diff --git a/LiteWearable/entry/src/main/js/MainAbility/exit/exit.hml b/LiteWearable/entry/src/main/js/MainAbility/exit/exit.hml index 9b0a820d11f8cb72f2dfa22b34e69027fc8fab19..db1fc10f0f24b1c4d1f929a48c1fa711a6cb684d 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/exit/exit.hml +++ b/LiteWearable/entry/src/main/js/MainAbility/exit/exit.hml @@ -1,5 +1,5 @@ +
Hello {{ title }} diff --git a/LiteWearable/entry/src/main/js/MainAbility/exit/exit.js b/LiteWearable/entry/src/main/js/MainAbility/exit/exit.js index 8d9cfc726c9f630933ec07178db4b93965aff8de..5af73721be3dd29a26dca6d26bc6eefdba38faa3 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/exit/exit.js +++ b/LiteWearable/entry/src/main/js/MainAbility/exit/exit.js @@ -1,7 +1,7 @@ // [Start exit_js] // index.js import router from '@ohos.router'; -// 导入app模块 +// Import the app module. import app from '@system.app'; export default { @@ -13,8 +13,8 @@ export default { uri: 'pages/details/details' }); }, - touchMove(e) { // swipe处理事件 - if (e.direction == 'right') { // 右滑退出 + touchMove(e) { // Handle swipe events. + if (e.direction == 'right') { // Swipe right to exit. app.terminate(); } } diff --git a/LiteWearable/entry/src/main/js/MainAbility/initpage/initpage.hml b/LiteWearable/entry/src/main/js/MainAbility/initpage/initpage.hml index 0acac82f39ee3acca68239dc977f69f0b0215435..6ac9727451eca5d6832e487f84bb3506787503a1 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/initpage/initpage.hml +++ b/LiteWearable/entry/src/main/js/MainAbility/initpage/initpage.hml @@ -1,5 +1,5 @@ +
Hello {{ title }} diff --git a/LiteWearable/entry/src/main/js/MainAbility/pages/index/index.css b/LiteWearable/entry/src/main/js/MainAbility/pages/index/index.css index a75028a4780f2f5652297afac125500b61e51370..6388b193331250028e80862664846517dad4e053 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/pages/index/index.css +++ b/LiteWearable/entry/src/main/js/MainAbility/pages/index/index.css @@ -1,10 +1,10 @@ .container { - width: 100%;/* 容器宽度设置为 100% */ - height: 100%;/* 容器高度设置为 100% */ + width: 100%;/* The width of the container is set to 100%. */ + height: 100%;/* The height of the container is set to 100%. */ justify-content: center; align-items: center; flex-direction: column; - background-color: aquamarine;/* 设置背景色为碧绿色 */ + background-color: aquamarine;/* Set the background color to light green. */ } .stackContainer { @@ -14,8 +14,8 @@ } .button { - top: 10%;/* 设置y轴上距离父组件为父组件高度的10%位置 */ - left: 10%;/* 设置x轴上距离父组件为父组件宽度的10%位置 */ + top: 10%;/* Set the position on the y-axis to be 10% of the height of the parent component from the top. */ + left: 10%;/* Set the position on the x-axis to be 10% of the width of the parent component from the parent component itself. */ width: 50%; height: 30%; font-size: 30px; @@ -27,5 +27,5 @@ height: 20%; font-size: 30px; background-color: black; - margin-top: 2%;/* 父组件高度的2% */ + margin-top: 2%;/* 2% of the height of the parent component. */ } \ 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 efa05f9af4c6be0efd0340185ee73b9d40f38da8..a9cbba6cd9d3ae3ae968e90905912073541209d5 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/security/DES.js +++ b/LiteWearable/entry/src/main/js/MainAbility/security/DES.js @@ -3,35 +3,35 @@ import huks from '@ohos.security.huks'; // [Start des_encrypt] // [Start des_decrypt] -// 别名,用于区分生成的KEY +// Alias, used to distinguish the generated KEY. const DES_CBC_64_KEY_ALIAS = 'DesCBC64KeyAlias'; // [StartExclude des_generate] -// 三段式句柄,用于连接三段式上下文 +// Three-part handle, used for connecting three-part context. let handle; let IV = '12345678'; -// 明文,加密前数据 +// Plain text, data before encryption. let plainText = 'DESAAAdffssghCBC5612345612345L64'; -// 密文,存放加密后数据 +// Ciphertext, storing the encrypted data. let cipherText = ''; // [EndExclude des_generate] // [StartExclude des_encrypt] // [StartExclude des_decrypt] -// 配置生成密钥所需的Tag +// Configure the Tag required for generating the key. function getDesGenProperties() { let properties = new Array(); let index = 0; - // DES算法 + // DES algorithm. properties[index++] = { tag: huks.HuksTag.HUKS_TAG_ALGORITHM, value: huks.HuksKeyAlg.HUKS_ALG_DES }; - // 密钥长度64 + // Key length: 64. properties[index++] = { tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, value: huks.HuksKeySize.HUKS_DES_KEY_SIZE_64 }; - // 密钥用途,加密和解密 + // Key usage, encryption and decryption. properties[index++] = { tag: huks.HuksTag.HUKS_TAG_PURPOSE, value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_DECRYPT | huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_ENCRYPT @@ -40,7 +40,7 @@ function getDesGenProperties() { return properties; } -// 生成密钥 +// Generate a key. function generateDESKey() { let huksInfo; let options = { properties: getDesGenProperties() } @@ -58,37 +58,37 @@ function generateDESKey() { function getDesCBCEncryptProperties() { let properties = new Array(); let index = 0; - // 算法 + // algorithm. properties[index++] = { tag: huks.HuksTag.HUKS_TAG_ALGORITHM, value: huks.HuksKeyAlg.HUKS_ALG_DES }; - // 密钥长度 + // key length. properties[index++] = { tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, value: huks.HuksKeySize.HUKS_DES_KEY_SIZE_64 }; - // 密钥用途 + // Key usage. properties[index++] = { tag: huks.HuksTag.HUKS_TAG_PURPOSE, value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_ENCRYPT }; - // 填充方式 + // Filling method. properties[index++] = { tag: huks.HuksTag.HUKS_TAG_PADDING, value: huks.HuksKeyPadding.HUKS_PADDING_NONE }; - // 分组方式 + // packet mode. properties[index++] = { tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE, value: huks.HuksCipherMode.HUKS_MODE_CBC }; - // 分组加密偏移向量,更安全 + // Group encryption offset vector, more secure. properties[index++] = { tag: huks.HuksTag.HUKS_TAG_IV, value: stringToUint8Array(IV) @@ -143,7 +143,7 @@ function encryptDES() { } }); } else { - // 密文接收 + // Encrypted message reception cipherText = uint8ArrayToString(updateData.outData); huksInfo = cipherText } @@ -163,7 +163,7 @@ function encryptDES() { } }); } else { - // 密文接收 + // Encrypted message reception cipherText = cipherText + uint8ArrayToString(finishData.outData); huksInfo = cipherText } @@ -194,32 +194,32 @@ function uint8ArrayToString(fileData) { function GetDesCBCDecryptProperties() { let properties = new Array(); let index = 0; - // 算法 + // algorithm properties[index++] = { tag: huks.HuksTag.HUKS_TAG_ALGORITHM, value: huks.HuksKeyAlg.HUKS_ALG_DES }; - // 密钥长度 + // key length properties[index++] = { tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, value: huks.HuksKeySize.HUKS_DES_KEY_SIZE_64 }; - // 密钥用途 + // Key usage properties[index++] = { tag: huks.HuksTag.HUKS_TAG_PURPOSE, value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_DECRYPT }; - // 填充方式 + // Filling method properties[index++] = { tag: huks.HuksTag.HUKS_TAG_PADDING, value: huks.HuksKeyPadding.HUKS_PADDING_NONE }; - // 分组方式 + // packet mode properties[index++] = { tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE, value: huks.HuksCipherMode.HUKS_MODE_CBC }; - // 分组加密偏移向量,更安全 + // Group encryption offset vector, more secure properties[index++] = { tag: huks.HuksTag.HUKS_TAG_IV, value: stringToUint8Array(IV) @@ -274,7 +274,7 @@ function decryptDES() { } }); } else { - // 明文接收 + // Clear text reception outPlainText = uint8ArrayToString(updateData.outData); huksInfo = outPlainText; } @@ -294,7 +294,7 @@ function decryptDES() { } }); } else { - // 明文接收 + // Clear text reception outPlainText = outPlainText + uint8ArrayToString(finishData.outData); huksInfo = outPlainText; } diff --git a/LiteWearable/entry/src/main/js/MainAbility/style1/style1.hml b/LiteWearable/entry/src/main/js/MainAbility/style1/style1.hml index bc53d37ea47559a2b108ca0f9aee9faa8a588a6e..86089f34602fd88a279a4d1f28eb1106d2db25f7 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/style1/style1.hml +++ b/LiteWearable/entry/src/main/js/MainAbility/style1/style1.hml @@ -1,8 +1,9 @@ + +
- + Hello World
diff --git a/LiteWearable/entry/src/main/js/MainAbility/style2/style2.hml b/LiteWearable/entry/src/main/js/MainAbility/style2/style2.hml index 161b7efb6b36ea3d1cef91f15b3381cba5cddd5a..7f5f73b188475b893014f7bf00fa734a7f62142d 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/style2/style2.hml +++ b/LiteWearable/entry/src/main/js/MainAbility/style2/style2.hml @@ -1,7 +1,9 @@ + +
- + + Hello World diff --git a/LiteWearable/entry/src/main/js/MainAbility/style3/style3.css b/LiteWearable/entry/src/main/js/MainAbility/style3/style3.css index e90d8da48e528984be67910b8cd52dd03b12ab16..2dde480f1ec0e25a69acf242539e0639f4de6229 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/style3/style3.css +++ b/LiteWearable/entry/src/main/js/MainAbility/style3/style3.css @@ -1,4 +1,4 @@ -/* .为类选择器,所有组件中class="container" 的组件都会使用该样式 */ +/* . For the class selector, all components with the class attribute set to "container" will apply this style. */ .container { display: flex; justify-content: center; @@ -6,7 +6,7 @@ width: 466px; height: 466px; } -/* #为ID选择器,id为title的组件会使用该样式 */ +/* # For the ID selector, the component with the ID "title" will apply this style. */ #title { font-size: 30px; text-align: center; diff --git a/LiteWearable/entry/src/main/js/MainAbility/style3/style3.hml b/LiteWearable/entry/src/main/js/MainAbility/style3/style3.hml index e23b9118819bafc36c863ac7d32df3de4d3ced7c..e63cb8f9256001e062d7ae3752d5fe94c70a099b 100644 --- a/LiteWearable/entry/src/main/js/MainAbility/style3/style3.hml +++ b/LiteWearable/entry/src/main/js/MainAbility/style3/style3.hml @@ -1,8 +1,8 @@ - +
- + Hello World