소스 검색

1. 1.3以下的镜像禁用文件传输---未完善

huangxiaodong 1 년 전
부모
커밋
93c2afecbb

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

@@ -18,6 +18,7 @@
 @property (nonatomic, strong)cloudPhoneExtraFileListModel* cloudPhoneExtraFileListMod;
 //@property (nonatomic, strong)couldPhoneBaseInfoModel *couldPhoneBaseInfoMod;
 @property (nonatomic, assign)BOOL getSystemPermissType;//主动获取权限进入后台
+@property (nonatomic, assign)BOOL DisabledFileTransferType;//禁用文件传输
 +(AppDelegate*)sharedAppDelegate;
 @end
 

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

@@ -164,6 +164,11 @@
         case 2:
         case 3:
         {
+            if(ksharedAppDelegate.DisabledFileTransferType){
+                [[iToast makeText:NSLocalizedString(@"File_Transfer_Disable_tip",nil)] show];
+                return;
+            }
+            
             fileTransferPopView * fileTransferPopV = [[fileTransferPopView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H)];
             if(tag==2){
                 fileTransferPopV.fileTransferType =1;

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

@@ -60,6 +60,10 @@ static backupsFileManager * cur_backupsFileShareInstance = nil;
         return;
     }
     
+    if(ksharedAppDelegate.DisabledFileTransferType){
+        return;
+    }
+    
     //相册权限
     if (![[TZImageManager manager] authorizationStatusAuthorized]){
         [HWDataManager setBoolWithKey:Const_photo_backups_state value:NO];

+ 11 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/downloadManager.m

@@ -99,6 +99,12 @@ static downloadManager * cur_downloadManager = nil;
         return;
     }
     
+    if(ksharedAppDelegate.DisabledFileTransferType){
+        [[iToast makeText:NSLocalizedString(@"File_Transfer_Disable_tip",nil)] show];
+        complete(_databaseArr);
+        return;
+    }
+    
     for (couldPhoneFileModel*model in indexPathsForSelectedItems) {
         model.bg_tableName = download_tableName;
     }
@@ -209,6 +215,11 @@ static downloadManager * cur_downloadManager = nil;
         
     }
     
+    if(ksharedAppDelegate.DisabledFileTransferType){
+        [[iToast makeText:NSLocalizedString(@"File_Transfer_Disable_tip",nil)] show];
+        return;
+    }
+    
     self.taskRenewTime = [iTools getNowTimeStamp];
     
     _isSuspendType = NO;

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

@@ -110,6 +110,12 @@ static uploadFileManager * cur_uploadFileShareInstance = nil;
         return;
     }
     
+    if(ksharedAppDelegate.DisabledFileTransferType){
+        [[iToast makeText:NSLocalizedString(@"File_Transfer_Disable_tip",nil)] show];
+        complete(_databaseArr);
+        return;
+    }
+    
     if(!_fileModelDataArr){
         _fileModelDataArr = [NSMutableArray new];
     }
@@ -248,6 +254,11 @@ static uploadFileManager * cur_uploadFileShareInstance = nil;
         
     }
     
