Browse Source

1.iOS端修改密码后,可以使用新密码进入云机,Android端扫描同一序列号,输旧密码也可以登录,
2.修改app显示名字未成功

huangxiaodong 2 years ago
parent
commit
0199cf9b82

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

@@ -2110,11 +2110,11 @@
 				);
 				INFOPLIST_FILE = "双子星云手机/Info.plist";
 				INFOPLIST_KEY_CFBundleDisplayName = "Private-X";
-				INFOPLIST_KEY_NSCameraUsageDescription = "Invisible space将需要使用您的摄像头用于头像拍照";
-				INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "Invisible space将需要使用您的地址信息以便于为您提供更准确的服务。";
-				INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "Invisible space将需要使用您的地址信息以便于为您提供更准确的服务。";
-				INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "Invisible space需求使用您的相册保存图片。";
-				INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Invisible space需求获取您的相册图片。";
+				INFOPLIST_KEY_NSCameraUsageDescription = "Private-X将需要使用您的摄像头用于头像拍照";
+				INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "Private-X将需要使用您的地址信息以便于为您提供更准确的服务。";
+				INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "Private-X将需要使用您的地址信息以便于为您提供更准确的服务。";
+				INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "Private-X需求使用您的相册保存图片。";
+				INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Private-X需求获取您的相册图片。";
 				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
 				INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
 				INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent;
@@ -2188,11 +2188,11 @@
 				);
 				INFOPLIST_FILE = "双子星云手机/Info.plist";
 				INFOPLIST_KEY_CFBundleDisplayName = "Private-X";
-				INFOPLIST_KEY_NSCameraUsageDescription = "Invisible space将需要使用您的摄像头用于头像拍照";
-				INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "Invisible space将需要使用您的地址信息以便于为您提供更准确的服务。";
-				INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "Invisible space将需要使用您的地址信息以便于为您提供更准确的服务。";
-				INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "Invisible space需求使用您的相册保存图片。";
-				INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Invisible space需求获取您的相册图片。";
+				INFOPLIST_KEY_NSCameraUsageDescription = "Private-X将需要使用您的摄像头用于头像拍照";
+				INFOPLIST_KEY_NSLocationAlwaysAndWhenInUseUsageDescription = "Private-X将需要使用您的地址信息以便于为您提供更准确的服务。";
+				INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "Private-X将需要使用您的地址信息以便于为您提供更准确的服务。";
+				INFOPLIST_KEY_NSPhotoLibraryAddUsageDescription = "Private-X需求使用您的相册保存图片。";
+				INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Private-X需求获取您的相册图片。";
 				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
 				INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
 				INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent;

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

@@ -228,7 +228,8 @@ static iPhone *shareInstance = nil;
 {
     NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary];
     
-    NSString *appVersion = [infoDic objectForKey:@"CFBundleName"];
+    //NSString *appVersion = [infoDic objectForKey:@"CFBundleName"];
+    NSString *appVersion = [infoDic objectForKey:@"CFBundleDisplayName"];
     
     return appVersion;
 }

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

@@ -85,6 +85,9 @@ isBangsScreen; \
 //#define CloudService   @"http://14.18.190.141:1801"
 #define CloudService   @"http://hiboxde.armclouding.com:7780"
 
+#define AESCODEKEEYY @"fvO8gAfNSr1tbdQe"
+
+
 #define FileService            @"http://file.phone.androidscloud.com:8210"
 #define Const_File_Access_Key  @"13d0arghebcc4cm49cf04"
 #define CloudGameService       @"http://14.18.190.140:9090"

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

@@ -248,7 +248,9 @@
                 //有设备了先去做链接准备  // 80bec9c5
                 NSString *SNStr = deviceDict[@"Const_Have_Add_Device_SN"];
                 if(SNStr){
-                    [[connectDeviceManager shareInstance] updateCardInfoBySN:SNStr withPwdStr:pwd];
+                    [[connectDeviceManager shareInstance] updateCardInfoBySN:SNStr withPwdStr:pwd didNetEnd:^(bool didSuc) {
+                        
+                    }];
                 }
             }
             

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

@@ -228,17 +228,47 @@
 //        }
 //    }
     
