Add Play review license command
This commit is contained in:
1 parent
f41d263a2e
commit
480134538a
1 file changed
+26
@@ -5,6 +5,32 @@ internal static class Program
|
||||
[STAThread]
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
if (args.Length == 3 && args[0].Equals("--issue-play-review", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (!DateTimeOffset.TryParse(
|
||||
args[2],
|
||||
System.Globalization.CultureInfo.InvariantCulture,
|
||||
System.Globalization.DateTimeStyles.AssumeUniversal,
|
||||
out var expiresAt))
|
||||
{
|
||||
throw new InvalidOperationException("Scadenza non valida. Usa il formato ISO 8601.");
|
||||
}
|
||||
|
||||
var reviewRepository = new LicenseRepository();
|
||||
reviewRepository.Initialize();
|
||||
var license = reviewRepository.Issue(
|
||||
"Google",
|
||||
"Play Review",
|
||||
"livio.merola+play-review@gmail.com",
|
||||
expiresAt,
|
||||
"Accesso riutilizzabile per la revisione Google Play");
|
||||
var outputPath = Path.GetFullPath(args[1]);
|
||||
File.WriteAllText(outputPath, license.Token, new System.Text.UTF8Encoding(false));
|
||||
Console.WriteLine($"Licenza di revisione creata in: {outputPath}");
|
||||
Console.WriteLine($"Scadenza UTC: {license.ExpiresAtUtc:O}");
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Length == 2 && args[0].Equals("--export-key", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var password = Environment.GetEnvironmentVariable("LME_LICENSE_BACKUP_PASSWORD");
|
||||
|
||||
Reference in new issue
Block a user