Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: phone environment override keystore fields #28

Closed
wants to merge 65 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
629fc32
build: upgrade dependencies manually
SERDUN Mar 19, 2024
67018bb
feat: add base configure commands
SERDUN Mar 19, 2024
0510086
feat: add plugin for change app meta data
SERDUN Apr 5, 2024
b3e0801
refactor: remove unused part of code
SERDUN Apr 16, 2024
b400819
refactor: change assets const name
SERDUN Apr 16, 2024
4cd5917
refactor: move the appending of the working directory to the method
SERDUN Apr 16, 2024
819a328
feat: add the possibility to provide a custom working directory as an…
SERDUN Apr 16, 2024
b9da65c
feat: add extensions for convert json
SERDUN Apr 16, 2024
fab6a9d
refactor: change applicationId option name
SERDUN Apr 16, 2024
f54bf8a
feat: add the option to provide the correct key-store path
SERDUN Apr 16, 2024
7431ede
Merge pull request #2 from WebTrit/refactor/configurator
SERDUN Apr 16, 2024
6ff30d4
feat(configure_generate_command): add the possibility to provide a cu…
SERDUN Apr 16, 2024
8295e43
feat: add possibility to configure platforms google services by servi…
SERDUN Apr 16, 2024
49ca05a
doc: add comment for deprecated part
SERDUN Apr 16, 2024
b2edc16
Merge pull request #3 from WebTrit/feature/google_services
SERDUN Apr 16, 2024
4754ddd
feat: remove the deprecated provision of Google services
SERDUN Apr 16, 2024
596ffcc
feat(configurator_generate_command, configurator_get_resources_comman…
SERDUN Apr 17, 2024
346dfff
fix(configurator_get_resources_command): implement the proper prepara…
SERDUN Apr 17, 2024
a66f478
feat: add possibility to provide SSL certificates
SERDUN May 1, 2024
c021c0c
feat(configurator_generate_command): add platforms to configure a fir…
SERDUN May 6, 2024
63a60f5
fix(configurator_generate_command): add missed working directory for …
SERDUN May 6, 2024
5190fd3
refactor(configurator_generate_command): set the working directory fo…
SERDUN May 6, 2024
b1c098a
feat(configurator_generate_command): remove web platforms to configur…
SERDUN May 6, 2024
3fa2d99
feat(configurator_generate_command): add a parameter to provide the b…
SERDUN May 6, 2024
19144f0
doc(configurator_generate_command): add log for showing current bundl…
SERDUN May 6, 2024
7b6058c
feat(configurator_generate_command): provide firebase macos-bundle-id…
SERDUN May 6, 2024
69e3bcd
feat(configurator_generate_command): provide firebase web-app-id for …
SERDUN May 6, 2024
4644c67
feat(configurator_generate_command): provide firebase windows-app-id …
SERDUN May 6, 2024
481cc81
style: order commands export
SERDUN May 12, 2024
be8bc40
feat(configurator_generate_command): add install flutterfire_cli and …
SERDUN May 12, 2024
33fba47
feat: add transitioning to PKCS12 Format for jks
SERDUN May 14, 2024
2a71bea
Merge pull request #5 from WebTrit/feature/android_keystore_p12
SERDUN May 14, 2024
a56f2c8
Merge pull request #6 from WebTrit/feature/configurator
SERDUN May 14, 2024
d6b36ca
feat: separate platform id migration (#10)
digiboridev May 15, 2024
0152afe
Refactor/remove deprecated platform id 1 (#12)
SERDUN May 15, 2024
444b44b
fix: add app link domain to dart define
SERDUN May 16, 2024
e7dca3d
feat: add a short description of the configuration commands (#14)
SERDUN May 29, 2024
b555146
doc: add title for Android Keystore Signing (#15)
SERDUN May 29, 2024
2da2656
Fix/custom cert (#16)
SERDUN May 29, 2024
f93ecc7
feat: add validation to check if the project keystore directory exist…
SERDUN Jun 17, 2024
d9a89d8
Feature/keystore init command (#21)
SERDUN Jun 17, 2024
5c7a2cc
Feature/stringify assets (#22)
SERDUN Jun 20, 2024
b4d1bac
feat: webtrit analysis integration (#19)
digiboridev Jun 24, 2024
2d1567d
feature: assetlinks generate (#17)
digiboridev Jun 24, 2024
ec0ae11
feat: keystore verify command (#18)
digiboridev Jun 24, 2024
0ad3466
feat: app translations download (#13)
digiboridev Jun 24, 2024
9ec89b4
Refactor/remove wrapper for write file (#23)
SERDUN Jun 24, 2024
ae4a000
Fix/sales email (#25)
SERDUN Jun 26, 2024
2afaa19
Fix/languages (#26)
SERDUN Jun 26, 2024
93a35fa
feat: add command for generate localisations
SERDUN Jun 26, 2024
13cb79b
refactor: change path to firebase servce account
SERDUN Jul 2, 2024
229d124
feat: add new mustache plugin implementation with JSON extension
SERDUN Jul 2, 2024
c7935cb
refactor(configurator_get_resources_command): migrate simple_mustache…
SERDUN Jul 2, 2024
1eb7359
refactor(configurator_get_resources_command): change var name
SERDUN Jul 2, 2024
bf5c4df
refactor(assetlinks_generate_command): migrate simple_mustache to mus…
SERDUN Jul 2, 2024
63b35f3
refactor(keystore_init_command): migrate simple_mustache to mustache_…
SERDUN Jul 2, 2024
15f043c
refactor: remove unused plugin
SERDUN Jul 2, 2024
08ef6bf
fix: change store file property to expected phone
SERDUN Jun 27, 2024
80593d5
feat(keystore_init_command): add additional generation deeplink files…
SERDUN Jul 2, 2024
8e9e07e
style(keystore_init_command): change generation folder name
SERDUN Jul 2, 2024
6232fde
Refactor/add mustache for phone theme (#27)
SERDUN Jul 3, 2024
2dd0577
feat: add possibility to load phone env data from config file
SERDUN Jul 5, 2024
e1b61e0
feat: add additional field for credentials request url
SERDUN Jul 5, 2024
30a8d90
refactor: move local variables to getters
SERDUN Jul 5, 2024
0005167
refactor: move code for configuring phone environment to a separate m…
SERDUN Jul 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,32 @@

## Usage

**Android Keystore Signing**

```sh
# Keystore-generate command
$ webtrit_phone_tools keystore-generate --bundleId="com.webtrit.app" --appendDirectory ../webtrit_phone_keystores
# Keystore-commit command
$ webtrit_phone_tools keystore-commit --bundleId="com.webtrit.app" --appendDirectory ../webtrit_phone_keystores
# Keystore-verify command
$ webtrit_phone_tools keystore-verify ../webtrit_phone_keystores/com.webtrit.app
```

**Application Resource Configuration:**

```sh
# Configure application resources (using configurator tool)

Check warning on line 39 in README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (configurator)

Check warning on line 39 in README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (configurator)
$ webtrit_phone_tools configure --applicationId=$(id) $(KEYSTORES_PATH) --$(BUILD_FLOW)
# Generate configuration files
$ webtrit_phone_tools configurator-generate

Check warning on line 42 in README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (configurator)

Check warning on line 42 in README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (configurator)

# Create demo classic configuration (using configurator tool)

Check warning on line 44 in README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (configurator)

Check warning on line 44 in README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (configurator)
$ webtrit_phone_tools create-demo-classic

# Create assetlink and apple-app-site-association files

Check warning on line 47 in README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (assetlink)

Check warning on line 47 in README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (assetlink)
$ webtrit_phone_tools assetlinks-generate --bundleId=$(bundle_id) --appleTeamID=$(team_id) --androidFingerprints=$(SHA256_key) --output=$(out_path) $(metadata_path)

Check warning on line 48 in README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (assetlinks)

Check warning on line 48 in README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (assetlinks)

**Additional Commands:**

# Show CLI version
$ webtrit_phone_tools --version
Expand All @@ -37,4 +58,29 @@

---

**Advanced Usage (Configurator Tool):**

Check warning on line 61 in README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (Configurator)

Check warning on line 61 in README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (Configurator)

These commands are for developers familiar with the `configurator` tool used internally.

Check warning on line 63 in README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (configurator)

Check warning on line 63 in README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (configurator)

* [`configurator-resources`](./lib/src/commands/configurator_get_resources_command.dart)

Check warning on line 65 in README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (configurator)

Check warning on line 65 in README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (configurator)
* [`configurator-generate`](./lib/src/commands/configurator_generate_command.dart)

---

## Providing Assets for Builds

In the Dart CLI, there isn't a mechanism like in Flutter where you can directly store files in executed builds. Instead, we need to stringify assets before creating the build. This ensures that assets are properly embedded into the Dart code.

To stringify assets, use the `stringify_assets.sh` script. This script converts asset files into Dart code that can be included in your build.

**Example Usage:**

```sh
./stringify_assets.sh assets lib/src/gen/stringify_assets.dart
```

This command takes all files in the `assets` directory and converts them into a Dart file located at `lib/src/gen/stringify_assets.dart`.

Make sure to run this script before creating a build to ensure all assets are properly included.

[very_good_cli_link]: https://github.com/VeryGoodOpenSource/very_good_cli
10 changes: 5 additions & 5 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include: package:very_good_analysis/analysis_options.5.1.0.yaml
linter:
rules:
lines_longer_than_80_chars: false
public_member_api_docs: false
include: package:webtrit_analysis/analysis_options.yaml

analyzer:
exclude:
- lib/src/gen/**
4 changes: 4 additions & 0 deletions assets/app_theme_gradient_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"color": "{{ color }}",
"blend": false
}
55 changes: 55 additions & 0 deletions assets/app_theme_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"seedColor": "{{ seedColor }}",
"lightColorSchemeOverride": {
"primary": "{{ primary }}",
"onPrimary": "{{ onPrimary }}",
"primaryContainer": "{{ primaryContainer }}",
"onPrimaryContainer": "{{ onPrimaryContainer }}",
"primaryFixed": "{{ primaryFixed }}",
"primaryFixedDim": "{{ primaryFixedDim }}",
"onPrimaryFixed": "{{ onPrimaryFixed }}",
"onPrimaryFixedVariant": "{{ onPrimaryFixedVariant }}",
"secondary": "{{ secondary }}",
"onSecondary": "{{ onSecondary }}",
"secondaryContainer": "{{ secondaryContainer }}",
"onSecondaryContainer": "{{ onSecondaryContainer }}",
"secondaryFixed": "{{ secondaryFixed }}",
"secondaryFixedDim": "{{ secondaryFixedDim }}",
"onSecondaryFixed": "{{ onSecondaryFixed }}",
"onSecondaryFixedVariant": "{{ onSecondaryFixedVariant }}",
"tertiary": "{{ tertiary }}",
"onTertiary": "{{ onTertiary }}",
"tertiaryContainer": "{{ tertiaryContainer }}",
"onTertiaryContainer": "{{ onTertiaryContainer }}",
"tertiaryFixed": "{{ tertiaryFixed }}",
"tertiaryFixedDim": "{{ tertiaryFixedDim }}",
"onTertiaryFixed": "{{ onTertiaryFixed }}",
"onTertiaryFixedVariant": "{{ onTertiaryFixedVariant }}",
"error": "{{ error }}",
"onError": "{{ onError }}",
"errorContainer": "{{ errorContainer }}",
"onErrorContainer": "{{ onErrorContainer }}",
"outline": "{{ outline }}",
"outlineVariant": "{{ outlineVariant }}",
"surface": "{{ surface }}",
"onSurface": "{{ onSurface }}",
"surfaceDim": "{{ surfaceDim }}",
"surfaceBright": "{{ surfaceBright }}",
"surfaceContainerLowest": "{{ surfaceContainerLowest }}",
"surfaceContainerLow": "{{ surfaceContainerLow }}",
"surfaceContainer": "{{ surfaceContainer }}",
"surfaceContainerHigh": "{{ surfaceContainerHigh }}",
"surfaceContainerHighest": "{{ surfaceContainerHighest }}",
"onSurfaceVariant": "{{ onSurfaceVariant }}",
"inverseSurface": "{{ inverseSurface }}",
"onInverseSurface": "{{ onInverseSurface }}",
"inversePrimary": "{{ inversePrimary }}",
"shadow": "{{ shadow }}",
"scrim": "{{ scrim }}",
"surfaceTint": "{{ surfaceTint }}"
},
"primaryGradientColors": {{ primaryGradientColors }},
"fontFamily": "{{fontFamily}}",
"primaryOnboardingLogo": "{{primaryOnboardingLogo}}",
"secondaryOnboardingLogo": "{{secondaryOnboardingLogo}}"
}
10 changes: 10 additions & 0 deletions assets/apple_asset_links_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"applinks": {
"details": [
{
"appID": "{{ appID }}",
"paths": [ "*" ]
}
]
}
}
15 changes: 15 additions & 0 deletions assets/dart_define_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"WEBTRIT_APP_DEBUG_LEVEL": "ALL",
"WEBTRIT_APP_DATABASE_LOG_STATEMENTS": false,
"WEBTRIT_APP_PERIODIC_POLLING": true,
"WEBTRIT_APP_DEMO_CORE_URL": "{{ WEBTRIT_APP_DEMO_CORE_URL }}",
"WEBTRIT_APP_CORE_URL": "{{ WEBTRIT_APP_CORE_URL }}",
"WEBTRIT_APP_NAME": "{{ WEBTRIT_APP_NAME }}",
"WEBTRIT_APP_GREETING": "{{ WEBTRIT_APP_GREETING }}",
"WEBTRIT_APP_DESCRIPTION": "{{ WEBTRIT_APP_DESCRIPTION }}",
"WEBTRIT_APP_TERMS_AND_CONDITIONS_URL": "{{ WEBTRIT_APP_TERMS_AND_CONDITIONS_URL }}",
"WEBTRIT_APP_SALES_EMAIL": "{{ WEBTRIT_APP_SALES_EMAIL }}",
"WEBTRIT_APP_CREDENTIALS_REQUEST_URL": "{{ WEBTRIT_APP_CREDENTIALS_REQUEST_URL }}",
"WEBTRIT_ANDROID_RELEASE_UPLOAD_KEYSTORE_PATH": "{{ WEBTRIT_ANDROID_RELEASE_UPLOAD_KEYSTORE_PATH }}",
"WEBTRIT_APP_LINK_DOMAIN": "app.webtrit.com"
}
14 changes: 14 additions & 0 deletions assets/flutter_launcher_icons_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
flutter_launcher_icons:
android: true
image_path_android: "assets/launcher_icons/android.png"
min_sdk_android: 23
adaptive_icon_background: "{{adaptive_icon_background}}"
adaptive_icon_foreground: "assets/launcher_icons/ic_foreground.png"
ios: true
remove_alpha_ios: true
image_path_ios: "assets/launcher_icons/ios.png"
web:
generate: true
image_path: "assets/launcher_icons/web.png"
background_color: "#FFFFFF"
theme_color: "{{theme_color}}"
6 changes: 6 additions & 0 deletions assets/flutter_native_splash_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
flutter_native_splash:
color: "{{background}}"
color_dark: "{{background}}"
android_12:
color: "{{background}}"
color_dark: "{{background}}"
7 changes: 7 additions & 0 deletions assets/google_asset_links_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"relation": [ "delegate_permission/common.handle_all_urls" ],
"target": {
"package_name": "{{ package_name }}",
"sha256_cert_fingerprints": {{ sha256_cert_fingerprints }}
}
}
9 changes: 9 additions & 0 deletions assets/package_rename_config_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package_rename_config:
android:
app_name: {{ app_name }}
package_name: {{ android_package_name }}
override_old_package: {{override_old_package}}
lang: kotlin
ios:
app_name: {{ app_name }}
package_name: {{ ios_package_name }}
7 changes: 7 additions & 0 deletions assets/upload-store-connect-metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"bundleId": "{{ BUNDLE_ID }}",
"issuer-id": "",
"key_id": "",
"code-signing-identity": "",
"team-id": ""
}
21 changes: 21 additions & 0 deletions lib/src/command_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import 'package:pub_updater/pub_updater.dart';
import 'package:webtrit_phone_tools/src/commands/commands.dart';
import 'package:webtrit_phone_tools/src/version.dart';

import 'commands/constants.dart';
import 'utils/utils.dart';

const executableName = 'webtrit_phone_tools';
const packageName = 'webtrit_phone_tools';
const description = 'WebTrit Phone CLI tools';
Expand All @@ -22,8 +25,12 @@ class WebtritPhoneToolsCommandRunner extends CompletionCommandRunner<int> {
/// {@macro webtrit_phone_tools_command_runner}
WebtritPhoneToolsCommandRunner({
Logger? logger,
HttpClient? httpClient,
KeystoreReadmeUpdater? keystoreReadmeUpdater,
PubUpdater? pubUpdater,
}) : _logger = logger ?? Logger(),
_httpClient = httpClient ?? HttpClient(configuratorApiUrl, Logger()),
_keystoreReadmeUpdater = keystoreReadmeUpdater ?? KeystoreReadmeUpdater(Logger()),
_pubUpdater = pubUpdater ?? PubUpdater(),
super(executableName, description) {
// Add root options and flags
Expand All @@ -40,15 +47,29 @@ class WebtritPhoneToolsCommandRunner extends CompletionCommandRunner<int> {
);

// Add sub commands
addCommand(ConfiguratorGetResourcesCommand(
logger: _logger,
httpClient: _httpClient,
));
addCommand(ConfiguratorGenerateCommand(logger: _logger));
addCommand(KeystoreInitCommand(
logger: _logger,
httpClient: _httpClient,
keystoreReadmeUpdater: _keystoreReadmeUpdater,
));
addCommand(KeystoreGenerateCommand(logger: _logger));
addCommand(KeystoreCommitCommand(logger: _logger));
addCommand(KeystoreVerifyCommand(logger: _logger));
addCommand(AssetlinksGenerateCommand(logger: _logger));
addCommand(UpdateCommand(logger: _logger, pubUpdater: _pubUpdater));
}

@override
void printUsage() => _logger.info(usage);

final Logger _logger;
final HttpClient _httpClient;
final KeystoreReadmeUpdater _keystoreReadmeUpdater;
final PubUpdater _pubUpdater;

@override
Expand Down
Loading
Loading