Merge branch 'develop_liyi' of code-internal.star-lock.cn:StarlockTeam/app-starlock into develop_liyi

This commit is contained in:
“DaisyWu” 2025-02-10 09:45:50 +08:00
commit d9aadc0cd1
18 changed files with 142 additions and 56 deletions

View File

@ -6,7 +6,7 @@
<string>development</string>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:lock.skychip.top</string>
<string>applinks:lock.xhjcn.ltd</string>
</array>
<key>com.apple.external-accessory.wireless-configuration</key>
<true/>

View File

@ -30,10 +30,10 @@
<key>CFBundleURLIconFile</key>
<string></string>
<key>CFBundleURLName</key>
<string>com.sky.skysmartlock</string>
<string>com.xhj.xhjsmartlock</string>
<key>CFBundleURLSchemes</key>
<array>
<string>skysmartlock</string>
<string>xhjsmartlock</string>
<string></string>
<string></string>
</array>
@ -45,7 +45,7 @@
<string>weixin</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wxbe340095d2b8fd51</string>
<string>wx8e48112e22343817</string>
</array>
</dict>
</array>

View File

@ -39,6 +39,13 @@ class UmengKey {
typedef dynamic fCallFunction();
class WechatAppInfo {
WechatAppInfo({required this.wechatAppId, required this.universalLink});
String wechatAppId;
String universalLink;
}
class F {
static Flavor? appFlavor;
@ -281,6 +288,37 @@ class F {
}
}
static WechatAppInfo get wechatAppInfo {
switch (appFlavor) {
case Flavor.local:
return WechatAppInfo(
wechatAppId: 'wxbe340095d2b8fd51',
universalLink: 'https://apt.skychip.top/');
case Flavor.dev:
return WechatAppInfo(
wechatAppId: 'wxbe340095d2b8fd51',
universalLink: 'https://apt.skychip.top/');
case Flavor.pre:
case Flavor.sky_pre:
case Flavor.xhj_pre:
return WechatAppInfo(
wechatAppId: 'wxbe340095d2b8fd51',
universalLink: 'https://apt.skychip.top/');
case Flavor.sky:
return WechatAppInfo(
wechatAppId: 'wxbe340095d2b8fd51',
universalLink: 'https://lock.skychip.top/');
case Flavor.xhj:
case Flavor.xhj_bundle:
return WechatAppInfo(
wechatAppId: 'wx8e48112e22343817',
universalLink: 'https://lock.xhjcn.ltd/');
default:
return WechatAppInfo(
wechatAppId: 'wxbe340095d2b8fd51', universalLink: '');
}
}
//
static bool get isProductionEnv {
switch (appFlavor) {

View File

@ -146,13 +146,48 @@ class CatEyeSetLogic extends BaseGetXController {
_getConfigAndGenerateBleData() async {
// state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0].catEyeMode
int originalCatEyeMode = state
.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0].catEyeMode!;
int recordMode = state.lockSetInfoData.value.lockSettingInfo!
.catEyeConfig![0].catEyeModeConfig!.recordMode ==
0
? 1
: 0;
int originalCatEyeMode = 0;
int recordMode = 0;
int recordStartTime = 0;
int recordEndTime = 0;
int recordTime = 0;
int detectionDistance = 0;
int realTimeMode = 0;
if (state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig != null &&
state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig!.length > 0) {
originalCatEyeMode = state
.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0].catEyeMode!;
recordMode = state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0]
.catEyeModeConfig!.recordMode ==
0
? 1
: 0;
recordStartTime = _handleTimeToM(state
.lockSetInfoData
.value
.lockSettingInfo!
.catEyeConfig![0]
.catEyeModeConfig!
.recordStartTime!);
recordEndTime = _handleTimeToM(state.lockSetInfoData.value
.lockSettingInfo!.catEyeConfig![0].catEyeModeConfig!.recordEndTime!);
recordTime = _handleGetIntNumber(state.lockSetInfoData.value
.lockSettingInfo!.catEyeConfig![0].catEyeModeConfig!.recordTime!);
if (state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0]!
.catEyeModeConfig!.detectionDistance !=
null) {
detectionDistance = _handleDetectionDistance(state
.lockSetInfoData
.value
.lockSettingInfo!
.catEyeConfig![0]
.catEyeModeConfig!
.detectionDistance!);
}
realTimeMode = state.lockSetInfoData.value.lockSettingInfo!
.catEyeConfig![0].catEyeModeConfig!.realTimeMode!;
}
int stayWarn = state.lockSetInfoData.value.lockSettingInfo!.stayWarn!;
int abnormalWarn =
@ -160,30 +195,6 @@ class CatEyeSetLogic extends BaseGetXController {
int autoLightScreen =
state.lockSetInfoData.value.lockSettingInfo!.autoLightScreen!;
int recordStartTime = _handleTimeToM(state.lockSetInfoData.value
.lockSettingInfo!.catEyeConfig![0].catEyeModeConfig!.recordStartTime!);
int recordEndTime = _handleTimeToM(state.lockSetInfoData.value
.lockSettingInfo!.catEyeConfig![0].catEyeModeConfig!.recordEndTime!);
int recordTime = _handleGetIntNumber(state.lockSetInfoData.value
.lockSettingInfo!.catEyeConfig![0].catEyeModeConfig!.recordTime!);
int detectionDistance = 0;
if (state.lockSetInfoData.value.lockSettingInfo!.catEyeConfig![0]!
.catEyeModeConfig!.detectionDistance !=
null) {
detectionDistance = _handleDetectionDistance(state
.lockSetInfoData
.value
.lockSettingInfo!
.catEyeConfig![0]
.catEyeModeConfig!
.detectionDistance!);
}
int realTimeMode = state.lockSetInfoData.value.lockSettingInfo!
.catEyeConfig![0].catEyeModeConfig!.realTimeMode!;
// catEyeMode
int adjustedCatEyeMode =
originalCatEyeMode > 0 ? originalCatEyeMode - 1 : originalCatEyeMode;

View File

@ -49,7 +49,7 @@ class StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
onTap: () {
WechatManageTool.getAppInfo(() {
WxPushWeChatMiniProgramTool.pushWeChatMiniProgram(
'wxbe340095d2b8fd51');
F.wechatAppInfo.wechatAppId, F.wechatAppInfo.universalLink);
});
},
child: Padding(

View File

@ -86,7 +86,8 @@ class _MineSetPageState extends State<MineSetPage>
onTap: () {
WechatManageTool.getAppInfo(() {
WxPushWeChatMiniProgramTool.pushWeChatMiniProgram(
'wxbe340095d2b8fd51');
F.wechatAppInfo.wechatAppId,
F.wechatAppInfo.universalLink);
});
},
child: ClipRRect(

View File

@ -59,10 +59,15 @@ class UdpRbcuInfoHandler extends ScpMessageBaseHandle
@override
void handleResp(ScpMessage scpMessage) {
final RbcuInfo rbcuInfo = scpMessage.Payload;
final GenericResp genericResp = scpMessage.Payload;
if (checkGenericRespSuccess(genericResp)) {
//
startChartManage.stopSendingRbcuInfoMessages();
if (rbcuInfo.isResp) {
//
_handleResultRbcuInfo(rbcuInfo);
}
}
}
@ -70,5 +75,6 @@ class UdpRbcuInfoHandler extends ScpMessageBaseHandle
void _handleResultRbcuInfo(RbcuInfo rbcuInfo) {
startChartManage.rbcuInfo = rbcuInfo;
startChartManage.stopSendingRbcuInfoMessages();
startChartManage.startSendingRbcuProbeTMessages();
}
}

View File

@ -40,6 +40,9 @@ class UdpTalkAcceptHandler extends ScpMessageBaseHandle
//
talkeRequestOverTimeTimerManager.renew();
talkeRequestOverTimeTimerManager.cancel();
// rbcuInfo数据
startChartManage.startSendingRbcuInfoMessages(
ToPeerId: startChartManage.lockPeerId);
}
}

