Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.
HarmonyOS
An app calls the API of Device Security Kit to obtain fraudulent app information for anti-fraud purposes, such as reporting fraudulent apps.
Currently, this capability is supported only on phones and tablets. It is available only to anti-fraud apps.

Process description:
A user selects the function of reporting fraudulent apps in your app.
Your app calls the API of Device Security Kit to start the fraudulent app picker.
The user selects fraudulent apps in the fraudulent app picker.
Device Security Kit calls the callback function to notify your app of the selection result. Your app then processes the service based on the fraudulent app information.
The following table lists the API for obtaining fraudulent apps. For more information about the API, please refer to API Reference.
| API | Description |
|---|---|
| selectFraudApp(context: common.Context, options?: AntifraudAppOptions): Promise<AntifraudAppResult> | Obtains fraudulent app information. |
When preparing for the development, you need to apply for the ohos.permission.USE_FRAUD_APP_PICKER permission.
Only apps in the trustlist can apply for this permission. For details about how to apply for this permission, please refer to Requesting Restricted Permissions.
You need to inform users about the purpose, methods, and scope of data usage.
Import the Device Security Kit module and related public modules.
- import { BusinessError } from '@kit.BasicServicesKit';
- import antifraudPicker from '@hms.security.antifraudPicker';
- import hilog from '@ohos.hilog';
- import { common } from '@kit.AbilityKit';
Call the selectFraudApp API to obtain the fraudulent app information.
- const TAG = 'AntifraudPickerJsTest';
-
- // Request to obtain the fraudulent app information and process the service.
- let options: antifraudPicker.AntifraudAppOptions = {
- maxSelectNumber: 5
- };
- try {
- hilog.info(0x0000, TAG, 'SelectFraudApp begin.');
- let context = this.getUIContext().getHostContext();
- const result: antifraudPicker.AntifraudAppResult = await antifraudPicker.selectFraudApp(context, options);
- } catch (err) {
- let e: BusinessError = err as BusinessError;
- hilog.error(0x0000, TAG, 'SelectFraudApp failed: %{public}d %{public}s', e.code, e.message);
- }
Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
Quick start
Helps you find desired resources with ease.