All Products
Search
Document Center

Mobile Platform as a Service:Solve conflict with dependency on security guard

Last Updated:Oct 14, 2022

Conflict description

If you are using mPaaS along with other Alibaba SDKs, there may be a conflict with the SecurityGuardSDK.

Solution

mPaaS allows you to remove the mPaaS SecurityGuard library and use the security guard library provided by other Alibaba SDKs.

Procedure

  1. Confirm the version of the SecurityGuard SDK currently used by mPaaS in order to select other Alibaba security guard libraries that are the same or similar.

    'SecurityGuardSDK-without-resources-5.4.2009'
  2. Get the group:artifact information for the SecurityGuard SDK used by mPaaS.

    'com.alipay.android.phone.thirdparty:securityguard-build'
  3. Remove SecurityGuard from mPaaS.

    • AAR method

      configurations {
      all*.exclude group:'com.alipay.android.phone.thirdparty', module: 'securityguard-build'
      }
    • mPaaS Inside and Portal & Bundle

      mpaascomponents {
      excludeDependencies = [
         "com.alipay.android.phone.thirdparty:securityguard-build"
      ]
      }
  4. Resolve image conflicts.

    1. Add the image suffix to config and compile.

      Add "authCode": "1234" to the config file, where 1234 can be any string; we recommend you to use 4 digits.

      {
      "appId":"xxx",
      "appKey":"xxx",
      "base64Code":"xxx",
      "packageName":"xxx",
      "rootPath":"xxx",
      "workspaceId":"xxx",
      "rpcGW":"xxx",
      "mpaasapi":"xxx",
      "pushPort":"xxx",
      "pushGW":"xxx",
      "logGW":"xxx",
      "syncport":"xxx",
      "syncserver":"xxx",
      "authCode": "1234"
      }
    2. Verify that the image suffix is in effect.

      Check if the generated apk has yw_1222_1234.jpg image in drawable and the following information in AndroidManifest by decompiling.

      <meta-data
      android:name="security_guard_auth_code"
      android:value="1234" />
      Note

      Image conflict resolution only supports 10.1.32.7 and above, 10.1.60 (beta version requires beta.7 and above) and 10.1.68 baseline versions.