private static Provider getConscryptProviderWithReflection() throws GeneralSecurityException {
    try {
      Class<?> conscrypt = Class.forName("org.conscrypt.Conscrypt");
      Method getProvider = conscrypt.getMethod("newProvider");
      return (Provider) getProvider.invoke(null);
    } catch (ClassNotFoundException
        | NoSuchMethodException
        | IllegalArgumentException
        | InvocationTargetException
        | IllegalAccessException e) {
      throw new GeneralSecurityException("Failed to get Conscrypt provider", e);
    }
  }
Tries to get the Conscrypt provider using reflection.

<p>Note that this will typically fail on Android, because after ProGuard renames all class and
method names. However, on Android Conscrypt is installed by default and so this code is not
executed.
java_src/src/main/java/com/google/crypto/tink/internal/Random.java