Skip to content

Commit 10caa3e

Browse files
SERDUNclaude
andcommitted
feat: add subdirectory structure to keystore-init project layout
- Create push_notifications, build, and assets folders during init - Place firebase-service-account.json stub in push_notifications/ - Place google-play-service-account.json stub in build/ - Add keystoreFileSubdirectory mapping to keystore_constants.dart - Document keystore-init command and generated folder structure in README Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 695827a commit 10caa3e

3 files changed

Lines changed: 54 additions & 1 deletion

File tree

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,41 @@ dart pub global activate --source=path <path_to_package>
2525

2626
## Usage
2727

28+
### Keystore Project Initialization
29+
30+
Initialize a full keystore project directory for a given application. Fetches application metadata
31+
from the Configurator API and generates the required folder structure, signing keys, deep link
32+
metadata, and template credential files.
33+
34+
```sh
35+
$ webtrit_phone_tools keystore-init --applicationId=<id> --token=<jwt> [directory]
36+
```
37+
38+
The command creates the following structure under `<directory>/applications/<applicationId>/`:
39+
40+
```
41+
<applicationId>/
42+
├── assets/ # Application assets (logos, icons, etc.)
43+
├── build/
44+
│ └── google-play-service-account.json # Google Play service account for CI publishing
45+
├── deep_links/
46+
│ └── .well-known/
47+
│ ├── apple-app-site-association.json
48+
│ └── assetlinks.json
49+
├── push_notifications/
50+
│ └── firebase-service-account.json # Firebase service account for push notifications
51+
├── ssl_certificates/ # SSL certificates for the application
52+
├── AuthKey_[key_id].p8 # iOS APNs auth key
53+
├── Certificates.p12 # iOS distribution certificate
54+
├── Provision.mobileprovision # iOS provisioning profile
55+
├── upload-keystore.jks # Android upload keystore (JKS)
56+
├── upload-keystore.p12 # Android upload keystore (P12)
57+
├── upload-keystore-metadata.json # Android keystore metadata
58+
└── upload-store-connect-metadata.json # App Store Connect credentials
59+
```
60+
61+
Files that require manual completion are created with an `.incomplete` suffix.
62+
2863
### Android Keystore Signing
2964

3065
Tools for managing signing keys and certificates.

lib/src/commands/keystore_generate/models/keystore_constants.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ const keystoreFiles = [
1313
androidUploadKeystoreP12,
1414
];
1515

16+
// Subdirectory mapping for keystore files (null means root)
17+
const keystoreFileSubdirectory = {
18+
firebaseServiceAccount: 'push_notifications',
19+
androidPlayServiceAccount: 'build',
20+
};
21+
1622
// Firebase
1723
const firebaseServiceAccount = 'firebase-service-account.json';
1824

lib/src/commands/keystore_init/processors/keystore_project_processor.dart

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ class KeystoreProjectProcessor {
2121

2222
logger.info('Creating ssl certificates directory: $keystoreProjectPath');
2323
Directory(path.join(keystoreProjectPath, 'ssl_certificates')).createSync(recursive: true);
24+
25+
logger.info('Creating push notifications directory: $keystoreProjectPath');
26+
Directory(path.join(keystoreProjectPath, 'push_notifications')).createSync(recursive: true);
27+
28+
logger.info('Creating build directory: $keystoreProjectPath');
29+
Directory(path.join(keystoreProjectPath, 'build')).createSync(recursive: true);
30+
31+
logger.info('Creating assets directory: $keystoreProjectPath');
32+
Directory(path.join(keystoreProjectPath, 'assets')).createSync(recursive: true);
2433
}
2534

2635
void writeIosCredentialsTemplate({
@@ -44,7 +53,10 @@ class KeystoreProjectProcessor {
4453
}) {
4554
for (final fileName in keystoreFiles) {
4655
if (!existingKeystoreFiles.contains(fileName)) {
47-
final filePath = path.join(keystoreProjectPath, '$fileName.incomplete');
56+
final subdirectory = keystoreFileSubdirectory[fileName];
57+
final filePath = subdirectory != null
58+
? path.join(keystoreProjectPath, subdirectory, '$fileName.incomplete')
59+
: path.join(keystoreProjectPath, '$fileName.incomplete');
4860
logger.info('Creating empty file: $filePath');
4961
File(filePath).createSync();
5062
}

0 commit comments

Comments
 (0)