Procházet zdrojové kódy

1.瑞云报11时上传客户端瑞云日志到文件中心,把key给后台
2.扫码获取不到设备信息弹框修改

huangxiaodong před 1 rokem
rodič
revize
1cadce7a9a

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

@@ -208,6 +208,14 @@
 		6B45C5092B5FA2DD007E6911 /* diskListTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B45C5072B5FA2DD007E6911 /* diskListTableCell.m */; };
 		6B45C50C2B5FA80E007E6911 /* diskListBgView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B45C50A2B5FA80E007E6911 /* diskListBgView.h */; };
 		6B45C50D2B5FA80E007E6911 /* diskListBgView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B45C50B2B5FA80E007E6911 /* diskListBgView.m */; };
+		6B467BB22BC7E4360039A6A6 /* addLogObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B467BB12BC7E4350039A6A6 /* addLogObject.m */; };
+		6B467BB32BC7E4360039A6A6 /* addLogObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B467BB02BC7E4350039A6A6 /* addLogObject.h */; };
+		6B467BB42BC7E4360039A6A6 /* addLogObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B467BB12BC7E4350039A6A6 /* addLogObject.m */; };
+		6B467BB52BC7E4360039A6A6 /* addLogObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B467BB02BC7E4350039A6A6 /* addLogObject.h */; };
+		6B467BB82BC7F7D70039A6A6 /* fileUploadToFileCenterModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B467BB72BC7F7D70039A6A6 /* fileUploadToFileCenterModel.m */; };
+		6B467BB92BC7F7D70039A6A6 /* fileUploadToFileCenterModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B467BB62BC7F7D70039A6A6 /* fileUploadToFileCenterModel.h */; };
+		6B467BBA2BC7F7D70039A6A6 /* fileUploadToFileCenterModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B467BB72BC7F7D70039A6A6 /* fileUploadToFileCenterModel.m */; };
+		6B467BBB2BC7F7D70039A6A6 /* fileUploadToFileCenterModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B467BB62BC7F7D70039A6A6 /* fileUploadToFileCenterModel.h */; };
 		6B4835FD2B9172D7001FC9BA /* usbInsertAnimation.json in Resources */ = {isa = PBXBuildFile; fileRef = 6B4835FC2B9172D7001FC9BA /* usbInsertAnimation.json */; };
 		6B4D23B12B33DDBC005B718A /* imageVersionRenewTipView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B4D23AF2B33DDBB005B718A /* imageVersionRenewTipView.h */; };
 		6B4D23B22B33DDBC005B718A /* imageVersionRenewTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B4D23B02B33DDBB005B718A /* imageVersionRenewTipView.m */; };
