소스 검색

1. [connectDeviceManager shareInstance].DeviceThirdIdMod改为 ksharedAppDelegate.DeviceThirdIdMod

huangxiaodong 9 달 전
부모
커밋
5a366a2134
44개의 변경된 파일335개의 추가작업 그리고 103개의 파일을 삭제
  1. 20 0
      创维盒子/双子星云手机.xcodeproj/project.pbxproj
  2. 4 0
      创维盒子/双子星云手机/AppDelegate/AppDelegate.h
  3. 2 2
      创维盒子/双子星云手机/AppDelegate/AppDelegate.m
  4. 4 3
      创维盒子/双子星云手机/AppDelegate/PrefixHeader.pch
  5. 114 31
      创维盒子/双子星云手机/AppDelegate/SceneDelegate.m
  6. 3 3
      创维盒子/双子星云手机/Class/Calculator/CalculatorViewController.m
  7. 3 3
      创维盒子/双子星云手机/Class/Controller/HWWebViewController.m
  8. 1 1
      创维盒子/双子星云手机/Class/Guide/AuthCodeView/AuthCodeInputView.m
  9. 3 3
      创维盒子/双子星云手机/Class/Guide/GuideViewController.m
  10. 4 4
      创维盒子/双子星云手机/Class/Guide/inputPWDViewController.m
  11. 1 1
      创维盒子/双子星云手机/Class/Set/CustomerWebViewController.m
  12. 1 1
      创维盒子/双子星云手机/Class/Set/MySetViewController.m
  13. 1 1
      创维盒子/双子星云手机/Class/Set/previewFile/shareRecordViewController.m
  14. 1 1
      创维盒子/双子星云手机/Class/Set/previewFile/videoPlayByAVPlayerViewController.m
  15. 1 1
      创维盒子/双子星云手机/Class/Set/previewFile/view/editShareView.m
  16. 2 2
      创维盒子/双子星云手机/Class/Set/privacyMode/privacyModeTipViewController.m
  17. 5 5
      创维盒子/双子星云手机/Class/Set/privacyMode/privacyModeViewController.m
  18. 1 1
      创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/backupsFileManager.h
  19. 2 2
      创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/backupsFileManager.m
  20. 1 1
      创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/boxDownloadFileManager.h
  21. 2 2
      创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/boxDownloadFileManager.m
  22. 1 1
      创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/boxSaveFileManager.h
  23. 1 1
      创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/cachesFileManager.h
  24. 1 1
      创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/downloadManager.h
  25. 1 1
      创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/downloadThumbnailManager.h
  26. 1 1
      创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/uploadFileManager.h
  27. 4 4
      创维盒子/双子星云手机/Class/Set/view/allVersionView.m
  28. 1 1
      创维盒子/双子星云手机/CloudPlayer/PlayerViewController+otherDelegate.mm
  29. 2 2
      创维盒子/双子星云手机/CloudPlayer/PlayerViewController.mm
  30. 2 2
      创维盒子/双子星云手机/CloudPlayer/View/playerShowSecretkeyView.m
  31. 2 2
      创维盒子/双子星云手机/NAS/nasBackupsManager/nasBackupsManager.m
  32. 1 1
      创维盒子/双子星云手机/NAS/nasDownloadManager/nasDownloadFileManager.h
  33. 1 1
      创维盒子/双子星云手机/NAS/nasDownloadManager/nasDownloadFileManager.m
  34. 1 1
      创维盒子/双子星云手机/NAS/nasUploadManager/nasUploadFileManager.h
  35. 2 2
      创维盒子/双子星云手机/NAS/view/errorAlertTool.m
  36. 2 2
      创维盒子/双子星云手机/cloudPhone/websocket/webSocketManager.m
  37. 1 1
      创维盒子/双子星云手机/connectDeviceManager/connectDeviceManager.m
  38. 1 1
      创维盒子/双子星云手机/mine/PCLoginViewController.m
  39. 3 3
      创维盒子/双子星云手机/mine/mineViewController.m
  40. 1 1
      创维盒子/双子星云手机/mine/scanToPCLoginViewController.m
  41. 2 2
      创维盒子/双子星云手机/netWork/addLog/addLogObject.m
  42. 4 4
      创维盒子/双子星云手机/netWork/netWorkManager.m
  43. 24 0
      创维盒子/双子星云手机/webRtc/webRtcManager/webRtcManager.h
  44. 100 0
      创维盒子/双子星云手机/webRtc/webRtcManager/webRtcManager.m

+ 20 - 0
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -440,6 +440,10 @@
 		6B3E7A7C2C89AD5500B032C4 /* webRtcPlayerViewController+AdjustPlayerViewFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B3E7A7A2C89AD5500B032C4 /* webRtcPlayerViewController+AdjustPlayerViewFrame.m */; };
 		6B3E7A7D2C89AD5500B032C4 /* webRtcPlayerViewController+AdjustPlayerViewFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3E7A792C89AD5500B032C4 /* webRtcPlayerViewController+AdjustPlayerViewFrame.h */; };
 		6B3E7A7E2C89AD5500B032C4 /* webRtcPlayerViewController+AdjustPlayerViewFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B3E7A7A2C89AD5500B032C4 /* webRtcPlayerViewController+AdjustPlayerViewFrame.m */; };
+		6B3E7A822C89CC1300B032C4 /* webRtcManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3E7A802C89CC1300B032C4 /* webRtcManager.h */; };
+		6B3E7A832C89CC1300B032C4 /* webRtcManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B3E7A812C89CC1300B032C4 /* webRtcManager.m */; };
+		6B3E7A842C89CC1300B032C4 /* webRtcManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3E7A802C89CC1300B032C4 /* webRtcManager.h */; };
+		6B3E7A852C89CC1400B032C4 /* webRtcManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B3E7A812C89CC1300B032C4 /* webRtcManager.m */; };
 		6B3F96342AD2A15A008E349E /* netWorkManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3F96322AD2A15A008E349E /* netWorkManager.h */; };
 		6B3F96352AD2A15A008E349E /* netWorkManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B3F96332AD2A15A008E349E /* netWorkManager.m */; };
 		6B3F963A2AD2AD0B008E349E /* newWorkInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3F96392AD2AD0B008E349E /* newWorkInterface.h */; };