+    if(ksharedAppDelegate.DisabledFileTransferType){
+        [[iToast makeText:NSLocalizedString(@"File_Transfer_Disable_tip",nil)] show];
+        return;
+    }
+    
     if(_isSuspendType)
     {
         return;

+ 6 - 0
创维盒子/双子星云手机/Class/Set/view/mySetHeadView.m

@@ -563,6 +563,12 @@
         BOOL haveOpenBackups = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_photo_backups_state)];
         
         if(!haveOpenBackups){
+            
+            if(ksharedAppDelegate.DisabledFileTransferType){
+                [[iToast makeText:NSLocalizedString(@"File_Transfer_Disable_tip",nil)] show];
+                return;
+            }
+            
             //相册权限
             if (![[TZImageManager manager] authorizationStatusAuthorized]){
                 [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {

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

@@ -161,35 +161,65 @@
     couldphoneSysInfoModel *model = [[couldphoneSysInfoModel alloc] initWithDictionary:dataDict error:nil];
     [[NSNotificationCenter defaultCenter] postNotificationName:getCouldPhoneSysInfoNotification object:model];
     
-    NSString * predatestr = [HWDataManager getObjectWithKey:Const_did_show_image_version_date];
-    
-    NSString *datestr = [iTools getNowDateString];
-    
-    if(predatestr && [predatestr isEqualToString:datestr]){
-        return;
-    }
-    
-    NSString *hostImgVer = model.data.data.hostImgVer;
+//    NSString * predatestr = [HWDataManager getObjectWithKey:Const_did_show_image_version_date];
+//
+//    NSString *datestr = [iTools getNowDateString];
+//
+//    if(predatestr && [predatestr isEqualToString:datestr]){
+//        return;
+//    }
     
-    if (!hostImgVer || hostImgVer.length < 3) {
+//    NSString *hostImgVer = model.data.data.hostImgVer;
+//    NSString *MyNewVersion = model.data.data.MyNewVersion;
+    NSString *hostImgVer = @"1.2.3";
+    NSString *MyNewVersion = @"1.3.0";
+    //判断当前版本号 待更新版本
+    if (!hostImgVer || hostImgVer.length < 3
+        ||!MyNewVersion || MyNewVersion.length < 3) {
         //[self showImageViewRenewTipViewFun];
         return;
     }
     
     NSArray *versionArr = [hostImgVer componentsSeparatedByString:@"."];
+    NSArray *MyNewVersionArr = [MyNewVersion componentsSeparatedByString:@"."];
+    
+    NSInteger versionArrCount = versionArr.count;
+    NSInteger MyNewVersionArrCount = MyNewVersionArr.count;
+    NSInteger maxCount =  versionArrCount < MyNewVersionArrCount ? versionArrCount:MyNewVersionArrCount;
+    
+    BOOL isNeedShowType = NO;
+    //判断是否要更新镜像框
+    if(maxCount > 0){
+        for (int i=0; i<maxCount; i++) {
+            NSString * numberStr1 = versionArr[i];
+            NSString * numberStr2 = MyNewVersionArr[i];
+            
+            if(numberStr2.intValue > numberStr1.intValue){
+                isNeedShowType =YES;
+                break;
+            }
+        }
+    }
+    
+    
+    if(isNeedShowType){
+        [self showImageViewRenewTipViewFun];
+    }
     
+    //是否禁用文件传输 (1.3以及以上的镜像可以使用文件传输)
     if(versionArr.count >= 2)
     {
         NSString * oneStr = versionArr[0];
         NSString * twoStr = versionArr[1];
-        
-        if(oneStr.integerValue >=1 && twoStr.integerValue >=2){
-            return;
+
+        if(oneStr.integerValue <=1 && twoStr.integerValue <=2){//禁用
+            ksharedAppDelegate.DisabledFileTransferType = YES;
+        }
+        else{
+            ksharedAppDelegate.DisabledFileTransferType = NO;
         }
     }
     
-    
-    [self showImageViewRenewTipViewFun];
 }
 
 - (void)getCouldPhoneTvStatusResponseFun:(NSDictionary *)dataDict

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

@@ -1770,6 +1770,9 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
     
     if(!_didSendfristMsg || _isLoginAgainType)
     {
+        NSString *commondStr3  = @"{\"type\":\"getSysInfo\"}";
+        [self send_data:commondStr3];
+        
         NSString *commondStr  = @"{\"type\":\"forwardMsg\",\"data\":\"offline_notification\"}";
         [self send_data:commondStr];
         
@@ -1785,9 +1788,6 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
         NSString *commondStr2  = @"{\"type\":\"TvStatus\"}";
         [self send_data:commondStr2];
         
-        NSString *commondStr3  = @"{\"type\":\"getSysInfo\"}";
-        [self send_data:commondStr3];
-        
         
         //test code
         //[self LogoutByOtherFun];

+ 1 - 0
创维盒子/双子星云手机/zh-Hans.lproj/Localizable.strings

@@ -404,3 +404,4 @@
 4、备份文件时,系统将请求相册访问权限。为确保顺畅体验,建议您选择【允许完全访问】,以避免频繁弹窗打扰。权限路径:设置> private-X应用>照片>完全访问;\n
 5、备份文件时,请保持APP前台运行,退出将会导致传输中断;\n
 6、备份文件时,可能会影响云机操作体验,建议先完成文件传输再进行云机操作;";
+"File_Transfer_Disable_tip"   = "此功能暂时无法使用,请插拔电源更新设备。恢复电源和网络后,预计需要15分钟完成更新,更新期间将无法使用云机。";

+ 1 - 0
创维盒子/双子星云手机/zh-Hant.lproj/Localizable.strings

@@ -406,3 +406,4 @@
 權限路徑:設置> private-X應用>照片>完全訪問\n
 5. 備份文件時,請保持APP在前台運行,退出將導致傳輸中斷;
 6. 備份文件時,可能會影響雲機操作體驗,建議先完成文件傳輸再進行雲機操作;";
+"File_Transfer_Disable_tip"   = "此功能暂时无法使用,请插拔电源更新设备。恢复电源和网络后,预计需要15分钟完成更新,更新期间将无法使用云机。";