All Products
Search
Document Center

Solve conflict with dependency on security guard

Last Updated: Mar 10, 2021

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.

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

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

    • AAR method

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

           
      1. mpaascomponents {
      2. excludeDependencies = [
      3. "com.alipay.android.phone.thirdparty:securityguard-build"
      4. ]
      5. }
  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.

           
      1. {
      2. "appId":"xxx",
      3. "appKey":"xxx",
      4. "base64Code":"xxx",
      5. "packageName":"xxx",
      6. "rootPath":"xxx",
      7. "workspaceId":"xxx",
      8. "rpcGW":"xxx",
      9. "mpaasapi":"xxx",
      10. "pushPort":"xxx",
      11. "pushGW":"xxx",
      12. "logGW":"xxx",
      13. "syncport":"xxx",
      14. "syncserver":"xxx",
      15. "authCode": "1234"
      16. }
    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.

           
      1. <meta-data
      2. android:name="security_guard_auth_code"
      3. android:value="1234" />

      Note: Image conflict supports the following baseline versions:
      • 10.1.32.7 or later versions
      • ,10.1.60 (beta version requires beta.7 or higher), and
      • 10.1.68