615 lines
16 KiB
C++
615 lines
16 KiB
C++
#include "Verify.h"
|
|
#include "Global.h"
|
|
/// <summary>
|
|
/// 构造函数
|
|
/// </summary>
|
|
/// <param name="Url"></param>
|
|
/// <param name="AppId"></param>
|
|
/// <param name="CommKey"></param>
|
|
/// <param name="Verison"></param>
|
|
Verify::Verify(QString Url, QString AppId, QString CommKey, QString Verison)
|
|
{
|
|
VMProtectBegin("Verify_Init");
|
|
// 初始化网络权限管理类
|
|
|
|
|
|
// 获取随机Key
|
|
this->m_randomeKey = this->GetRandom(32);
|
|
|
|
m_appId = this->ParamEncrypt(AppId);
|
|
m_commKey = this->ParamEncrypt(CommKey);
|
|
m_webApi = this->ParamEncrypt(Url + "/api_new.php?");
|
|
m_machineCode = this->GetCPUID();
|
|
m_version = Verison;
|
|
|
|
//qDebug() << "验证网址:" << Url;
|
|
//qDebug() << "软件ID:" << AppId;
|
|
//qDebug() << "通信密钥:" << CommKey;
|
|
//qDebug() << "软件版本:" << Verison;
|
|
//qDebug() << "机器码:" << this->GetCPUID();
|
|
VMProtectEnd();
|
|
}
|
|
|
|
Verify::~Verify()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
// 获取计算机的CPU的ID
|
|
QString Verify::GetCPUID()
|
|
{
|
|
QString strCpuId = "";
|
|
unsigned int dwBuf[4] = { 0 };
|
|
unsigned long long ret = 0;
|
|
|
|
__cpuid((int*)(void*)dwBuf, 1);
|
|
|
|
ret = dwBuf[3];
|
|
ret = ret << 32;
|
|
|
|
QString str0 = QString::number(dwBuf[3], 16).toUpper();
|
|
QString str0_1 = str0.rightJustified(8, '0');
|
|
QString str1 = QString::number(dwBuf[0], 16).toUpper();
|
|
QString str1_1 = str1.rightJustified(8, '0');
|
|
strCpuId = str0_1 + str1_1;
|
|
|
|
return strCpuId;
|
|
}
|
|
|
|
// 取随机文本
|
|
QString Verify::GetRandom(int Length)
|
|
{
|
|
srand(QDateTime::currentMSecsSinceEpoch());
|
|
QString String;
|
|
const char ch[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
int index = 0;
|
|
for (int i = 0; i < Length; ++i)
|
|
{
|
|
index = rand() % strlen(ch);
|
|
String += ch[index];
|
|
}
|
|
return String;
|
|
}
|
|
|
|
// 取随机数
|
|
int Verify::GetRandom(int Min, int Max)
|
|
{
|
|
srand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
|
|
int Random = rand();
|
|
int Number = Random % (Max - Min + 1) + Min;
|
|
return Number;
|
|
}
|
|
|
|
// 计算CRC32
|
|
unsigned int Verify::Crc32(const void* Buffer, unsigned short Length)
|
|
{
|
|
|
|
int i, j;
|
|
unsigned int CRC32;
|
|
|
|
CRC32 = 0xFFFFFFFF;
|
|
for (i = 0; i < Length; i++)
|
|
{
|
|
for (j = 0; j < 8; j++)
|
|
{
|
|
if (CRC32 & 1) {
|
|
CRC32 = (CRC32 >> 1) ^ 0xEDB88320;
|
|
}
|
|
else
|
|
{
|
|
CRC32 = (CRC32 >> 1);
|
|
}
|
|
if (((unsigned char*)Buffer)[i] & (1 << j))
|
|
{
|
|
CRC32 ^= 0xEDB88320;
|
|
}
|
|
}
|
|
}
|
|
CRC32 = ~CRC32;
|
|
return (CRC32);
|
|
}
|
|
|
|
// RC4加密
|
|
QByteArray Verify::RC4(QByteArray Data, QString Key)
|
|
{
|
|
QByteArray m, k, result;
|
|
m.resize(256);
|
|
k.resize(256);
|
|
result.resize(Data.length());
|
|
if (Data.length() < 1)
|
|
{
|
|
return "";
|
|
}
|
|
for (int i = 0; i < 256; i++)
|
|
{
|
|
m[i] = i;
|
|
}
|
|
|
|
if (Key.length() > 0)
|
|
{
|
|
int j = 0;
|
|
for (int i = 0; i < 256; i++)
|
|
{
|
|
k[i] = Key.toUtf8()[j];
|
|
j++;
|
|
if (j > Key.length() - 1)
|
|
{
|
|
j = 0;
|
|
}
|
|
}
|
|
j = 0;
|
|
for (int i = 0; i < 256; i++)
|
|
{
|
|
j = (j + m[i] + k[i]) & 255;
|
|
char temp = m[i];
|
|
m[i] = m[j];
|
|
m[j] = temp;
|
|
}
|
|
}
|
|
int i = 0, j = 0;
|
|
for (int x = 0; x < Data.length(); x++)
|
|
{
|
|
i = (i + 1) & 255;
|
|
j = (j + m[i]) & 255;
|
|
|
|
char temp = m[i];
|
|
m[i] = m[j];
|
|
m[j] = temp;
|
|
result[x] = Data[x] ^ m[(m[i] + m[j]) & 255];
|
|
}
|
|
// qDebug() << "RC4:" << result.toHex();
|
|
return result;
|
|
}
|
|
|
|
// 获取MD5
|
|
QString Verify::Md5(QByteArray Data)
|
|
{
|
|
QCryptographicHash hash(QCryptographicHash::Md5);
|
|
hash.addData(Data);
|
|
QString md5 = hash.result().toHex();
|
|
return md5;
|
|
}
|
|
|
|
QString Verify::ParamEncrypt(QString Param)
|
|
{
|
|
VMProtectBegin("Verify_Enc");
|
|
if (Param.isEmpty())
|
|
{
|
|
return "";
|
|
}
|
|
// 转为字节数组
|
|
QByteArray paramByteArray = Param.toUtf8();
|
|
// 根据字节数组指针计算CRC32
|
|
unsigned int ParamCrc32 = this->Crc32(paramByteArray.data(), Param.size());
|
|
// 参数 + CRC32
|
|
paramByteArray.append(((char*)&ParamCrc32)[0]);
|
|
paramByteArray.append(((char*)&ParamCrc32)[1]);
|
|
paramByteArray.append(((char*)&ParamCrc32)[2]);
|
|
paramByteArray.append(((char*)&ParamCrc32)[3]);
|
|
|
|
int Key = this->GetRandom(1, 65535);
|
|
QByteArray keyByteArray;
|
|
keyByteArray.append(((char*)&Key)[0]);
|
|
keyByteArray.append(((char*)&Key)[1]);
|
|
keyByteArray.append(((char*)&Key)[2]);
|
|
keyByteArray.append(((char*)&Key)[3]);
|
|
|
|
int passwordCRC32 = this->Crc32(m_randomeKey.toUtf8().data(), m_randomeKey.size());
|
|
keyByteArray.append(((char*)&passwordCRC32)[0]);
|
|
keyByteArray.append(((char*)&passwordCRC32)[1]);
|
|
keyByteArray.append(((char*)&passwordCRC32)[2]);
|
|
keyByteArray.append(((char*)&passwordCRC32)[3]);
|
|
|
|
// MD5加密
|
|
QCryptographicHash hash(QCryptographicHash::Md5);
|
|
hash.addData(keyByteArray);
|
|
// 转换为十六进制字符串
|
|
QString md5 = hash.result().toHex();
|
|
int offset = 0;
|
|
for (int i = 0; i < paramByteArray.length(); i++)
|
|
{
|
|
// 防止数组越界
|
|
if (offset > md5.length() - 1)
|
|
{
|
|
offset = 0;
|
|
}
|
|
|
|
int location = md5.mid(offset, 1).toInt(nullptr, 16) + 4;
|
|
offset++;
|
|
if (location > paramByteArray.length() - 1)
|
|
{
|
|
continue;
|
|
}
|
|
char TempA = paramByteArray[paramByteArray.size() - 1 - i];
|
|
char TempB = paramByteArray[location];
|
|
paramByteArray[paramByteArray.size() - 1 - i] = TempB;
|
|
paramByteArray[location] = TempA;
|
|
}
|
|
paramByteArray += ((char*)&offset)[0];
|
|
paramByteArray += ((char*)&offset)[1];
|
|
paramByteArray += ((char*)&Key)[0];
|
|
paramByteArray += ((char*)&Key)[1];
|
|
paramByteArray += ((char*)&Key)[2];
|
|
|
|
// XOR
|
|
for (unsigned int i = 0; i < paramByteArray.length(); i++)
|
|
{
|
|
paramByteArray[i] = paramByteArray[i] ^ ((char*)&Key)[3];
|
|
}
|
|
paramByteArray.append(((char*)&Key)[3]);
|
|
|
|
return paramByteArray.toHex();
|
|
VMProtectEnd();
|
|
|
|
}
|
|
|
|
QString Verify::ParamDecrypt(QString Param)
|
|
{
|
|
VMProtectBegin("Verify_Dec");
|
|
if (Param.isEmpty())
|
|
{
|
|
return "";
|
|
}
|
|
QByteArray paramByteArray = QByteArray::fromHex(Param.toUtf8());
|
|
char xorKey = paramByteArray[paramByteArray.size() - 1];
|
|
|
|
QByteArray UnHashData = NULL;
|
|
for (unsigned int i = 0; i < paramByteArray.size() - 1; i++)
|
|
{
|
|
UnHashData += paramByteArray[i] ^ xorKey;
|
|
}
|
|
QByteArray md5ByteArray;
|
|
|
|
// 根据字节数组指针计算CRC32
|
|
int passwordCrc32 = this->Crc32(m_randomeKey.toUtf8().data(), m_randomeKey.size());
|
|
// 参数 + CRC32
|
|
md5ByteArray.append(UnHashData[UnHashData.size() - 3]);
|
|
md5ByteArray.append(UnHashData[UnHashData.size() - 2]);
|
|
md5ByteArray.append(UnHashData[UnHashData.size() - 1]);
|
|
//qDebug() << "RValue:" << md5ByteArray.toHex();
|
|
md5ByteArray.append(xorKey);
|
|
md5ByteArray.append(((char*)&passwordCrc32)[0]);
|
|
md5ByteArray.append(((char*)&passwordCrc32)[1]);
|
|
md5ByteArray.append(((char*)&passwordCrc32)[2]);
|
|
md5ByteArray.append(((char*)&passwordCrc32)[3]);
|
|
|
|
QCryptographicHash hash(QCryptographicHash::Md5);
|
|
hash.addData(md5ByteArray);
|
|
// 转换为十六进制字符串
|
|
QString md5 = hash.result().toHex();
|
|
short last;
|
|
((char*)&last)[0] = UnHashData[UnHashData.length() - 5];
|
|
((char*)&last)[1] = UnHashData[UnHashData.length() - 4];
|
|
|
|
UnHashData = UnHashData.mid(0, UnHashData.length() - 5);
|
|
|
|
int offset = 0;
|
|
int _last = last;
|
|
bool error = false;
|
|
for (int i = 0; i < UnHashData.length(); i++)
|
|
{
|
|
if (UnHashData.length() < _last - 1)
|
|
{
|
|
break;
|
|
}
|
|
if (offset > md5.size() - 1)
|
|
{
|
|
offset = 0;
|
|
}
|
|
if (last - offset - 1 < 0)
|
|
{
|
|
last = md5.size();
|
|
offset = 0;
|
|
}
|
|
int location = md5.mid(last - offset - 1, 1).toInt(nullptr, 16) + 4;
|
|
offset = offset + 1;
|
|
if (location > UnHashData.size() - 1)
|
|
{
|
|
continue;
|
|
}
|
|
char TempA = UnHashData[i];
|
|
char TempB = UnHashData[location];
|
|
UnHashData[i] = TempB;
|
|
UnHashData[location] = TempA;
|
|
}
|
|
|
|
int crc32;
|
|
((char*)&crc32)[0] = UnHashData[UnHashData.length() - 4];
|
|
((char*)&crc32)[1] = UnHashData[UnHashData.length() - 3];
|
|
((char*)&crc32)[2] = UnHashData[UnHashData.length() - 2];
|
|
((char*)&crc32)[3] = UnHashData[UnHashData.length() - 1];
|
|
UnHashData = UnHashData.mid(0, UnHashData.length() - 4);
|
|
if (crc32 != this->Crc32(UnHashData.data(), UnHashData.length()))
|
|
{
|
|
return "";
|
|
}
|
|
|
|
return UnHashData;
|
|
VMProtectEnd();
|
|
}
|
|
|
|
|
|
QString ByteArrayToHexString(QByteArray data) {
|
|
QString ret(data.toHex().toUpper());
|
|
int len = ret.length() / 2;
|
|
for (int i = 1; i < len; i++)
|
|
{
|
|
ret.insert(2 * i + i - 1, " ");
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
// 发送网络请求
|
|
bool Verify::Send(QString Option, QString Data, QString& Result, bool async)
|
|
{
|
|
VMProtectBegin("Verify_Send");
|
|
QNetworkAccessManager networkAccessManager;
|
|
|
|
// 获取当前时间戳
|
|
QDateTime timeDate = QDateTime::currentDateTime();
|
|
QString timestamp = QString::number(timeDate.toSecsSinceEpoch());
|
|
//qDebug() << "解密:" << ParamDecrypt(m_commKey);
|
|
// 获取签名
|
|
|
|
// 转为十六进制文本
|
|
QString PostData;
|
|
PostData.append(RC4(Data.toUtf8(), ParamDecrypt(m_commKey)).toHex());
|
|
|
|
//qDebug() << "RC4的结果:" << PostData;
|
|
QByteArray PostByte = PostData.toUtf8();
|
|
//qDebug() << "RC4结果:" << PostByte.toHex();
|
|
QByteArray SignData = PostByte + timestamp.toUtf8() + ParamDecrypt(m_commKey).toUtf8();
|
|
// 转换为十六进制字符串
|
|
|
|
QString md5 = this->Md5(SignData);
|
|
// a98d0872e603bc63f04767a14617df64
|
|
//qDebug() << "md5:" << md5;
|
|
QUrl strUrl = ParamDecrypt(m_webApi) + "&mod=" + Option + "&appId=" + this->ParamDecrypt(m_appId) + "&sign=" + md5 + "×tamp=" + timestamp;
|
|
//qDebug() << "访问地址:" << strUrl;
|
|
// 网络请求
|
|
QNetworkRequest request;
|
|
// 设置请求地址
|
|
request.setUrl(strUrl);
|
|
// 设置请求头
|
|
// request.setRawHeader("Content-Type", "charset='utf-8'");
|
|
request.setRawHeader("Content-Type", "application/x-www-form-urlencoded");// "charset='utf-8'"
|
|
//request.setRawHeader("Content-Type", "application/json");
|
|
// 网络应答
|
|
|
|
QNetworkReply* reply = networkAccessManager.post(request, PostData.toUtf8());
|
|
QByteArray responseData;
|
|
// 事件循环
|
|
if (async)
|
|
{
|
|
|
|
}
|
|
QEventLoop eventLoop;
|
|
// 连接信号和槽
|
|
connect(&networkAccessManager, SIGNAL(finished(QNetworkReply*)), &eventLoop, SLOT(quit()));
|
|
// 开始循环
|
|
eventLoop.exec();
|
|
|
|
//错误处理
|
|
if (reply->error() != QNetworkReply::NoError)
|
|
{
|
|
qDebug() << "Request protobufHttp handle errors here";
|
|
QVariant statusCodeV = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
|
|
// statusCodeV是HTTP服务器的相应码,reply->error()是Qt定义的错误码,可以参考QT的文档
|
|
qDebug("request protobufHttp found error ....code: %d %d\n", statusCodeV.toInt(), (int)reply->error());
|
|
qDebug(qPrintable(reply->errorString()));
|
|
reply->deleteLater();
|
|
return "";
|
|
}
|
|
|
|
//RC4(QByteArray::fromHex(数据.toUtf8()), ParamDecrypt(m_commKey));
|
|
//QString strReply = reply->readAll();
|
|
QString result = reply->readAll();//RC4(QByteArray::fromHex(reply->readAll()),ParamDecrypt(m_commKey));
|
|
//qDebug() << "访问结果:" << result.toStdString().c_str();
|
|
reply->deleteLater();
|
|
|
|
QJsonDocument jsonDocument = QJsonDocument::fromJson(result.toLocal8Bit().data());
|
|
if (jsonDocument.isNull())
|
|
{
|
|
//qDebug() << "String NULL";;
|
|
}
|
|
QJsonObject jsonObject = jsonDocument.object();
|
|
QString jsonCode = jsonObject["code"].toVariant().toString();//QString::number(jsonObject["code"].toInt());
|
|
QString jsonMsg = jsonObject["msg"].toVariant().toString();
|
|
QString jsonData = jsonObject["data"].toVariant().toString();
|
|
QString jsonSign = jsonObject["sign"].toVariant().toString();
|
|
QString jsonTampstamp = jsonObject["timestamp"].toVariant().toString();
|
|
|
|
Result = RC4(QByteArray::fromHex(jsonData.toUtf8()), ParamDecrypt(m_commKey));
|
|
if (!jsonSign.isEmpty())
|
|
{
|
|
QString verifySign = this->Md5(jsonCode.toUtf8() + jsonMsg.toUtf8() + jsonData.toUtf8());
|
|
if (verifySign != jsonSign)
|
|
{
|
|
Result = "数据校验失败";
|
|
return false;
|
|
}
|
|
}
|
|
|
|
if (jsonCode == "1")
|
|
{
|
|
return true;
|
|
}
|
|
Result = jsonMsg;
|
|
return false;
|
|
VMProtectEnd();
|
|
}
|
|
|
|
|
|
bool Verify::Login(QString Username, QString Password, QString& result)
|
|
{
|
|
VMProtectBegin("Verify_Login");
|
|
QJsonObject JsonObject;
|
|
JsonObject.insert("username", Username);
|
|
JsonObject.insert("password", Password);
|
|
JsonObject.insert("hardwareCode", m_machineCode);
|
|
QJsonDocument jsonDoc = QJsonDocument(JsonObject);
|
|
QString post_data = jsonDoc.toJson(QJsonDocument::Compact);
|
|
//qDebug() << "参数:" << post_data.toStdString().c_str();
|
|
if (!Send("login", post_data, result))
|
|
{
|
|
//qDebug() << "登录失败:" << result.toStdString().c_str();
|
|
//result = "登录失败";
|
|
return false;
|
|
}
|
|
//qDebug() << "登录成功:" << result.toStdString().c_str();
|
|
QJsonDocument jsonDocument = QJsonDocument::fromJson(result.toLocal8Bit().data());
|
|
if (jsonDocument.isNull())
|
|
{
|
|
//qDebug() << "String NULL";;
|
|
result = "登录失败";
|
|
return false;
|
|
}
|
|
QJsonObject jsonObject = jsonDocument.object();
|
|
QString jsonTime = jsonObject["expireTime"].toVariant().toString();
|
|
m_dueTime = QDateTime::fromString(jsonTime, "yyyy-MM-dd hh:mm:ss");
|
|
m_username = Username;
|
|
m_password = Password;
|
|
return true;
|
|
VMProtectEnd();
|
|
}
|
|
|
|
bool Verify::Heartbeat(QString& result)
|
|
{
|
|
VMProtectBegin("Verify_Heartbeat");
|
|
QJsonObject JsonObject;
|
|
JsonObject.insert("username", m_username);
|
|
JsonObject.insert("password", m_password);
|
|
JsonObject.insert("hardwareCode", m_machineCode);
|
|
QJsonDocument jsonDoc = QJsonDocument(JsonObject);
|
|
QString post_data = jsonDoc.toJson(QJsonDocument::Compact);
|
|
//qDebug() << "参数:" << post_data.toStdString().c_str();
|
|
if (!Send("heartbeat", post_data, result))
|
|
{
|
|
//qDebug() << "心跳失败:" << result.toStdString().c_str();
|
|
return false;
|
|
}
|
|
//qDebug() << "登录成功:" << result.toStdString().c_str();
|
|
QJsonDocument jsonDocument = QJsonDocument::fromJson(result.toLocal8Bit().data());
|
|
if (jsonDocument.isNull())
|
|
{
|
|
//qDebug() << "String NULL";;
|
|
return false;
|
|
}
|
|
QJsonObject jsonObject = jsonDocument.object();
|
|
QString jsonTime = jsonObject["expireTime"].toVariant().toString();
|
|
m_dueTime = QDateTime::fromString(jsonTime, "yyyy-MM-dd hh:mm:ss");
|
|
|
|
return true;
|
|
VMProtectEnd();
|
|
}
|
|
|
|
bool Verify::checkUpdate()
|
|
{
|
|
VMProtectBegin("Verify_Check");
|
|
QString result;
|
|
QJsonObject JsonObject;
|
|
JsonObject.insert("username", m_username);
|
|
JsonObject.insert("password", m_password);
|
|
JsonObject.insert("hardwareCode", m_machineCode);
|
|
QJsonDocument jsonDoc = QJsonDocument(JsonObject);
|
|
QString post_data = jsonDoc.toJson(QJsonDocument::Compact);
|
|
//qDebug() << "参数:" << post_data.toStdString().c_str();
|
|
if (!Send("version", post_data, result))
|
|
{
|
|
//qDebug() << "获取版本失败:" << result.toStdString().c_str();
|
|
return false;
|
|
}
|
|
//qDebug() << "获取版本成功:" << result.toStdString().c_str();
|
|
QJsonDocument jsonDocument = QJsonDocument::fromJson(result.toLocal8Bit().data());
|
|
if (jsonDocument.isNull())
|
|
{
|
|
//qDebug() << "String NULL";;
|
|
return false;
|
|
}
|
|
QJsonObject jsonObject = jsonDocument.object();
|
|
QString version = jsonObject["version"].toVariant().toString();
|
|
//qDebug() << "最新版本:" << version;
|
|
if (m_version == version)
|
|
{
|
|
//qDebug() << "验证结果: 真";
|
|
}
|
|
else
|
|
{
|
|
//qDebug() << "验证结果: 假";
|
|
}
|
|
|
|
return version == m_version;
|
|
VMProtectEnd();
|
|
}
|
|
|
|
QString Verify::Username()
|
|
{
|
|
return m_username;
|
|
}
|
|
|
|
QDateTime Verify::GetDueTime()
|
|
{
|
|
return m_dueTime;
|
|
}
|
|
|
|
bool Verify::push_msg(QString type,QString app,QString account,QMap<QString, QString> order)
|
|
{
|
|
VMProtectBegin("Verify_Push");
|
|
QString result;
|
|
QJsonObject JsonObject;
|
|
JsonObject.insert("username", m_username);
|
|
JsonObject.insert("password", m_password);
|
|
JsonObject.insert("account", m_machineCode);
|
|
JsonObject.insert("type", type);
|
|
JsonObject.insert("app", app);
|
|
JsonObject.insert("account", account);
|
|
|
|
// 修复:直接将 QMap 转换为 QJsonObject
|
|
QJsonObject orderJson;
|
|
for (auto it = order.begin(); it != order.end(); ++it) {
|
|
if (it.key() == "TEAM_H")
|
|
{
|
|
//qDebug() << "队伍H:" << it.value();
|
|
}
|
|
if (it.key() == "TEAM_C")
|
|
{
|
|
//qDebug() << "队伍C:" << it.value();
|
|
}
|
|
orderJson.insert(it.key(), it.value());
|
|
}
|
|
//qDebug() << orderJson;
|
|
JsonObject.insert("order", orderJson);
|
|
|
|
QJsonDocument jsonDoc = QJsonDocument(JsonObject);
|
|
QString post_data = jsonDoc.toJson(QJsonDocument::Compact);
|
|
//qDebug() << "参数:" << post_data.toStdString().c_str();
|
|
if (!Send("push", post_data, result))
|
|
{
|
|
//qDebug() << "推送消息失败:" << result.toStdString().c_str();
|
|
return false;
|
|
}
|
|
//qDebug() << "推送成功:" << result.toStdString().c_str();
|
|
QJsonDocument jsonDocument = QJsonDocument::fromJson(result.toLocal8Bit().data());
|
|
if (jsonDocument.isNull())
|
|
{
|
|
//qDebug() << "String NULL";;
|
|
return false;
|
|
}
|
|
QJsonObject jsonObject = jsonDocument.object();
|
|
QString version = jsonObject["version"].toVariant().toString();
|
|
//qDebug() << "最新版本:" << version;
|
|
if (m_version == version)
|
|
{
|
|
//qDebug() << "验证结果: 真";
|
|
}
|
|
else
|
|
{
|
|
//qDebug() << "验证结果: 假";
|
|
}
|
|
|
|
return false;
|
|
VMProtectEnd();
|
|
}
|