@@ -1028,6 +1036,10 @@
 		6B45C5072B5FA2DD007E6911 /* diskListTableCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = diskListTableCell.m; sourceTree = "<group>"; };
 		6B45C50A2B5FA80E007E6911 /* diskListBgView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = diskListBgView.h; sourceTree = "<group>"; };
 		6B45C50B2B5FA80E007E6911 /* diskListBgView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = diskListBgView.m; sourceTree = "<group>"; };
+		6B467BB02BC7E4350039A6A6 /* addLogObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = addLogObject.h; sourceTree = "<group>"; };
+		6B467BB12BC7E4350039A6A6 /* addLogObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = addLogObject.m; sourceTree = "<group>"; };
+		6B467BB62BC7F7D70039A6A6 /* fileUploadToFileCenterModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fileUploadToFileCenterModel.h; sourceTree = "<group>"; };
+		6B467BB72BC7F7D70039A6A6 /* fileUploadToFileCenterModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = fileUploadToFileCenterModel.m; sourceTree = "<group>"; };
 		6B4835FC2B9172D7001FC9BA /* usbInsertAnimation.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = usbInsertAnimation.json; sourceTree = "<group>"; };
 		6B4D23AF2B33DDBB005B718A /* imageVersionRenewTipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = imageVersionRenewTipView.h; sourceTree = "<group>"; };
 		6B4D23B02B33DDBB005B718A /* imageVersionRenewTipView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = imageVersionRenewTipView.m; sourceTree = "<group>"; };
@@ -1844,6 +1856,7 @@
 		6B3F96312AD2A0FA008E349E /* netWork */ = {
 			isa = PBXGroup;
 			children = (
+				6B467BAF2BC7E3B10039A6A6 /* addLog */,
 				6B3F96322AD2A15A008E349E /* netWorkManager.h */,
 				6B3F96332AD2A15A008E349E /* netWorkManager.m */,
 				6B3F96392AD2AD0B008E349E /* newWorkInterface.h */,
@@ -1851,6 +1864,17 @@
 			path = netWork;
 			sourceTree = "<group>";
 		};
+		6B467BAF2BC7E3B10039A6A6 /* addLog */ = {
+			isa = PBXGroup;
+			children = (
+				6B467BB02BC7E4350039A6A6 /* addLogObject.h */,
+				6B467BB12BC7E4350039A6A6 /* addLogObject.m */,
+				6B467BB62BC7F7D70039A6A6 /* fileUploadToFileCenterModel.h */,
+				6B467BB72BC7F7D70039A6A6 /* fileUploadToFileCenterModel.m */,
+			);
+			path = addLog;
+			sourceTree = "<group>";
+		};
 		6B4835FB2B9172B2001FC9BA /* resources */ = {
 			isa = PBXGroup;
 			children = (
@@ -2391,6 +2415,7 @@
 				6B5D40372B4BEEF8000965CF /* downloadThumbnailManager.h in Headers */,
 				6B0582802B01C67400D37290 /* uploadFileRecordViewController.h in Headers */,
 				6BEA31752BB65606005167AA /* clearCacheAlretViewController.h in Headers */,
+				6B467BB32BC7E4360039A6A6 /* addLogObject.h in Headers */,
 				183AE6D12A8CA98C00B11CB0 /* CloudPhoneAPI.h in Headers */,
 				1868201D2AB97BE1005702A6 /* TipsQRCodeViewController.h in Headers */,
 				6B5B60602B3BC8DE009A2AE2 /* fileTransferPopView.h in Headers */,
@@ -2460,6 +2485,7 @@
 				184C8ACC2A94557200F26650 /* HidenMaskSetViewController.h in Headers */,
 				18EC79DC2ABC109F0084836A /* SetPWDSecondViewController.h in Headers */,
 				6B0582852B0457C400D37290 /* uploadFileManager.h in Headers */,
+				6B467BB92BC7F7D70039A6A6 /* fileUploadToFileCenterModel.h in Headers */,
 				6BFF268C2AF8E1C600FCB4F7 /* forgetPwdViewController.h in Headers */,
 				6BF52C992AD5546500A617DB /* Reachability.h in Headers */,
 				6B5D40432B4CF04C000965CF /* PlayerViewController+downloadFile.h in Headers */,
@@ -2517,6 +2543,7 @@
 				6BD506A72B9576A4006E7CB0 /* downloadThumbnailManager.h in Headers */,
 				6BD506A82B9576A4006E7CB0 /* uploadFileRecordViewController.h in Headers */,
 				6BEA31782BB65606005167AA /* clearCacheAlretViewController.h in Headers */,
+				6B467BB52BC7E4360039A6A6 /* addLogObject.h in Headers */,
 				6BD506A92B9576A4006E7CB0 /* CloudPhoneAPI.h in Headers */,
 				6BD506AA2B9576A4006E7CB0 /* TipsQRCodeViewController.h in Headers */,
 				6BD506AB2B9576A4006E7CB0 /* fileTransferPopView.h in Headers */,
@@ -2586,6 +2613,7 @@
 				6BD506EA2B9576A4006E7CB0 /* HidenMaskSetViewController.h in Headers */,
 				6BD506EB2B9576A4006E7CB0 /* SetPWDSecondViewController.h in Headers */,
 				6BD506EC2B9576A4006E7CB0 /* uploadFileManager.h in Headers */,
+				6B467BBB2BC7F7D70039A6A6 /* fileUploadToFileCenterModel.h in Headers */,
 				6BD506ED2B9576A4006E7CB0 /* forgetPwdViewController.h in Headers */,
 				6BD506EE2B9576A4006E7CB0 /* Reachability.h in Headers */,
 				6BD506EF2B9576A4006E7CB0 /* PlayerViewController+downloadFile.h in Headers */,
@@ -3089,6 +3117,7 @@
 				6BD5076B2B9576A4006E7CB0 /* JSONModel.m in Sources */,
 				6BD5076C2B9576A4006E7CB0 /* PlayerViewController+AppDelegate.m in Sources */,
 				6BD5076D2B9576A4006E7CB0 /* WHPingTester.m in Sources */,
+				6B467BB42BC7E4360039A6A6 /* addLogObject.m in Sources */,
 				6BD5076E2B9576A4006E7CB0 /* forgetPwdViewController.m in Sources */,
 				6BD5076F2B9576A4006E7CB0 /* uploadFileRecordTableViewHeadView.m in Sources */,
 				6BD507702B9576A4006E7CB0 /* JSONHTTPClient.m in Sources */,
@@ -3182,6 +3211,7 @@
 				6BD507C72B9576A4006E7CB0 /* ShortcutManager.m in Sources */,
 				6BD507C82B9576A4006E7CB0 /* uploadFileRecordViewController.m in Sources */,
 				6BD507C92B9576A4006E7CB0 /* BaseModel.m in Sources */,
+				6B467BBA2BC7F7D70039A6A6 /* fileUploadToFileCenterModel.m in Sources */,
 				6BD507CA2B9576A4006E7CB0 /* HWHistoryModel.m in Sources */,
 				6BD507CB2B9576A4006E7CB0 /* PlayerViewController+downloadThumbnailImage.m in Sources */,
 				6BD507CC2B9576A4006E7CB0 /* PlayerView.m in Sources */,
@@ -3300,6 +3330,7 @@
 				183AE6042A89CE3C00B11CB0 /* JSONModel.m in Sources */,
 				18FCE5492AD15E750020F623 /* PlayerViewController+AppDelegate.m in Sources */,
 				6BF52C9A2AD5546500A617DB /* WHPingTester.m in Sources */,
+				6B467BB22BC7E4360039A6A6 /* addLogObject.m in Sources */,
 				6BFF268D2AF8E1C600FCB4F7 /* forgetPwdViewController.m in Sources */,
 				6B72724C2B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.m in Sources */,
 				183AE6082A89CE3C00B11CB0 /* JSONHTTPClient.m in Sources */,
@@ -3393,6 +3424,7 @@
 				18FCE5452AD136FF0020F623 /* ShortcutManager.m in Sources */,
 				6B0582812B01C67400D37290 /* uploadFileRecordViewController.m in Sources */,
 				A003F6A827D841C800715CBF /* BaseModel.m in Sources */,
+				6B467BB82BC7F7D70039A6A6 /* fileUploadToFileCenterModel.m in Sources */,
 				A0295B1627EDA0EC009C5D8B /* HWHistoryModel.m in Sources */,
 				6B5D403C2B4BFEB9000965CF /* PlayerViewController+downloadThumbnailImage.m in Sources */,
 				183AE6B42A8CA00300B11CB0 /* PlayerView.m in Sources */,
@@ -3830,7 +3862,7 @@
 				ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEVELOPMENT_TEAM = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -3907,7 +3939,7 @@
 				ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEVELOPMENT_TEAM = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",

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

@@ -99,8 +99,8 @@ isBangsScreen; \
 #define cutVideoPieceSzie (10*1024*1024) //视频每次切片多少(切完上传再切一次)
 #define keyToForgetPwd @"%==%"
 
-#define FileService            @"http://file.phone.androidscloud.com:8210"
-#define Const_File_Access_Key  @"13d0arghebcc4cm49cf04"
+#define FileService            @"http://file.phone.androidscloud.com:8210/document/file/lowLevelMultipartUpload"
+#define Const_File_Access_Key  @"ikIm5C0KjKNvusTF6tIH" //@"13d0arghebcc4cm49cf04"
 #define CloudGameService       @"http://14.18.190.140:9090"
 #define FileAPPManifestKey  Const_File_APP_Manifest_Key_test
 #define WXAPPid @"wxd6397f58cb0d92cf"

+ 1 - 1
创维盒子/双子星云手机/Class/ComontAlretViewController.h

@@ -31,7 +31,7 @@ typedef void (^CommonAlert_ClickCancelBtn) (void);
 - (id)initWithTiTle:(NSString *)title msg:(NSString *)msg imageStr:(NSString *)images cancelTitle:(NSString *)cancelTitle okTitle:(NSString *)okTitle isOkBtnHighlight:(BOOL)okBtnHighlight didClickOk:(CommonAlert_ClickOkBtn)ok didClickCancel:(CommonAlert_ClickCancelBtn)Cancel;
 
 - (void)setButtonCountdownFun:(NSInteger)second;
-
+- (void)setMsgTextAlignment:(NSTextAlignment)textAlignment;
 @end
 
 NS_ASSUME_NONNULL_END

+ 13 - 5
创维盒子/双子星云手机/Class/ComontAlretViewController.m

@@ -99,8 +99,8 @@
     if (titleStr.length > 0){
         [bgView addSubview:titleLabel];
         [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-            make.left.mas_equalTo(8.f);
-            make.right.mas_equalTo(-8.f);
+            make.left.mas_equalTo(10.f);
+            make.right.mas_equalTo(-10.f);
             make.top.mas_equalTo(curTop);
         }];
     }
@@ -110,14 +110,15 @@
     [msgLabel setTextColor:HW333333Color];
     [msgLabel setFont:[UIFont systemFontOfSize:15.f]];
     [msgLabel setTextAlignment:(NSTextAlignmentCenter)];
+    msgLabel.tag = 11;
     [msgLabel setText:msgStr];
     [msgLabel setNumberOfLines:0];
     
     if (msgStr.length > 0){
         [bgView addSubview:msgLabel];
         [msgLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-            make.left.mas_equalTo(8.f);
-            make.right.mas_equalTo(-8.f);
+            make.left.mas_equalTo(10.f);
+            make.right.mas_equalTo(-10.f);
             if (titleStr.length > 0){
                 make.top.equalTo(titleLabel.mas_bottom).offset(15.f);
             }else{
@@ -296,7 +297,14 @@
     }
 }
 
-
+- (void)setMsgTextAlignment:(NSTextAlignment)textAlignment
+{
+    UILabel *label = [self.view viewWithTag:11];
+    
+    if(label && [label isKindOfClass:[UILabel class]]){
+        label.textAlignment = textAlignment;
+    }
+}
 
 /*
 #pragma mark - Navigation

+ 4 - 2
创维盒子/双子星云手机/Class/Guide/TipsQRCodeViewController.m

@@ -222,9 +222,10 @@
 {
     
     
-    NSString *linkErrTip = NSLocalizedString(@"scan_sn_data_error_tip",nil);
+    NSString *linkErrTitle = NSLocalizedString(@"scan_sn_data_error_title",nil);
+    NSString *linkErrTip = NSLocalizedString(@"scan_sn_data_error_content",nil);
     
-    ComontAlretViewController *linkFailAlretVC= [[ComontAlretViewController alloc] initWithTiTle:nil
+    ComontAlretViewController *linkFailAlretVC= [[ComontAlretViewController alloc] initWithTiTle:linkErrTitle
                                                                                       msg:linkErrTip
                                                                                  imageStr:nil
                                                                               cancelTitle:NSLocalizedString(@"guide_set_pwd_guide_know",nil)
@@ -238,6 +239,7 @@
     
      linkFailAlretVC.modalPresentationStyle = UIModalPresentationCustom;
      
+     [linkFailAlretVC setMsgTextAlignment:NSTextAlignmentLeft];
      [self presentViewController:linkFailAlretVC animated:YES completion:^{
          linkFailAlretVC.view.superview.backgroundColor = [UIColor clearColor];
      }];

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

@@ -385,7 +385,7 @@ static uploadFileManager * cur_uploadFileShareInstance = nil;
                 
                 AVURLAsset* urlAsset = (AVURLAsset*)asset;
                 
-                BOOL isSuc = [cachesFileManager copyVideoItemAtPath:[urlAsset.URL path] fileName:_curUploadFileDataModel.filename error:nil];
+                BOOL isSuc = [cachesFileManager copyVideoItemAtPath:[urlAsset.URL path] fileName:self->_curUploadFileDataModel.filename error:nil];
                 
                 //NSData *videoData =  [NSData dataWithContentsOfURL:urlAsset.URL];
            

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

@@ -28,6 +28,7 @@
 #import "cloudPhoneCommonModel.h"
 #import "ComontAlretViewController.h"
 #import "AudioSessionObject.h"
+#import "addLogObject.h"
 
 @protocol PlayerViewControllerDelegate <NSObject>
 

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

@@ -251,6 +251,7 @@ ComontAlretViewControllerDelegate>
     _checkThridConnectNum += 1;
     
     if(_checkThridConnectNum >= 30 && [[connectDeviceManager shareInstance] curConnectDeviceState] <= 3 ){
+        [[addLogObject shareInstance] gotoAddLogFun];
         [self showNetErrorAlertFun:11];
         _checkThridConnectNum = 0;
 //        [_checkThridConnectTimer invalidate];

+ 1 - 1
创维盒子/双子星云手机/CloudPlayer/View/PlayerView.m

@@ -71,7 +71,7 @@ ShowImageViewDelegate>{
                   inRect:CGRectMake(0, 0, glkshowImageView.drawableWidth, glkshowImageView.drawableHeight)
                 fromRect:[ciImage extent]];
     
-    [self->glkshowImageView display];
+    //[self->glkshowImageView display];
 }
 
 - (void)showIMage

+ 9 - 0
创维盒子/双子星云手机/Info.plist

@@ -79,6 +79,15 @@
 				<key>NSIncludesSubdomains</key>
 				<true/>
 			</dict>
+			<key>file.phone.androidscloud.com</key>
+			<dict>
+				<key>NSExceptionAllowsInsecureHTTPLoads</key>
+				<true/>
+				<key>NSExceptionRequiresForwardSecrecy</key>
+				<false/>
+				<key>NSIncludesSubdomains</key>
+				<true/>
+			</dict>
 			<key>hiboxde.armclouding.com</key>
 			<dict>
 				<key>NSExceptionAllowsInsecureHTTPLoads</key>

+ 2 - 1
创维盒子/双子星云手机/SuperModel/SuperModel.h

@@ -13,5 +13,6 @@
 @property(nonatomic,copy) NSString* msg;//描述信息
 @property(nonatomic,assign) NSInteger status; //错误码
 
-
+//文件中心的
+@property(nonatomic,assign) NSInteger code; //
 @end

+ 19 - 0
创维盒子/双子星云手机/netWork/addLog/addLogObject.h

@@ -0,0 +1,19 @@
+//
+//  addLogObject.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/4/11.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface addLogObject : NSObject
+@property(nonatomic,assign) BOOL canUploadNowType;//当前是否可以上传日志 正常上传中 不可再次上传
+
++(addLogObject *)shareInstance;
+- (void)gotoAddLogFun;
+@end
+
+NS_ASSUME_NONNULL_END

+ 145 - 0
创维盒子/双子星云手机/netWork/addLog/addLogObject.m

@@ -0,0 +1,145 @@
+//
+//  addLogObject.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/4/11.
+//
+
+#import "addLogObject.h"
+#import "netWorkManager.h"
+#import "connectDeviceManager.h"
+#import "fileUploadToFileCenterModel.h"
+
+@implementation addLogObject
+static addLogObject *addlog_ShareInstance = nil;
++(addLogObject *)shareInstance;
+{
+    static dispatch_once_t onceToken;
+    
+    dispatch_once(&onceToken, ^{
+        addlog_ShareInstance = [[addLogObject alloc]init];
+    });
+    
+    return addlog_ShareInstance;
+}
+
+- (id)init
+{
+    self = [super init];
+    
+    if (self) {
+        _canUploadNowType = YES;
+    }
+    
+    return self;
+}
+
+//1.读取日志
+//2.上传到文件中心
+//3.拿到key上传到盒子服务器
+- (void)gotoAddLogFun
+{
+    //HLog(@"hxd beginTime");
+    if(!_canUploadNowType){
+        return;
+    }
+    
+    //一小时内只能上传一次
+    NSNumber *preSecondNum =  [HWDataManager getNumberWithKey:stringKeyAddSn(@"addLog")];
+    if(preSecondNum){
+        long seconds =  [iTools getNowTimeStamp];
+        if(seconds - preSecondNum.longValue <= 60*60){
+            return;
+        }
+    }
+    
+    _canUploadNowType = NO;
+    
+    //1.读取日志
+    NSString *ruiyunLogPath = [NSString stringWithFormat:@"%@/logs/debug_0.log",CachesPatch];
+    NSData *logData = [NSData dataWithContentsOfFile:ruiyunLogPath];
+    HLog(@"%@",logData);
+    
+    if(!logData || [logData length]==0){
+        _canUploadNowType = YES;
+        return;
+    }
+    
+    //2.上传到文件中心
+    NSMutableDictionary *paraDict = [NSMutableDictionary new];
+    
+    NSString *snStr = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    if(!snStr){
+        snStr = [iTools getNowTimeString];
+    }
+    NSString*filename = [[NSString alloc] initWithFormat:@"%@_ios",snStr];
+    
+    [paraDict setValue:filename forKey:@"filename"];
+    
+    [[netWorkManager shareInstance] doUploadFileToFileServiceWithParams:paraDict data:logData success:^(id  _Nonnull responseObject) {
+        HLog(@"%@",responseObject);
+        
+        fileUploadToFileCenterModel *model = [[fileUploadToFileCenterModel alloc] initWithDictionary:responseObject error:nil];
+        if(model.code == 200){
+            NSString * fileKey = model.data.fileKey;
+            if(fileKey && fileKey.length >0){
+                [self uploadKeyToServerFunBy:fileKey];
+            }
+            else{
+                self->_canUploadNowType = YES;
+            }
+        }
+        else{
+            self->_canUploadNowType = YES;
+        }
+        
+    } faild:^(NSError * _Nonnull error) {
+        self->_canUploadNowType = YES;
+    }];
+    
+
+    //[self uploadKeyToServerFunBy:@"LowLevelMultipartUpload_43025714606656109698"];
+}
+
+//3.拿到key上传到盒子服务器
+- (void)uploadKeyToServerFunBy:(NSString*)fileKey
+{
+    NSMutableDictionary *paraDict = [NSMutableDictionary new];
+    [paraDict setValue:@"ios" forKey:@"type"];
+    
+    NSString *snStr = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    if(!snStr){
+        _canUploadNowType = YES;
+        return;
+    }
+    [paraDict setValue:snStr forKey:@"sn"];
+    [paraDict setValue:fileKey forKey:@"key"];
+    
+    KWeakSelf
+    [[netWorkManager shareInstance] CommonPostCallBackCode:addLogFun Parameters:paraDict success:^(id  _Nonnull responseObject) {
+        SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
+        if(model.code == 0){
+            [weakSelf markAddLogTimeFun];
+        }
+        else{
+            self->_canUploadNowType = YES;
+        }
+        
+    } failure:^(NSError * _Nonnull error) {
+        self->_canUploadNowType = YES;
+    }];
+}
+
+- (void)markAddLogTimeFun
+{
+   //
+    long seconds =  [iTools getNowTimeStamp];
+    NSNumber *secondsNum = [NSNumber numberWithLong:seconds];
+    if(secondsNum){
+        [HWDataManager  setNumberWithKey:stringKeyAddSn(@"addLog") value:secondsNum];
+    }
+    
+    _canUploadNowType = YES;
+    //HLog(@"hxd endTime");
+}
+@end

+ 22 - 0
创维盒子/双子星云手机/netWork/addLog/fileUploadToFileCenterModel.h

@@ -0,0 +1,22 @@
+//
+//  fileUploadToFileCenterModel.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/4/11.
+//
+
+#import "SuperModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface dileCenterDataModel : SuperModel
+@property (nonatomic, copy) NSString* fileKey;
+@property (nonatomic, copy) NSString* md5;
+@property(nonatomic, assign)NSInteger uploadSize;
+@end
+
+@interface fileUploadToFileCenterModel : SuperModel
+@property (nonatomic, strong) dileCenterDataModel* data;
+@end
+
+NS_ASSUME_NONNULL_END

+ 15 - 0
创维盒子/双子星云手机/netWork/addLog/fileUploadToFileCenterModel.m

@@ -0,0 +1,15 @@
+//
+//  fileUploadToFileCenterModel.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/4/11.
+//
+
+#import "fileUploadToFileCenterModel.h"
+
+@implementation dileCenterDataModel
+
+@end
+@implementation fileUploadToFileCenterModel
+
+@end

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

@@ -30,6 +30,7 @@ typedef void (^netWork_Faild) (NSError *error);
 #pragma mark afnetwork  get 请求
 - (void)CommonGetWithCallBackCode:(NSString *)code Parameters:(NSDictionary *_Nullable)dic success:(netWork_Success)success failure:(netWork_Faild)faildStr;
 
+- (void)doUploadFileToFileServiceWithParams:(NSMutableDictionary *)params data:(NSData *)data success:(netWork_Success)success faild:(netWork_Faild)faildStr;
 @end
 
 NS_ASSUME_NONNULL_END

+ 28 - 0
创维盒子/双子星云手机/netWork/netWorkManager.m

@@ -234,4 +234,32 @@ static netWorkManager *Game_NetWorkShareInstance = nil;
     }];
 }
 
+- (void)doUploadFileToFileServiceWithParams:(NSMutableDictionary *)params data:(NSData *)data success:(netWork_Success)success faild:(netWork_Faild)faildStr {
+    
+    AFHTTPSessionManager *uploadManager = [[AFHTTPSessionManager alloc] init];
+    uploadManager.requestSerializer = [AFJSONRequestSerializer serializer];
+    uploadManager.responseSerializer = [AFJSONResponseSerializer serializer];
+    uploadManager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json",@"text/json", @"text/javascript",@"text/html",@"text/plain",nil];
+    uploadManager.requestSerializer.timeoutInterval = 60;
+    
+    
+    NSString *urlString = FileService;
+    [uploadManager.requestSerializer setValue:Const_File_Access_Key forHTTPHeaderField:@"file-access-key"];
+    [uploadManager POST:urlString parameters:params constructingBodyWithBlock:^(id<AFMultipartFormData>  _Nonnull formData) {
+        
+        NSString *mimeType =@"application/octet-stream";
+        [formData appendPartWithFileData:data name:@"file" fileName:params[@"filename"] mimeType:mimeType];
+        
+    } progress:^(NSProgress * _Nonnull uploadProgress) {
+        
+    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
+        
+        success(responseObject);
+        
+    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error, id  _Nonnull responseObject) {
+        
+        faildStr(error);
+    }];
+}
+
 @end

+ 8 - 0
创维盒子/双子星云手机/netWork/newWorkInterface.h

@@ -50,4 +50,12 @@
  返回数据模型 */
 #define queryOneNotice  @"/box/notice/queryOne"
 
+/*7 上报日志   POST请求
+输入参数     sn
+输入参数     key 文件中心上传成功的到的key
+输入参数     type  应用类型(安卓=apk IOS=ios TV=app)
+ 
+ 返回数据模型 */
+#define addLogFun  @"/box/log/add"
+
 #endif /* newWorkInterface_h */

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

@@ -431,3 +431,5 @@
 "common_minute"      = "分";
 "common_second"      = "秒";
 "backups_cur_task_done_numbers"   = "本次更新备份";
+"scan_sn_data_error_title"   = "设备信息不存在,请检查您的设备";
+"scan_sn_data_error_content"   = "检查步骤:\n1、检查盒子是否通电通网;\n2、检查设备与网络是否均处于国内大陆环境;\n\n解决步骤:\n1、确保盒子通电通网,呼吸灯蓝色。\n2、非国内大陆环境需提供SN给客服处理。";