Bladeren bron

1.上传 备份下载路径以及开关跟着盒子走

huangxiaodong 1 jaar geleden
bovenliggende
commit
131f9a2da8

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

@@ -44,6 +44,7 @@
 #import "newWorkInterface.h"
 
 #import "AppDelegate.h"
+#import "connectDeviceManager.h"
 
 #define globalBlock(block) dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), block)
 
@@ -105,6 +106,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]
 
 #pragma mark 音频相关宏定义
 #define USEAAC    NO

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

@@ -228,7 +228,7 @@
     [self.view addSubview:bottomView];
     self.photoPreViewBottomV = bottomView;
     
-    NSString * uploadDefaultPath = [HWDataManager getStringWithKey:Const_photo_upload_default_path];
+    NSString * uploadDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_photo_upload_default_path)];
     
     BOOL isExtraFileType = NO;
     BOOL isExtraPathFind = NO;

+ 6 - 6
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/backupsSetViewController.m

@@ -156,11 +156,11 @@
 {
     NSString * leftStr = NSLocalizedString(@"File_backups_path_way_tip",nil);
     
-    NSString * backupsDefaultPath = [HWDataManager getStringWithKey:Const_photo_backups_default_path];
+    NSString * backupsDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_photo_backups_default_path)];
     
     if(!backupsDefaultPath || backupsDefaultPath.length == 0){
         backupsDefaultPath = Const_default_backups_path;
-        [HWDataManager setStringWithKey:Const_photo_backups_default_path value:backupsDefaultPath];
+        [HWDataManager setStringWithKey:stringKeyAddSn(Const_photo_backups_default_path) value:backupsDefaultPath];
     }
     
     if([backupsDefaultPath containsString:@"mnt/media_rw"]){
@@ -227,7 +227,7 @@
          
          //判断尺寸路径是否存在
          
-         NSString * uploadDefaultPath = [HWDataManager getStringWithKey:Const_photo_backups_default_path];
+         NSString * uploadDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_photo_backups_default_path)];
          
          BOOL isExtraFileType = NO;
          BOOL isExtraPathFind = NO;
@@ -308,7 +308,7 @@
     if (row == 0){
         [cell.titleLabel setText:NSLocalizedString(@"File_backups_set_Cellular",nil)];
         
-        BOOL haveOpenMask = [HWDataManager getBoolWithKey:Const_file_backups_canUse_Cellular];
+        BOOL haveOpenMask = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_file_backups_canUse_Cellular)];
         [cell.maskSwitch setOn:haveOpenMask];
         
         /*上圆角*/
@@ -362,10 +362,10 @@
 - (void)didClickSwitchBy:(BOOL)SwitchOn withRow:(NSInteger)row
 {
     if(row == 0){
-        [HWDataManager setBoolWithKey:Const_file_backups_canUse_Cellular value:SwitchOn];
+        [HWDataManager setBoolWithKey:stringKeyAddSn(Const_file_backups_canUse_Cellular) value:SwitchOn];
     }
     else{
-        [HWDataManager setBoolWithKey:Const_file_backups_battery_level value:SwitchOn];
+        [HWDataManager setBoolWithKey:stringKeyAddSn(Const_file_backups_battery_level) value:SwitchOn];
     }
 }
 

+ 7 - 7
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/fileTransfeSetViewController.m

@@ -147,9 +147,9 @@
 {
     NSString * leftStr = NSLocalizedString(@"File_upload_path_way",nil);
     
-    NSString * uploadDefaultPath = [HWDataManager getStringWithKey:Const_photo_upload_default_path];
+    NSString * uploadDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_photo_upload_default_path)];
     if(!uploadDefaultPath || uploadDefaultPath.length == 0){
-        [HWDataManager setStringWithKey:Const_photo_upload_default_path value:Const_default_upload_path];
+        [HWDataManager setStringWithKey:stringKeyAddSn(Const_photo_upload_default_path) value:Const_default_upload_path];
         uploadDefaultPath = Const_default_upload_path;
     }
     
@@ -208,7 +208,7 @@
         
         //判断尺寸路径是否存在
         
-        NSString * uploadDefaultPath = [HWDataManager getStringWithKey:Const_photo_upload_default_path];
+        NSString * uploadDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_photo_upload_default_path)];
         
         BOOL isExtraFileType = NO;
         BOOL isExtraPathFind = NO;
@@ -287,7 +287,7 @@
     if (row == 0){
         [cell.titleLabel setText:NSLocalizedString(@"File_Transfer_set_Cellular",nil)];
         
-        BOOL haveOpenMask = [HWDataManager getBoolWithKey:Const_file_Transfe_canUse_Cellular];
+        BOOL haveOpenMask = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_file_Transfe_canUse_Cellular)];
         [cell.maskSwitch setOn:haveOpenMask];
         
         /*上圆角*/
