Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
[credentials][android][apiv2] Fix upload keystore (#1911)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkh authored Apr 17, 2020
1 parent bbd34d3 commit 9fd1630
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/expo-cli/src/commands/build/AndroidBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'fs-extra';
import path from 'path';
import untildify from 'untildify';
import { Android, Credentials } from '@expo/xdl';
import { Android, AndroidCredentials, Credentials } from '@expo/xdl';
import chalk from 'chalk';
import get from 'lodash/get';

Expand Down Expand Up @@ -195,9 +195,9 @@ See https://docs.expo.io/versions/latest/distribution/building-standalone-apps/#
// read the keystore
const keystoreData = await fs.readFile(keystorePath);

const credentials = {
const credentials: AndroidCredentials.Keystore = {
keystore: keystoreData.toString('base64'),
keystoreAlias,
keyAlias: keystoreAlias,
keystorePassword,
keyPassword,
};
Expand Down
5 changes: 2 additions & 3 deletions packages/expo-cli/src/commands/google-play/AppSigningOptIn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export default class AppSigningOptInProcess {
{
// @ts-ignore
keystorePassword: this.uploadKeystoreCredentials.keystorePassword,
keystoreAlias: this.uploadKeystoreCredentials.keyAlias,
keyAlias: this.uploadKeystoreCredentials.keyAlias,
keyPassword: this.uploadKeystoreCredentials.keyPassword,
keystore: (await fs.readFile(this.uploadKeystore)).toString('base64'),
},
Expand All @@ -198,8 +198,7 @@ export default class AppSigningOptInProcess {
);

log(
`The original keystore is stored in ${this
.signKeystore}; remove it only if you are sure that Google Play App Signing is enabled for your app.`
`The original keystore is stored in ${this.signKeystore}; remove it only if you are sure that Google Play App Signing is enabled for your app.`
);
if (!this.signKeystoreCredentials) {
throw new Error(
Expand Down
5 changes: 3 additions & 2 deletions packages/xdl/src/credentials/Credentials.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Platform, getConfig } from '@expo/config';
import { ApiV2 } from '../xdl';
import { Keystore } from './AndroidCredentials';

import Api from '../Api';
import UserManager from '../User';
Expand Down Expand Up @@ -109,7 +110,7 @@ async function fetchCredentials(

export async function updateCredentialsForPlatform(
platform: 'android',
newCredentials: Credentials,
newCredentials: Keystore,
userCredentialsIds: Array<number>,
metadata: CredentialMetadata
): Promise<void> {
Expand All @@ -118,7 +119,7 @@ export async function updateCredentialsForPlatform(
const user = await UserManager.ensureLoggedInAsync();
const api = ApiV2.clientForUser(user);
const result = await api.putAsync(`credentials/android/keystore/${experienceName}`, {
credentials: newCredentials,
keystore: newCredentials,
});

if (result.errors) {
Expand Down

0 comments on commit 9fd1630

Please sign in to comment.