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
8c9616cb
Commit
8c9616cb
authored
Jun 14, 2014
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch native lib load errors
parent
02a20acc
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
12 deletions
+34
-12
build.gradle
TMessagesProj/build.gradle
+1
-1
Android.mk
TMessagesProj/jni/Android.mk
+1
-0
FileLog.java
...gesProj/src/main/java/org/telegram/messenger/FileLog.java
+1
-1
NativeLoader.java
...oj/src/main/java/org/telegram/messenger/NativeLoader.java
+22
-8
Utilities.java
...sProj/src/main/java/org/telegram/messenger/Utilities.java
+9
-2
No files found.
TMessagesProj/build.gradle
View file @
8c9616cb
...
@@ -81,7 +81,7 @@ android {
...
@@ -81,7 +81,7 @@ android {
defaultConfig
{
defaultConfig
{
minSdkVersion
8
minSdkVersion
8
targetSdkVersion
19
targetSdkVersion
19
versionCode
25
4
versionCode
25
5
versionName
"1.5.3"
versionName
"1.5.3"
}
}
}
}
TMessagesProj/jni/Android.mk
View file @
8c9616cb
LOCAL_PATH := $(call my-dir)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(CLEAR_VARS)
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE := tmessages
LOCAL_MODULE := tmessages
LOCAL_CFLAGS := -w -std=gnu99 -O3 -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
LOCAL_CFLAGS := -w -std=gnu99 -O3 -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64
LOCAL_CFLAGS += -Drestrict='' -D__EMX__ -DOPUS_BUILD -DFIXED_POINT -DUSE_ALLOCA -DHAVE_LRINT -DHAVE_LRINTF -fno-math-errno
LOCAL_CFLAGS += -Drestrict='' -D__EMX__ -DOPUS_BUILD -DFIXED_POINT -DUSE_ALLOCA -DHAVE_LRINT -DHAVE_LRINTF -fno-math-errno
...
...
TMessagesProj/src/main/java/org/telegram/messenger/FileLog.java
View file @
8c9616cb
...
@@ -110,7 +110,7 @@ public class FileLog {
...
@@ -110,7 +110,7 @@ public class FileLog {
}
}
}
}
public
static
void
e
(
final
String
tag
,
final
Exception
e
)
{
public
static
void
e
(
final
String
tag
,
final
Throwable
e
)
{
if
(!
BuildVars
.
DEBUG_VERSION
)
{
if
(!
BuildVars
.
DEBUG_VERSION
)
{
return
;
return
;
}
}
...
...
TMessagesProj/src/main/java/org/telegram/messenger/NativeLoader.java
View file @
8c9616cb
...
@@ -54,6 +54,12 @@ public class NativeLoader {
...
@@ -54,6 +54,12 @@ public class NativeLoader {
return
;
return
;
}
}
try
{
System
.
loadLibrary
(
"jnigraphics"
);
}
catch
(
Error
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
try
{
try
{
String
folder
=
null
;
String
folder
=
null
;
long
libSize
=
0
;
long
libSize
=
0
;
...
@@ -96,8 +102,8 @@ public class NativeLoader {
...
@@ -96,8 +102,8 @@ public class NativeLoader {
System
.
loadLibrary
(
"tmessages"
);
System
.
loadLibrary
(
"tmessages"
);
nativeLoaded
=
true
;
nativeLoaded
=
true
;
return
;
return
;
}
catch
(
E
xception
e
)
{
}
catch
(
E
rror
e
)
{
e
.
printStackTrace
(
);
FileLog
.
e
(
"tmessages"
,
e
);
}
}
}
}
}
}
...
@@ -110,8 +116,8 @@ public class NativeLoader {
...
@@ -110,8 +116,8 @@ public class NativeLoader {
System
.
load
(
destLocalFile
.
getAbsolutePath
());
System
.
load
(
destLocalFile
.
getAbsolutePath
());
nativeLoaded
=
true
;
nativeLoaded
=
true
;
return
;
return
;
}
catch
(
E
xception
e
)
{
}
catch
(
E
rror
e
)
{
e
.
printStackTrace
(
);
FileLog
.
e
(
"tmessages"
,
e
);
}
}
}
else
{
}
else
{
destLocalFile
.
delete
();
destLocalFile
.
delete
();
...
@@ -139,8 +145,12 @@ public class NativeLoader {
...
@@ -139,8 +145,12 @@ public class NativeLoader {
}
}
out
.
close
();
out
.
close
();
try
{
System
.
load
(
destLocalFile
.
getAbsolutePath
());
System
.
load
(
destLocalFile
.
getAbsolutePath
());
nativeLoaded
=
true
;
nativeLoaded
=
true
;
}
catch
(
Error
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
return
;
return
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
FileLog
.
e
(
"tmessages"
,
e
);
...
@@ -164,7 +174,11 @@ public class NativeLoader {
...
@@ -164,7 +174,11 @@ public class NativeLoader {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
try
{
System
.
loadLibrary
(
"tmessages"
);
System
.
loadLibrary
(
"tmessages"
);
nativeLoaded
=
true
;
nativeLoaded
=
true
;
}
catch
(
Error
e
)
{
FileLog
.
e
(
"tmessages"
,
e
);
}
}
}
}
}
TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java
View file @
8c9616cb
...
@@ -262,10 +262,17 @@ public class Utilities {
...
@@ -262,10 +262,17 @@ public class Utilities {
public
static
File
getCacheDir
()
{
public
static
File
getCacheDir
()
{
if
(
externalCacheNotAvailableState
==
1
||
externalCacheNotAvailableState
==
0
&&
Environment
.
getExternalStorageState
().
startsWith
(
Environment
.
MEDIA_MOUNTED
))
{
if
(
externalCacheNotAvailableState
==
1
||
externalCacheNotAvailableState
==
0
&&
Environment
.
getExternalStorageState
().
startsWith
(
Environment
.
MEDIA_MOUNTED
))
{
externalCacheNotAvailableState
=
1
;
externalCacheNotAvailableState
=
1
;
return
ApplicationLoader
.
applicationContext
.
getExternalCacheDir
();
File
file
=
ApplicationLoader
.
applicationContext
.
getExternalCacheDir
();
if
(
file
!=
null
)
{
return
file
;
}
}
}
externalCacheNotAvailableState
=
2
;
externalCacheNotAvailableState
=
2
;
return
ApplicationLoader
.
applicationContext
.
getCacheDir
();
File
file
=
ApplicationLoader
.
applicationContext
.
getCacheDir
();
if
(
file
!=
null
)
{
return
file
;
}
return
new
File
(
""
);
}
}
public
static
String
bytesToHex
(
byte
[]
bytes
)
{
public
static
String
bytesToHex
(
byte
[]
bytes
)
{
...
...
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