打包给欧阳回归测试
This commit is contained in:
parent
d38e56bd84
commit
37e2f3ec2a
@ -462,7 +462,7 @@ class BlueManage {
|
||||
|
||||
_subScribeToCharacteristic(BluetoothCharacteristic characteristic) async {
|
||||
final subscription = characteristic.onValueReceived.listen((data) {
|
||||
AppLog.log("订阅获取的数据:$data");
|
||||
// AppLog.log("订阅获取的数据:$data");
|
||||
if (data == lastTimeData || data.isEmpty) {
|
||||
return;
|
||||
} else {
|
||||
@ -477,7 +477,7 @@ class BlueManage {
|
||||
// 当包有头时
|
||||
// 判断是否需要分包
|
||||
dataLen = data[8] * 256 + data[9]; // 高16位用来指示后面数据块内容的长度
|
||||
AppLog.log("dataLen1111:$dataLen getDataLength:${data.length} data:$data");
|
||||
// AppLog.log("dataLen1111:$dataLen getDataLength:${data.length} data:$data");
|
||||
if (dataLen! + 14 > data.length) {
|
||||
// 当前包的长度小于实际的包时 分包添加 不解析
|
||||
allData.addAll(data);
|
||||
@ -493,8 +493,7 @@ class BlueManage {
|
||||
// 当包没有头时 是分包的包 直接添加
|
||||
allData.addAll(data);
|
||||
// var len = allData[8] * 256 + allData[9];
|
||||
AppLog.log(
|
||||
"dataLen3333:$dataLen allData.length:${allData.length} allData:$allData");
|
||||
// AppLog.log("dataLen3333:$dataLen allData.length:${allData.length} allData:$allData");
|
||||
if (((dataLen ?? 0) + 14) <= allData.length) {
|
||||
// 当长度小于等于当前包的数据时 直接解析数据
|
||||
CommandReciverManager.appDataReceive(allData);
|
||||
|
||||
@ -34,8 +34,8 @@ abstract class SenderProtocol extends IOData {
|
||||
}
|
||||
|
||||
void printLog(List<int> data) {
|
||||
// AppLog.log(
|
||||
// "App -> 锁,指令类型:${commandType!.typeName} \n参数是:\n${toString()} \n加密之前数据是:\n$data 长度是:${data.length}");
|
||||
AppLog.log(
|
||||
"App -> 锁,指令类型:${commandType!.typeName} \n参数是:\n${toString()} \n加密之前数据是:\n$data 长度是:${data.length}");
|
||||
}
|
||||
|
||||
//TODO:拼装数据Ï
|
||||
|
||||
@ -187,7 +187,7 @@ class SenderBeforeDataManage {
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
|
||||
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
|
||||
@ -8,6 +8,7 @@ import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||
|
||||
import '../../../../../tools/commonDataManage.dart';
|
||||
import '../../../../../tools/custom_bottom_sheet.dart';
|
||||
import '../../../../../tools/dateTool.dart';
|
||||
import '../../../../../tools/eventBusEventManage.dart';
|
||||
@ -233,15 +234,21 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||
|
||||
Future openModalBottomSheet(BuildContext context) async {
|
||||
var textList = <String>[];
|
||||
if (state.keyType.value == 1 || state.keyType.value == 2) {
|
||||
textList = [
|
||||
state.itemData.value.keyStatus == 110405 ? '取消冻结'.tr : "冻结".tr,
|
||||
state.itemData.value.keyRight == 1 ? '取消授权'.tr : '授权'.tr
|
||||
];
|
||||
} else if (state.keyType.value == 4) {
|
||||
if(CommonDataManage().currentKeyInfo.keyRight == 1){
|
||||
textList = [
|
||||
state.itemData.value.keyStatus == 110405 ? '取消冻结'.tr : "冻结".tr
|
||||
];
|
||||
}else if(CommonDataManage().currentKeyInfo.isLockOwner == 1){
|
||||
if (state.keyType.value == 1 || state.keyType.value == 2) {
|
||||
textList = [
|
||||
state.itemData.value.keyStatus == 110405 ? '取消冻结'.tr : "冻结".tr,
|
||||
state.itemData.value.keyRight == 1 ? '取消授权'.tr : '授权'.tr
|
||||
];
|
||||
} else if (state.keyType.value == 4) {
|
||||
textList = [
|
||||
state.itemData.value.keyStatus == 110405 ? '取消冻结'.tr : "冻结".tr
|
||||
];
|
||||
}
|
||||
}
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
|
||||
@ -158,7 +158,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
// var fingerprintNum = listChangInt(reply.data.sublist(9, 11)).toString();
|
||||
var fingerprintList = reply.data.sublist(reply.data.length - 2);
|
||||
var fingerprintNum = listChangInt(fingerprintList).toString();
|
||||
|
||||
state.regIndex.value++;
|
||||
if(state.fingerprintNumber.value == fingerprintNum){
|
||||
return;
|
||||
}else{
|
||||
|
||||
@ -28,9 +28,9 @@ class AdminOpenLockPasswordLogic extends BaseGetXController{
|
||||
_replyChangeAdministratorPassword(reply);
|
||||
}
|
||||
|
||||
if (reply is SenderReadAdminPasswordReply) {
|
||||
_replyReadAdminPassword(reply);
|
||||
}
|
||||
// if (reply is SenderReadAdminPasswordReply) {
|
||||
// _replyReadAdminPassword(reply);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
@ -61,11 +61,11 @@ class AdminOpenLockPasswordLogic extends BaseGetXController{
|
||||
IoSenderManage.changeAdministratorPasswordCommand(
|
||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
userID: await Storage.getUid(),
|
||||
pwdNo: 254,
|
||||
pwdNo: state.lockBasicInfo.value.lockUserNo!,
|
||||
pwd:state.changePwdController.text,
|
||||
useCountLimit: 0xff,
|
||||
startTime: 0x11223344,
|
||||
endTime: 0x11223344,
|
||||
useCountLimit: 0xffff,
|
||||
startTime: 0,
|
||||
endTime: 0,
|
||||
needAuthor: 1,
|
||||
isBeforeAddUser: false,
|
||||
signKey: signKeyDataList,
|
||||
@ -79,102 +79,102 @@ class AdminOpenLockPasswordLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
// 读取管理员密码
|
||||
Future<void> _replyReadAdminPassword(Reply reply) async {
|
||||
var token = reply.data.sublist(5, 9);
|
||||
var saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
|
||||
int status = reply.data[2];
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
if(reply.data[5] > 0){
|
||||
reply.data.removeRange(0, 6);
|
||||
// 把得到的数据按8位分割成数组 然后塞进一个新的数组里面
|
||||
var getList = splitList(reply.data, 13);
|
||||
for(int i = 0; i<getList.length; i++){
|
||||
var indexList = getList[i];
|
||||
var pwd = indexList.sublist(1, 11);
|
||||
var pwdStr = utf8String(pwd);
|
||||
|
||||
if(pwdStr == state.adminPwd.value){
|
||||
showToast("管理员密码相同,无需修改".tr);
|
||||
return;
|
||||
}
|
||||
state.adminPwd.value = pwdStr;
|
||||
addLockAdminPassword(false);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
|
||||
IoSenderManage.senderReadAdminPasswordCommand(
|
||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
userID: await Storage.getUid(),
|
||||
role:0xff,
|
||||
pwdNum:1,
|
||||
pwdNo: 0,
|
||||
token: getTokenList,
|
||||
needAuthor: 1,
|
||||
publicKey: getPublicKeyList,
|
||||
privateKey: getPrivateKeyList
|
||||
);
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Future<void> _replyReadAdminPassword(Reply reply) async {
|
||||
// var token = reply.data.sublist(5, 9);
|
||||
// var saveStrList = changeIntListToStringList(token);
|
||||
// Storage.setStringList(saveBlueToken, saveStrList);
|
||||
//
|
||||
// int status = reply.data[2];
|
||||
// switch (status) {
|
||||
// case 0x00:
|
||||
// //成功
|
||||
// dismissEasyLoading();
|
||||
// cancelBlueConnetctToastTimer();
|
||||
//
|
||||
// if(reply.data[5] > 0){
|
||||
// reply.data.removeRange(0, 6);
|
||||
// // 把得到的数据按8位分割成数组 然后塞进一个新的数组里面
|
||||
// var getList = splitList(reply.data, 13);
|
||||
// for(int i = 0; i<getList.length; i++){
|
||||
// var indexList = getList[i];
|
||||
// var pwd = indexList.sublist(1, 11);
|
||||
// var pwdStr = utf8String(pwd);
|
||||
//
|
||||
// if(pwdStr == state.adminPwd.value){
|
||||
// showToast("管理员密码相同,无需修改".tr);
|
||||
// return;
|
||||
// }
|
||||
// state.adminPwd.value = pwdStr;
|
||||
// addLockAdminPassword(false);
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
// case 0x06:
|
||||
// //无权限
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var token = await Storage.getStringList(saveBlueToken);
|
||||
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||
//
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
//
|
||||
// IoSenderManage.senderReadAdminPasswordCommand(
|
||||
// keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
// userID: await Storage.getUid(),
|
||||
// role:0xff,
|
||||
// pwdNum:1,
|
||||
// pwdNo: 0,
|
||||
// token: getTokenList,
|
||||
// needAuthor: 1,
|
||||
// publicKey: getPublicKeyList,
|
||||
// privateKey: getPrivateKeyList
|
||||
// );
|
||||
// break;
|
||||
// default:
|
||||
// //失败
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 读取支持功能-带参数
|
||||
Future<void> readAdminPassword() async {
|
||||
showEasyLoading();
|
||||
showBlueConnetctToastTimer(action: (){
|
||||
dismissEasyLoading();
|
||||
});
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
||||
if (connectionState == BluetoothConnectionState.connected) {
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
|
||||
IoSenderManage.senderReadAdminPasswordCommand(
|
||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
userID: await Storage.getUid(),
|
||||
role:0xff,
|
||||
pwdNum:1,
|
||||
pwdNo: 0,
|
||||
token: getTokenList,
|
||||
needAuthor: 1,
|
||||
publicKey: getPublicKeyList,
|
||||
privateKey: getPrivateKeyList
|
||||
);
|
||||
} else if (connectionState == BluetoothConnectionState.disconnected) {
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
if(state.ifCurrentScreen.value == true){
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// Future<void> readAdminPassword() async {
|
||||
// showEasyLoading();
|
||||
// showBlueConnetctToastTimer(action: (){
|
||||
// dismissEasyLoading();
|
||||
// });
|
||||
// BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async {
|
||||
// if (connectionState == BluetoothConnectionState.connected) {
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var token = await Storage.getStringList(saveBlueToken);
|
||||
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||
//
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
//
|
||||
// IoSenderManage.senderReadAdminPasswordCommand(
|
||||
// keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
// userID: await Storage.getUid(),
|
||||
// role:0xff,
|
||||
// pwdNum:1,
|
||||
// pwdNo: 0,
|
||||
// token: getTokenList,
|
||||
// needAuthor: 1,
|
||||
// publicKey: getPublicKeyList,
|
||||
// privateKey: getPrivateKeyList
|
||||
// );
|
||||
// } else if (connectionState == BluetoothConnectionState.disconnected) {
|
||||
// dismissEasyLoading();
|
||||
// cancelBlueConnetctToastTimer();
|
||||
// if(state.ifCurrentScreen.value == true){
|
||||
// showBlueConnetctToast();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// 修改管理员密码(同添加自定义开锁密码,指纹/密码/卡片前5个是管理员)
|
||||
Future<void> changeAdministratorPasswordCommand() async {
|
||||
@ -199,27 +199,14 @@ class AdminOpenLockPasswordLogic extends BaseGetXController{
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
// IoSenderManage.changeAdministratorPasswordCommand(
|
||||
// keyID: "1",
|
||||
// userID: await Storage.getUid(),
|
||||
// pwdNo: 0,
|
||||
// pwd:state.changePwdController.text,
|
||||
// useCountLimit: 0xff,
|
||||
// startTime: 0x11223344,
|
||||
// endTime: 0x11223344,
|
||||
// needAuthor: 1,
|
||||
// signKey: signKeyDataList,
|
||||
// privateKey: getPrivateKeyList,
|
||||
// token: getTokenList);
|
||||
|
||||
IoSenderManage.changeAdministratorPasswordCommand(
|
||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||
userID: await Storage.getUid(),
|
||||
pwdNo: 254,
|
||||
pwdNo: state.lockBasicInfo.value.lockUserNo!,
|
||||
pwd:state.changePwdController.text,
|
||||
useCountLimit: 0xff,
|
||||
startTime: 0x11223344,
|
||||
endTime: 0x11223344,
|
||||
useCountLimit: 0xffff,
|
||||
startTime: 0,
|
||||
endTime: 0,
|
||||
needAuthor: 1,
|
||||
isBeforeAddUser: false,
|
||||
signKey: signKeyDataList,
|
||||
|
||||
@ -42,43 +42,43 @@ class _AdminOpenLockPasswordPageState extends State<AdminOpenLockPasswordPage> w
|
||||
action: () {
|
||||
showCupertinoAlertDialog();
|
||||
})),
|
||||
Container(
|
||||
margin: EdgeInsets.all(30.w),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.adminOpenLockPasswordTip!.tr,
|
||||
style: TextStyle(fontSize: 20.sp),
|
||||
)),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
logic.readAdminPassword();
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
TranslationLoader
|
||||
.lanKeys!.updateLockAdminPassword!.tr,
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor, fontSize: 20.sp),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// Container(
|
||||
// margin: EdgeInsets.all(30.w),
|
||||
// child: Column(
|
||||
// children: [
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// children: [
|
||||
// Expanded(
|
||||
// child: Text(
|
||||
// TranslationLoader.lanKeys!.adminOpenLockPasswordTip!.tr,
|
||||
// style: TextStyle(fontSize: 20.sp),
|
||||
// )),
|
||||
// ],
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: 10.h,
|
||||
// ),
|
||||
// GestureDetector(
|
||||
// onTap: () {
|
||||
// logic.readAdminPassword();
|
||||
// },
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// children: [
|
||||
// Expanded(
|
||||
// child: Text(
|
||||
// TranslationLoader
|
||||
// .lanKeys!.updateLockAdminPassword!.tr,
|
||||
// style: TextStyle(
|
||||
// color: AppColors.mainColor, fontSize: 20.sp),
|
||||
// )),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
@ -167,9 +167,9 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
|
||||
allHeight: 80.h,
|
||||
isHaveLine: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: Container(
|
||||
rightWidget: SizedBox(
|
||||
width: 300.w,
|
||||
child: Text(state.lockBasicInfo.value.address ?? "-",
|
||||
child: Text(state.lockBasicInfo.value.address ?? "无".tr,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.end,
|
||||
|
||||
@ -258,8 +258,8 @@ class PasswordKeyDetailLogic extends BaseGetXController {
|
||||
state.isCirculation.value = true;
|
||||
break;
|
||||
case 14:
|
||||
//周天循环 14 每周日开始和结束时间指定时间段内有效
|
||||
useDateStr = '周天 $starHour:00-$endHour:00';
|
||||
//周日循环 14 每周日开始和结束时间指定时间段内有效
|
||||
useDateStr = '周日 $starHour:00-$endHour:00';
|
||||
state.isCirculation.value = true;
|
||||
break;
|
||||
default:
|
||||
@ -333,8 +333,8 @@ class PasswordKeyDetailLogic extends BaseGetXController {
|
||||
useDateStr = '类型:循环\n周六 $starHour:00-$endHour:00';
|
||||
break;
|
||||
case 14:
|
||||
//周天循环 14 每周日开始和结束时间指定时间段内有效
|
||||
useDateStr = '类型:循环\n周天 $starHour:00-$endHour:00';
|
||||
//周日循环 14 每周日开始和结束时间指定时间段内有效
|
||||
useDateStr = '类型:循环\n周日 $starHour:00-$endHour:00';
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@ -13,7 +13,7 @@ class SeletKeyCyclicDateLogic extends BaseGetXController {
|
||||
var starTimeTimestamp = DateTool().dateToTimestamp(state.starTime.value, 0).toString();
|
||||
var endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 0).toString();
|
||||
|
||||
if (int.parse(starDateTimestamp) >= int.parse(endDateTimestamp)) {
|
||||
if (int.parse(starDateTimestamp) > int.parse(endDateTimestamp)) {
|
||||
showToast("失效日期要大于生效日期".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -39,8 +39,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# 1.0.29+2024042901 打包给欧阳测试
|
||||
# 1.0.30+2024043001 打包鑫锁提审ios
|
||||
# 1.0.31+2024050301 打包鑫锁提审华为
|
||||
# 1.0.32+2024051001:打包给欧阳回归测试
|
||||
|
||||
version: 1.0.31+2024050301
|
||||
version: 1.0.32+2024051001
|
||||
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user