code: public boolean validateSignature(@NonNull Context context, @NonNull String packageName) {
          if (isDebug(context)) {
              return true;
          }
  
          PackageInfo packageInfo;
          try {
              packageInfo = context.getPackageManager().getPackageInfo(packageName,
                      PackageManager.GET_SIGNATURES);
          } catch (PackageManager.NameNotFoundException e) {
              return false;
          }
  
          for (Signature signature : packageInfo.signatures) {
              String hashedSignature = Utility.sha1hash(signature.toByteArray());
              if (!validAppSignatureHashes.contains(hashedSignature)) {
                  return false;
              }
          }
          return true;
      }
docs: Validates the app signature required or returns true if in debug.