Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
);
}
}
}
);
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(
async function update(projectMetadata, credentials, userCredentialsIds) {
await Credentials.updateCredentialsForPlatform(
PLATFORMS.IOS,
credentials,
userCredentialsIds,
projectMetadata
);
log.warn('Encrypted credentials and saved to the Expo servers');
}
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);
}
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);