| | |
| | | #ifndef MAINWINDOW_H |
| | | #define MAINWINDOW_H |
| | | |
| | | #include "licensedata.h" |
| | | |
| | | #include <QMainWindow> |
| | | #include <QCryptographicHash> |
| | | #include <QJsonDocument> |
| | | #include <QJsonObject> |
| | | #include <QMap> |
| | | |
| | | QT_BEGIN_NAMESPACE |
| | | namespace Ui { class MainWindow; } |
| | |
| | | QString Bios_Serialnumber = ""; |
| | | QString CPU_Processorid = ""; |
| | | QString Username = ""; |
| | | int ActiveState = 0; |
| | | int IsEnabled_cell = 0; |
| | | int IsEnabled_aquifer = 0; |
| | | int IsEnabled_pipe = 0; |
| | | int IsEnabled_network = 0; |
| | | QString LicensedDuration_start = "2023-04-01 12:00:00"; |
| | | QString LicensedDuration_end = "2023-04-01 12:00:00"; |
| | | QString LicensedDuration_start = "2023-04-01"; |
| | | QString LicensedDuration_end = "2023-04-01"; |
| | | QString Productid = "1"; //产品号 (1,3)安全评价软件(2,3)数据库 |
| | | QString Versionid = "1.0.0.0"; //版本号 用于区分大版本,同一个大版本内可用 |
| | | QString Versionid = "2.0"; //版本号 用于区分大版本,同一个大版本内可用 |
| | | } LicenseInfo; |
| | | |
| | | class MainWindow : public QMainWindow |
| | |
| | | public: |
| | | MainWindow(QWidget *parent = nullptr); |
| | | ~MainWindow(); |
| | | |
| | | void initUI(); |
| | | |
| | | QString toUpperAndLower(QString src); |
| | | |
| | |
| | | |
| | | QString AES_decryption(const QString &data, const QString &key); |
| | | |
| | | QByteArray AES_decryption_byte(const QString &data, const QString &key); |
| | | |
| | | QString getEncrypt(const QString &data, QString key); |
| | | |
| | | QString getDecrypt(const QString &data, QString key); |
| | |
| | | QString getLocalID(); |
| | | |
| | | QString getWindowsInfo(const QString &cmd); |
| | | |
| | | //授权集中在一起,不同点在于时间 |
| | | void giveLicense(int time); |
| | | void ActiveRecord(LicenseData lic,QString edition, QString licenseKey); |
| | | |
| | | //新的加密方法 |
| | | QString getEncrypt_New(); |
| | | private slots: |
| | | void on_pushButton_decrypt_clicked(); |
| | | |
| | |
| | | |
| | | void on_pushButton_setversion_clicked(); |
| | | |
| | | void on_pushButton_normal_clicked(); |
| | | |
| | | void on_pushButton_education_clicked(); |
| | | |
| | | void on_pushButton_profession_clicked(); |
| | | |
| | | void on_pushButton_viewUsers_clicked(); |
| | | |
| | | private: |
| | | Ui::MainWindow *ui; |
| | | |
| | |
| | | |
| | | QJsonDocument workingjsondoc; |
| | | |
| | | QString key = "9aFUEFjsqHsde4DOhirdskgdznSDHlfb0ae"; |
| | | LicenseData lic2; |
| | | QByteArray key = "MySecretKey12345"; |
| | | |
| | | // QString key = "9aFUEFjsqHsde4DOhirdskgdznSDHlfb0ae"; |
| | | // QByteArray key = "MySecretKey12345"; // 16字节密钥 |
| | | |
| | | QMap<QString,QString> m_numToInfo; |
| | | }; |
| | | #endif // MAINWINDOW_H |