Merge remote-tracking branch 'origin/develop_sky_minbb' into develop_sky_minbb

# Conflicts:
#	lib/main/lockDetail/lockDetail/lockDetail_logic.dart
#	lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_page.dart
This commit is contained in:
sky_min 2025-12-10 11:12:47 +08:00
commit 07fb7a6542
7 changed files with 44 additions and 69 deletions

View File

@ -54,7 +54,7 @@ class DeviceNetworkInfo {
String? networkMac;
String? secretKey;
String? peerId;
String? rssi;
int? rssi;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};

View File

@ -411,32 +411,19 @@ class LockDetailLogic extends BaseGetXController {
indexMap['type'] = indexList[0].toString();
final int userNo = (indexList[1] * 256) + indexList[2];
indexMap['user'] = userNo.toString();
// AppLog.log('userNouserNouserNouserNo:$userNo');
if (userNo == 0xFFFF) {
// 线16F(0x1F)
final List<int> passwordData = indexList.sublist(7, 17); // 10
// F(0x1F)
int endIndex = passwordData.indexOf(0x1F);
if (endIndex == -1) {
//
endIndex = passwordData.length;
}
//
final List<int> actualPasswordData = passwordData.sublist(0, endIndex);
//
String passwordHex = actualPasswordData.map((byte) => byte.toRadixString(16).padLeft(2, '0')).join();
//
passwordHex = passwordHex.replaceAll(RegExp(r'[^0-9]'), '');
indexMap['password'] = passwordHex;
// indexMap['password'] = passwordHex; //
AppLog.log('离线密码开锁:$passwordHex');
final List<int> passwordData = indexList.sublist(7, 17);
final String password;
if(userNo == 65535){
//线
password = passwordData
.map((byte) => byte.toRadixString(16).padLeft(2, '0'))
.join('')
.replaceAll(RegExp(r'f*$'), '');
} else {
final List<int> passwordData = indexList.sublist(7, 17);
final String password = utf8String(passwordData);
indexMap['password'] = password.toString();
indexMap['user'] = userNo.toString();
password = utf8String(passwordData);
}
indexMap['password'] = password.toString();
// AppLog.log('passwordpasswordpassword:$password');
@ -542,23 +529,6 @@ class LockDetailLogic extends BaseGetXController {
signKey: signKeyDataList,
privateKey: getPrivateKeyList,
);
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
cancelBlueConnetctToastTimer();
BuglyTool.uploadException(
message: '蓝牙连接失败-开锁失败', detail: '蓝牙连接失败,断开连接, 开锁失败--OpenLockCommand:$command', upload: true);
final String getMobile = (await Storage.getMobile())!;
ApmHelper.instance.trackEvent('open_lock', {
'lock_name': state.keyInfos.value.lockName!,
'account': getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
'date': DateTool().getNowDateWithType(1),
'open_lock_result': '断开连接',
});
// if (state.ifCurrentScreen.value == true) {
// showBlueConnetctToast();
// }
resetOpenDoorState();
}
});
}

View File

@ -61,7 +61,7 @@ class ConfiguringWifiLogic extends BaseGetXController {
required String secretKey,
required String deviceMac,
required String networkMac,
int? rssi,
required int rssi,
}) async {
try {
final LoginEntity entity = await ApiRepository.to.settingDeviceNetwork(
@ -174,7 +174,7 @@ class ConfiguringWifiLogic extends BaseGetXController {
secretKey: secretKey,
deviceMac: deviceMac ?? '',
networkMac: networkMac ?? '',
rssi: rssi,
rssi: rssi ?? 0,
);
if (info.errorCode!.codeIsSuccessful) {
// peerID
@ -183,7 +183,7 @@ class ConfiguringWifiLogic extends BaseGetXController {
networkMac: networkMac,
secretKey: secretKey,
peerId: peerId,
rssi: rssi.toString(),
rssi: rssi,
);
state.lockSetInfoData.value?.lockBasicInfo?.networkInfo?.peerId =

View File

@ -28,6 +28,11 @@ class ThirdPartyPlatformLogic extends BaseGetXController {
void onReady() async {
super.onReady();
await getActivateInfo();
//
final savedIndex = await state.getSavedSelectedPlatformIndex();
if (savedIndex != null && savedIndex < state.platFormSet.length) {
state.selectPlatFormIndex.value = savedIndex;
}
_initReplySubscription();
await getServerDatetime();
showEasyLoading();
@ -209,6 +214,8 @@ class ThirdPartyPlatformLogic extends BaseGetXController {
void savePlatFormSetting() {
if (state.selectPlatFormIndex.value == 1 || state.selectPlatFormIndex.value == 0) {
if (state.registerKey.isNotEmpty) {
//
state.saveSelectedPlatformIndex(state.selectPlatFormIndex.value);
_requestAuthorizationCode();
}
} else {

View File

@ -2,6 +2,7 @@ import 'dart:ui';
import 'package:get/get.dart';
import 'package:get/get_rx/get_rx.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:star_lock/main/lockDetail/lockDetail/ActivateInfoResponse.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
import 'package:star_lock/translations/app_dept.dart';
@ -32,4 +33,16 @@ class ThirdPartyPlatformState {
Map lockInfo = {};
int serverTime = 0; // UTC+0
//
static const String _SELECTED_PLATFORM_INDEX_KEY = 'selected_platform_index';
Future<void> saveSelectedPlatformIndex(int index) async {
final prefs = await SharedPreferences.getInstance();
await prefs.setInt(_SELECTED_PLATFORM_INDEX_KEY, index);
}
//
Future<int?> getSavedSelectedPlatformIndex() async {
final prefs = await SharedPreferences.getInstance();
return prefs.getInt(_SELECTED_PLATFORM_INDEX_KEY);
}
}

View File

@ -66,14 +66,12 @@ class AppLifecycleObserver extends WidgetsBindingObserver {
final status = StartChartManage().talkStatus.status;
if ((status == TalkStatus.passiveCallWaitingAnswer ||
status == TalkStatus.proactivelyCallWaitingAnswer ||
status == TalkStatus.answeredSuccessfully) &&
status == TalkStatus.answeredSuccessfully ||
status == TalkStatus.uninitialized) &&
Get.currentRoute != '/StarLockRegisterPage') { //
Get.back();
}
//
if (status != TalkStatus.uninitialized) {
StartChartManage().destruction();
}
StartChartManage().destruction();
_readMessageRefreshUIEvent?.cancel();
}

View File

@ -1311,13 +1311,8 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
state.currentQuality.value = quality;
TalkExpectReq talkExpectReq = StartChartManage().getDefaultTalkExpect();
final audioType = talkExpectReq.audioType;
// loading状态
state.isLoading.value = true;
int width = 864;
int height = 480;
switch (quality) {
case '高清':
talkExpectReq = TalkExpectReq(
@ -1337,23 +1332,15 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
break;
}
//
///
StartChartManage().changeTalkExpectDataTypeAndReStartTalkExpectMessageTimer(talkExpect: talkExpectReq);
// loadingframeSeq回绕检测
// frameSeq回绕检测标志
_pendingStreamReset = false;
_pendingResetWidth = width;
_pendingResetHeight = height;
try {
//
await Future.wait([
//
_resetDecoderForNewStream(width, height),
//
Future.microtask(() =>
StartChartManage().changeTalkExpectDataTypeAndReStartTalkExpectMessageTimer(talkExpect: talkExpectReq))
]).timeout(const Duration(milliseconds: 1500)); //
} catch (e) {
AppLog.log('切换清晰度超时或失败: $e');
state.isLoading.value = false;
}
}
void _initHdOptions() {