From 06f489520115aa3d1a4928a5e1fe5b0aaf8c5d57 Mon Sep 17 00:00:00 2001 From: DrKLO Date: Sun, 5 Jan 2020 21:39:58 +0300 Subject: [PATCH] Update to 5.13.1 (1828) --- TMessagesProj/build.gradle | 2 +- TMessagesProj/jni/tgnet/ConnectionsManager.cpp | 12 ++++++++---- .../main/java/org/telegram/messenger/BuildVars.java | 2 +- .../java/org/telegram/tgnet/ConnectionsManager.java | 1 - 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 160963bdc..8d8507f01 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -283,7 +283,7 @@ android { } } - defaultConfig.versionCode = 1827 + defaultConfig.versionCode = 1828 applicationVariants.all { variant -> variant.outputs.all { output -> diff --git a/TMessagesProj/jni/tgnet/ConnectionsManager.cpp b/TMessagesProj/jni/tgnet/ConnectionsManager.cpp index 18b25431b..7875e89ab 100644 --- a/TMessagesProj/jni/tgnet/ConnectionsManager.cpp +++ b/TMessagesProj/jni/tgnet/ConnectionsManager.cpp @@ -377,8 +377,8 @@ void ConnectionsManager::loadConfig() { if (version >= 5) { int32_t lastServerTime = buffer->readInt32(nullptr); int32_t currentTime = getCurrentTime(); - if (currentTime < lastServerTime) { - timeDifference = lastServerTime - currentTime; + if (currentTime > timeDifference && currentTime < lastServerTime) { + timeDifference += (lastServerTime - currentTime); } } @@ -659,7 +659,11 @@ void ConnectionsManager::onConnectionClosed(Connection *connection, int reason) if (!connection->hasUsefullData()) { if (LOGS_ENABLED) DEBUG_D("start requesting new address and port due to timeout reach"); requestingSecondAddressByTlsHashMismatch = connection->hasTlsHashMismatch(); - requestingSecondAddress = 0; + if (requestingSecondAddressByTlsHashMismatch) { + requestingSecondAddress = 1; + } else { + requestingSecondAddress = 0; + } delegate->onRequestNewServerIpAndPort(requestingSecondAddress, instanceNum); } else { if (LOGS_ENABLED) DEBUG_D("connection has usefull data, don't request anything"); @@ -3097,7 +3101,7 @@ void ConnectionsManager::applyDnsConfig(NativeByteBuffer *buffer, std::string ph int currentDate = getCurrentTime(); if (config != nullptr && config->date <= currentDate && currentDate <= config->expires) { if (realDate > 0 && requestingSecondAddressByTlsHashMismatch) { - timeDifference = realDate - currentDate; + timeDifference += (realDate - currentDate); requestingSecondAddressByTlsHashMismatch = false; } for (std::vector>::iterator iter = config->rules.begin(); iter != config->rules.end(); iter++) { diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java b/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java index ec6352096..3167c9e98 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java @@ -19,7 +19,7 @@ public class BuildVars { public static boolean USE_CLOUD_STRINGS = true; public static boolean CHECK_UPDATES = true; public static boolean TON_WALLET_STANDALONE = false; - public static int BUILD_VERSION = 1827; + public static int BUILD_VERSION = 1828; public static String BUILD_VERSION_STRING = "5.13.0"; public static int APP_ID = 4; public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103"; diff --git a/TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java b/TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java index 1c58ea627..78dcbaf43 100644 --- a/TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java +++ b/TMessagesProj/src/main/java/org/telegram/tgnet/ConnectionsManager.java @@ -996,7 +996,6 @@ public class ConnectionsManager extends BaseController { protected NativeByteBuffer doInBackground(Void... voids) { ByteArrayOutputStream outbuf = null; InputStream httpConnectionStream = null; - //curl -s "https://dns.google.com/resolve?name=apv2.stel.com&type=ANY&random_padding=askdkadaas3232dskdKFKDs" try { String domain = native_isTestBackend(currentAccount) != 0 ? "tapv3.stel.com" : AccountInstance.getInstance(currentAccount).getMessagesController().dcDomainName; int len = Utilities.random.nextInt(116) + 13;