Skip to content

Commit 28e25a4

Browse files
committed
update to 12.3.0 (6377)
1 parent fff7c8d commit 28e25a4

File tree

152 files changed

+5099
-1270
lines changed

Some content is hidden

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

152 files changed

+5099
-1270
lines changed

‎TMessagesProj/build.gradle‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ dependencies {
5353
implementation 'com.google.android.gms:play-services-mlkit-subject-segmentation:16.0.0-beta1'
5454
implementation 'com.google.android.gms:play-services-mlkit-image-labeling:16.0.8'
5555

56-
implementation 'co.nstant.in:cbor:0.8'
5756
implementation "androidx.credentials:credentials:1.6.0-alpha04"
5857
implementation "androidx.credentials:credentials-play-services-auth:1.6.0-alpha04"
5958

@@ -67,7 +66,7 @@ dependencies {
6766
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
6867
}
6968
}
70-
implementation 'com.google.android.recaptcha:recaptcha:18.4.0'
69+
implementation 'com.google.android.recaptcha:recaptcha:18.7.1'
7170

7271
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
7372
}

‎TMessagesProj/jni/tgnet/ApiScheme.cpp‎

Lines changed: 100 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -388,13 +388,20 @@ TL_username *TL_username::TLdeserialize(NativeByteBuffer *stream, uint32_t const
388388
return result;
389389
}
390390

391-
TL_peerColor *TL_peerColor::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
392-
if (TL_peerColor::constructor != constructor) {
393-
error = true;
394-
if (LOGS_ENABLED) DEBUG_FATAL("can't parse magic %x in TL_peerColor", constructor);
395-
return nullptr;
391+
PeerColor *PeerColor::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
392+
PeerColor *result = nullptr;
393+
switch (constructor) {
394+
case TL_peerColor::constructor:
395+
result = new TL_peerColor();
396+
break;
397+
case TL_peerColorCollectible::constructor:
398+
result = new TL_peerColorCollectible();
399+
break;
400+
default:
401+
error = true;
402+
if (LOGS_ENABLED) DEBUG_FATAL("can't parse magic %x in PeerColor", constructor);
403+
return nullptr;
396404
}
397-
TL_peerColor *result = new TL_peerColor();
398405
result->readParams(stream, instanceNum, error);
399406
return result;
400407
}
@@ -465,6 +472,67 @@ void TL_peerColor::serializeToStream(NativeByteBuffer *stream) {
465472
}
466473
}
467474

