// Path: app/src/main/java/com/lijizhi/studydemo/utils/L.java
// public class L {
//     //开关
//     public static final boolean DEBUG = true;
//     //TAG
//     public  static final String TAG ="StudyDemo";
//     //五个等级
//     public static void d(String text){
//         if (DEBUG){
//             Log.d(TAG,text);
//         }
//     }
//     public  static void i(String text){
//         if(DEBUG){
//             Log.i(TAG,text);
//         }
// 
//     }
//     public static  void w(String text){
//         if (DEBUG){
//             Log.e(TAG,text);
//         }
//     }
//     public static  void e(String text){
//         if (DEBUG){
//             Log.e(TAG,text);
//         }
//     }
// 
// }
// 
// Path: app/src/main/java/com/lijizhi/studydemo/utils/StaticClass.java
// public class StaticClass {
// 
//     //闪屏页延时
//     public static  final int HANDLER_SPLASH=1001;
//     //判断程序是否是第一次运行
//     public static final String SHARE_IS_FIRST ="isFirst";
// 
//     //bugly key
//     public  static final String BUGLY_KEY="702ead4cab";
//     //bmob key
//     public  static final String BMOB_KEY="380dc1058f334261ba3c497c29b51901";
//     //快递Key
//     public static final String COURIER_KEY = "52ed1bad53c600d4aceaad10e1da3826";
// 
//     //归属地Key
//     public static final String PHONE_KEY = "22a6ba14995ce26dd0002216be51dabb";
//     //妹子接口
//     public static final String GIRL_URL = "";
//     //微信精选key
//     public static final String WECHAT_KEY = "e2edd400bfefdc95a54f0c01c4352016";
// 
//     public static final String MOVIENEWS="ef8adeb738c0e8219337e91ec7a1cbc9";
// 
//     //问答机器人key
//     public static final String CHAT_LIST_KEY = "7a48539921338ef90866922b21e25f6d";
//     //语音Key
//     //语音Key
//     public static final String VOICE_KEY = "583081c6";
// 
// 
//     //短信Action
//     public static final String SMS_ACTION = "android.provider.Telephony.SMS_RECEIVED";
// 
// 
// 
// }
// 
// Path: app/src/main/java/com/lijizhi/studydemo/view/DispatchLinearLayout.java
// public class DispatchLinearLayout extends LinearLayout {
// 
//     private DispatchKeyEventListener dispatchKeyEventListener;
// 
//     public DispatchLinearLayout(Context context, AttributeSet attrs) {
//         super(context, attrs);
//     }
// 
//     public DispatchLinearLayout(Context context) {
//         super(context);
//     }
// 
//     public DispatchLinearLayout(Context context, AttributeSet attrs, int defStyleAttr) {
//         super(context, attrs, defStyleAttr);
//     }
// 
//     public DispatchKeyEventListener getDispatchKeyEventListener() {
//         return dispatchKeyEventListener;
//     }
// 
//     public void setDispatchKeyEventListener(DispatchKeyEventListener dispatchKeyEventListener) {
//         this.dispatchKeyEventListener = dispatchKeyEventListener;
//     }
// 
//     //接口
//     public static interface DispatchKeyEventListener {
//         boolean dispatchKeyEvent(KeyEvent event);
//     }
// 
//     @Override
//     public boolean dispatchKeyEvent(KeyEvent event) {
//         //如果不为空 说明调用了 去获取事件
//         if (dispatchKeyEventListener != null) {
//             return dispatchKeyEventListener.dispatchKeyEvent(event);
//         }
//         return super.dispatchKeyEvent(event);
//     }
// }


