version:2.3

fix:修复锁屏密码问题
update:
This commit is contained in:
2022-11-30 09:30:22 +08:00
parent f7f8141ac6
commit cc5951ad0f
6 changed files with 61 additions and 49 deletions

View File

@@ -56,6 +56,7 @@ public class ManagerService extends Service implements NetworkUtils.OnNetworkSta
public static final String ACTION_LOCK = "LockScreenReceiver_lockscreen";
public static final String ACTION_UNLOCK = "LockScreenReceiver_unlockscreen";
public static final String ACTION_UPDATE = "TimeChangedReceiver_update";
private static final String DEFAULT_PASSWORD = "0000";
private WindowManager windowManager;
private View topView;
private boolean screenlocked = false;
@@ -324,32 +325,15 @@ public class ManagerService extends Service implements NetworkUtils.OnNetworkSta
}
Log.e(TAG, "inputComplete: " + content);
String password = (String) SPUtils.get(ManagerService.this, UrlAddress.LOCK_SCREEN_PWD, "");
if ((!TextUtils.isEmpty(content) && !TextUtils.isEmpty(password) && password.equals(content)) || "0000".equals(content)) {
hideFloatingWindow();
SPUtils.put(ManagerService.this, ManagerService.LOCK_STATE, 0);
NetInterfaceManager.getInstance().getUpdateLockScreenObservable()
.subscribe(new Observer<BaseResponse>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseResponse baseResponse) {
Log.e("getUpdateLockScreenObservable", "onNext: " + baseResponse);
}
@Override
public void onError(@NonNull Throwable e) {
}
@Override
public void onComplete() {
}
});
} else {
if ((!TextUtils.isEmpty(content) && !TextUtils.isEmpty(password))) {
if (password.equals(content)) {
hide();
}else {
tv_hint.setText("密码错误");
}
} else if (DEFAULT_PASSWORD.equals(content)){
hide();
} else{
// ToastUtil.show("密码错误");
tv_hint.setText("密码错误");
}
@@ -358,6 +342,33 @@ public class ManagerService extends Service implements NetworkUtils.OnNetworkSta
}
private void hide() {
hideFloatingWindow();
SPUtils.put(ManagerService.this, ManagerService.LOCK_STATE, 0);
NetInterfaceManager.getInstance().getUpdateLockScreenObservable()
.subscribe(new Observer<BaseResponse>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseResponse baseResponse) {
Log.e("getUpdateLockScreenObservable", "onNext: " + baseResponse);
}
@Override
public void onError(@NonNull Throwable e) {
}
@Override
public void onComplete() {
}
});
}
private void add(VerificationCodeView codeView, String text) {
Log.e(TAG, "add: text = " + text);
String oldText = codeView.getEditText().getText().toString();