All Products
Search
Document Center

Mobile Platform as a Service:Use mPaaS plug-in

Last Updated:Apr 09, 2024

The GUI-based mPaaS Plugin supports quick access to mPaaS and provides functions for convenient use.

The mPaaS Plugin provides the following functions: Native AAR Access, Componentized Access, Basic Tools, Help and Build.

  • An access panel is available for the Native AAR Access and Componentized Access functions. The access wizard on the access panel can guide you to add mPaaS to your project through a specific access mode. After the access is complete, you can also update the baseline and manage components on the access panel.

  • The mPaaS Plugin provides the following Basic Tools: Generate Encryption Image (Apsara Stack Config File), Generate Signed APK, and Generate UC Key Signing Info. These tools assist you to prepare necessary information for easy use of mPaaS functions.

  • The mPaaS Plugin provides the following Help functions: Log Diagnostic Tool, Common Issues, and View Documentation, to support you to troubleshoot common issues.

  • Build allows you to build a project after you get access to mPaaS.

Add a configuration file

The main work of the access process is to add configuration files to the project. The mPaaS plug-in supports manual import to add configuration files. For manual import, you need to download the configuration file in the console, and then manually add it to the project through the mPaaS plug-in.

Manual import

The manual upload method supports Ant Technology users, Alibaba Cloud users, and Ant Private Cloud users.

Prerequisites

  • You have an Alibaba Cloud account with the mPaaS service activated.

  • You have created an application on the mPaaS console. For more information about application creation, see Create mPaaS application on the console.

  • An Android project already exists.

Procedure

  1. Open the existing project in Android Studio and then click mPaaS > Native AAR Access or Componentized Access. On the access panel, click Start Import below Import App configuration.

  2. Select I have not downloaded the configuration file and click Next.

  3. Select the configuration file and click Finish. The configuration file is imported to the project. After the process finishes, you will receive a prompt message that the configuration file has been imported successfully.

AAR access

Procedure

  1. Open the existing project in Android Studio, click mPaaS > Native AAR access.

  2. Import App configuration. On the access panel, click Start Import, follow manual import to add a configuration file.

Follow-up steps

  1. Add and update a baseline

  2. Configure and update components

Componentized access

Procedure

  1. Open the existing project in Android Studio and click mPaaS > Componentized Access.

  2. Import App configuration.

    On the access panel, click Start Import, follow Add a configuration file to add a configuration file.

  3. Convert the project. If the project is a native Android project, you need to convert the project.

    On the access panel, click Install mPaaS Portal. In the Install mPaaS Portal window, select the location and configuration file of the original project and then click OK.

Follow-up steps

  1. Add and update a baseline

  2. Configure and update components

Add and update a baseline

Update to a common baseline

Procedure

  1. Click mPaaS > Native AAR Access or Componentized Access to open the access panel. Then click Start Config below Access/update the baseline.

  2. Select the baseline version to be updated and click OK. After the update is complete, a success message is displayed.

Follow-up steps

Click the updated baseline on the access panel. You will see the baseline version in the baseline selection window.

Update to a custom baseline

We provide baselines specific to all customers, such as 10.1.32, 10.1.60 and 10.1.68. If you need custom mPaaS functions, you can contact our staff and make a request. We will customize baselines for you as demanded. mPaaS staff will deliver the ID of your custom baseline. You can obtain the custom baseline after you enter this ID in the mPaaS Plugin.

Prerequisites

mPaaS V2.19111217 or later version is required in Android Studio. See Update the mPaaS Plugin to check the current mPaaS Plugin version and learn how to update the mPaaS Plugin.

Procedure

  1. Delete the mpaas_package.json file of the project in Android Studio.

  2. Click mPaaS > Native AAR Access or Component-Based Access to open the access panel. Then click Start Config below Add and update baseline.

  3. In the baseline update dialog, select Custom baseline and enter the custom baseline ID.

  4. Click OK. The custom baseline is added.

Configure and update components

mPaaS component management (AAR)

Prerequisites

You have updated the baseline.

Procedure

  1. Click mPaaS > Native AAR Access to open the access panel. Then click Start configuration below Configure and update components.

  2. In the displayed management window, click mPaaS Component Management. Then select the module and components to be managed and click OK. If your project contains multiple modules, you can select individual modules and select components for each module respectively.

  3. After the components are added, click OK.

Component Management

Procedure

  1. Click mPaaS > Component-Based Access to open the access panel. Then click Start Config below Configure and update components.

  2. In the displayed component management window, click the corresponding buttons to install the required components.

Basic tools

Basic Tools provide the following functions: Generate Encryption Image (Apsara Stack Config File), Generate Signed APK, and Generate UC Key Signing Info.

Generate the encryption image (Apsara Stack configuration file)