import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.PixelFormat;
import android.net.Uri;
import android.os.IBinder;
import android.telephony.SmsMessage;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;
import com.lijizhi.studydemo.R;
import com.lijizhi.studydemo.utils.L;
import com.lijizhi.studydemo.utils.StaticClass;
import com.lijizhi.studydemo.view.DispatchLinearLayout;
        IntentFilter intent = new IntentFilter();
        //添加Action
        intent.addAction(StaticClass.SMS_ACTION);
        //设置权限
        intent.setPriority(Integer.MAX_VALUE);
        //注册
        registerReceiver(smsReceiver, intent);

        mHomeWatchReceiver = new HomeWatchReceiver();
        IntentFilter intentFilter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
        registerReceiver(mHomeWatchReceiver, intentFilter);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        L.i("stop service");

        //注销
        unregisterReceiver(smsReceiver);
        unregisterReceiver(mHomeWatchReceiver);
    }


    //短信广播
    public class SmsReceiver extends BroadcastReceiver {

        @Override
        public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
// Path: app/src/main/java/com/lijizhi/studydemo/utils/L.java
// public class L {
//     //开关
//     public static final boolean DEBUG = true;
//     //TAG
//     public  static final String TAG ="StudyDemo";
//     //五个等级
//     public static void d(String text){
//         if (DEBUG){
//             Log.d(TAG,text);
//         }
//     }
//     public  static void i(String text){
//         if(DEBUG){
//             Log.i(TAG,text);
//         }
// 
//     }
//     public static  void w(String text){
//         if (DEBUG){
//             Log.e(TAG,text);
//         }
//     }
//     public static  void e(String text){
//         if (DEBUG){
//             Log.e(TAG,text);
//         }
//     }
// 
// }
// 
// Path: app/src/main/java/com/lijizhi/studydemo/utils/StaticClass.java
// public class StaticClass {
// 
//     //闪屏页延时
//     public static  final int HANDLER_SPLASH=1001;
//     //判断程序是否是第一次运行
//     public static final String SHARE_IS_FIRST ="isFirst";
// 
//     //bugly key
//     public  static final String BUGLY_KEY="702ead4cab";
//     //bmob key
//     public  static final String BMOB_KEY="380dc1058f334261ba3c497c29b51901";
//     //快递Key
//     public static final String COURIER_KEY = "52ed1bad53c600d4aceaad10e1da3826";
// 
//     //归属地Key
//     public static final String PHONE_KEY = "22a6ba14995ce26dd0002216be51dabb";
//     //妹子接口
//     public static final String GIRL_URL = "";
//     //微信精选key
//     public static final String WECHAT_KEY = "e2edd400bfefdc95a54f0c01c4352016";
// 
//     public static final String MOVIENEWS="ef8adeb738c0e8219337e91ec7a1cbc9";
// 
//     //问答机器人key
//     public static final String CHAT_LIST_KEY = "7a48539921338ef90866922b21e25f6d";
//     //语音Key
//     //语音Key
//     public static final String VOICE_KEY = "583081c6";
// 
// 
//     //短信Action
//     public static final String SMS_ACTION = "android.provider.Telephony.SMS_RECEIVED";
// 
// 
// 
// }
// 
// Path: app/src/main/java/com/lijizhi/studydemo/view/DispatchLinearLayout.java
// public class DispatchLinearLayout extends LinearLayout {
// 
//     private DispatchKeyEventListener dispatchKeyEventListener;
// 
//     public DispatchLinearLayout(Context context, AttributeSet attrs) {
//         super(context, attrs);
//     }
// 
//     public DispatchLinearLayout(Context context) {
//         super(context);
//     }
// 
//     public DispatchLinearLayout(Context context, AttributeSet attrs, int defStyleAttr) {
//         super(context, attrs, defStyleAttr);
//     }
// 
//     public DispatchKeyEventListener getDispatchKeyEventListener() {
//         return dispatchKeyEventListener;
//     }
// 
//     public void setDispatchKeyEventListener(DispatchKeyEventListener dispatchKeyEventListener) {
//         this.dispatchKeyEventListener = dispatchKeyEventListener;
//     }
// 
//     //接口
//     public static interface DispatchKeyEventListener {
//         boolean dispatchKeyEvent(KeyEvent event);
//     }
// 
//     @Override
//     public boolean dispatchKeyEvent(KeyEvent event) {
//         //如果不为空 说明调用了 去获取事件
//         if (dispatchKeyEventListener != null) {
//             return dispatchKeyEventListener.dispatchKeyEvent(event);
//         }
//         return super.dispatchKeyEvent(event);
//     }
// }


// Path: app/src/main/java/com/lijizhi/studydemo/service/SmsService.java
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.PixelFormat;
import android.net.Uri;
import android.os.IBinder;
import android.telephony.SmsMessage;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;
import com.lijizhi.studydemo.R;
import com.lijizhi.studydemo.utils.L;
import com.lijizhi.studydemo.utils.StaticClass;
import com.lijizhi.studydemo.view.DispatchLinearLayout;

        IntentFilter intent = new IntentFilter();
        //添加Action
        intent.addAction(StaticClass.SMS_ACTION);
        //设置权限
        intent.setPriority(Integer.MAX_VALUE);
        //注册
        registerReceiver(smsReceiver, intent);

        mHomeWatchReceiver = new HomeWatchReceiver();
        IntentFilter intentFilter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
        registerReceiver(mHomeWatchReceiver, intentFilter);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        L.i("stop service");

        //注销
        unregisterReceiver(smsReceiver);
        unregisterReceiver(mHomeWatchReceiver);
    }


    //短信广播
    public class SmsReceiver extends BroadcastReceiver {

        @Override
        public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
            if (StaticClass.SMS_ACTION.equals(action)) {