Resolve Security Guard conflicts

更新时间:
复制 MD 格式

Conflict description

If you use mPaaS with other Alibaba Software Development Kits (SDKs), a conflict with Security Guard (SecurityGuardSDK) may occur.

Solution

mPaaS lets you remove the mPaaS Security Guard library and use the one provided by the other Alibaba SDK.

Procedure

  1. You can check the version of the Security Guard SDK used by your mPaaS. This information helps you select the same or a similar Security Guard library from another Alibaba SDK.

    'SecurityGuardSDK-without-resources-5.4.2009'
  2. You can check the group:artifact information of the Security Guard SDK used by mPaaS.

    'com.alipay.android.phone.thirdparty:securityguard-build'
  3. You can remove the mPaaS Security Guard.

    • AAR method

      configurations {
      all*.exclude group:'com.alipay.android.phone.thirdparty', module: 'securityguard-build'
      }
    • Component-based (Portal & Bundle)

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

    1. You can add an image suffix to the config file and then compile it. In the config file, add "authCode": "1234". The value 1234 can be any string. A four-digit number is a good choice.

      {
      "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. To verify that the image suffix is effective, you can decompile the generated APK file. Then, check whether the yw_1222_1234.jpg image exists in the drawable directory and whether the AndroidManifest file contains the following information.

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

      Resolving image conflicts is supported on baseline versions 10.1.32.7 and later, 10.1.60 (beta.7 or later for beta versions), 10.1.68, and 10.2.3.