When some components of the mPaaS Plug-in get access to the network, the contents must be encrypted to ensure security.

  • The image named as yw_1222.jpg provides a secret key for encryption and decryption. The components of mPaaS Plugin automatically use this image for encryption and decryption.

  • Since this encrypted image has been deprecated in public cloud environments, public cloud users can ignore this section.

The following describes how to generate and use the encryption image yw_1222.jpg.

Preparations

The encrypted image is bound with the APK signature file. Therefore, you need to prepare the signed APK of your Portal project. For detailed signing instructions, see Android official website: Sign your app.

    Note

    This APK uses the same signature file as the Release Version APK.

    The generated encrypted image can only be used in this APK project.

Generation

You can use mPaaS Plugin to generate the encryption image.

  1. In Android Studio, click mPaaS > Basic Tools > Generate Encryption Image (Apsara Stack Config File).

  2. In Release Apk, select the signed APK of the Portal project. The RSA field is automatically filled.

  3. In mPaaS Config File, select the .config file of the Portal project. The workSpaceId, appId and packageName fields are automatically filled. If these fields are not automatically filled, enter the corresponding configurations according to the contents in the .config file of the project.

  4. Fill the appsecret field.

    Note

    As the server administrator, you can query the corresponding appsecret of appid on the console.

  5. In the jpg Version field, enter the version number of the security guard image.

    Note

    Check the securityguard version in the build.gradle file under the main module of the Portal project. Enter 4 if the version is lower than 5.4 (such as securityguard-build:5.1.38.180402194514 in the baseline). Otherwise, enter 5.

  6. In outPath, select an output path for the security guard image yw_1222.jpg. The generated encryption image will be stored under this local path.

  7. Click OK to generate the encryption image.

Usage

The following describes how to use the encryption image:

  1. Store the encryption image yw_1222.jpg in the res/drawable folder of the Portal project.

  2. If ProGuard is used, you need to avoid confusion of the encryption image.

    1. Check whether build.gradle contains the following configurations:

      minifyEnabled true
      shrinkResources true
    2. If yes, you need to create a keep.xml file under res/raw to avoid confusion of the encryption image. The file content is as follows:

      <?xml version="1.0" encoding="utf-8"?>
      <resources xmlns:tools="http://schemas.android.com/tools"
      tools:keep="@drawable/yw_1222*" /><!--tools:discard="@layout/unused2"-->

Generate blue shield image

If the absBase64Code value in the .config file you downloaded from the mPaaS console is empty, perform the following steps to generate a Blue Shield image.

Important

If you are in a public cloud environment and the absBase64Code value in the .config file downloaded from the mPaaS console is empty, please confirm that you have uploaded a correctly signed APK before downloading and download it again. For more details, see Step 3 add configuration files to your project.

Click mPaaS > Basic tools > Generate blue shield encrypted pictures, Enter relevant information to generate a blue shield image.

Description of key input items in the preceding figure:

  • Release Apk : The release apk package packaged by the mPaaS project, you must sign the package.

  • MD5: After the release apk package is uploaded, it will be filled in automatically, that is, the public md5 key of the apk package.

  • mPaaS config File: Click Download Configuration on the mPaaS console to download the .config file and import it.

  • appSecret: View in the mPaaS console.

  • Other items appId, packageName, outPath will be automatically identified and filled in after the above information is passed in.

Finally, add the generated image to the assets directory of the project.

Generate signed APK

When you attempt to obtain the configuration file on the mPaaS console, you need to upload a signed APK file. The procedure will be suspended if you have not created a project or compiled the signed APK. The mPaaS Plugin provides the function Generate Signed APK to simplify this procedure in Android Studio. This function can generate a signed APK after you input necessary parameters for APK signing.

Generation

  1. Click mPaaS > Basic tools > Generate Signed APK used in Console to open the Build Signed APK page.

  2. In the Build Signed APK page, enter the required configuration information.

  3. Click OK The signed APK is generated.

  4. Click Reveal in Finder You can find the generated APK file. The file name is mpaas-signed.apk. The generation of signed APK is complete.

    Open the APK file. You can find the file is small and has been signed.

Help

Log diagnostic tool

  1. Click mPaaS > Help > Log Diagnostic Tool.

  2. Copy and paste the log to be analyzed in the text box and click Next.

  3. Wait until the analysis is completed.

  4. View the analysis result.

    The analysis result contains Cause and Solution. You can modify your codes according to the cause and solution if any issue is found.

  5. After the modification, click Finish to close the window.

FAQ

Click mPaaS > Help > Common Issues to go to Common Android access issues. You can check common issues that you may encounter when you access Android.

View document

Click mPaaS > Help > View documents to go to mPaaS Document Center. You can view the documents of all components.

Build

In Android Studio, select mPaaS > Build. Then you can build your project.