license: Implemented new license format
* Implemented new format splitting user, version, and usage period into separate lines * Refactored all classes: License, LicenseGenerator, LicenseChecker * Removed redundant license check hash from ApplicationSettings, don't generate, store and check it anymore * Moved license checking and encoding logic to LicenseChecker * Moved default for license generation to main.cpp * Refactored license checking logic in whole app, removed involved message types * Added LicenseCheckerTestSuite for checking all legacy and current license types * Generate new license type lifelong
This commit is contained in:
@@ -224,32 +224,3 @@ std::string utility::getOsTypeString()
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
bool utility::saveLicense(const License* license)
|
||||
{
|
||||
if (license == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (license->isValid())
|
||||
{
|
||||
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
|
||||
if (appSettings == nullptr)
|
||||
{
|
||||
LOG_ERROR_STREAM(<< "Unable to retrieve app settings");
|
||||
return false;
|
||||
}
|
||||
|
||||
const FilePath appLocation = AppPath::getAppPath();
|
||||
appSettings->setLicenseString(license->getLicenseEncodedString(appLocation.str()));
|
||||
appSettings->setLicenseCheck(license->hashLocation(appLocation.getAbsolute().str()));
|
||||
appSettings->save();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR( "The entered license key is invalid.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user