@@ -309,7 +309,7 @@
     }else if (row == 1){
         [cell.titleLabel setText:NSLocalizedString(@"File_Transfer_set_battery_level",nil)];
  
-        BOOL haveOpenMask = [HWDataManager getBoolWithKey:Const_file_Transfe_battery_level];
+        BOOL haveOpenMask = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_file_Transfe_battery_level)];
         [cell.maskSwitch setOn:haveOpenMask];
 
         /*下圆角*/
@@ -340,10 +340,10 @@
 - (void)didClickSwitchBy:(BOOL)SwitchOn withRow:(NSInteger)row
 {
     if(row == 0){
-        [HWDataManager setBoolWithKey:Const_file_Transfe_canUse_Cellular value:SwitchOn];
+        [HWDataManager setBoolWithKey:stringKeyAddSn(Const_file_Transfe_canUse_Cellular) value:SwitchOn];
     }
     else{
-        [HWDataManager setBoolWithKey:Const_file_Transfe_battery_level value:SwitchOn];
+        [HWDataManager setBoolWithKey:stringKeyAddSn(Const_file_Transfe_battery_level) value:SwitchOn];
     }
 }
 

+ 5 - 7
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/fileTransferPathCheckViewController.m

@@ -260,10 +260,10 @@
     _selectIndex = row;
     NSString *cutPath = _folderListArr[row];
     if(_curType == 2){
-        [HWDataManager setStringWithKey:Const_photo_backups_default_path value:cutPath];
+        [HWDataManager setStringWithKey:stringKeyAddSn(Const_photo_backups_default_path) value:cutPath];
     }
     else if(_curType == 1){
-        [HWDataManager setStringWithKey:Const_photo_upload_default_path value:cutPath];
+        [HWDataManager setStringWithKey:stringKeyAddSn(Const_photo_upload_default_path) value:cutPath];
     }
     
     [[iToast makeText:NSLocalizedString(@"save_path_change_suc_tip",nil)] show];
@@ -288,14 +288,12 @@
    
     
     if(_curType == 2){
-        [HWDataManager setStringWithKey:Const_photo_backups_default_path value:curbackupsDefaultPath];
+        [HWDataManager setStringWithKey:stringKeyAddSn(Const_photo_backups_default_path) value:curbackupsDefaultPath];
     }
     else if(_curType == 1){
-        [HWDataManager setStringWithKey:Const_photo_upload_default_path value:curbackupsDefaultPath];
+        [HWDataManager setStringWithKey:stringKeyAddSn(Const_photo_upload_default_path) value:curbackupsDefaultPath];
     }
     
-    //[HWDataManager setStringWithKey:Const_photo_backups_default_path value:curbackupsDefaultPath];
-    
     [[NSNotificationCenter defaultCenter] postNotificationName:createFolderBeginNotification object:curbackupsDefaultPath];/*发送通知*/
 }
 
@@ -337,7 +335,7 @@
         NSString * backupsDefaultPath = [HWDataManager getStringWithKey:Const_photo_backups_default_path];
         
         if(_curType == 1){
-            backupsDefaultPath = [HWDataManager getStringWithKey:Const_photo_upload_default_path];
+            backupsDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_photo_upload_default_path)];
         }
         
         NSString *lastbackupsStr = [backupsDefaultPath substringFromIndex:backupsDefaultPath.length -1];

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

@@ -207,7 +207,7 @@
 
 - (void)setSavePathDataFun
 {
-    NSString *savePath = [HWDataManager getStringWithKey:Const_photo_upload_default_path];
+    NSString *savePath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_photo_upload_default_path)];
     if(!savePath||savePath.length == 0){
         savePath = Const_default_upload_path;
     }

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

@@ -55,7 +55,7 @@ static backupsFileManager * cur_backupsFileShareInstance = nil;
 
 - (void)handlePhotosBackupsFun
 {
-    BOOL haveOpenBackups = [HWDataManager getBoolWithKey:Const_photo_backups_state];
+    BOOL haveOpenBackups = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_photo_backups_state)];
     if(!haveOpenBackups){
         return;
     }

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

@@ -401,7 +401,7 @@ static uploadFileManager * cur_uploadFileShareInstance = nil;
     
     if(curUploadStateType == uploadStateDone){
         
-        NSString *uploadDefaultPath = [HWDataManager getStringWithKey:Const_photo_upload_default_path];
+        NSString *uploadDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_photo_upload_default_path)];
         
         if([uploadDefaultPath containsString:@"mnt/media_rw"]){
             uploadDefaultPath = [uploadDefaultPath stringByReplacingOccurrencesOfString:@"mnt/media_rw" withString:NSLocalizedString(@"disk_Extra_default_tip",nil)];

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

@@ -244,7 +244,7 @@
         [[backupsFileManager shareInstance] suspendBackupsFileFun];
     }
     else{
-        BOOL haveOpenBackups = [HWDataManager getBoolWithKey:Const_photo_backups_state];
+        BOOL haveOpenBackups = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_photo_backups_state)];
         if(!haveOpenBackups){
             [[iToast makeText:NSLocalizedString(@"File_Record_backups_set_close_tip",nil)] show];
             [self reloadData];
@@ -258,7 +258,7 @@
             return;
         }
         
