|
|
@@ -1,14 +1,11 @@
|
|
|
package com.sheep.jiuyan.samllsheep.service;
|
|
|
|
|
|
-import android.app.AlertDialog;
|
|
|
import android.app.Service;
|
|
|
import android.content.Context;
|
|
|
-import android.content.DialogInterface;
|
|
|
import android.content.Intent;
|
|
|
import android.graphics.PixelFormat;
|
|
|
import android.os.Build;
|
|
|
import android.os.IBinder;
|
|
|
-import android.provider.Settings;
|
|
|
import android.text.TextUtils;
|
|
|
import android.util.Log;
|
|
|
import android.view.Gravity;
|
|
|
@@ -22,7 +19,6 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.sheep.gamegroup.model.entity.AppRecord;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
-import com.sheep.gamegroup.model.entity.TaskEty;
|
|
|
import com.sheep.gamegroup.model.entity.TaskListen;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.util.CommonUtil;
|
|
|
@@ -34,7 +30,6 @@ import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.DeviceInfo;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
-import com.sheep.jiuyan.samllsheep.utils.OpenService;
|
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
@@ -48,7 +43,7 @@ import rx.schedulers.Schedulers;
|
|
|
* Created by realicing on 2018/5/8.
|
|
|
* realicing@sina.com
|
|
|
*/
|
|
|
-public class FloatService extends Service implements View.OnClickListener {
|
|
|
+public class FloatService extends Service {
|
|
|
|
|
|
private static final String TAG = "MainService";
|
|
|
|
|
|
@@ -245,37 +240,4 @@ public class FloatService extends Service implements View.OnClickListener {
|
|
|
super.onDestroy();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 前往开启辅助服务界面
|
|
|
- */
|
|
|
- private void goAccess() {
|
|
|
- Intent intent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
|
|
|
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
|
- startActivity(intent);
|
|
|
-
|
|
|
- Intent intent2 = new Intent(this, MonitorAppService.class);
|
|
|
- startService(intent2);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- if (!new OpenService().isAccessibilitySettingsOn(this)) {
|
|
|
- AlertDialog.Builder builder= new AlertDialog.Builder(this)
|
|
|
- .setTitle("温馨提示!")
|
|
|
- .setMessage("亲!要赚钱需要手动开启小绵羊辅助功能哟!")
|
|
|
- .setPositiveButton("去开启", new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- goAccess();
|
|
|
- }
|
|
|
- });
|
|
|
- builder.setCancelable(false);
|
|
|
- builder.show();
|
|
|
- return ;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
}
|