475+
void TL_peerColorCollectible::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
476+
flags = stream->readInt32(&error);
477+
collectible_id = stream->readInt64(&error);
478+
gift_emoji_id = stream->readInt64(&error);
479+
background_emoji_id = stream->readInt64(&error);
480+
accent_color = stream->readInt32(&error);
481+
{
482+
uint32_t magic = stream->readUint32(&error);
483+
if (magic != 0x1cb5c415) {
484+
error = true;
485+
if (LOGS_ENABLED) DEBUG_FATAL("wrong Vector magic in TL_peerColorCollectible, got %x", magic);
486+
return;
487+
}
488+
int32_t count = stream->readInt32(&error);
489+
colors.clear();
490+
for (int32_t a = 0; a < count; a++) {
491+
colors.push_back(stream->readInt32(&error));
492+
}
493+
}
494+
if ((flags & 1) != 0) {
495+
dark_accent_color = stream->readInt32(&error);
496+
}
497+
if ((flags & 2) != 0) {
498+
uint32_t magic = stream->readUint32(&error);
499+
if (magic != 0x1cb5c415) {
500+
error = true;
501+
if (LOGS_ENABLED) DEBUG_FATAL("wrong Vector magic in TL_peerColorCollectible, got %x", magic);
502+
return;
503+
}
504+
int32_t count = stream->readInt32(&error);
505+
dark_colors.clear();
506+
for (int32_t a = 0; a < count; a++) {
507+
dark_colors.push_back(stream->readInt32(&error));
508+
}
509+
}
510+
}
511+
512+
void TL_peerColorCollectible::serializeToStream(NativeByteBuffer *stream) {
513+
stream->writeInt32(constructor);
514+
stream->writeInt32(flags);
515+
stream->writeInt64(collectible_id);
516+
stream->writeInt64(gift_emoji_id);
517+
stream->writeInt64(background_emoji_id);
518+
stream->writeInt32(accent_color);
519+
stream->writeInt32(0x1cb5c415);
520+
stream->writeInt32(colors.size());
521+
for (int32_t x : colors) {
522+
stream->writeInt32(x);
523+
}
524+
if ((flags & 1) != 0) {
525+
stream->writeInt32(dark_accent_color);
526+
}
527+
if ((flags & 2) != 0) {
528+
stream->writeInt32(0x1cb5c415);
529+
stream->writeInt32(dark_colors.size());
530+
for (int32_t x: dark_colors) {
531+
stream->writeInt32(x);
532+
}
533+
}
534+
}
535+
468536
EmojiStatus *EmojiStatus::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
469537
EmojiStatus *result = nullptr;
470538
switch (constructor) {
@@ -477,6 +545,9 @@ EmojiStatus *EmojiStatus::TLdeserialize(NativeByteBuffer *stream, uint32_t const
477545
case TL_emojiStatusCollectible::constructor:
478546
result = new TL_emojiStatusCollectible();
479547
break;
548+
case TL_inputEmojiStatusCollectible::constructor:
549+
result = new TL_inputEmojiStatusCollectible();
550+
break;
480551
case TL_emojiStatus_layer197::constructor:
481552
result = new TL_emojiStatus_layer197();
482553
break;
@@ -485,7 +556,7 @@ EmojiStatus *EmojiStatus::TLdeserialize(NativeByteBuffer *stream, uint32_t const
485556
break;
486557
default:
487558
error = true;
488-
if (LOGS_ENABLED) DEBUG_FATAL("can't parse magic %x in User", constructor);
559+
if (LOGS_ENABLED) DEBUG_FATAL("can't parse magic %x in EmojiStatus", constructor);
489560
return nullptr;
490561
}
491562
result->readParams(stream, instanceNum, error);
@@ -570,6 +641,24 @@ void TL_emojiStatusCollectible::serializeToStream(NativeByteBuffer *stream) {
570641
}
571642
}
572643

644+
645+
void TL_inputEmojiStatusCollectible::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
646+
flags = stream->readInt32(&error);
647+
collectible_id = stream->readInt64(&error);
648+
if ((flags & 1) != 0) {
649+
until = stream->readInt32(&error);
650+
}
651+
}
652+
653+
void TL_inputEmojiStatusCollectible::serializeToStream(NativeByteBuffer *stream) {
654+
stream->writeInt32(constructor);
655+
stream->writeInt32(flags);
656+
stream->writeInt64(collectible_id);
657+
if ((flags & 1) != 0) {
658+
stream->writeInt32(until);
659+
}
660+
}
661+
573662
User *User::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
574663
User *result = nullptr;
575664
switch (constructor) {
@@ -673,10 +762,10 @@ void TL_user::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &er
673762
stories_max_id = std::unique_ptr<TL_recentStory>(TL_recentStory::TLdeserialize(stream, stream->readInt32(&error), instanceNum, error));
674763
}
675764
if ((flags2 & 256) != 0) {
676-
color = std::unique_ptr<TL_peerColor>(TL_peerColor::TLdeserialize(stream, stream->readUint32(&error), instanceNum, error));
765+
color = std::unique_ptr<PeerColor>(PeerColor::TLdeserialize(stream, stream->readUint32(&error), instanceNum, error));
677766
}
678767
if ((flags2 & 512) != 0) {
679-
profile_color = std::unique_ptr<TL_peerColor>(TL_peerColor::TLdeserialize(stream, stream->readUint32(&error), instanceNum, error));
768+
profile_color = std::unique_ptr<PeerColor>(PeerColor::TLdeserialize(stream, stream->readUint32(&error), instanceNum, error));
680769
}
681770
if ((flags2 & 4096) != 0) {
682771
bot_active_users = stream->readInt32(&error);
@@ -838,10 +927,10 @@ void TL_user_layer216::readParams(NativeByteBuffer *stream, int32_t instanceNum,
838927
stories_max_id->max_id = stream->readInt32(&error);
839928
}
840929
if ((flags2 & 256) != 0) {
841-
color = std::unique_ptr<TL_peerColor>(TL_peerColor::TLdeserialize(stream, stream->readUint32(&error), instanceNum, error));
930+
color = std::unique_ptr<PeerColor>(PeerColor::TLdeserialize(stream, stream->readUint32(&error), instanceNum, error));
842931
}
843932
if ((flags2 & 512) != 0) {
844-
profile_color = std::unique_ptr<TL_peerColor>(TL_peerColor::TLdeserialize(stream, stream->readUint32(&error), instanceNum, error));
933+
profile_color = std::unique_ptr<PeerColor>(PeerColor::TLdeserialize(stream, stream->readUint32(&error), instanceNum, error));
845934
}
846935
if ((flags2 & 4096) != 0) {
847936
bot_active_users = stream->readInt32(&error);

‎TMessagesProj/jni/tgnet/ApiScheme.h‎

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class TL_userStatusOffline : public UserStatus {
204204
class TL_userStatusLastWeek : public UserStatus {
205205

206206
public:
207-
static const uint32_t constructor = 0x7bf09fc;
207+
static const uint32_t constructor = 0x541a1d1a;
208208

209209
uint32_t flags;
210210
bool by_me;
@@ -376,15 +376,36 @@ class TL_username : public TLObject {
376376
void serializeToStream(NativeByteBuffer *stream);
377377
};
378378

379-
class TL_peerColor : public TLObject {
379+
class PeerColor : public TLObject {
380+
public:
381+
static PeerColor *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error);
382+
};
383+
384+
class TL_peerColor : public PeerColor {
380385
public:
381386
static const uint32_t constructor = 0xb54b5acf;
382387

383388
int32_t flags;
384389
int32_t color;
385390
int64_t background_emoji_id;
386391

387-
static TL_peerColor *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error);
392+
void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
393+
void serializeToStream(NativeByteBuffer *stream);
394+
};
395+
396+
class TL_peerColorCollectible : public PeerColor {
397+
public:
398+
static const uint32_t constructor = 0xb9c0639a;
399+
400+
int32_t flags;
401+
int64_t collectible_id;
402+
int64_t gift_emoji_id;
403+
int64_t background_emoji_id;
404+
int32_t accent_color;
405+
std::vector<int32_t> colors;
406+
int32_t dark_accent_color;
407+
std::vector<int32_t> dark_colors;
408+
388409
void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
389410
void serializeToStream(NativeByteBuffer *stream);
390411
};
@@ -396,7 +417,7 @@ class EmojiStatus : public TLObject {
396417

397418
class TL_emojiStatusEmpty : public EmojiStatus {
398419
public:
399-
static const uint32_t constructor = 0xb54b5acf;
420+
static const uint32_t constructor = 0x2de11aae;
400421

401422
void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
402423
void serializeToStream(NativeByteBuffer *stream);
@@ -455,6 +476,18 @@ class TL_emojiStatusCollectible : public EmojiStatus {
455476
void serializeToStream(NativeByteBuffer *stream);
456477
};
457478

479+
class TL_inputEmojiStatusCollectible : public EmojiStatus {
480+
public:
481+
static const uint32_t constructor = 0x7141dbf;
482+
483+
int32_t flags;
484+
int64_t collectible_id;
485+
int32_t until;
486+
487+
void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
488+
void serializeToStream(NativeByteBuffer *stream);
489+
};
490+
458491
class User : public TLObject {
459492

460493
public:
@@ -475,8 +508,8 @@ class User : public TLObject {
475508
std::vector<std::unique_ptr<TL_username>> usernames;
476509
std::unique_ptr<TL_recentStory> stories_max_id;
477510
std::unique_ptr<EmojiStatus> emoji_status;
478-
std::unique_ptr<TL_peerColor> color;
479-
std::unique_ptr<TL_peerColor> profile_color;
511+
std::unique_ptr<PeerColor> color;
512+
std::unique_ptr<PeerColor> profile_color;
480513
int32_t bot_active_users;
481514
int64_t bot_verification_icon;
482515
int64_t send_paid_messages_stars;

‎TMessagesProj/jni/voip/webrtc/examples/aarproject/gradle.properties‎

Lines changed: 0 additions & 22 deletions
This file was deleted.

‎TMessagesProj/src/main/AndroidManifest.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
android:allowAudioPlaybackCapture="true"
110110
tools:replace="android:supportsRtl"
111111
android:usesCleartextTraffic="true"
112+
android:enableOnBackInvokedCallback="true"
112113
>
113114
<!-- usesCleartextTraffic for browser supporting opening http:// links -->
114115

‎TMessagesProj/src/main/java/androidx/recyclerview/widget/DefaultItemAnimator.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ public void onAnimationEnd(Animator animator) {
274274
}
275275
view.setTranslationX(0);
276276
view.setTranslationY(0);
277+
onRemoveAnimationUpdate(holder);
277278
dispatchRemoveFinished(holder);
278279
mRemoveAnimations.remove(holder);
279280
dispatchFinishedWhenDone();
@@ -331,6 +332,7 @@ public void onAnimationCancel(Animator animator) {
331332
@Override
332333
public void onAnimationEnd(Animator animator) {
333334
animation.setListener(null);
335+
onAddAnimationUpdate(holder);
334336
dispatchAddFinished(holder);
335337
mAddAnimations.remove(holder);
336338
dispatchFinishedWhenDone();
@@ -448,6 +450,7 @@ public void onAnimationCancel(Animator animator) {
448450
@Override
449451
public void onAnimationEnd(Animator animator) {
450452
animation.setListener(null);
453+
onMoveAnimationUpdate(holder);
451454
dispatchMoveFinished(holder);
452455
mMoveAnimations.remove(holder);
453456
dispatchFinishedWhenDone();
@@ -536,6 +539,7 @@ public void onAnimationEnd(Animator animator) {
536539
}
537540
view.setTranslationX(0);
538541
view.setTranslationY(0);
542+
onChangeAnimationUpdate(changeInfo.oldHolder);
539543
dispatchChangeFinished(changeInfo.oldHolder, true);
540544
mChangeAnimations.remove(changeInfo.oldHolder);
541545
dispatchFinishedWhenDone();
@@ -573,6 +577,7 @@ public void onAnimationEnd(Animator animator) {
573577
}
574578
newView.setTranslationX(0);
575579
newView.setTranslationY(0);
580+
onChangeAnimationUpdate(changeInfo.newHolder);
576581
dispatchChangeFinished(changeInfo.newHolder, false);
577582
mChangeAnimations.remove(changeInfo.newHolder);
578583
dispatchFinishedWhenDone();

‎TMessagesProj/src/main/java/org/telegram/messenger/AndroidUtilities.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5635,10 +5635,10 @@ public static void updateViewVisibilityAnimated(View view, boolean show, float s
56355635
}
56365636

56375637
public static void updateViewVisibilityAnimated(View view, boolean show, float scaleFactor, boolean goneOnHide, boolean animated) {
5638-
updateViewVisibilityAnimated(view, show, scaleFactor, goneOnHide, 1f, animated);
5638+
updateViewVisibilityAnimated(view, show, scaleFactor, goneOnHide, 1f, animated, null);
56395639
}
56405640

5641-
public static void updateViewVisibilityAnimated(View view, boolean show, float scaleFactor, boolean goneOnHide, float maxAlpha, boolean animated) {
5641+
public static void updateViewVisibilityAnimated(View view, boolean show, float scaleFactor, boolean goneOnHide, float maxAlpha, boolean animated, ValueAnimator.AnimatorUpdateListener onUpdate) {
56425642
if (view == null) {
56435643
return;
56445644
}
@@ -5661,11 +5661,11 @@ public static void updateViewVisibilityAnimated(View view, boolean show, float s
56615661
view.setScaleX(scaleFactor);
56625662
view.setScaleY(scaleFactor);
56635663
}
5664-
view.animate().alpha(maxAlpha).scaleY(1f).scaleX(1f).setDuration(150).start();
5664+
view.animate().alpha(maxAlpha).scaleY(1f).scaleX(1f).setDuration(150).setUpdateListener(onUpdate).start();
56655665
view.setTag(1);
56665666
} else if (!show && view.getTag() != null) {
56675667
view.animate().setListener(null).cancel();
5668-
view.animate().alpha(0).scaleY(scaleFactor).scaleX(scaleFactor).setListener(new HideViewAfterAnimation(view, goneOnHide)).setDuration(150).start();
5668+
view.animate().alpha(0).scaleY(scaleFactor).scaleX(scaleFactor).setListener(new HideViewAfterAnimation(view, goneOnHide)).setDuration(150).setUpdateListener(onUpdate).start();
56695669
view.setTag(null);
56705670
}
56715671
}

‎TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ public class BuildVars {
2626
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
2727
public static String BUILD_VERSION_STRING = BuildConfig.BUILD_VERSION_STRING;
2828

29-
// works only on official app ids, disable on your forks
30-
public static boolean SUPPORTS_PASSKEYS = true;
31-
3229
public static int APP_ID = 4;
3330
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
3431

@@ -43,6 +40,9 @@ public class BuildVars {
4340
// You can use this flag to disable Google Play Billing (If you're making fork and want it to be in Google Play)
4441
public static boolean IS_BILLING_UNAVAILABLE = false;
4542

43+
// works only on official app ids, disable on your forks
44+
public static boolean SUPPORTS_PASSKEYS = true;
45+
4646
static {
4747
if (ApplicationLoader.applicationContext != null) {
4848
SharedPreferences sharedPreferences = ApplicationLoader.applicationContext.getSharedPreferences("systemConfig", Context.MODE_PRIVATE);

0 commit comments

Comments
 (0)