Merge pull request #94 from thoughtbox/Change-default-behaviour-when-receiving-"flash"-messages

Changes default behaviour for CLASS 0 messages
This commit is contained in:
Moxie Marlinspike 2012-11-24 19:25:53 -08:00
commit c83d57aa59

View File

@ -31,10 +31,16 @@ public class SmsListener extends BroadcastReceiver {
private static final String SMS_RECEIVED_ACTION = "android.provider.Telephony.SMS_RECEIVED"; private static final String SMS_RECEIVED_ACTION = "android.provider.Telephony.SMS_RECEIVED";
private boolean isExemption(SmsMessage message, String messageBody) { private boolean isExemption(SmsMessage message, String messageBody) {
// ignore CLASS0 ("flash") messages
if (message.getMessageClass() == SmsMessage.MessageClass.CLASS_0)
return true;
// ignore OTP messages from Sparebank1 (Norwegian bank) // ignore OTP messages from Sparebank1 (Norwegian bank)
if (messageBody.startsWith("Sparebank1://otp?")) { if (messageBody.startsWith("Sparebank1://otp?")) {
return (true); return true;
} }
// Sprint Visual Voicemail // Sprint Visual Voicemail
return return
message.getOriginatingAddress().length() < 7 && message.getOriginatingAddress().length() < 7 &&