From 5338b4e1ab7bf39afef971c0e66bfabe2bfed92a Mon Sep 17 00:00:00 2001 From: Mathew Date: Thu, 21 Apr 2022 16:47:06 +0300 Subject: [PATCH] Fixes for Qt 5 --- crypto.cpp | 4 ++-- library.pri | 25 +++++++++++-------------- telegramapi.cpp | 2 +- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/crypto.cpp b/crypto.cpp index 63bb9e7..3372401 100644 --- a/crypto.cpp +++ b/crypto.cpp @@ -10,8 +10,8 @@ #include DHKey::DHKey(QString publicKey, qint64 fingerprint, QString exponent) : - publicKey(QByteArray::fromHex(publicKey.toAscii())), - exponent(QByteArray::fromHex(exponent.toAscii())), + publicKey(QByteArray::fromHex(publicKey.toUtf8())), + exponent(QByteArray::fromHex(exponent.toUtf8())), fingerprint(fingerprint) { diff --git a/library.pri b/library.pri index 2e5340a..59035b1 100644 --- a/library.pri +++ b/library.pri @@ -13,21 +13,18 @@ contains(MOBILITY_CONFIG, systeminfo) { include(qt-json/qt-json.pri) include(thirdparty/thirdparty.pri) -win32:include(zlib/zlib.pri) -!symbian:unix:LIBS += -lz - symbian:LIBS += -llibcrypto -!symbian:unix:LIBS += -lcrypto - -win32 { - exists(C:/OpenSSL-Win32) { - LIBS += -LC:/OpenSSL-Win32/lib - LIBS += -llibcrypto - INCLUDEPATH += C:/OpenSSL-Win32/include - } else { - message(OpenSSL-Win32 1.1.1 not found. Install it from https://slproweb.com/ to C:/OpenSSL-Win32) - } -} + +!symbian:!android:unix:LIBS += -lz +!symbian:!android:unix:LIBS += -lcrypto + +android:LIBS += -lz +android:LIBS += -LC:/QtAndroid/openssl -lcrypto +android:INCLUDEPATH += C:/QtAndroid/openssl/include + +win32:include(zlib/zlib.pri) +win32:LIBS += -LC:/OpenSSL-Win32/lib -llibcrypto +win32:INCLUDEPATH += C:/OpenSSL-Win32/include HEADERS += \ $$PWD/telegramclient.h \ diff --git a/telegramapi.cpp b/telegramapi.cpp index ff5cbc7..1e123e3 100644 --- a/telegramapi.cpp +++ b/telegramapi.cpp @@ -19,7 +19,7 @@ void TelegramClient::handleLoginToken(QByteArray data, qint64 mtm) readTLAuthLoginToken(packet, var); TelegramObject loginToken = var.toMap(); - emit gotLoginToken(mtm, loginToken["expires"].toInt(), "tg://login?token=" + QString::fromAscii(loginToken["token"].toByteArray().toBase64()).replace("+", "-").replace("/", "_")); + emit gotLoginToken(mtm, loginToken["expires"].toInt(), "tg://login?token=" + QString::fromUtf8(loginToken["token"].toByteArray().toBase64()).replace("+", "-").replace("/", "_")); } void TelegramClient::handleLoginTokenSuccess(QByteArray data, qint64 mtm)