Skip to content

Commit

Permalink
Update to 6.3.0 (2040)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrKLO committed Jul 26, 2020
1 parent feba57c commit 520592b
Show file tree
Hide file tree
Showing 768 changed files with 44,551 additions and 19,111 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM gradle:6.0.1-jdk8
FROM gradle:6.1.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.3
ENV ANDROID_API_LEVEL android-30
ENV ANDROID_BUILD_TOOLS_VERSION 30.0.1
ENV ANDROID_HOME /usr/local/android-sdk-linux
ENV ANDROID_NDK_VERSION 21.1.6352462
ENV ANDROID_VERSION 29
ENV ANDROID_VERSION 30
ENV ANDROID_NDK_HOME ${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}/
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools

Expand Down
23 changes: 12 additions & 11 deletions TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,32 @@ configurations.all {
}

dependencies {
implementation 'androidx.core:core:1.1.0-beta01'
implementation 'androidx.core:core:1.3.1'
implementation 'androidx.palette:palette:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.2.0'
implementation 'androidx.dynamicanimation:dynamicanimation:1.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'androidx.multidex:multidex:2.0.1'
implementation "androidx.sharetarget:sharetarget:1.0.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.2.0'
implementation 'com.google.firebase:firebase-config:19.1.4'
implementation 'com.google.firebase:firebase-messaging:20.2.3'
implementation 'com.google.firebase:firebase-config:19.2.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-auth:18.0.0'
implementation 'com.google.android.gms:play-services-auth:18.1.0'
implementation 'com.google.android.gms:play-services-vision:16.2.0'
implementation 'com.google.android.gms:play-services-wearable:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation "com.microsoft.appcenter:appcenter-distribute:3.2.1"
implementation "com.microsoft.appcenter:appcenter-crashes:3.2.1"
implementation "com.microsoft.appcenter:appcenter-distribute:3.2.2"
implementation "com.microsoft.appcenter:appcenter-crashes:3.2.2"
implementation 'com.googlecode.mp4parser:isoparser:1.0.6'
implementation 'com.stripe:stripe-android:2.0.2'
implementation files('libs/libgsaverification-client.aar')
}

android {
compileSdkVersion 29
buildToolsVersion '29.0.3'
compileSdkVersion 30
buildToolsVersion '30.0.1'
ndkVersion "21.1.6352462"

defaultConfig.applicationId = "org.telegram.messenger"
Expand Down Expand Up @@ -276,7 +277,7 @@ android {
}
}

defaultConfig.versionCode = 1988
defaultConfig.versionCode = 2040

def tgVoipDexFileName = "libtgvoip.dex"
def tgVoipDexClasses = ["AudioRecordJNI", "AudioTrackJNI", "NativeTgVoipDelegate", "NativeTgVoipInstance", "TgVoipNativeLoader", "Resampler", "VLog"]
Expand Down Expand Up @@ -371,7 +372,7 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
versionName "6.2.0"
versionName "6.3.0"

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

Expand Down
2 changes: 1 addition & 1 deletion TMessagesProj/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,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 -DPACKAGE_NAME='"drinkless/org/ton"'
LOCAL_CPPFLAGS := -DBSD=1 -ffast-math -Os -funroll-loops -std=c++14
LOCAL_LDLIBS := -ljnigraphics -llog -lz -lEGL -lGLESv2 -landroid
LOCAL_STATIC_LIBRARIES := webp sqlite lz4 rlottie tgnet swscale avformat avcodec avresample avutil flac

Expand Down
10 changes: 7 additions & 3 deletions TMessagesProj/jni/TgNetWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,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, jstring cFingerprint, jint timezoneOffset, 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, jstring installerId, jint timezoneOffset, 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 @@ -377,8 +377,9 @@ void init(JNIEnv *env, jclass c, jint instanceNum, jint version, jint layer, jin
const char *logPathStr = env->GetStringUTFChars(logPath, 0);
const char *regIdStr = env->GetStringUTFChars(regId, 0);
const char *cFingerprintStr = env->GetStringUTFChars(cFingerprint, 0);
const char *installerIdStr = env->GetStringUTFChars(installerId, 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), std::string(cFingerprintStr), timezoneOffset, 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), std::string(installerIdStr), timezoneOffset, userId, true, enablePushConnection, hasNetwork, networkType);

if (deviceModelStr != 0) {
env->ReleaseStringUTFChars(deviceModel, deviceModelStr);
Expand Down Expand Up @@ -407,6 +408,9 @@ void init(JNIEnv *env, jclass c, jint instanceNum, jint version, jint layer, jin
if (cFingerprintStr != 0) {
env->ReleaseStringUTFChars(cFingerprint, cFingerprintStr);
}
if (installerIdStr != 0) {
env->ReleaseStringUTFChars(installerId, installerIdStr);
}
}

void setJava(JNIEnv *env, jclass c, jboolean useJavaByteBuffers) {
Expand All @@ -431,7 +435,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;Ljava/lang/String;IIZZI)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;Ljava/lang/String;IIZZI)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
90 changes: 45 additions & 45 deletions TMessagesProj/jni/exoplayer/flac_jni.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,45 +40,45 @@
JNIEnv *env, jobject thiz, ##__VA_ARGS__)

class JavaDataSource : public DataSource {
public:
void setFlacDecoderJni(JNIEnv *env, jobject flacDecoderJni) {
this->env = env;
this->flacDecoderJni = flacDecoderJni;
if (mid == NULL) {
jclass cls = env->GetObjectClass(flacDecoderJni);
mid = env->GetMethodID(cls, "read", "(Ljava/nio/ByteBuffer;)I");
public:
void setFlacDecoderJni(JNIEnv *env, jobject flacDecoderJni) {
this->env = env;
this->flacDecoderJni = flacDecoderJni;
if (mid == NULL) {
jclass cls = env->GetObjectClass(flacDecoderJni);
mid = env->GetMethodID(cls, "read", "(Ljava/nio/ByteBuffer;)I");
}
}
}

ssize_t readAt(off64_t offset, void *const data, size_t size) {
jobject byteBuffer = env->NewDirectByteBuffer(data, size);
int result = env->CallIntMethod(flacDecoderJni, mid, byteBuffer);
if (env->ExceptionCheck()) {
// Exception is thrown in Java when returning from the native call.
result = -1;
ssize_t readAt(off64_t offset, void *const data, size_t size) {
jobject byteBuffer = env->NewDirectByteBuffer(data, size);
int result = env->CallIntMethod(flacDecoderJni, mid, byteBuffer);
if (env->ExceptionCheck()) {
// Exception is thrown in Java when returning from the native call.
result = -1;
}
return result;
}
return result;
}

private:
JNIEnv *env;
jobject flacDecoderJni;
jmethodID mid;
private:
JNIEnv *env;
jobject flacDecoderJni;
jmethodID mid;
};

struct Context {
JavaDataSource *source;
FLACParser *parser;
JavaDataSource *source;
FLACParser *parser;

Context() {
source = new JavaDataSource();
parser = new FLACParser(source);
}
Context() {
source = new JavaDataSource();
parser = new FLACParser(source);
}

~Context() {
delete parser;
delete source;
}
~Context() {
delete parser;
delete source;
}
};

DECODER_FUNC(jlong, flacInit) {
Expand All @@ -99,16 +99,16 @@ DECODER_FUNC(jobject, flacDecodeMetadata, jlong jContext) {

jclass arrayListClass = env->FindClass("java/util/ArrayList");
jmethodID arrayListConstructor =
env->GetMethodID(arrayListClass, "<init>", "()V");
env->GetMethodID(arrayListClass, "<init>", "()V");
jobject commentList = env->NewObject(arrayListClass, arrayListConstructor);
jmethodID arrayListAddMethod =
env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z");
env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z");

if (context->parser->areVorbisCommentsValid()) {
std::vector<std::string> vorbisComments =
context->parser->getVorbisComments();
context->parser->getVorbisComments();
for (std::vector<std::string>::const_iterator vorbisComment =
vorbisComments.begin();
vorbisComments.begin();
vorbisComment != vorbisComments.end(); ++vorbisComment) {
jstring commentString = env->NewStringUTF((*vorbisComment).c_str());
env->CallBooleanMethod(commentList, arrayListAddMethod, commentString);
Expand All @@ -121,10 +121,10 @@ DECODER_FUNC(jobject, flacDecodeMetadata, jlong jContext) {
if (picturesValid) {
std::vector<FlacPicture> pictures = context->parser->getPictures();
jclass pictureFrameClass = env->FindClass(
"com/google/android/exoplayer2/metadata/flac/PictureFrame");
"com/google/android/exoplayer2/metadata/flac/PictureFrame");
jmethodID pictureFrameConstructor =
env->GetMethodID(pictureFrameClass, "<init>",
"(ILjava/lang/String;Ljava/lang/String;IIII[B)V");
env->GetMethodID(pictureFrameClass, "<init>",
"(ILjava/lang/String;Ljava/lang/String;IIII[B)V");
for (std::vector<FlacPicture>::const_iterator picture = pictures.begin();
picture != pictures.end(); ++picture) {
jstring mimeType = env->NewStringUTF(picture->mimeType.c_str());
Expand All @@ -133,9 +133,9 @@ DECODER_FUNC(jobject, flacDecodeMetadata, jlong jContext) {
env->SetByteArrayRegion(pictureData, 0, picture->data.size(),
(signed char *)&picture->data[0]);
jobject pictureFrame = env->NewObject(
pictureFrameClass, pictureFrameConstructor, picture->type, mimeType,
description, picture->width, picture->height, picture->depth,
picture->colors, pictureData);
pictureFrameClass, pictureFrameConstructor, picture->type, mimeType,
description, picture->width, picture->height, picture->depth,
picture->colors, pictureData);
env->CallBooleanMethod(pictureFrames, arrayListAddMethod, pictureFrame);
env->DeleteLocalRef(mimeType);
env->DeleteLocalRef(description);
Expand All @@ -144,14 +144,14 @@ DECODER_FUNC(jobject, flacDecodeMetadata, jlong jContext) {
}

const FLAC__StreamMetadata_StreamInfo &streamInfo =
context->parser->getStreamInfo();
context->parser->getStreamInfo();

jclass flacStreamMetadataClass = env->FindClass(
"com/google/android/exoplayer2/util/"
"FlacStreamMetadata");
"com/google/android/exoplayer2/util/"
"FlacStreamMetadata");
jmethodID flacStreamMetadataConstructor =
env->GetMethodID(flacStreamMetadataClass, "<init>",
"(IIIIIIIJLjava/util/List;Ljava/util/List;)V");
env->GetMethodID(flacStreamMetadataClass, "<init>",
"(IIIIIIIJLjava/util/ArrayList;Ljava/util/ArrayList;)V");

return env->NewObject(flacStreamMetadataClass, flacStreamMetadataConstructor,
streamInfo.min_blocksize, streamInfo.max_blocksize,
Expand Down
Loading

0 comments on commit 520592b

Please sign in to comment.