+   
+    
+    // 获取Info.plist的路径
+    NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"];
+
+    // 读取Info.plist文件
+    NSMutableDictionary *infoDict = [NSMutableDictionary dictionaryWithContentsOfFile:plistPath];
+
+   
     if (logoSelectView.selectIndex == 1){
         /*设置图标*/
         [[UIApplication sharedApplication] setAlternateIconName:@"AppIcon 1" completionHandler:^(NSError * _Nullable error) {
             [HWDataManager setIntegerWithKey:Const_Mask_View_Model value:1];
         }];
+        // 修改应用名称
+        [infoDict setObject:NSLocalizedString(@"logo_calculator",nil) forKey:@"CFBundleDisplayName"]; // 或者使用CFBundleName
+
+        
     }else if (logoSelectView.selectIndex == 2){
         /*设置图标*/
         [[UIApplication sharedApplication] setAlternateIconName:@"AppIcon 2" completionHandler:^(NSError * _Nullable error) {
             [HWDataManager setIntegerWithKey:Const_Mask_View_Model value:2];
         }];
+        
+        // 修改应用名称
+        [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);
 }
 
 - (void)logoSelectViewHaveSelect{

+ 25 - 2
创维盒子/双子星云手机/Class/Set/ModifyPWD/ModifyPWDSecondViewController.m

@@ -8,6 +8,7 @@
 #import "ModifyPWDSecondViewController.h"
 #import <Masonry.h>
 #import "MySetViewController.h"
+#import "connectDeviceManager.h"
 
 @interface ModifyPWDSecondViewController (){
     NSString *pwd;
@@ -259,8 +260,30 @@
             [dict setObject:pwd forKey:Const_Have_Add_Device_PWD];
             [HWDataManager setObjectWithKey:Const_Have_Add_Device value:dict];
             
-            /*返回设置首页*/
-            [self goSetHome];
+            
+            if (deviceDict && [[deviceDict allKeys] containsObject:Const_Have_Add_Device_SN]){
+                //有设备了先去做链接准备  // 80bec9c5
+                NSString *SNStr = deviceDict[@"Const_Have_Add_Device_SN"];
+                if(SNStr){
+                    KWeakSelf
+                    [self showNewIndicatorWithCanBack:YES canTouch:NO];
+                    [[connectDeviceManager shareInstance] updateCardInfoBySN:SNStr withPwdStr:pwd didNetEnd:^(bool didSuc) {
+                        
+                        [weakSelf removeNewIndicator];
+                        
+                        if(didSuc){
+                            /*返回设置首页*/
+                            [weakSelf goSetHome];
+                        }
+                        else{
+                            
+                        }
+                        
+                    }];
+                }
+            }
+            
+           
         }else{
             /*提示密码不一致*/
             [topLabel setText:NSLocalizedString(@"guide_set_pwd_no_same",nil)];

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

@@ -65,8 +65,8 @@
     [appName setTextColor:HW333333Color];
     [appName setFont:[UIFont boldSystemFontOfSize:16.f]];
     [appName setTextAlignment:(NSTextAlignmentCenter)];
-    //[appName setText:[NSString stringWithFormat:@"%@APP",[iPhone appBundleName]]];
-    [appName setText:[NSString stringWithFormat:@"%@",@"Private- X"]];
+    [appName setText:[NSString stringWithFormat:@"%@",[iPhone appBundleName]]];
+    //[appName setText:[NSString stringWithFormat:@"%@",@"Private- X"]];
     
     [self.view addSubview:appName];
     [appName mas_makeConstraints:^(MASConstraintMaker *make) {

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

@@ -18,6 +18,11 @@ typedef enum{
     DeviceConnectDeciceOk,
 }connectDeviceState;
 
+/**
+ *  
+ */
+typedef void (^netWork_DidEndByOK) (bool didSuc);
+
 @interface connectDeviceManager : NSObject
 +(connectDeviceManager *)shareInstance;
 
@@ -30,7 +35,7 @@ typedef enum{
 -(void)getThridMsgBySN:(NSString*)snStr;
 
 #pragma mark 保持卡密码
--(void)updateCardInfoBySN:(NSString*)snStr withPwdStr:(NSString*)pwd;
+-(void)updateCardInfoBySN:(NSString*)snStr withPwdStr:(NSString*)pwd didNetEnd:(netWork_DidEndByOK)didNetEndIsOK;
 @end
 
 NS_ASSUME_NONNULL_END

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

@@ -72,7 +72,7 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
         {
             weakSelf.curConnectDeviceState = DeviceConnectGetThridOK;
             
-            NSString*desPwdstr = [RSATool AES128Decrypt:weakSelf.DeviceThirdIdMod.data.password key:@"fvO8gAfNSr1tbdQe"];
+            NSString*desPwdstr = [RSATool AES128Decrypt:weakSelf.DeviceThirdIdMod.data.password key:AESCODEKEEYY];
             
             /*密码保持在本地*/
             NSDictionary *deviceDict = [HWDataManager getObjectWithKey:Const_Have_Add_Device];
@@ -314,29 +314,43 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
 
 
 #pragma mark 保持卡密码
--(void)updateCardInfoBySN:(NSString*)snStr withPwdStr:(NSString*)pwd
+-(void)updateCardInfoBySN:(NSString*)snStr withPwdStr:(NSString*)pwd didNetEnd:(netWork_DidEndByOK)didNetEndIsOK
 {
     
-    
     NSMutableDictionary *paraDict = [NSMutableDictionary new];
     [paraDict setValue:snStr forKey:@"sn"];
-    [paraDict setValue:pwd forKey:@"password"];
+    
+    NSString* enPwdStr = [RSATool AES128Encrypt:pwd key:AESCODEKEEYY];
+    if(enPwdStr){
+        [paraDict setValue:enPwdStr forKey:@"password"];
+    }
     
     KWeakSelf
-    [[netWorkManager shareInstance] CommonGetWithCallBackCode:updateCardInfo Parameters:paraDict success:^(id  _Nonnull responseObject) {
+    [[netWorkManager shareInstance] CommonPostCallBackCode:updateCardInfo Parameters:paraDict success:^(id  _Nonnull responseObject) {
         
         
         SuperModel*model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
 
-        if(model.status == 0)
+        if(model && model.status == 0)
         {
+            didNetEndIsOK(YES);
+            
+            [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password = enPwdStr;
+            /*密码保持在本地*/
+            NSDictionary *deviceDict = [HWDataManager getObjectWithKey:Const_Have_Add_Device];
+            NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithDictionary:deviceDict];
+            [dict setObject:pwd forKey:Const_Have_Add_Device_PWD];
+            [HWDataManager setObjectWithKey:Const_Have_Add_Device value:dict];
             
         }
-        
+        else{
+            didNetEndIsOK(NO);
+        }
         
         
     } failure:^(NSError * _Nonnull error) {
         HLog("网络报错");
+        didNetEndIsOK(NO);
     }];
 }