732143c8Add on Mar 18History
FilesLast commitLast update
11 months ago
10 months ago
11 months ago
8 months ago
8 months ago
11 months ago
11 months ago
11 months ago
11 months ago
README

Secure Development with the ArkWeb Component

Overview

This sample accompanies the "Secure Development with the ArkWeb Component" best practice.

Effect

N/A

How to Use

You can learn how to develop this project by referring to the best practice.

Project Directory

├──arkwebsecurity/src/main/ets
│  ├──arkwebsecurityability
│  │  └──ArkWebSecurityAbility.ets                       // Program entry
│  ├──arkwebsecuritybackupability 
│  │  └──ArkWebSecurityBackupAbility.ets                 // Backup capability 
│  └──pages
│     ├──ErrorSamples 
│     │  ├──GeolocationShow.ets                          // Location permission 
│     │  ├──GetURL.ets                                   // Custom trustlist verification 
│     │  ├──JavaScriptProxy.ets                          // JSBridge permission 
│     │  ├──LoadURL.ets                                  // External input filtering 
│     │  ├──LoadURLWithSensitiveData.ets                 // URL concatenation with sensitive data 
│     │  ├──MixedMode.ets                                // Mixed content loading 
│     │  ├──OnInterceptRequest.ets                       // File URL verification 
│     │  ├──OnOverrideUrlLoading.ets                     // Page reload override 
│     │  ├──OnSslErrorEventReceive.ets                   // SSL error event handling 
│     │  ├──PermissionRequest.ets                        // Multimedia permission 
│     │  ├──PostMessage.ets                              // Web page message transfer 
│     │  ├──Redirection.ets                              // Insecure page redirection 
│     │  ├──RunJavaScript.ets                            // External JS script loading 
│     │  ├──RunJavaScript2.ets                           // JS code concatenation and loading 
│     │  ├──SetCookie.ets                                // Cookie management 
│     │  ├──SetURLTrustList.ets                          // URL trustlist configuration 
│     │  └──WebDebug.ets                                 // Unexpanded resource directory
│     ├──GeolocationShow.ets                             // Location permission 
│     ├──GetURL.ets                                      // Custom trustlist verification 
│     ├──Index.ets                                       // Home page 
│     ├──LoadURL.ets                                     // External input filtering 
│     ├──MixedMode.ets                                   // Mixed content loading 
│     ├──OnInterceptRequest.ets                          // File URL verification 
│     ├──OnSslErrorEventReceive.ets                      // SSL error event handling 
│     ├──PermissionRequest.ets                           // Multimedia permission 
│     ├──PostMessage.ets                                 // Web page message transfer 
│     ├──RunJavaScript2.ets                              // JS code concatenation and loading 
│     ├──SetCookie.ets                                   // Cookie management 
│     └──SetURLTrustList.ets                             // URL trustlist configuration 
└──arkwebsecurity/src/main/resources                     // Application resource directory

How to Implement

Use the ArkWeb component to implement functionalities such as page loading, JSBridge registration and use, and data transmission.

Required Permissions

N/A

Constraints

  1. This sample is only supported on Huawei phones running standard systems.
  2. The HarmonyOS version must be HarmonyOS 6.0.0 Release or later.
  3. The DevEco Studio version must be DevEco Studio 6.0.0 Release or later.
  4. The HarmonyOS SDK version must be HarmonyOS 6.0.0 Release SDK or later.