|
@@ -10,6 +10,7 @@ import android.util.Log;
|
|
|
|
|
|
import com.wdkl.ncs.android.component.home.activity.SmsReceivedActivity;
|
|
|
import com.wdkl.ncs.android.component.home.settingconfig.SettingConfig;
|
|
|
+import com.wdkl.ncs.android.component.home.util.AppUtils;
|
|
|
import com.wdkl.ncs.android.component.home.util.HandleTcpConnect;
|
|
|
import com.wdkl.ncs.android.component.home.util.PhoneCallUtil;
|
|
|
import com.wdkl.ncs.android.component.home.util.RecordHelper;
|
|
@@ -56,11 +57,18 @@ public class PhoneStateReceiver extends BroadcastReceiver {
|
|
|
|
|
|
//如果是运营商短信且是点击了号码查询才提示
|
|
|
if (("10001".equals(address) || SettingConfig.getOperatorNumber(context).equals(address)) && Constants.Companion.getSmsCheck()) {
|
|
|
- Intent smsIntent = new Intent(context, SmsReceivedActivity.class);
|
|
|
- smsIntent.putExtra("address", address);
|
|
|
- smsIntent.putExtra("sms_data", fullMessage);
|
|
|
- smsIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
|
- context.startActivity(smsIntent);
|
|
|
+ String regex = "(1[3-9][0-9])\\d{8}";
|
|
|
+ boolean find = AppUtils.checkMobileNumber(fullMessage, regex);
|
|
|
+
|
|
|
+ if (find) {
|
|
|
+ Intent smsIntent = new Intent(context, SmsReceivedActivity.class);
|
|
|
+ smsIntent.putExtra("address", address);
|
|
|
+ smsIntent.putExtra("sms_data", fullMessage);
|
|
|
+ smsIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
|
+ context.startActivity(smsIntent);
|
|
|
+ } else {
|
|
|
+ Log.e(TAG, "find no phone number!!!");
|
|
|
+ }
|
|
|
}
|
|
|
Log.e(TAG, "received sms: " + fullMessage + ", address: " + address + ", check: " + Constants.Companion.getSmsCheck());
|
|
|
} else if (action.equals(Intent.ACTION_NEW_OUTGOING_CALL)) {
|