View File

@ -15,7 +15,9 @@ class UdpTalkDataHandler extends ScpMessageBaseHandle
factory UdpTalkDataHandler() {
return _instance;
}
UdpTalkDataHandler._internal();
static final UdpTalkDataHandler _instance = UdpTalkDataHandler._internal();
int _recentRecvDataRate = 0;
@ -157,7 +159,7 @@ class UdpTalkDataHandler extends ScpMessageBaseHandle
final TalkDataH264Frame talkDataH264Frame = TalkDataH264Frame();
talkDataH264Frame.mergeFromBuffer(talkData.content);
// AppLog.log('H264 TalkData :$talkDataH264Frame');
talkDataRepository.addTalkData(talkData);
// talkDataRepository.addTalkData(talkData);
}
///

View File

@ -34,6 +34,8 @@ class UdpTalkHangUpHandler extends ScpMessageBaseHandle
talkDataOverTimeTimerManager.cancel();
EasyLoading.showToast('已挂断'.tr);
startChartManage.stopSendingRbcuInfoMessages();
startChartManage.stopSendingRbcuProBeMessages();
Get.back();
}
}
@ -49,6 +51,8 @@ class UdpTalkHangUpHandler extends ScpMessageBaseHandle
talkeRequestOverTimeTimerManager.cancel();
talkePingOverTimeTimerManager.cancel();
talkDataOverTimeTimerManager.cancel();
startChartManage.stopSendingRbcuInfoMessages();
startChartManage.stopSendingRbcuProBeMessages();
}
@override

