Static Environment Switching

更新时间:
复制 MD 格式

Prerequisites

An app built on the mPaaS framework is required. For more information, see mPaaS Framework > Quick start.

Static environment switching requires easyconfig, which works as follows:

  • Modifies the meta attributes of the AndroidManifest workspace.

  • Modifies the mpaas.properties file in the assets directory.

  • If the mPaaS project configuration file contains a non-empty base64 attribute, generates the Security Guard encrypted image yw_1222.jpg.

Public cloud

To switch workspaces in a public cloud environment:

  1. Verify that the build.gradle file in the project root directory contains the following dependencies:

    Note

    These dependency versions may be updated in future releases.

     classpath 'com.alipay.android:android-gradle-plugin:3.0.0.9.13'
     // The version must be later than 2.8.4
     classpath 'com.android.boost.easyconfig:easyconfig:2.8.4'
  2. Verify that the build.gradle file in the main module (android main module) contains the following configuration. Note the order:

     apply plugin: 'com.alipay.portal'
     // Place this after 'com.alipay.portal'
     apply plugin: 'com.alipay.apollo.baseline.update'
  3. Download the .config file for the workspace from the console. For more information, see Create an application in the console > Download the configuration file.

  4. Add the downloaded .config file to the main module (android main module) directory, as shown in the following figure:

    修改11.png

    Important

    Keep only the configuration file for the target workspace.

Apsara Stack

To switch workspaces in an Apsara Stack environment:

  1. Verify that the build.gradle file in the project root directory contains the following dependencies:

    Note

    These dependency versions may be updated in future releases.

     classpath 'com.alipay.android:android-gradle-plugin:3.0.0.9.13'
     // The version must be later than 2.8.4
     classpath 'com.android.boost.easyconfig:easyconfig:2.8.4'
  2. Verify that the build.gradle file of the main module (android main module) contains the following configuration. Note the order:

     apply plugin: 'com.alipay.portal'
     // Place this after 'com.alipay.portal'
     apply plugin: 'com.alipay.apollo.baseline.update'
  3. Download the .config file for the corresponding workspace from the console. For more information, see Create an application in the console > Download the configuration file.

  4. Add the downloaded .config file to the android main module directory, as shown in the following figure:

    修改22.png

    Important

    Keep only the configuration file for the target workspace.

  5. Use the mPaaS plugin to generate the yw_1222.jpg encrypted image. For more information, see Encrypted Image (Apsara Stack).