How to use the @expo/xdl.IosCodeSigning.findP12CertSerialNumber function in @expo/xdl

To help you get started, we’ve selected a few @expo/xdl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / expo-cli / packages / expo-cli / src / credentials / views / IosDistCert.ts View on Github external
async function promptForDistCert(ctx: Context): Promise {
  const userProvided = await askForUserProvided(distCertSchema);
  if (userProvided) {
    try {
      userProvided.distCertSerialNumber = IosCodeSigning.findP12CertSerialNumber(
        userProvided.certP12,
        userProvided.certPassword
      );
    } catch (error) {
      log.warn('Unable to access certificate serial number.');
      log.warn('Make sure that certificate and password are correct.');
      log.warn(error);
    }
    return userProvided;
  } else {
    return null;
  }
}
github expo / expo-cli / packages / expo-cli / src / commands / build / ios / credentials / index.js View on Github external
async function getDistributionCertSerialNumber(projectMetadata) {
  const { certP12, certPassword } = await fetch(projectMetadata, true);
  if (certP12 && certPassword) {
    return IosCodeSigning.findP12CertSerialNumber(certP12, certPassword);
  } else {
    return null;
  }
}
github expo / expo-cli / packages / expo-cli / src / commands / build / ios / credentials / prompt / promptForCredentials.js View on Github external
async function _calculateMetadata({ certP12, certPassword }) {
  if (!(certP12 && certPassword)) {
    return null;
  }
  const distCertSerialNumber = IosCodeSigning.findP12CertSerialNumber(certP12, certPassword);
  return { distCertSerialNumber };
}
github expo / turtle / src / builders / utils / ios / adhocBuild.ts View on Github external
async function prepareAdHocBuildCredentials(job: IJob) {
  if (process.platform !== 'darwin') {
    throw new Error('This function should be called only on macOS!');
  }

  const { bundleIdentifier } = job.config;
  const {
    certP12,
    certPassword,
    teamId,
    appleSession,
    udids,
    provisioningProfileId,
  } = job.credentials;

  const certSerialNumber = IosCodeSigning.findP12CertSerialNumber(certP12, certPassword);
  const args = [
    ...(provisioningProfileId ? ['--profile-id', provisioningProfileId] : []),
    teamId,
    udids!.join(','),
    bundleIdentifier,
    certSerialNumber || '__last__',
  ];

  try {
    const credentials = await runFastlaneAction(
      travelingFastlane.manageAdHocProvisioningProfile,
      args,
      { env: { FASTLANE_SESSION: appleSession } },
    );

    logger.info('New ad hoc provisioning profile successfully created');
github expo / expo-cli / packages / expo-cli / src / credentials / views / IosDistCert.ts View on Github external
function formatDistCert(distCert: IosDistCredentials, credentials: IosCredentials): string {
  const appCredentials = credentials.appCredentials.filter(
    cred => cred.distCredentialsId === distCert.id
  );
  const joinApps = appCredentials
    .map(i => `${i.experienceName} (${i.bundleIdentifier})`)
    .join(', ');

  const usedByString = joinApps
    ? `\n    ${chalk.gray(`used by ${joinApps}`)}`
    : `\n    ${chalk.gray(`not used by any apps`)}`;

  let serialNumber = distCert.distCertSerialNumber;
  try {
    if (!serialNumber) {
      serialNumber = IosCodeSigning.findP12CertSerialNumber(
        distCert.certP12,
        distCert.certPassword
      );
    }
  } catch (error) {
    serialNumber = chalk.red('invalid serial number');
  }
  return `Distribution Certificate (Cert ID: ${distCert.certId}, Serial number: ${serialNumber}, Team ID: ${distCert.teamId})${usedByString}`;
}