feat: 基本功能逻辑没有问题
在自动返回到桌面时,后端说有接口没有传上去,待修复。 准备升级Android Studio版本
This commit is contained in:
1 parent
ae66c33035
commit
4217eb7f8b
25 files changed
+1538
-155
No files matched your search
@@ -21,6 +21,7 @@ import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.blankj.utilcode.util.NetworkUtils;
|
||||
import com.fuying.sn.BuildConfig;
|
||||
import com.fuying.sn.R;
|
||||
import com.fuying.sn.bean.BaseResponse;
|
||||
import com.fuying.sn.config.CommonConfig;
|
||||
@@ -33,6 +34,7 @@ import com.fuying.sn.utils.SPUtils;
|
||||
import com.fuying.sn.utils.TimeUtils;
|
||||
import com.fuying.sn.utils.Utils;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.tuo.customview.VerificationCodeView;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -53,6 +55,8 @@ import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
public class ManagerService extends Service implements NetworkUtils.OnNetworkStatusChangedListener {
|
||||
private static final String TAG = "ManagerService";
|
||||
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
public static final String ACTION_LOCK = "LockScreenReceiver_lockscreen";
|
||||
public static final String ACTION_UNLOCK = "LockScreenReceiver_unlockscreen";
|
||||
public static final String ACTION_UPDATE = "TimeChangedReceiver_update";
|
||||
@@ -204,6 +208,10 @@ public class ManagerService extends Service implements NetworkUtils.OnNetworkSta
|
||||
public static final String LOCK_STATE = "SCRENN_LOOCKED_STATE";
|
||||
|
||||
private void showFloatingWindow(String name) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.e(TAG, "showFloatingWindow: debug mode skip");
|
||||
return;
|
||||
}
|
||||
if (Settings.canDrawOverlays(this)) {
|
||||
// 获取WindowManager服务
|
||||
if (null == windowManager) {
|
||||
@@ -324,17 +332,10 @@ public class ManagerService extends Service implements NetworkUtils.OnNetworkSta
|
||||
return;
|
||||
}
|
||||
Log.e(TAG, "inputComplete: " + content);
|
||||
String password = (String) SPUtils.get(ManagerService.this, UrlAddress.LOCK_SCREEN_PWD, "");
|
||||
if ((!TextUtils.isEmpty(content) && !TextUtils.isEmpty(password))) {
|
||||
if (password.equals(content)) {
|
||||
hide();
|
||||
}else {
|
||||
tv_hint.setText("密码错误");
|
||||
}
|
||||
} else if (DEFAULT_PASSWORD.equals(content)){
|
||||
String password = mMMKV.decodeString(UrlAddress.LOCK_SCREEN_PWD, DEFAULT_PASSWORD);
|
||||
if (content.equals(password)) {
|
||||
hide();
|
||||
} else{
|
||||
// ToastUtil.show("密码错误");
|
||||
} else {
|
||||
tv_hint.setText("密码错误");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,18 +51,26 @@ public class RemoteService extends Service {
|
||||
|
||||
@Override
|
||||
public boolean inControl(String pkg) throws RemoteException {
|
||||
boolean control = RunningAppManager.getInstance().inControlTime(pkg);
|
||||
Log.e(TAG, "inControl: " + control);
|
||||
return control;
|
||||
if (BuildConfig.VERSION_CODE < 88) {
|
||||
boolean control = RunningAppManager.getInstance().inControlTime(pkg);
|
||||
Log.e(TAG, "inControl: " + control);
|
||||
return control;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisableContent(String pkg) throws RemoteException {
|
||||
String content = RunningAppManager.getInstance().getDisableContent(pkg);
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.e(TAG, "getDisableContent: " + content);
|
||||
if (BuildConfig.VERSION_CODE < 88) {
|
||||
String content = RunningAppManager.getInstance().getDisableContent(pkg);
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.e(TAG, "getDisableContent: " + content);
|
||||
}
|
||||
return content;
|
||||
} else {
|
||||
return "新版本测试";
|
||||
}
|
||||
return content;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import android.content.Intent;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
|
||||
import com.fuying.sn.BuildConfig;
|
||||
import com.fuying.sn.bean.AppStart;
|
||||
import com.fuying.sn.bean.BaseResponse;
|
||||
import com.fuying.sn.bean.MyAppUsageBean;
|
||||
@@ -329,7 +330,7 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
|
||||
@Override
|
||||
public void getSnTimeControl() {
|
||||
NetInterfaceManager.getInstance().getSnTimeControl(getLifecycle(), new NetInterfaceManager.CompleteCallback() {
|
||||
NetInterfaceManager.getInstance().getMachineTimeControl(getLifecycle(), new NetInterfaceManager.CompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setSnTimeControl();
|
||||
@@ -342,7 +343,9 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
NetInterfaceManager.getInstance().getMyAppList(new NetInterfaceManager.MyAppListCallback() {
|
||||
@Override
|
||||
public void setMyAppList(List<MyAppUsageBean> myAppList) {
|
||||
RunningAppManager.getInstance().syncAllAppUsageTime(myAppList);
|
||||
if (BuildConfig.VERSION_CODE < 88) {
|
||||
RunningAppManager.getInstance().syncAllAppUsageTime(myAppList);
|
||||
}
|
||||
mView.setMyAppList();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -444,7 +444,9 @@ public class MainService extends BaseRxService implements MainSContact.MainView,
|
||||
Log.e(TAG, "getAppControl: requests have been made today");
|
||||
} else {
|
||||
Log.e(TAG, "getAppControl: getConfig");
|
||||
RunningAppManager.getInstance().getConfig();
|
||||
if (BuildConfig.VERSION_CODE < 88) {
|
||||
RunningAppManager.getInstance().getConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user