Overview
mPaaS uses the Wireless Security Guard client SDK and its image service as its core security dependency. Starting from Android baseline 10.2.3.23, mPaaS supports switching to Blue Shield as an alternative—useful when compliance requirements exceed what Wireless Security Guard covers.
This guide covers how to upgrade your baseline and configure Blue Shield.
Prerequisites
Before you begin, confirm the following:
Android Studio Flamingo | 2022.2.1 or later
mPaaS plugin 3.0.230609 or later
Baseline 10.2.3.23 or later
If your baseline is 10.1.68 or earlier, upgrade it before proceeding. See Upgrade the baseline.
Upgrade the baseline
Upgrade to baseline 10.2.3.23 or later.
Current baseline: 10.1.68 main baseline
Follow the mPaaS 10.2.3 Upgrade Guide to upgrade to the latest 10.2.3 baseline and complete the required adaptations.
Current baseline: custom baseline
Search for DingTalk group number 145930007362 to join the support group, or submit a ticket to consult with the after-sales and technical support team about switching to the 10.2.3 baseline.
Switch to Blue Shield
Step 1: Remove the Wireless Security Guard component
In the build.gradle file of your app module, exclude the securityguard-build dependency using Gradle's exclude.
// app/build.gradle
configurations.all {
exclude group: 'com.alipay.android.phone.thirdparty', module:
'securityguard-build'
}Step 2: Add the Blue Shield component
Add the following dependencies to your app/build.gradle file.
Blue Shield SDK dependency:
implementation 'com.mpaas.android:blueshield'// Blue Shield SDK dependencyUpgrade the easyconfig plugin:
classpath 'com.android.boost.easyconfig:easyconfig:2.8.0'Step 3: Generate a Blue Shield image (Optional)
Check whether absBase64Code in the config file has a value. If it does, skip this step.
If you are using a public cloud environment and absBase64Code in the .config file downloaded from the mPaaS console is empty, confirm that you uploaded a correctly signed APK before downloading the file. Then download the file again. For more information, see Fill in configuration information and upload a signed APK.
Use the tool below and enter the required information to generate the Blue Shield image:


Required input fields:
Release APK: The release APK packaged from your mPaaS project. The APK must be signed.
MD5: Auto-filled after you upload the release APK. This is the
public MD5 keyof the APK.mPaaS config file: Click Download Configuration in the mPaaS console to download the .config file, then import it here.
appSecret: Find this value in the mPaaS console, as shown below.

appId, packageName, and outPath are identified and filled in automatically after you provide the fields above.
Add the generated image to the assets folder of your project.
Step 4: Verify the Blue Shield image
Drag the APK into Android Studio and check whether abs_1222.jpg appears in the assets directory.

If abs_1222.jpg is present, the Blue Shield image is configured correctly. If it is missing, verify that you generated the image and added it to the assets folder, then rebuild the project.
Step 5: Configure the switch to Blue Shield
Add the following meta-data entry to AndroidManifest.xml:
<!--Description of the value: antGroup specifies Blue Shield-->
<meta-data
android:name="mpaas_security_mode"
android:value="antGroup"/>The mpaas_security_mode option controls the RPC signing tool.
Libraries that support Blue Shield
Mobile Gateway Service
Mobile Scheduling Center
Mobile Sync Service
Multimedia
Mini Program
Location Service
Unified Storage
Some internal dependent components
Ant Dynamic Card
Regression testing
After switching to Blue Shield, use the preceding change checklist to run regression testing on the libraries listed above to confirm the switch is working correctly.