短信监控移到运维程序中

serial
BlueMatthew 1 year ago
parent 0fb0e2a77c
commit 7097b4a739

@ -135,11 +135,7 @@
<action android:name="android.intent.action.USER_UNLOCKED" />
</intent-filter>
</receiver>
<receiver android:name=".SmsReceiver">
<intent-filter android:priority="2147483647">
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
<receiver
android:name="com.xypower.common.UpdateReceiver"
android:enabled="true"

@ -110,6 +110,11 @@
<data android:scheme="package" />
</intent-filter>
</receiver>
<receiver android:name=".SmsReceiver">
<intent-filter android:priority="2147483647">
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
<receiver
android:name=".BootBroadcastReceiver"
android:enabled="true"

@ -1,4 +1,4 @@
package com.xypower.mpapp;
package com.xypower.mpmaster;
import android.content.BroadcastReceiver;
import android.content.Context;
@ -18,6 +18,7 @@ import java.util.TimeZone;
*/
public class SmsReceiver extends BroadcastReceiver {
private static final String TAG = "MPLOG";
private Context mContext;
public static final String SMS_RECEIVED_ACTION = "android.provider.Telephony.SMS_RECEIVED";
public static final String SMS_DELIVER_ACTION = "android.provider.Telephony.SMS_DELIVER";
@ -26,11 +27,11 @@ public class SmsReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
this.mContext = context;
Log.e("日志onReceive...", "-接收短信执行了" + intent.getStringExtra("sele"));
Log.e(TAG, "Recv SMS");
String action = intent.getAction();
if (SMS_RECEIVED_ACTION.equals(action) || SMS_DELIVER_ACTION.equals(action)) {
Log.e("日志onReceive。。。", "开始接收短信.....");
// Log.e("日志onReceive。。。", "开始接收短信.....");
Bundle bundle = intent.getExtras();
if (bundle != null) {
Object[] pdus = (Object[]) bundle.get("pdus");
@ -48,6 +49,7 @@ public class SmsReceiver extends BroadcastReceiver {
format.setTimeZone(TimeZone.getTimeZone("GMT+08:00"));
String dateContent = format.format(date);
// this.abortBroadcast();// 中止
}
Loading…
Cancel
Save