Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apk
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
apk
Commits
02c8efb0
Commit
02c8efb0
authored
Dec 23, 2013
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update to 1.3.4
parent
5aee72ee
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
96 additions
and
17 deletions
+96
-17
AndroidManifest.xml
TMessagesProj/src/main/AndroidManifest.xml
+2
-2
ExportAuthorizationAction.java
...ava/org/telegram/messenger/ExportAuthorizationAction.java
+6
-0
HandshakeAction.java
...src/main/java/org/telegram/messenger/HandshakeAction.java
+8
-2
MessagesController.java
.../main/java/org/telegram/messenger/MessagesController.java
+20
-0
TcpConnection.java
...j/src/main/java/org/telegram/messenger/TcpConnection.java
+8
-0
Utilities.java
...sProj/src/main/java/org/telegram/messenger/Utilities.java
+37
-0
ChatProfileActivity.java
...oj/src/main/java/org/telegram/ui/ChatProfileActivity.java
+3
-0
LoginActivity.java
...agesProj/src/main/java/org/telegram/ui/LoginActivity.java
+2
-6
UserProfileActivity.java
...oj/src/main/java/org/telegram/ui/UserProfileActivity.java
+4
-3
SizeNotifierRelativeLayout.java
...ava/org/telegram/ui/Views/SizeNotifierRelativeLayout.java
+6
-4
No files found.
TMessagesProj/src/main/AndroidManifest.xml
View file @
02c8efb0
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"org.telegram.messenger"
android:versionCode=
"12
2
"
android:versionName=
"1.3.
2
"
>
android:versionCode=
"12
6
"
android:versionName=
"1.3.
4
"
>
<supports-screens
android:anyDensity=
"true"
android:smallScreens=
"true"
...
...
TMessagesProj/src/main/java/org/telegram/messenger/ExportAuthorizationAction.java
View file @
02c8efb0
...
...
@@ -37,6 +37,9 @@ public class ExportAuthorizationAction extends Action {
ConnectionsManager
.
Instance
.
performRpc
(
exportAuthorization
,
new
RPCRequest
.
RPCRequestDelegate
()
{
@Override
public
void
run
(
TLObject
response
,
TLRPC
.
TL_error
error
)
{
if
(
delegate
==
null
)
{
return
;
}
if
(
error
==
null
)
{
exportedAuthorization
=
(
TLRPC
.
TL_auth_exportedAuthorization
)
response
;
beginImport
();
...
...
@@ -65,6 +68,9 @@ public class ExportAuthorizationAction extends Action {
ConnectionsManager
.
Instance
.
performRpc
(
importAuthorization
,
new
RPCRequest
.
RPCRequestDelegate
()
{
@Override
public
void
run
(
TLObject
response
,
TLRPC
.
TL_error
error
)
{
if
(
delegate
==
null
)
{
return
;
}
if
(
error
==
null
)
{
delegate
.
ActionDidFinishExecution
(
ExportAuthorizationAction
.
this
,
null
);
}
else
{
...
...
TMessagesProj/src/main/java/org/telegram/messenger/HandshakeAction.java
View file @
02c8efb0
...
...
@@ -178,6 +178,7 @@ public class HandshakeAction extends Action implements TcpConnection.TcpConnecti
Utilities
.
globalQueue
.
postRunnable
(
new
Runnable
()
{
@Override
public
void
run
()
{
final
Utilities
.
TPFactorizedValue
factorizedPq
=
Utilities
.
getFactorizedValue
(
pqf
);
Utilities
.
stageQueue
.
postRunnable
(
new
Runnable
()
{
...
...
@@ -323,6 +324,10 @@ public class HandshakeAction extends Action implements TcpConnection.TcpConnecti
return
;
}
if
(!
Utilities
.
isGoodPrime
(
dhInnerData
.
dh_prime
))
{
throw
new
RuntimeException
(
"bad prime"
);
}
if
(!
Arrays
.
equals
(
authNonce
,
dhInnerData
.
nonce
))
{
FileLog
.
e
(
"tmessages"
,
"***** Invalid DH nonce"
);
beginHandshake
(
false
);
...
...
@@ -339,12 +344,13 @@ public class HandshakeAction extends Action implements TcpConnection.TcpConnecti
b
[
a
]
=
(
byte
)(
MessagesController
.
random
.
nextDouble
()
*
255
);
}
BigInteger
dhBI
=
new
BigInteger
(
1
,
dhInnerData
.
dh_prime
);
BigInteger
i_g_b
=
BigInteger
.
valueOf
(
dhInnerData
.
g
);
i_g_b
=
i_g_b
.
modPow
(
new
BigInteger
(
1
,
b
),
new
BigInteger
(
1
,
dhInnerData
.
dh_prime
)
);
i_g_b
=
i_g_b
.
modPow
(
new
BigInteger
(
1
,
b
),
dhBI
);
byte
[]
g_b
=
i_g_b
.
toByteArray
();
BigInteger
i_authKey
=
new
BigInteger
(
1
,
dhInnerData
.
g_a
);
i_authKey
=
i_authKey
.
modPow
(
new
BigInteger
(
1
,
b
),
new
BigInteger
(
1
,
dhInnerData
.
dh_prime
)
);
i_authKey
=
i_authKey
.
modPow
(
new
BigInteger
(
1
,
b
),
dhBI
);
authKey
=
i_authKey
.
toByteArray
();
if
(
authKey
.
length
>
256
)
{
...
...
TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java
View file @
02c8efb0
...
...
@@ -1224,6 +1224,9 @@ public class MessagesController implements NotificationCenter.NotificationCenter
for
(
TLRPC
.
TL_contact
value
:
contactsArr
)
{
TLRPC
.
User
user
=
usersDict
.
get
(
value
.
user_id
);
if
(
user
==
null
)
{
continue
;
}
contactsDictionery
.
put
(
value
.
user_id
,
value
);
contactsPhones
.
put
(
user
.
phone
,
value
);
...
...
@@ -4880,6 +4883,12 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if
(
error
==
null
)
{
TLRPC
.
messages_DhConfig
res
=
(
TLRPC
.
messages_DhConfig
)
response
;
if
(
response
instanceof
TLRPC
.
TL_messages_dhConfig
)
{
if
(!
Utilities
.
isGoodPrime
(
res
.
p
))
{
acceptingChats
.
remove
(
encryptedChat
.
id
);
declineSecretChat
(
encryptedChat
.
id
);
return
;
}
MessagesStorage
.
secretPBytes
=
res
.
p
;
MessagesStorage
.
secretG
=
res
.
g
;
MessagesStorage
.
lastSecretVersion
=
res
.
version
;
...
...
@@ -4967,6 +4976,17 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if
(
error
==
null
)
{
TLRPC
.
messages_DhConfig
res
=
(
TLRPC
.
messages_DhConfig
)
response
;
if
(
response
instanceof
TLRPC
.
TL_messages_dhConfig
)
{
if
(!
Utilities
.
isGoodPrime
(
res
.
p
))
{
Utilities
.
RunOnUIThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(!((
ActionBarActivity
)
context
).
isFinishing
())
{
progressDialog
.
dismiss
();
}
}
});
return
;
}
MessagesStorage
.
secretPBytes
=
res
.
p
;
MessagesStorage
.
secretG
=
res
.
g
;
MessagesStorage
.
lastSecretVersion
=
res
.
version
;
...
...
TMessagesProj/src/main/java/org/telegram/messenger/TcpConnection.java
View file @
02c8efb0
...
...
@@ -85,6 +85,14 @@ public class TcpConnection extends PyroClientAdapter {
connectionState
=
TcpConnectionState
.
TcpConnectionStageConnecting
;
try
{
try
{
if
(
reconnectTimer
!=
null
)
{
reconnectTimer
.
cancel
();
reconnectTimer
=
null
;
}
}
catch
(
Exception
e2
)
{
FileLog
.
e
(
"tmessages"
,
e2
);
}
Datacenter
datacenter
=
ConnectionsManager
.
Instance
.
datacenterWithId
(
datacenterId
);
hostAddress
=
datacenter
.
getCurrentAddress
();
hostPort
=
datacenter
.
getCurrentPort
();
...
...
TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java
View file @
02c8efb0
...
...
@@ -55,6 +55,10 @@ public class Utilities {
public
static
int
statusBarHeight
=
0
;
private
final
static
Integer
lock
=
1
;
public
static
String
[]
goodPrimes
=
{
"C71CAEB9C6B1C9048E6C522F70F13F73980D40238E3E21C14934D037563D930F48198A0AA7C14058229493D22530F4DBFA336F6E0AC925139543AED44CCE7C3720FD51F69458705AC68CD4FE6B6B13ABDC9746512969328454F18FAF8C595F642477FE96BB2A941D5BCD1D4AC8CC49880708FA9B378E3C4F3A9060BEE67CF9A4A4A695811051907E162753B56B0F6B410DBA74D8A84B2A14B3144E0EF1284754FD17ED950D5965B4B9DD46582DB1178D169C6BC465B0D6FF9CA3928FEF5B9AE4E418FC15E83EBEA0F87FA9FF5EED70050DED2849F47BF959D956850CE929851F0D8115F635B105EE2E4E15D04B2454BF6F4FADF034B10403119CD8E3B92FCC5B"
};
public
static
class
TPFactorizedValue
{
public
long
p
,
q
;
}
...
...
@@ -84,6 +88,39 @@ public class Utilities {
return
ApplicationLoader
.
applicationContext
.
getCacheDir
();
}
final
protected
static
char
[]
hexArray
=
"0123456789ABCDEF"
.
toCharArray
();
public
static
String
bytesToHex
(
byte
[]
bytes
)
{
char
[]
hexChars
=
new
char
[
bytes
.
length
*
2
];
int
v
;
for
(
int
j
=
0
;
j
<
bytes
.
length
;
j
++
)
{
v
=
bytes
[
j
]
&
0xFF
;
hexChars
[
j
*
2
]
=
hexArray
[
v
>>>
4
];
hexChars
[
j
*
2
+
1
]
=
hexArray
[
v
&
0x0F
];
}
return
new
String
(
hexChars
);
}
public
static
boolean
isGoodPrime
(
byte
[]
prime
)
{
String
hex
=
bytesToHex
(
prime
);
for
(
String
cached
:
goodPrimes
)
{
if
(
cached
.
equals
(
hex
))
{
return
true
;
}
}
if
(
prime
.
length
!=
256
||
prime
[
0
]
>=
0
)
{
return
false
;
}
BigInteger
dhBI
=
new
BigInteger
(
1
,
prime
);
BigInteger
dhBI2
=
dhBI
.
subtract
(
BigInteger
.
valueOf
(
1
)).
divide
(
BigInteger
.
valueOf
(
2
));
if
(!
dhBI
.
isProbablePrime
(
30
)
||
!
dhBI2
.
isProbablePrime
(
30
))
{
return
false
;
}
return
true
;
}
public
static
TPFactorizedValue
getFactorizedValue
(
long
what
)
{
long
g
=
doPQNative
(
what
);
if
(
g
>
1
&&
g
<
what
)
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java
View file @
02c8efb0
...
...
@@ -410,6 +410,9 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
private
void
processPhotoMenu
(
int
action
)
{
if
(
action
==
0
)
{
if
(
parentActivity
==
null
)
{
return
;
}
TLRPC
.
Chat
chat
=
MessagesController
.
Instance
.
chats
.
get
(
chat_id
);
if
(
chat
.
photo
!=
null
&&
chat
.
photo
.
photo_big
!=
null
)
{
NotificationCenter
.
Instance
.
addToMemCache
(
53
,
chat
.
photo
.
photo_big
);
...
...
TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java
View file @
02c8efb0
...
...
@@ -157,14 +157,10 @@ public class LoginActivity extends ActionBarActivity implements SlideView.SlideV
}
public
void
setPage
(
int
page
,
boolean
animated
,
Bundle
params
,
boolean
back
)
{
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>
1
1
)
{
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>
1
3
)
{
Point
displaySize
=
new
Point
();
Display
display
=
getWindowManager
().
getDefaultDisplay
();
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
<
13
)
{
displaySize
.
set
(
display
.
getWidth
(),
display
.
getHeight
());
}
else
{
display
.
getSize
(
displaySize
);
}
final
SlideView
outView
=
views
[
currentViewNum
];
final
SlideView
newView
=
views
[
page
];
...
...
TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java
View file @
02c8efb0
...
...
@@ -257,9 +257,11 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
String
name
=
null
;
if
(
ringtone
!=
null
)
{
Ringtone
rng
=
RingtoneManager
.
getRingtone
(
ApplicationLoader
.
applicationContext
,
ringtone
);
if
(
rng
!=
null
)
{
name
=
rng
.
getTitle
(
ApplicationLoader
.
applicationContext
);
rng
.
stop
();
}
}
SharedPreferences
preferences
=
ApplicationLoader
.
applicationContext
.
getSharedPreferences
(
"Notifications"
,
Activity
.
MODE_PRIVATE
);
SharedPreferences
.
Editor
editor
=
preferences
.
edit
();
...
...
@@ -276,7 +278,6 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
editor
.
commit
();
listView
.
invalidateViews
();
}
}
public
void
didReceivedNotification
(
int
id
,
Object
...
args
)
{
...
...
TMessagesProj/src/main/java/org/telegram/ui/Views/SizeNotifierRelativeLayout.java
View file @
02c8efb0
...
...
@@ -39,9 +39,11 @@ public class SizeNotifierRelativeLayout extends RelativeLayout {
@Override
protected
void
onLayout
(
boolean
changed
,
int
l
,
int
t
,
int
r
,
int
b
)
{
super
.
onLayout
(
changed
,
l
,
t
,
r
,
b
);
if
(
delegate
!=
null
)
{
int
usableViewHeight
=
this
.
getRootView
().
getHeight
()
-
Utilities
.
statusBarHeight
;
this
.
getWindowVisibleDisplayFrame
(
rect
);
int
keyboardHeight
=
usableViewHeight
-
(
rect
.
bottom
-
rect
.
top
);
delegate
.
onSizeChanged
(
keyboardHeight
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment