Skip to content

Commit

Permalink
Activate to max allowed duration
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyw15 committed Jul 24, 2024
1 parent 5248313 commit 69ccb5c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Libs/Activator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ public string GetCeVIOProductCode()
}
}

public TimeSpan OfflineAcceptablePeriod => _ProductLicense.OfflineAcceptablePeriod;

public void Dispose()
{
_Assembly.Dispose();
Expand Down
9 changes: 9 additions & 0 deletions Libs/CeVIO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ public byte[] ScrambleDateTime(DateTime value)
var method = Instance.GetMethod("ScrambleDateTime", BindingFlags.Static | BindingFlags.NonPublic);
return (byte[])method.Invoke(null, new object[] { value });
}

public TimeSpan OfflineAcceptablePeriod
{
get
{
var span = Instance.GetField("OfflineAcceptablePeriod");
return (TimeSpan)span.GetValue(null);
}
}
}

public class Authorizer
Expand Down
5 changes: 2 additions & 3 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ namespace CeVIOActivator
class Program
{
// N54KC-7U2ZL-PQZBM-SPF8H suzuki trial key
const int DEFAULT_ACTIVATION_DAYS = 100 * 365;

static void Main(string[] args)
{
Expand All @@ -20,7 +19,7 @@ static void Main(string[] args)

Console.WriteLine("Loading...");
var activator = new Activator(executablePath);
activator.ActivateProducts(TimeSpan.FromDays(DEFAULT_ACTIVATION_DAYS));
activator.ActivateProducts(activator.OfflineAcceptablePeriod);
Console.WriteLine("Activated all packages");

activator.GenerateLicenseSummary();
Expand All @@ -46,7 +45,7 @@ static void Main(string[] args)
Console.WriteLine("CeVIO.ToolBarControl.dll already patched, skip");
}

Console.WriteLine("You should reactivate CeVIO AI before " + DateTime.Now.AddDays(DEFAULT_ACTIVATION_DAYS).ToLongDateString());
Console.WriteLine("You should reactivate CeVIO AI before " + (DateTime.Now + activator.OfflineAcceptablePeriod).ToLongDateString());

Console.WriteLine("Press any key to exit...");
Console.ReadKey();
Expand Down

0 comments on commit 69ccb5c

Please sign in to comment.