Skip to content

Commit

Permalink
Update to 7.2.0 (2128)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrKLO committed Oct 30, 2020
1 parent 19599e6 commit aaa5dc0
Show file tree
Hide file tree
Showing 252 changed files with 16,310 additions and 6,526 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gradle:6.1.1-jdk8
FROM gradle:6.5.0-jdk8

ENV ANDROID_SDK_URL https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
ENV ANDROID_API_LEVEL android-30
Expand Down
25 changes: 5 additions & 20 deletions TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ configurations.all {
dependencies {
implementation 'androidx.core:core:1.3.2'
implementation 'androidx.palette:palette:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.3.0'
implementation 'androidx.exifinterface:exifinterface:1.3.1'
implementation 'androidx.dynamicanimation:dynamicanimation:1.0.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation "androidx.sharetarget:sharetarget:1.0.0"
Expand All @@ -33,6 +33,7 @@ dependencies {
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.1.0'
implementation 'com.google.android.gms:play-services-wallet:18.1.2'
implementation "com.microsoft.appcenter:appcenter-distribute:3.3.1"
implementation "com.microsoft.appcenter:appcenter-crashes:3.3.1"
implementation 'com.googlecode.mp4parser:isoparser:1.0.6'
Expand Down Expand Up @@ -284,28 +285,12 @@ android {
}
}

defaultConfig.versionCode = 2103
defaultConfig.versionCode = 2128

applicationVariants.all { variant ->
variant.outputs.all { output ->
outputFileName = "app.apk"
output.getProcessManifestProvider().get().doLast {
def abiVersion = variant.productFlavors.get(0).abiVersionCode

def outputDir = manifestOutputDirectory
File directory
if (outputDir instanceof File) {
directory = outputDir
} else {
directory = outputDir.get().asFile
}

String manifestPath = directory.toString() + "/AndroidManifest.xml"
def manifestContent = file(manifestPath).getText()

manifestContent = manifestContent.replace(String.format('android:versionCode="%d"', defaultConfig.versionCode), String.format('android:versionCode="%s"', defaultConfig.versionCode * 10 + abiVersion))
file(manifestPath).write(manifestContent)
}
output.versionCodeOverride = defaultConfig.versionCode * 10 + variant.productFlavors.get(0).abiVersionCode
}
}

Expand All @@ -319,7 +304,7 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
versionName "7.1.3"
versionName "7.2.0"

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

Expand Down
2 changes: 1 addition & 1 deletion TMessagesProj/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ target_compile_definitions(sqlite PUBLIC
#voip
include(${CMAKE_HOME_DIRECTORY}/voip/CMakeLists.txt)

set(NATIVE_LIB "tmessages.33")
set(NATIVE_LIB "tmessages.34")

#tmessages
add_library(${NATIVE_LIB} SHARED
Expand Down
5 changes: 5 additions & 0 deletions TMessagesProj/jni/TgNetWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ jint getCurrentTime(JNIEnv *env, jclass c, jint instanceNum) {
return ConnectionsManager::getInstance(instanceNum).getCurrentTime();
}

jint getCurrentDatacenterId(JNIEnv *env, jclass c, jint instanceNum) {
return ConnectionsManager::getInstance(instanceNum).getCurrentDatacenterId();
}

jint isTestBackend(JNIEnv *env, jclass c, jint instanceNum) {
return ConnectionsManager::getInstance(instanceNum).isTestBackend() ? 1 : 0;
}
Expand Down Expand Up @@ -424,6 +428,7 @@ static const char *ConnectionsManagerClassPathName = "org/telegram/tgnet/Connect
static JNINativeMethod ConnectionsManagerMethods[] = {
{"native_getCurrentTimeMillis", "(I)J", (void *) getCurrentTimeMillis},
{"native_getCurrentTime", "(I)I", (void *) getCurrentTime},
{"native_getCurrentDatacenterId", "(I)I", (void *) getCurrentDatacenterId},
{"native_isTestBackend", "(I)I", (void *) isTestBackend},
{"native_getTimeDifference", "(I)I", (void *) getTimeDifference},
{"native_sendRequest", "(IJLorg/telegram/tgnet/RequestDelegateInternal;Lorg/telegram/tgnet/QuickAckDelegate;Lorg/telegram/tgnet/WriteToSocketDelegate;IIIZI)V", (void *) sendRequest},
Expand Down
7 changes: 4 additions & 3 deletions TMessagesProj/jni/lottie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ JNIEXPORT void Java_org_telegram_ui_Components_RLottieDrawable_createCache(JNIEn
for (size_t a = 0; a < info->frameCount; a += framesPerUpdate) {
Surface &surfaceToRender = num % 2 == 0 ? surface1 : surface2;
num++;
info->animation->renderSync(a, surfaceToRender);
info->animation->renderSync(a, surfaceToRender, true);
if (a != 0) {
std::unique_lock<std::mutex> lk(cacheDoneMutex);
cacheDoneCv.wait(lk, [] { return !frameReady.load(); });
Expand All @@ -317,6 +317,7 @@ JNIEXPORT void Java_org_telegram_ui_Components_RLottieDrawable_createCache(JNIEn

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

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) {
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) {
if (!ptr || bitmap == nullptr) {
return 0;
}
Expand Down Expand Up @@ -384,7 +385,7 @@ JNIEXPORT jint Java_org_telegram_ui_Components_RLottieDrawable_getFrame(JNIEnv *
if (!loadedFromCache) {
if (!info->nextFrameIsCacheFrame || !info->precache) {
Surface surface((uint32_t *) pixels, (size_t) w, (size_t) h, (size_t) stride);
info->animation->renderSync((size_t) frame, surface);
info->animation->renderSync((size_t) frame, surface, clear);
info->nextFrameIsCacheFrame = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion TMessagesProj/jni/rlottie/inc/rlottie.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ class LOT_EXPORT Animation {
*
* @internal
*/
void renderSync(size_t frameNo, Surface &surface);
void renderSync(size_t frameNo, Surface &surface, bool clear);

/**
* @brief Returns root layer of the composition updated with
Expand Down
10 changes: 5 additions & 5 deletions TMessagesProj/jni/rlottie/src/lottie/lottieanimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class AnimationImpl {
double frameRate() const { return mModel->frameRate(); }
size_t totalFrame() const { return mModel->totalFrame(); }
size_t frameAtPos(double pos) const { return mModel->frameAtPos(pos); }
Surface render(size_t frameNo, const Surface &surface);
Surface render(size_t frameNo, const Surface &surface, bool clear);
const LOTLayerNode * renderTree(size_t frameNo, const VSize &size);

const LayerInfoList &layerInfoList() const
Expand Down Expand Up @@ -93,7 +93,7 @@ bool AnimationImpl::update(size_t frameNo, const VSize &size)
return mCompItem->update(frameNo);
}

Surface AnimationImpl::render(size_t frameNo, const Surface &surface)
Surface AnimationImpl::render(size_t frameNo, const Surface &surface, bool clear)
{
bool renderInProgress = mRenderInProgress.load();
if (renderInProgress) {
Expand All @@ -104,7 +104,7 @@ Surface AnimationImpl::render(size_t frameNo, const Surface &surface)
mRenderInProgress.store(true);
update(frameNo,
VSize(surface.drawRegionWidth(), surface.drawRegionHeight()));
mCompItem->render(surface);
mCompItem->render(surface, clear);
mRenderInProgress.store(false);

return surface;
Expand Down Expand Up @@ -201,9 +201,9 @@ const LOTLayerNode *Animation::renderTree(size_t frameNo, size_t width,
return d->renderTree(frameNo, VSize(width, height));
}

void Animation::renderSync(size_t frameNo, Surface &surface)
void Animation::renderSync(size_t frameNo, Surface &surface, bool clear)
{
d->render(frameNo, surface);
d->render(frameNo, surface, clear);
}

const LayerInfoList &Animation::layers() const
Expand Down
10 changes: 5 additions & 5 deletions TMessagesProj/jni/rlottie/src/lottie/lottieitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const LOTLayerNode *LOTCompItem::renderTree() const
return mRootLayer->layerNode();
}

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

VPainter painter(&bitmap);
VPainter painter(&bitmap, clear);
// set sub surface area for drawing.
painter.setDrawRegion(
VRect(surface.drawRegionPosX(), surface.drawRegionPosY(),
Expand Down Expand Up @@ -609,7 +609,7 @@ void LOTCompLayerItem::render(VPainter *painter, const VRle &inheritMask,
VPainter srcPainter;
VBitmap srcBitmap(size.width(), size.height(),
VBitmap::Format::ARGB32);
srcPainter.begin(&srcBitmap);
srcPainter.begin(&srcBitmap, true);
renderHelper(&srcPainter, inheritMask, matteRle);
srcPainter.end();
painter->drawBitmap(VPoint(), srcBitmap, combinedAlpha() * 255);
Expand Down Expand Up @@ -669,15 +669,15 @@ void LOTCompLayerItem::renderMatteLayer(VPainter *painter, const VRle &mask,
VPainter srcPainter;
src->bitmap().reset(size.width(), size.height(),
VBitmap::Format::ARGB32);
srcPainter.begin(&src->bitmap());
srcPainter.begin(&src->bitmap(), true);
src->render(&srcPainter, mask, matteRle);
srcPainter.end();

// 2. draw layer to layer buffer
VPainter layerPainter;
layer->bitmap().reset(size.width(), size.height(),
VBitmap::Format::ARGB32);
layerPainter.begin(&layer->bitmap());
layerPainter.begin(&layer->bitmap(), true);
layer->render(&layerPainter, mask, matteRle);

// 2.1update composition mode
Expand Down
2 changes: 1 addition & 1 deletion TMessagesProj/jni/rlottie/src/lottie/lottieitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class LOTCompItem
VSize size() const;
void buildRenderTree();
const LOTLayerNode * renderTree()const;
bool render(const rlottie::Surface &surface);
bool render(const rlottie::Surface &surface, bool clear);
void setValue(const std::string &keypath, LOTVariant &value);
void resetCurrentFrame();
private:
Expand Down
10 changes: 6 additions & 4 deletions TMessagesProj/jni/rlottie/src/vector/vpainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,19 @@ VPainter::VPainter()
mImpl = new VPainterImpl;
}

VPainter::VPainter(VBitmap *buffer)
VPainter::VPainter(VBitmap *buffer, bool clear)
{
mImpl = new VPainterImpl;
begin(buffer);
begin(buffer, clear);
}
bool VPainter::begin(VBitmap *buffer)
bool VPainter::begin(VBitmap *buffer, bool clear)
{
mImpl->mBuffer.prepare(buffer);
mImpl->mSpanData.init(&mImpl->mBuffer);
// TODO find a better api to clear the surface
mImpl->mBuffer.clear();
if (clear) {
mImpl->mBuffer.clear();
}
return true;
}
void VPainter::end() {}
Expand Down
4 changes: 2 additions & 2 deletions TMessagesProj/jni/rlottie/src/vector/vpainter.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class VPainter {
};
~VPainter();
VPainter();
VPainter(VBitmap *buffer);
bool begin(VBitmap *buffer);
VPainter(VBitmap *buffer, bool clear);
bool begin(VBitmap *buffer, bool clear);
void end();
void setDrawRegion(const VRect &region); // sub surface rendering area.
void setBrush(const VBrush &brush);
Expand Down
7 changes: 6 additions & 1 deletion TMessagesProj/jni/tgnet/ConnectionsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,11 @@ int32_t ConnectionsManager::getCurrentTime() {
return (int32_t) (getCurrentTimeMillis() / 1000) + timeDifference;
}

uint32_t ConnectionsManager::getCurrentDatacenterId() {
Datacenter *datacenter = getDatacenterWithId(DEFAULT_DATACENTER_ID);
return datacenter != nullptr ? datacenter->getDatacenterId() : INT_MAX;
}

bool ConnectionsManager::isTestBackend() {
return testBackend;
}
Expand Down Expand Up @@ -2796,7 +2801,7 @@ std::unique_ptr<TLObject> ConnectionsManager::wrapInLayer(TLObject *object, Data
invokeWithLayer *request2 = new invokeWithLayer();
request2->layer = currentLayer;
request2->query = std::unique_ptr<TLObject>(request);
if (LOGS_ENABLED) DEBUG_D("wrap in layer %s", typeid(*object).name());
if (LOGS_ENABLED) DEBUG_D("wrap in layer %s, flags = %d", typeid(*object).name(), request->flags);
return std::unique_ptr<TLObject>(request2);
}
}
Expand Down
1 change: 1 addition & 0 deletions TMessagesProj/jni/tgnet/ConnectionsManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class ConnectionsManager {
int64_t getCurrentTimeMillis();
int64_t getCurrentTimeMonotonicMillis();
int32_t getCurrentTime();
uint32_t getCurrentDatacenterId();
bool isTestBackend();
int32_t getTimeDifference();
int32_t sendRequest(TLObject *object, onCompleteFunc onComplete, onQuickAckFunc onQuickAck, uint32_t flags, uint32_t datacenterId, ConnectionType connetionType, bool immediate);
Expand Down
2 changes: 1 addition & 1 deletion TMessagesProj/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W" android:value="632dp" />
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H" android:value="598dp" />

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

<meta-data android:name="com.google.android.gms.car.notification.SmallIcon" android:resource="@drawable/ic_player" />
<meta-data android:name="com.google.android.gms.car.application" android:resource="@xml/automotive_app_desc" />
Expand Down
4 changes: 3 additions & 1 deletion TMessagesProj/src/main/assets/arctic.attheme
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ dialogProgressCircle=-12281108
avatar_subtitleInProfilePink=-16777216
player_progress=-14441474
chat_inReplyLine=-12478487
dialogLineProgressBackground=-3875601
dialogLineProgressBackground=-3152133
chat_inReplyNameText=-13464859
chat_outAudioPerfomerSelectedText=-1
profile_title=-13224394
Expand Down Expand Up @@ -122,6 +122,7 @@ dialogTextBlue2=-14772773
dialogTextBlue3=-14839830
dialogTextBlue4=-15625752
actionBarTabActiveText=-13590803
chat_topPanelMessage=-8354167
statisticChartLine_golden=-1853657
calls_callReceivedGreenIcon=-13645978
chats_pinnedOverlay=100663296
Expand Down Expand Up @@ -279,6 +280,7 @@ windowBackgroundWhiteBlueText4=-12675352
chat_replyPanelMessage=-13355980
chat_inViewsSelected=-6373686
windowBackgroundWhiteLinkSelection=560114147
inappPlayerClose=-7563878
chat_outMediaIcon=-13332255
chat_outAudioCacheSeekbar=738197503
chats_sentClock=2066650878
Expand Down
2 changes: 1 addition & 1 deletion TMessagesProj/src/main/assets/bluebubbles.attheme
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ chat_inLoaderSelected=-12277262
chat_outLocationIcon=-2105761599
chat_outAudioProgress=-6239505
chat_inReplyLine=-348807706
dialogLineProgressBackground=-2825240
dialogLineProgressBackground=-2035723
chat_inReplyNameText=-14643754
statisticChartLine_lightgreen=-7352519
chats_onlineCircle=-13192972
Expand Down
Loading

0 comments on commit aaa5dc0

Please sign in to comment.