Permalink
Browse files

bug fixes

  • Loading branch information...
DrKLO
DrKLO committed Dec 9, 2017
1 parent 5630ad8 commit e9e40cb13ea942b148b259c083fb3364a0cd90ea
@@ -91,7 +91,7 @@ android {
}
}

defaultConfig.versionCode = 1154
defaultConfig.versionCode = 1155

sourceSets.debug {
manifest.srcFile 'config/debug/AndroidManifest.xml'
@@ -1289,12 +1289,12 @@ void ConnectionsManager::processServerResponse(TLObject *message, int64_t messag
networkMessage->message->bytes = request->getObjectSize();
networkMessage->message->body = std::unique_ptr<TLObject>(request);
networkMessage->message->seqno = connection->generateMessageSeqNo(false);
resendRequests[networkMessage->message->msg_id] = response->answer_msg_id;

std::vector<std::unique_ptr<NetworkMessage>> array;
array.push_back(std::unique_ptr<NetworkMessage>(networkMessage));

sendMessagesToConnection(array, connection, false);
resendRequests[networkMessage->message->msg_id] = response->answer_msg_id;
} else if (confirm) {
connection->addMessageToConfirm(response->answer_msg_id);
}
@@ -476,7 +476,7 @@ int32_t NativeByteBuffer::readBigInt32(bool *error) {
}

int64_t NativeByteBuffer::readInt64(bool *error) {
if (_position + 4 > _limit) {
if (_position + 8 > _limit) {
if (error != nullptr) {
*error = true;
}
@@ -521,7 +521,7 @@ bool NativeByteBuffer::readBool(bool *error) {
}

void NativeByteBuffer::readBytes(uint8_t *b, uint32_t length, bool *error) {
if (_position + length > _limit) {
if (length > _limit - _position) {
if (error != nullptr) {
*error = true;
}
@@ -533,7 +533,7 @@ void NativeByteBuffer::readBytes(uint8_t *b, uint32_t length, bool *error) {
}

ByteArray *NativeByteBuffer::readBytes(uint32_t length, bool *error) {
if (_position + length > _limit) {
if (length > _limit - _position) {
if (error != nullptr) {
*error = true;
}
@@ -11,7 +11,7 @@
public class BuildVars {
public static boolean DEBUG_VERSION = false;
public static boolean DEBUG_PRIVATE_VERSION = false;
public static int BUILD_VERSION = 1154;
public static int BUILD_VERSION = 1155;
public static String BUILD_VERSION_STRING = "4.6";
public static int APP_ID = 0; //obtain your own APP_ID at https://core.telegram.org/api/obtaining_api_id
public static String APP_HASH = ""; //obtain your own APP_HASH at https://core.telegram.org/api/obtaining_api_id
@@ -808,18 +808,23 @@ public static String getFileExtension(File file) {
}

public static String getDocumentFileName(TLRPC.Document document) {
String fileName = null;
if (document != null) {
if (document.file_name != null) {
return document.file_name;
}
for (int a = 0; a < document.attributes.size(); a++) {
TLRPC.DocumentAttribute documentAttribute = document.attributes.get(a);
if (documentAttribute instanceof TLRPC.TL_documentAttributeFilename) {
return documentAttribute.file_name;
fileName = document.file_name;
} else {
for (int a = 0; a < document.attributes.size(); a++) {
TLRPC.DocumentAttribute documentAttribute = document.attributes.get(a);
if (documentAttribute instanceof TLRPC.TL_documentAttributeFilename) {
fileName = documentAttribute.file_name;
}
}
}
}
return "";
if (fileName != null) {
fileName = fileName.replaceAll("[\u0001-\u001f<>:\"/\\\\|?*\u007f]+", "").trim();
}
return fileName != null ? fileName : "";
}

public static String getExtensionByMime(String mime) {
@@ -4863,7 +4863,7 @@ private void putMessagesInternal(final ArrayList<TLRPC.Message> messages, final
mentionsIdsMap.put(messageId, message.dialog_id);
}

if (!MessageObject.isOut(message) && (message.id > 0 || MessageObject.isUnread(message))) {
if (!(message.action instanceof TLRPC.TL_messageActionHistoryClear) && !MessageObject.isOut(message) && (message.id > 0 || MessageObject.isUnread(message))) {
Integer currentMaxId = dialogsReadMax.get(message.dialog_id);
if (currentMaxId == null) {
SQLiteCursor cursor = database.queryFinalized("SELECT inbox_max FROM dialogs WHERE did = " + message.dialog_id);
@@ -193,17 +193,17 @@ private void createNotification(MessageObject messageObject) {

if (MediaController.getInstance().isDownloadingCurrentMessage()) {
playbackState.setState(PlaybackState.STATE_BUFFERING, 0, 1).setActions(0);
bldr.addAction(new Notification.Action.Builder(R.drawable.ic_action_previous, null, pendingPrev).build())
.addAction(new Notification.Action.Builder(R.drawable.loading_animation2, null, null).build())
.addAction(new Notification.Action.Builder(R.drawable.ic_action_next, null, pendingNext).build());
bldr.addAction(new Notification.Action.Builder(R.drawable.ic_action_previous, "", pendingPrev).build())
.addAction(new Notification.Action.Builder(R.drawable.loading_animation2, "", null).build())
.addAction(new Notification.Action.Builder(R.drawable.ic_action_next, "", pendingNext).build());
} else {
playbackState.setState(isPlaying ? PlaybackState.STATE_PLAYING : PlaybackState.STATE_PAUSED,
MediaController.getInstance().getPlayingMessageObject().audioProgressSec * 1000L,
isPlaying ? 1 : 0)
.setActions(PlaybackState.ACTION_PLAY_PAUSE | PlaybackState.ACTION_PLAY | PlaybackState.ACTION_PAUSE | PlaybackState.ACTION_SKIP_TO_PREVIOUS | PlaybackState.ACTION_SKIP_TO_NEXT);
bldr.addAction(new Notification.Action.Builder(R.drawable.ic_action_previous, null, pendingPrev).build())
.addAction(new Notification.Action.Builder(isPlaying ? R.drawable.ic_action_pause : R.drawable.ic_action_play, null, pendingPlaypause).build())
.addAction(new Notification.Action.Builder(R.drawable.ic_action_next, null, pendingNext).build());
bldr.addAction(new Notification.Action.Builder(R.drawable.ic_action_previous, "", pendingPrev).build())
.addAction(new Notification.Action.Builder(isPlaying ? R.drawable.ic_action_pause : R.drawable.ic_action_play, "", pendingPlaypause).build())
.addAction(new Notification.Action.Builder(R.drawable.ic_action_next, "", pendingNext).build());
}

mediaSession.setPlaybackState(playbackState.build());

22 comments on commit e9e40cb

@mosqueiro

This comment has been minimized.

Copy link

mosqueiro replied Feb 28, 2018

Telegram is no longer open source?

@zikrinullah

This comment has been minimized.

Copy link

zikrinullah replied Mar 26, 2018

I need your email. please email me at bengkelbalap739@gmail.com DrKLO

@daniel-itunu

This comment has been minimized.

Copy link

daniel-itunu replied Mar 26, 2018

Hi hello

@zikrinullah

This comment has been minimized.

Copy link

zikrinullah replied Mar 26, 2018

I need your email. please email me at bengkelbalap739@gmail.com DrKLO

@PattyGeorgi

This comment has been minimized.

Copy link

PattyGeorgi replied Apr 11, 2018

Hello everyone,
does anyone know when version 4.8.5 will be available on github?
Any answer is greatly appreciated :)

@g1hostsilvestre

This comment has been minimized.

Copy link

g1hostsilvestre replied Apr 13, 2018

Does anyone know how to resolve this error?
Cause: executing external native build for ndkBuild C:\Telegram-master\TMessagesProj\jni\Android.mk

telegra

@Younes-L

This comment has been minimized.

Copy link

Younes-L replied Apr 13, 2018

@g1hostsilvestre it's been 14 months and you're still not done spamming your errors here, ffs

@tpimh

This comment has been minimized.

Copy link

tpimh replied Apr 18, 2018

Recently a new version was released on Google Play (version number not incremented), this repo is officially dead

@PattyGeorgi

This comment has been minimized.

Copy link

PattyGeorgi replied Apr 18, 2018

@tpimh thanks for your answer. But how do you know that this repo is dead? Was there an official statement?

@tpimh

This comment has been minimized.

Copy link

tpimh replied Apr 18, 2018

No commits for over 4 months and several binary releases during this time, it's pretty bold official statement. Why the hell they call it "open-source app" while only the source for last year's release is published?

@Younes-L

This comment has been minimized.

Copy link

Younes-L replied Apr 18, 2018

@tpimh I suggest you check the commit history here. There have been times with over 6 months between 2 commits ! It's quite literally the #1 issue with Telegram.

@mosqueiro

This comment has been minimized.

Copy link

mosqueiro replied Apr 18, 2018

I received responses from Telegram support before, but now they no longer respond to any updates.
I believe that this repository is dead, the Telegram got a token and a lot of money with it, it will not continue open source.

@Biftor

This comment has been minimized.

Copy link

Biftor replied Apr 27, 2018

i think @mosqueirois right this repo is dead, i think it's some things about filtering ... they don't want share it!
@DrKLO isn't it?

@johanw666

This comment has been minimized.

Copy link

johanw666 replied May 2, 2018

As if the Russian and Iranian governments could not decompile the apk and study how it is done.

@Biftor

This comment has been minimized.

Copy link

Biftor replied May 11, 2018

No activity? This repo is dead?
I have an unofficial , i really need to know this repo will get update or not? Let me know it

@tuxayo

This comment has been minimized.

Copy link

tuxayo replied Jun 4, 2018

What is the best way to contact them (cordially) about releasing the latest sources? To show that there is interest in the app staying libre/open source.

@mosqueiro

This comment has been minimized.

Copy link

mosqueiro replied Jun 12, 2018

@tuxayo https://twitter.com/durov
I've tried it and it does not respond. Forget, Telegram X is proof that the code will be closed.

@tpimh

This comment has been minimized.

Copy link

tpimh replied Jun 12, 2018

I don't think @durov even read your twit and knows about the issue. We should contact Telegram tech support instead.

@JoshuaDietz

This comment has been minimized.

Copy link

JoshuaDietz replied Jun 12, 2018

I just contacted telegram support, they told me the only reason is there limited time and that there will be a new repo soon. But I can't really understand how they can have such limited time that it's too hard to open a command line and run git push :D

@Younes-L

This comment has been minimized.

Copy link

Younes-L replied Jun 13, 2018

@tpimh I contacted telegram support and they just stop responding when I bring up this topic. Shame.

@paaaa

This comment has been minimized.

Copy link

paaaa replied Jul 21, 2018

**### Jump to other ip can not connect successfully @DrKLO **
/org.telegram.messenger.beta V/FA: Inactivity, disconnecting from the service
07-21 11:47:25.772 28242-28310/org.telegram.messenger.beta D/mytgnet: connection(0x766b1e70, dc2, type 1) disconnected with reason 2
connection(0x766b1e70, dc2, type 1) reconnect
07-21 11:47:26.392 28242-28443/org.telegram.messenger.beta D/dalvikvm: GC_FOR_ALLOC freed 958K, 6% free 17641K/18632K, paused 22ms, total 22ms
07-21 11:47:26.633 28242-28443/org.telegram.messenger.beta W/System.err: java.io.FileNotFoundException: https://google.com
at com.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:186)
at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:246)
at org.telegram.tgnet.ConnectionsManager$DnsLoadTask.doInBackground(ConnectionsManager.java:775)
at org.telegram.tgnet.ConnectionsManager$DnsLoadTask.doInBackground(ConnectionsManager.java:759)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
07-21 11:47:26.643 28242-28443/org.telegram.messenger.beta W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
07-21 11:47:26.783 28242-28310/org.telegram.messenger.beta D/mytgnet: connection(0x766b1e70, dc2, type 1) connecting ()
timer(0x750f0fe0) call
07-21 11:47:27.013 28242-28310/org.telegram.messenger.beta D/mytgnet: got address 104.233.21.22 and port 443 for dc4
wrap in layer 17TL_help_getConfig
dc4 handshake: begin
connection(0x7a977678, dc4, type 1) connecting (104.233.21.22:443)

@tuxayo

This comment has been minimized.

Copy link

tuxayo replied Dec 11, 2018

For the record, there were more or less 6 months of lag since the first non libre version (4.7.0 on December 31, 2017 from what I understand) and the next libre version (4.9.0 on 30 july 2017)

Previous occurrence this kind of issue: 9e4f549#commitcomment-31628211

References:
Commit log: https://github.com/DrKLO/Telegram/commits/master?after=7e327c1e2cf511b472e101ca0948343897757f10+1
PlayStore apk version history: https://www.apk4fun.com/history/6964/

Please sign in to comment.