You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cake_wallet/tool/secrets.dart

21 lines
856 B

import 'dart:convert';
import 'dart:io';
const secretsProdPath = 'tool/.secrets-prod.json';
const secretsTestPath = 'tool/.secrets-test.json';
const outputPath = 'lib/.secrets.g.dart';
Future<void> main() async {
final inputPath = FileSystemEntity.typeSync(secretsProdPath) !=
FileSystemEntityType.notFound
? secretsProdPath
: secretsTestPath;
final inoutContent = File(inputPath).readAsStringSync();
final config = json.decode(inoutContent) as Map<String, dynamic>;
final output =
'const salt = \'${config["salt"]}\';const keychainSalt = \'${config["keychainSalt"]}\';\nconst key = \'${config["key"]}\';\nconst walletSalt = \'${config["walletSalt"]}\';\nconst shortKey = \'${config["shortKey"]}\';\nconst change_now_api_key = \'${config["change_now_api_key"]}\';';
await File(outputPath).writeAsString(output);
}