diff --git a/en/application-dev/js-reference/app-js.md b/en/application-dev/js-reference/app-js.md index aaf73378aced0088c4d499e8575a474c4785c275..11600f86a7423854920fec39c90e6f645eef4dfc 100755 --- a/en/application-dev/js-reference/app-js.md +++ b/en/application-dev/js-reference/app-js.md @@ -3,7 +3,7 @@ You can implement lifecycle logic specific to your application in the **app.js** file. Available application lifecycle functions are as follows: - **onCreate\(\)**: called when an application is created -- **onDestory\(\)**: called when an application is destroyed +- **onDestroy\(\)**: called when an application is destroyed In the following example, logs are printed only in the lifecycle functions . diff --git a/en/contribute/OpenHarmony-Java-secure-coding-guide.md b/en/contribute/OpenHarmony-Java-secure-coding-guide.md index 79a5726cc1192f3faf495e7fcfa3e6f75781df39..c9f95c18e089f471d97b39c70244bb17af5855c2 100644 --- a/en/contribute/OpenHarmony-Java-secure-coding-guide.md +++ b/en/contribute/OpenHarmony-Java-secure-coding-guide.md @@ -507,7 +507,7 @@ public void unzip(FileInputStream zipFileInputStream, String dir) throws IOExcep entryFile = new File(entryFilePath); if (entry.isDirectory()) { - creatDir(entryFile); + createDir(entryFile); continue; } @@ -536,7 +536,7 @@ private String sanitizeFileName(String fileName, String dir) throws IOException throw new IOException("Path Traversal vulnerability: ..."); } -private void creatDir(File dirPath) throws IOException { +private void createDir(File dirPath) throws IOException { boolean result = dirPath.mkdirs(); if (!result) { throw new IOException("Create dir failed, path is : " + dirPath.getPath()); diff --git a/en/contribute/OpenHarmony-JavaScript-coding-style-guide.md b/en/contribute/OpenHarmony-JavaScript-coding-style-guide.md index 2bc5234ca6a8a7a28a0b4f0d2c4eebf0123bcb8c..39d6945ec211060a1a3068315a86d1278e8c1d2d 100755 --- a/en/contribute/OpenHarmony-JavaScript-coding-style-guide.md +++ b/en/contribute/OpenHarmony-JavaScript-coding-style-guide.md @@ -329,7 +329,7 @@ console.log(`${username}'s birthday is ${birthday}`); **Example:** ```javascript -let message = 'wolrd'; +let message = 'world'; console.log(message); ``` diff --git a/en/contribute/OpenHarmony-c-coding-style-guide.md b/en/contribute/OpenHarmony-c-coding-style-guide.md index 6231319194293ad1bfdf9dfd6d51affe408889a1..781b0a169b77c1e318dcb4fb30c8490124e64a08 100755 --- a/en/contribute/OpenHarmony-c-coding-style-guide.md +++ b/en/contribute/OpenHarmony-c-coding-style-guide.md @@ -1966,7 +1966,7 @@ The value is limited by the name, for example, `#define XX_TIMER_INTERVAL_300MS ### Rec 8.1 When comparing expressions, follow the principle that the left side tends to change and the right side tends to remain unchanged. -When a variable is compared with a constant, placing the constant on the left, for example, `if (MAX == v)` does not read naturally, and `if (MAX > v)` is more difficult to understand. +When a variable is compared with a constant, placing the constant on the left, for example, `if (MAX == v)` does not read naturally, and `if (MAX > v)` is more difficult to understand. The constant should be placed on the right according to the normal reading order and habit. The expression is written as follows: ```c diff --git a/en/contribute/OpenHarmony-c-cpp-secure-coding-guide.md b/en/contribute/OpenHarmony-c-cpp-secure-coding-guide.md index 621953b338c8ca14c1e71d1a670788a544ab22aa..31114039d57f68473980b4d651f5771db16f1899 100644 --- a/en/contribute/OpenHarmony-c-cpp-secure-coding-guide.md +++ b/en/contribute/OpenHarmony-c-cpp-secure-coding-guide.md @@ -36,8 +36,8 @@ Input validation includes but is not limited to: **External Data Validation Principles 1. Trust boundary** - External data is untrusted. Therefore, if data is transmitted and processed across different trust boundaries during system operation, validity check must be performed on data from modules outside the trust boundaries to prevent attacks from spreading. (a) Different so (or dll) modules - As an independent third-party module, the so or dll module is used to export common API functions for other modules to call. The so/dll module is unable to determine whether the caller passes on valid arguments. Therefore, the common function of the so/dll module needs to check the validity of the arguments provided by the caller. The so/dll module should be designed in low coupling and high reusability. Although the so/dll module is designed to be used only in this software in certain cases, different so/dll modules should still be regarded as different trust boundaries. (b) Different processes + External data is untrusted. Therefore, if data is transmitted and processed across different trust boundaries during system operation, validity check must be performed on data from modules outside the trust boundaries to prevent attacks from spreading. (a) Different so (or dll) modules + As an independent third-party module, the so or dll module is used to export common API functions for other modules to call. The so/dll module is unable to determine whether the caller passes on valid arguments. Therefore, the common function of the so/dll module needs to check the validity of the arguments provided by the caller. The so/dll module should be designed in low coupling and high reusability. Although the so/dll module is designed to be used only in this software in certain cases, different so/dll modules should still be regarded as different trust boundaries. (b) Different processes To prevent privilege escalation through processes with high permissions, the IPC communications between processes (including IPC communications between boards and network communications between hosts) should be regarded as communications across different trust boundaries. (c) Application layer processes and operating system kernel The operating system kernel has higher permissions than the application layer. The interface provided by the kernel for the application layer should process the data from the application layer as untrusted data. (d) Internal and external environments of TEE To prevent attacks from spreading to the TEE, the interfaces provided by the TEE and SGX for external systems should process external data as untrusted data. @@ -2072,7 +2072,7 @@ memset(buffer, 0, SIZE); // Use the requested buffer size. ## Do not directly use external data to concatenate SQL statements **\[Description]** -An SQL injection vulnerability arises when an SQL query is dynamically altered to form an altogether different query. Execution of this altered query may result in information leaks or data tampering. The root cause of SQL injection is the use of external data to concatenate SQL statements. In C/C++, external data is used to concatenate SQL statements in the following scenarios (but not limited to): +An SQL injection vulnerability arises when an SQL query is dynamically altered to form an altogether different query. Execution of this altered query may result in information leaks or data tampering. The root cause of SQL injection is the use of external data to concatenate SQL statements. In C/C++, external data is used to concatenate SQL statements in the following scenarios (but not limited to): - Argument for calling **mysql\_query()** and **Execute()** when connecting to MySQL - Argument for calling **dbsqlexec()** of the db-library driver when connecting to the SQL server diff --git a/en/contribute/OpenHarmony-cpp-coding-style-guide.md b/en/contribute/OpenHarmony-cpp-coding-style-guide.md index 8a7ecbad0ca50c514f6b14380fca47613f505468..9471318f4b227c28bb15a6568b7442a83f93f1d2 100755 --- a/en/contribute/OpenHarmony-cpp-coding-style-guide.md +++ b/en/contribute/OpenHarmony-cpp-coding-style-guide.md @@ -2321,7 +2321,7 @@ The default constructor, destructor, `swap` function, and `move` operator should Template programming allows for extremely flexible interfaces that are type safe and high performance, enabling reuse of code of different types but with the same behavior. -The disadvantages of template proramming are as follows: +The disadvantages of template programming are as follows: 1. The techniques used in template programming are often obscure to anyone but language experts. Code that uses templates in complicated ways is often unreadable, and is hard to debug or maintain. 2. Template programming often leads to extremely poor compiler time error messages: even if an interface is simple, complicated implementation details become visible when the user does something wrong. diff --git a/en/device-dev/driver/driver-service-management.md b/en/device-dev/driver/driver-service-management.md index 961fceb1181222a71d1423c5f0eebe22e07da3c6..833d233b6723f92b9227eaa04ffc6998fbec2cf9 100644 --- a/en/device-dev/driver/driver-service-management.md +++ b/en/device-dev/driver/driver-service-management.md @@ -128,7 +128,7 @@ The development of driver service management includes compiling, binding, obtain - Using the subscription mechanism - If the kernel sapce unaware of the time for loading drivers \(on the same host\), use the subscription mechanism provided by the HDF to subscribe to the drivers. After the drivers are loaded, the HDF releases the driver services to you. The implementation is as follows: + If the kernel space unaware of the time for loading drivers \(on the same host\), use the subscription mechanism provided by the HDF to subscribe to the drivers. After the drivers are loaded, the HDF releases the driver services to you. The implementation is as follows: ``` // Subscription callback function. After the subscribed drivers are loaded, the HDF releases the driver services to you using this function. diff --git a/en/device-dev/driver/watchdogusage-example.md b/en/device-dev/driver/watchdogusage-example.md index 98f6acfa0e383b059ed257df8411ef03f3f9ee72..43943a038ad5bbdeddd29351d263d03ce0925deb 100644 --- a/en/device-dev/driver/watchdogusage-example.md +++ b/en/device-dev/driver/watchdogusage-example.md @@ -52,7 +52,7 @@ static int32_t TestCaseWatchdog(void) /* Start the watchdog. The timer starts. */ ret = WatchdogStart(handle); if (ret != HDF_SUCCESS) { - HDF_LOGE("%s: satrt fail! ret:%d\n", __func__, ret); + HDF_LOGE("%s: start fail! ret:%d\n", __func__, ret); WatchdogClose(handle); return ret; } @@ -73,7 +73,7 @@ static int32_t TestCaseWatchdog(void) /* Enable the timer to expire by stopping feeding the watchdog. */ for (i = 0; i < WATCHDOG_TEST_FEED_TIME; i++) { - HDF_LOGE("%s: watiting dog buck %d times... \n", __func__, i); + HDF_LOGE("%s: waiting dog buck %d times... \n", __func__, i); OsalSleep(1); } diff --git a/en/device-dev/guide/faqs.md b/en/device-dev/guide/faqs.md index 1a8fa2eae8d539e023e1914ca6b586efc9fe6d69..14afd9f8ecc2d094fe8d632dc05372dc9356e9da 100644 --- a/en/device-dev/guide/faqs.md +++ b/en/device-dev/guide/faqs.md @@ -12,7 +12,7 @@
. - +
/* index.js */ diff --git a/en/readme/liteipc_driver.md b/en/readme/liteipc_driver.md index c2afc7b4f6390d6db5b6f37779ba5bbfe103fc36..efc5d255dbdac47ba54d875a6a13e42feff8e14e 100644 --- a/en/readme/liteipc_driver.md +++ b/en/readme/liteipc_driver.md @@ -56,7 +56,7 @@ IpcContent - The **SEND** flag indicates a request to send outMsg. Returns with error **EINVAL** if any member of the message has been given an invalid value. - Sending a message with type **MT_REQUEST** returns with error **EACCES** if the task doesn't have access rights to the recipient, and **EINVAL** for an invalid recipient. All tasks have access rights to the CMS (see IPC_SET_CMS), and to their own process' IPC services. - - Sending a message with type **MT_REPLY** or **MT_FAILED_REPLY** returns with error **EINVAL** if any of the following are not satisifed: + - Sending a message with type **MT_REPLY** or **MT_FAILED_REPLY** returns with error **EINVAL** if any of the following are not satisfied: - buffToFree must point at the message being replied to and the **BUFF_FREE** flag must be set. - The outMsg recipient (target.handle) must match the buffToFree sender (taskID). - The outMsg and buffToFree timestamps must match. diff --git a/zh-cn/application-dev/js-reference/app-js.md b/zh-cn/application-dev/js-reference/app-js.md index b9354823eab42470903557a9bccd9b0bd1015422..73c29c9c2464fdeba0c7c20ddaa52052dd736382 100755 --- a/zh-cn/application-dev/js-reference/app-js.md +++ b/zh-cn/application-dev/js-reference/app-js.md @@ -3,7 +3,7 @@ 每个应用可以在app.js自定义应用级生命周期的实现逻辑,包括: - onCreate:在应用生成时被调用的生命周期函数。 -- onDestory:在应用销毁时被调用的生命周期函数。 +- onDestroy:在应用销毁时被调用的生命周期函数。 以下示例仅在生命周期函数中打印对应日志: diff --git "a/zh-cn/application-dev/js-reference/\345\215\207\347\272\247.md" "b/zh-cn/application-dev/js-reference/\345\215\207\347\272\247.md" index 6dfc0396682e90e99d11da65f2279df6b545973f..63dafac299eae0e94beada19c021808b78b1adf3 100644 --- "a/zh-cn/application-dev/js-reference/\345\215\207\347\272\247.md" +++ "b/zh-cn/application-dev/js-reference/\345\215\207\347\272\247.md" @@ -73,7 +73,7 @@ import client from 'libupdateclient.z.so' ``` updater.getNewVersionInfo(info => { -console.log("getNewVersionInfo sucess " + info.status); +console.log("getNewVersionInfo success " + info.status); console.log(`info versionName = ` + info.result[0].versionName); console.log(`info versionCode = ` + info.result[0].versionCode); console.log(`info verifyInfo = ` + info.result[0].verifyInfo); @@ -134,7 +134,7 @@ console.log(`info verifyInfo = ` + info.result[0].verifyInfo); ``` updater.checkNewVersion(info => { -console.log("checkNewVersion sucess " + info.status); +console.log("checkNewVersion success " + info.status); console.log(`info versionName = ` + info.result[0].versionName); console.log(`info versionCode = ` + info.result[0].versionCode); console.log(`info verifyInfo = ` + info.result[0].verifyInfo); @@ -316,7 +316,7 @@ console.log("setUpdatePolicy ", result) ``` updater.getUpdatePolicy(policy => { -console.log("getUpdatePolicy sucess", policy) +console.log("getUpdatePolicy success", policy) }); ``` diff --git a/zh-cn/contribute/OpenHarmony-Java-secure-coding-guide.md b/zh-cn/contribute/OpenHarmony-Java-secure-coding-guide.md index f5aa62464925f42e3e9fe4ce883b6780162817e0..11c240029abded9a06d39b9f4101a26f1ad23b6a 100644 --- a/zh-cn/contribute/OpenHarmony-Java-secure-coding-guide.md +++ b/zh-cn/contribute/OpenHarmony-Java-secure-coding-guide.md @@ -507,7 +507,7 @@ public void unzip(FileInputStream zipFileInputStream, String dir) throws IOExcep entryFile = new File(entryFilePath); if (entry.isDirectory()) { - creatDir(entryFile); + createDir(entryFile); continue; } @@ -536,7 +536,7 @@ private String sanitizeFileName(String fileName, String dir) throws IOException throw new IOException("Path Traversal vulnerability: ..."); } -private void creatDir(File dirPath) throws IOException { +private void createDir(File dirPath) throws IOException { boolean result = dirPath.mkdirs(); if (!result) { throw new IOException("Create dir failed, path is : " + dirPath.getPath()); diff --git a/zh-cn/contribute/OpenHarmony-JavaScript-coding-style-guide.md b/zh-cn/contribute/OpenHarmony-JavaScript-coding-style-guide.md index 74dffa62081ecc349c319b5d5ba60c3812847811..51f6af5f189441f21ea884aa75c33172254e17d4 100755 --- a/zh-cn/contribute/OpenHarmony-JavaScript-coding-style-guide.md +++ b/zh-cn/contribute/OpenHarmony-JavaScript-coding-style-guide.md @@ -330,7 +330,7 @@ console.log(`${username}'s birthday is ${birthday}`); **正例:** ```javascript -let message = 'wolrd'; +let message = 'world'; console.log(message); ``` diff --git "a/zh-cn/device-dev/driver/\347\234\213\351\227\250\347\213\227\344\275\277\347\224\250\345\256\236\344\276\213.md" "b/zh-cn/device-dev/driver/\347\234\213\351\227\250\347\213\227\344\275\277\347\224\250\345\256\236\344\276\213.md" index b8d64e53b754037b4ec6335e683f32bfbd1b6a34..a723e3739bc3b018f590d7633c3d12504182a742 100755 --- "a/zh-cn/device-dev/driver/\347\234\213\351\227\250\347\213\227\344\275\277\347\224\250\345\256\236\344\276\213.md" +++ "b/zh-cn/device-dev/driver/\347\234\213\351\227\250\347\213\227\344\275\277\347\224\250\345\256\236\344\276\213.md" @@ -52,7 +52,7 @@ static int32_t TestCaseWatchdog(void) /* 启动看门狗,开始计时 */ ret = WatchdogStart(handle); if (ret != HDF_SUCCESS) { - HDF_LOGE("%s: satrt fail! ret:%d\n", __func__, ret); + HDF_LOGE("%s: start fail! ret:%d\n", __func__, ret); WatchdogClose(handle); return ret; } @@ -73,7 +73,7 @@ static int32_t TestCaseWatchdog(void) /* 接下来持续不喂狗,使得看门狗计时器超时 */ for (i = 0; i < WATCHDOG_TEST_FEED_TIME; i++) { - HDF_LOGE("%s: watiting dog buck %d times... \n", __func__, i); + HDF_LOGE("%s: waiting dog buck %d times... \n", __func__, i); OsalSleep(1); } diff --git "a/zh-cn/device-dev/guide/\345\270\270\350\247\201\351\227\256\351\242\230.md" "b/zh-cn/device-dev/guide/\345\270\270\350\247\201\351\227\256\351\242\230.md" index e595cc85c3a246c0cbea8bbb2a58b8c00da0ad69..56d892fc1d9e51d07f85a25137ec12cc10b6008d 100755 --- "a/zh-cn/device-dev/guide/\345\270\270\350\247\201\351\227\256\351\242\230.md" +++ "b/zh-cn/device-dev/guide/\345\270\270\350\247\201\351\227\256\351\242\230.md" @@ -12,7 +12,7 @@
- +
/* index.js */ diff --git "a/zh-cn/device-dev/subsystems/\347\274\226\350\257\221\346\236\204\345\273\272\344\275\277\347\224\250\346\214\207\345\257\274.md" "b/zh-cn/device-dev/subsystems/\347\274\226\350\257\221\346\236\204\345\273\272\344\275\277\347\224\250\346\214\207\345\257\274.md" index 8d5f276817760d9b28e9bee264507fc2e6c6b533..2d690e7594c16fb8b297776fb1ed8b6af062a50e 100755 --- "a/zh-cn/device-dev/subsystems/\347\274\226\350\257\221\346\236\204\345\273\272\344\275\277\347\224\250\346\214\207\345\257\274.md" +++ "b/zh-cn/device-dev/subsystems/\347\274\226\350\257\221\346\236\204\345\273\272\344\275\277\347\224\250\346\214\207\345\257\274.md" @@ -154,7 +154,7 @@ hb是OpenHarmony的命令行工具,用来执行编译命令。以下对hb的 3. 将组件配置到产品。 - 产品的配置文件config.json位于位于vendor/company/product/下,产品配置文件需包含产品名称、OpenHarmony版本号、device厂商、开发板、内核类型、内核版本号,以及配置的子系统和组件。以将hello\_world组件加入产品配置文件my\_product.json中为例,加入hello\_wolrd对象: + 产品的配置文件config.json位于位于vendor/company/product/下,产品配置文件需包含产品名称、OpenHarmony版本号、device厂商、开发板、内核类型、内核版本号,以及配置的子系统和组件。以将hello\_world组件加入产品配置文件my\_product.json中为例,加入hello\_world对象: ``` { diff --git "a/zh-cn/readme/\345\210\206\345\270\203\345\274\217\346\226\207\344\273\266\345\255\220\347\263\273\347\273\237.md" "b/zh-cn/readme/\345\210\206\345\270\203\345\274\217\346\226\207\344\273\266\345\255\220\347\263\273\347\273\237.md" index 1ae22c7b5e18d0fd0e47b68a7b3156fddade4ee9..c93e750534b3fc7a733255b05d283a44a378368f 100644 --- "a/zh-cn/readme/\345\210\206\345\270\203\345\274\217\346\226\207\344\273\266\345\255\220\347\263\273\347\273\237.md" +++ "b/zh-cn/readme/\345\210\206\345\270\203\345\274\217\346\226\207\344\273\266\345\255\220\347\263\273\347\273\237.md" @@ -182,7 +182,7 @@ foundation/distributeddatamgr/distributedfile - 异步编程模型:Promise - @OHOS.distributedfile.fileio 模块中,名称不含 Sync 的接口,在不提供最后一个函数型参数 callback 的时候,即实现为 Promsie 异步模型。Promise 异步模型是 OHOS 标准异步模型之一。用户在调用这些接口的时候,接口实现将异步执行任务,同时返回一个 promise 对象,其代表异步操作的结果。在返回的结果的个数超过一个时,其以对象属性的形式返回。 + @OHOS.distributedfile.fileio 模块中,名称不含 Sync 的接口,在不提供最后一个函数型参数 callback 的时候,即实现为 Promise 异步模型。Promise 异步模型是 OHOS 标准异步模型之一。用户在调用这些接口的时候,接口实现将异步执行任务,同时返回一个 promise 对象,其代表异步操作的结果。在返回的结果的个数超过一个时,其以对象属性的形式返回。 下例通过 Promise 链依次完成:以只读方式打开文件流、尝试读取文件前 4096 个字节、显示读取内容的长度,最后关闭文件。 diff --git a/zh-cn/release-notes/OpenHarmony-1-1-0-LTS.md b/zh-cn/release-notes/OpenHarmony-1-1-0-LTS.md index 539767d09702bd59d80621ab813dfec5a8244242..c74ba1be8e50a7d376dd1beee7cb26b2302a81e4 100755 --- a/zh-cn/release-notes/OpenHarmony-1-1-0-LTS.md +++ b/zh-cn/release-notes/OpenHarmony-1-1-0-LTS.md @@ -1154,7 +1154,7 @@ repo sync -c

I3D71U

-

【驱动】反复reset,启动到hmac_main_init SUCCESSULLY后,高概率出现系统挂死问题

+

【驱动】反复reset,启动到hmac_main_init SUCCESSFULLY后,高概率出现系统挂死问题

I3EGUX