Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

630 B
Raw Blame
import { Platform } from 'react-native';
import { requireOptionalNativeModule } from 'expo-modules-core';

interface NativeInstallSource {
  /** Absent on binaries released before the Play routing fix. */
  installerPackageName?: () => string | null;
}

const native = Platform.OS === 'android'
  ? requireOptionalNativeModule<NativeInstallSource>('CindyAppInstaller') : null;

/** Read the installed package's source, rather than a value mutable by JS OTA. */
export function isGooglePlayInstallation(): boolean {
  try {
    return native?.installerPackageName?.() === 'com.android.vending';
  } catch {
    return false;
  }
}