Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuYi0526 committed Jan 28, 2025
2 parents b0a694d + dad6d90 commit 683874a
Show file tree
Hide file tree
Showing 437 changed files with 48,788 additions and 42,592 deletions.
99 changes: 47 additions & 52 deletions TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repositories {
}

def verName = APP_VERSION_NAME
def verCode = 1202
def verCode = 1204


def officialVer = APP_VERSION_NAME
Expand Down Expand Up @@ -277,32 +277,61 @@ def crashlyticsVersion = "18.6.2"
def playCoreVersion = "1.10.3"

dependencies {

implementation "androidx.browser:browser:1.5.0"
implementation 'androidx.fragment:fragment:1.2.0'
implementation "androidx.core:core-ktx:1.9.0"
implementation "androidx.core:core-ktx:1.10.1"
implementation "androidx.palette:palette-ktx:1.0.0"
implementation "androidx.viewpager:viewpager:1.0.0"
implementation "androidx.exifinterface:exifinterface:1.3.7"
implementation "androidx.interpolator:interpolator:1.0.0"
implementation 'androidx.biometric:biometric:1.1.0'
implementation "androidx.dynamicanimation:dynamicanimation:1.0.0"
implementation "androidx.multidex:multidex:2.0.1"
implementation "androidx.sharetarget:sharetarget:1.2.0"
implementation "androidx.interpolator:interpolator:1.0.0"
implementation 'androidx.biometric:biometric:1.1.0'

// just follow official
compileOnly 'org.checkerframework:checker-qual:2.5.2'
compileOnly 'org.checkerframework:checker-compat-qual:2.5.0'

// don"t change this :)
//noinspection GradleDependency
implementation "com.google.firebase:firebase-messaging:$fcmVersion"
implementation "com.google.firebase:firebase-crashlytics:$crashlyticsVersion"
implementation 'com.google.android.gms:play-services-vision:20.1.3'
implementation 'com.google.android.gms:play-services-maps:18.1.0'
implementation 'com.google.android.gms:play-services-auth:20.4.0'
implementation 'com.google.android.gms:play-services-vision:20.1.3'
implementation 'com.google.android.gms:play-services-wearable:18.0.0'
implementation 'com.google.android.gms:play-services-location:21.0.1'
implementation 'com.google.android.gms:play-services-wallet:19.1.0'
implementation "com.googlecode.mp4parser:isoparser:1.0.6"

implementation 'com.stripe:stripe-android:2.0.2'
// add for auto translate
implementation 'com.google.mlkit:language-id:17.0.6'
implementation 'com.android.billingclient:billing:6.0.1'
implementation "com.google.code.gson:gson:2.11.0"
implementation "org.osmdroid:osmdroid-android:6.1.10"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.23"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0"
implementation 'com.google.guava:guava:31.1-android'
implementation 'com.google.android.play:integrity:1.3.0'
implementation 'com.google.android.gms:play-services-safetynet:18.0.1'

implementation 'com.google.android.gms:play-services-mlkit-subject-segmentation:16.0.0-beta1'
implementation 'com.google.android.gms:play-services-mlkit-image-labeling:16.0.8'
// constraints {
// implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
// because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
// }
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
}
// }

testImplementation "junit:junit:4.13.2"
testImplementation "androidx.test:core:1.5.0"
testImplementation "org.robolectric:robolectric:4.5.1"

coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.2.0"
}
dependencies {
implementation "androidx.browser:browser:1.5.0"
implementation "androidx.viewpager:viewpager:1.0.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0"
// OSM
implementation "org.osmdroid:osmdroid-android:6.1.10"
// okhttp
implementation "com.squareup.okhttp3:okhttp:5.0.0-alpha.10"
implementation 'com.neovisionaries:nv-websocket-client:2.14'
implementation 'dnsjava:dnsjava:3.4.1'
Expand All @@ -312,50 +341,16 @@ dependencies {
implementation "cn.hutool:hutool-crypto:5.7.13"
implementation 'cn.hutool:hutool-http:5.7.5'
implementation "com.jakewharton:process-phoenix:2.1.2"
implementation 'com.google.guava:guava:31.1-android'

implementation 'com.google.android.play:integrity:1.3.0'

implementation 'com.google.android.gms:play-services-mlkit-subject-segmentation:16.0.0-beta1'
implementation 'com.google.android.gms:play-services-mlkit-image-labeling:16.0.8'

compileOnly 'org.yaml:snakeyaml:1.29'
implementation 'org.yaml:snakeyaml:1.29'

// openpgp
implementation project(":openpgp-api")

compileOnly fileTree("libs")

compileOnly "com.google.firebase:firebase-messaging:$fcmVersion"
compileOnly "com.google.firebase:firebase-crashlytics:$crashlyticsVersion"
compileOnly "com.google.android.play:core:$playCoreVersion"

implementation 'com.google.android.gms:play-services-vision:20.1.3'
implementation 'com.google.android.gms:play-services-maps:18.2.0'
implementation 'com.google.android.gms:play-services-location:21.2.0'
implementation 'com.google.android.gms:play-services-wallet:19.1.0'

implementation "com.google.firebase:firebase-messaging:$fcmVersion"
implementation "com.google.firebase:firebase-crashlytics:$crashlyticsVersion"
// implementation "com.google.android.play:core:$playCoreVersion"

implementation 'com.stripe:stripe-android:2.0.2'
implementation 'com.android.billingclient:billing:6.0.1'

testImplementation "junit:junit:4.13.2"
testImplementation "androidx.test:core:1.5.0"
testImplementation "org.robolectric:robolectric:4.5.1"

coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.2.0"

}
dependencies {
// add for undo and redo
implementation 'org.lsposed.hiddenapibypass:hiddenapibypass:4.3'
implementation 'org.lsposed.hiddenapibypass:hiddenapibypass:5.1'
// add splash screen
implementation("androidx.core:core-splashscreen:1.0.1")
// add for auto translate
implementation 'com.google.mlkit:language-id:17.0.5'
// add for emoji
implementation 'com.jaredrummler:truetypeparser-light:1.0.0'
// add for up
Expand Down Expand Up @@ -396,7 +391,7 @@ android {
task.enabled = false
} else if (task.name.endsWith("GoogleServices") && task.name.contains("NoGcm")) {
task.enabled = false
} else if (task.name.contains("buildCMakeDebug") && nagram_build_args.contains("skip_buildCMakeDebug")) {
} else if (task.name.contains("buildCMakeDebug") && nagram_build_args != null && nagram_build_args.contains("skip_buildCMakeDebug")) {
task.enabled = false
}
}
Expand Down
185 changes: 149 additions & 36 deletions TMessagesProj/jni/tgnet/ApiScheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,17 @@ TL_username *TL_username::TLdeserialize(NativeByteBuffer *stream, uint32_t const
return result;
}

TL_peerColor *TL_peerColor::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
if (TL_peerColor::constructor != constructor) {
error = true;
if (LOGS_ENABLED) DEBUG_FATAL("can't parse magic %x in TL_peerColor", constructor);
return nullptr;
}
TL_peerColor *result = new TL_peerColor();
result->readParams(stream, instanceNum, error);
return result;
}

void TL_restrictionReason::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
platform = stream->readString(&error);
reason = stream->readString(&error);
Expand Down Expand Up @@ -405,6 +416,132 @@ void TL_username::serializeToStream(NativeByteBuffer *stream) {
stream->writeString(username);
}

void TL_peerColor::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
flags = stream->readInt32(&error);
if ((flags & 1) != 0) {
color = stream->readInt32(&error);
}
if ((flags & 2) != 0) {
background_emoji_id = stream->readInt64(&error);
}
}

void TL_peerColor::serializeToStream(NativeByteBuffer *stream) {
stream->writeInt32(constructor);
stream->writeInt32(flags);
if ((flags & 1) != 0) {
stream->writeInt32(color);
}
if ((flags & 2) != 0) {
stream->writeInt64(background_emoji_id);
}
}

EmojiStatus *EmojiStatus::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
EmojiStatus *result = nullptr;
switch (constructor) {
case TL_emojiStatusEmpty::constructor:
result = new TL_emojiStatusEmpty();
break;
case TL_emojiStatus::constructor:
result = new TL_emojiStatus();
break;
case TL_emojiStatusCollectible::constructor:
result = new TL_emojiStatusCollectible();
break;
case TL_emojiStatus_layer197::constructor:
result = new TL_emojiStatus_layer197();
break;
case TL_emojiStatusUntil_layer197::constructor:
result = new TL_emojiStatusUntil_layer197();
break;
default:
error = true;
if (LOGS_ENABLED) DEBUG_FATAL("can't parse magic %x in User", constructor);
return nullptr;
}
result->readParams(stream, instanceNum, error);
return result;
}

void TL_emojiStatusEmpty::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {

}

void TL_emojiStatusEmpty::serializeToStream(NativeByteBuffer *stream) {
stream->writeInt32(constructor);
}

void TL_emojiStatus::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
flags = stream->readInt32(&error);
document_id = stream->readInt64(&error);
if ((flags & 1) != 0) {
until = stream->readInt64(&error);
}
}

void TL_emojiStatus::serializeToStream(NativeByteBuffer *stream) {
stream->writeInt32(constructor);
stream->writeInt32(flags);
stream->writeInt64(document_id);
if ((flags & 1) != 0) {
stream->writeInt32(until);
}
}

void TL_emojiStatus_layer197::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
document_id = stream->readInt64(&error);
}

void TL_emojiStatus_layer197::serializeToStream(NativeByteBuffer *stream) {
stream->writeInt32(constructor);
stream->writeInt64(document_id);
}

void TL_emojiStatusUntil_layer197::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
document_id = stream->readInt64(&error);
until = stream->readInt32(&error);
}

void TL_emojiStatusUntil_layer197::serializeToStream(NativeByteBuffer *stream) {
stream->writeInt32(constructor);
stream->writeInt64(document_id);
stream->writeInt32(until);
}

