Quellcode durchsuchen

1.更新设备 密码没换问题

huangxiaodong vor 1 Jahr
Ursprung
Commit
c082996e4c

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

@@ -375,16 +375,26 @@
 /*CalculatorViewController*/
 - (void)showCalculatorVC{
     /*无有效时长直接返回不加载任何加密界面*/
-    NSString *str = nil;
+    NSString *PwdStr = nil;
     NSDictionary *deviceDict = [HWDataManager getObjectWithKey:Const_Have_Add_Device];
     
-    //本地密码补在判断 密码改在服务器保持
+    //本地密码本地判断 密码改在服务器保持
     if ([[deviceDict allKeys] containsObject:Const_Have_Add_Device_PWD]){
-        str = [deviceDict objectForKey:Const_Have_Add_Device_PWD];
+        PwdStr = [deviceDict objectForKey:Const_Have_Add_Device_PWD];
     }
 
+    //实时拿到的密码 (每次打开或者更换设备 通过SN重新拿)
+    if([connectDeviceManager shareInstance].DeviceThirdIdMod.data.password){
+        NSString *curPwd = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password;
+        NSString*desPwdStr  = [RSATool AES128Decrypt:curPwd key:AESCODEKEEYY];
+        
+        if(desPwdStr){
+            PwdStr = desPwdStr;
+        }
+    }
+   
     
-    if (!str || [str isEqualToString:@""])
+    if (!PwdStr || [PwdStr isEqualToString:@""])
     {
         return;
     }
@@ -414,14 +424,14 @@
         /*浏览器*/
         [self closeCalculatorVC];
         _webVC = [[HWWebViewController alloc] init];
-        _webVC.pwd = str;
+        _webVC.pwd = PwdStr;
         _webVC.webUrl = @"https://baidu.com";
         [self.window addSubview:_webVC.view];
     }else{
         /*计算器*/
         [self closeCalculatorVC];
         _calculatorVC = [[CalculatorViewController alloc] init];
-        _calculatorVC.pwd = str;
+        _calculatorVC.pwd = PwdStr;
         [self.window addSubview:_calculatorVC.view];
     }
     

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

@@ -226,7 +226,7 @@ bool isDownType = YES;
         
         if(resStr.length > 22)
         {
-            NSString*desStr  = [RSATool AES128Decrypt:resStr key:@"fvO8gAfNSr1tbdQe"];
+            NSString*desStr  = [RSATool AES128Decrypt:resStr key:AESCODEKEEYY];
             
             if(desStr){//能解码
                 resStr = desStr;

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

@@ -336,7 +336,7 @@
         //是否已经有密码了 有就是输入密码 没有就是设置密码
         NSString *curPwd = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password;
         
-        NSString*desPwdStr  = [RSATool AES128Decrypt:curPwd key:@"fvO8gAfNSr1tbdQe"];
+        NSString*desPwdStr  = [RSATool AES128Decrypt:curPwd key:AESCODEKEEYY];
         
         if([desPwdStr isEqualToString:pwd]){
             

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

@@ -227,7 +227,7 @@ bool isDownType22 = YES;
         NSString *resStr = object.stringValue;//RK3908P1V62112465
         if(resStr.length > 22)
         {
-            NSString*desStr  = [RSATool AES128Decrypt:resStr key:@"fvO8gAfNSr1tbdQe"];
+            NSString*desStr  = [RSATool AES128Decrypt:resStr key:AESCODEKEEYY];
             
             if(desStr){//能解码
                 resStr = desStr;
@@ -288,6 +288,8 @@ bool isDownType22 = YES;
                     [[NSNotificationCenter defaultCenter] postNotificationName:GuideOkNotification object:nil];
                 }else{
                     [[iToast makeText:NSLocalizedString(@"guide_qrcoede_tips_get_SdnID_fail",nil)] show];
+                    
+                    [self.navigationController popViewControllerAnimated:YES];
                 }
             }];
         }

+ 15 - 15
创维盒子/双子星云手机/Class/Set/ChangeLogo/ChangeLogoViewController.m

@@ -231,10 +231,10 @@
    
     
     // 获取Info.plist的路径
-    NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"];
-
-    // 读取Info.plist文件
-    NSMutableDictionary *infoDict = [NSMutableDictionary dictionaryWithContentsOfFile:plistPath];
+//    NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"];
+//
+//    // 读取Info.plist文件
+//    NSMutableDictionary *infoDict = [NSMutableDictionary dictionaryWithContentsOfFile:plistPath];
 
    
     if (logoSelectView.selectIndex == 1){
@@ -247,7 +247,7 @@
         [HWDataManager setIntegerWithKey:Const_Mask_View_Model value:1];
         
         // 修改应用名称
-        [infoDict setObject:NSLocalizedString(@"logo_calculator",nil) forKey:@"CFBundleDisplayName"]; // 或者使用CFBundleName
+        //[infoDict setObject:NSLocalizedString(@"logo_calculator",nil) forKey:@"CFBundleDisplayName"]; // 或者使用CFBundleName
 
         
     }else if (logoSelectView.selectIndex == 2){
@@ -260,22 +260,22 @@
         [HWDataManager setIntegerWithKey:Const_Mask_View_Model value:2];
         
         // 修改应用名称
-        [infoDict setObject:NSLocalizedString(@"logo_bowser",nil) forKey:@"CFBundleDisplayName"]; // 或者使用CFBundleName
+        //[infoDict setObject:NSLocalizedString(@"logo_bowser",nil) forKey:@"CFBundleDisplayName"]; // 或者使用CFBundleName
 
     }
     
   
     
     // 保存修改后的Info.plist文件
-    [infoDict writeToFile:plistPath atomically:YES];
-
-    // 刷新应用的名称
-    [[NSBundle mainBundle] load];
-    
-    infoDict = [NSMutableDictionary dictionaryWithContentsOfFile:plistPath];
-    
-    NSString *DisplayName = [NSBundle mainBundle].infoDictionary[@"CFBundleDisplayName"];
-    HLog(@"CFBundleDisplayName:%@",DisplayName);
+//    [infoDict writeToFile:plistPath atomically:YES];
+//
+//    // 刷新应用的名称
+//    [[NSBundle mainBundle] load];
+//
+//    infoDict = [NSMutableDictionary dictionaryWithContentsOfFile:plistPath];
+//
+//    NSString *DisplayName = [NSBundle mainBundle].infoDictionary[@"CFBundleDisplayName"];
+//    HLog(@"CFBundleDisplayName:%@",DisplayName);
     
     
     //提示语