Skip to content

Commit 6bb7547

Browse files
author
DrKLO
committed
Update to 3.2.2
1 parent 906746d commit 6bb7547

File tree

1,086 files changed

+282408
-47781
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,086 files changed

+282408
-47781
lines changed

TMessagesProj/build.gradle

+9-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@ dependencies {
99
compile 'com.google.android.gms:play-services:3.2.+'
1010
compile 'net.hockeyapp.android:HockeySDK:3.5.+'
1111
compile 'com.googlecode.mp4parser:isoparser:1.0.+'
12+
compile 'org.apache.httpcomponents:httpmime:4.2.1'
1213
}
1314

1415
android {
1516
compileSdkVersion 22
16-
buildToolsVersion '23.0.0'
17+
buildToolsVersion '23.0.1'
18+
19+
packagingOptions {
20+
exclude 'META-INF/NOTICE.txt'
21+
exclude 'META-INF/LICENSE.txt'
22+
}
1723

1824
compileOptions {
1925
sourceCompatibility JavaVersion.VERSION_1_7
@@ -73,7 +79,7 @@ android {
7379
defaultConfig {
7480
minSdkVersion 8
7581
targetSdkVersion 22
76-
versionCode 592
77-
versionName "3.1.3"
82+
versionCode 627
83+
versionName "3.2.2"
7884
}
7985
}

TMessagesProj/jni/Android.mk

+97-27
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,89 @@ LOCAL_PATH := $(call my-dir)
22

33
include $(CLEAR_VARS)
44

5-
LOCAL_CFLAGS := -Wall -DANDROID -DHAVE_MALLOC_H -DHAVE_PTHREAD -DWEBP_USE_THREAD -finline-functions -ffast-math -ffunction-sections -fdata-sections -O2
5+
LOCAL_MODULE := crypto
6+
7+
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
8+
LOCAL_SRC_FILES := ./boringssl/lib/libcrypto_armeabi-v7a.a
9+
else
10+
ifeq ($(TARGET_ARCH_ABI),armeabi)
11+
LOCAL_SRC_FILES := ./boringssl/lib/libcrypto_armeabi.a
12+
else
13+
ifeq ($(TARGET_ARCH_ABI),x86)
14+
LOCAL_SRC_FILES := ./boringssl/lib/libcrypto_x86.a
15+
endif
16+
endif
17+
endif
18+
19+
include $(PREBUILT_STATIC_LIBRARY)
20+
21+
include $(CLEAR_VARS)
22+
23+
LOCAL_CPP_EXTENSION := .cc
24+
LOCAL_ARM_MODE := arm
25+
LOCAL_MODULE := breakpad
26+
LOCAL_CPPFLAGS := -Wall -std=c++11 -DANDROID -finline-functions -ffast-math -Os -fno-strict-aliasing
27+
28+
LOCAL_C_INCLUDES := \
29+
./breakpad/common/android/include \
30+
./breakpad
31+
32+
LOCAL_SRC_FILES := \
33+
./breakpad/client/linux/crash_generation/crash_generation_client.cc \
34+
./breakpad/client/linux/dump_writer_common/ucontext_reader.cc \
35+
./breakpad/client/linux/dump_writer_common/thread_info.cc \
36+
./breakpad/client/linux/handler/exception_handler.cc \
37+
./breakpad/client/linux/handler/minidump_descriptor.cc \
38+
./breakpad/client/linux/log/log.cc \
39+
./breakpad/client/linux/microdump_writer/microdump_writer.cc \
40+
./breakpad/client/linux/minidump_writer/linux_dumper.cc \
41+
./breakpad/client/linux/minidump_writer/linux_ptrace_dumper.cc \
42+
./breakpad/client/linux/minidump_writer/minidump_writer.cc \
43+
./breakpad/client/minidump_file_writer.cc \
44+
./breakpad/common/android/breakpad_getcontext.S \
45+
./breakpad/common/convert_UTF.c \
46+
./breakpad/common/md5.cc \
47+
./breakpad/common/string_conversion.cc \
48+
./breakpad/common/linux/elfutils.cc \
49+
./breakpad/common/linux/file_id.cc \
50+
./breakpad/common/linux/guid_creator.cc \
51+
./breakpad/common/linux/linux_libc_support.cc \
52+
./breakpad/common/linux/memory_mapped_file.cc \
53+
./breakpad/common/linux/safe_readlink.cc
54+
55+
include $(BUILD_STATIC_LIBRARY)
56+
57+
include $(CLEAR_VARS)
58+
59+
LOCAL_CPPFLAGS := -Wall -std=c++11 -DANDROID -frtti -DHAVE_PTHREAD -finline-functions -ffast-math -Os
60+
LOCAL_C_INCLUDES += ./boringssl/include/
61+
LOCAL_ARM_MODE := arm
62+
LOCAL_MODULE := tgnet
63+
LOCAL_STATIC_LIBRARIES := crypto
64+
65+
LOCAL_SRC_FILES := \
66+
./tgnet/BuffersStorage.cpp \
67+
./tgnet/ByteArray.cpp \
68+
./tgnet/ByteStream.cpp \
69+
./tgnet/Connection.cpp \
70+
./tgnet/ConnectionSession.cpp \
71+
./tgnet/ConnectionsManager.cpp \
72+
./tgnet/ConnectionSocket.cpp \
73+
./tgnet/Datacenter.cpp \
74+
./tgnet/EventObject.cpp \
75+
./tgnet/FileLog.cpp \
76+
./tgnet/MTProtoScheme.cpp \
77+
./tgnet/NativeByteBuffer.cpp \
78+
./tgnet/Request.cpp \
79+
./tgnet/Timer.cpp \
80+
./tgnet/TLObject.cpp \
81+
./tgnet/Config.cpp
82+
83+
include $(BUILD_STATIC_LIBRARY)
84+
85+
include $(CLEAR_VARS)
86+
87+
LOCAL_CFLAGS := -Wall -DANDROID -DHAVE_MALLOC_H -DHAVE_PTHREAD -DWEBP_USE_THREAD -finline-functions -ffast-math -ffunction-sections -fdata-sections -Os
688
LOCAL_C_INCLUDES += ./libwebp/src
789
LOCAL_ARM_MODE := arm
890
LOCAL_STATIC_LIBRARIES := cpufeatures
@@ -93,7 +175,7 @@ else
93175
LOCAL_ARM_MODE := arm
94176
endif
95177
LOCAL_MODULE := sqlite
96-
LOCAL_CFLAGS := -w -std=gnu99 -O2 -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
178+
LOCAL_CFLAGS := -w -std=c11 -Os -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
97179
LOCAL_CFLAGS += -DANDROID_NDK -DDISABLE_IMPORTGL -fno-strict-aliasing -fprefetch-loop-arrays -DAVOID_TABLES -DANDROID_TILE_BASED_DECODE -DANDROID_ARMV6_IDCT -DHAVE_STRCHRNUL=0
98180

99181
LOCAL_SRC_FILES := \
@@ -103,13 +185,14 @@ include $(BUILD_STATIC_LIBRARY)
103185

104186
include $(CLEAR_VARS)
105187
LOCAL_PRELINK_MODULE := false
106-
LOCAL_STATIC_LIBRARIES := webp sqlite
107-
LOCAL_MODULE := tmessages.8
108-
LOCAL_CFLAGS := -w -std=gnu99 -O2 -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
188+
LOCAL_STATIC_LIBRARIES := webp sqlite tgnet breakpad
189+
190+
LOCAL_MODULE := tmessages.12
191+
LOCAL_CFLAGS := -w -std=c11 -Os -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
109192
LOCAL_CFLAGS += -Drestrict='' -D__EMX__ -DOPUS_BUILD -DFIXED_POINT -DUSE_ALLOCA -DHAVE_LRINT -DHAVE_LRINTF -fno-math-errno
110193
LOCAL_CFLAGS += -DANDROID_NDK -DDISABLE_IMPORTGL -fno-strict-aliasing -fprefetch-loop-arrays -DAVOID_TABLES -DANDROID_TILE_BASED_DECODE -DANDROID_ARMV6_IDCT -ffast-math
111-
LOCAL_CPPFLAGS := -DBSD=1 -ffast-math -O2 -funroll-loops
112-
LOCAL_LDLIBS := -ljnigraphics -llog
194+
LOCAL_CPPFLAGS := -DBSD=1 -ffast-math -Os -funroll-loops -std=c++11
195+
LOCAL_LDLIBS := -ljnigraphics -llog -lz
113196
ifeq ($(TARGET_ARCH_ABI),armeabi)
114197
LOCAL_ARM_MODE := thumb
115198
else
@@ -267,32 +350,17 @@ LOCAL_SRC_FILES += \
267350
./giflib/dgif_lib.c \
268351
./giflib/gifalloc.c
269352

270-
LOCAL_SRC_FILES += \
271-
./aes/aes_ige.c \
272-
./aes/aes_misc.c
273-
274-
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
275-
LOCAL_SRC_FILES += ./aes/aes_arm.S
276-
else
277-
ifeq ($(TARGET_ARCH_ABI),armeabi)
278-
LOCAL_SRC_FILES += ./aes/aes_arm.S
279-
else
280-
ifeq ($(TARGET_ARCH_ABI),x86)
281-
LOCAL_SRC_FILES += ./aes/aes_core.c
282-
else
283-
LOCAL_SRC_FILES += ./aes/aes_core.c
284-
endif
285-
endif
286-
endif
287-
288353
LOCAL_C_INCLUDES := \
289354
./opus/include \
290355
./opus/silk \
291356
./opus/silk/fixed \
292357
./opus/celt \
293358
./opus/ \
294359
./opus/opusfile \
295-
./libyuv/include
360+
./libyuv/include \
361+
./boringssl/include \
362+
./breakpad/common/android/include \
363+
./breakpad
296364

297365
LOCAL_SRC_FILES += \
298366
./libjpeg/jcapimin.c \
@@ -393,7 +461,9 @@ LOCAL_SRC_FILES += \
393461
./gif.c \
394462
./utils.c \
395463
./image.c \
396-
./video.c
464+
./video.c \
465+
./TgNetWrapper.cpp \
466+
./NativeLoader.cpp
397467

398468
include $(BUILD_SHARED_LIBRARY)
399469

TMessagesProj/jni/Application.mk

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
APP_PLATFORM := android-9
2-
APP_ABI := armeabi armeabi-v7a x86
2+
APP_ABI := armeabi armeabi-v7a x86
3+
NDK_TOOLCHAIN_VERSION := 4.8
4+
APP_STL := gnustl_static

TMessagesProj/jni/NativeLoader.cpp

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include <jni.h>
2+
#include <stdio.h>
3+
#include "breakpad/client/linux/handler/exception_handler.h"
4+
#include "breakpad/client/linux/handler/minidump_descriptor.h"
5+
6+
static google_breakpad::ExceptionHandler *exceptionHandler;
7+
8+
bool callback(const google_breakpad::MinidumpDescriptor &descriptor, void *context, bool succeeded) {
9+
printf("dump path: %s\n", descriptor.path());
10+
return succeeded;
11+
}
12+
13+
extern "C" {
14+
void Java_org_telegram_messenger_NativeLoader_init(JNIEnv* env, jobject obj, jstring filepath, bool enable) {
15+
if (enable) {
16+
const char *path = env->GetStringUTFChars(filepath, 0);
17+
google_breakpad::MinidumpDescriptor descriptor(path);
18+
exceptionHandler = new google_breakpad::ExceptionHandler(descriptor, NULL, callback, NULL, true, -1);
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)