Skip to content

Commit

Permalink
Update to 5.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DrKLO committed Sep 10, 2019
1 parent 53e04b5 commit 28eb8df
Show file tree
Hide file tree
Showing 198 changed files with 16,784 additions and 7,105 deletions.
11 changes: 6 additions & 5 deletions TMessagesProj/build.gradle
Expand Up @@ -21,15 +21,15 @@ dependencies {

compileOnly 'org.checkerframework:checker-qual:2.5.2'
compileOnly 'org.checkerframework:checker-compat-qual:2.5.0'
implementation 'com.google.firebase:firebase-messaging:19.0.1'
implementation 'com.google.firebase:firebase-config:18.0.0'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
implementation 'com.google.firebase:firebase-config:19.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.android.gms:play-services-vision:16.2.0'
implementation 'com.google.android.gms:play-services-wallet:17.0.0'
implementation 'com.google.android.gms:play-services-wearable:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'net.hockeyapp.android:HockeySDK:5.1.1'
implementation 'net.hockeyapp.android:HockeySDK:5.2.0'
implementation 'com.googlecode.mp4parser:isoparser:1.0.6'
implementation 'com.stripe:stripe-android:2.0.2'
}
Expand All @@ -51,6 +51,7 @@ android {
lintOptions {
disable 'MissingTranslation'
disable 'ExtraTranslation'
disable 'BlockedPrivateApi'
}

dexOptions {
Expand Down Expand Up @@ -242,7 +243,7 @@ android {
}
}

defaultConfig.versionCode = 1684
defaultConfig.versionCode = 1710

applicationVariants.all { variant ->
variant.outputs.all { output ->
Expand Down Expand Up @@ -276,7 +277,7 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
versionName "5.10.0"
versionName "5.11.0"

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

Expand Down
15 changes: 14 additions & 1 deletion TMessagesProj/jni/rlottie/src/lottie/lottieitem.cpp
Expand Up @@ -78,6 +78,16 @@ LOTCompItem::LOTCompItem(LOTModel *model)
mViewSize = mCompData->size();
}

static bool isGoodParentLayer(LOTLayerItem *parent, LOTLayerItem *child) {
do {
if (parent == child) {
return false;
}
parent = parent->resolvedParentLayer();
} while (parent);
return true;
}

void LOTCompItem::setValue(const std::string &keypath, LOTVariant &value)
{
LOTKeyPath key(keypath);
Expand Down Expand Up @@ -527,7 +537,10 @@ LOTCompLayerItem::LOTCompLayerItem(LOTLayerData *layerModel)
auto search =
std::find_if(mLayers.begin(), mLayers.end(),
[id](const auto &val) { return val->id() == id; });
if (search != mLayers.end()) layer->setParentLayer((*search).get());
if (search != mLayers.end() &&
isGoodParentLayer((*search).get(), layer.get())) {
layer->setParentLayer((*search).get());
}
}
}

Expand Down
1 change: 1 addition & 0 deletions TMessagesProj/jni/rlottie/src/lottie/lottieitem.h
Expand Up @@ -107,6 +107,7 @@ class LOTLayerItem
LOTLayerItem(LOTLayerData *layerData);
int id() const {return mLayerData->id();}
int parentId() const {return mLayerData->parentId();}
LOTLayerItem *resolvedParentLayer() const {return mParentLayer;}
void setParentLayer(LOTLayerItem *parent){mParentLayer = parent;}
void setComplexContent(bool value) { mComplexContent = value;}
bool complexContent() const {return mComplexContent;}
Expand Down
18 changes: 14 additions & 4 deletions TMessagesProj/jni/rlottie/src/lottie/lottieparser.cpp
Expand Up @@ -622,6 +622,10 @@ void LottieParserImpl::parseComposition() {
parsingError = true;
return;
}
if (comp->mVersion.empty() || !comp->mRootLayer) {
// don't have a valid bodymovin header
return;
}
resolveLayerRefs();
comp->setStatic(comp->mRootLayer->isStatic());
comp->mRootLayer->mInFrame = comp->mStartFrame;
Expand Down Expand Up @@ -1969,7 +1973,7 @@ void LottieParserImpl::getValue(std::vector<VPointF> &v) {

void LottieParserImpl::getValue(VPointF &pt)
{
float val[4];
float val[4] = {0.f};
int i = 0;

if (PeekType() == kArrayType) EnterArray();
Expand All @@ -1978,7 +1982,10 @@ void LottieParserImpl::getValue(VPointF &pt)
if (parsingError) {
return;
}
val[i++] = GetDouble();
const auto value = GetDouble();
if (i < 4) {
val[i++] = value;
}
}
if (!IsValid()) {
parsingError = true;
Expand Down Expand Up @@ -2014,15 +2021,18 @@ void LottieParserImpl::getValue(float &val)

void LottieParserImpl::getValue(LottieColor &color)
{
float val[4];
float val[4] = {0.f};
int i = 0;
if (PeekType() == kArrayType) EnterArray();

while (NextArrayValue()) {
if (parsingError) {
return;
}
val[i++] = GetDouble();
const auto value = GetDouble();
if (i < 4) {
val[i++] = value;
}
}
if (!IsValid()) {
parsingError = true;
Expand Down
48 changes: 45 additions & 3 deletions TMessagesProj/jni/tgnet/ApiScheme.cpp
Expand Up @@ -339,13 +339,37 @@ void TL_account_registerDevice::serializeToStream(NativeByteBuffer *stream) {
stream->writeString(token);
}

TL_restrictionReason *TL_restrictionReason::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
if (TL_restrictionReason::constructor != constructor) {
error = true;
if (LOGS_ENABLED) DEBUG_E("can't parse magic %x in TL_restrictionReason", constructor);
return nullptr;
}
TL_restrictionReason *result = new TL_restrictionReason();
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);
text = stream->readString(&error);
}

void TL_restrictionReason::serializeToStream(NativeByteBuffer *stream) {
stream->writeInt32(constructor);
stream->writeString(platform);
stream->writeString(reason);
stream->writeString(text);
}

User *User::TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
User *result = nullptr;
switch (constructor) {
case 0x200250ba:
result = new TL_userEmpty();
break;
case 0x2e13f4c3:
case 0x938458c1:
result = new TL_user();
break;
default:
Expand Down Expand Up @@ -394,7 +418,20 @@ void TL_user::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &er
bot_info_version = stream->readInt32(&error);
}
if ((flags & 262144) != 0) {
restriction_reason = stream->readString(&error);
uint32_t magic = stream->readUint32(&error);
if (magic != 0x1cb5c415) {
error = true;
if (LOGS_ENABLED) DEBUG_E("wrong Vector magic, got %x", magic);
return;
}
int32_t count = stream->readInt32(&error);
for (int32_t a = 0; a < count; a++) {
TL_restrictionReason *object = TL_restrictionReason::TLdeserialize(stream, stream->readUint32(&error), instanceNum, error);
if (object == nullptr) {
return;
}
restriction_reason.push_back(std::unique_ptr<TL_restrictionReason>(object));
}
}
if ((flags & 524288) != 0) {
bot_inline_placeholder = stream->readString(&error);
Expand Down Expand Up @@ -433,7 +470,12 @@ void TL_user::serializeToStream(NativeByteBuffer *stream) {
stream->writeInt32(bot_info_version);
}
if ((flags & 262144) != 0) {
stream->writeString(restriction_reason);
stream->writeInt32(0x1cb5c415);
uint32_t count = (uint32_t) restriction_reason.size();
stream->writeInt32(count);
for (int a = 0; a < count; a++) {
restriction_reason[a]->serializeToStream(stream);
}
}
if ((flags & 524288) != 0) {
stream->writeString(bot_inline_placeholder);
Expand Down
18 changes: 16 additions & 2 deletions TMessagesProj/jni/tgnet/ApiScheme.h
Expand Up @@ -277,6 +277,20 @@ class TL_userProfilePhoto : public UserProfilePhoto {
void serializeToStream(NativeByteBuffer *stream);
};

class TL_restrictionReason : public TLObject {

public:
static const uint32_t constructor = 0xd072acb4;

std::string platform;
std::string reason;
std::string text;

static TL_restrictionReason *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error);
void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
void serializeToStream(NativeByteBuffer *stream);
};

class User : public TLObject {

public:
Expand All @@ -290,7 +304,7 @@ class User : public TLObject {
std::unique_ptr<UserStatus> status;
int32_t flags;
int32_t bot_info_version;
std::string restriction_reason;
std::vector<std::unique_ptr<TL_restrictionReason>> restriction_reason;
std::string bot_inline_placeholder;
std::string lang_code;

Expand All @@ -309,7 +323,7 @@ class TL_userEmpty : public User {
class TL_user : public User {

public:
static const uint32_t constructor = 0x2e13f4c3;
static const uint32_t constructor = 0x938458c1;

void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error);
void serializeToStream(NativeByteBuffer *stream);
Expand Down
3 changes: 3 additions & 0 deletions TMessagesProj/jni/tgnet/ByteStream.cpp
Expand Up @@ -58,6 +58,9 @@ void ByteStream::discard(uint32_t count) {
uint32_t remaining;
NativeByteBuffer *buffer;
while (count > 0) {
if (buffersQueue.empty()) {
break;
}
buffer = buffersQueue[0];
remaining = buffer->remaining();
if (count < remaining) {
Expand Down

3 comments on commit 28eb8df

@zarEclEC
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well. that's good. Keep it up!

@HitaloM
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As always, keeping the source updated. 😊

@ehsansouri23
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you don't think about reflection in android 9?

Please sign in to comment.