Skip to content

Commit 8233e89

Browse files
author
DrKLO
committed
Perfect forward secrecy in secret chats, phone change, telegram.me links support
1 parent 95de265 commit 8233e89

File tree

142 files changed

+4813
-2305
lines changed

Some content is hidden

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

142 files changed

+4813
-2305
lines changed

TMessagesProj/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ android {
8080
defaultConfig {
8181
minSdkVersion 8
8282
targetSdkVersion 21
83-
versionCode 397
84-
versionName "2.0.5"
83+
versionCode 403
84+
versionName "2.1.0"
8585
}
8686
}

TMessagesProj/config/debug/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
android:icon="@drawable/ic_launcher"
2424
android:label="@string/AppName"
2525
android:theme="@style/Theme.TMessages.Start"
26-
android:name="org.telegram.ui.ApplicationLoader"
26+
android:name=".ApplicationLoader"
2727
android:hardwareAccelerated="true"
2828
android:largeHeap="true">
2929

TMessagesProj/config/foss/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
android:icon="@drawable/ic_launcher"
99
android:label="@string/AppName"
1010
android:theme="@style/Theme.TMessages.Start"
11-
android:name="org.telegram.ui.ApplicationLoader"
11+
android:name=".ApplicationLoader"
1212
android:hardwareAccelerated="true"
1313
android:largeHeap="true">
1414

TMessagesProj/config/release/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
android:icon="@drawable/ic_launcher"
2424
android:label="@string/AppName"
2525
android:theme="@style/Theme.TMessages.Start"
26-
android:name="org.telegram.ui.ApplicationLoader"
26+
android:name=".ApplicationLoader"
2727
android:hardwareAccelerated="true"
2828
android:largeHeap="true">
2929

TMessagesProj/jni/Android.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ LOCAL_PATH := $(call my-dir)
22

33
include $(CLEAR_VARS)
44
LOCAL_PRELINK_MODULE := false
5-
LOCAL_MODULE := tmessages.3
5+
LOCAL_MODULE := tmessages.4
66
LOCAL_CFLAGS := -w -std=gnu99 -O2 -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
77
LOCAL_CFLAGS += -Drestrict='' -D__EMX__ -DOPUS_BUILD -DFIXED_POINT -DUSE_ALLOCA -DHAVE_LRINT -DHAVE_LRINTF -fno-math-errno
88
LOCAL_CFLAGS += -DANDROID_NDK -DDISABLE_IMPORTGL -fno-strict-aliasing -fprefetch-loop-arrays -DAVOID_TABLES -DANDROID_TILE_BASED_DECODE -DANDROID_ARMV6_IDCT -DHAVE_STRCHRNUL=0

TMessagesProj/jni/gif.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ static jint open(GifFileType *GifFileIn, int Error, int startPos, JNIEnv *env, j
589589
return (jint)(Error == 0 ? info : NULL);
590590
}
591591