View File

@ -31,6 +31,8 @@ class UdpTalkRejectHandler extends ScpMessageBaseHandle
talkeRequestOverTimeTimerManager.cancel();
talkePingOverTimeTimerManager.cancel();
talkDataOverTimeTimerManager.cancel();
startChartManage.stopSendingRbcuInfoMessages();
startChartManage.stopSendingRbcuProBeMessages();
}
@override
@ -43,6 +45,8 @@ class UdpTalkRejectHandler extends ScpMessageBaseHandle
talkeRequestOverTimeTimerManager.cancel();
talkePingOverTimeTimerManager.cancel();
talkDataOverTimeTimerManager.cancel();
startChartManage.stopSendingRbcuInfoMessages();
startChartManage.stopSendingRbcuProBeMessages();
}
@override

View File

@ -33,6 +33,8 @@ class TalkDataOverTimeTimerManager {
StartChartManage().sendTalkHangupMessage();
StartChartManage().stopTalkPingMessageTimer();
StartChartManage().stopTalkExpectMessageTimer();
StartChartManage().stopSendingRbcuInfoMessages();
StartChartManage().stopSendingRbcuProBeMessages();
talkStatus.setNotTalkData();
talkStatus.setEnd();
AudioPlayerManager().stopRingtone();

View File

@ -37,6 +37,8 @@ class TalkePingOverTimeTimerManager {
StartChartManage().stopTalkExpectMessageTimer();
//
StartChartManage().sendTalkHangupMessage();
StartChartManage().stopSendingRbcuInfoMessages();
StartChartManage().stopSendingRbcuProBeMessages();
talkStatus.setNotTalkPing();
talkStatus.setEnd();
Get.back();

View File

@ -32,6 +32,8 @@ class TalkeRequestOverTimeTimerManager {
EasyLoading.showToast('通话未接通,已挂断'.tr, duration: 2000.milliseconds);
//
StartChartManage().sendTalkRejectMessage();
StartChartManage().stopSendingRbcuInfoMessages();
StartChartManage().stopSendingRbcuProBeMessages();
talkStatus.setInitializationCompleted();
Get.back();
}

View File

@ -314,9 +314,10 @@ class StartChartManage {
);
}
final info = rbcuInfo = RbcuInfo(address: ['119.137.55.161:62289']);
if (info != null && info.address != null && info.address.length > 0) {
info.address.forEach((element) {
if (rbcuInfo != null &&
rbcuInfo!.address != null &&
rbcuInfo!.address.length > 0) {
rbcuInfo!.address.forEach((element) {
// element
final parts = element.split(':');
final host = parts[0]; // IP
@ -345,6 +346,7 @@ class StartChartManage {
rbcuInfoTimer ??=
Timer.periodic(Duration(seconds: _defaultIntervalTime), (timer) {
// RbcuInfo
_log(text: '发送RbcuInfo 地址交换消息');
_sendRbcuInfoMessage(ToPeerId: ToPeerId);
});
}
@ -585,6 +587,8 @@ class StartChartManage {
stopTalkExpectMessageTimer();
stopTalkPingMessageTimer();
stopCallRequestMessageTimer();
stopSendingRbcuInfoMessages();
stopSendingRbcuProBeMessages();
//
talkePingOverTimeTimerManager.cancel();
@ -665,6 +669,8 @@ class StartChartManage {
stopTalkExpectMessageTimer();
stopTalkPingMessageTimer();
stopCallRequestMessageTimer();
stopSendingRbcuInfoMessages();
stopSendingRbcuProBeMessages();
//
talkePingOverTimeTimerManager.cancel();
talkDataOverTimeTimerManager.cancel();
@ -1101,7 +1107,7 @@ class StartChartManage {
bluetoothDeviceName: bluetoothDeviceName,
bleStructData: bleStructData,
);
await _sendMessage(message: message);
await _sendMessage(message: message);
}
///

View File

@ -58,6 +58,7 @@ class _TalkViewPageState extends State<TalkViewPage>
// _latencyStream = measureServerLatencyStream(F.apiPrefix); //
}
//
// Stream<int> measureServerLatencyStream(String url) async* {
// while (true) {
@ -155,7 +156,7 @@ class _TalkViewPageState extends State<TalkViewPage>
),
Obx(() => state.listData.value.isEmpty
? Positioned(
bottom: 300.h,
bottom: 310.h,
child: Text(
'正在创建安全连接...'.tr,
style: TextStyle(color: Colors.black, fontSize: 26.sp),
@ -509,13 +510,17 @@ class _TalkViewPageState extends State<TalkViewPage>
onLongPress: longPress,
onLongPressUp: longPressUp,
child: SizedBox(
height: 140.h,
height: 160.w,
width: 140.w,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
width: wh,
height: wh,
constraints: BoxConstraints(
minWidth: wh,
),
decoration: BoxDecoration(
color: backgroundColor,
borderRadius: BorderRadius.circular((wh + 10.w * 2) / 2),
@ -524,10 +529,11 @@ class _TalkViewPageState extends State<TalkViewPage>
child: Image.asset(iconUrl, fit: BoxFit.fitWidth),
),
SizedBox(height: 20.w),
Expanded(
child: Text(name,
style: TextStyle(fontSize: 20.sp, color: Colors.white),
textAlign: TextAlign.center),
Text(
name,
style: TextStyle(fontSize: 20.sp, color: Colors.white),
textAlign: TextAlign.center, // 使
maxLines: 2, // 1
)
],
),

View File

@ -23,10 +23,9 @@ class WxPushWeChatMiniProgramTool {
doOnIOS: true);
}
static Future<void> pushWeChatMiniProgram(String appId) async {
static Future<void> pushWeChatMiniProgram(String appId,String _associationUrl) async {
if (!isInit) {
isInit = true;
final String _associationUrl = await Storage.getAssociationUrl();
await initWeChatMiniProgram(appId, _associationUrl);
final MiniProgram miniProgram = MiniProgram(

View File

@ -109,12 +109,12 @@ version: 1.0.85+2025010802
environment:
sdk: '>=2.12.0 <3.0.0'
fluwx:
app_id: 'wxbe340095d2b8fd51'
debug_logging: true
android:
ios:
universal_link: https://lock.skychip.top/apple-app-site-association.json
#fluwx:
# app_id: 'wxbe340095d2b8fd51'
# debug_logging: true
# android:
# ios:
# universal_link: https://lock.skychip.top/apple-app-site-association.json
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions