Skip to content

Commit aaa5dc0

Browse files
committed
Update to 7.2.0 (2128)
1 parent 19599e6 commit aaa5dc0

File tree

252 files changed

+16310
-6526
lines changed

Some content is hidden

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

252 files changed

+16310
-6526
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM gradle:6.1.1-jdk8
1+
FROM gradle:6.5.0-jdk8
22

33
ENV ANDROID_SDK_URL https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
44
ENV ANDROID_API_LEVEL android-30

TMessagesProj/build.gradle

+5-20
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ configurations.all {
1717
dependencies {
1818
implementation 'androidx.core:core:1.3.2'
1919
implementation 'androidx.palette:palette:1.0.0'
20-
implementation 'androidx.exifinterface:exifinterface:1.3.0'
20+
implementation 'androidx.exifinterface:exifinterface:1.3.1'
2121
implementation 'androidx.dynamicanimation:dynamicanimation:1.0.0'
2222
implementation 'androidx.multidex:multidex:2.0.1'
2323
implementation "androidx.sharetarget:sharetarget:1.0.0"
@@ -33,6 +33,7 @@ dependencies {
3333
implementation 'com.google.android.gms:play-services-vision:16.2.0'
3434
implementation 'com.google.android.gms:play-services-wearable:17.0.0'
3535
implementation 'com.google.android.gms:play-services-location:17.1.0'
36+
implementation 'com.google.android.gms:play-services-wallet:18.1.2'
3637
implementation "com.microsoft.appcenter:appcenter-distribute:3.3.1"
3738
implementation "com.microsoft.appcenter:appcenter-crashes:3.3.1"
3839
implementation 'com.googlecode.mp4parser:isoparser:1.0.6'
@@ -284,28 +285,12 @@ android {
284285
}
285286
}
286287

287-
defaultConfig.versionCode = 2103
288+
defaultConfig.versionCode = 2128
288289

289290
applicationVariants.all { variant ->
290291
variant.outputs.all { output ->
291292
outputFileName = "app.apk"
292-
output.getProcessManifestProvider().get().doLast {
293-
def abiVersion = variant.productFlavors.get(0).abiVersionCode
294-
295-
def outputDir = manifestOutputDirectory
296-
File directory
297-
if (outputDir instanceof File) {
298-
directory = outputDir
299-
} else {
300-
directory = outputDir.get().asFile
301-
}
302-
303-
String manifestPath = directory.toString() + "/AndroidManifest.xml"
304-
def manifestContent = file(manifestPath).getText()
305-
306-
manifestContent = manifestContent.replace(String.format('android:versionCode="%d"', defaultConfig.versionCode), String.format('android:versionCode="%s"', defaultConfig.versionCode * 10 + abiVersion))
307-
file(manifestPath).write(manifestContent)
308-
}
293+
output.versionCodeOverride = defaultConfig.versionCode * 10 + variant.productFlavors.get(0).abiVersionCode
309294
}
310295
}
311296

@@ -319,7 +304,7 @@ android {
319304
defaultConfig {
320305
minSdkVersion 16
321306
targetSdkVersion 28
322-
versionName "7.1.3"
307+
versionName "7.2.0"
323308

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

TMessagesProj/jni/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ target_compile_definitions(sqlite PUBLIC
395395
#voip
396396
include(${CMAKE_HOME_DIRECTORY}/voip/CMakeLists.txt)
397397

398-
set(NATIVE_LIB "tmessages.33")
398+
set(NATIVE_LIB "tmessages.34")
399399

400400
#tmessages
401401
add_library(${NATIVE_LIB} SHARED

TMessagesProj/jni/TgNetWrapper.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ jint getCurrentTime(JNIEnv *env, jclass c, jint instanceNum) {
8080
return ConnectionsManager::getInstance(instanceNum).getCurrentTime();
8181
}
8282

83+
jint getCurrentDatacenterId(JNIEnv *env, jclass c, jint instanceNum) {
84+
return ConnectionsManager::getInstance(instanceNum).getCurrentDatacenterId();
85+
}
86+
8387
jint isTestBackend(JNIEnv *env, jclass c, jint instanceNum) {
8488
return ConnectionsManager::getInstance(instanceNum).isTestBackend() ? 1 : 0;
8589
}
@@ -424,6 +428,7 @@ static const char *ConnectionsManagerClassPathName = "org/telegram/tgnet/Connect
424428
static JNINativeMethod ConnectionsManagerMethods[] = {
425429
{"native_getCurrentTimeMillis", "(I)J", (void *) getCurrentTimeMillis},
426430
{"native_getCurrentTime", "(I)I", (void *) getCurrentTime},
431+
{"native_getCurrentDatacenterId", "(I)I", (void *) getCurrentDatacenterId},
427432
{"native_isTestBackend", "(I)I", (void *) isTestBackend},
428433
{"native_getTimeDifference", "(I)I", (void *) getTimeDifference},
429434
{"native_sendRequest", "(IJLorg/telegram/tgnet/RequestDelegateInternal;Lorg/telegram/tgnet/QuickAckDelegate;Lorg/telegram/tgnet/WriteToSocketDelegate;IIIZI)V", (void *) sendRequest},

TMessagesProj/jni/lottie.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ JNIEXPORT void Java_org_telegram_ui_Components_RLottieDrawable_createCache(JNIEn
299299
for (size_t a = 0; a < info->frameCount; a += framesPerUpdate) {
300300
Surface &surfaceToRender = num % 2 == 0 ? surface1 : surface2;
301301
num++;
302-
info->animation->renderSync(a, surfaceToRender);
302+
info->animation->renderSync(a, surfaceToRender, true);
303303
if (a != 0) {
304304
std::unique_lock<std::mutex> lk(cacheDoneMutex);
305305
cacheDoneCv.wait(lk, [] { return !frameReady.load(); });
@@ -317,6 +317,7 @@ JNIEXPORT void Java_org_telegram_ui_Components_RLottieDrawable_createCache(JNIEn
317317

318318
//DEBUG_D("sticker time = %d", (int) (ConnectionsManager::getInstance(0).getCurrentTimeMonotonicMillis() - time));
319319
delete[] info->compressBuffer;
320+
delete[] firstBuffer;
320321
delete[] secondBuffer;
321322
fseek(info->precacheFile, 0, SEEK_SET);
322323
uint8_t byte = 1;
@@ -332,7 +333,7 @@ JNIEXPORT void Java_org_telegram_ui_Components_RLottieDrawable_createCache(JNIEn
332333
}
333334
}
334335

335-
JNIEXPORT jint Java_org_telegram_ui_Components_RLottieDrawable_getFrame(JNIEnv *env, jclass clazz, jlong ptr, jint frame, jobject bitmap, jint w, jint h, jint stride) {
336+
JNIEXPORT jint Java_org_telegram_ui_Components_RLottieDrawable_getFrame(JNIEnv *env, jclass clazz, jlong ptr, jint frame, jobject bitmap, jint w, jint h, jint stride, jboolean clear) {
336337
if (!ptr || bitmap == nullptr) {
337338
return 0;
338339
}
@@ -384,7 +385,7 @@ JNIEXPORT jint Java_org_telegram_ui_Components_RLottieDrawable_getFrame(JNIEnv *
384385
if (!loadedFromCache) {
385386
if (!info->nextFrameIsCacheFrame || !info->precache) {
386387
Surface surface((uint32_t *) pixels, (size_t) w, (size_t) h, (size_t) stride);
387-
info->animation->renderSync((size_t) frame, surface);
388+
info->animation->renderSync((size_t) frame, surface, clear);
388389
info->nextFrameIsCacheFrame = true;
389390
}
390391
}

TMessagesProj/jni/rlottie/inc/rlottie.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ class LOT_EXPORT Animation {
345345
*
346346
* @internal
347347
*/
348-
void renderSync(size_t frameNo, Surface &surface);
348+
void renderSync(size_t frameNo, Surface &surface, bool clear);
349349

350350
/**
351351
* @brief Returns root layer of the composition updated with

TMessagesProj/jni/rlottie/src/lottie/lottieanimation.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class AnimationImpl {
4444
double frameRate() const { return mModel->frameRate(); }
4545
size_t totalFrame() const { return mModel->totalFrame(); }
4646
size_t frameAtPos(double pos) const { return mModel->frameAtPos(pos); }
47-
Surface render(size_t frameNo, const Surface &surface);
47+
Surface render(size_t frameNo, const Surface &surface, bool clear);
4848
const LOTLayerNode * renderTree(size_t frameNo, const VSize &size);
4949

5050
const LayerInfoList &layerInfoList() const
@@ -93,7 +93,7 @@ bool AnimationImpl::update(size_t frameNo, const VSize &size)
9393
return mCompItem->update(frameNo);
9494
}
9595

96-
Surface AnimationImpl::render(size_t frameNo, const Surface &surface)
96+
Surface AnimationImpl::render(size_t frameNo, const Surface &surface, bool clear)
9797
{
9898
bool renderInProgress = mRenderInProgress.load();
9999
if (renderInProgress) {
@@ -104,7 +104,7 @@ Surface AnimationImpl::render(size_t frameNo, const Surface &surface)
104104
mRenderInProgress.store(true);
105105
update(frameNo,
106106
VSize(surface.drawRegionWidth(), surface.drawRegionHeight()));
107-
mCompItem->render(surface);
107+
mCompItem->render(surface, clear);
108108
mRenderInProgress.store(false);
109109

110110
return surface;
@@ -201,9 +201,9 @@ const LOTLayerNode *Animation::renderTree(size_t frameNo, size_t width,
201201
return d->renderTree(frameNo, VSize(width, height));
202202
}
203203

204-
void Animation::renderSync(size_t frameNo, Surface &surface)
204+
void Animation::renderSync(size_t frameNo, Surface &surface, bool clear)
205205
{
206-
d->render(frameNo, surface);
206+
d->render(frameNo, surface, clear);
207207
}
208208

209209
const LayerInfoList &Animation::layers() const

TMessagesProj/jni/rlottie/src/lottie/lottieitem.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ const LOTLayerNode *LOTCompItem::renderTree() const
175175
return mRootLayer->layerNode();
176176
}
177177

178-
bool LOTCompItem::render(const rlottie::Surface &surface)
178+
bool LOTCompItem::render(const rlottie::Surface &surface, bool clear)
179179
{
180180
VBitmap bitmap(reinterpret_cast<uchar *>(surface.buffer()), surface.width(),
181181
surface.height(), surface.bytesPerLine(),
@@ -190,7 +190,7 @@ bool LOTCompItem::render(const rlottie::Surface &surface)
190190
e->preprocess(clip);
191191
}
192192

193-
VPainter painter(&bitmap);
193+
VPainter painter(&bitmap, clear);
194194
// set sub surface area for drawing.
195195
painter.setDrawRegion(
196196
VRect(surface.drawRegionPosX(), surface.drawRegionPosY(),
@@ -609,7 +609,7 @@ void LOTCompLayerItem::render(VPainter *painter, const VRle &inheritMask,
609609
VPainter srcPainter;
610610
VBitmap srcBitmap(size.width(), size.height(),
611611
VBitmap::Format::ARGB32);
612-
srcPainter.begin(&srcBitmap);
612+
srcPainter.begin(&srcBitmap, true);
613613
renderHelper(&srcPainter, inheritMask, matteRle);
614614
srcPainter.end();
615615
painter->drawBitmap(VPoint(), srcBitmap, combinedAlpha() * 255);
@@ -669,15 +669,15 @@ void LOTCompLayerItem::renderMatteLayer(VPainter *painter, const VRle &mask,
669669
VPainter srcPainter;
670670
src->bitmap().reset(size.width(), size.height(),
671671
VBitmap::Format::ARGB32);
672-
srcPainter.begin(&src->bitmap());
672+
srcPainter.begin(&src->bitmap(), true);
673673
src->render(&srcPainter, mask, matteRle);
674674
srcPainter.end();
675675

676676
// 2. draw layer to layer buffer
677677
VPainter layerPainter;
678678
layer->bitmap().reset(size.width(), size.height(),
679679
VBitmap::Format::ARGB32);
680-
layerPainter.begin(&layer->bitmap());
680+
layerPainter.begin(&layer->bitmap(), true);
681681
layer->render(&layerPainter, mask, matteRle);
682682

683683
// 2.1update composition mode

TMessagesProj/jni/rlottie/src/lottie/lottieitem.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class LOTCompItem
7070
VSize size() const;
7171
void buildRenderTree();
7272
const LOTLayerNode * renderTree()const;
73-
bool render(const rlottie::Surface &surface);
73+
bool render(const rlottie::Surface &surface, bool clear);
7474
void setValue(const std::string &keypath, LOTVariant &value);
7575
void resetCurrentFrame();
7676
private:

TMessagesProj/jni/rlottie/src/vector/vpainter.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,19 @@ VPainter::VPainter()
115115
mImpl = new VPainterImpl;
116116
}
117117

118-
VPainter::VPainter(VBitmap *buffer)
118+
VPainter::VPainter(VBitmap *buffer, bool clear)
119119
{
120120
mImpl = new VPainterImpl;
121-
begin(buffer);
121+
begin(buffer, clear);
122122
}
123-
bool VPainter::begin(VBitmap *buffer)
123+
bool VPainter::begin(VBitmap *buffer, bool clear)
124124
{
125125
mImpl->mBuffer.prepare(buffer);
126126
mImpl->mSpanData.init(&mImpl->mBuffer);
127127
// TODO find a better api to clear the surface
128-
mImpl->mBuffer.clear();
128+
if (clear) {
129+
mImpl->mBuffer.clear();
130+
}
129131
return true;
130132
}
131133
void VPainter::end() {}

TMessagesProj/jni/rlottie/src/vector/vpainter.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class VPainter {
3737
};
3838
~VPainter();
3939
VPainter();
40-
VPainter(VBitmap *buffer);
41-
bool begin(VBitmap *buffer);
40+
VPainter(VBitmap *buffer, bool clear);
41+
bool begin(VBitmap *buffer, bool clear);
4242
void end();
4343
void setDrawRegion(const VRect &region); // sub surface rendering area.
4444
void setBrush(const VBrush &brush);

TMessagesProj/jni/tgnet/ConnectionsManager.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,11 @@ int32_t ConnectionsManager::getCurrentTime() {
564564
return (int32_t) (getCurrentTimeMillis() / 1000) + timeDifference;
565565
}
566566

567+
uint32_t ConnectionsManager::getCurrentDatacenterId() {
568+
Datacenter *datacenter = getDatacenterWithId(DEFAULT_DATACENTER_ID);
569+
return datacenter != nullptr ? datacenter->getDatacenterId() : INT_MAX;
570+
}
571+
567572
bool ConnectionsManager::isTestBackend() {
568573
return testBackend;
569574
}
@@ -2796,7 +2801,7 @@ std::unique_ptr<TLObject> ConnectionsManager::wrapInLayer(TLObject *object, Data
27962801
invokeWithLayer *request2 = new invokeWithLayer();
27972802
request2->layer = currentLayer;
27982803
request2->query = std::unique_ptr<TLObject>(request);
2799-
if (LOGS_ENABLED) DEBUG_D("wrap in layer %s", typeid(*object).name());
2804+
if (LOGS_ENABLED) DEBUG_D("wrap in layer %s, flags = %d", typeid(*object).name(), request->flags);
28002805
return std::unique_ptr<TLObject>(request2);
28012806
}
28022807
}

TMessagesProj/jni/tgnet/ConnectionsManager.h

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class ConnectionsManager {
4545
int64_t getCurrentTimeMillis();
4646
int64_t getCurrentTimeMonotonicMillis();
4747
int32_t getCurrentTime();
48+
uint32_t getCurrentDatacenterId();
4849
bool isTestBackend();
4950
int32_t getTimeDifference();
5051
int32_t sendRequest(TLObject *object, onCompleteFunc onComplete, onQuickAckFunc onQuickAck, uint32_t flags, uint32_t datacenterId, ConnectionType connetionType, bool immediate);

TMessagesProj/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@
394394
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W" android:value="632dp" />
395395
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H" android:value="598dp" />
396396

397-
<!--<meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true" />-->
397+
<meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true" />
398398

399399
<meta-data android:name="com.google.android.gms.car.notification.SmallIcon" android:resource="@drawable/ic_player" />
400400
<meta-data android:name="com.google.android.gms.car.application" android:resource="@xml/automotive_app_desc" />

TMessagesProj/src/main/assets/arctic.attheme

+3-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ dialogProgressCircle=-12281108
9292
avatar_subtitleInProfilePink=-16777216
9393
player_progress=-14441474
9494
chat_inReplyLine=-12478487
95-
dialogLineProgressBackground=-3875601
95+
dialogLineProgressBackground=-3152133
9696
chat_inReplyNameText=-13464859
9797
chat_outAudioPerfomerSelectedText=-1
9898
profile_title=-13224394
@@ -122,6 +122,7 @@ dialogTextBlue2=-14772773
122122
dialogTextBlue3=-14839830
123123
dialogTextBlue4=-15625752
124124
actionBarTabActiveText=-13590803
125+
chat_topPanelMessage=-8354167
125126
statisticChartLine_golden=-1853657
126127
calls_callReceivedGreenIcon=-13645978
127128
chats_pinnedOverlay=100663296
@@ -279,6 +280,7 @@ windowBackgroundWhiteBlueText4=-12675352
279280
chat_replyPanelMessage=-13355980
280281
chat_inViewsSelected=-6373686
281282
windowBackgroundWhiteLinkSelection=560114147
283+
inappPlayerClose=-7563878
282284
chat_outMediaIcon=-13332255
283285
chat_outAudioCacheSeekbar=738197503
284286
chats_sentClock=2066650878

TMessagesProj/src/main/assets/bluebubbles.attheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ chat_inLoaderSelected=-12277262
4848
chat_outLocationIcon=-2105761599
4949
chat_outAudioProgress=-6239505
5050
chat_inReplyLine=-348807706
51-
dialogLineProgressBackground=-2825240
51+
dialogLineProgressBackground=-2035723
5252
chat_inReplyNameText=-14643754
5353
statisticChartLine_lightgreen=-7352519
5454
chats_onlineCircle=-13192972

0 commit comments

Comments
 (0)