From 2d340f14f1e6dd7c91466543c19d4ac53ece31d5 Mon Sep 17 00:00:00 2001
From: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
Date: Wed, 21 Jan 2026 10:44:33 +0800
Subject: [PATCH 01/14] =?UTF-8?q?docs:=20=E6=96=B0=E5=A2=9Elottie-turbo-re?=
=?UTF-8?q?act-native=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
en/react-native-screen-capture.md | 371 +++++++++++++++++++++++++++
zh-cn/react-native-screen-capture.md | 356 +++++++++++++++++++++++++
2 files changed, 727 insertions(+)
create mode 100644 en/react-native-screen-capture.md
create mode 100644 zh-cn/react-native-screen-capture.md
diff --git a/en/react-native-screen-capture.md b/en/react-native-screen-capture.md
new file mode 100644
index 00000000..f3deae64
--- /dev/null
+++ b/en/react-native-screen-capture.md
@@ -0,0 +1,371 @@
+> Template version: v0.2.2
+
+
+
react-native-screen-capture
+
+
+
+
+
+
+
+
+
+
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-screen-capture)
+
+## Installation and Usage
+
+Please refer to the Releases page of the third-party library for the corresponding version information
+
+| Version | Release Information |Supported RN Version |
+|-----------------------------------|--------------------------------------------| -------------------- |
+| <= 4.4.1-0.0.3@deprecated | [@react-native-oh-tpl/react-native-screen-capture Releases(deprecated)](https://github.com/react-native-oh-library/react-native-screen-capture/releases) | 0.72 |
+| 4.4.2 | [@react-native-ohos/react-native-screen-capture Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-screen-capture/releases) | 0.72 |
+| 4.5.0 | [@react-native-ohos/react-native-screen-capture Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-screen-capture/releases) | 0.77 |
+
+For older versions not published on npm, please refer to the [Installation Guide](/en/tgz-usage-en.md) to install the tgz package.
+
+Go to the project directory and execute the following instruction:
+
+
+
+
+#### **npm**
+
+```bash
+npm install @react-native-ohos/react-native-screen-capture
+```
+
+#### **yarn**
+
+```bash
+yarn add @react-native-ohos/react-native-screen-capture
+```
+
+
+
+
+The following code shows the basic use scenario of the repository:
+
+> [!WARNING] The name of the imported repository remains unchanged.
+
+```js
+import React, { Component, useState } from 'react';
+import { Alert, View, Button, Text } from 'react-native';
+import {disallowScreenshot,keepAwake} from 'react-native-screen-capture';
+
+class AppDemo extends React.Component {
+ state = {
+ isVisible: true,
+ screenOn: false, // false 表示允许截屏,true 表示禁止截屏
+ };
+
+ handleDisallowScreenshot = () => {
+ // 切换状态:如果当前是 false(允许截屏),点击后变为 true(禁止截屏)
+ const newState = !this.state.screenOn;
+ this.setState({ screenOn: newState });
+ disallowScreenshot(newState);
+ console.log('Disallow Screenshot state:', newState);
+ };
+
+ handleKeepAwake = () => {
+ const newState = !this.state.isVisible;
+ this.setState({ isVisible: newState });
+ keepAwake(newState);
+ console.log('Keep Awake state:', newState);
+ };
+
+ render() {
+ return (
+
+
+ 防截屏状态: {this.state.screenOn ? '已禁止' : '已允许'}
+
+
+
+ 屏幕常亮状态: {this.state.isVisible ? '已开启' : '已关闭'}
+
+
+ 岁月静好
+
+ )
+ };
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: 'center',
+ flexDirection: 'column',
+ alignItems: 'center'
+ },
+ label: {
+ fontSize: 30
+ },
+ status: {
+ fontSize: 18,
+ marginVertical: 10,
+ color: '#333'
+ }
+})
+
+export default AppDemo;
+
+```
+## Use Codegen
+
+This library has been adapted for `Codegen`. Before using it, you need to proactively generate the bridge code for the third-party library. For details, please refer to the [Codegen Usage Documentation](/en/codegen.md).
+
+## Link
+
+| | is supporte autolink | Supported RN Version |
+|--------------------------------------|-----------------------|----------------------|
+| ~4.5.0 | No | 0.77 |
+| ~4.4.2 | Yes | 0.72 |
+| <= 4.4.1-0.0.3@deprecated | No | 0.72 |
+
+Using AutoLink need to be configured according to this document, Autolink Framework Guide Documentation: https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md
+
+If the version you use supports Autolink and the project has been connected to Autolink, skip the ManualLink configuration.
+
+ ManualLink: this step is a guide to manually configure native dependencies.
+
+First, use DevEco Studio to open the HarmonyOS project `harmony` in the project directory.
+
+### 1.Open `entry/oh-package.json5` file and add the following dependencies:
+
+```json
+{
+ ...
+ "overrides": {
+ "@rnoh/react-native-openharmony": "file:react-native-openharmony-0.72.90.har"
+ }
+}
+```
+
+### 2. Introducing Native Code
+
+Currently, two methods are available:
+
+
+
+Method 1 (recommended): Use the HAR file.
+
+> [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library.
+
+Open `entry/oh-package.json5` file and add the following dependencies:
+
+```json
+"dependencies": {
+ "@rnoh/react-native-openharmony": "file:../react-native-openharmony-0.72.90.har",
+ "@react-native-oh-tpl/react-native-safe-area-context": "file:../../node_modules/@react-native-oh-tpl/react-native-safe-area-context/harmony/safe_area.har",
+ "react-native-screen-capture": "file:../screen_capture"
+ }
+```
+
+Click the `sync` button in the upper right corner.
+
+Alternatively, run the following instruction on the terminal:
+
+```bash
+cd entry
+ohpm install
+```
+
+Method 2: Directly link to the source code.
+
+> [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md).
+
+### 3. Configuring CMakeLists and Introducing TouchIdPackage
+
+> If you are using version <= 4.4.1-0.0.3, please skip this chapter.
+
+Open `entry/src/main/cpp/CMakeLists.txt` and add the following code:
+
+```diff
+project(rnapp)
+cmake_minimum_required(VERSION 3.4.1)
+set(CMAKE_SKIP_BUILD_RPATH TRUE)
+set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
++ set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules")
++ file(REAL_PATH "${NODE_MODULES}" NODE_MODULES)
+set(OH_MODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
+set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules/@rnoh/react-native-openharmony/src/main/cpp")
+set(RNOH_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/generated")
+file(REAL_PATH "${RNOH_CPP_DIR}" RNOH_CPP_DIR)
+set(LOG_VERBOSITY_LEVEL 1)
+set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments")
+set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie")
+set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
+
+set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use
+add_compile_definitions(WITH_HITRACE_SYSTRACE)
+
+# Add include directory for screen_capture generated headers
+include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../../../screen_capture/src/main/cpp/generated")
+
+add_subdirectory("${RNOH_CPP_DIR}" ./rn)
+
+# RNOH_BEGIN: manual_package_linking_1
+add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-safe-area-context/src/main/cpp" ./safe-area)
+# add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../../../../screen_capture/src/main/cpp" ./screen-capture)
+# RNOH_END: manual_package_linking_1
+
+# Add screen_capture generated cpp files directly
+set(SCREEN_CAPTURE_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../screen_capture/src/main/cpp/generated")
+file(GLOB SCREEN_CAPTURE_GENERATED_CPP "${SCREEN_CAPTURE_GENERATED_DIR}/RNOH/generated/turbo_modules/*.cpp")
+message(STATUS "ScreenCapture generated cpp files: ${SCREEN_CAPTURE_GENERATED_CPP}")
+
+file(GLOB GENERATED_CPP_FILES "${CMAKE_CURRENT_SOURCE_DIR}/generated/*.cpp") # this line is needed by codegen v1
+
+add_library(rnoh_app SHARED
+ ${GENERATED_CPP_FILES}
+ ${SCREEN_CAPTURE_GENERATED_CPP}
+ "./PackageProvider.cpp"
+ "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp"
+)
+target_link_libraries(rnoh_app PUBLIC rnoh)
+
+# RNOH_BEGIN: manual_package_linking_2
++ target_link_libraries(rnoh_app PUBLIC rnoh_safe_area)
++ target_link_libraries(rnoh_app PUBLIC screen_capture)
+# RNOH_END: manual_package_linking_2
+```
+
+### 4. Introducing TouchIdPackage to ArkTS
+
+Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
+
+```diff
+ ...
++ import type {RNPackageContext, RNPackage} from '@rnoh/react-native-openharmony/ts';
++ import {SafeAreaViewPackage} from '@react-native-oh-tpl/react-native-safe-area-context/ts'
++ import {ScreenCapturePackage} from '../../../../screen_capture/src/main/ets/ScreenCapturePackage'
+
+export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
+ return [
+ + new SafeAreaViewPackage(ctx),
+ + new ScreenCapturePackage(ctx),
+ ];
+}
+```
+
+
+## Running
+
+Click the `sync` button in the upper right corner.
+
+Alternatively, run the following instruction on the terminal:
+
+```bash
+cd entry
+ohpm install
+```
+
+Then build and run the code.
+
+## Constraints
+
+### Compatibility
+
+
+To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone.
+
+Verified in the following versions.
+
+1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112;
+2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71;
+3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112;
+
+### Permission Requirements
+
+(Enter the related permission configuration.)
+
+Add the following permissions to their respective files:
+
+In your `module.json5`
+
+```
+ "requestPermissions": [
+ {
+ "name": "ohos.permission.PRIVACY_WINDOW"
+ }
+ ]
+```
+
+## API
+
+> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
+
+> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ---- | ----------- | ---- | -------- | -------- | ------------------ |
+| disallowScreenshot | Whether to disallow screenshots | function | yes | ios/andriod | yes |
+| keepAwake | Whether to keep the device awake | function | yes | ios/andriod | yes |
+## API Parameters Introduction
+### disallowScreenshot(newState: boolean);
+* **newState**: A parameter of type boolean, used to switch the state.
+
+### keepAwake(newState: boolean);
+* **newState**: A parameter of type boolean, used to switch the state.
+
+## Properties
+
+> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
+
+> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
+
+
+
+## License
+
+This project is licensed under [The MIT License (MIT)](https://github.com/recepkocur/react-native-screen-capture?tab=readme-ov-file#license).
diff --git a/zh-cn/react-native-screen-capture.md b/zh-cn/react-native-screen-capture.md
new file mode 100644
index 00000000..bfb4323a
--- /dev/null
+++ b/zh-cn/react-native-screen-capture.md
@@ -0,0 +1,356 @@
+> 模板版本:v0.2.2
+
+
+
react-native-screen-capture
+
+
+
+
+
+
+
+
+
+
+> [!TIP] [Github 地址](https://github.com/recepkocur/react-native-screen-capture)
+
+## 安装与使用
+
+请到三方库的 Releases 发布地址查看配套的版本信息:
+
+| 三方库版本 | 发布信息 |Supported RN Version |
+|---------------------------|--------------------------------------------| -------------------- |
+| <= 4.4.1-0.0.3@deprecated | [@react-native-oh-tpl/react-native-screen-capture Releases(deprecated)](https://github.com/react-native-oh-library/react-native-screen-capture/releases) | 0.72 |
+| 4.4.2 | [@react-native-ohos/react-native-screen-capture Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-screen-capture/releases) | 0.72 |
+| 4.5.0 | [@react-native-ohos/react-native-screen-capture Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-screen-capture/releases) | 0.77 |
+
+对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。
+
+进入到工程目录并输入以下命令:
+
+
+
+#### **npm**
+
+```bash
+npm install @react-native-ohos/react-native-screen-capture
+```
+
+#### **yarn**
+
+```bash
+yarn add @react-native-ohos/react-native-screen-capture
+```
+
+
+
+下面的代码展示了这个库的基本使用场景:
+
+> [!WARNING] 使用时 import 的库名不变。
+
+```js
+import React, { Component, useState } from 'react';
+import { Alert, View, Button, Text } from 'react-native';
+import {disallowScreenshot,keepAwake} from 'react-native-screen-capture';
+
+class AppDemo extends React.Component {
+ state = {
+ isVisible: true,
+ screenOn: false, // false 表示允许截屏,true 表示禁止截屏
+ };
+
+ handleDisallowScreenshot = () => {
+ // 切换状态:如果当前是 false(允许截屏),点击后变为 true(禁止截屏)
+ const newState = !this.state.screenOn;
+ this.setState({ screenOn: newState });
+ disallowScreenshot(newState);
+ console.log('Disallow Screenshot state:', newState);
+ };
+
+ handleKeepAwake = () => {
+ const newState = !this.state.isVisible;
+ this.setState({ isVisible: newState });
+ keepAwake(newState);
+ console.log('Keep Awake state:', newState);
+ };
+
+ render() {
+ return (
+
+
+ 防截屏状态: {this.state.screenOn ? '已禁止' : '已允许'}
+
+
+
+ 屏幕常亮状态: {this.state.isVisible ? '已开启' : '已关闭'}
+
+
+ 岁月静好
+
+ )
+ };
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: 'center',
+ flexDirection: 'column',
+ alignItems: 'center'
+ },
+ label: {
+ fontSize: 30
+ },
+ status: {
+ fontSize: 18,
+ marginVertical: 10,
+ color: '#333'
+ }
+})
+
+export default AppDemo;
+
+```
+## 使用 Codegen
+
+本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。
+
+## Link
+
+| | 是否支持autolink | RN框架版本 |
+|---------------------------------------|-----------------|------------|
+| ~4.5.0 | No | 0.77 |
+| ~4.4.2 | Yes | 0.72 |
+| <= 4.4.1-0.0.3@deprecated | No | 0.72 |
+
+使用AutoLink的工程需要根据该文档配置,Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md
+
+如您使用的版本支持 Autolink,并且工程已接入 Autolink,可跳过ManualLink配置。
+
+ ManualLink: 此步骤为手动配置原生依赖项的指导
+
+首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony`。
+
+### 1.在工程根目录的 `oh-package.json5` 添加 overrides字段
+
+```json
+{
+ ...
+ "overrides": {
+ "@rnoh/react-native-openharmony": "file:react-native-openharmony-0.72.90.har"
+ }
+}
+```
+
+### 2.引入原生端代码
+
+目前有两种方法:
+
+1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法);
+2. 直接链接源码。
+
+方法一:通过 har 包引入(推荐)
+
+> [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。
+
+打开 `entry/oh-package.json5`,添加以下依赖
+
+```json
+"dependencies": {
+ "@rnoh/react-native-openharmony": "file:../react-native-openharmony-0.72.90.har",
+ "@react-native-oh-tpl/react-native-safe-area-context": "file:../../node_modules/@react-native-oh-tpl/react-native-safe-area-context/harmony/safe_area.har",
+ "react-native-screen-capture": "file:../screen_capture"
+ }
+```
+
+点击右上角的 `sync` 按钮
+
+或者在终端执行:
+
+```bash
+cd entry
+ohpm install
+```
+
+方法二:直接链接源码
+
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
+
+
+### 3.配置 CMakeLists 和引入 TouchIdPackage
+
+> 若使用的是 <= 4.4.1-0.0.3 版本,请跳过本章。
+
+打开 `entry/src/main/cpp/CMakeLists.txt`,添加:
+
+```diff
+project(rnapp)
+cmake_minimum_required(VERSION 3.4.1)
+set(CMAKE_SKIP_BUILD_RPATH TRUE)
+set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
++ set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules")
++ file(REAL_PATH "${NODE_MODULES}" NODE_MODULES)
+set(OH_MODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
+set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules/@rnoh/react-native-openharmony/src/main/cpp")
+set(RNOH_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/generated")
+file(REAL_PATH "${RNOH_CPP_DIR}" RNOH_CPP_DIR)
+set(LOG_VERBOSITY_LEVEL 1)
+set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments")
+set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie")
+set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
+
+set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use
+add_compile_definitions(WITH_HITRACE_SYSTRACE)
+
+# Add include directory for screen_capture generated headers
+include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../../../screen_capture/src/main/cpp/generated")
+
+add_subdirectory("${RNOH_CPP_DIR}" ./rn)
+
+# RNOH_BEGIN: manual_package_linking_1
+add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-safe-area-context/src/main/cpp" ./safe-area)
+# add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../../../../screen_capture/src/main/cpp" ./screen-capture)
+# RNOH_END: manual_package_linking_1
+
+# Add screen_capture generated cpp files directly
+set(SCREEN_CAPTURE_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../screen_capture/src/main/cpp/generated")
+file(GLOB SCREEN_CAPTURE_GENERATED_CPP "${SCREEN_CAPTURE_GENERATED_DIR}/RNOH/generated/turbo_modules/*.cpp")
+message(STATUS "ScreenCapture generated cpp files: ${SCREEN_CAPTURE_GENERATED_CPP}")
+
+file(GLOB GENERATED_CPP_FILES "${CMAKE_CURRENT_SOURCE_DIR}/generated/*.cpp") # this line is needed by codegen v1
+
+add_library(rnoh_app SHARED
+ ${GENERATED_CPP_FILES}
+ ${SCREEN_CAPTURE_GENERATED_CPP}
+ "./PackageProvider.cpp"
+ "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp"
+)
+target_link_libraries(rnoh_app PUBLIC rnoh)
+
+# RNOH_BEGIN: manual_package_linking_2
++ target_link_libraries(rnoh_app PUBLIC rnoh_safe_area)
++ target_link_libraries(rnoh_app PUBLIC screen_capture)
+# RNOH_END: manual_package_linking_2
+
+```
+
+### 4.在 ArkTs 侧引入 TouchIdPackage
+
+打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
+
+```diff
+ ...
++ import type {RNPackageContext, RNPackage} from '@rnoh/react-native-openharmony/ts';
++ import {SafeAreaViewPackage} from '@react-native-oh-tpl/react-native-safe-area-context/ts'
++ import {ScreenCapturePackage} from '../../../../screen_capture/src/main/ets/ScreenCapturePackage'
+
+export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
+ return [
+ + new SafeAreaViewPackage(ctx),
+ + new ScreenCapturePackage(ctx),
+ ];
+}
+```
+
+
+## 运行
+
+点击右上角的 `sync` 按钮
+
+或者在终端执行:
+
+```bash
+cd entry
+ohpm install
+```
+
+然后编译、运行即可。
+
+## 约束与限制
+
+### 兼容性
+
+要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
+
+在以下版本验证通过:
+
+1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112;
+2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71;
+3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112;
+
+### 权限要求
+
+(填入相关权限配置)
+
+Add the following permissions to their respective files:
+
+In your `module.json5`
+
+```
+ "requestPermissions": [
+ {
+ "name": "ohos.permission.PRIVACY_WINDOW"
+ }
+ ]
+```
+
+## API
+
+> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
+
+> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ---- | ----------- | ---- | -------- | -------- | ------------------ |
+| disallowScreenshot | 是否可以截屏 | function | yes | ios/andriod | yes |
+| keepAwake | 是否保持屏幕唤醒 | function | yes | ios/andriod | yes |
+
+## API 参数介绍
+
+### disallowScreenshot(newState: boolean);
+* **newState**: boolean类型,切换状态的参数
+
+### keepAwake(newState: boolean);
+* **newState**: boolean类型,切换状态的参数
+## 属性
+
+> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
+
+> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
+
+
+
+
+
+
+
+## 开源协议
+
+本项目基于 [The MIT License (MIT)](https://github.com/recepkocur/react-native-screen-capture?tab=readme-ov-file#license) ,请自由地享受和参与开源。
--
Gitee
From 10e0702b3ec452a05591343fb38fe8f3bb73eda9 Mon Sep 17 00:00:00 2001
From: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
Date: Wed, 21 Jan 2026 14:24:36 +0800
Subject: [PATCH 02/14] =?UTF-8?q?docs:=20=E6=96=B0=E5=A2=9Ereact-native-sc?=
=?UTF-8?q?reen-capture=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
---
zh-cn/react-native-screen-capture.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/zh-cn/react-native-screen-capture.md b/zh-cn/react-native-screen-capture.md
index bfb4323a..61555161 100644
--- a/zh-cn/react-native-screen-capture.md
+++ b/zh-cn/react-native-screen-capture.md
@@ -351,6 +351,7 @@ In your `module.json5`
- ios/android不支持`useFaceID`参数,该参数仅用于鸿蒙平台,用于控制是否使用人脸识别功能。 -->
+
## 开源协议
本项目基于 [The MIT License (MIT)](https://github.com/recepkocur/react-native-screen-capture?tab=readme-ov-file#license) ,请自由地享受和参与开源。
--
Gitee
From dbdfc3a844f0a295e793f9d133a76d3ed246b079 Mon Sep 17 00:00:00 2001
From: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
Date: Wed, 21 Jan 2026 14:26:41 +0800
Subject: [PATCH 03/14] =?UTF-8?q?docs:=20=E6=96=B0=E5=A2=9Ereact-native-sc?=
=?UTF-8?q?reen-capture=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
zh-cn/react-native-screen-capture.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/zh-cn/react-native-screen-capture.md b/zh-cn/react-native-screen-capture.md
index 61555161..5b88f21d 100644
--- a/zh-cn/react-native-screen-capture.md
+++ b/zh-cn/react-native-screen-capture.md
@@ -352,6 +352,7 @@ In your `module.json5`
- ios/android不支持`useFaceID`参数,该参数仅用于鸿蒙平台,用于控制是否使用人脸识别功能。 -->
+
## 开源协议
本项目基于 [The MIT License (MIT)](https://github.com/recepkocur/react-native-screen-capture?tab=readme-ov-file#license) ,请自由地享受和参与开源。
--
Gitee
From d5fb813665e8b5890a048e87faaef9f93ab868b7 Mon Sep 17 00:00:00 2001
From: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
Date: Wed, 21 Jan 2026 14:42:18 +0800
Subject: [PATCH 04/14] =?UTF-8?q?docs:=20=E6=96=B0=E5=A2=9Ereact-native-sc?=
=?UTF-8?q?reen-capture=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
---
en/react-native-screen-capture.md | 49 +++-------------------------
zh-cn/react-native-screen-capture.md | 31 ++----------------
2 files changed, 6 insertions(+), 74 deletions(-)
diff --git a/en/react-native-screen-capture.md b/en/react-native-screen-capture.md
index f3deae64..7185b196 100644
--- a/en/react-native-screen-capture.md
+++ b/en/react-native-screen-capture.md
@@ -310,62 +310,21 @@ In your `module.json5`
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
| disallowScreenshot | Whether to disallow screenshots | function | yes | ios/andriod | yes |
| keepAwake | Whether to keep the device awake | function | yes | ios/andriod | yes |
+
## API Parameters Introduction
+
### disallowScreenshot(newState: boolean);
* **newState**: A parameter of type boolean, used to switch the state.
-
+
### keepAwake(newState: boolean);
* **newState**: A parameter of type boolean, used to switch the state.
-
+
## Properties
> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
-
-
## License
This project is licensed under [The MIT License (MIT)](https://github.com/recepkocur/react-native-screen-capture?tab=readme-ov-file#license).
diff --git a/zh-cn/react-native-screen-capture.md b/zh-cn/react-native-screen-capture.md
index 5b88f21d..467769c5 100644
--- a/zh-cn/react-native-screen-capture.md
+++ b/zh-cn/react-native-screen-capture.md
@@ -318,41 +318,14 @@ In your `module.json5`
### keepAwake(newState: boolean);
* **newState**: boolean类型,切换状态的参数
+
+
## 属性
> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-
-
-
-
-
-
-
## 开源协议
本项目基于 [The MIT License (MIT)](https://github.com/recepkocur/react-native-screen-capture?tab=readme-ov-file#license) ,请自由地享受和参与开源。
--
Gitee
From 6d77915c283fc939e43c4941db249b24abb67713 Mon Sep 17 00:00:00 2001
From: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
Date: Wed, 21 Jan 2026 15:44:58 +0800
Subject: [PATCH 05/14] =?UTF-8?q?docs:=20=E6=96=B0=E5=A2=9Ereact-native-sc?=
=?UTF-8?q?reen-capture=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
---
en/react-native-screen-capture.md | 17 +++++++----------
zh-cn/react-native-screen-capture.md | 21 +++++++++------------
2 files changed, 16 insertions(+), 22 deletions(-)
diff --git a/en/react-native-screen-capture.md b/en/react-native-screen-capture.md
index 7185b196..f24c2e87 100644
--- a/en/react-native-screen-capture.md
+++ b/en/react-native-screen-capture.md
@@ -20,9 +20,7 @@ Please refer to the Releases page of the third-party library for the correspondi
| Version | Release Information |Supported RN Version |
|-----------------------------------|--------------------------------------------| -------------------- |
-| <= 4.4.1-0.0.3@deprecated | [@react-native-oh-tpl/react-native-screen-capture Releases(deprecated)](https://github.com/react-native-oh-library/react-native-screen-capture/releases) | 0.72 |
-| 4.4.2 | [@react-native-ohos/react-native-screen-capture Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-screen-capture/releases) | 0.72 |
-| 4.5.0 | [@react-native-ohos/react-native-screen-capture Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-screen-capture/releases) | 0.77 |
+| 0.2.4 | [@react-native-ohos/react-native-screen-capture](https://gitcode.com/OpenHarmony-RN/rntpc_react-native-screen-capture/releases) | 0.72/0.77
For older versions not published on npm, please refer to the [Installation Guide](/en/tgz-usage-en.md) to install the tgz package.
@@ -93,7 +91,6 @@ class AppDemo extends React.Component {
title={this.state.isVisible ? "关闭屏幕常亮" : "开启屏幕常亮"}
onPress={this.handleKeepAwake}
/>
- 岁月静好
)
};
@@ -183,7 +180,7 @@ Method 2: Directly link to the source code.
> [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md).
-### 3. Configuring CMakeLists and Introducing TouchIdPackage
+### 3. Configuring CMakeLists and Introducing SafeAreaViewPackage,ScreenCapturePackage
> If you are using version <= 4.4.1-0.0.3, please skip this chapter.
@@ -239,7 +236,7 @@ target_link_libraries(rnoh_app PUBLIC rnoh)
# RNOH_END: manual_package_linking_2
```
-### 4. Introducing TouchIdPackage to ArkTS
+### 4. Introducing SafeAreaViewPackage,ScreenCapturePackage to ArkTS
Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
@@ -313,11 +310,11 @@ In your `module.json5`
## API Parameters Introduction
-### disallowScreenshot(newState: boolean);
-* **newState**: A parameter of type boolean, used to switch the state.
+### disallowScreenshot(state: boolean);
+* **state**: A parameter of type boolean, used to switch the state.
-### keepAwake(newState: boolean);
-* **newState**: A parameter of type boolean, used to switch the state.
+### keepAwake(state: boolean);
+* **state**: A parameter of type boolean, used to switch the state.
## Properties
diff --git a/zh-cn/react-native-screen-capture.md b/zh-cn/react-native-screen-capture.md
index 467769c5..713958f3 100644
--- a/zh-cn/react-native-screen-capture.md
+++ b/zh-cn/react-native-screen-capture.md
@@ -20,9 +20,7 @@
| 三方库版本 | 发布信息 |Supported RN Version |
|---------------------------|--------------------------------------------| -------------------- |
-| <= 4.4.1-0.0.3@deprecated | [@react-native-oh-tpl/react-native-screen-capture Releases(deprecated)](https://github.com/react-native-oh-library/react-native-screen-capture/releases) | 0.72 |
-| 4.4.2 | [@react-native-ohos/react-native-screen-capture Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-screen-capture/releases) | 0.72 |
-| 4.5.0 | [@react-native-ohos/react-native-screen-capture Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-screen-capture/releases) | 0.77 |
+| 0.2.4 | [@react-native-ohos/react-native-screen-capture](https://gitcode.com/OpenHarmony-RN/rntpc_react-native-screen-capture/releases) | 0.72/0.77
对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。
@@ -91,7 +89,6 @@ class AppDemo extends React.Component {
title={this.state.isVisible ? "关闭屏幕常亮" : "开启屏幕常亮"}
onPress={this.handleKeepAwake}
/>
- 岁月静好
)
};
@@ -183,7 +180,7 @@ ohpm install
> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
-### 3.配置 CMakeLists 和引入 TouchIdPackage
+### 3.配置 CMakeLists 和引入 SafeAreaViewPackage,ScreenCapturePackage
> 若使用的是 <= 4.4.1-0.0.3 版本,请跳过本章。
@@ -240,7 +237,7 @@ target_link_libraries(rnoh_app PUBLIC rnoh)
```
-### 4.在 ArkTs 侧引入 TouchIdPackage
+### 4.在 ArkTs 侧引入 SafeAreaViewPackage,ScreenCapturePackage
打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
@@ -288,9 +285,9 @@ ohpm install
(填入相关权限配置)
-Add the following permissions to their respective files:
+在entry目录下的module.json5文件中添加权限配置:
-In your `module.json5`
+打开 `module.json5` 文件,添加权限配置:
```
"requestPermissions": [
@@ -313,11 +310,11 @@ In your `module.json5`
## API 参数介绍
-### disallowScreenshot(newState: boolean);
-* **newState**: boolean类型,切换状态的参数
+### disallowScreenshot(state: boolean);
+* **state**: boolean类型,切换状态的参数
-### keepAwake(newState: boolean);
-* **newState**: boolean类型,切换状态的参数
+### keepAwake(state: boolean);
+* **state**: boolean类型,切换状态的参数
## 属性
--
Gitee
From 2d57b7edb542fa771ad1ff28899d1073e2b1a059 Mon Sep 17 00:00:00 2001
From: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
Date: Wed, 21 Jan 2026 15:49:26 +0800
Subject: [PATCH 06/14] =?UTF-8?q?docs:=20=E6=96=B0=E5=A2=9Ereact-native-sc?=
=?UTF-8?q?reen-capture=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
---
en/react-native-screen-capture.md | 2 +-
zh-cn/react-native-screen-capture.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/en/react-native-screen-capture.md b/en/react-native-screen-capture.md
index f24c2e87..9e8b479d 100644
--- a/en/react-native-screen-capture.md
+++ b/en/react-native-screen-capture.md
@@ -324,4 +324,4 @@ In your `module.json5`
## License
-This project is licensed under [The MIT License (MIT)](https://github.com/recepkocur/react-native-screen-capture?tab=readme-ov-file#license).
+This project is licensed under [The MIT License (MIT)](https://github.com/recepkocur/react-native-screen-capture/blob/0.2.3/LICENSE).
diff --git a/zh-cn/react-native-screen-capture.md b/zh-cn/react-native-screen-capture.md
index 713958f3..2cb5b297 100644
--- a/zh-cn/react-native-screen-capture.md
+++ b/zh-cn/react-native-screen-capture.md
@@ -325,4 +325,4 @@ ohpm install
## 开源协议
-本项目基于 [The MIT License (MIT)](https://github.com/recepkocur/react-native-screen-capture?tab=readme-ov-file#license) ,请自由地享受和参与开源。
+本项目基于 [The MIT License (MIT)](https://github.com/recepkocur/react-native-screen-capture/blob/0.2.3/LICENSE) ,请自由地享受和参与开源。
--
Gitee
From fd288c295856fa23e0f5f912ba8a7482cccffb56 Mon Sep 17 00:00:00 2001
From: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
Date: Wed, 21 Jan 2026 16:29:52 +0800
Subject: [PATCH 07/14] =?UTF-8?q?docs:=20=E6=96=B0=E5=A2=9Ereact-native-sc?=
=?UTF-8?q?reen-capture=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
---
en/react-native-screen-capture.md | 4 +---
zh-cn/react-native-screen-capture.md | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/en/react-native-screen-capture.md b/en/react-native-screen-capture.md
index 9e8b479d..c965cf7b 100644
--- a/en/react-native-screen-capture.md
+++ b/en/react-native-screen-capture.md
@@ -124,9 +124,7 @@ This library has been adapted for `Codegen`. Before using it, you need to proact
| | is supporte autolink | Supported RN Version |
|--------------------------------------|-----------------------|----------------------|
-| ~4.5.0 | No | 0.77 |
-| ~4.4.2 | Yes | 0.72 |
-| <= 4.4.1-0.0.3@deprecated | No | 0.72 |
+| 0.2.4 | No | 0.72/0.77 |
Using AutoLink need to be configured according to this document, Autolink Framework Guide Documentation: https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md
diff --git a/zh-cn/react-native-screen-capture.md b/zh-cn/react-native-screen-capture.md
index 2cb5b297..1b369def 100644
--- a/zh-cn/react-native-screen-capture.md
+++ b/zh-cn/react-native-screen-capture.md
@@ -122,9 +122,7 @@ export default AppDemo;
| | 是否支持autolink | RN框架版本 |
|---------------------------------------|-----------------|------------|
-| ~4.5.0 | No | 0.77 |
-| ~4.4.2 | Yes | 0.72 |
-| <= 4.4.1-0.0.3@deprecated | No | 0.72 |
+| 0.2.4 | No | 0.72/0.77 |
使用AutoLink的工程需要根据该文档配置,Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md
--
Gitee
From 5049f03f2e3c02ca6d44a0b211d86f3d55f9c9c3 Mon Sep 17 00:00:00 2001
From: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
Date: Wed, 21 Jan 2026 17:03:27 +0800
Subject: [PATCH 08/14] =?UTF-8?q?docs:=20=E6=96=B0=E5=A2=9Ereact-native-sc?=
=?UTF-8?q?reen-capture=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
---
zh-cn/react-native-screen-capture.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/zh-cn/react-native-screen-capture.md b/zh-cn/react-native-screen-capture.md
index 1b369def..64ec9dfc 100644
--- a/zh-cn/react-native-screen-capture.md
+++ b/zh-cn/react-native-screen-capture.md
@@ -303,8 +303,8 @@ ohpm install
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
-| disallowScreenshot | 是否可以截屏 | function | yes | ios/andriod | yes |
-| keepAwake | 是否保持屏幕唤醒 | function | yes | ios/andriod | yes |
+| disallowScreenshot | 启动或禁用防截屏 | boolean | yes | ios/andriod | yes |
+| keepAwake | 启动或禁用屏幕常亮 | boolean | yes | ios/andriod | yes |
## API 参数介绍
--
Gitee
From ef8945285eb75d2aa52d10dce0a0b521b7b7f354 Mon Sep 17 00:00:00 2001
From: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
Date: Wed, 21 Jan 2026 17:18:48 +0800
Subject: [PATCH 09/14] =?UTF-8?q?docs:=20=E6=96=B0=E5=A2=9Ereact-native-sc?=
=?UTF-8?q?reen-capture=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
---
en/react-native-screen-capture.md | 4 ++--
zh-cn/react-native-screen-capture.md | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/en/react-native-screen-capture.md b/en/react-native-screen-capture.md
index c965cf7b..29c16c8f 100644
--- a/en/react-native-screen-capture.md
+++ b/en/react-native-screen-capture.md
@@ -303,8 +303,8 @@ In your `module.json5`
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
-| disallowScreenshot | Whether to disallow screenshots | function | yes | ios/andriod | yes |
-| keepAwake | Whether to keep the device awake | function | yes | ios/andriod | yes |
+| disallowScreenshot | Whether to disallow screenshots | boolean | yes | ios/andriod | yes |
+| keepAwake | Whether to keep the device awake | boolean | yes | ios/andriod | yes |
## API Parameters Introduction
diff --git a/zh-cn/react-native-screen-capture.md b/zh-cn/react-native-screen-capture.md
index 64ec9dfc..082241a1 100644
--- a/zh-cn/react-native-screen-capture.md
+++ b/zh-cn/react-native-screen-capture.md
@@ -309,10 +309,10 @@ ohpm install
## API 参数介绍
### disallowScreenshot(state: boolean);
-* **state**: boolean类型,切换状态的参数
+* **state**: boolean类型,启动或禁用防截屏
### keepAwake(state: boolean);
-* **state**: boolean类型,切换状态的参数
+* **state**: boolean类型,启动或禁用屏幕常亮
## 属性
--
Gitee
From 614cac64c439e5d81c884f8a2937ed5aaa547b96 Mon Sep 17 00:00:00 2001
From: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
Date: Wed, 21 Jan 2026 17:44:02 +0800
Subject: [PATCH 10/14] =?UTF-8?q?docs:=20=E6=96=B0=E5=A2=9Ereact-native-sc?=
=?UTF-8?q?reen-capture=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
---
en/react-native-screen-capture.md | 4 ++--
zh-cn/react-native-screen-capture.md | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/en/react-native-screen-capture.md b/en/react-native-screen-capture.md
index 29c16c8f..c965cf7b 100644
--- a/en/react-native-screen-capture.md
+++ b/en/react-native-screen-capture.md
@@ -303,8 +303,8 @@ In your `module.json5`
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
-| disallowScreenshot | Whether to disallow screenshots | boolean | yes | ios/andriod | yes |
-| keepAwake | Whether to keep the device awake | boolean | yes | ios/andriod | yes |
+| disallowScreenshot | Whether to disallow screenshots | function | yes | ios/andriod | yes |
+| keepAwake | Whether to keep the device awake | function | yes | ios/andriod | yes |
## API Parameters Introduction
diff --git a/zh-cn/react-native-screen-capture.md b/zh-cn/react-native-screen-capture.md
index 082241a1..970a1eef 100644
--- a/zh-cn/react-native-screen-capture.md
+++ b/zh-cn/react-native-screen-capture.md
@@ -303,8 +303,8 @@ ohpm install
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
-| disallowScreenshot | 启动或禁用防截屏 | boolean | yes | ios/andriod | yes |
-| keepAwake | 启动或禁用屏幕常亮 | boolean | yes | ios/andriod | yes |
+| disallowScreenshot | 启动或禁用防截屏 | function | yes | ios/andriod | yes |
+| keepAwake | 启动或禁用屏幕常亮 | function | yes | ios/andriod | yes |
## API 参数介绍
--
Gitee
From aecf397bb6c2c9be52607987e7e6b1af83efd58e Mon Sep 17 00:00:00 2001
From: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
Date: Thu, 22 Jan 2026 10:03:16 +0800
Subject: [PATCH 11/14] =?UTF-8?q?docs:=20=E6=96=B0=E5=A2=9Ereact-native-sc?=
=?UTF-8?q?reen-capture=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
---
en/react-native-screen-capture.md | 4 +---
zh-cn/react-native-screen-capture.md | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/en/react-native-screen-capture.md b/en/react-native-screen-capture.md
index c965cf7b..5c4f52c2 100644
--- a/en/react-native-screen-capture.md
+++ b/en/react-native-screen-capture.md
@@ -64,14 +64,12 @@ class AppDemo extends React.Component {
const newState = !this.state.screenOn;
this.setState({ screenOn: newState });
disallowScreenshot(newState);
- console.log('Disallow Screenshot state:', newState);
};
handleKeepAwake = () => {
const newState = !this.state.isVisible;
this.setState({ isVisible: newState });
keepAwake(newState);
- console.log('Keep Awake state:', newState);
};
render() {
@@ -140,7 +138,7 @@ First, use DevEco Studio to open the HarmonyOS project `harmony` in the project
{
...
"overrides": {
- "@rnoh/react-native-openharmony": "file:react-native-openharmony-0.72.90.har"
+ "@rnoh/react-native-openharmony": "./react_native_openharmony"
}
}
```
diff --git a/zh-cn/react-native-screen-capture.md b/zh-cn/react-native-screen-capture.md
index 970a1eef..d45ea25f 100644
--- a/zh-cn/react-native-screen-capture.md
+++ b/zh-cn/react-native-screen-capture.md
@@ -62,14 +62,12 @@ class AppDemo extends React.Component {
const newState = !this.state.screenOn;
this.setState({ screenOn: newState });
disallowScreenshot(newState);
- console.log('Disallow Screenshot state:', newState);
};
handleKeepAwake = () => {
const newState = !this.state.isVisible;
this.setState({ isVisible: newState });
keepAwake(newState);
- console.log('Keep Awake state:', newState);
};
render() {
@@ -138,7 +136,7 @@ export default AppDemo;
{
...
"overrides": {
- "@rnoh/react-native-openharmony": "file:react-native-openharmony-0.72.90.har"
+ "@rnoh/react-native-openharmony": "./react_native_openharmony"
}
}
```
--
Gitee
From b736ef7e3b7d5161db236832d0a225c0281835bf Mon Sep 17 00:00:00 2001
From: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
Date: Thu, 22 Jan 2026 11:36:19 +0800
Subject: [PATCH 12/14] =?UTF-8?q?docs:=20=E6=96=B0=E5=A2=9Ereact-native-sc?=
=?UTF-8?q?reen-capture=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
---
en/react-native-screen-capture.md | 108 +++++++++++----------------
zh-cn/react-native-screen-capture.md | 105 +++++++++++---------------
2 files changed, 87 insertions(+), 126 deletions(-)
diff --git a/en/react-native-screen-capture.md b/en/react-native-screen-capture.md
index 5c4f52c2..a2ef8726 100644
--- a/en/react-native-screen-capture.md
+++ b/en/react-native-screen-capture.md
@@ -22,8 +22,6 @@ Please refer to the Releases page of the third-party library for the correspondi
|-----------------------------------|--------------------------------------------| -------------------- |
| 0.2.4 | [@react-native-ohos/react-native-screen-capture](https://gitcode.com/OpenHarmony-RN/rntpc_react-native-screen-capture/releases) | 0.72/0.77
-For older versions not published on npm, please refer to the [Installation Guide](/en/tgz-usage-en.md) to install the tgz package.
-
Go to the project directory and execute the following instruction:
@@ -51,11 +49,11 @@ The following code shows the basic use scenario of the repository:
```js
import React, { Component, useState } from 'react';
import { Alert, View, Button, Text } from 'react-native';
-import {disallowScreenshot,keepAwake} from 'react-native-screen-capture';
+import { disallowScreenshot, keepAwake } from 'react-native-screen-capture';
class AppDemo extends React.Component {
state = {
- isVisible: true,
+ isVisible: false,
screenOn: false, // false 表示允许截屏,true 表示禁止截屏
};
@@ -114,21 +112,9 @@ const styles = StyleSheet.create({
export default AppDemo;
```
-## Use Codegen
-
-This library has been adapted for `Codegen`. Before using it, you need to proactively generate the bridge code for the third-party library. For details, please refer to the [Codegen Usage Documentation](/en/codegen.md).
## Link
-
-| | is supporte autolink | Supported RN Version |
-|--------------------------------------|-----------------------|----------------------|
-| 0.2.4 | No | 0.72/0.77 |
-
-Using AutoLink need to be configured according to this document, Autolink Framework Guide Documentation: https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md
-
-If the version you use supports Autolink and the project has been connected to Autolink, skip the ManualLink configuration.
-
- ManualLink: this step is a guide to manually configure native dependencies.
+ this step is a guide to manually configure native dependencies.
First, use DevEco Studio to open the HarmonyOS project `harmony` in the project directory.
@@ -157,10 +143,9 @@ Open `entry/oh-package.json5` file and add the following dependencies:
```json
"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react-native-openharmony-0.72.90.har",
- "@react-native-oh-tpl/react-native-safe-area-context": "file:../../node_modules/@react-native-oh-tpl/react-native-safe-area-context/harmony/safe_area.har",
- "react-native-screen-capture": "file:../screen_capture"
- }
+ "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
+ "@react-native-ohos/react-native-screen-capture": "file:../../node_modules/@react-native-ohos/react-native-screen-capture/harmony/screen_capture.har"
+}
```
Click the `sync` button in the upper right corner.
@@ -176,80 +161,77 @@ Method 2: Directly link to the source code.
> [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md).
-### 3. Configuring CMakeLists and Introducing SafeAreaViewPackage,ScreenCapturePackage
-
-> If you are using version <= 4.4.1-0.0.3, please skip this chapter.
+### 3. Configuring CMakeLists and Introducing ScreenCapturePackage
Open `entry/src/main/cpp/CMakeLists.txt` and add the following code:
-```diff
project(rnapp)
cmake_minimum_required(VERSION 3.4.1)
set(CMAKE_SKIP_BUILD_RPATH TRUE)
set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
-+ set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules")
-+ file(REAL_PATH "${NODE_MODULES}" NODE_MODULES)
-set(OH_MODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
-set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules/@rnoh/react-native-openharmony/src/main/cpp")
-set(RNOH_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/generated")
-file(REAL_PATH "${RNOH_CPP_DIR}" RNOH_CPP_DIR)
+set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules")
++ set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
+set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp")
set(LOG_VERBOSITY_LEVEL 1)
set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments")
set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie")
-set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
-
set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use
add_compile_definitions(WITH_HITRACE_SYSTRACE)
-# Add include directory for screen_capture generated headers
-include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../../../screen_capture/src/main/cpp/generated")
-
add_subdirectory("${RNOH_CPP_DIR}" ./rn)
# RNOH_BEGIN: manual_package_linking_1
-add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-safe-area-context/src/main/cpp" ./safe-area)
-# add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../../../../screen_capture/src/main/cpp" ./screen-capture)
+add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package)
++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-screen-capture/src/main/cpp" ./screen-capture)
# RNOH_END: manual_package_linking_1
-# Add screen_capture generated cpp files directly
-set(SCREEN_CAPTURE_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../screen_capture/src/main/cpp/generated")
-file(GLOB SCREEN_CAPTURE_GENERATED_CPP "${SCREEN_CAPTURE_GENERATED_DIR}/RNOH/generated/turbo_modules/*.cpp")
-message(STATUS "ScreenCapture generated cpp files: ${SCREEN_CAPTURE_GENERATED_CPP}")
-
-file(GLOB GENERATED_CPP_FILES "${CMAKE_CURRENT_SOURCE_DIR}/generated/*.cpp") # this line is needed by codegen v1
+file(GLOB GENERATED_CPP_FILES "./generated/*.cpp")
add_library(rnoh_app SHARED
${GENERATED_CPP_FILES}
- ${SCREEN_CAPTURE_GENERATED_CPP}
"./PackageProvider.cpp"
"${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp"
)
target_link_libraries(rnoh_app PUBLIC rnoh)
# RNOH_BEGIN: manual_package_linking_2
-+ target_link_libraries(rnoh_app PUBLIC rnoh_safe_area)
-+ target_link_libraries(rnoh_app PUBLIC screen_capture)
+target_link_libraries(rnoh_app PUBLIC rnoh_sample_package)
++ target_link_libraries(rnoh_app PUBLIC rnoh_screen_capture)
# RNOH_END: manual_package_linking_2
+
```
-### 4. Introducing SafeAreaViewPackage,ScreenCapturePackage to ArkTS
+打开 `entry/src/main/cpp/PackageProvider.cpp`,添加:
+
+```diff
+#include "RNOH/PackageProvider.h"
+#include "SamplePackage.h"
++ #include "generated/RNOH/generated/BaseScreenCapturePackage.h"
+
+using namespace rnoh;
+
+std::vector> PackageProvider::getPackages(Package::Context ctx) {
+ return {
+ std::make_shared(ctx),
++ std::make_shared(ctx)
+ };
+}
+```
+
+### 4.Introducing ScreenCapturePackage to ArkTS
Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
```diff
...
-+ import type {RNPackageContext, RNPackage} from '@rnoh/react-native-openharmony/ts';
-+ import {SafeAreaViewPackage} from '@react-native-oh-tpl/react-native-safe-area-context/ts'
-+ import {ScreenCapturePackage} from '../../../../screen_capture/src/main/ets/ScreenCapturePackage'
++ import { ScreenCapturePackage } from '@react-native-ohos/react-native-screen-capture/ts';
export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
return [
- + new SafeAreaViewPackage(ctx),
- + new ScreenCapturePackage(ctx),
++ new ScreenCapturePackage(ctx)
];
}
```
-
## Running
@@ -287,10 +269,10 @@ In your `module.json5`
```
"requestPermissions": [
- {
- "name": "ohos.permission.PRIVACY_WINDOW"
- }
- ]
+ {
+ "name": "ohos.permission.PRIVACY_WINDOW"
+ }
+ ]
```
## API
@@ -307,16 +289,14 @@ In your `module.json5`
## API Parameters Introduction
### disallowScreenshot(state: boolean);
-* **state**: A parameter of type boolean, used to switch the state.
+* **state**: A parameter of type boolean, used to switch the state. False denote allow screenshots, true denote disallow screenshots.
### keepAwake(state: boolean);
-* **state**: A parameter of type boolean, used to switch the state.
+* **state**: A parameter of type boolean, used to switch the state. False denote allow screen sleep, true denote keep screen awake.
-## Properties
+## Known Issues
-> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
-
-> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
+## Others
## License
diff --git a/zh-cn/react-native-screen-capture.md b/zh-cn/react-native-screen-capture.md
index d45ea25f..a403996e 100644
--- a/zh-cn/react-native-screen-capture.md
+++ b/zh-cn/react-native-screen-capture.md
@@ -22,8 +22,6 @@
|---------------------------|--------------------------------------------| -------------------- |
| 0.2.4 | [@react-native-ohos/react-native-screen-capture](https://gitcode.com/OpenHarmony-RN/rntpc_react-native-screen-capture/releases) | 0.72/0.77
-对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。
-
进入到工程目录并输入以下命令:
@@ -49,11 +47,11 @@ yarn add @react-native-ohos/react-native-screen-capture
```js
import React, { Component, useState } from 'react';
import { Alert, View, Button, Text } from 'react-native';
-import {disallowScreenshot,keepAwake} from 'react-native-screen-capture';
+import { disallowScreenshot, keepAwake } from 'react-native-screen-capture';
class AppDemo extends React.Component {
state = {
- isVisible: true,
+ isVisible: false,
screenOn: false, // false 表示允许截屏,true 表示禁止截屏
};
@@ -112,21 +110,9 @@ const styles = StyleSheet.create({
export default AppDemo;
```
-## 使用 Codegen
-
-本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。
-
## Link
-| | 是否支持autolink | RN框架版本 |
-|---------------------------------------|-----------------|------------|
-| 0.2.4 | No | 0.72/0.77 |
-
-使用AutoLink的工程需要根据该文档配置,Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md
-
-如您使用的版本支持 Autolink,并且工程已接入 Autolink,可跳过ManualLink配置。
-
- ManualLink: 此步骤为手动配置原生依赖项的指导
+ 此步骤为手动配置原生依赖项的指导
首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony`。
@@ -156,10 +142,9 @@ export default AppDemo;
```json
"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react-native-openharmony-0.72.90.har",
- "@react-native-oh-tpl/react-native-safe-area-context": "file:../../node_modules/@react-native-oh-tpl/react-native-safe-area-context/harmony/safe_area.har",
- "react-native-screen-capture": "file:../screen_capture"
- }
+ "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
+ "@react-native-ohos/react-native-screen-capture": "file:../../node_modules/@react-native-ohos/react-native-screen-capture/harmony/screen_capture.har"
+}
```
点击右上角的 `sync` 按钮
@@ -176,9 +161,7 @@ ohpm install
> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
-### 3.配置 CMakeLists 和引入 SafeAreaViewPackage,ScreenCapturePackage
-
-> 若使用的是 <= 4.4.1-0.0.3 版本,请跳过本章。
+### 3.配置 CMakeLists 和引入 ScreenCapturePackage
打开 `entry/src/main/cpp/CMakeLists.txt`,添加:
@@ -187,70 +170,69 @@ project(rnapp)
cmake_minimum_required(VERSION 3.4.1)
set(CMAKE_SKIP_BUILD_RPATH TRUE)
set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
-+ set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules")
-+ file(REAL_PATH "${NODE_MODULES}" NODE_MODULES)
-set(OH_MODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
-set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules/@rnoh/react-native-openharmony/src/main/cpp")
-set(RNOH_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/generated")
-file(REAL_PATH "${RNOH_CPP_DIR}" RNOH_CPP_DIR)
+set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules")
++ set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
+set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp")
set(LOG_VERBOSITY_LEVEL 1)
set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments")
set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie")
-set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
-
set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use
add_compile_definitions(WITH_HITRACE_SYSTRACE)
-# Add include directory for screen_capture generated headers
-include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../../../screen_capture/src/main/cpp/generated")
-
add_subdirectory("${RNOH_CPP_DIR}" ./rn)
# RNOH_BEGIN: manual_package_linking_1
-add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-safe-area-context/src/main/cpp" ./safe-area)
-# add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../../../../screen_capture/src/main/cpp" ./screen-capture)
+add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package)
++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-screen-capture/src/main/cpp" ./screen-capture)
# RNOH_END: manual_package_linking_1
-# Add screen_capture generated cpp files directly
-set(SCREEN_CAPTURE_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../screen_capture/src/main/cpp/generated")
-file(GLOB SCREEN_CAPTURE_GENERATED_CPP "${SCREEN_CAPTURE_GENERATED_DIR}/RNOH/generated/turbo_modules/*.cpp")
-message(STATUS "ScreenCapture generated cpp files: ${SCREEN_CAPTURE_GENERATED_CPP}")
-
-file(GLOB GENERATED_CPP_FILES "${CMAKE_CURRENT_SOURCE_DIR}/generated/*.cpp") # this line is needed by codegen v1
+file(GLOB GENERATED_CPP_FILES "./generated/*.cpp")
add_library(rnoh_app SHARED
${GENERATED_CPP_FILES}
- ${SCREEN_CAPTURE_GENERATED_CPP}
"./PackageProvider.cpp"
"${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp"
)
target_link_libraries(rnoh_app PUBLIC rnoh)
# RNOH_BEGIN: manual_package_linking_2
-+ target_link_libraries(rnoh_app PUBLIC rnoh_safe_area)
-+ target_link_libraries(rnoh_app PUBLIC screen_capture)
+target_link_libraries(rnoh_app PUBLIC rnoh_sample_package)
++ target_link_libraries(rnoh_app PUBLIC rnoh_screen_capture)
# RNOH_END: manual_package_linking_2
```
-### 4.在 ArkTs 侧引入 SafeAreaViewPackage,ScreenCapturePackage
+打开 `entry/src/main/cpp/PackageProvider.cpp`,添加:
+
+```diff
+#include "RNOH/PackageProvider.h"
+#include "SamplePackage.h"
++ #include "generated/RNOH/generated/BaseScreenCapturePackage.h"
+
+using namespace rnoh;
+
+std::vector> PackageProvider::getPackages(Package::Context ctx) {
+ return {
+ std::make_shared(ctx),
++ std::make_shared(ctx)
+ };
+}
+```
+
+### 4.在 ArkTs 侧引入 ScreenCapturePackage
打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
```diff
...
-+ import type {RNPackageContext, RNPackage} from '@rnoh/react-native-openharmony/ts';
-+ import {SafeAreaViewPackage} from '@react-native-oh-tpl/react-native-safe-area-context/ts'
-+ import {ScreenCapturePackage} from '../../../../screen_capture/src/main/ets/ScreenCapturePackage'
++ import { ScreenCapturePackage } from '@react-native-ohos/react-native-screen-capture/ts';
export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
return [
- + new SafeAreaViewPackage(ctx),
- + new ScreenCapturePackage(ctx),
++ new ScreenCapturePackage(ctx)
];
}
```
-
## 运行
@@ -287,10 +269,10 @@ ohpm install
```
"requestPermissions": [
- {
- "name": "ohos.permission.PRIVACY_WINDOW"
- }
- ]
+ {
+ "name": "ohos.permission.PRIVACY_WINDOW"
+ }
+ ]
```
## API
@@ -307,17 +289,16 @@ ohpm install
## API 参数介绍
### disallowScreenshot(state: boolean);
-* **state**: boolean类型,启动或禁用防截屏
+* **state**: boolean类型,启动或禁用防截屏,false表示允许截屏,true表示禁止截屏。
### keepAwake(state: boolean);
-* **state**: boolean类型,启动或禁用屏幕常亮
+* **state**: boolean类型,启动或禁用屏幕常亮,false表示允许屏幕休眠,true表示保持屏幕常亮。
+## 遗留问题
-## 属性
-> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
+## 其他
-> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
## 开源协议
--
Gitee
From 02a14e4b992b9ae094297775a22f8e02218597bd Mon Sep 17 00:00:00 2001
From: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
Date: Thu, 22 Jan 2026 14:18:49 +0800
Subject: [PATCH 13/14] =?UTF-8?q?docs:=20=E6=96=B0=E5=A2=9Ereact-native-sc?=
=?UTF-8?q?reen-capture=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
---
en/react-native-screen-capture.md | 5 +++--
zh-cn/react-native-screen-capture.md | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/en/react-native-screen-capture.md b/en/react-native-screen-capture.md
index a2ef8726..a103c8f9 100644
--- a/en/react-native-screen-capture.md
+++ b/en/react-native-screen-capture.md
@@ -165,6 +165,7 @@ Method 2: Directly link to the source code.
Open `entry/src/main/cpp/CMakeLists.txt` and add the following code:
+```diff
project(rnapp)
cmake_minimum_required(VERSION 3.4.1)
set(CMAKE_SKIP_BUILD_RPATH TRUE)
@@ -206,14 +207,14 @@ target_link_libraries(rnoh_app PUBLIC rnoh_sample_package)
```diff
#include "RNOH/PackageProvider.h"
#include "SamplePackage.h"
-+ #include "generated/RNOH/generated/BaseScreenCapturePackage.h"
++ #include "ScreenCapturePackage.h"
using namespace rnoh;
std::vector> PackageProvider::getPackages(Package::Context ctx) {
return {
std::make_shared(ctx),
-+ std::make_shared(ctx)
++ std::make_shared(ctx)
};
}
```
diff --git a/zh-cn/react-native-screen-capture.md b/zh-cn/react-native-screen-capture.md
index a403996e..3e67290b 100644
--- a/zh-cn/react-native-screen-capture.md
+++ b/zh-cn/react-native-screen-capture.md
@@ -207,14 +207,14 @@ target_link_libraries(rnoh_app PUBLIC rnoh_sample_package)
```diff
#include "RNOH/PackageProvider.h"
#include "SamplePackage.h"
-+ #include "generated/RNOH/generated/BaseScreenCapturePackage.h"
++ #include "ScreenCapturePackage.h"
using namespace rnoh;
std::vector> PackageProvider::getPackages(Package::Context ctx) {
return {
std::make_shared(ctx),
-+ std::make_shared(ctx)
++ std::make_shared(ctx)
};
}
```
--
Gitee
From d1c95549ff49995c0c72a192e7e86d6183cb44b3 Mon Sep 17 00:00:00 2001
From: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
Date: Thu, 22 Jan 2026 15:19:56 +0800
Subject: [PATCH 14/14] =?UTF-8?q?docs:=20=E6=96=B0=E5=A2=9Ereact-native-sc?=
=?UTF-8?q?reen-capture=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: xinbingchao <10921250+xinbingchao@user.noreply.gitee.com>
---
en/react-native-screen-capture.md | 2 +-
zh-cn/react-native-screen-capture.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/en/react-native-screen-capture.md b/en/react-native-screen-capture.md
index a103c8f9..beb07455 100644
--- a/en/react-native-screen-capture.md
+++ b/en/react-native-screen-capture.md
@@ -266,7 +266,7 @@ Verified in the following versions.
Add the following permissions to their respective files:
-In your `module.json5`
+In your `entry/src/main/module.json5`
```
"requestPermissions": [
diff --git a/zh-cn/react-native-screen-capture.md b/zh-cn/react-native-screen-capture.md
index 3e67290b..4cf34c17 100644
--- a/zh-cn/react-native-screen-capture.md
+++ b/zh-cn/react-native-screen-capture.md
@@ -265,7 +265,7 @@ ohpm install
在entry目录下的module.json5文件中添加权限配置:
-打开 `module.json5` 文件,添加权限配置:
+打开 `entry/src/main/module.json5` 文件,添加权限配置:
```
"requestPermissions": [
--
Gitee