code: public static boolean init(Application app, Activity activity) {
  
          Application appTmp = app;
          Activity activityTmp = activity;
  
          // 两个参数都为null，直接抛异常 | Two parameters are null, throwing exceptions directly
          if (appTmp == null && activityTmp == null) {
              HMSAgentLog.e("the param of method HMSAgent.init can not be null !!!");
              return false;
          }
  
          // 如果application实例为null，则从activity里面取 | If the creator instance is null, it is taken from the activity
          if (appTmp == null) {
              appTmp = activityTmp.getApplication();
          }
  
          // 如果application实例仍然为null，抛异常 | Throws an exception if the creator instance is still null
          if (appTmp == null) {
              HMSAgentLog.e("the param of method HMSAgent.init app can not be null !!!");
              return false;
          }
  
          // activity 已经失效，则赋值null | Assignment NULL if activity has been invalidated
          if (activityTmp != null && activityTmp.isFinishing()) {
              activityTmp = null;
          }
  
          // 检查HMSAgent 和 HMSSDK 版本匹配关系 | Check hmsagent and HMSSDK version matching relationships
          if (!checkSDKVersion(appTmp)) {
              return false;
          }
  
          HMSAgentLog.i("init HMSAgent " + CURVER + " with hmssdkver " + HuaweiApiAvailability.HMS_SDK_VERSION_CODE);
  
          // 初始化activity管理类 | Initializing Activity Management Classes
          ActivityMgr.INST.init(appTmp, activityTmp);
  
          // 初始化HuaweiApiClient管理类 | Initialize Huaweiapiclient Management class
          ApiClientMgr.INST.init(appTmp);
  
          return true;
      }
docs: 初始化方法，建议在Application onCreate里面调用 | Initialization method, it is recommended to call in creator OnCreate
  @param app 应用程序 | Application
  @param activity 当前界面 | Current activity
  @return true：成功 false：失败 | True: Success false: Failed