Merge branch 'develop_liyi' into canary_release

This commit is contained in:
Liuyf 2025-04-10 14:35:20 +08:00
commit 80e2b62724
16 changed files with 163 additions and 103 deletions

View File

@ -173,9 +173,9 @@
"接收人信息": "收件人",
"转移网关": "傳輸網關",
"锁屏": "屏幕鎖定",
"已关闭": "關閉",
"已开启": "",
"开启": "開",
"已关闭": "關閉",
"已开启": "已開啟",
"开启": "開",
"确定要开启重置键?": "繼續啟用Reset掣",
"确定要关闭重置键?": "繼續禁用Reset掣",
"隐藏无效开锁权限": "隱藏無效訪問權限",

View File

@ -172,9 +172,9 @@
"接收人信息": "收件人",
"转移网关": "傳輸網關",
"锁屏": "屏幕鎖定",
"已关闭": "關",
"已开启": "開啟",
"开启": "開",
"已关闭": "",
"已开启": "開啟",
"开启": "",
"确定要开启重置键?": "是否繼續啟用重置按鈕?",
"确定要关闭重置键?": "是否繼續禁用重置按鈕?",
"隐藏无效开锁权限": "隱藏無效訪問",

View File

@ -140,11 +140,11 @@ class F {
case Flavor.dev:
case Flavor.xhj_dev:
case Flavor.sky_dev:
return 'https://dev.lock.star-lock.cn';
return 'https://lock.dev.star-lock.cn';
case Flavor.pre:
case Flavor.xhj_pre:
case Flavor.sky_pre:
return 'https://pre.lock.star-lock.cn';
return 'https://lock.pre.star-lock.cn';
case Flavor.sky:
return 'https://lock.skychip.top';
case Flavor.xhj:

View File

@ -1,18 +1,17 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:star_lock/apm/apm_helper.dart';
import 'package:jverify/jverify.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/app_settings/app_settings.dart';
import 'package:star_lock/blue/blue_manage.dart';
import 'package:star_lock/blue/io_tool/manager_event_bus.dart';
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:star_lock/login/login/entity/LoginEntity.dart';
import 'package:star_lock/mine/mine/starLockMine_state.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
import 'package:star_lock/network/start_chart_api.dart';
import 'package:star_lock/talk/starChart/entity/star_chart_register_node_entity.dart';
import 'package:star_lock/tools/appFirstEnterHandle.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import '../../main/lockMian/lockMain/lockMain_logic.dart';
@ -143,7 +142,7 @@ class StarLockLoginLogic extends BaseGetXController {
if (entity.errorCode!.codeIsSuccessful) {
if (state.countryName != entity.data!.name) {
ShowTipView().showSureAlertDialog(
'国家地区的选择将影响数据安全,你当前选择的是'+state.countryName+'请确认后再继续'.tr,
'国家地区的选择将影响数据安全,你当前选择的是' + state.countryName + '请确认后再继续'.tr,
tipTitle: '确认国家或地区'.tr,
sureStr: '我知道了'.tr);
}
@ -175,11 +174,22 @@ class StarLockLoginLogic extends BaseGetXController {
state.canNext.value = state.pwdIsOK && state.isEmailOrPhone;
}
void _initEventListen() {
eventBus
.on<AgreePrivacyAgreement>()
.listen((AgreePrivacyAgreement event) async {
await JverifyOneClickLoginManage();
oneClickLoginAction();
state.isCheckVerifyEnable.value =
await JverifyOneClickLoginManage().checkVerifyEnable();
AppLog.log('一键登录初始化认证结果:${state.isCheckVerifyEnable.value}');
});
}
@override
Future<void> onInit() async {
_initEventListen();
super.onInit();
}
@override

View File

@ -18,6 +18,7 @@ import 'package:star_lock/talk/starChart/handle/impl/debug_Info_model.dart';
import 'package:star_lock/talk/starChart/status/appLifecycle_observer.dart';
import 'package:star_lock/tools/bugly/bugly_tool.dart';
import 'package:star_lock/tools/device_info_service.dart';
import 'package:star_lock/tools/eventBusEventManage.dart';
import 'package:star_lock/tools/jverify_one_click_login.dart';
import 'package:star_lock/tools/platform_info_services.dart';
import 'package:star_lock/tools/push/notification_service.dart';
@ -104,8 +105,9 @@ Future<void> privacySDKInitialization() async {
//
final StarLockLoginLogic loginLogic = Get.put(StarLockLoginLogic());
JverifyOneClickLoginManage();
await JverifyOneClickLoginManage();
loginLogic.oneClickLoginAction();
loginLogic.state.isCheckVerifyEnable.value =
await JverifyOneClickLoginManage().checkVerifyEnable();
eventBus.fire(AgreePrivacyAgreement());
}

View File

@ -22,6 +22,7 @@ class FaceListLogic extends BaseGetXController {
//
late StreamSubscription<Reply> _replySubscription;
void _initReplySubscription() {
_replySubscription =
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) {
@ -77,11 +78,15 @@ class FaceListLogic extends BaseGetXController {
userID: (await Storage.getUid())!,
faceNo: state.deletFaceNo,
useCountLimit: 0xffff,
operate: state.isDeletAll == true ? 3 : 2, // 0: 1 2: 3
operate: state.isDeletAll == true ? 3 : 2,
// 0: 1 2: 3
isAdmin: 0,
isForce: 0, //
isRound: 0, //
weekRound: 0, //
isForce: 0,
//
isRound: 0,
//
weekRound: 0,
//
startDate: 0x11223344,
endDate: 0x11223344,
startTime: '0',
@ -277,11 +282,15 @@ class FaceListLogic extends BaseGetXController {
userID: (await Storage.getUid())!,
faceNo: state.deletFaceNo,
useCountLimit: 0xffff,
operate: state.isDeletAll == true ? 3 : 2, // 0: 1 2: 3
operate: state.isDeletAll == true ? 3 : 2,
// 0: 1 2: 3
isAdmin: 0,
isForce: 0, //
isRound: 0, //
weekRound: 0, //
isForce: 0,
//
isRound: 0,
//
weekRound: 0,
//
startDate: 0x11223344,
endDate: 0x11223344,
startTime: '0',
@ -348,8 +357,8 @@ class FaceListLogic extends BaseGetXController {
lockId: state.lockId.value,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast('删除成功'.tr, something: () {
getFaceListData(isRefresh: true);
showToast('删除成功'.tr, something: () async {
await getFaceListData(isRefresh: true);
});
}
}
@ -366,8 +375,8 @@ class FaceListLogic extends BaseGetXController {
lockId: state.lockId.value,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast('重置成功'.tr, something: () {
getFaceListData(isRefresh: true);
showToast('重置成功'.tr, something: () async{
await getFaceListData(isRefresh: true);
});
}
}
@ -403,11 +412,12 @@ class FaceListLogic extends BaseGetXController {
//
late StreamSubscription _teamEvent;
void _initRefreshAction() {
_teamEvent = eventBus
.on<OtherTypeRefreshListEvent>()
.listen((OtherTypeRefreshListEvent event) {
getFaceListData(isRefresh: true);
.listen((OtherTypeRefreshListEvent event) async {
await getFaceListData(isRefresh: true);
});
}
@ -434,6 +444,7 @@ class FaceListLogic extends BaseGetXController {
// senderCheckingUserInfoCount();
}
getFaceListData(isRefresh: true);
}
@override

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -31,24 +30,6 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
final FaceListLogic logic = Get.put(FaceListLogic());
final FaceListState state = Get.find<FaceListLogic>().state;
Future<void> getHttpData({required bool isRefresh}) async {
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) {
logic.getFaceListData(isRefresh: isRefresh).then((FingerprintListDataEntity value) {
if (mounted) {
setState(() {});
}
});
}
}
@override
void initState() {
super.initState();
getHttpData(isRefresh: true);
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -92,17 +73,17 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
),
body: EasyRefreshTool(
onRefresh: () {
getHttpData(isRefresh: true);
logic.getFaceListData(isRefresh: true);
},
onLoad: () {
getHttpData(isRefresh: false);
logic.getFaceListData(isRefresh: false);
},
child: Column(
children: <Widget>[
KeySearchWidget(
editingController: state.searchController,
onSubmittedAction: () {
getHttpData(isRefresh: true);
logic.getFaceListData(isRefresh: true);
},
),
SizedBox(
@ -110,14 +91,15 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
),
Expanded(child: _buildMainUI()),
AddBottomWhiteBtn(
btnName:
'添加人脸'.tr,
btnName: '添加人脸'.tr,
onClick: () async {
await Get.toNamed(Routers.addFaceTypePage, arguments: <String, int>{
await Get.toNamed(Routers.addFaceTypePage,
arguments: <String, int>{
'lockId': state.lockId.value,
'fromType': 1 // 1 2
})!.then((value) {
getHttpData(isRefresh: true);
})!
.then((value) {
logic.getFaceListData(isRefresh: true);
});
},
),
@ -154,9 +136,11 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
logic.getKeyType(getFaceItemData),
logic.getKeyDateType(getFaceItemData), () async {
await Get.toNamed(Routers.faceDetailPage,
arguments: <String, FingerprintItemData>{
arguments: <String, FingerprintItemData>{
'faceItemData': getFaceItemData,
})!.then((value) => getHttpData(isRefresh: true));
})!
.then((value) =>
logic.getFaceListData(isRefresh: true));
}),
);
}

View File

@ -105,6 +105,13 @@ class AddFingerprintLogic extends BaseGetXController {
token: token,
isBeforeAddUser: false);
break;
case 0xFE:
//
state.ifAddState.value = false;
showToast('管理员已满'.tr, something: () {
Get.back();
});
break;
default:
//
state.ifAddState.value = false;

View File

@ -285,7 +285,7 @@ class LockDetailLogic extends BaseGetXController {
final List<int> publicKeyData =
state.keyInfos.value.bluetooth!.publicKey!.cast<int>();
final List<String> saveStrList = changeIntListToStringList(publicKeyData);
await Storage.setStringList(saveBluePublicKey, saveStrList);
await Storage.setStringList(saveBluePublicKey, saveStrList);
//
final List<int> privateKeyData =
@ -298,7 +298,7 @@ class LockDetailLogic extends BaseGetXController {
final List<int> signKeyData =
state.keyInfos.value.bluetooth!.signKey!.cast<int>();
final List<String> saveSignKeyList = changeIntListToStringList(signKeyData);
await Storage.setStringList(saveBlueSignKey, saveSignKeyList);
await Storage.setStringList(saveBlueSignKey, saveSignKeyList);
final bool ifHaveKey = await Storage.ifHaveKey(saveBlueToken);
if (!ifHaveKey) {
@ -838,5 +838,12 @@ class LockDetailLogic extends BaseGetXController {
state.keyInfos.refresh();
}
});
eventBus
.on<SuccessfulDistributionNetwork>()
.listen((SuccessfulDistributionNetwork event) {
//
requestDeviceNetworkInfo();
});
}
}

View File

@ -89,7 +89,6 @@ class _LockDetailPageState extends State<LockDetailPage>
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
state.isOpenLockNeedOnline.refresh();
logic.requestDeviceNetworkInfo();
}
StreamSubscription? _lockRefreshLockDetailInfoDataEvent;
@ -1024,7 +1023,7 @@ class _LockDetailPageState extends State<LockDetailPage>
Widget widget = getBottomWidget()[index];
return widget;
},
physics: const NeverScrollableScrollPhysics(),
// physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
)

View File

@ -62,10 +62,8 @@ class ConfiguringWifiLogic extends BaseGetXController {
peerId: peerId,
);
if (entity.errorCode!.codeIsSuccessful) {
await _getUploadLockSet();
showToast('配网成功'.tr, something: () async {
eventBus
.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
// peerID
StartChartManage().lockNetworkInfo = DeviceNetworkInfo(
wifiName: wifiName,
@ -74,6 +72,7 @@ class ConfiguringWifiLogic extends BaseGetXController {
peerId: peerId,
);
});
_getUploadLockSet();
}
}
@ -135,7 +134,7 @@ class ConfiguringWifiLogic extends BaseGetXController {
//
await Storage.saveLockNetWorkInfo(jsonMap);
//
updateNetworkInfo(
updateNetworkInfo(
peerId: peerId ?? '',
wifiName: wifiName ?? '',
secretKey: secretKey ?? '',
@ -231,6 +230,13 @@ class ConfiguringWifiLogic extends BaseGetXController {
password: state.wifiPWDController.text,
gatewayConfigurationStr: state.getGatewayConfigurationStr,
);
} else if (connectionState == BluetoothConnectionState.disconnected) {
dismissEasyLoading();
cancelBlueConnetctToastTimer();
state.sureBtnState.value = 0;
if (state.ifCurrentScreen.value == true) {
showBlueConnetctToast();
}
}
},
isAddEquipment: true,
@ -391,10 +397,10 @@ class ConfiguringWifiLogic extends BaseGetXController {
//
Future<void> _getUploadLockSet() async {
showEasyLoading();
showBlueConnetctToastTimer(action: () {
dismissEasyLoading();
});
// showEasyLoading();
// showBlueConnetctToastTimer(action: () {
// dismissEasyLoading();
// });
BlueManage().blueSendData(BlueManage().connectDeviceName,
(BluetoothConnectionState connectionState) async {
if (connectionState == BluetoothConnectionState.connected) {
@ -476,6 +482,10 @@ class ConfiguringWifiLogic extends BaseGetXController {
Get.offAllNamed(Routers.starLockMain);
}
dismissEasyLoading();
eventBus
.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
eventBus
.fire(SuccessfulDistributionNetwork());
if (state.loadingTimer != null) {
state.loadingTimer!.cancel();
state.loadingTimer = null;
@ -493,6 +503,5 @@ class ConfiguringWifiLogic extends BaseGetXController {
state.loadingTimer!.cancel();
state.loadingTimer = null;
}
}
}

View File

@ -456,10 +456,10 @@ class _MineSetPageState extends State<MineSetPage>
// showLoginOutAlertTipDialog();
}),
Container(
padding: EdgeInsets.only(right: 30.w, top: 30.h),
padding: EdgeInsets.only(left: 30.w, top: 30.h),
// color: Colors.red,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
TextButton(
child: Text(

View File

@ -25,8 +25,24 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle
RxString currentLanguage =
CurrentLocaleTool.getCurrentLocaleString().obs; //
//
int _lastRequestTime = 0;
@override
void handleReq(ScpMessage scpMessage) async {
final currentTime = DateTime.now().millisecondsSinceEpoch;
// 1
if (currentTime - _lastRequestTime < 1000) {
// 1
replyErrorMessage(scpMessage);
AppLog.log('对讲请求过于频繁,已拒绝');
return;
}
//
_lastRequestTime = currentTime;
//
final loginData = await Storage.getLoginData();
@ -47,6 +63,7 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle
} else {
// ,
replyErrorMessage(scpMessage);
AppLog.log('正在接听,回复拒绝');
}
}

View File

@ -28,17 +28,16 @@ class AppLifecycleObserver extends WidgetsBindingObserver {
void onAppPaused() {
//
print('App has entered the background.');
if (StartChartManage().talkStatus.status ==
TalkStatus.passiveCallWaitingAnswer ||
StartChartManage().talkStatus.status ==
TalkStatus.proactivelyCallWaitingAnswer) {
StartChartManage().startTalkHangupMessageTimer();
StartChartManage().startTalkRejectMessageTimer();
// 退
final status = StartChartManage().talkStatus.status;
if (status == TalkStatus.passiveCallWaitingAnswer ||
status == TalkStatus.proactivelyCallWaitingAnswer ||
status == TalkStatus.answeredSuccessfully ||
status == TalkStatus.uninitialized) {
StartChartManage().destruction();
Get.back();
}
StartChartManage().destruction();
}
void onAppResumed() async {

View File

@ -56,6 +56,9 @@ class TalkViewLogic extends BaseGetXController {
final Map<String, ui.Image> _imageCache = {};
//
int _lastFrameTimestamp = 0; // 0
//
int _frameCount = 0;
int _lastFpsUpdateTime = 0;
@ -100,11 +103,11 @@ class TalkViewLogic extends BaseGetXController {
//
switch (contentType) {
case TalkData_ContentTypeE.G711:
//
if (_isFirstAudioFrame) {
_startAudioTime = currentTime;
_isFirstAudioFrame = false;
}
// //
// if (_isFirstAudioFrame) {
// _startAudioTime = currentTime;
// _isFirstAudioFrame = false;
// }
//
final expectedTime = _startAudioTime + talkData.durationMs;
@ -130,15 +133,16 @@ class TalkViewLogic extends BaseGetXController {
if (_isFirstFrame) {
_startTime = currentTime;
_isFirstFrame = false;
// AppLog.log('记录第一帧的时间戳${currentTime},${talkData.durationMs}');
AppLog.log('第一帧帧的时间戳:${talkData.durationMs}');
}
// AppLog.log('其他帧的时间戳:${talkData.durationMs}');
//
if (_lastFrameTimestamp != 0) {
final int frameInterval = talkData.durationMs - _lastFrameTimestamp;
_adjustBufferSize(frameInterval); //
}
_lastFrameTimestamp = talkData.durationMs; //
// -
final expectedTime = _startTime + talkData.durationMs;
final videoDelay = currentTime - expectedTime; //
//
_adjustBufferSize(videoDelay);
//
if (state.videoBuffer.length >= bufferSize) {
state.videoBuffer.removeAt(0);
@ -257,19 +261,21 @@ class TalkViewLogic extends BaseGetXController {
}
//
void _adjustBufferSize(int delay) {
const int delayThresholdHigh = 250; // 3
const int delayThresholdLow = 166; // 2
void _adjustBufferSize(int frameInterval) {
const int frameDuration = 83; // 83ms12fps
const int delayThresholdHigh = frameDuration * 2; // 2
const int delayThresholdLow = frameDuration; // 1
const int adjustInterval = 1; // 1
if (delay > delayThresholdHigh && bufferSize < maxBufferSize) {
//
if (frameInterval > delayThresholdHigh && bufferSize < maxBufferSize) {
//
bufferSize = min(bufferSize + adjustInterval, maxBufferSize);
// AppLog.log('📈 增加缓冲区 - 当前大小: $bufferSize, 延迟: ${delay}ms');
} else if (delay < delayThresholdLow && bufferSize > minBufferSize) {
//
AppLog.log('📈 增加缓冲区 - 当前大小: $bufferSize, 帧间间隔: ${frameInterval}ms');
} else if (frameInterval < delayThresholdLow &&
bufferSize > minBufferSize) {
//
bufferSize = max(bufferSize - adjustInterval, minBufferSize);
// AppLog.log('📉 减少缓冲区 - 当前大小: $bufferSize, 延迟: ${delay}ms');
AppLog.log('📉 减少缓冲区 - 当前大小: $bufferSize, 帧间间隔: ${frameInterval}ms');
}
}

View File

@ -195,3 +195,12 @@ class RogerThatLockInfoDataEvent {
class GetGatewayListRefreshUI {
GetGatewayListRefreshUI();
}
///
class AgreePrivacyAgreement {
AgreePrivacyAgreement();
}
///
class SuccessfulDistributionNetwork {
SuccessfulDistributionNetwork();
}