Skip to content

Commit e3dd312

Browse files
committed
convert android keystore for local use
1 parent 2226726 commit e3dd312

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

lib/checker.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { MarketplaceService } from './marketplace.service';
22
import { ProjectService } from './project.service';
3-
import { writeFileSync } from 'fs';
3+
import { writeFileSync, unlinkSync, existsSync } from 'fs';
44
import { execPromise } from './execPromise';
55
import { Logger } from './log.service';
66

@@ -39,10 +39,15 @@ async function _setup(out: OutputModel) {
3939
const pass = args.length > 5 ? args[5] : '';
4040
const cloudEnabled = !!(user && pass);
4141
if (cloudEnabled) {
42-
await execPromise('.', 'tns extension install nativescript-cloud', true) as string;
43-
await execPromise('.', 'tns accept eula', true) as string;
44-
await execPromise('.', 'tns config apply test --apiVersion test', true) as string;
45-
await execPromise('.', `tns dev-login ${user} ${pass}`, true) as string;
42+
await execPromise('.', 'tns extension install nativescript-cloud');
43+
await execPromise('.', 'tns accept eula');
44+
await execPromise('.', 'tns config apply test --apiVersion test');
45+
await execPromise('.', `tns dev-login ${user} ${pass}`);
46+
// setup android signing
47+
if (existsSync('debug.p12')) {
48+
unlinkSync('debug.p12');
49+
}
50+
await execPromise('.', 'echo android | keytool -importkeystore -srckeystore ~/.android/debug.keystore -destkeystore debug.p12 -srcstoretype JKS -deststoretype PKCS12 -deststorepass android -srcalias androiddebugkey -destalias androiddebugkey');
4651
}
4752
await ProjectService.setup(cloudEnabled);
4853
}

lib/project.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ export namespace ProjectService {
5252
}
5353

5454
export async function testSnapshot(plugin: MarketplaceService.PluginModel) {
55+
const signKeystore = cloudEnabled ? '../../debug.p12' : '~/.android/debug.keystore';
5556
return await testPlugin(plugin, {
56-
android: '--bundle --release --env.snapshot --key-store-path ~/.android/debug.keystore --key-store-password android --key-store-alias androiddebugkey --key-store-alias-password android'
57+
android: `--bundle --release --env.snapshot --key-store-path ${signKeystore} --key-store-password android --key-store-alias androiddebugkey --key-store-alias-password android`
5758
});
5859
}
5960

0 commit comments

Comments
 (0)