void TL_emojiStatusCollectible::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
flags = stream->readInt32(&error);
collectible_id = stream->readInt64(&error);
document_id = stream->readInt64(&error);
title = stream->readString(&error);
slug = stream->readString(&error);
pattern_document_id = stream->readInt64(&error);
center_color = stream->readInt32(&error);
edge_color = stream->readInt32(&error);
pattern_color = stream->readInt32(&error);
text_color = stream->readInt32(&error);
if ((flags & 1) != 0) {
until = stream->readInt64(&error);
}
}

void TL_emojiStatusCollectible::serializeToStream(NativeByteBuffer *stream) {
stream->writeInt32(constructor);
stream->writeInt32(flags);
stream->writeInt64(collectible_id);
stream->writeInt64(document_id);
stream->writeString(title);
stream->writeString(slug);
stream->writeInt64(pattern_document_id);
stream->writeInt32(center_color);
stream->writeInt32(edge_color);
stream->writeInt32(pattern_color);
stream->writeInt32(text_color);
if ((flags & 1) != 0) {
stream->writeInt32(until);
}
}

User *User::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
User *result = nullptr;
switch (constructor) {
Expand Down Expand Up @@ -483,21 +620,7 @@ void TL_user::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &er
lang_code = stream->readString(&error);
}
if ((flags & 1073741824) != 0) {
emojiStatusMagic = stream->readUint32(&error);
if (emojiStatusMagic == 0x2de11aae) {
// emojiStatusEmpty
} else if (emojiStatusMagic == 0x929b619d) {
// emojiStatus
emojiStatusDocumentId = stream->readInt64(&error);
} else if (emojiStatusMagic == 0xfa30a8c7) {
// emojiStatusUntil
emojiStatusDocumentId = stream->readInt64(&error);
emojiStatusUntil = stream->readInt32(&error);
} else {
error = true;
if (LOGS_ENABLED) DEBUG_FATAL("wrong EmojiStatus magic, got %x", emojiStatusMagic);
return;
}
emoji_status = std::unique_ptr<EmojiStatus>(EmojiStatus::TLdeserialize(stream, stream->readInt32(&error), instanceNum, error));
}
if ((flags2 & 1) != 0) {
uint32_t magic = stream->readUint32(&error);
Expand All @@ -519,18 +642,17 @@ void TL_user::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &er
stories_max_id = stream->readInt32(&error);
}
if ((flags2 & 256) != 0) {
int magic = stream->readInt32(&error);
color_color = stream->readInt32(&error);
color_background_emoji_id = stream->readInt64(&error);
color = std::unique_ptr<TL_peerColor>(TL_peerColor::TLdeserialize(stream, stream->readUint32(&error), instanceNum, error));
}
if ((flags2 & 512) != 0) {
int magic = stream->readInt32(&error);
profile_color_color = stream->readInt32(&error);
profile_color_background_emoji_id = stream->readInt64(&error);
profile_color = std::unique_ptr<TL_peerColor>(TL_peerColor::TLdeserialize(stream, stream->readUint32(&error), instanceNum, error));
}
if ((flags2 & 4096) != 0) {
bot_active_users = stream->readInt32(&error);
}
if ((flags2 & 16384) != 0) {
bot_verification_icon = stream->readInt64(&error);
}
}

void TL_user::serializeToStream(NativeByteBuffer *stream) {
Expand Down Expand Up @@ -577,15 +699,7 @@ void TL_user::serializeToStream(NativeByteBuffer *stream) {
stream->writeString(lang_code);
}
if ((flags & 1073741824) != 0) {
stream->writeInt32(emojiStatusMagic);
if (emojiStatusMagic == 0x929b619d) {
// emojiStatus
stream->writeInt64(emojiStatusDocumentId);
} else if (emojiStatusMagic == 0xfa30a8c7) {
// emojiStatusUntil
stream->writeInt64(emojiStatusDocumentId);
stream->writeInt32(emojiStatusUntil);
}
emoji_status->serializeToStream(stream);
}
if ((flags2 & 1) != 0) {
stream->writeInt32(0x1cb5c415);
Expand All @@ -599,18 +713,17 @@ void TL_user::serializeToStream(NativeByteBuffer *stream) {
stream->writeInt32(stories_max_id);
}
if ((flags2 & 256) != 0) {
stream->writeInt32(0xba278146);
stream->writeInt32(color_color);
stream->writeInt32(color_background_emoji_id);
color->serializeToStream(stream);
}
if ((flags2 & 512) != 0) {
stream->writeInt32(0xba278146);
stream->writeInt32(profile_color_color);
stream->writeInt32(profile_color_background_emoji_id);
profile_color->serializeToStream(stream);
}
if ((flags2 & 4096) != 0) {
stream->writeInt32(bot_active_users);
}
if ((flags2 & 16384) != 0) {
stream->writeInt64(bot_verification_icon);
}
}

InputPeer *InputPeer::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
Expand Down
Loading

0 comments on commit 683874a

Please sign in to comment.