Step 3 Add the configuration file to your project

更新时间:
复制 MD 格式

This topic describes how to manually import the mPaaS configuration file into your project using the native AAR method.

Complete the three steps below in order:

  1. Enter configuration information and upload a signed APK.

  2. Download the configuration to your local machine.

  3. Add the configuration file to your project.

Enter configuration information and upload a signed APK

  1. On the application list page, click the application card — for example, the mPaaS Demo application created in the previous step — to open the product page.

    0

    • The application name appears in the upper-left corner. Use this to switch between applications.

    • On the Product Details page, click Android Code Configuration to open the application configuration panel.

  2. In the application configuration panel, click the Download Configuration File link to open the Code Configuration page.

  3. On the Code Configuration page, enter the Package Name — for example, com.mpaas.demo — and upload the compiled, signed APK. To quickly generate a signed APK, see Generate a signed APK for the console.

    3

Download the configuration to your local machine

On the Code Configuration page, click Download Configuration after entering the required information to download the mPaaS configuration file.

The configuration file is a compressed package. The package contains a .config file and an encrypted image named yw_1222.jpg.

5

Before proceeding, verify the package contents based on your deployment environment:

  • Public cloud: Open the base64Code field in the .config file and confirm it is not empty. The yw_1222.jpg file is deprecated in public cloud environments — you can ignore it.

    Xnip2022-07-07_16-03-01

  • Apsara Stack: You do not need to check base64Code. Instead, manually generate an Apsara Stack encrypted image and replace the yw_1222.jpg file downloaded from the console. For instructions, see Generate an encrypted image (Apsara Stack configuration file).

Add the configuration file to your project

Note

If you use the component-based method (Portal & Bundle), see Introduction to the component-based access procedure.

Prerequisites

To use the native AAR method, you must have a native development project.

Procedure

  1. In Android Studio, open your existing project, then click mPaaS > Native AAR Access.

  2. In the access panel, under Import App Configuration, click Start Import.

  3. Select I have downloaded the configuration file (Ant-mpaas-xxxx.config) from the console and am ready to import it into the project, then click Next.

  4. In the Import mPaaS Configuration File window, select the app module to import, choose the configuration file, then click Finish.

  5. A confirmation message appears in Android Studio. You have now manually imported the configuration file.