-        BOOL isCanUseCellular = [HWDataManager getBoolWithKey:Const_file_backups_canUse_Cellular];
+        BOOL isCanUseCellular = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_file_backups_canUse_Cellular)];
 
         if(!isCanUseCellular){//不允许流量备份
             //

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

@@ -616,7 +616,7 @@
         return;
     }
     
-    NSString * uploadDefaultPath = [HWDataManager getStringWithKey:Const_photo_upload_default_path];
+    NSString * uploadDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_photo_upload_default_path)];
     
     BOOL isExtraFileType = NO;
     BOOL isExtraPathFind = NO;

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

@@ -477,7 +477,7 @@
 
 - (void)closeImageBackupsFun
 {
-    [HWDataManager setBoolWithKey:Const_photo_backups_state value:NO];
+    [HWDataManager setBoolWithKey:stringKeyAddSn(Const_photo_backups_state) value:NO];
     [self setBackupsStateFun];
     //处理相册备份
     [[backupsFileManager shareInstance] suspendBackupsFileFun];
@@ -485,7 +485,7 @@
 
 - (void)openImageBackupsFun
 {
-    [HWDataManager setBoolWithKey:Const_photo_backups_state value:YES];
+    [HWDataManager setBoolWithKey:stringKeyAddSn(Const_photo_backups_state) value:YES];
     [self setBackupsStateFun];
     [[iToast makeText:NSLocalizedString(@"set_Privacy_title_image_open",nil)] show];
     //处理相册备份
@@ -494,7 +494,7 @@
 
 - (void)setBackupsStateFun
 {
-    BOOL haveOpenBackups = [HWDataManager getBoolWithKey:Const_photo_backups_state];
+    BOOL haveOpenBackups = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_photo_backups_state)];
     
     _imageBackupsButton.selected = haveOpenBackups;
     
@@ -515,7 +515,7 @@
     //HLog(@"xxxx:%ld",tag)
     
     if(tag == 7){
-        BOOL haveOpenBackups = [HWDataManager getBoolWithKey:Const_photo_backups_state];
+        BOOL haveOpenBackups = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_photo_backups_state)];
         
         if(!haveOpenBackups){
             //相册权限

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

@@ -50,11 +50,11 @@
         
     //}
     
-    NSString * backupsDefaultPath = [HWDataManager getStringWithKey:Const_photo_backups_default_path];
+    NSString * backupsDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_photo_backups_default_path)];
     
     if(!backupsDefaultPath || backupsDefaultPath.length == 0){
         backupsDefaultPath = Const_default_backups_path;
-        [HWDataManager setStringWithKey:Const_photo_backups_default_path value:backupsDefaultPath];
+        [HWDataManager setStringWithKey:stringKeyAddSn(Const_photo_backups_default_path) value:backupsDefaultPath];
     }
     
     NSString *lastStr= [backupsDefaultPath substringFromIndex:backupsDefaultPath.length-1];
@@ -321,7 +321,7 @@
 #pragma mark 处理上传过程
 - (void)handleBackupsingFun:(NSNumber*)fileLengthNum
 {
-    BOOL isCanUseCellular = [HWDataManager getBoolWithKey:Const_file_backups_canUse_Cellular];
+    BOOL isCanUseCellular = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_file_backups_canUse_Cellular)];
 
     if(!isCanUseCellular){//不允许流量备份
         //

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

@@ -324,7 +324,8 @@
 #pragma mark 处理上传过程
 - (void)handleUploadingFun:(NSNumber*)fileLengthNum
 {
-    BOOL isCanUseCellular = [HWDataManager getBoolWithKey:Const_file_Transfe_canUse_Cellular];
+    
+    BOOL isCanUseCellular = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_file_Transfe_canUse_Cellular)];
     
     if(!isCanUseCellular){//不允许流量备份
         //

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

@@ -981,9 +981,9 @@
 
 + (NSString *)applyForUploadFileBy:(NSString*)taskUid filePath:(NSString *)filePath
 {
-    NSString * uploadDefaultPath = [HWDataManager getStringWithKey:Const_photo_upload_default_path];
+    NSString * uploadDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_photo_upload_default_path)];
     if(!uploadDefaultPath || uploadDefaultPath.length == 0){
-        [HWDataManager setStringWithKey:Const_photo_upload_default_path value:Const_default_upload_path];
+        [HWDataManager setStringWithKey:stringKeyAddSn(Const_photo_upload_default_path) value:Const_default_upload_path];
         uploadDefaultPath = Const_default_upload_path;
     }