本示例基于业务风险检测服务能力,提供场景(防作弊、反欺诈、违规内容检测等)的业务风险决策能力。
| Files | Last commit | Last update |
|---|---|---|
| 2 years ago | ||
| 9 months ago | ||
| 1 year ago | ||
| 9 months ago | ||
| 2 years ago | ||
| 9 months ago | ||
| 2 years ago | ||
| 1 year ago | ||
| 9 months ago | ||
| 9 months ago |
Implement business intelligent risk detection (ArkTS)
Overview
This sample code demonstrates how to use the BusinessRiskIntelligentDetection API in your application for fraud detection, simulated click detection and enhanced simulated click detection.
The API that you need to use is packaged into @kit.DeviceSecurityKit.
Preview

How to Configure and Use
Configuring the Sample App in DevEco Studio
- Create a project. Under the project, create an app.
- Open the sample app and set bundleName in the app.json5 file to the app package name configured in AppGallery Connect.
- Enable Fraud detection in AppGallery Connect. For details, please refer to here. No activation is required for Simulated click detection or Enhanced simulated click detection.
Using the Sample App
-
Before running the sample app, connect the device to the network.
-
Run the sample app:
- Tap FraudRiskDetect to obtain the fraud detection result.
- Tap SimulatedClickRiskDetect to obtain the simulated click detection result.
- Tap SimulatedClickRiskEnhancedDetect to obtain the enhanced simulated click detection result.
If the result is obtained successfully, it will be displayed on the page. If the result fails to be obtained, an error code will be displayed on the page.
-
After obtaining the detection result:
- Fraud detection result should be parsed and signature-verified on the server side.
- Simulated click detection result should be parsed on the server side.
- Enhanced simulated click detection result should be parsed and signature-verified on the server side.
Project Directory
└──entry/src/main/ets // Code area.
└── entryability
│ └── EntryAbility.ets // Entry point class.
└── model
│ └── FraudRiskDetectModel.ets // Class for obtaining the fraud detection result.
│ └── SimulatedClickRiskDetectModel.ets // Class for obtaining the simulated click detection result.
| └── SimulatedClickRiskEnhancedDetectModel.ets // Class for obtaining the enhanced simulated click detection result.
└── pages
└── Index.ets // Home page, where the business risk detection result can be obtained.
How to Implement
This demo illustrates how to call the business risk detection functions on a page.
- Call the businessRiskIntelligentDetection.detectFraudRisk() method to obtain the fraud detection result. For details, please refer to FraudRiskDetectModel.ets.
- Call the businessRiskIntelligentDetection.detectSimulatedClickRisk() method to obtain the simulated click detection result. For details, please refer to SimulatedClickRiskDetectModel.ets.
- Call the businessRiskIntelligentDetection.detectSimulatedClickRiskEnhanced() method to obtain the enhanced simulated click detection result. For details, please refer to SimulatedClickRiskDetectModel.ets.
Reference
- entry\src\main\ets\entryability\EntryAbility.ets
- entry\src\main\ets\model\FraudRiskDetectModel.ets
- entry\src\main\ets\model\SimulatedClickRiskDetectModel.ets
- entry\src\main\ets\model\SimulatedClickRiskEnhancedDetectModel.ets
- entry\src\main\ets\pages\Index.ets
Required Permissions
None
Dependencies
The device where the sample app runs must connect to the network.
Constraints
-
The sample app is only supported on phones and tablets with standard systems.
-
The HarmonyOS version must be HarmonyOS 6.0.2 Beta1 or later.
-
The DevEco Studio version must be DevEco Studio 6.0.2 Beta1 or later.
-
The HarmonyOS SDK version must be HarmonyOS 6.0.2 Beta1 SDK or later.