Skip to content

Commit

Permalink
Update to 5.13.0 (1818)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrKLO committed Dec 31, 2019
1 parent 28eb8df commit f41b228
Show file tree
Hide file tree
Showing 2,581 changed files with 1,025,095 additions and 64,047 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,3 @@ build/
obj/
*.iml
local.properties
*.keystore
gradle.properties

TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM gradle:6.0.1-jdk8

ENV ANDROID_SDK_URL https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
ENV ANDROID_API_LEVEL android-29
ENV ANDROID_BUILD_TOOLS_VERSION 29.0.2
ENV ANDROID_HOME /usr/local/android-sdk-linux
ENV ANDROID_NDK_VERSION 20.0.5594570
ENV ANDROID_VERSION 29
ENV ANDROID_NDK_HOME ${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}/
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools

RUN mkdir "$ANDROID_HOME" .android && \
cd "$ANDROID_HOME" && \
curl -o sdk.zip $ANDROID_SDK_URL && \
unzip sdk.zip && \
rm sdk.zip

RUN yes | ${ANDROID_HOME}/tools/bin/sdkmanager --licenses
RUN $ANDROID_HOME/tools/bin/sdkmanager --update
RUN $ANDROID_HOME/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" \
"platforms;android-${ANDROID_VERSION}" \
"platform-tools" \
"ndk;$ANDROID_NDK_VERSION"
ENV PATH ${ANDROID_NDK_HOME}:$PATH
ENV PATH ${ANDROID_NDK_HOME}/prebuilt/linux-x86_64/bin/:$PATH
59 changes: 50 additions & 9 deletions TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ configurations.all {
dependencies {
implementation 'androidx.core:core:1.1.0-beta01'
implementation 'androidx.palette:palette:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.1.0-beta01'
implementation 'androidx.exifinterface:exifinterface:1.1.0'

compileOnly 'org.checkerframework:checker-qual:2.5.2'
compileOnly 'org.checkerframework:checker-compat-qual:2.5.0'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
implementation 'com.google.firebase:firebase-config:19.0.0'
implementation 'com.google.firebase:firebase-messaging:20.1.0'
implementation 'com.google.firebase:firebase-config:19.1.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.android.gms:play-services-vision:16.2.0'
Expand All @@ -32,11 +32,13 @@ dependencies {
implementation 'net.hockeyapp.android:HockeySDK:5.2.0'
implementation 'com.googlecode.mp4parser:isoparser:1.0.6'
implementation 'com.stripe:stripe-android:2.0.2'
implementation files('libs/libgsaverification-client.aar')
}

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
compileSdkVersion 29
buildToolsVersion '29.0.2'
ndkVersion "20.0.5594570"

defaultConfig.applicationId = "org.telegram.messenger"

Expand Down Expand Up @@ -89,6 +91,34 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}

/*debugAsan {
debuggable true
jniDebuggable true
signingConfig signingConfigs.debug
applicationIdSuffix ".beta"
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
packagingOptions {
doNotStrip "**.so"
}
sourceSets {
main {
jniLibs {
srcDir {
'jniLibs'
}
}
resources {
srcDir {
'jniRes'
}
}
}
}
}*/

debugMultidex {
initWith debug
minifyEnabled false
Expand Down Expand Up @@ -122,6 +152,10 @@ android {
manifest.srcFile 'config/debug/AndroidManifest.xml'
}

/*sourceSets.debugAsan {
manifest.srcFile 'config/debug/AndroidManifest.xml'
}*/

sourceSets.debugMultidex {
manifest.srcFile 'config/debug/AndroidManifest.xml'
java.srcDirs = ['src/multidex/java']
Expand Down Expand Up @@ -207,6 +241,9 @@ android {
sourceSets.debug {
manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml'
}
/*sourceSets.debugAsan {
manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml'
}*/
sourceSets.release {
manifest.srcFile 'config/release/AndroidManifest_SDK23.xml'
}
Expand Down Expand Up @@ -234,6 +271,9 @@ android {
sourceSets.debug {
manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml'
}
/*sourceSets.debugAsan {
manifest.srcFile 'config/debug/AndroidManifest_SDK23.xml'
}*/
sourceSets.release {
manifest.srcFile 'config/release/AndroidManifest_SDK23.xml'
}
Expand All @@ -243,10 +283,11 @@ android {
}
}

defaultConfig.versionCode = 1710
defaultConfig.versionCode = 1818

applicationVariants.all { variant ->
variant.outputs.all { output ->
outputFileName = "app.apk"
output.getProcessManifestProvider().get().doLast {
def abiVersion = variant.productFlavors.get(0).abiVersionCode

Expand Down Expand Up @@ -276,14 +317,14 @@ android {

defaultConfig {
minSdkVersion 16
targetSdkVersion 27
versionName "5.11.0"
targetSdkVersion 28
versionName "5.13.0"

vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']

externalNativeBuild {
ndkBuild {
arguments "NDK_APPLICATION_MK:=jni/Application.mk", "APP_PLATFORM:=android-16", "-j8"
arguments "NDK_APPLICATION_MK:=jni/Application.mk", "APP_PLATFORM:=android-16", "--jobs=8"
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
}
Expand Down
Binary file added TMessagesProj/config/release.keystore
Binary file not shown.
89 changes: 89 additions & 0 deletions TMessagesProj/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"project_info": {
"project_number": "760348033671",
"firebase_url": "https://tmessages2.firebaseio.com",
"project_id": "tmessages2",
"storage_bucket": "tmessages2.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:760348033671:android:dc022572c167a16c",
"android_client_info": {
"package_name": "org.telegram.messenger.beta"
}
},
"oauth_client": [
{
"client_id": "760348033671-jiv412evc1r36rl4k7vhl1ba83atdmot.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "760348033671-7cj8o8gntcp2o052du67k1t0pi9frbso.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "760348033671-2hh8ebmuflsnjoc0kldkfells9rhtfni.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAijSIM_t8bfdRrn2-mCumXRu37pPslqkU"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:760348033671:android:f6afd7b67eae3860",
"android_client_info": {
"package_name": "org.telegram.messenger"
}
},
"oauth_client": [
{
"client_id": "760348033671-jiv412evc1r36rl4k7vhl1ba83atdmot.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "760348033671-7cj8o8gntcp2o052du67k1t0pi9frbso.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "760348033671-2hh8ebmuflsnjoc0kldkfells9rhtfni.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAijSIM_t8bfdRrn2-mCumXRu37pPslqkU"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}
5 changes: 2 additions & 3 deletions TMessagesProj/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ LOCAL_CPPFLAGS := -frtti
LOCAL_CFLAGS += -DVERSION="1.3.1" -DFLAC__NO_MD5 -DFLAC__INTEGER_ONLY_LIBRARY -DFLAC__NO_ASM
LOCAL_CFLAGS += -D_REENTRANT -DPIC -DU_COMMON_IMPLEMENTATION -fPIC -DHAVE_SYS_PARAM_H
LOCAL_CFLAGS += -O3 -funroll-loops -finline-functions
LOCAL_LDLIBS := -lz -lm
LOCAL_C_INCLUDES := ./jni/exoplayer/libFLAC/include
LOCAL_ARM_MODE := arm
LOCAL_CPP_EXTENSION := .cc
Expand Down Expand Up @@ -252,7 +251,6 @@ LOCAL_SRC_FILES := \
./exoplayer/libFLAC/stream_encoder_intrin_avx2.c \
./exoplayer/libFLAC/stream_encoder_intrin_sse2.c \
./exoplayer/libFLAC/stream_encoder_intrin_ssse3.c \
./exoplayer/libFLAC/windows_unicode_filenames \
./exoplayer/libFLAC/window.c

include $(BUILD_STATIC_LIBRARY)
Expand Down Expand Up @@ -351,7 +349,7 @@ LOCAL_MODULE := tmessages.30
LOCAL_CFLAGS := -w -std=c11 -Os -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED -D_LARGEFILE_SOURCE=1
LOCAL_CFLAGS += -Drestrict='' -D__EMX__ -DOPUS_BUILD -DFIXED_POINT -DUSE_ALLOCA -DHAVE_LRINT -DHAVE_LRINTF -fno-math-errno
LOCAL_CFLAGS += -DANDROID_NDK -DDISABLE_IMPORTGL -fno-strict-aliasing -fprefetch-loop-arrays -DAVOID_TABLES -DANDROID_TILE_BASED_DECODE -DANDROID_ARMV6_IDCT -ffast-math -D__STDC_CONSTANT_MACROS
LOCAL_CPPFLAGS := -DBSD=1 -ffast-math -Os -funroll-loops -std=c++14
LOCAL_CPPFLAGS := -DBSD=1 -ffast-math -Os -funroll-loops -std=c++14 -DPACKAGE_NAME='"drinkless/org/ton"'
LOCAL_LDLIBS := -ljnigraphics -llog -lz -lEGL -lGLESv2 -landroid
LOCAL_STATIC_LIBRARIES := webp sqlite lz4 rlottie tgnet swscale avformat avcodec avresample avutil voip flac

Expand Down Expand Up @@ -562,6 +560,7 @@ LOCAL_C_INCLUDES := \
./jni/exoplayer/libFLAC/include \
./jni/intro \
./jni/rlottie/inc \
./jni/ton \
./jni/lz4

LOCAL_SRC_FILES += \
Expand Down
2 changes: 1 addition & 1 deletion TMessagesProj/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
APP_PLATFORM := android-14
APP_PLATFORM := android-16
NDK_TOOLCHAIN_VERSION := clang
APP_STL := c++_static
10 changes: 7 additions & 3 deletions TMessagesProj/jni/TgNetWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ void setSystemLangCode(JNIEnv *env, jclass c, jint instanceNum, jstring langCode
}
}

void init(JNIEnv *env, jclass c, jint instanceNum, jint version, jint layer, jint apiId, jstring deviceModel, jstring systemVersion, jstring appVersion, jstring langCode, jstring systemLangCode, jstring configPath, jstring logPath, jstring regId, jint userId, jboolean enablePushConnection, jboolean hasNetwork, jint networkType) {
void init(JNIEnv *env, jclass c, jint instanceNum, jint version, jint layer, jint apiId, jstring deviceModel, jstring systemVersion, jstring appVersion, jstring langCode, jstring systemLangCode, jstring configPath, jstring logPath, jstring regId, jstring cFingerprint, jint userId, jboolean enablePushConnection, jboolean hasNetwork, jint networkType) {
const char *deviceModelStr = env->GetStringUTFChars(deviceModel, 0);
const char *systemVersionStr = env->GetStringUTFChars(systemVersion, 0);
const char *appVersionStr = env->GetStringUTFChars(appVersion, 0);
Expand All @@ -373,8 +373,9 @@ void init(JNIEnv *env, jclass c, jint instanceNum, jint version, jint layer, jin
const char *configPathStr = env->GetStringUTFChars(configPath, 0);
const char *logPathStr = env->GetStringUTFChars(logPath, 0);
const char *regIdStr = env->GetStringUTFChars(regId, 0);
const char *cFingerprintStr = env->GetStringUTFChars(cFingerprint, 0);

ConnectionsManager::getInstance(instanceNum).init((uint32_t) version, layer, apiId, std::string(deviceModelStr), std::string(systemVersionStr), std::string(appVersionStr), std::string(langCodeStr), std::string(systemLangCodeStr), std::string(configPathStr), std::string(logPathStr), std::string(regIdStr), userId, true, enablePushConnection, hasNetwork, networkType);
ConnectionsManager::getInstance(instanceNum).init((uint32_t) version, layer, apiId, std::string(deviceModelStr), std::string(systemVersionStr), std::string(appVersionStr), std::string(langCodeStr), std::string(systemLangCodeStr), std::string(configPathStr), std::string(logPathStr), std::string(regIdStr), std::string(cFingerprintStr), userId, true, enablePushConnection, hasNetwork, networkType);

if (deviceModelStr != 0) {
env->ReleaseStringUTFChars(deviceModel, deviceModelStr);
Expand All @@ -400,6 +401,9 @@ void init(JNIEnv *env, jclass c, jint instanceNum, jint version, jint layer, jin
if (regIdStr != 0) {
env->ReleaseStringUTFChars(regId, regIdStr);
}
if (cFingerprintStr != 0) {
env->ReleaseStringUTFChars(cFingerprint, cFingerprintStr);
}
}

void setJava(JNIEnv *env, jclass c, jboolean useJavaByteBuffers) {
Expand All @@ -424,7 +428,7 @@ static JNINativeMethod ConnectionsManagerMethods[] = {
{"native_setProxySettings", "(ILjava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", (void *) setProxySettings},
{"native_getConnectionState", "(I)I", (void *) getConnectionState},
{"native_setUserId", "(II)V", (void *) setUserId},
{"native_init", "(IIIILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZZI)V", (void *) init},
{"native_init", "(IIIILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZZI)V", (void *) init},
{"native_setLangCode", "(ILjava/lang/String;)V", (void *) setLangCode},
{"native_setRegId", "(ILjava/lang/String;)V", (void *) setRegId},
{"native_setSystemLangCode", "(ILjava/lang/String;)V", (void *) setSystemLangCode},
Expand Down
Loading

0 comments on commit f41b228

Please sign in to comment.