diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 1ae6e9c20..83bd704d8 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -82,7 +82,7 @@ android { defaultConfig { minSdkVersion 8 targetSdkVersion 19 - versionCode 224 + versionCode 225 versionName "1.4.10" } } diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/NativeLoader.java b/TMessagesProj/src/main/java/org/telegram/messenger/NativeLoader.java index 0e2afdd4e..40b5a3dc7 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/NativeLoader.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/NativeLoader.java @@ -40,27 +40,35 @@ public class NativeLoader { long libSize = 0; long libSize2 = 0; - if (Build.CPU_ABI.equalsIgnoreCase("armeabi-v7a")) { - folder = "armeabi-v7a"; - libSize = sizes[1]; - libSize2 = sizes[0]; - } else if (Build.CPU_ABI.equalsIgnoreCase("armeabi")) { + try { + if (Build.CPU_ABI.equalsIgnoreCase("armeabi-v7a")) { + folder = "armeabi-v7a"; + libSize = sizes[1]; + libSize2 = sizes[0]; + } else if (Build.CPU_ABI.equalsIgnoreCase("armeabi")) { + folder = "armeabi"; + libSize = sizes[0]; + libSize2 = sizes[1]; + } else if (Build.CPU_ABI.equalsIgnoreCase("x86")) { + folder = "x86"; + libSize = sizes[2]; + } else if (Build.CPU_ABI.equalsIgnoreCase("mips")) { + folder = "mips"; + libSize = sizes[3]; + } else { + folder = "armeabi"; + libSize = sizes[0]; + libSize2 = sizes[1]; + FileLog.e("tmessages", "Unsupported arch: " + Build.CPU_ABI); + } + } catch (Exception e) { + FileLog.e("tmessages", e); folder = "armeabi"; libSize = sizes[0]; libSize2 = sizes[1]; - } else if (Build.CPU_ABI.equalsIgnoreCase("x86")) { - folder = "x86"; - libSize = sizes[2]; - } else if (Build.CPU_ABI.equalsIgnoreCase("mips")) { - folder = "mips"; - libSize = sizes[3]; - } else { - System.loadLibrary("tmessages"); - nativeLoaded = true; - FileLog.e("tmessages", "Unsupported arch: " + Build.CPU_ABI); - return; } + File destFile = new File(context.getApplicationInfo().nativeLibraryDir + "/libtmessages.so"); if (destFile.exists() && (destFile.length() == libSize || libSize2 != 0 && destFile.length() == libSize2)) { FileLog.d("tmessages", "Load normal lib"); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index 6fb02986f..25997a08c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -3424,7 +3424,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa break; } case attach_location: { - if (!isGoogleMapsInstalled()) { + if (!isGoogleMapsInstalled() || parentActivity == null) { return true; } LocationActivity fragment = new LocationActivity(); @@ -3432,6 +3432,9 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa break; } case attach_document: { + if (parentActivity == null) { + return true; + } DocumentSelectActivity fragment = new DocumentSelectActivity(); fragment.delegate = this; ((LaunchActivity)parentActivity).presentFragment(fragment, "document", false); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java index 60ebbbbef..62bb91234 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java @@ -45,9 +45,6 @@ public class LoginActivity extends ActionBarActivity implements SlideView.SlideV ((LoginActivityPhoneView)views[0]).selectCountry(data.getStringExtra("country")); } } -// if (views[currentViewNum] instanceof LoginActivityRegisterView) { -// ((LoginActivityRegisterView)views[currentViewNum]).avatarUpdater.onActivityResult(requestCode, resultCode, data); -// } } @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivitySmsView.java b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivitySmsView.java index 7bd39f869..d9283a4b8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivitySmsView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivitySmsView.java @@ -105,6 +105,9 @@ public class LoginActivitySmsView extends SlideView implements NotificationCente @Override public void setParams(Bundle params) { + if (params == null) { + return; + } codeField.setText(""); Utilities.setWaitingForSms(true); NotificationCenter.getInstance().addObserver(this, 998); @@ -116,6 +119,10 @@ public class LoginActivitySmsView extends SlideView implements NotificationCente registered = params.getString("registered"); time = params.getInt("calltime"); + if (phone == null) { + return; + } + String number = PhoneFormat.getInstance().format(phone); confirmTextView.setText(Html.fromHtml(String.format(ApplicationLoader.applicationContext.getResources().getString(R.string.SentSmsCode) + " %s", number)));