Sfoglia il codice sorgente

1.启动的时候要先输入密码才能连接设备

huangxiaodong 1 anno fa
parent
commit
7240c40aac

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

@@ -2,6 +2,7 @@
 
 #import "CalculatorViewController.h"
 #import <Masonry.h>
+#import "connectDeviceManager.h"
 
 @interface CalculatorViewController ()
 {
@@ -318,9 +319,11 @@
     
     NSLog(@"tf.text = %@",tf.text);
     if ([tf.text isEqualToString:pwd]){
-        [self.view removeFromSuperview];
+        [connectDeviceManager shareInstance].isFirstInputPwdDone = YES;
         
         [[NSNotificationCenter defaultCenter] postNotificationName:ShowImgAndVoiceNotification object:nil];
+        
+        [self.view removeFromSuperview];
     }
 }
 

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

@@ -17,6 +17,7 @@
 
 #import "HWHistoryModel.h"
 #import "iPhone.h"
+#import "connectDeviceManager.h"
 
 @interface HWWebViewController ()<WKScriptMessageHandler,WKNavigationDelegate,WKUIDelegate,HWToolViewControllerDelete>{
     UIView *bgView;/*引导视图*/
@@ -266,6 +267,8 @@
 - (void)searchBarWithText:(NSString *)text {
     HLog(@"搜索:%@", text)
     if ([_pwd isEqualToString:text] && (_pwd.length == 4)){
+        [connectDeviceManager shareInstance].isFirstInputPwdDone = YES;
+        
         [self.view removeFromSuperview];
         [[NSNotificationCenter defaultCenter] postNotificationName:ShowImgAndVoiceNotification object:nil];
     }

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

@@ -339,7 +339,7 @@
         NSString*desPwdStr  = [RSATool AES128Decrypt:curPwd key:AESCODEKEEYY];
         
         if([desPwdStr isEqualToString:pwd]){
-            
+            [connectDeviceManager shareInstance].isFirstInputPwdDone = YES;
             if(_isQRCodeType){
                 [[NSNotificationCenter defaultCenter] postNotificationName:GuideOkNotification object:nil];
             }

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

@@ -209,19 +209,24 @@ ComontAlretViewControllerDelegate>
     
     HLog(@"局域网是否能ping通:%d",[connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPingOk);
     HLog(@"瑞云连接状态:%d",[[connectDeviceManager shareInstance] curConnectDeviceState]);
-    if([connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPingOk){
-        ip = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.ip;
-        internetVideoPort = @"9100";
-        [self didCanConnectServerFun];
-    }
-    else{
-        if([[connectDeviceManager shareInstance] curConnectDeviceState] == DeviceConnectDeciceOk){
-            ip = @"127.0.0.1";
-            internetVideoPort = [[connectDeviceManager shareInstance] tcpPortStr];
+    
+    //第一次进 先输入密码才能连接
+    if([connectDeviceManager shareInstance].isFirstInputPwdDone){
+        if([connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPingOk){
+            ip = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.ip;
+            internetVideoPort = @"9100";
             [self didCanConnectServerFun];
         }
+        else{
+            if([[connectDeviceManager shareInstance] curConnectDeviceState] == DeviceConnectDeciceOk){
+                ip = @"127.0.0.1";
+                internetVideoPort = [[connectDeviceManager shareInstance] tcpPortStr];
+                [self didCanConnectServerFun];
+            }
+        }
     }
     
+    
 }
 
 #pragma mark 走局域网或者瑞云SDK链接OK

+ 3 - 0
创维盒子/双子星云手机/connectDeviceManager/connectDeviceManager.h

@@ -29,6 +29,9 @@ typedef void (^netWork_DidEndByOK) (bool didSuc);
 @property(nonatomic,strong) DeviceThirdIdModel *DeviceThirdIdMod;//设备的第三方信息  连接时需要
 @property(nonatomic,assign) connectDeviceState  curConnectDeviceState;
 
+//是否完成了第一次密码输入
+@property(nonatomic,assign) BOOL  isFirstInputPwdDone;
+
 @property(nonatomic,copy) NSString*  tcpPortStr;
 
 #pragma mark 根据扫码的sn获取第三方信息