diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 9e95adf0a..0828c0d93 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -81,7 +81,7 @@ android { defaultConfig { minSdkVersion 8 targetSdkVersion 19 - versionCode 254 + versionCode 255 versionName "1.5.3" } } diff --git a/TMessagesProj/jni/Android.mk b/TMessagesProj/jni/Android.mk index 2a4ee466a..ede2b4e60 100755 --- a/TMessagesProj/jni/Android.mk +++ b/TMessagesProj/jni/Android.mk @@ -1,6 +1,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) +LOCAL_PRELINK_MODULE := false 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 += -Drestrict='' -D__EMX__ -DOPUS_BUILD -DFIXED_POINT -DUSE_ALLOCA -DHAVE_LRINT -DHAVE_LRINTF -fno-math-errno diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/FileLog.java b/TMessagesProj/src/main/java/org/telegram/messenger/FileLog.java index 7daea61f7..0b15d2d72 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/FileLog.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/FileLog.java @@ -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) { return; } diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/NativeLoader.java b/TMessagesProj/src/main/java/org/telegram/messenger/NativeLoader.java index 6c3b014e3..31f65ed6d 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/NativeLoader.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/NativeLoader.java @@ -54,6 +54,12 @@ public class NativeLoader { return; } + try { + System.loadLibrary("jnigraphics"); + } catch (Error e) { + FileLog.e("tmessages", e); + } + try { String folder = null; long libSize = 0; @@ -96,8 +102,8 @@ public class NativeLoader { System.loadLibrary("tmessages"); nativeLoaded = true; return; - } catch (Exception e) { - e.printStackTrace(); + } catch (Error e) { + FileLog.e("tmessages", e); } } } @@ -110,8 +116,8 @@ public class NativeLoader { System.load(destLocalFile.getAbsolutePath()); nativeLoaded = true; return; - } catch (Exception e) { - e.printStackTrace(); + } catch (Error e) { + FileLog.e("tmessages", e); } } else { destLocalFile.delete(); @@ -139,8 +145,12 @@ public class NativeLoader { } out.close(); - System.load(destLocalFile.getAbsolutePath()); - nativeLoaded = true; + try { + System.load(destLocalFile.getAbsolutePath()); + nativeLoaded = true; + } catch (Error e) { + FileLog.e("tmessages", e); + } return; } catch (Exception e) { FileLog.e("tmessages", e); @@ -164,7 +174,11 @@ public class NativeLoader { e.printStackTrace(); } - System.loadLibrary("tmessages"); - nativeLoaded = true; + try { + System.loadLibrary("tmessages"); + nativeLoaded = true; + } catch (Error e) { + FileLog.e("tmessages", e); + } } } diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java b/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java index 2922900b6..7ae99f997 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java @@ -262,10 +262,17 @@ public class Utilities { public static File getCacheDir() { if (externalCacheNotAvailableState == 1 || externalCacheNotAvailableState == 0 && Environment.getExternalStorageState().startsWith(Environment.MEDIA_MOUNTED)) { externalCacheNotAvailableState = 1; - return ApplicationLoader.applicationContext.getExternalCacheDir(); + File file = ApplicationLoader.applicationContext.getExternalCacheDir(); + if (file != null) { + return file; + } } 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) {