Switch Linux HDID code to Qt shenanigans (#879)
* Replace legacy Linux HDID code This should, I guess, fix t * Bump zlib version * Libbass changed the folder structure, it seems. * Should update the rest too. * Add default HDID
This commit is contained in:
parent
8a0404f424
commit
1aca9a19db
@ -36,7 +36,7 @@ QString get_hdid()
|
||||
ConvertSidToStringSidW(pToken->User.Sid, &HDIDParam);
|
||||
QString returnHDID = QString::fromWCharArray(HDIDParam);
|
||||
CloseHandle(hToken);
|
||||
return returnHDID;
|
||||
return returnHDID;
|
||||
}
|
||||
#elif defined(ANDROID)
|
||||
QString get_hdid()
|
||||
@ -50,30 +50,18 @@ QString get_hdid()
|
||||
}
|
||||
#elif QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
|
||||
#if (defined(LINUX) || defined(__linux__))
|
||||
#include <QSysInfo>
|
||||
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
QByteArray machineId;
|
||||
|
||||
QString get_hdid()
|
||||
{
|
||||
QFile fstab_file("/etc/fstab");
|
||||
if (!fstab_file.open(QIODevice::ReadOnly))
|
||||
return "uxcps32sa9fnwic92mfbs0";
|
||||
machineId = QSysInfo::machineUniqueId();
|
||||
|
||||
QTextStream in(&fstab_file);
|
||||
|
||||
while (!in.atEnd()) {
|
||||
QString line = in.readLine();
|
||||
|
||||
if (line.startsWith("UUID")) {
|
||||
QStringList line_elements = line.split("=");
|
||||
|
||||
if (line_elements.size() > 1)
|
||||
return line_elements.at(1).left(23).trimmed();
|
||||
}
|
||||
if (machineId.isEmpty()) {
|
||||
return "gxsps32sa9fnwic92mfbs2";
|
||||
}
|
||||
|
||||
return "uxcpz32sa9fnwic92mfbs1";
|
||||
return QString(machineId);
|
||||
}
|
||||
|
||||
#elif defined __APPLE__
|
||||
|
Loading…
Reference in New Issue
Block a user