From 91e1330b5966b0422b9ada4750249985582b4390 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 4 Feb 2016 20:45:53 +0300 Subject: [PATCH 1/2] improved breakpad appstore patch --- Telegram/Build.sh | 2 +- Telegram/_breakpad_appstore_patch.diff | 147 +++++++++++++++++++++---- 2 files changed, 126 insertions(+), 23 deletions(-) diff --git a/Telegram/Build.sh b/Telegram/Build.sh index 302419fad..f7a64597f 100755 --- a/Telegram/Build.sh +++ b/Telegram/Build.sh @@ -209,7 +209,7 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarg fi echo "Dumping debug symbols.." - "./../../Libraries/breakpad/src/tools/mac/dump_syms/build/Release/dump_syms" "$ReleasePath/$BinaryName.app/Contents/MacOS/$BinaryName" > "$ReleasePath/$BinaryName.sym" + "./../../Libraries/breakpad/src/tools/mac/dump_syms/build/Release/dump_syms" "$ReleasePath/$BinaryName.app.dSYM" > "$ReleasePath/$BinaryName.sym" 2>/dev/null echo "Done!" echo "Stripping the executable.." diff --git a/Telegram/_breakpad_appstore_patch.diff b/Telegram/_breakpad_appstore_patch.diff index 9b12b92b8..7ef79fa21 100644 --- a/Telegram/_breakpad_appstore_patch.diff +++ b/Telegram/_breakpad_appstore_patch.diff @@ -1,16 +1,40 @@ diff --git a/src/client/mac/Breakpad.xcodeproj/project.pbxproj b/src/client/mac/Breakpad.xcodeproj/project.pbxproj -index 584ec5d..9cea428 100644 +index 584ec5d..1c7214f 100644 --- a/src/client/mac/Breakpad.xcodeproj/project.pbxproj +++ b/src/client/mac/Breakpad.xcodeproj/project.pbxproj -@@ -174,7 +174,6 @@ +@@ -35,6 +35,19 @@ + /* End PBXAggregateTarget section */ + + /* Begin PBXBuildFile section */ ++ 0748C0431C63C409004489BF /* MachIPC.mm in Sources */ = {isa = PBXBuildFile; fileRef = F92C53790ECCE635009BE4BA /* MachIPC.mm */; }; ++ 0748C0441C63C43C004489BF /* minidump_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536F0ECCE3FD009BE4BA /* minidump_generator.cc */; }; ++ 0748C0451C63C46C004489BF /* string_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53820ECCE635009BE4BA /* string_utilities.cc */; }; ++ 0748C0461C63C484004489BF /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */; }; ++ 0748C0471C63C4A1004489BF /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */; }; ++ 0748C0491C63C4CF004489BF /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537A0ECCE635009BE4BA /* macho_id.cc */; }; ++ 0748C04A1C63C4D4004489BF /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; }; ++ 0748C04B1C63C4DB004489BF /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.c */; }; ++ 0748C04C1C63C4EA004489BF /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537C0ECCE635009BE4BA /* macho_utilities.cc */; }; ++ 0748C04D1C63C50F004489BF /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53740ECCE635009BE4BA /* file_id.cc */; }; ++ 0748C04E1C63C51C004489BF /* md5.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D72CA0D13DFAD5C006CABE3 /* md5.cc */; }; ++ 0748C04F1C63C523004489BF /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537E0ECCE635009BE4BA /* macho_walker.cc */; }; ++ 0748C0501C63C52D004489BF /* bootstrap_compat.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D61A25D14F43CFC002D5862 /* bootstrap_compat.cc */; }; + 162F64F2161C577500CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64F0161C577500CD68D5 /* arch_utilities.cc */; }; + 162F64F3161C577500CD68D5 /* arch_utilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 162F64F1161C577500CD68D5 /* arch_utilities.h */; }; + 162F64F4161C579B00CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64F0161C577500CD68D5 /* arch_utilities.cc */; }; +@@ -170,11 +183,8 @@ + F92C564A0ECD10CA009BE4BA /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; }; + F92C564C0ECD10DD009BE4BA /* breakpadUtilities.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; }; + F92C56570ECD113E009BE4BA /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F92C554A0ECCF530009BE4BA /* Carbon.framework */; }; +- F92C565C0ECD1158009BE4BA /* breakpadUtilities.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; }; F92C565F0ECD116B009BE4BA /* protected_memory_allocator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53720ECCE3FD009BE4BA /* protected_memory_allocator.cc */; }; F92C56630ECD1179009BE4BA /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; }; - F92C56650ECD1185009BE4BA /* breakpadUtilities.dylib in Resources */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; }; +- F92C56650ECD1185009BE4BA /* breakpadUtilities.dylib in Resources */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; }; - F92C568A0ECD15F9009BE4BA /* Inspector in Resources */ = {isa = PBXBuildFile; fileRef = F92C53540ECCE349009BE4BA /* Inspector */; }; F92C56A90ECE04C5009BE4BA /* crash_report_sender.m in Sources */ = {isa = PBXBuildFile; fileRef = F92C56A80ECE04C5009BE4BA /* crash_report_sender.m */; }; F93803CD0F8083B7004D428B /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */; }; F93803CE0F8083B7004D428B /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; }; -@@ -213,7 +212,6 @@ +@@ -213,7 +223,6 @@ F9C44DBD0EF072A0003AEBAA /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F9C44DBA0EF072A0003AEBAA /* MainMenu.xib */; }; F9C44E000EF077CD003AEBAA /* Breakpad.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Breakpad.framework */; }; F9C44E3C0EF08B12003AEBAA /* Breakpad.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Breakpad.framework */; }; @@ -18,10 +42,17 @@ index 584ec5d..9cea428 100644 F9C44EA20EF09F93003AEBAA /* HTTPMultipartUpload.m in Sources */ = {isa = PBXBuildFile; fileRef = F92C53770ECCE635009BE4BA /* HTTPMultipartUpload.m */; }; F9C44EE50EF0A006003AEBAA /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9C44EE40EF0A006003AEBAA /* SystemConfiguration.framework */; }; F9C44EE90EF0A3C1003AEBAA /* GTMLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = F9C44EE80EF0A3C1003AEBAA /* GTMLogger.m */; }; -@@ -417,13 +415,6 @@ +@@ -410,20 +419,6 @@ remoteGlobalIDString = F92C563B0ECD10B3009BE4BA; remoteInfo = breakpadUtilities; }; +- F92C56850ECD15EF009BE4BA /* PBXContainerItemProxy */ = { +- isa = PBXContainerItemProxy; +- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; +- proxyType = 1; +- remoteGlobalIDString = F92C563B0ECD10B3009BE4BA; +- remoteInfo = breakpadUtilities; +- }; - F92C56870ECD15F1009BE4BA /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; @@ -32,7 +63,7 @@ index 584ec5d..9cea428 100644 F93DE2FB0F82C3C600608B94 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; -@@ -536,13 +527,6 @@ +@@ -536,13 +531,6 @@ remoteGlobalIDString = 8DC2EF4F0486A6940098B216; remoteInfo = Breakpad; }; @@ -46,10 +77,28 @@ index 584ec5d..9cea428 100644 /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ -@@ -1193,8 +1177,6 @@ +@@ -715,7 +703,6 @@ + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( +- F92C565C0ECD1158009BE4BA /* breakpadUtilities.dylib in Frameworks */, + 8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; +@@ -1183,18 +1170,13 @@ + isa = PBXNativeTarget; + buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "Breakpad" */; + buildPhases = ( +- F97A0E850ED4EC15008784D3 /* Change install name of breakpadUtilities */, + 8DC2EF500486A6940098B216 /* Headers */, +- 8DC2EF520486A6940098B216 /* Resources */, + 8DC2EF540486A6940098B216 /* Sources */, + 8DC2EF560486A6940098B216 /* Frameworks */, + ); + buildRules = ( ); dependencies = ( - F92C56860ECD15EF009BE4BA /* PBXTargetDependency */, +- F92C56860ECD15EF009BE4BA /* PBXTargetDependency */, - F92C56880ECD15F1009BE4BA /* PBXTargetDependency */, - F9C44E970EF09F4B003AEBAA /* PBXTargetDependency */, ); @@ -64,19 +113,73 @@ index 584ec5d..9cea428 100644 buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Breakpad" */; compatibilityVersion = "Xcode 3.1"; developmentRegion = English; -@@ -1589,8 +1573,6 @@ - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( +@@ -1585,16 +1569,6 @@ + /* End PBXReferenceProxy section */ + + /* Begin PBXResourcesBuildPhase section */ +- 8DC2EF520486A6940098B216 /* Resources */ = { +- isa = PBXResourcesBuildPhase; +- buildActionMask = 2147483647; +- files = ( - F9C44E980EF09F56003AEBAA /* crash_report_sender.app in Resources */, - F92C568A0ECD15F9009BE4BA /* Inspector in Resources */, - F92C56650ECD1185009BE4BA /* breakpadUtilities.dylib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; -@@ -1962,11 +1944,6 @@ - target = F92C563B0ECD10B3009BE4BA /* breakpadUtilities */; - targetProxy = F92C56850ECD15EF009BE4BA /* PBXContainerItemProxy */; +- F92C56650ECD1185009BE4BA /* breakpadUtilities.dylib in Resources */, +- ); +- runOnlyForDeploymentPostprocessing = 0; +- }; + F92C569C0ECE04A7009BE4BA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; +@@ -1642,20 +1616,6 @@ + shellPath = /bin/sh; + shellScript = "install_name_tool -id \"@executable_path/../Resources/breakpadUtilities.dylib\" \"${BUILT_PRODUCTS_DIR}/breakpadUtilities.dylib\"\n"; }; +- F97A0E850ED4EC15008784D3 /* Change install name of breakpadUtilities */ = { +- isa = PBXShellScriptBuildPhase; +- buildActionMask = 2147483647; +- files = ( +- ); +- inputPaths = ( +- ); +- name = "Change install name of breakpadUtilities"; +- outputPaths = ( +- ); +- runOnlyForDeploymentPostprocessing = 0; +- shellPath = /bin/sh; +- shellScript = "#!/bin/bash\ninstall_name_tool -id \"@executable_path/../Frameworks/Breakpad.framework/Resources/breakpadUtilities.dylib\" \"${BUILT_PRODUCTS_DIR}/breakpadUtilities.dylib\"\n"; +- }; + F9C77DD80F7DD5CF0045F7DB /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; +@@ -1676,6 +1636,19 @@ + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( ++ 0748C0501C63C52D004489BF /* bootstrap_compat.cc in Sources */, ++ 0748C04F1C63C523004489BF /* macho_walker.cc in Sources */, ++ 0748C04E1C63C51C004489BF /* md5.cc in Sources */, ++ 0748C04D1C63C50F004489BF /* file_id.cc in Sources */, ++ 0748C04C1C63C4EA004489BF /* macho_utilities.cc in Sources */, ++ 0748C04B1C63C4DB004489BF /* convert_UTF.c in Sources */, ++ 0748C04A1C63C4D4004489BF /* string_conversion.cc in Sources */, ++ 0748C0491C63C4CF004489BF /* macho_id.cc in Sources */, ++ 0748C0471C63C4A1004489BF /* dynamic_images.cc in Sources */, ++ 0748C0461C63C484004489BF /* minidump_file_writer.cc in Sources */, ++ 0748C0451C63C46C004489BF /* string_utilities.cc in Sources */, ++ 0748C0441C63C43C004489BF /* minidump_generator.cc in Sources */, ++ 0748C0431C63C409004489BF /* MachIPC.mm in Sources */, + F92C565F0ECD116B009BE4BA /* protected_memory_allocator.cc in Sources */, + F92C56630ECD1179009BE4BA /* exception_handler.cc in Sources */, + F92C55D10ECD0064009BE4BA /* Breakpad.mm in Sources */, +@@ -1957,16 +1930,6 @@ + target = F92C563B0ECD10B3009BE4BA /* breakpadUtilities */; + targetProxy = F92C564D0ECD10E5009BE4BA /* PBXContainerItemProxy */; + }; +- F92C56860ECD15EF009BE4BA /* PBXTargetDependency */ = { +- isa = PBXTargetDependency; +- target = F92C563B0ECD10B3009BE4BA /* breakpadUtilities */; +- targetProxy = F92C56850ECD15EF009BE4BA /* PBXContainerItemProxy */; +- }; - F92C56880ECD15F1009BE4BA /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = F92C53530ECCE349009BE4BA /* Inspector */; @@ -85,7 +188,7 @@ index 584ec5d..9cea428 100644 F93DE2FC0F82C3C600608B94 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = F93803BD0F80820F004D428B /* generator_test */; -@@ -2027,11 +2004,6 @@ +@@ -2027,11 +1990,6 @@ target = 8DC2EF4F0486A6940098B216 /* Breakpad */; targetProxy = F9C44E190EF0790F003AEBAA /* PBXContainerItemProxy */; }; @@ -97,7 +200,7 @@ index 584ec5d..9cea428 100644 /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ -@@ -2128,8 +2100,12 @@ +@@ -2128,8 +2086,12 @@ isa = XCBuildConfiguration; baseConfigurationReference = 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */; buildSettings = { @@ -111,7 +214,7 @@ index 584ec5d..9cea428 100644 }; name = Debug; }; -@@ -2137,7 +2113,12 @@ +@@ -2137,7 +2099,12 @@ isa = XCBuildConfiguration; baseConfigurationReference = 8B31027811F0D3AF00FCF3E4 /* BreakpadRelease.xcconfig */; buildSettings = { @@ -124,7 +227,7 @@ index 584ec5d..9cea428 100644 }; name = Release; }; -@@ -2456,7 +2437,12 @@ +@@ -2456,7 +2423,12 @@ isa = XCBuildConfiguration; baseConfigurationReference = 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */; buildSettings = { From f3a4b5460196ff3a6b1e24ce09596e0b1e07d10a Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 5 Feb 2016 01:16:25 +0300 Subject: [PATCH 2/2] fixed bugs in crash dump finding and in beta version --- Telegram/SourceFiles/facades.cpp | 1 + Telegram/SourceFiles/window.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index e43410051..4cb9c6202 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -191,6 +191,7 @@ namespace Global { QFile beta(cExeDir() + qsl("TelegramBeta_data/tdata/beta")); if (cBetaVersion()) { cForceWorkingDir(cExeDir() + qsl("TelegramBeta_data/")); + QDir().mkpath(cWorkingDir() + qstr("tdata")); if (*BetaPrivateKey) { cSetBetaPrivateKey(QByteArray(BetaPrivateKey)); } diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 6525b79dd..43c2b25a8 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -2028,7 +2028,7 @@ LastCrashedWindow::LastCrashedWindow() if (!possibleDump.startsWith('/')) { possibleDump = dumpspath + '/' + possibleDump; } - if (!possibleDump.endsWith('.dmp')) { + if (!possibleDump.endsWith(qstr(".dmp"))) { possibleDump += qsl(".dmp"); } QFileInfo possibleInfo(possibleDump);