@@ -1780,6 +1784,8 @@
 		6B3E7A742C8960CA00B032C4 /* webRtcPlayerBottomContrView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = webRtcPlayerBottomContrView.m; sourceTree = "<group>"; };
 		6B3E7A792C89AD5500B032C4 /* webRtcPlayerViewController+AdjustPlayerViewFrame.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "webRtcPlayerViewController+AdjustPlayerViewFrame.h"; sourceTree = "<group>"; };
 		6B3E7A7A2C89AD5500B032C4 /* webRtcPlayerViewController+AdjustPlayerViewFrame.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "webRtcPlayerViewController+AdjustPlayerViewFrame.m"; sourceTree = "<group>"; };
+		6B3E7A802C89CC1300B032C4 /* webRtcManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = webRtcManager.h; sourceTree = "<group>"; };
+		6B3E7A812C89CC1300B032C4 /* webRtcManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = webRtcManager.m; sourceTree = "<group>"; };
 		6B3F96322AD2A15A008E349E /* netWorkManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = netWorkManager.h; sourceTree = "<group>"; };
 		6B3F96332AD2A15A008E349E /* netWorkManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = netWorkManager.m; sourceTree = "<group>"; };
 		6B3F96392AD2AD0B008E349E /* newWorkInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = newWorkInterface.h; sourceTree = "<group>"; };
@@ -3039,6 +3045,15 @@
 			path = view;
 			sourceTree = "<group>";
 		};
+		6B3E7A7F2C89CBF100B032C4 /* webRtcManager */ = {
+			isa = PBXGroup;
+			children = (
+				6B3E7A802C89CC1300B032C4 /* webRtcManager.h */,
+				6B3E7A812C89CC1300B032C4 /* webRtcManager.m */,
+			);
+			path = webRtcManager;
+			sourceTree = "<group>";
+		};
 		6B3F96312AD2A0FA008E349E /* netWork */ = {
 			isa = PBXGroup;
 			children = (
@@ -3364,6 +3379,7 @@
 		6B8676802C855ECC00F81DFC /* webRtc */ = {
 			isa = PBXGroup;
 			children = (
+				6B3E7A7F2C89CBF100B032C4 /* webRtcManager */,
 				6B3E7A722C89609E00B032C4 /* view */,
 				6B8676942C8596F800F81DFC /* model */,
 				6B8676812C855EDF00F81DFC /* WebRTC.framework */,
@@ -3975,6 +3991,7 @@
 				6B5B60602B3BC8DE009A2AE2 /* fileTransferPopView.h in Headers */,
 				6BB573342C8076F000713351 /* nasBackupsManager.h in Headers */,
 				181E85002A8F6B1800292B96 /* LogoSelectView.h in Headers */,
+				6B3E7A822C89CC1300B032C4 /* webRtcManager.h in Headers */,
 				6B8A5AE02C3BCC0E00E40B19 /* lastFileModel.h in Headers */,
 				6B5B60762B3E665E009A2AE2 /* filePathCreatPopView.h in Headers */,
 				18BA24872AA5C57900BA01EE /* RSATool.h in Headers */,
@@ -4257,6 +4274,7 @@
 				6BD506AB2B9576A4006E7CB0 /* fileTransferPopView.h in Headers */,
 				6BB573362C8076F500713351 /* nasBackupsManager.h in Headers */,
 				6BD506AC2B9576A4006E7CB0 /* LogoSelectView.h in Headers */,
+				6B3E7A842C89CC1300B032C4 /* webRtcManager.h in Headers */,
 				6B8A5AE32C3BCC0E00E40B19 /* lastFileModel.h in Headers */,
 				6BD506AD2B9576A4006E7CB0 /* filePathCreatPopView.h in Headers */,
 				6BD506AE2B9576A4006E7CB0 /* RSATool.h in Headers */,
@@ -5079,6 +5097,7 @@
 				6BD5077B2B9576A4006E7CB0 /* HWSearchBar.m in Sources */,
 				6BD5077C2B9576A4006E7CB0 /* HWFolderListCell.m in Sources */,
 				6BD5077D2B9576A4006E7CB0 /* RSA.m in Sources */,
+				6B3E7A852C89CC1400B032C4 /* webRtcManager.m in Sources */,
 				6BD5077E2B9576A4006E7CB0 /* RSATool.m in Sources */,
 				6B5BE5822BFC81E300A1B9B3 /* NASFileAndFolderModel.m in Sources */,
 				6BD5077F2B9576A4006E7CB0 /* iPhone.m in Sources */,
@@ -5443,6 +5462,7 @@
 				A003F6F827D8775A00715CBF /* HWSearchBar.m in Sources */,
 				A00221E027EB0EBF00E45F78 /* HWFolderListCell.m in Sources */,
 				A003F6D027D8425C00715CBF /* RSA.m in Sources */,
+				6B3E7A832C89CC1300B032C4 /* webRtcManager.m in Sources */,
 				18BA24882AA5C57900BA01EE /* RSATool.m in Sources */,
 				6B5BE5802BFC81E300A1B9B3 /* NASFileAndFolderModel.m in Sources */,
 				1866F99E2A136DC700B31E22 /* iPhone.m in Sources */,

+ 4 - 0
创维盒子/双子星云手机/AppDelegate/AppDelegate.h

@@ -10,6 +10,7 @@
 #import "NASMsgModel.h"
 #import "couldPhoneBaseInfoModel.h"
 #import "TvStatusModel.h"
+#import "webRtcMsgModel.h"
 
 @interface AppDelegate : UIResponder <UIApplicationDelegate>
 
@@ -37,6 +38,9 @@
 //与 isFirstInputPwdDone 有重复的地方 后续优化
 @property (nonatomic, assign)  BOOL isDidShowPwdType;// 是否显示密码界面了
 
+@property(nonatomic,strong) DeviceThirdIdModel *DeviceThirdIdMod;//设备的第三方信息  连接时需要
+@property(nonatomic,strong) webRtcMsgModel *DeviceWebRtcMsgMod;//设备的第三方信息  连接时需要
+
 @property (nonatomic, assign)BOOL supportScreenRotateType;
 +(AppDelegate*)sharedAppDelegate;
 @end

+ 2 - 2
创维盒子/双子星云手机/AppDelegate/AppDelegate.m

@@ -97,7 +97,7 @@
         if (rotationGravityz > 0.85){
             
             BOOL haveOpenMask = [HWDataManager getBoolWithKey:Consn_Fanzhuan_Exit_app_Open];
-            BOOL isPrivacyMode = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode;
+            BOOL isPrivacyMode = ksharedAppDelegate.DeviceThirdIdMod.data.isPrivacyMode;
             if (haveOpenMask && isPrivacyMode){
                 exit(0);/*强制退出app*/
             }
@@ -346,7 +346,7 @@
     }
     
     if([connectDeviceManager shareInstance].isPingOk){
-        return [NSString stringWithFormat:@"http://%@:9888/",[connectDeviceManager shareInstance].DeviceThirdIdMod.data.ip];
+        return [NSString stringWithFormat:@"http://%@:9888/",ksharedAppDelegate.DeviceThirdIdMod.data.ip];
     }
     
     if(_NASMsgMod){

+ 4 - 3
创维盒子/双子星云手机/AppDelegate/PrefixHeader.pch

@@ -50,6 +50,7 @@
 #import "cachesFileManager.h"
 #import "ComontAlretViewController.h"
 #import "webSocketManager.h"
+#import "webRtcManager.h"
 
 #import "MJExtension.h"
 #import "RSATool.h"
@@ -137,7 +138,7 @@ isBangsScreen; \
 #define  AirPaySecret   @"shuangzixingiOSApp"
 
 #define User_Info_tableName(userName) [[NSString alloc] initWithFormat:@"User_Info_tableName_%@",userName];
-#define stringKeyAddSn(key)    [[NSString alloc] initWithFormat:@"%@_%@",key,[connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn]
+#define stringKeyAddSn(key)    [[NSString alloc] initWithFormat:@"%@_%@",key,ksharedAppDelegate.DeviceThirdIdMod.data.sn]
 
 #pragma mark 音频相关宏定义
 #define USEAAC    NO
@@ -154,10 +155,10 @@ isBangsScreen; \
 
 #pragma mark - 云盘文件缓存路径
 /**云盘文件下载-文件缓存路径*/
-#define kPath_YunPan_Download_Folder  [HWDataManager cachesPathForAccount:[connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn fileFolder:@"download"]
+#define kPath_YunPan_Download_Folder  [HWDataManager cachesPathForAccount:ksharedAppDelegate.DeviceThirdIdMod.data.sn fileFolder:@"download"]
 
 /**云盘文件上传-文件缓存路径*/
-#define kPath_YunPan_Upload_Folder    [HWDataManager cachesPathForAccount:[connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn fileFolder:@"Upload"]
+#define kPath_YunPan_Upload_Folder    [HWDataManager cachesPathForAccount:ksharedAppDelegate.DeviceThirdIdMod.data.sn fileFolder:@"Upload"]
 
 
 #endif /* PrefixHeader_pch */

+ 114 - 31
创维盒子/双子星云手机/AppDelegate/SceneDelegate.m

@@ -239,28 +239,81 @@
     KWeakSelf
     //有设备了先去做链接准备  // 80bec9c5
     NSString *SNStr = deviceDict[@"Const_Have_Add_Device_SN"];
-    NSString *sdnId = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.sdnId;
+    NSString *sdnId = ksharedAppDelegate.DeviceThirdIdMod.data.sdnId;
     if(SNStr && !sdnId){
-        [[connectDeviceManager shareInstance] getThridMsgBySN:SNStr needReconnect:YES didNetEnd:^(NSInteger didSuc) {
+        //瑞云方案
+//        [[connectDeviceManager shareInstance] getThridMsgBySN:SNStr needReconnect:YES didNetEnd:^(NSInteger didSuc) {
+//            
+//            if(didSuc == 0){
+//                dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+//                    mainBlock(^{
+//                        [weakSelf showNetErrorAlertFun];
+//                        [weakSelf enterMainVCFromSceneSecondStepFun];
+//                    });
+//                });
+//            }
+//            else if(didSuc == 2
+//                    ||didSuc == 201
+//                    ||didSuc == 202){
+//                [weakSelf gotoScanAginByThridMsgErrorFun:didSuc];
+//            }
+//            else{
+//                [weakSelf enterMainVCFromSceneSecondStepFun];
+//            }
+//            
+//        }];
+        
+        //webrtc方案
+        NSMutableDictionary *paraDict = [NSMutableDictionary new];
+        [paraDict setValue:SNStr forKey:@"sn"];
+        KWeakSelf
+        [[netWorkManager shareInstance] CommonGetWithCallBackCode:getThirdIdBySn Parameters:paraDict success:^(id  _Nonnull responseObject) {
             
-            if(didSuc == 0){
-                dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-                    mainBlock(^{
-                        [weakSelf showNetErrorAlertFun];
-                        [weakSelf enterMainVCFromSceneSecondStepFun];
-                    });
-                });
-            }
-            else if(didSuc == 2
-                    ||didSuc == 201
-                    ||didSuc == 202){
-                [weakSelf gotoScanAginByThridMsgErrorFun:didSuc];
+            DeviceThirdIdModel *model = [[DeviceThirdIdModel alloc] initWithDictionary:responseObject error:nil];
+
+            if(model.status == 0
+               && model.data)
+            {//根据SN 获取到正确的信息
+                ksharedAppDelegate.DeviceThirdIdMod = model;
+                
+                NSString*desPwdstr = [RSATool AES128Decrypt:model.data.password key:AESCODEKEEYY];
+                
+                /*密码保持在本地*/
+                NSDictionary *deviceDict = [HWDataManager getObjectWithKey:Const_Have_Add_Device];
+                NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithDictionary:deviceDict];
+                [dict setObject:desPwdstr forKey:Const_Have_Add_Device_PWD];
+               
+                NSString *sdnid = model.data.sdnId;
+                
+                if(sdnid){
+                    [dict setObject:sdnid forKey:Const_Have_Add_Device_sdnid];
+                }
+                
+                [HWDataManager setObjectWithKey:Const_Have_Add_Device_Privacy_Mode value:[NSNumber numberWithBool:model.data.isPrivacyMode]];
+                
+                [HWDataManager setObjectWithKey:Const_Have_Add_Device value:dict];
+                
+                
+                [weakSelf enterMainVCFromSceneSecondStepFun];;
+                
+                //获取webrtc相关信息
+                [weakSelf queryWebRtcMsgFun];
             }
             else{
-                [weakSelf enterMainVCFromSceneSecondStepFun];
+                
+                //if(model.status == 201||model.status == 202 || model.status ==2){}
+                [weakSelf gotoScanAginByThridMsgErrorFun:model.status];
             }
             
+            
+        } failure:^(NSError * _Nonnull error) {
+            HLog("网络报错");
+            mainBlock(^{
+                [weakSelf showNetErrorAlertFun];
+                [weakSelf enterMainVCFromSceneSecondStepFun];
+            });
         }];
+        
     }
     else{
         [self enterMainVCFromSceneSecondStepFun];
@@ -268,12 +321,42 @@
 
 }
     
+#pragma mark 获取webrct 的链接信息
+-(void)queryWebRtcMsgFun
+{
+    NSMutableDictionary *paraDict = [NSMutableDictionary new];
+
+    KWeakSelf
+    [[netWorkManager shareInstance] CommonPostCallBackCode:webrctQueryByClient Parameters:paraDict success:^(id  _Nonnull responseObject){
+        
+        webRtcMsgModel *curModel = [[webRtcMsgModel alloc] initWithDictionary:responseObject error:nil];
+        
+        if(curModel && curModel.status == 0){
+            ksharedAppDelegate.DeviceWebRtcMsgMod = curModel;
+            [[webRtcManager shareManager] beginToLinkWebRtcFun];
+        }
+        else
+        {
+            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+                [weakSelf queryWebRtcMsgFun];
+            });
+        }
+        
+    } failure:^(NSError * _Nonnull error) {
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            [weakSelf queryWebRtcMsgFun];
+        });
+    }];
+}
+
+
 - (void)enterMainVCFromSceneSecondStepFun
 {
     
     //确保通过SN号拿到密码了
     //非扫码进入 进入到这里很可能还没联网拿到设备最新信息
-    if(![connectDeviceManager shareInstance].DeviceThirdIdMod){
+    if(!ksharedAppDelegate.DeviceThirdIdMod
+       &&!ksharedAppDelegate.DeviceThirdIdMod){
      
         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
             mainBlock(^{
@@ -285,10 +368,10 @@
     }
     
     //是否已经有密码了 有就是输入密码 没有就是设置密码
-    NSString *curPwd = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password;
-    NSString * sdnId = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.sdnId;
-    if(!sdnId){
-        HLog(@"没有拿到sdnId");
+    NSString *curPwd = ksharedAppDelegate.DeviceThirdIdMod.data.password;
+    NSString * sdnId = ksharedAppDelegate.DeviceThirdIdMod.data.sdnId;
+    if(!sdnId && !ksharedAppDelegate.DeviceWebRtcMsgMod){
+        HLog(@"没有拿到 --sdnId:%@ --- DeviceWebRtcMsgMod:%@",sdnId,ksharedAppDelegate.DeviceWebRtcMsgMod);
         
         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
             mainBlock(^{
@@ -322,8 +405,8 @@
     //下载配置先处理
     [boxDownloadFileManager shareInstance];
     
-    [lastFileManager shareManager].uid = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn;
-    [audioPlayListManager shareManager].uid = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn;
+    [lastFileManager shareManager].uid = ksharedAppDelegate.DeviceThirdIdMod.data.sn;
+    [audioPlayListManager shareManager].uid = ksharedAppDelegate.DeviceThirdIdMod.data.sn;
     
     //获取NAS相关信息
     [self getNASMsgFun];
@@ -332,7 +415,7 @@
     
     self.isLoginAgainType = NO;
 
-    __block BOOL isPrivacyMode = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode;
+    __block BOOL isPrivacyMode = ksharedAppDelegate.DeviceThirdIdMod.data.isPrivacyMode;
 
     //KWeakSelf
     if(!_isQRCodeType){
@@ -672,8 +755,8 @@
     
     BOOL isPrivacyMode = [HWDataManager getBoolWithKey:Const_Have_Add_Device_Privacy_Mode];
     
-    if([connectDeviceManager shareInstance].DeviceThirdIdMod){
-        isPrivacyMode = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode;
+    if(ksharedAppDelegate.DeviceThirdIdMod){
+        isPrivacyMode = ksharedAppDelegate.DeviceThirdIdMod.data.isPrivacyMode;
     }
     
     if(!isPrivacyMode){
@@ -697,8 +780,8 @@
     NSDictionary *deviceDict = [HWDataManager getObjectWithKey:Const_Have_Add_Device];
     
     //实时拿到的密码 (每次打开或者更换设备 通过SN重新拿)
-    if([connectDeviceManager shareInstance].DeviceThirdIdMod.data.password){
-        NSString *curPwd = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password;
+    if(ksharedAppDelegate.DeviceThirdIdMod.data.password){
+        NSString *curPwd = ksharedAppDelegate.DeviceThirdIdMod.data.password;
         NSString*desPwdStr  = [RSATool AES128Decrypt:curPwd key:AESCODEKEEYY];
         
         if(desPwdStr){
@@ -733,11 +816,11 @@
     
     if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus != AFNetworkReachabilityStatusNotReachable)
     {
-        if(![connectDeviceManager shareInstance].DeviceThirdIdMod){
+        if(!ksharedAppDelegate.DeviceThirdIdMod){
             return;
         }
       
-        BOOL isPrivacyMode = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode;
+        BOOL isPrivacyMode = ksharedAppDelegate.DeviceThirdIdMod.data.isPrivacyMode;
         if(!isPrivacyMode)
         {
             [connectDeviceManager shareInstance].isFirstInputPwdDone = YES;
@@ -896,7 +979,7 @@
     //frp的下载
     [[customDownloadManager shareManager] suspendAllDownloadTask];
     
-    NSString *uid =[connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn;
+    NSString *uid =ksharedAppDelegate.DeviceThirdIdMod.data.sn;
     if(uid){
         
     }
@@ -952,7 +1035,7 @@
 {
     NSMutableDictionary *paraDict = [NSMutableDictionary new];
     
-    NSString *SNStr = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString *SNStr = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     if(SNStr){
         [paraDict setValue:SNStr forKey:@"sn"];
     }

+ 3 - 3
创维盒子/双子星云手机/Class/Calculator/CalculatorViewController.m

@@ -386,9 +386,9 @@
                 NSString *curPwd = nil;
                 NSString*desPwdStr = nil;
                 
-                if([connectDeviceManager shareInstance].DeviceThirdIdMod.data.password
-                   && [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password.length > 0){
-                    curPwd = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password;
+                if(ksharedAppDelegate.DeviceThirdIdMod.data.password
+                   && ksharedAppDelegate.DeviceThirdIdMod.data.password.length > 0){
+                    curPwd = ksharedAppDelegate.DeviceThirdIdMod.data.password;
                     desPwdStr  = [RSATool AES128Decrypt:curPwd key:AESCODEKEEYY];
                 }
                 else{

+ 3 - 3
创维盒子/双子星云手机/Class/Controller/HWWebViewController.m

@@ -327,9 +327,9 @@
                     NSString *curPwd = nil;
                     NSString*desPwdStr = nil;
                     
-                    if([connectDeviceManager shareInstance].DeviceThirdIdMod.data.password
-                       && [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password.length > 0){
-                        curPwd = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password;
+                    if(ksharedAppDelegate.DeviceThirdIdMod.data.password
+                       && ksharedAppDelegate.DeviceThirdIdMod.data.password.length > 0){
+                        curPwd = ksharedAppDelegate.DeviceThirdIdMod.data.password;
                         desPwdStr  = [RSATool AES128Decrypt:curPwd key:AESCODEKEEYY];
                     }
                     else{

+ 1 - 1
创维盒子/双子星云手机/Class/Guide/AuthCodeView/AuthCodeInputView.m

@@ -155,7 +155,7 @@
 // 调用接口验证验证码正确性
 -(void)checkAuthcode
 {
-    NSString *snStr = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString *snStr = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     NSString *secretkey  = [RSATool sha256_8:snStr];
     
     NSString*inputCodeStr = [self.codeStr uppercaseString];

+ 3 - 3
创维盒子/双子星云手机/Class/Guide/GuideViewController.m

@@ -63,7 +63,7 @@
         [HWDataManager setBoolWithKey:Const_Have_Show_Guide value:YES];
         
        
-        if(![connectDeviceManager shareInstance].DeviceThirdIdMod){
+        if(!ksharedAppDelegate.DeviceThirdIdMod){
             
             HLog(@"没有拿到设备信息");
             
@@ -83,11 +83,11 @@
         }
 
         //是否已经有密码了 有就是输入密码 没有就是设置密码
-        NSString *curPwd = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password;
+        NSString *curPwd = ksharedAppDelegate.DeviceThirdIdMod.data.password;
         
         
         if(curPwd && curPwd.length > 0){
-            BOOL haveOpenMask = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode;
+            BOOL haveOpenMask = ksharedAppDelegate.DeviceThirdIdMod.data.isPrivacyMode;
             if(!haveOpenMask)
             {
                 [connectDeviceManager shareInstance].isFirstInputPwdDone = YES;

+ 4 - 4
创维盒子/双子星云手机/Class/Guide/inputPWDViewController.m

@@ -411,7 +411,7 @@
     
 
 //        //是否已经有密码了 有就是输入密码 没有就是设置密码
-//        NSString *curPwd = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password;
+//        NSString *curPwd = ksharedAppDelegate.DeviceThirdIdMod.data.password;
 //
 //        NSString*desPwdStr  = [RSATool AES128Decrypt:curPwd key:AESCODEKEEYY];
 //
@@ -478,9 +478,9 @@
             NSString *curPwd = nil;
             NSString*desPwdStr = nil;
             
-            if([connectDeviceManager shareInstance].DeviceThirdIdMod.data.password
-               && [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password.length > 0){
-                curPwd = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password;
+            if(ksharedAppDelegate.DeviceThirdIdMod.data.password
+               && ksharedAppDelegate.DeviceThirdIdMod.data.password.length > 0){
+                curPwd = ksharedAppDelegate.DeviceThirdIdMod.data.password;
                 desPwdStr  = [RSATool AES128Decrypt:curPwd key:AESCODEKEEYY];
             }
             else{

+ 1 - 1
创维盒子/双子星云手机/Class/Set/CustomerWebViewController.m

@@ -248,7 +248,7 @@
     //2.上传到文件中心
     NSMutableDictionary *paraDict = [NSMutableDictionary new];
     
-    NSString *snStr = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString *snStr = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     if(!snStr){
         snStr = [iTools getNowTimeString];
     }

+ 1 - 1
创维盒子/双子星云手机/Class/Set/MySetViewController.m

@@ -838,7 +838,7 @@
 {
     KWeakSelf
     //瑞云发起重连
-    NSString *snStr = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString *snStr = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     if(snStr){
         [[connectDeviceManager shareInstance] getThridMsgBySN:snStr needReconnect:YES didNetEnd:^(NSInteger didSuc) {
             if(didSuc){

+ 1 - 1
创维盒子/双子星云手机/Class/Set/previewFile/shareRecordViewController.m

@@ -431,7 +431,7 @@
 {
     NSMutableDictionary*paraDict = [NSMutableDictionary new];
     
-    NSString *SNStr = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString *SNStr = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     if(SNStr){
         [paraDict setValue:SNStr forKey:@"sn"];
     }

+ 1 - 1
创维盒子/双子星云手机/Class/Set/previewFile/videoPlayByAVPlayerViewController.m

@@ -778,7 +778,7 @@
 #pragma mark 输入完密码
 - (void)didInputPwdOkFun
 {
-    if([connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode){
+    if(ksharedAppDelegate.DeviceThirdIdMod.data.isPrivacyMode){
         if(self.player.pauseByEvent){//隐私模式 是
             self.player.pauseByEvent = NO;
         }

+ 1 - 1
创维盒子/双子星云手机/Class/Set/previewFile/view/editShareView.m

@@ -420,7 +420,7 @@
 //添加分享
 - (void)addShareDataBy:(NSInteger)tag
 {
-    NSString *curSn = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString *curSn = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     NSString *platformType = [[NSString alloc] initWithFormat:@"%ld", tag - 9];
     //_shareFileType
     NSInteger expirationDay = _day7Button.selected ? 7 : 0;

+ 2 - 2
创维盒子/双子星云手机/Class/Set/privacyMode/privacyModeTipViewController.m

@@ -164,7 +164,7 @@
     [self showNewIndicatorWithCanBack:YES canTouch:NO];
 
     BOOL haveOpenMask = YES;
-    NSString* curSn = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString* curSn = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     
     NSMutableDictionary *paraDict = [NSMutableDictionary dictionary];
     [paraDict setValue:curSn forKey:@"sn"];
@@ -178,7 +178,7 @@
       SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
 
        if (model.status == 0) {
-           [connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode = YES;
+           ksharedAppDelegate.DeviceThirdIdMod.data.isPrivacyMode = YES;
            [weakSelf handleOkFun];
        }
        else

+ 5 - 5
创维盒子/双子星云手机/Class/Set/privacyMode/privacyModeViewController.m

@@ -291,7 +291,7 @@
 
 #pragma mark 设置tabview 是否隐藏
 - (void)setPrivacySwitchStateFun{
-    BOOL haveOpenMask = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode;
+    BOOL haveOpenMask = ksharedAppDelegate.DeviceThirdIdMod.data.isPrivacyMode;
     
     [_privacySwitch setOn:haveOpenMask];
     
@@ -323,10 +323,10 @@
     
     [self showNewIndicatorWithCanBack:YES canTouch:NO];
 
-    BOOL haveOpenMask = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode;
-    NSString* curSn = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    BOOL haveOpenMask = ksharedAppDelegate.DeviceThirdIdMod.data.isPrivacyMode;
+    NSString* curSn = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     if(!curSn || curSn.length == 0){
-        curSn = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn;
+        curSn = ksharedAppDelegate.DeviceThirdIdMod.data.sn;
     }
     
     NSMutableDictionary *paraDict = [NSMutableDictionary dictionary];
@@ -341,7 +341,7 @@
       SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
 
        if (model.status == 0) {
-           [connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode = ![connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode;
+           ksharedAppDelegate.DeviceThirdIdMod.data.isPrivacyMode = !ksharedAppDelegate.DeviceThirdIdMod.data.isPrivacyMode;
            
            [weakSelf setPrivacySwitchStateFun];
            

+ 1 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/backupsFileManager.h

@@ -10,7 +10,7 @@
 #import "TZImageManager.h"
 #import "photosBackupsTaskModel.h"
 
-#define backups_photos_tableName [[NSString alloc] initWithFormat:@"backups_photos_tableName_%@",[connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn]
+#define backups_photos_tableName [[NSString alloc] initWithFormat:@"backups_photos_tableName_%@",ksharedAppDelegate.DeviceThirdIdMod.data.sn]
 
 NS_ASSUME_NONNULL_BEGIN
 

+ 2 - 2
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/backupsFileManager.m

@@ -43,7 +43,7 @@ static backupsFileManager * cur_backupsFileShareInstance = nil;
 
 - (void)AutohandlePhotosBackupsFun
 {
-    NSString *curSdnId = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.sdnId;
+    NSString *curSdnId = ksharedAppDelegate.DeviceThirdIdMod.data.sdnId;
     if(!_sdnId || ![curSdnId isEqualToString:_sdnId])
     {//没有备份过 或者更换设备了
         [self handlePhotosBackupsFun];
@@ -71,7 +71,7 @@ static backupsFileManager * cur_backupsFileShareInstance = nil;
         return;
     }
     
-    NSString *curSdnId = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.sdnId;
+    NSString *curSdnId = ksharedAppDelegate.DeviceThirdIdMod.data.sdnId;
     _sdnId = curSdnId;
     
     [photosBackupsTaskModel bg_findAsync:backups_photos_tableName limit:0 orderBy:nil desc:YES complete:^(NSArray * _Nullable array) {

+ 1 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/boxDownloadFileManager.h

@@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
 //3.删除此次保存数据
 //4.UIDocumentPickerViewController 保存后访问本地持久化 查询还有没有没处理的任务
 
-#define share_box_download_tableName [[NSString alloc] initWithFormat:@"share_download_tableName_%@",[connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn]
+#define share_box_download_tableName [[NSString alloc] initWithFormat:@"share_download_tableName_%@",ksharedAppDelegate.DeviceThirdIdMod.data.sn]
 
 @interface boxDownloadFileManager : NSObject
 +(boxDownloadFileManager *)shareInstance;

+ 2 - 2
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/boxDownloadFileManager.m

@@ -40,8 +40,8 @@ static boxDownloadFileManager * cur_boxDownloadFileShareInstance = nil;
 
 - (void)initDownloadManagerFun
 {
-    //[mixDownloadManager shareManager].uid = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn;
-    [customDownloadManager shareManager].uid = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn;
+    //[mixDownloadManager shareManager].uid = ksharedAppDelegate.DeviceThirdIdMod.data.sn;
+    [customDownloadManager shareManager].uid = ksharedAppDelegate.DeviceThirdIdMod.data.sn;
     [customDownloadManager shareManager].maxDownLoadCount = 2;
     
     [self delItemInDoneTaskFun];

+ 1 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/boxSaveFileManager.h

@@ -11,7 +11,7 @@
 #import "downStatusModel.h"
 NS_ASSUME_NONNULL_BEGIN
 
-#define share_box_save_tableName [[NSString alloc] initWithFormat:@"share_box_save_tableName_%@",[connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn]
+#define share_box_save_tableName [[NSString alloc] initWithFormat:@"share_box_save_tableName_%@",ksharedAppDelegate.DeviceThirdIdMod.data.sn]
 
 @interface boxSaveFileManager : NSObject
 +(boxSaveFileManager *)shareInstance;

+ 1 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/cachesFileManager.h

@@ -20,7 +20,7 @@
 #define kSHPath_DownLoadFlie [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/DownLoadFlie",CachesPatch]]
 
 //云机最后一帧 路径
-#define kSHPath_cloudPhone_last_image [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/lastImage_%@/111.png",CachesPatch,[connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn]]
+#define kSHPath_cloudPhone_last_image [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/lastImage_%@/111.png",CachesPatch,ksharedAppDelegate.DeviceThirdIdMod.data.sn]]
 
 //日志路径
 #define kSHPath_logs [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/logs/",CachesPatch]]

+ 1 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/downloadManager.h

@@ -10,7 +10,7 @@
 #import "couldPhoneFileListModel.h"
 #import "uploadFileManager.h"
 
-#define download_tableName [[NSString alloc] initWithFormat:@"download_tableName_%@",[connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn]
+#define download_tableName [[NSString alloc] initWithFormat:@"download_tableName_%@",ksharedAppDelegate.DeviceThirdIdMod.data.sn]
 
 NS_ASSUME_NONNULL_BEGIN
 

+ 1 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/downloadThumbnailManager.h

@@ -10,7 +10,7 @@
 #import "couldPhoneFileListModel.h"
 
 //#define downloadThumbnail_tableName @"downloadThumbnail_tableName"
-//[[NSString alloc] initWithFormat:@"downloadThumbnail_tableName_%@",[connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn]
+//[[NSString alloc] initWithFormat:@"downloadThumbnail_tableName_%@",ksharedAppDelegate.DeviceThirdIdMod.data.sn]
 
 NS_ASSUME_NONNULL_BEGIN
 

+ 1 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/uploadFileManager.h

@@ -14,7 +14,7 @@
 
 
 //#define upLoadFile_image_tableName @"upLoadFile_image_tableName"
-#define upLoadFile_image_tableName [[NSString alloc] initWithFormat:@"upLoadFile_tableName_%@",[connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn]
+#define upLoadFile_image_tableName [[NSString alloc] initWithFormat:@"upLoadFile_tableName_%@",ksharedAppDelegate.DeviceThirdIdMod.data.sn]
 
 NS_ASSUME_NONNULL_BEGIN
 

+ 4 - 4
创维盒子/双子星云手机/Class/Set/view/allVersionView.m

@@ -204,12 +204,12 @@
             }
                 break;
             case 6:{
-                if([_couldphoneSysInfoMod.data.data.sn isEqualToString:[connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn]){
+                if([_couldphoneSysInfoMod.data.data.sn isEqualToString:ksharedAppDelegate.DeviceThirdIdMod.data.sn]){
                     cell.detailTextLabel.text = _couldphoneSysInfoMod.data.data.sn;
                 }
                 else{
                     cell.detailTextLabel.numberOfLines = 0;
-                    cell.detailTextLabel.text = [[NSString alloc] initWithFormat:@"%@(%@)",_couldphoneSysInfoMod.data.data.sn,[connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn];
+                    cell.detailTextLabel.text = [[NSString alloc] initWithFormat:@"%@(%@)",_couldphoneSysInfoMod.data.data.sn,ksharedAppDelegate.DeviceThirdIdMod.data.sn];
                 }
             }
                 break;
@@ -222,11 +222,11 @@
             }
                 break;
             case 9:{
-                cell.detailTextLabel.text = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.sdnId;
+                cell.detailTextLabel.text = ksharedAppDelegate.DeviceThirdIdMod.data.sdnId;
             }
                 break;
             case 10:{
-//                NSString *curIp = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.ip;
+//                NSString *curIp = ksharedAppDelegate.DeviceThirdIdMod.data.ip;
 //                NSString * networkStr = @"_LAN";
 //                if(![connectDeviceManager shareInstance].isPingOk){
 //                    networkStr = @"_Not_LAN";

+ 1 - 1
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+otherDelegate.mm

@@ -31,7 +31,7 @@
 - (void)updateForceStartFun{
     
     
-    NSString* curSn = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString* curSn = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     
     NSMutableDictionary *paraDict = [NSMutableDictionary dictionary];
     [paraDict setValue:curSn forKey:@"sn"];

+ 2 - 2
创维盒子/双子星云手机/CloudPlayer/PlayerViewController.mm

@@ -231,7 +231,7 @@ UIDocumentPickerDelegate>
     //if([connectDeviceManager shareInstance].isFirstInputPwdDone){
         if([connectDeviceManager shareInstance].isPingOk
            && [AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusReachableViaWiFi){
-            ip = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.ip;
+            ip = ksharedAppDelegate.DeviceThirdIdMod.data.ip;
             internetVideoPort = @"9100";
             [self didCanConnectServerFun];
         }
@@ -1030,7 +1030,7 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
     
     if([connectDeviceManager shareInstance].isPingOk
        && [AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusReachableViaWiFi){
-        ip = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.ip;
+        ip = ksharedAppDelegate.DeviceThirdIdMod.data.ip;
         internetVideoPort = @"9100";
     }
     else{

+ 2 - 2
创维盒子/双子星云手机/CloudPlayer/View/playerShowSecretkeyView.m

@@ -87,7 +87,7 @@
     [grayBgView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(copyKeyFun)]];
     
     
-    NSString *snStr = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString *snStr = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     NSString *secretkey  = [RSATool sha256_8:snStr];
 
     UILabel *secretKeyLab = [[UILabel alloc] init];
@@ -196,7 +196,7 @@
 #pragma mark 复制
 - (void)copyKeyFun
 {
-    NSString *snStr = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString *snStr = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     NSString *secretkey  = [RSATool sha256_8:snStr];
     
     UIPasteboard * Pasteboard = [UIPasteboard generalPasteboard];

+ 2 - 2
创维盒子/双子星云手机/NAS/nasBackupsManager/nasBackupsManager.m

@@ -26,7 +26,7 @@
 
 - (void)AutohandlePhotosBackupsFun
 {
-    NSString *curSdnId = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.sdnId;
+    NSString *curSdnId = ksharedAppDelegate.DeviceThirdIdMod.data.sdnId;
     if(!_sdnId || ![curSdnId isEqualToString:_sdnId])
     {//没有备份过 或者更换设备了
         [self handlePhotosBackupsFun];
@@ -54,7 +54,7 @@
         return;
     }
     
-    NSString *curSdnId = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.sdnId;
+    NSString *curSdnId = ksharedAppDelegate.DeviceThirdIdMod.data.sdnId;
     _sdnId = curSdnId;
     
     [photosBackupsTaskModel bg_findAsync:backups_photos_tableName limit:0 orderBy:nil desc:YES complete:^(NSArray * _Nullable array) {

+ 1 - 1
创维盒子/双子星云手机/NAS/nasDownloadManager/nasDownloadFileManager.h

@@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
 //3.删除此次保存数据
 //4.UIDocumentPickerViewController 保存后访问本地持久化 查询还有没有没处理的任务
 
-#define nas_box_download_tableName [[NSString alloc] initWithFormat:@"download_tableName_%@",[connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn]
+#define nas_box_download_tableName [[NSString alloc] initWithFormat:@"download_tableName_%@",ksharedAppDelegate.DeviceThirdIdMod.data.sn]
 
 @interface nasDownloadFileManager : NSObject
 +(nasDownloadFileManager *)shareInstance;

+ 1 - 1
创维盒子/双子星云手机/NAS/nasDownloadManager/nasDownloadFileManager.m

@@ -37,7 +37,7 @@ static nasDownloadFileManager * cur_nasDownloadFileManager = nil;
 
 - (void)initDownloadManagerFun
 {
-    [nasDownloadManager shareManager].uid = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn;
+    [nasDownloadManager shareManager].uid = ksharedAppDelegate.DeviceThirdIdMod.data.sn;
     [nasDownloadManager shareManager].maxDownLoadCount = 2;
     
     [self delItemInDoneTaskFun];

+ 1 - 1
创维盒子/双子星云手机/NAS/nasUploadManager/nasUploadFileManager.h

@@ -13,7 +13,7 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-#define nasUpLoadFile_tableName [[NSString alloc] initWithFormat:@"upLoadFile_tableName_%@",[connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn]
+#define nasUpLoadFile_tableName [[NSString alloc] initWithFormat:@"upLoadFile_tableName_%@",ksharedAppDelegate.DeviceThirdIdMod.data.sn]
 
 @interface nasUploadFileManager : NSObject
 +(instancetype)shareInstance;

+ 2 - 2
创维盒子/双子星云手机/NAS/view/errorAlertTool.m

@@ -208,7 +208,7 @@ static errorAlertTool *shareInstance = nil;
     if([[connectDeviceManager shareInstance] curConnectDeviceState] <= 3)
     {
         //瑞云发起重连
-        NSString *snStr = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+        NSString *snStr = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
         if(snStr){
             //_checkThridConnectNum = 1;
             [[connectDeviceManager shareInstance] getThridMsgBySN:snStr needReconnect:YES didNetEnd:^(NSInteger didSuc) {
@@ -258,7 +258,7 @@ static errorAlertTool *shareInstance = nil;
 #pragma mark 需要强制重启
 - (void)updateForceStartFun{
     
-    NSString* curSn = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString* curSn = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     
     NSMutableDictionary *paraDict = [NSMutableDictionary dictionary];
     [paraDict setValue:curSn forKey:@"sn"];

+ 2 - 2
创维盒子/双子星云手机/cloudPhone/websocket/webSocketManager.m

@@ -90,7 +90,7 @@ static webSocketManager *webSocketManagerInstance = nil;
     NSString *wsPort = @"";
     if([connectDeviceManager shareInstance].isPingOk
        && [AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusReachableViaWiFi){
-        _curIp = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.ip;
+        _curIp = ksharedAppDelegate.DeviceThirdIdMod.data.ip;
         wsPort = @"9300";
     }
     else if([connectDeviceManager shareInstance].tcpPortStr
@@ -1003,7 +1003,7 @@ static webSocketManager *webSocketManagerInstance = nil;
     
     NSString * loginAgainStr = NSLocalizedString(@"single_sign_on_login_again",nil);
     BOOL isOkBtnHighlight = YES;
-    if(![connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode){
+    if(!ksharedAppDelegate.DeviceThirdIdMod.data.isPrivacyMode){
         loginAgainStr = @"";
         isOkBtnHighlight = NO;
     }

+ 1 - 1
创维盒子/双子星云手机/connectDeviceManager/connectDeviceManager.m

@@ -538,7 +538,7 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
         {
             didNetEndIsOK(YES);
             
-            [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password = enPwdStr;
+            ksharedAppDelegate.DeviceThirdIdMod.data.password = enPwdStr;
             /*密码保持在本地*/
             NSDictionary *deviceDict = [HWDataManager getObjectWithKey:Const_Have_Add_Device];
             NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithDictionary:deviceDict];

+ 1 - 1
创维盒子/双子星云手机/mine/PCLoginViewController.m

@@ -118,7 +118,7 @@
 #pragma mark PC 扫码登录
 -(void)scanToPCloginFunWith:(NSInteger)status
 {
-    NSString *changSN =  [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString *changSN =  ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     NSMutableDictionary *paraDict = [NSMutableDictionary new];
     [paraDict setValue:[NSNumber numberWithInteger:status] forKey:@"status"];
     if(_loginIdString){

+ 3 - 3
创维盒子/双子星云手机/mine/mineViewController.m

@@ -176,7 +176,7 @@
 //                //url = @"http://hiboxde.armclouding.com:7780/h5/rule.html";;
 //            }
             NSString *url = [[NSString alloc] initWithFormat:@"%@/problemFeedback/#/pages/fileSharing/problem/index?sn=",CloudService];
-            vc.webUrl = [[NSString alloc] initWithFormat:@"%@%@",url,[connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn];
+            vc.webUrl = [[NSString alloc] initWithFormat:@"%@%@",url,ksharedAppDelegate.DeviceThirdIdMod.data.changeSn];
             [self pushViewController:vc animated:YES];
             
             //数据埋点
@@ -473,7 +473,7 @@
 #pragma mark 数据设置
 - (void)setDataFun
 {
-    NSString *fullSNStr = [[NSString alloc] initWithFormat:@"SN:%@",[connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn];
+    NSString *fullSNStr = [[NSString alloc] initWithFormat:@"SN:%@",ksharedAppDelegate.DeviceThirdIdMod.data.changeSn];
     _snLabel.text = fullSNStr;
     
     NSString *NetButText = NSLocalizedString(@"mine_net_LAN",nil);
@@ -602,7 +602,7 @@
 #pragma mark PC 扫码登录
 -(void)scanToPCloginFunWithID:(NSString*)idStr
 {
-    NSString *changSN =  [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString *changSN =  ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     NSMutableDictionary *paraDict = [NSMutableDictionary new];
     [paraDict setValue:@1 forKey:@"status"];
     [paraDict setValue:idStr forKey:@"boxLoginId"];

+ 1 - 1
创维盒子/双子星云手机/mine/scanToPCLoginViewController.m

@@ -316,7 +316,7 @@ bool isPCScanDownType = YES;
 #pragma mark PC 扫码登录
 -(void)scanToPCloginFunWithID:(NSString*)idStr
 {
-    NSString *changSN =  [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString *changSN =  ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     NSMutableDictionary *paraDict = [NSMutableDictionary new];
     [paraDict setValue:@1 forKey:@"status"];
     [paraDict setValue:idStr forKey:@"boxLoginId"];

+ 2 - 2
创维盒子/双子星云手机/netWork/addLog/addLogObject.m

@@ -68,7 +68,7 @@ static addLogObject *addlog_ShareInstance = nil;
     //2.上传到文件中心
     NSMutableDictionary *paraDict = [NSMutableDictionary new];
     
-    NSString *snStr = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString *snStr = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     if(!snStr){
         snStr = [iTools getNowTimeString];
     }
@@ -107,7 +107,7 @@ static addLogObject *addlog_ShareInstance = nil;
     NSMutableDictionary *paraDict = [NSMutableDictionary new];
     [paraDict setValue:@"ios" forKey:@"type"];
     
-    NSString *snStr = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString *snStr = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     if(!snStr){
         _canUploadNowType = YES;
         return;

+ 4 - 4
创维盒子/双子星云手机/netWork/netWorkManager.m

@@ -113,7 +113,7 @@ static netWorkManager *Game_NetWorkShareInstance = nil;
         [manager.requestSerializer setValue:DeviceModel forHTTPHeaderField:@"Devices"];
     }
     
-//    NSString *curSN = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+//    NSString *curSN = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
 //    if (curSN) {
 //        [manager.requestSerializer setValue:curSN forHTTPHeaderField:@"SN"];
 //    }
@@ -288,7 +288,7 @@ static netWorkManager *Game_NetWorkShareInstance = nil;
     }
     
     
-    NSString *curSN = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString *curSN = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     if (curSN) {
         [manager.requestSerializer setValue:curSN forHTTPHeaderField:@"SN"];
     }
@@ -323,7 +323,7 @@ static netWorkManager *Game_NetWorkShareInstance = nil;
         return;
     }
     
-    NSString *curSN = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString *curSN = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     if (curSN) {
         [manager.requestSerializer setValue:curSN forHTTPHeaderField:@"SN"];
     }
@@ -383,7 +383,7 @@ static netWorkManager *Game_NetWorkShareInstance = nil;
         return;
     }
     
-    NSString *curSN = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    NSString *curSN = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
     if (curSN) {
         [manager.requestSerializer setValue:curSN forHTTPHeaderField:@"SN"];
     }

+ 24 - 0
创维盒子/双子星云手机/webRtc/webRtcManager/webRtcManager.h

@@ -0,0 +1,24 @@
+//
+//  webRtcManager.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/9/5.
+//
+
+#import <Foundation/Foundation.h>
+#import <WebRTC/AMediaStream.h>
+#import <WebRTC/RTCMacros.h>
+#import "webRtcMsgModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface webRtcManager : NSObject
+/** 实例化对象(单例) */
++ (instancetype)shareManager;
+
+@property (nonatomic, strong) AMediaStream *mediaStream;
+
+- (void)beginToLinkWebRtcFun;
+@end
+
+NS_ASSUME_NONNULL_END

+ 100 - 0
创维盒子/双子星云手机/webRtc/webRtcManager/webRtcManager.m

@@ -0,0 +1,100 @@
+//
+//  webRtcManager.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/9/5.
+//
+
+#import "webRtcManager.h"
+
+@interface webRtcManager ()<MediaStreamClientEventsDelegate>
+
+@end
+
+@implementation webRtcManager
++ (instancetype)shareManager {
+    static webRtcManager *_instance;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        _instance = [[self alloc] init];
+    });
+    return _instance;
+}
+
+- (instancetype)init {
+
+    if (self = [super init]) {
+        //[self registeNotification];
+        
+        _mediaStream = [[RTC_OBJC_TYPE(AMediaStream) alloc] initWithFrame:CGRectZero];
+        [_mediaStream setEventDelegate:self];
+    }
+    return self;
+}
+
+#pragma mark 开始链接
+- (void)beginToLinkWebRtcFun
+{
+    webRtcMsgModel * _webRtcMsgMod = ksharedAppDelegate.DeviceWebRtcMsgMod;
+    
+    //链接用
+    NSString *signallingUrl = [[NSString alloc] initWithFormat:@"%@:%@",_webRtcMsgMod.data.signalling.domainName,_webRtcMsgMod.data.signalling.port];
+    NSURL *url = [NSURL URLWithString:signallingUrl];
+    
+    //ice用
+    NSString *iceUrl = [[NSString alloc] initWithFormat:@"%@:%@",_webRtcMsgMod.data.turn.domainName,_webRtcMsgMod.data.turn.port];
+    
+    NSMutableDictionary *ice = [NSMutableDictionary new];
+    if(iceUrl){
+        [ice setValue:iceUrl forKey:@"CHINANET"];
+        [ice setValue:iceUrl forKey:@"CMNET"];
+        [ice setValue:iceUrl forKey:@"UNICOM"];
+    }
+   
+    NSString *roomName = _webRtcMsgMod.data.uniqueIdentifier;
+    
+    NSInteger result = [_mediaStream startUploadChannel:url ice:ice sn:roomName token:@"vclusters"];
+    
+    
+    HLog(@"result:%ld",result)
+}
+
+- (void)relinkWebRtcFun{
+    [self relinkWebRtcFun];
+}
+
+
+#pragma mark WebRTC 回调 MediaStreamClientEventsDelegate
+
+#pragma mark 链接状态发生变化
+-(void)onChangeConnectionStateFromPeerName:(NSString*)peerName didChangeIceConnectionState:(RTCIceConnectionState)state
+{
+    HLog(@"channel onChangeConnectionStateFromPeerName: state:%ld",state)
+    switch (state) {
+        case RTCIceConnectionStateConnected:{
+            //链接成功
+            
+        }
+            break;
+        case RTCIceConnectionStateCompleted:
+            //链接完成
+            break;
+        case RTCIceConnectionStateFailed:
+            //链接失败
+            break;
+        case RTCIceConnectionStateDisconnected:
+            //链接断开
+            [self relinkWebRtcFun];
+            break;
+        case RTCIceConnectionStateClosed:
+            //链接关闭
+            break;
+            
+        default:
+            break;
+    }
+    
+    
+}
+
+@end