Skip to content

Commit

Permalink
Update to 7.7.0 (2284)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrKLO committed Apr 14, 2021
1 parent 7ba9838 commit 8bf056e
Show file tree
Hide file tree
Showing 209 changed files with 7,674 additions and 2,278 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ RUN $ANDROID_HOME/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSIO
ENV PATH ${ANDROID_NDK_HOME}:$PATH
ENV PATH ${ANDROID_NDK_HOME}/prebuilt/linux-x86_64/bin/:$PATH

CMD mkdir -p /home/source/TMessagesProj/build/outputs/apk && mkdir -p /home/source/TMessagesProj/build/outputs/native-debug-symbols && cp -R /home/source/. /home/gradle && cd /home/gradle && gradle assembleRelease && cp -R /home/gradle/TMessagesProj/build/outputs/apk/. /home/source/TMessagesProj/build/outputs/apk && cp -R /home/gradle/TMessagesProj/build/outputs/native-debug-symbols/. /home/source/TMessagesProj/build/outputs/native-debug-symbols
CMD mkdir -p /home/source/TMessagesProj/build/outputs/apk && mkdir -p /home/source/TMessagesProj/build/outputs/native-debug-symbols && cp -R /home/source/. /home/gradle && cd /home/gradle && gradle assembleRelease && gradle assembleStandalone && cp -R /home/gradle/TMessagesProj/build/outputs/apk/. /home/source/TMessagesProj/build/outputs/apk && cp -R /home/gradle/TMessagesProj/build/outputs/native-debug-symbols/. /home/source/TMessagesProj/build/outputs/native-debug-symbols
28 changes: 20 additions & 8 deletions TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,17 @@ android {
ndk.debugSymbolLevel = 'FULL'
}

standalone {
debuggable false
jniDebuggable false
signingConfig signingConfigs.release
applicationIdSuffix ".web"
minifyEnabled true
multiDexEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ndk.debugSymbolLevel = 'FULL'
}

release {
debuggable false
jniDebuggable false
Expand All @@ -167,6 +178,10 @@ android {
manifest.srcFile 'config/debug/AndroidManifest.xml'
}

sourceSets.standalone {
manifest.srcFile 'config/release/AndroidManifest.xml'
}

sourceSets.release {
manifest.srcFile 'config/release/AndroidManifest.xml'
}
Expand Down Expand Up @@ -243,9 +258,6 @@ 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 @@ -276,19 +288,19 @@ 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'
}
sourceSets.standalone {
manifest.srcFile 'config/release/AndroidManifest_standalone.xml'
}
ext {
abiVersionCode = 9
}
}
}

defaultConfig.versionCode = 2274
defaultConfig.versionCode = 2284

applicationVariants.all { variant ->
variant.outputs.all { output ->
Expand All @@ -307,7 +319,7 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 29
versionName "7.6.1"
versionName "7.7.0"

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

Expand Down
67 changes: 67 additions & 0 deletions TMessagesProj/config/release/AndroidManifest_standalone.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.telegram.messenger"
android:installLocation="auto">

<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-feature android:name="android.hardware.location.network" android:required="false" />
<uses-feature android:name="android.hardware.location" android:required="false" />
<uses-feature android:name="android.hardware.LOCATION" android:required="false" />

<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="org.telegram.messenger.permission.MAPS_RECEIVE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.READ_CALL_LOG" />

<permission android:name="org.telegram.messenger.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>

<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher_sa"
android:roundIcon="@mipmap/ic_launcher_sa"
android:label="@string/AppName"
android:theme="@style/Theme.TMessages.Start"
android:name=".ApplicationLoader"
android:hardwareAccelerated="@bool/useHardwareAcceleration"
android:largeHeap="true"
android:supportsRtl="false"
android:requestLegacyExternalStorage="true"
tools:replace="android:supportsRtl">

<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyA-t0jLPjUt2FxrA8VPK2EiYHcYcboIR6k" />

<service
android:name=".GcmPushListenerService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>

<uses-library android:name="com.google.android.maps" android:required="false"/>

<meta-data android:name="firebase_analytics_collection_deactivated" android:value="true" />
<meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />

<receiver
tools:replace="android:enabled"
android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
android:enabled="false">
<intent-filter>
<action android:name="com.google.android.gms.measurement.UPLOAD" />
</intent-filter>
</receiver>

<service
tools:replace="android:enabled"
android:name="com.google.android.gms.measurement.AppMeasurementService"
android:enabled="false"
android:exported="false" />

</application>

</manifest>
39 changes: 34 additions & 5 deletions TMessagesProj/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,35 @@
"storage_bucket": "tmessages2.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:760348033671:android:f6afd7b67eae3860",
"android_client_info": {
"package_name": "org.telegram.messenger"
}
},
"oauth_client": [
{
"client_id": "760348033671-2hh8ebmuflsnjoc0kldkfells9rhtfni.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyA-t0jLPjUt2FxrA8VPK2EiYHcYcboIR6k"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "760348033671-2hh8ebmuflsnjoc0kldkfells9rhtfni.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:760348033671:android:dc022572c167a16c",
Expand All @@ -28,7 +57,7 @@
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "760348033671-jiv412evc1r36rl4k7vhl1ba83atdmot.apps.googleusercontent.com",
"client_id": "760348033671-2hh8ebmuflsnjoc0kldkfells9rhtfni.apps.googleusercontent.com",
"client_type": 3
}
]
Expand All @@ -37,9 +66,9 @@
},
{
"client_info": {
"mobilesdk_app_id": "1:760348033671:android:f6afd7b67eae3860",
"mobilesdk_app_id": "1:760348033671:android:7396e651423888c3f66e22",
"android_client_info": {
"package_name": "org.telegram.messenger"
"package_name": "org.telegram.messenger.web"
}
},
"oauth_client": [
Expand All @@ -57,7 +86,7 @@
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "760348033671-jiv412evc1r36rl4k7vhl1ba83atdmot.apps.googleusercontent.com",
"client_id": "760348033671-2hh8ebmuflsnjoc0kldkfells9rhtfni.apps.googleusercontent.com",
"client_type": 3
}
]
Expand All @@ -66,4 +95,4 @@
}
],
"configuration_version": "1"
}
}
2 changes: 1 addition & 1 deletion TMessagesProj/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ target_compile_definitions(sqlite PUBLIC
#voip
include(${CMAKE_HOME_DIRECTORY}/voip/CMakeLists.txt)

set(NATIVE_LIB "tmessages.37")
set(NATIVE_LIB "tmessages.38")

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

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

void setJava(JNIEnv *env, jclass c, jboolean useJavaByteBuffers) {
Expand All @@ -440,7 +444,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;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;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
8 changes: 7 additions & 1 deletion TMessagesProj/jni/tgnet/ApiScheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ UserProfilePhoto *UserProfilePhoto::TLdeserialize(NativeByteBuffer *stream, uint
case 0x4f11bae1:
result = new TL_userProfilePhotoEmpty();
break;
case 0x69d3ab26:
case 0xcc656077:
result = new TL_userProfilePhoto();
break;
default:
Expand All @@ -1194,6 +1194,9 @@ void TL_userProfilePhoto::readParams(NativeByteBuffer *stream, int32_t instanceN
photo_id = stream->readInt64(&error);
photo_small = std::unique_ptr<FileLocation>(FileLocation::TLdeserialize(stream, stream->readUint32(&error), instanceNum, error));
photo_big = std::unique_ptr<FileLocation>(FileLocation::TLdeserialize(stream, stream->readUint32(&error), instanceNum, error));
if ((flags & 2) != 0) {
stripped_thumb = std::unique_ptr<ByteArray>(stream->readByteArray(&error));
}
dc_id = stream->readInt32(&error);
}

Expand All @@ -1204,6 +1207,9 @@ void TL_userProfilePhoto::serializeToStream(NativeByteBuffer *stream) {
stream->writeInt64(photo_id);
photo_small->serializeToStream(stream);
photo_big->serializeToStream(stream);
if ((flags & 2) != 0) {
stream->writeByteArray(stripped_thumb.get());
}
stream->writeInt32(dc_id);
}

Expand Down
3 changes: 2 additions & 1 deletion TMessagesProj/jni/tgnet/ApiScheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ class UserProfilePhoto : public TLObject {
int64_t photo_id;
std::unique_ptr<FileLocation> photo_small;
std::unique_ptr<FileLocation> photo_big;
std::unique_ptr<ByteArray> stripped_thumb;
int32_t dc_id;

static UserProfilePhoto *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error);
Expand All @@ -273,7 +274,7 @@ class TL_userProfilePhotoEmpty : public UserProfilePhoto {
class TL_userProfilePhoto : public UserProfilePhoto {

public:
static const uint32_t constructor = 0x69d3ab26;
static const uint32_t constructor = 0xcc656077;

void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
void serializeToStream(NativeByteBuffer *stream);
Expand Down
Loading

0 comments on commit 8bf056e

Please sign in to comment.