AndroidConfig constructor

AndroidConfig({
  1. required String? expectedPackageName,
  2. required List<String>? expectedSigningCertificateHashes,
  3. List<String>? supportedAlternativeStores = const <String>[],
})

Constructor checks whether expectedPackageName and expectedSigningCertificateHashes are provided. Both arguments are MANDATORY.

Implementation

AndroidConfig({
  required this.expectedPackageName,
  required this.expectedSigningCertificateHashes,
  this.supportedAlternativeStores = const <String>[],
})  : assert(
        expectedPackageName != null,
        'expectedPackageName cannot be null.',
      ),
      assert(
        expectedSigningCertificateHashes != null,
        'expectedSigningCertificateHashes cannot be null.',
      ),
      assert(
        expectedSigningCertificateHashes!.isNotEmpty,
        'expectedSigningCertificateHashes cannot be empty.',
      ),
      assert(
        supportedAlternativeStores != null,
        'supportedAlternativeStores cannot be null.',
      ),
      assert(
        _areSigningHashesBase64(expectedSigningCertificateHashes!),
        'some of expectedSigningCertificateHashes are not in base64 form.',
      ),
      assert(
          _areSigningHashesValid(expectedSigningCertificateHashes!),
          'some of expectedSigningCertificateHashes do NOT contain '
          'SHA-256 value.');