How to use the @expo/xdl.Credentials.updateCredentialsForPlatform 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 / commands / build / AndroidBuilder.js View on Github external
await this._clearCredentials();
        }
        // just continue
      } else {
        const { keystorePath, keystoreAlias, keystorePassword, keyPassword } = answers;

        // read the keystore
        const keystoreData = await fs.readFile(keystorePath);

        const credentials = {
          keystore: keystoreData.toString('base64'),
          keystoreAlias,
          keystorePassword,
          keyPassword,
        };
        await Credentials.updateCredentialsForPlatform(
          ANDROID,
          credentials,
          [],
          credentialMetadata
        );
      }
    }
  }
github expo / expo-cli / packages / expo-cli / src / commands / google-play / AppSigningOptIn.js View on Github external
);
    const { confirm: confirmUpload } = await prompt([
      {
        type: 'confirm',
        name: 'confirm',
        message: 'Is App Signing by Google Play enabled succesfully?',
        default: false,
      },
    ]);
    if (!confirmUpload) {
      await this.cleanup(true);
      log.error('Aborting, no changes were applied');
      process.exit(1);
    }

    await Credentials.updateCredentialsForPlatform(
      'android',
      {
        keystorePassword: this.uploadKeystoreCredentials.keystorePassword,
        keystoreAlias: this.uploadKeystoreCredentials.keyAlias,
        keyPassword: this.uploadKeystoreCredentials.keyPassword,
        keystore: (await fs.readFile(this.uploadKeystore)).toString('base64'),
      },
      [],
      {
        platform: 'android',
        username,
        experienceName: `@${username}/${exp.slug}`,
      }
    );

    log(
github expo / expo-cli / packages / expo-cli / src / commands / build / ios / credentials / index.js View on Github external
async function update(projectMetadata, credentials, userCredentialsIds) {
  await Credentials.updateCredentialsForPlatform(
    PLATFORMS.IOS,
    credentials,
    userCredentialsIds,
    projectMetadata
  );
  log.warn('Encrypted credentials and saved to the Expo servers');
}
github expo / expo-cli / packages / expo-cli / src / commands / build / AndroidBuilder.js View on Github external
async collectAndValidateCredentialsFromCI(credentialMetadata) {
    const credentials = {
      keystore: (await fs.readFile(this.options.keystorePath)).toString('base64'),
      keystoreAlias: this.options.keystoreAlias,
      keystorePassword: process.env.EXPO_ANDROID_KEYSTORE_PASSWORD,
      keyPassword: process.env.EXPO_ANDROID_KEY_PASSWORD,
    };
    await Credentials.updateCredentialsForPlatform(ANDROID, credentials, [], credentialMetadata);
  }
github expo / expo-cli / packages / expo-cli / src / commands / client / index.js View on Github external
const updateCredentialsFn = async listOfCredentials => {
          if (listOfCredentials.length === 0) {
            return;
          }
          const credentials = listOfCredentials.reduce(
            (acc, credential) => {
              return { ...acc, ...credential };
            },
            { teamId: context.team.id }
          );
          await Credentials.updateCredentialsForPlatform(IOS, credentials, [], {
            username: user.username,
            experienceName,
            bundleIdentifier,
          });
        };
        const CredentialsUpdater = new Updater(updateCredentialsFn);