592-
JNIEXPORT jlong JNICALL Java_org_telegram_ui_Views_GifDrawable_getAllocationByteCount(JNIEnv *env, jclass class, jobject gifInfo) {
592+
JNIEXPORT jlong JNICALL Java_org_telegram_ui_Components_GifDrawable_getAllocationByteCount(JNIEnv *env, jclass class, jobject gifInfo) {
593593
GifInfo *info = (GifInfo *)gifInfo;
594594
if (info == NULL) {
595595
return 0;
@@ -602,23 +602,23 @@ JNIEXPORT jlong JNICALL Java_org_telegram_ui_Views_GifDrawable_getAllocationByte
602602
return sum;
603603
}
604604

605-
JNIEXPORT void JNICALL Java_org_telegram_ui_Views_GifDrawable_reset(JNIEnv *env, jclass class, jobject gifInfo) {
605+
JNIEXPORT void JNICALL Java_org_telegram_ui_Components_GifDrawable_reset(JNIEnv *env, jclass class, jobject gifInfo) {
606606
GifInfo *info = (GifInfo *)gifInfo;
607607
if (info == NULL) {
608608
return;
609609
}
610610
reset(info);
611611
}
612612

613-
JNIEXPORT void JNICALL Java_org_telegram_ui_Views_GifDrawable_setSpeedFactor(JNIEnv *env, jclass class, jobject gifInfo, jfloat factor) {
613+
JNIEXPORT void JNICALL Java_org_telegram_ui_Components_GifDrawable_setSpeedFactor(JNIEnv *env, jclass class, jobject gifInfo, jfloat factor) {
614614
GifInfo *info = (GifInfo *)gifInfo;
615615
if (info == NULL) {
616616
return;
617617
}
618618
info->speedFactor = factor;
619619
}
620620

621-
JNIEXPORT void JNICALL Java_org_telegram_ui_Views_GifDrawable_seekToTime(JNIEnv *env, jclass class, jobject gifInfo, jint desiredPos, jintArray jPixels) {
621+
JNIEXPORT void JNICALL Java_org_telegram_ui_Components_GifDrawable_seekToTime(JNIEnv *env, jclass class, jobject gifInfo, jint desiredPos, jintArray jPixels) {
622622
GifInfo *info = (GifInfo *)gifInfo;
623623
if (info == NULL || jPixels == NULL) {
624624
return;
@@ -665,7 +665,7 @@ JNIEXPORT void JNICALL Java_org_telegram_ui_Views_GifDrawable_seekToTime(JNIEnv
665665
}
666666
}
667667

668-
JNIEXPORT void JNICALL Java_org_telegram_ui_Views_GifDrawable_seekToFrame(JNIEnv *env, jclass class, jobject gifInfo, jint desiredIdx, jintArray jPixels) {
668+
JNIEXPORT void JNICALL Java_org_telegram_ui_Components_GifDrawable_seekToFrame(JNIEnv *env, jclass class, jobject gifInfo, jint desiredIdx, jintArray jPixels) {
669669
GifInfo *info = (GifInfo *)gifInfo;
670670
if (info == NULL|| jPixels==NULL) {
671671
return;
@@ -701,7 +701,7 @@ JNIEXPORT void JNICALL Java_org_telegram_ui_Views_GifDrawable_seekToFrame(JNIEnv
701701
}
702702
}
703703

704-
JNIEXPORT void JNICALL Java_org_telegram_ui_Views_GifDrawable_renderFrame(JNIEnv *env, jclass class, jintArray jPixels, jobject gifInfo, jintArray metaData) {
704+
JNIEXPORT void JNICALL Java_org_telegram_ui_Components_GifDrawable_renderFrame(JNIEnv *env, jclass class, jintArray jPixels, jobject gifInfo, jintArray metaData) {
705705
GifInfo *info = (GifInfo *)gifInfo;
706706
if (info == NULL || jPixels == NULL) {
707707
return;
@@ -752,7 +752,7 @@ JNIEXPORT void JNICALL Java_org_telegram_ui_Views_GifDrawable_renderFrame(JNIEnv
752752
(*env)->ReleaseIntArrayElements(env, metaData, rawMetaData, 0);
753753
}
754754

755-
JNIEXPORT void JNICALL Java_org_telegram_ui_Views_GifDrawable_free(JNIEnv *env, jclass class, jobject gifInfo) {
755+
JNIEXPORT void JNICALL Java_org_telegram_ui_Components_GifDrawable_free(JNIEnv *env, jclass class, jobject gifInfo) {
756756
if (gifInfo == NULL) {
757757
return;
758758
}
@@ -765,22 +765,22 @@ JNIEXPORT void JNICALL Java_org_telegram_ui_Views_GifDrawable_free(JNIEnv *env,
765765
cleanUp(info);
766766
}
767767

768-
JNIEXPORT jstring JNICALL Java_org_telegram_ui_Views_GifDrawable_getComment(JNIEnv *env, jclass class, jobject gifInfo) {
768+
JNIEXPORT jstring JNICALL Java_org_telegram_ui_Components_GifDrawable_getComment(JNIEnv *env, jclass class, jobject gifInfo) {
769769
if (gifInfo == NULL) {
770770
return NULL;
771771
}
772772
GifInfo *info = (GifInfo *)gifInfo;
773773
return (*env)->NewStringUTF(env, info->comment);
774774
}
775775

776-
JNIEXPORT jint JNICALL Java_org_telegram_ui_Views_GifDrawable_getLoopCount(JNIEnv *env, jclass class, jobject gifInfo) {
776+
JNIEXPORT jint JNICALL Java_org_telegram_ui_Components_GifDrawable_getLoopCount(JNIEnv *env, jclass class, jobject gifInfo) {
777777
if (gifInfo == NULL) {
778778
return 0;
779779
}
780780
return ((GifInfo *)gifInfo)->loopCount;
781781
}
782782

783-
JNIEXPORT jint JNICALL Java_org_telegram_ui_Views_GifDrawable_getDuration(JNIEnv *env, jclass class, jobject gifInfo) {
783+
JNIEXPORT jint JNICALL Java_org_telegram_ui_Components_GifDrawable_getDuration(JNIEnv *env, jclass class, jobject gifInfo) {
784784
GifInfo *info = (GifInfo *)gifInfo;
785785
if (info == NULL) {
786786
return 0;
@@ -793,7 +793,7 @@ JNIEXPORT jint JNICALL Java_org_telegram_ui_Views_GifDrawable_getDuration(JNIEnv
793793
return sum;
794794
}
795795

796-
JNIEXPORT jint JNICALL Java_org_telegram_ui_Views_GifDrawable_getCurrentPosition(JNIEnv *env, jclass class, jobject gifInfo) {
796+
JNIEXPORT jint JNICALL Java_org_telegram_ui_Components_GifDrawable_getCurrentPosition(JNIEnv *env, jclass class, jobject gifInfo) {
797797
GifInfo *info = (GifInfo *)gifInfo;
798798
if (info == NULL) {
799799
return 0;
@@ -811,15 +811,15 @@ JNIEXPORT jint JNICALL Java_org_telegram_ui_Views_GifDrawable_getCurrentPosition
811811
return (int) (sum + remainder);
812812
}
813813

814-
JNIEXPORT void JNICALL Java_org_telegram_ui_Views_GifDrawable_saveRemainder(JNIEnv *env, jclass class, jobject gifInfo) {
814+
JNIEXPORT void JNICALL Java_org_telegram_ui_Components_GifDrawable_saveRemainder(JNIEnv *env, jclass class, jobject gifInfo) {
815815
GifInfo *info = (GifInfo *)gifInfo;
816816
if (info == NULL) {
817817
return;
818818
}
819819
info->lastFrameReaminder = getRealTime() - info->nextStartTime;
820820
}
821821

822-
JNIEXPORT void JNICALL Java_org_telegram_ui_Views_GifDrawable_restoreRemainder(JNIEnv *env, jclass class, jobject gifInfo) {
822+
JNIEXPORT void JNICALL Java_org_telegram_ui_Components_GifDrawable_restoreRemainder(JNIEnv *env, jclass class, jobject gifInfo) {
823823
GifInfo *info = (GifInfo *)gifInfo;
824824
if (info == NULL || info->lastFrameReaminder == ULONG_MAX) {
825825
return;
@@ -828,7 +828,7 @@ JNIEXPORT void JNICALL Java_org_telegram_ui_Views_GifDrawable_restoreRemainder(J
828828
info->lastFrameReaminder = ULONG_MAX;
829829
}
830830

831-
JNIEXPORT jint JNICALL Java_org_telegram_ui_Views_GifDrawable_openFile(JNIEnv *env, jclass class, jintArray metaData, jstring jfname) {
831+
JNIEXPORT jint JNICALL Java_org_telegram_ui_Components_GifDrawable_openFile(JNIEnv *env, jclass class, jintArray metaData, jstring jfname) {
832832
if (jfname == NULL) {
833833
setMetaData(0, 0, 0, D_GIF_ERR_OPEN_FAILED, env, metaData);
834834
return (jint) NULL;

TMessagesProj/src/main/AndroidManifest.xml

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
android:installLocation="auto">
55

66
<supports-screens android:anyDensity="true"
7-
android:smallScreens="true"
8-
android:normalScreens="true"
97
android:largeScreens="true"
8+
android:normalScreens="true"
109
android:resizeable="true"
10+
android:smallScreens="true"
1111
android:xlargeScreens="true"/>
1212

1313
<uses-feature android:glEsVersion="0x00020000" android:required="false"/>
@@ -41,20 +41,20 @@
4141
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
4242

4343
<application
44+
android:name=".ApplicationLoader"
4445
android:allowBackup="false"
46+
android:hardwareAccelerated="true"
4547
android:icon="@drawable/ic_launcher"
4648
android:label="@string/AppName"
47-
android:theme="@style/Theme.TMessages.Start"
48-
android:name="org.telegram.ui.ApplicationLoader"
49-
android:hardwareAccelerated="true"
50-
android:largeHeap="true">
49+
android:largeHeap="true"
50+
android:theme="@style/Theme.TMessages.Start">
5151

5252
<activity
5353
android:name="org.telegram.ui.LaunchActivity"
54-
android:windowSoftInputMode="adjustPan"
54+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
5555
android:hardwareAccelerated="true"
5656
android:launchMode="singleTask"
57-
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
57+
android:windowSoftInputMode="adjustPan">
5858
<intent-filter>
5959
<action android:name="android.intent.action.MAIN" />
6060
<category android:name="android.intent.category.LAUNCHER" />
@@ -95,6 +95,19 @@
9595
<category android:name="android.intent.category.DEFAULT"/>
9696
<data android:mimeType="vnd.android.cursor.item/vnd.org.telegram.messenger.android.profile"/>
9797
</intent-filter>
98+
<intent-filter>
99+
<action android:name="android.intent.action.VIEW"/>
100+
<category android:name="android.intent.category.DEFAULT" />
101+
<category android:name="android.intent.category.BROWSABLE" />
102+
<data android:host="telegram.me" android:scheme="http" />
103+
<data android:host="telegram.me" android:scheme="https" />
104+
</intent-filter>
105+
<intent-filter android:icon="@drawable/ic_launcher" android:priority="1">
106+
<action android:name="android.intent.action.VIEW" />
107+
<category android:name="android.intent.category.BROWSABLE" />
108+
<category android:name="android.intent.category.DEFAULT" />
109+
<data android:scheme="tg" />
110+
</intent-filter>
98111
</activity>
99112
<activity
100113
android:name="org.telegram.ui.IntroActivity"
@@ -105,9 +118,9 @@
105118
android:configChanges="keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
106119
android:excludeFromRecents="true"
107120
android:launchMode="singleTask"
108-
android:windowSoftInputMode="adjustResize|stateHidden"
109121
android:taskAffinity=""
110-
android:theme="@style/Theme.TMessages.PopupNotification">
122+
android:theme="@style/Theme.TMessages.PopupNotification"
123+
android:windowSoftInputMode="adjustResize|stateHidden">
111124
</activity>
112125

113126
<receiver android:name="org.telegram.android.SmsListener">
@@ -116,17 +129,15 @@
116129
</intent-filter>
117130
</receiver>
118131

119-
<service android:name="org.telegram.android.AuthenticatorService"
120-
android:exported="true">
132+
<service android:name="org.telegram.android.AuthenticatorService" android:exported="true">
121133
<intent-filter>
122134
<action android:name="android.accounts.AccountAuthenticator"/>
123135
</intent-filter>
124136
<meta-data android:name="android.accounts.AccountAuthenticator"
125137
android:resource="@xml/auth"/>
126138
</service>
127139

128-
<service android:name="org.telegram.android.ContactsSyncAdapterService"
129-
android:exported="true">
140+
<service android:name="org.telegram.android.ContactsSyncAdapterService" android:exported="true">
130141
<intent-filter>
131142
<action android:name="android.content.SyncAdapter" />
132143
</intent-filter>

0 commit comments

Comments
 (0)