From 65769599482ffe248ca891f04d74841b53850fd0 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 1 Mar 2017 21:42:36 +0300 Subject: [PATCH] Alpha 1.0.18: destroying auth keys on sign up. Also some debugging tools for mtproto endpoints added. --- Telegram/Resources/uwp/AppX/AppxManifest.xml | 2 +- Telegram/Resources/winrc/Telegram.rc | 8 +-- Telegram/Resources/winrc/Updater.rc | 8 +-- Telegram/SourceFiles/core/version.h | 8 +-- Telegram/build/replace.vbs | 36 +++++++---- Telegram/build/set_version.bat | 67 ++++++++++++++------ Telegram/build/set_version.sh | 20 ++++++ Telegram/build/version | 10 +-- changelog.txt | 6 +- 9 files changed, 114 insertions(+), 51 deletions(-) diff --git a/Telegram/Resources/uwp/AppX/AppxManifest.xml b/Telegram/Resources/uwp/AppX/AppxManifest.xml index 0c090148d..ee5bca384 100644 --- a/Telegram/Resources/uwp/AppX/AppxManifest.xml +++ b/Telegram/Resources/uwp/AppX/AppxManifest.xml @@ -9,7 +9,7 @@ + Version="1.0.18.0" /> Telegram Desktop Telegram Messenger LLP diff --git a/Telegram/Resources/winrc/Telegram.rc b/Telegram/Resources/winrc/Telegram.rc index 200819f67..f6d0fb84a 100644 --- a/Telegram/Resources/winrc/Telegram.rc +++ b/Telegram/Resources/winrc/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,17,1 - PRODUCTVERSION 1,0,17,1 + FILEVERSION 1,0,18,0 + PRODUCTVERSION 1,0,18,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -52,10 +52,10 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram Messenger LLP" VALUE "FileDescription", "Telegram Desktop" - VALUE "FileVersion", "1.0.17.1" + VALUE "FileVersion", "1.0.18.0" VALUE "LegalCopyright", "Copyright (C) 2014-2017" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "1.0.17.1" + VALUE "ProductVersion", "1.0.18.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Resources/winrc/Updater.rc b/Telegram/Resources/winrc/Updater.rc index 3c755351e..c5f7d7ee8 100644 --- a/Telegram/Resources/winrc/Updater.rc +++ b/Telegram/Resources/winrc/Updater.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,17,1 - PRODUCTVERSION 1,0,17,1 + FILEVERSION 1,0,18,0 + PRODUCTVERSION 1,0,18,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -43,10 +43,10 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram Messenger LLP" VALUE "FileDescription", "Telegram Desktop Updater" - VALUE "FileVersion", "1.0.17.1" + VALUE "FileVersion", "1.0.18.0" VALUE "LegalCopyright", "Copyright (C) 2014-2017" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "1.0.17.1" + VALUE "ProductVersion", "1.0.18.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h index a83ebdb4f..bb7436732 100644 --- a/Telegram/SourceFiles/core/version.h +++ b/Telegram/SourceFiles/core/version.h @@ -22,9 +22,9 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "core/utils.h" -#define BETA_VERSION_MACRO (1000017001ULL) +#define BETA_VERSION_MACRO (0ULL) -constexpr int AppVersion = 1000017; -constexpr str_const AppVersionStr = "1.0.17"; -constexpr bool AppAlphaVersion = false; +constexpr int AppVersion = 1000018; +constexpr str_const AppVersionStr = "1.0.18"; +constexpr bool AppAlphaVersion = true; constexpr uint64 AppBetaVersion = BETA_VERSION_MACRO; diff --git a/Telegram/build/replace.vbs b/Telegram/build/replace.vbs index 509445e2a..5b23ab8ee 100644 --- a/Telegram/build/replace.vbs +++ b/Telegram/build/replace.vbs @@ -1,23 +1,35 @@ -Dim pat, patparts, rxp, inp, found -pat = WScript.Arguments(0) +Dim action, pat, patparts, rxp, inp, matchCount +action = WScript.Arguments(0) +pat = WScript.Arguments(1) pat = Replace(pat, """, chr(34)) pat = Replace(pat, "&hat;", "^") pat = Replace(pat, "&", "&") -patparts = Split(pat,"/") + Set rxp = new RegExp -found = False rxp.Global = True rxp.Multiline = False -rxp.Pattern = patparts(0) +If action = "Replace" Then + patparts = Split(pat, "/") + rxp.Pattern = patparts(0) +Else + rxp.Pattern = pat +End If + +matchCount = 0 Do While Not WScript.StdIn.AtEndOfStream inp = WScript.StdIn.ReadLine() - If not found Then - If rxp.Test(inp) Then - found = True - End If + If rxp.Test(inp) Then + matchCount = matchCount + 1 + End If + If action = "Replace" Then + WScript.Echo rxp.Replace(inp, patparts(1)) End If - WScript.Echo rxp.Replace(inp, patparts(1)) Loop -If not found Then - WScript.Quit(2) + +If action = "Replace" Then + If matchCount = 0 Then + WScript.Quit(2) + End If +Else + WScript.Echo matchCount End If diff --git a/Telegram/build/set_version.bat b/Telegram/build/set_version.bat index 01f2f2564..4b448ebce 100644 --- a/Telegram/build/set_version.bat +++ b/Telegram/build/set_version.bat @@ -73,39 +73,56 @@ if "%VersionAlpha%" neq "0" ( echo Setting version: %VersionStr% stable ) +echo Checking changelog... +set "ChangelogFile=%FullScriptPath%..\..\changelog.txt" +call :count "Argument=^%VersionStr% " "Filename=%ChangelogFile%" +if "%FoundCount%" equ "0" ( + call :count "Argument=^%VersionStrSmall% " "Filename=%ChangelogFile%" + if "!FoundCount!" equ "0" ( + echo Changelog entry not found! + exit /b 1 + ) else if "!FoundCount!" neq "1" ( + echo Wrong changelog entries count found: %FoundCount% + exit /b 1 + ) +) else if "%FoundCount%" neq "1" ( + echo Wrong changelog entries count found: %FoundCount% + exit /b 1 +) + echo Patching build/version... set "VersionFilePath=%FullScriptPath%version" -call :repl "Replace=(AppVersion) (\s*)\d+/$1$2 %VersionFull%" "Filename=%VersionFilePath%" || goto :error -call :repl "Replace=(AppVersionStrMajor) (\s*)[\d\.]+/$1$2 %VersionMajor%.%VersionMinor%" "Filename=%VersionFilePath%" || goto :error -call :repl "Replace=(AppVersionStrSmall) (\s*)[\d\.]+/$1$2 %VersionStrSmall%" "Filename=%VersionFilePath%" || goto :error -call :repl "Replace=(AppVersionStr) (\s*)[\d\.]+/$1$2 %VersionStr%" "Filename=%VersionFilePath%" || goto :error -call :repl "Replace=(AlphaChannel) (\s*)[\d\.]+/$1$2 %VersionAlpha%" "Filename=%VersionFilePath%" || goto :error -call :repl "Replace=(BetaVersion) (\s*)\d+/$1$2 %VersionFullBeta%" "Filename=%VersionFilePath%" || goto :error +call :repl "Argument=(AppVersion) (\s*)\d+/$1$2 %VersionFull%" "Filename=%VersionFilePath%" || goto :error +call :repl "Argument=(AppVersionStrMajor) (\s*)[\d\.]+/$1$2 %VersionMajor%.%VersionMinor%" "Filename=%VersionFilePath%" || goto :error +call :repl "Argument=(AppVersionStrSmall) (\s*)[\d\.]+/$1$2 %VersionStrSmall%" "Filename=%VersionFilePath%" || goto :error +call :repl "Argument=(AppVersionStr) (\s*)[\d\.]+/$1$2 %VersionStr%" "Filename=%VersionFilePath%" || goto :error +call :repl "Argument=(AlphaChannel) (\s*)[\d\.]+/$1$2 %VersionAlpha%" "Filename=%VersionFilePath%" || goto :error +call :repl "Argument=(BetaVersion) (\s*)\d+/$1$2 %VersionFullBeta%" "Filename=%VersionFilePath%" || goto :error echo Patching core/version.h... set "VersionHeaderPath=%FullScriptPath%..\SourceFiles\core\version.h" -call :repl "Replace=(BETA_VERSION_MACRO\s+)\(\d+ULL\)/$1(%VersionFullBeta%ULL)" "Filename=%VersionHeaderPath%" || goto :error -call :repl "Replace=(AppVersion\s+=) (\s*)\d+/$1$2 %VersionFull%" "Filename=%VersionHeaderPath%" || goto :error -call :repl "Replace=(AppVersionStr\s+=) (\s*)[&hat;;]+/$1$2 "%VersionStrSmall%"" "Filename=%VersionHeaderPath%" || goto :error -call :repl "Replace=(AppAlphaVersion\s+=) (\s*)[a-z]+/$1$2 %VersionAlphaBool%" "Filename=%VersionHeaderPath%" || goto :error +call :repl "Argument=(BETA_VERSION_MACRO\s+)\(\d+ULL\)/$1(%VersionFullBeta%ULL)" "Filename=%VersionHeaderPath%" || goto :error +call :repl "Argument=(AppVersion\s+=) (\s*)\d+/$1$2 %VersionFull%" "Filename=%VersionHeaderPath%" || goto :error +call :repl "Argument=(AppVersionStr\s+=) (\s*)[&hat;;]+/$1$2 "%VersionStrSmall%"" "Filename=%VersionHeaderPath%" || goto :error +call :repl "Argument=(AppAlphaVersion\s+=) (\s*)[a-z]+/$1$2 %VersionAlphaBool%" "Filename=%VersionHeaderPath%" || goto :error echo Patching Telegram.rc... set "ResourcePath=%FullScriptPath%..\Resources\winrc\Telegram.rc" -call :repl "Replace=(FILEVERSION) (\s*)\d+,\d+,\d+,\d+/$1$2 %VersionMajor%,%VersionMinor%,%VersionPatch%,%VersionBeta%" "Filename=%ResourcePath%" || goto :error -call :repl "Replace=(PRODUCTVERSION) (\s*)\d+,\d+,\d+,\d+/$1$2 %VersionMajor%,%VersionMinor%,%VersionPatch%,%VersionBeta%" "Filename=%ResourcePath%" || goto :error -call :repl "Replace=("FileVersion",) (\s*)"\d+.\d+.\d+.\d+"/$1$2 "%VersionMajor%.%VersionMinor%.%VersionPatch%.%VersionBeta%"" "Filename=%ResourcePath%" || goto :error -call :repl "Replace=("ProductVersion",) (\s*)"\d+.\d+.\d+.\d+"/$1$2 "%VersionMajor%.%VersionMinor%.%VersionPatch%.%VersionBeta%"" "Filename=%ResourcePath%" || goto :error +call :repl "Argument=(FILEVERSION) (\s*)\d+,\d+,\d+,\d+/$1$2 %VersionMajor%,%VersionMinor%,%VersionPatch%,%VersionBeta%" "Filename=%ResourcePath%" || goto :error +call :repl "Argument=(PRODUCTVERSION) (\s*)\d+,\d+,\d+,\d+/$1$2 %VersionMajor%,%VersionMinor%,%VersionPatch%,%VersionBeta%" "Filename=%ResourcePath%" || goto :error +call :repl "Argument=("FileVersion",) (\s*)"\d+.\d+.\d+.\d+"/$1$2 "%VersionMajor%.%VersionMinor%.%VersionPatch%.%VersionBeta%"" "Filename=%ResourcePath%" || goto :error +call :repl "Argument=("ProductVersion",) (\s*)"\d+.\d+.\d+.\d+"/$1$2 "%VersionMajor%.%VersionMinor%.%VersionPatch%.%VersionBeta%"" "Filename=%ResourcePath%" || goto :error echo Patching Updater.rc... set "ResourcePath=%FullScriptPath%..\Resources\winrc\Updater.rc" -call :repl "Replace=(FILEVERSION) (\s*)\d+,\d+,\d+,\d+/$1$2 %VersionMajor%,%VersionMinor%,%VersionPatch%,%VersionBeta%" "Filename=%ResourcePath%" || goto :error -call :repl "Replace=(PRODUCTVERSION) (\s*)\d+,\d+,\d+,\d+/$1$2 %VersionMajor%,%VersionMinor%,%VersionPatch%,%VersionBeta%" "Filename=%ResourcePath%" || goto :error -call :repl "Replace=("FileVersion",) (\s*)"\d+.\d+.\d+.\d+"/$1$2 "%VersionMajor%.%VersionMinor%.%VersionPatch%.%VersionBeta%"" "Filename=%ResourcePath%" || goto :error -call :repl "Replace=("ProductVersion",) (\s*)"\d+.\d+.\d+.\d+"/$1$2 "%VersionMajor%.%VersionMinor%.%VersionPatch%.%VersionBeta%"" "Filename=%ResourcePath%" || goto :error +call :repl "Argument=(FILEVERSION) (\s*)\d+,\d+,\d+,\d+/$1$2 %VersionMajor%,%VersionMinor%,%VersionPatch%,%VersionBeta%" "Filename=%ResourcePath%" || goto :error +call :repl "Argument=(PRODUCTVERSION) (\s*)\d+,\d+,\d+,\d+/$1$2 %VersionMajor%,%VersionMinor%,%VersionPatch%,%VersionBeta%" "Filename=%ResourcePath%" || goto :error +call :repl "Argument=("FileVersion",) (\s*)"\d+.\d+.\d+.\d+"/$1$2 "%VersionMajor%.%VersionMinor%.%VersionPatch%.%VersionBeta%"" "Filename=%ResourcePath%" || goto :error +call :repl "Argument=("ProductVersion",) (\s*)"\d+.\d+.\d+.\d+"/$1$2 "%VersionMajor%.%VersionMinor%.%VersionPatch%.%VersionBeta%"" "Filename=%ResourcePath%" || goto :error echo Patching appxmanifest.xml... set "ResourcePath=%FullScriptPath%..\Resources\uwp\AppX\AppxManifest.xml" -call :repl "Replace= (Version=)"\d+.\d+.\d+.\d+"/ $1"%VersionMajor%.%VersionMinor%.%VersionPatch%.%VersionBeta%"" "Filename=%ResourcePath%" || goto :error +call :repl "Argument= (Version=)"\d+.\d+.\d+.\d+"/ $1"%VersionMajor%.%VersionMinor%.%VersionPatch%.%VersionBeta%"" "Filename=%ResourcePath%" || goto :error exit /b @@ -121,11 +138,21 @@ exit /b set %1 set %2 set "TempFilename=!Filename!__tmp__" - cscript //Nologo "%FullScriptPath%replace.vbs" "!Replace!" < "!Filename!" > "!TempFilename!" || goto :repl_finish + cscript //Nologo "%FullScriptPath%replace.vbs" "Replace" "!Argument!" < "!Filename!" > "!TempFilename!" || goto :repl_finish xcopy /Y !TempFilename! !Filename! >NUL || goto :repl_finish goto :repl_finish ) +:count +( + set %1 + set %2 + set "TempFilename=!Filename!__tmp__" + cscript //Nologo "%FullScriptPath%replace.vbs" "Count" "!Argument!" < "!Filename!" > "!TempFilename!" || goto :repl_finish + FOR /F "tokens=1,2* delims= " %%i in (!TempFilename!) do set "FoundCount=%%i" + goto :repl_finish +) + :repl_finish ( set ErrorCode=%errorlevel% diff --git a/Telegram/build/set_version.sh b/Telegram/build/set_version.sh index 1580682af..f251764cc 100755 --- a/Telegram/build/set_version.sh +++ b/Telegram/build/set_version.sh @@ -90,6 +90,26 @@ repl () { fi } +echo "Checking changelog..." +ChangelogFile="$FullScriptPath/../../changelog.txt" +ChangelogCommand="grep -sc '^$VersionStr ' $ChangelogFile" +set +e +FoundCount=`eval $ChangelogCommand` +set -e +if [ "$FoundCount" == "0" ]; then + ChangelogCommand="grep -sc '^$VersionStrSmall ' $ChangelogFile" + set +e + FoundCount=`eval $ChangelogCommand` + set -e + if [ "$FoundCount" == "0" ]; then + Error "Changelog entry not found!" + elif [ "$FoundCount" != "1" ]; then + Error "Wrong changelog entries count found: $FoundCount" + fi +elif [ "$FoundCount" != "1" ]; then + Error "Wrong changelog entries count found: $FoundCount" +fi + echo "Patching build/version..." VersionFilePath="$FullScriptPath/version" repl "\(AppVersion\) \([ ]*\)[0-9][0-9]*" "\1\2 $VersionFull" "$VersionFilePath" diff --git a/Telegram/build/version b/Telegram/build/version index 79ea8fe3d..13fda5284 100644 --- a/Telegram/build/version +++ b/Telegram/build/version @@ -1,6 +1,6 @@ -AppVersion 1000017 +AppVersion 1000018 AppVersionStrMajor 1.0 -AppVersionStrSmall 1.0.17 -AppVersionStr 1.0.17 -AlphaChannel 0 -BetaVersion 1000017001 +AppVersionStrSmall 1.0.18 +AppVersionStr 1.0.18 +AlphaChannel 1 +BetaVersion 0 diff --git a/changelog.txt b/changelog.txt index b20b23cda..844b296ea 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,8 @@ -1.0.17 alpha (28.02.17) +1.0.18 alpha (01.03.17) + +- Bug fixes and other minor improvements. + +1.0.17 alpha (28.02.17) - Bug fixes and other minor improvements.