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
5141fc1c
Commit
5141fc1c
authored
Mar 23, 2014
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preparation to move dev branch to github
yep, it's finally here
parent
4ede3110
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
126 additions
and
111 deletions
+126
-111
.gitignore
.gitignore
+4
-1
PyroClientAdapter.java
...sProj/src/main/java/jawnae/pyronet/PyroClientAdapter.java
+3
-3
BuildVars.java
...sProj/src/main/java/org/telegram/messenger/BuildVars.java
+18
-0
ConnectionsManager.java
.../main/java/org/telegram/messenger/ConnectionsManager.java
+4
-11
ContactsController.java
.../main/java/org/telegram/messenger/ContactsController.java
+6
-6
FileLog.java
...gesProj/src/main/java/org/telegram/messenger/FileLog.java
+5
-5
ApplicationLoader.java
...Proj/src/main/java/org/telegram/ui/ApplicationLoader.java
+2
-1
LaunchActivity.java
...gesProj/src/main/java/org/telegram/ui/LaunchActivity.java
+4
-3
LoginActivityPhoneView.java
...src/main/java/org/telegram/ui/LoginActivityPhoneView.java
+3
-2
SettingsActivity.java
...sProj/src/main/java/org/telegram/ui/SettingsActivity.java
+3
-2
strings.xml
TMessagesProj/src/main/res/values-it/strings.xml
+74
-77
No files found.
.gitignore
View file @
5141fc1c
.idea/
.gradle/
build/
obj/
*.iml
local.properties
\ No newline at end of file
local.properties
*.keystore
gradle.properties
TMessagesProj/src/main/java/jawnae/pyronet/PyroClientAdapter.java
View file @
5141fc1c
...
...
@@ -18,7 +18,7 @@
package
jawnae
.
pyronet
;
import
org.telegram.messenger.
ConnectionsManager
;
import
org.telegram.messenger.
BuildVars
;
import
org.telegram.messenger.FileLog
;
import
java.io.IOException
;
...
...
@@ -30,14 +30,14 @@ public class PyroClientAdapter implements PyroClientListener {
}
public
void
unconnectableClient
(
PyroClient
client
,
Exception
cause
)
{
if
(
ConnectionsManager
.
DEBUG_VERSION
)
{
if
(
BuildVars
.
DEBUG_VERSION
)
{
FileLog
.
e
(
"tmessages"
,
"unconnectable"
);
}
}
public
void
droppedClient
(
PyroClient
client
,
IOException
cause
)
{
if
(
cause
!=
null
)
{
if
(
ConnectionsManager
.
DEBUG_VERSION
)
{
if
(
BuildVars
.
DEBUG_VERSION
)
{
FileLog
.
e
(
"tmessages"
,
this
.
getClass
().
getSimpleName
()
+
".droppedClient() caught exception: "
+
cause
);
}
}
...
...
TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java
0 → 100644
View file @
5141fc1c
/*
* This is the source code of Telegram for Android v. 1.3.x.
* It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE).
*
* Copyright Nikolai Kudashov, 2013-2014.
*/
package
org
.
telegram
.
messenger
;
public
class
BuildVars
{
public
static
boolean
DEBUG_VERSION
=
true
;
public
static
int
APP_ID
=
2458
;
public
static
String
APP_HASH
=
"5bce48dc7d331e62c955669eb7233217"
;
public
static
String
HOCKEY_APP_HASH
=
"your-hockeyapp-api-key-here"
;
public
static
String
GCM_SENDER_ID
=
"760348033672"
;
public
static
String
SEND_LOGS_EMAIL
=
"email@gmail.com"
;
}
TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java
View file @
5141fc1c
...
...
@@ -30,13 +30,6 @@ import java.util.regex.Matcher;
import
java.util.regex.Pattern
;
public
class
ConnectionsManager
implements
Action
.
ActionDelegate
,
TcpConnection
.
TcpConnectionDelegate
{
public
static
boolean
DEBUG_VERSION
=
true
;
public
static
int
APP_ID
=
2458
;
public
static
String
APP_HASH
=
"5bce48dc7d331e62c955669eb7233217"
;
public
static
String
HOCKEY_APP_HASH
=
"your-hockeyapp-api-key-here"
;
public
static
String
GCM_SENDER_ID
=
"760348033672"
;
public
static
String
SEND_LOGS_EMAIL
=
"email@gmail.com"
;
private
HashMap
<
Integer
,
Datacenter
>
datacenters
=
new
HashMap
<
Integer
,
Datacenter
>();
private
HashMap
<
Long
,
ArrayList
<
Long
>>
processedMessageIdsSet
=
new
HashMap
<
Long
,
ArrayList
<
Long
>>();
private
HashMap
<
Long
,
Integer
>
nextSeqNoInSession
=
new
HashMap
<
Long
,
Integer
>();
...
...
@@ -728,7 +721,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
request
.
initRequest
=
true
;
TLRPC
.
initConnection
invoke
=
new
TLRPC
.
initConnection
();
invoke
.
query
=
object
;
invoke
.
api_id
=
APP_ID
;
invoke
.
api_id
=
BuildVars
.
APP_ID
;
try
{
invoke
.
lang_code
=
Locale
.
getDefault
().
getCountry
();
invoke
.
device_model
=
Build
.
MANUFACTURER
+
Build
.
MODEL
;
...
...
@@ -1637,7 +1630,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
NetworkMessage
networkMessage
=
messages
.
get
(
0
);
TLRPC
.
TL_protoMessage
message
=
networkMessage
.
protoMessage
;
if
(
DEBUG_VERSION
)
{
if
(
BuildVars
.
DEBUG_VERSION
)
{
if
(
message
.
body
instanceof
TLRPC
.
invokeWithLayer12
)
{
FileLog
.
d
(
"tmessages"
,
sessionId
+
":DC"
+
datacenter
.
datacenterId
+
"> Send message ("
+
message
.
seqno
+
", "
+
message
.
msg_id
+
"): "
+
((
TLRPC
.
invokeWithLayer12
)
message
.
body
).
query
);
}
else
if
(
message
.
body
instanceof
TLRPC
.
initConnection
)
{
...
...
@@ -1677,7 +1670,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
for
(
NetworkMessage
networkMessage
:
messages
)
{
TLRPC
.
TL_protoMessage
message
=
networkMessage
.
protoMessage
;
containerMessages
.
add
(
message
);
if
(
DEBUG_VERSION
)
{
if
(
BuildVars
.
DEBUG_VERSION
)
{
if
(
message
.
body
instanceof
TLRPC
.
invokeWithLayer12
)
{
FileLog
.
d
(
"tmessages"
,
sessionId
+
":DC"
+
datacenter
.
datacenterId
+
"> Send message ("
+
message
.
seqno
+
", "
+
message
.
msg_id
+
"): "
+
((
TLRPC
.
invokeWithLayer12
)
message
.
body
).
query
);
}
else
if
(
message
.
body
instanceof
TLRPC
.
initConnection
)
{
...
...
@@ -2445,7 +2438,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
else
{
connectionState
=
1
;
}
if
(
DEBUG_VERSION
)
{
if
(
BuildVars
.
DEBUG_VERSION
)
{
try
{
ConnectivityManager
cm
=
(
ConnectivityManager
)
ApplicationLoader
.
applicationContext
.
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
);
NetworkInfo
[]
networkInfos
=
cm
.
getAllNetworkInfo
();
...
...
TMessagesProj/src/main/java/org/telegram/messenger/ContactsController.java
View file @
5141fc1c
...
...
@@ -514,7 +514,7 @@ public class ContactsController {
Utilities
.
RunOnUIThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
ConnectionsManager
.
DEBUG_VERSION
)
{
if
(
BuildVars
.
DEBUG_VERSION
)
{
FileLog
.
e
(
"tmessages"
,
"need delete contacts"
);
for
(
HashMap
.
Entry
<
Integer
,
Contact
>
c
:
contactHashMap
.
entrySet
())
{
Contact
contact
=
c
.
getValue
();
...
...
@@ -590,7 +590,7 @@ public class ContactsController {
if
(
request
)
{
if
(!
toImport
.
isEmpty
())
{
if
(
ConnectionsManager
.
DEBUG_VERSION
)
{
if
(
BuildVars
.
DEBUG_VERSION
)
{
FileLog
.
e
(
"tmessages"
,
"start import contacts"
);
for
(
TLRPC
.
TL_inputPhoneContact
contact
:
toImport
)
{
FileLog
.
e
(
"tmessages"
,
"add contact "
+
contact
.
first_name
+
" "
+
contact
.
last_name
+
" "
+
contact
.
phone
);
...
...
@@ -613,7 +613,7 @@ public class ContactsController {
MessagesStorage
.
getInstance
().
putCachedPhoneBook
(
contactsMap
);
}
TLRPC
.
TL_contacts_importedContacts
res
=
(
TLRPC
.
TL_contacts_importedContacts
)
response
;
if
(
ConnectionsManager
.
DEBUG_VERSION
)
{
if
(
BuildVars
.
DEBUG_VERSION
)
{
for
(
TLRPC
.
User
user
:
res
.
users
)
{
FileLog
.
e
(
"tmessages"
,
"received user "
+
user
.
first_name
+
" "
+
user
.
last_name
+
" "
+
user
.
phone
);
}
...
...
@@ -776,7 +776,7 @@ public class ContactsController {
if
(
user
!=
null
)
{
usersDict
.
put
(
user
.
id
,
user
);
if
(
ConnectionsManager
.
DEBUG_VERSION
)
{
if
(
BuildVars
.
DEBUG_VERSION
)
{
FileLog
.
e
(
"tmessages"
,
"loaded user contact "
+
user
.
first_name
+
" "
+
user
.
last_name
+
" "
+
user
.
phone
);
}
}
...
...
@@ -1398,7 +1398,7 @@ public class ContactsController {
contactsParams
.
add
(
c
);
req
.
contacts
=
contactsParams
;
req
.
replace
=
false
;
if
(
ConnectionsManager
.
DEBUG_VERSION
)
{
if
(
BuildVars
.
DEBUG_VERSION
)
{
FileLog
.
e
(
"tmessages"
,
"add contact "
+
user
.
first_name
+
" "
+
user
.
last_name
+
" "
+
user
.
phone
);
}
ConnectionsManager
.
getInstance
().
performRpc
(
req
,
new
RPCRequest
.
RPCRequestDelegate
()
{
...
...
@@ -1410,7 +1410,7 @@ public class ContactsController {
final
TLRPC
.
TL_contacts_importedContacts
res
=
(
TLRPC
.
TL_contacts_importedContacts
)
response
;
MessagesStorage
.
getInstance
().
putUsersAndChats
(
res
.
users
,
null
,
true
,
true
);
if
(
ConnectionsManager
.
DEBUG_VERSION
)
{
if
(
BuildVars
.
DEBUG_VERSION
)
{
for
(
TLRPC
.
User
user
:
res
.
users
)
{
FileLog
.
e
(
"tmessages"
,
"received user "
+
user
.
first_name
+
" "
+
user
.
last_name
+
" "
+
user
.
phone
);
}
...
...
TMessagesProj/src/main/java/org/telegram/messenger/FileLog.java
View file @
5141fc1c
...
...
@@ -40,7 +40,7 @@ public class FileLog {
}
public
FileLog
()
{
if
(!
ConnectionsManager
.
DEBUG_VERSION
)
{
if
(!
BuildVars
.
DEBUG_VERSION
)
{
return
;
}
dateFormat
=
FastDateFormat
.
getInstance
(
"dd_MM_yyyy_HH_mm_ss"
,
Locale
.
US
);
...
...
@@ -70,7 +70,7 @@ public class FileLog {
}
public
static
void
e
(
final
String
tag
,
final
String
message
,
final
Throwable
exception
)
{
if
(!
ConnectionsManager
.
DEBUG_VERSION
)
{
if
(!
BuildVars
.
DEBUG_VERSION
)
{
return
;
}
Log
.
e
(
tag
,
message
,
exception
);
...
...
@@ -91,7 +91,7 @@ public class FileLog {
}
public
static
void
e
(
final
String
tag
,
final
String
message
)
{
if
(!
ConnectionsManager
.
DEBUG_VERSION
)
{
if
(!
BuildVars
.
DEBUG_VERSION
)
{
return
;
}
Log
.
e
(
tag
,
message
);
...
...
@@ -111,7 +111,7 @@ public class FileLog {
}
public
static
void
e
(
final
String
tag
,
final
Exception
e
)
{
if
(!
ConnectionsManager
.
DEBUG_VERSION
)
{
if
(!
BuildVars
.
DEBUG_VERSION
)
{
return
;
}
e
.
printStackTrace
();
...
...
@@ -137,7 +137,7 @@ public class FileLog {
}
public
static
void
d
(
final
String
tag
,
final
String
message
)
{
if
(!
ConnectionsManager
.
DEBUG_VERSION
)
{
if
(!
BuildVars
.
DEBUG_VERSION
)
{
return
;
}
Log
.
d
(
tag
,
message
);
...
...
TMessagesProj/src/main/java/org/telegram/ui/ApplicationLoader.java
View file @
5141fc1c
...
...
@@ -27,6 +27,7 @@ import com.google.android.gms.common.ConnectionResult;
import
com.google.android.gms.common.GooglePlayServicesUtil
;
import
com.google.android.gms.gcm.GoogleCloudMessaging
;
import
org.telegram.messenger.BuildVars
;
import
org.telegram.messenger.ConnectionsManager
;
import
org.telegram.messenger.FileLog
;
import
org.telegram.messenger.MessagesController
;
...
...
@@ -228,7 +229,7 @@ public class ApplicationLoader extends Application {
while
(
count
<
1000
)
{
try
{
count
++;
regid
=
gcm
.
register
(
ConnectionsManager
.
GCM_SENDER_ID
);
regid
=
gcm
.
register
(
BuildVars
.
GCM_SENDER_ID
);
sendRegistrationIdToBackend
(
true
);
storeRegistrationId
(
applicationContext
,
regid
);
return
true
;
...
...
TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java
View file @
5141fc1c
...
...
@@ -35,6 +35,7 @@ import android.widget.TextView;
import
android.widget.Toast
;
import
org.telegram.PhoneFormat.PhoneFormat
;
import
org.telegram.messenger.BuildVars
;
import
org.telegram.messenger.ConnectionsManager
;
import
org.telegram.messenger.FileLog
;
import
org.telegram.messenger.MessagesController
;
...
...
@@ -526,12 +527,12 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
}
private
void
checkForCrashes
()
{
CrashManager
.
register
(
this
,
ConnectionsManager
.
HOCKEY_APP_HASH
);
CrashManager
.
register
(
this
,
BuildVars
.
HOCKEY_APP_HASH
);
}
private
void
checkForUpdates
()
{
if
(
ConnectionsManager
.
DEBUG_VERSION
)
{
UpdateManager
.
register
(
this
,
ConnectionsManager
.
HOCKEY_APP_HASH
);
if
(
BuildVars
.
DEBUG_VERSION
)
{
UpdateManager
.
register
(
this
,
BuildVars
.
HOCKEY_APP_HASH
);
}
}
...
...
TMessagesProj/src/main/java/org/telegram/ui/LoginActivityPhoneView.java
View file @
5141fc1c
...
...
@@ -26,6 +26,7 @@ import android.widget.EditText;
import
android.widget.TextView
;
import
org.telegram.PhoneFormat.PhoneFormat
;
import
org.telegram.messenger.BuildVars
;
import
org.telegram.messenger.LocaleController
;
import
org.telegram.messenger.TLObject
;
import
org.telegram.messenger.TLRPC
;
...
...
@@ -328,8 +329,8 @@ public class LoginActivityPhoneView extends SlideView implements AdapterView.OnI
TLRPC
.
TL_auth_sendCode
req
=
new
TLRPC
.
TL_auth_sendCode
();
String
phone
=
PhoneFormat
.
stripExceptNumbers
(
""
+
codeField
.
getText
()
+
phoneField
.
getText
());
ConnectionsManager
.
getInstance
().
applyCountryPortNumber
(
phone
);
req
.
api_hash
=
ConnectionsManager
.
APP_HASH
;
req
.
api_id
=
ConnectionsManager
.
APP_ID
;
req
.
api_hash
=
BuildVars
.
APP_HASH
;
req
.
api_id
=
BuildVars
.
APP_ID
;
req
.
sms_type
=
0
;
req
.
phone_number
=
phone
;
req
.
lang_code
=
Locale
.
getDefault
().
getCountry
();
...
...
TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java
View file @
5141fc1c
...
...
@@ -34,6 +34,7 @@ import android.widget.TextView;
import
android.widget.Toast
;
import
org.telegram.PhoneFormat.PhoneFormat
;
import
org.telegram.messenger.BuildVars
;
import
org.telegram.messenger.LocaleController
;
import
org.telegram.messenger.SerializedData
;
import
org.telegram.messenger.TLClassStore
;
...
...
@@ -169,7 +170,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
textSizeRow
=
rowCount
++;
sendByEnterRow
=
rowCount
++;
supportSectionRow
=
rowCount
++;
if
(
ConnectionsManager
.
DEBUG_VERSION
)
{
if
(
BuildVars
.
DEBUG_VERSION
)
{
sendLogsRow
=
rowCount
++;
clearLogsRow
=
rowCount
++;
}
...
...
@@ -484,7 +485,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
}
Intent
i
=
new
Intent
(
Intent
.
ACTION_SEND_MULTIPLE
);
i
.
setType
(
"message/rfc822"
)
;
i
.
putExtra
(
Intent
.
EXTRA_EMAIL
,
new
String
[]{
ConnectionsManager
.
SEND_LOGS_EMAIL
});
i
.
putExtra
(
Intent
.
EXTRA_EMAIL
,
new
String
[]{
BuildVars
.
SEND_LOGS_EMAIL
});
i
.
putExtra
(
Intent
.
EXTRA_SUBJECT
,
"last logs"
);
i
.
putParcelableArrayListExtra
(
Intent
.
EXTRA_STREAM
,
uris
);
startActivity
(
Intent
.
createChooser
(
i
,
"Select email application."
));
...
...
TMessagesProj/src/main/res/values-it/strings.xml
View file @
5141fc1c
This diff is collapsed.
Click to expand it.
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