private boolean isRelevant(Context context, Intent intent) { SmsMessage message = getSmsMessageFromIntent(intent); String messageBody = getSmsMessageBodyFromIntent(intent); if (message == null && messageBody == null) return false; if (isExemption(message, messageBody)) return false; if (!ApplicationMigrationService.isDatabaseImported(context)) return false; if (isChallenge(context, messageBody)) return false; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && SMS_RECEIVED_ACTION.equals(intent.getAction()) && Util.isDefaultSmsProvider(context)) { return false; } if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT && TextSecurePreferences.isInterceptAllSmsEnabled(context)) { return true; } return false; }
private boolean isRelevent(Context context, Intent intent) { SmsMessage message = getSmsMessageFromIntent(intent); String messageBody = getSmsMessageBodyFromIntent(intent); if (message == null && messageBody == null) return false; if (isExemption(message, messageBody)) return false; if (!ApplicationMigrationService.isDatabaseImported(context)) return false; if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean("pref_all_sms", true)) return true; return WirePrefix.isEncryptedMessage(messageBody) || WirePrefix.isKeyExchange(messageBody); }