SceneDelegate.m 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149
  1. //
  2. // SceneDelegate.m
  3. // 唔即云相册
  4. //
  5. // Created by 余衡武 on 2021/12/8.
  6. //
  7. #import "SceneDelegate.h"
  8. #import "HWWebViewController.h"
  9. #import "CalculatorViewController.h"
  10. #import "SetUsePWDViewController.h"
  11. #import "GuideViewController.h"
  12. #import "BaseNavigationController.h"
  13. #import "MySetViewController.h"
  14. #import "SafeForKey.h"
  15. #import "TipsQRCodeViewController.h"
  16. #import "SetPWDFirstViewController.h"
  17. #import "ConnectTestViewController.h"
  18. //#import "PlayerViewController.h"
  19. #import "connectDeviceManager.h"
  20. #import "inputPWDViewController.h"
  21. #import "customLaunchView.h"
  22. #import "RSATool.h"
  23. #import "forgetPwdViewController.h"
  24. #import "TipsQRCodeForChangeDeviceViewController.h"
  25. #import "AFNetworkReachabilityManager.h"
  26. #import "ComontAlretViewController.h"
  27. #import "uploadFileManager.h"
  28. #import "downloadManager.h"
  29. #import "backupsFileManager.h"
  30. #import "iPhone.h"
  31. #import <WXApi.h>
  32. #import <TencentOpenAPI/QQApiInterface.h>
  33. #import <TencentOpenAPI/TencentOAuth.h>
  34. #import "NASMsgModel.h"
  35. #import "queryOneShareModel.h"
  36. #import "boxSaveFileManager.h"
  37. #import "boxDownloadFileManager.h"
  38. @interface SceneDelegate ()<SetUsePWDViewControllerDelegate,GuideViewControllerDelegate>
  39. @property(nonatomic, strong) CalculatorViewController *calculatorVC;
  40. @property(nonatomic, strong) HWWebViewController *webVC;
  41. @property(nonatomic, strong) inputPWDViewController *inputVC;
  42. @property(nonatomic, strong) customLaunchView *customLaunchV;//
  43. //@property(nonatomic, strong) PlayerViewController *curPlayerVC;
  44. @property(nonatomic, strong) BaseNavigationController *preRootPlayerNav;
  45. @property(nonatomic, assign) bool isQRCodeType;//第一次 扫码进来的
  46. //@property(nonatomic, assign) bool isNeedToShowSecretKey;//扫码进来的SN 没有密码 则需要显示秘钥
  47. @property (nonatomic, assign) BOOL isLoginAgainType;// 单点登录 点重新登录进来的
  48. @property (nonatomic, assign) BOOL isNeedToStopWork;// 无网络报错
  49. @property (nonatomic, assign) BOOL isDidShowPwdType;// 是否显示密码界面了
  50. @property(nonatomic, copy) NSString *getShareStr;//拿到分享的字符串
  51. @end
  52. @implementation SceneDelegate
  53. - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions API_AVAILABLE(ios(13.0)){
  54. if (scene) {
  55. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(guideOk:) name:GuideOkNotification object:nil];
  56. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showLockViewFun:) name:lockBypwdNotification object:nil];
  57. //[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setPwdVCFun:) name:setPwdNotification object:nil];
  58. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(forgetPwdFun:) name:forgetPwdNotification object:nil];
  59. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(forgetPwdBackFun:) name:forgetPwdBackNotification object:nil];
  60. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(forgetPwdDidSetPwdFun:) name:forgetPwdDidSetNotification object:nil];
  61. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(scanChangeDeviceFun:) name:scanChangeDeviceNotification object:nil];
  62. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(scanChangeDeviceBackFun:) name:scanChangeDeviceBackNotification object:nil];
  63. UIWindowScene *windowScene = (UIWindowScene *)scene;
  64. self.window = [[UIWindow alloc] initWithWindowScene:windowScene];
  65. self.window.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height);
  66. // 初始化数据库
  67. [self initBrowserWindow];
  68. // 加载主页面
  69. [self enterMainVCFromScene];
  70. //
  71. [self reportVersionInfoFun];
  72. [self.window makeKeyAndVisible];
  73. ksharedAppDelegate.window = self.window;
  74. }
  75. }
  76. /** 进入登录界面 - 内部使用 */
  77. - (void)enterLoginVCFromScene {
  78. // UIViewController *vc = [[UIViewController alloc] init];
  79. // vc.view.backgroundColor = [UIColor redColor];
  80. // UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:vc];
  81. // self.window.rootViewController = nvc;
  82. }
  83. /** 主界面 - 内部使用 */
  84. - (void)enterMainVCFromScene {
  85. // ConnectTestViewController *qrCodeVCNav = [[ConnectTestViewController alloc] init];
  86. // self.window.rootViewController = qrCodeVCNav;
  87. // return;/*临时测试*/
  88. if(_isNeedToStopWork){
  89. return;
  90. }
  91. /*先判断本地有无设备 无设备时需要先扫码添加设备*/
  92. NSDictionary *deviceDict = [HWDataManager getObjectWithKey:Const_Have_Add_Device];
  93. if (!deviceDict || ![[deviceDict allKeys] containsObject:Const_Have_Add_Device_SN]){
  94. /*扫码界面*/
  95. TipsQRCodeViewController *qrCodeVC = [[TipsQRCodeViewController alloc] init];
  96. BaseNavigationController *qrCodeVCNav = [[BaseNavigationController alloc] initWithRootViewController:qrCodeVC];
  97. self.window.rootViewController = qrCodeVCNav;
  98. _isQRCodeType = YES;
  99. return;
  100. }
  101. NSString *SNStr = deviceDict[@"Const_Have_Add_Device_SN"];
  102. // GuideViewController
  103. BOOL haveGuide = [HWDataManager getBoolWithKey:Const_Have_Show_Guide];
  104. if (haveGuide) {
  105. ;
  106. }else {
  107. GuideViewController *guiDeVC = [[GuideViewController alloc] init];
  108. guiDeVC.delegate = self;
  109. guiDeVC.sn = SNStr;
  110. self.window.rootViewController = guiDeVC;
  111. return;
  112. }
  113. //BOOL haveOpenMask = [HWDataManager getBoolWithKey:Const_Mask_View_Open];
  114. #ifdef developJSQ
  115. NSInteger maskModel = 1;// [HWDataManager getIntegerWithKey:Const_Mask_View_Model];
  116. #else
  117. NSInteger maskModel = [HWDataManager getIntegerWithKey:Const_Mask_View_Model];
  118. #endif
  119. //添加默认启动图片
  120. if(!_customLaunchV && maskModel == 0){
  121. _customLaunchV = [[customLaunchView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H)];
  122. [self.window addSubview:_customLaunchV];
  123. }
  124. [self getDeviceMsgInMainVCWith:deviceDict];
  125. //[self showNetErrorAlertType2Fun];
  126. }
  127. - (void)getDeviceMsgInMainVCWith:(NSDictionary*)deviceDict
  128. {
  129. KWeakSelf
  130. //有设备了先去做链接准备 // 80bec9c5
  131. NSString *SNStr = deviceDict[@"Const_Have_Add_Device_SN"];
  132. NSString *sdnId = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.sdnId;
  133. if(SNStr && !sdnId){
  134. [[connectDeviceManager shareInstance] getThridMsgBySN:SNStr needReconnect:YES didNetEnd:^(NSInteger didSuc) {
  135. if(didSuc == 0){
  136. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  137. mainBlock(^{
  138. [weakSelf showNetErrorAlertFun];
  139. [weakSelf enterMainVCFromSceneSecondStepFun];
  140. });
  141. });
  142. }
  143. else if(didSuc == 2){
  144. [weakSelf gotoScanAginByThridMsgErrorFun];
  145. }
  146. else{
  147. [weakSelf enterMainVCFromSceneSecondStepFun];
  148. }
  149. }];
  150. }
  151. else{
  152. [self enterMainVCFromSceneSecondStepFun];
  153. }
  154. }
  155. - (void)enterMainVCFromSceneSecondStepFun
  156. {
  157. //确保通过SN号拿到密码了
  158. //非扫码进入 进入到这里很可能还没联网拿到设备最新信息
  159. if(![connectDeviceManager shareInstance].DeviceThirdIdMod){
  160. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  161. mainBlock(^{
  162. [self enterMainVCFromScene];
  163. });
  164. });
  165. return;
  166. }
  167. //是否已经有密码了 有就是输入密码 没有就是设置密码
  168. NSString *curPwd = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password;
  169. NSString * sdnId = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.sdnId;
  170. if(!sdnId){
  171. HLog(@"没有拿到sdnId");
  172. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  173. mainBlock(^{
  174. [self enterMainVCFromScene];
  175. });
  176. });
  177. return;
  178. }
  179. if(_customLaunchV){
  180. [_customLaunchV removeFromSuperview];
  181. _customLaunchV = nil;
  182. }
  183. if(curPwd && curPwd.length > 0){
  184. /*设置密码*/
  185. // inputPWDViewController *nextVC = [[inputPWDViewController alloc] init];
  186. // BaseNavigationController *nextVCNav = [[BaseNavigationController alloc] initWithRootViewController:nextVC];
  187. // self.window.rootViewController = nextVCNav;
  188. }
  189. else{
  190. /*没有设置密码*/
  191. SetPWDFirstViewController *qrCodeVC = [[SetPWDFirstViewController alloc] init];
  192. BaseNavigationController *qrCodeVCNav = [[BaseNavigationController alloc] initWithRootViewController:qrCodeVC];
  193. self.window.rootViewController = qrCodeVCNav;
  194. return;
  195. }
  196. if(_curPlayerVC){
  197. //[_curPlayerVC disconnectVideoServer];
  198. _curPlayerVC.isNeedRecyclResource = YES;
  199. [_curPlayerVC recyclResource];
  200. _curPlayerVC.liveStreamManager = nil;
  201. _curPlayerVC.commandChannelManager = nil;
  202. [_curPlayerVC.navigationController popViewControllerAnimated:NO];
  203. _curPlayerVC = nil;
  204. }
  205. //每次进入
  206. PlayerViewController *playerRootVC = [[PlayerViewController alloc] init];
  207. if(self.isLoginAgainType){
  208. playerRootVC.isLoginAgainType = self.isLoginAgainType;
  209. }
  210. playerRootVC.isPwdVCShow = YES;
  211. _curPlayerVC = playerRootVC;
  212. // BaseNavigationController *playerNav = [[BaseNavigationController alloc] initWithRootViewController:playerRootVC];
  213. // self.window.rootViewController = playerNav;
  214. UIViewController *vc = [UIViewController new];
  215. BaseNavigationController *playerNav = [[BaseNavigationController alloc] initWithRootViewController:vc];
  216. [playerNav pushViewController:playerRootVC animated:NO];
  217. self.window.rootViewController = playerNav;
  218. _preRootPlayerNav = playerNav;
  219. self.isLoginAgainType = NO;
  220. __block BOOL isPrivacyMode = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode;
  221. KWeakSelf
  222. if(!_isQRCodeType){
  223. if(isPrivacyMode)
  224. {
  225. [playerRootVC setShowImgAndVoiceTypeFun:NO];
  226. [self showCalculatorVC];
  227. }
  228. else{
  229. [self HandleEnterNotPrivacyModeFun];
  230. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  231. mainBlock(^{
  232. [connectDeviceManager shareInstance].isFirstInputPwdDone = YES;
  233. playerRootVC.isPwdVCShow = NO;
  234. [playerRootVC setShowImgAndVoiceTypeFun:YES];
  235. [weakSelf shareAwakenAppBy:weakSelf.getShareStr];
  236. });
  237. });
  238. }
  239. //_isQRCodeType = NO;
  240. }
  241. else{
  242. if(isPrivacyMode)
  243. {
  244. [playerRootVC setShowImgAndVoiceTypeFun:NO];
  245. [self showCalculatorVC];
  246. }
  247. else{
  248. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  249. mainBlock(^{
  250. playerRootVC.isPwdVCShow = NO;
  251. [playerRootVC setShowImgAndVoiceTypeFun:YES];
  252. });
  253. });
  254. }
  255. }
  256. _isQRCodeType = NO;
  257. //获取NAS相关信息
  258. [self getNASMsgFun];
  259. }
  260. #pragma mark 处理进来是非隐私模式的情况
  261. - (void)HandleEnterNotPrivacyModeFun
  262. {
  263. #ifdef developJSQ
  264. NSInteger maskModel = 1;// [HWDataManager getIntegerWithKey:Const_Mask_View_Model];
  265. #else
  266. NSInteger maskModel = [HWDataManager getIntegerWithKey:Const_Mask_View_Model];
  267. #endif
  268. if (maskModel != 0){
  269. [HWDataManager setIntegerWithKey:Const_Mask_View_Model value:0];
  270. [iTools lc_setAlternateIconName:@"AppIcon1"];
  271. }
  272. }
  273. - (void)setPwdOk{
  274. [self enterMainVCFromScene];
  275. // NSArray *dataArray = [BaseModel bg_findAll:DB_BrowserWindows_TableName];
  276. //
  277. // if (dataArray.count == 0) { // 浏览器没有窗口
  278. // // 加载首页
  279. // HWWebViewController *vc = [[HWWebViewController alloc] init];
  280. // vc.webUrl = Const_HomeUrl;
  281. // UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:vc];
  282. // self.window.rootViewController = nvc;
  283. //
  284. // }else {
  285. // // 浏览器当前窗口索引ID
  286. // NSInteger ID = [HWDataManager getIntegerWithKey:BrowserWindowsCurrentID];
  287. // NSString *where = [NSString stringWithFormat:@"where %@=%ld",bg_sqlKey(@"ID"),(long)ID];
  288. // NSArray* finfAlls = [BaseModel bg_find:DB_BrowserWindows_TableName where:where];
  289. // BaseModel *model = finfAlls.firstObject;
  290. //
  291. // // 加载网页
  292. // HWWebViewController *vc = [[HWWebViewController alloc] init];
  293. // vc.webUrl = model.webUrl;
  294. // UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:vc];
  295. // self.window.rootViewController = nvc;
  296. // }
  297. }
  298. /** 登录界面 - 外部使用*/
  299. + (void)enterLoginVC {
  300. // SetPWDViewController *vc = [[SetPWDViewController alloc] init];
  301. // UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:vc];
  302. // UIWindow *keyWindow = [iTools getKeyWindow];
  303. // keyWindow.rootViewController = nvc;
  304. }
  305. /** 主界面 - 外部使用 */
  306. + (void)enterMainVC {
  307. // AlbumHomeViewController *vc = [[AlbumHomeViewController alloc] init];
  308. // UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:vc];
  309. // UIWindow *keyWindow = [iTools getKeyWindow];
  310. // keyWindow.rootViewController = nvc;
  311. }
  312. - (void)sceneDidDisconnect:(UIScene *)scene API_AVAILABLE(ios(13.0)){
  313. }
  314. - (void)sceneDidBecomeActive:(UIScene *)scene API_AVAILABLE(ios(13.0)){
  315. // BOOL haveGuide = [HWDataManager getBoolWithKey:Const_Have_Show_Guide];
  316. // if (haveGuide) {
  317. // ;
  318. // }else {
  319. //
  320. // return;
  321. // }
  322. // [self showCalculatorVC];
  323. }
  324. - (void)sceneWillResignActive:(UIScene *)scene API_AVAILABLE(ios(13.0)){
  325. BOOL haveGuide = [HWDataManager getBoolWithKey:Const_Have_Show_Guide];
  326. if (haveGuide) {
  327. ;
  328. }else {
  329. return;
  330. }
  331. [self showCalculatorVC];
  332. }
  333. - (void)sceneWillEnterForeground:(UIScene *)scene API_AVAILABLE(ios(13.0)){
  334. }
  335. - (void)sceneDidEnterBackground:(UIScene *)scene API_AVAILABLE(ios(13.0)){
  336. BOOL haveGuide = [HWDataManager getBoolWithKey:Const_Have_Show_Guide];
  337. if (haveGuide) {
  338. ;
  339. }else {
  340. return;
  341. }
  342. [self showCalculatorVC];
  343. }
  344. - (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity {
  345. if([TencentOAuth CanHandleUniversalLink:userActivity.webpageURL]){
  346. [TencentOAuth HandleUniversalLink:userActivity.webpageURL];
  347. }
  348. else{
  349. [WXApi handleOpenUniversalLink:userActivity delegate:self];
  350. }
  351. }
  352. - (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts {
  353. NSEnumerator *enumerator = [URLContexts objectEnumerator];
  354. UIOpenURLContext *context;
  355. while (context = [enumerator nextObject]) {
  356. NSLog(@"context.URL =====%@",context.URL);
  357. //openprivacyxapp://page?param1=value1&param2=value2
  358. NSString *curStr = context.URL.absoluteString;
  359. if([curStr rangeOfString:@"openprivacyxapp://page"].location != NSNotFound){
  360. _getShareStr = curStr;
  361. [self delayedHandlShareAwakenAppBy:curStr];
  362. break;
  363. }
  364. //NSLog(@"context.options.sourceApplication ===== %@",context.options.sourceApplication);
  365. [WXApi handleOpenURL:context.URL delegate:self];
  366. }
  367. }
  368. - (void)delayedHandlShareAwakenAppBy:(NSString*)curStr{
  369. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  370. [self shareAwakenAppBy:curStr];
  371. });
  372. }
  373. #pragma mark 初始化数据库-DB_BrowserWindows_TableName
  374. - (void)initBrowserWindow {
  375. // 浏览器当前所有窗口
  376. NSArray *dataArray = [BaseModel bg_findAll:DB_BrowserWindows_TableName];
  377. // 浏览器当前窗口索引ID
  378. NSInteger ID = [HWDataManager getIntegerWithKey:BrowserWindowsCurrentID];
  379. NSString *IDValue = [NSString stringWithFormat:@"%ld", ID];
  380. NSString *where = [NSString stringWithFormat:@"where %@=%@",bg_sqlKey(@"ID"),bg_sqlValue(IDValue)];
  381. NSArray *modelArr = [BaseModel bg_find:DB_BrowserWindows_TableName where:where];
  382. if (dataArray.count == 0) { // 浏览器没有窗口
  383. BaseModel *model = [[BaseModel alloc] init];
  384. model.ID = 0;
  385. model.name = @"主页";
  386. // model.iconFile = imageUrl;
  387. model.webUrl = Const_HomeUrl;
  388. // 写入数据库
  389. model.bg_tableName = DB_BrowserWindows_TableName;
  390. [model bg_saveOrUpdateAsync:^(BOOL isSuccess) {
  391. HLog(@"BaseModel写入:%@", isSuccess ? @"成功":@"失败");
  392. }];
  393. // 浏览器当前窗口索引ID
  394. [HWDataManager setIntegerWithKey:BrowserWindowsCurrentID value:0];
  395. }else if (modelArr.count == 0) { // 新建窗口
  396. BaseModel *model = [[BaseModel alloc] init];
  397. model.ID = ID;
  398. model.name = @"主页";
  399. // model.iconFile = imageUrl;
  400. model.webUrl = Const_HomeUrl;
  401. // 写入数据库
  402. model.bg_tableName = DB_BrowserWindows_TableName;
  403. [model bg_saveOrUpdateAsync:^(BOOL isSuccess) {
  404. HLog(@"BaseModel写入:%@", isSuccess ? @"成功":@"失败");
  405. }];
  406. }else { // 更新窗口数据
  407. // 浏览器当前窗口索引ID
  408. // NSInteger ID = [HWDataManager getIntegerWithKey:BrowserWindowsCurrentID];
  409. //
  410. // BaseModel *model = [[BaseModel alloc] init];
  411. // model.ID = ID;
  412. // model.name = @"主页";
  413. //// model.iconFile = imageUrl;
  414. // model.webUrl = Const_HomeUrl;
  415. //
  416. // // 更新数据库
  417. // model.bg_tableName = DB_BrowserWindows_TableName;
  418. // [model bg_saveOrUpdateAsync:^(BOOL isSuccess) {
  419. // HLog(@"BaseModel更新: %@", isSuccess ? @"成功":@"失败");
  420. // }];
  421. }
  422. }
  423. #pragma mark 获取当前屏幕的截图
  424. //- (UIImage *)getScreenShotImage {
  425. // CGSize size = [UIScreen mainScreen].bounds.size;
  426. // CGFloat scale = [UIScreen mainScreen].scale;
  427. // UIGraphicsBeginImageContextWithOptions(size, YES, scale);
  428. // [self.window.layer renderInContext:UIGraphicsGetCurrentContext()];
  429. // UIImage * image = UIGraphicsGetImageFromCurrentImageContext();
  430. // UIGraphicsEndImageContext();
  431. // return image;
  432. //}
  433. #pragma mark 计算器伪装视图
  434. /*CalculatorViewController*/
  435. - (void)showCalculatorVC{
  436. if(ksharedAppDelegate.getSystemPermissType){
  437. HLog(@"检测到获取系统全进入后台");
  438. return;
  439. }
  440. //修复扫描已经有密码的合作 点击跳过因为网络弹框再次覆盖一次密码(需要输入两次密码)
  441. BaseNavigationController*curTopNav = (BaseNavigationController*)[iTools appRootViewController];
  442. if([curTopNav isKindOfClass:[BaseNavigationController class]]){
  443. NSArray *vcArr = [curTopNav viewControllers];
  444. if(vcArr && vcArr.count >0){
  445. UIViewController *lastVC = vcArr.lastObject;
  446. if([lastVC isKindOfClass:[inputPWDViewController class]]){
  447. return;
  448. }
  449. }
  450. }
  451. /*无有效时长直接返回不加载任何加密界面*/
  452. NSString *PwdStr = nil;
  453. NSDictionary *deviceDict = [HWDataManager getObjectWithKey:Const_Have_Add_Device];
  454. //本地密码本地判断 密码改在服务器保持
  455. if ([[deviceDict allKeys] containsObject:Const_Have_Add_Device_PWD]){
  456. PwdStr = [deviceDict objectForKey:Const_Have_Add_Device_PWD];
  457. }
  458. //实时拿到的密码 (每次打开或者更换设备 通过SN重新拿)
  459. if([connectDeviceManager shareInstance].DeviceThirdIdMod.data.password){
  460. NSString *curPwd = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.password;
  461. NSString*desPwdStr = [RSATool AES128Decrypt:curPwd key:AESCODEKEEYY];
  462. if(desPwdStr){
  463. PwdStr = desPwdStr;
  464. }
  465. }
  466. if (!PwdStr || [PwdStr isEqualToString:@""])
  467. {
  468. return;
  469. }
  470. // BOOL haveOpenMask = [HWDataManager getBoolWithKey:Const_Mask_View_Open];
  471. // if (!haveOpenMask){
  472. // //输入密码界面
  473. // [self closeCalculatorVC];
  474. // _inputVC = [[inputPWDViewController alloc] init];
  475. // [self.window addSubview:_inputVC.view];
  476. // return;
  477. // }
  478. BOOL haveVaildTime = [HWDataManager getBoolWithKey:Const_Have_No_VaildTime];
  479. if (haveVaildTime == YES){/*无有效时间*/
  480. return;
  481. }
  482. if(![connectDeviceManager shareInstance].DeviceThirdIdMod){
  483. return;
  484. }
  485. BOOL isPrivacyMode = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode;
  486. if(!isPrivacyMode)
  487. {
  488. [connectDeviceManager shareInstance].isFirstInputPwdDone = YES;
  489. [[NSNotificationCenter defaultCenter] postNotificationName:ShowImgAndVoiceNotification object:nil];
  490. return;
  491. }
  492. #ifdef developJSQ
  493. NSInteger maskModel = 1;// [HWDataManager getIntegerWithKey:Const_Mask_View_Model];
  494. #else
  495. NSInteger maskModel = [HWDataManager getIntegerWithKey:Const_Mask_View_Model];
  496. #endif
  497. if (maskModel == 0){
  498. //输入密码界面
  499. [self closeCalculatorVC];
  500. _inputVC = [[inputPWDViewController alloc] init];
  501. [self.window addSubview:_inputVC.view];
  502. _isDidShowPwdType = YES;
  503. }
  504. else if (maskModel == 2){
  505. /*浏览器*/
  506. [self closeCalculatorVC];
  507. _webVC = [[HWWebViewController alloc] init];
  508. _webVC.pwd = PwdStr;
  509. _webVC.webUrl = @"https://baidu.com";
  510. [self.window addSubview:_webVC.view];
  511. _isDidShowPwdType = YES;
  512. }else{
  513. /*计算器*/
  514. [self closeCalculatorVC];
  515. _calculatorVC = [[CalculatorViewController alloc] init];
  516. _calculatorVC.pwd = PwdStr;
  517. [self.window addSubview:_calculatorVC.view];
  518. _isDidShowPwdType = YES;
  519. }
  520. [[NSNotificationCenter defaultCenter] postNotificationName:ShowPwdVCNotification object:nil];
  521. }
  522. - (void)closeCalculatorVC{
  523. ksharedAppDelegate.getSystemPermissType = NO;
  524. if (_calculatorVC){
  525. [_calculatorVC.view removeFromSuperview];
  526. }
  527. /*浏览器*/
  528. if (_webVC){
  529. [_webVC.view removeFromSuperview];
  530. }
  531. if(_inputVC){
  532. [_inputVC.view removeFromSuperview];
  533. }
  534. _isDidShowPwdType = NO;
  535. }
  536. - (NSString *)documentPathForAccount:(NSString *)account fileFolder:(NSString *)fileFolder {
  537. NSString *path = DocumentPath;
  538. if (account.length != 0) {
  539. path = [NSString stringWithFormat:@"%@/%@/",DocumentPath,account];
  540. }
  541. if ([fileFolder containsString:@"/"]) {
  542. NSString *path1 = [path stringByAppendingPathComponent:fileFolder];
  543. path1 = [path1 stringByDeletingLastPathComponent];
  544. NSError *error;
  545. if (![[NSFileManager defaultManager] fileExistsAtPath:path1]) {
  546. [[NSFileManager defaultManager] createDirectoryAtPath:path1 withIntermediateDirectories:YES attributes:nil error:&error];
  547. }
  548. }else{
  549. NSError *error;
  550. if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
  551. [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error];
  552. }
  553. }
  554. return [path stringByAppendingPathComponent:fileFolder];
  555. }
  556. - (void)startUseBtnBePressed{
  557. [self enterMainVCFromScene];
  558. // NSString *launchAppPWDPath = [self documentPathForAccount:@"" fileFolder:@"LaunchPWD"];
  559. // NSString *str = [[NSString alloc] initWithContentsOfFile:launchAppPWDPath encoding:(NSUTF8StringEncoding) error:nil];
  560. // if (!str || [str isEqualToString:@"0"])
  561. // {
  562. // SetUsePWDViewController *loginVC = [[SetUsePWDViewController alloc] init];
  563. // loginVC.delegate = self;
  564. // self.window.rootViewController = loginVC;
  565. //
  566. // return;
  567. // }
  568. //
  569. // NSArray *dataArray = [BaseModel bg_findAll:DB_BrowserWindows_TableName];
  570. //
  571. // if (dataArray.count == 0) { // 浏览器没有窗口
  572. // // 加载首页
  573. // HWWebViewController *vc = [[HWWebViewController alloc] init];
  574. // vc.webUrl = Const_HomeUrl;
  575. // UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:vc];
  576. // self.window.rootViewController = nvc;
  577. //
  578. // }else {
  579. // // 浏览器当前窗口索引ID
  580. // NSInteger ID = [HWDataManager getIntegerWithKey:BrowserWindowsCurrentID];
  581. // NSString *where = [NSString stringWithFormat:@"where %@=%ld",bg_sqlKey(@"ID"),(long)ID];
  582. // NSArray* finfAlls = [BaseModel bg_find:DB_BrowserWindows_TableName where:where];
  583. // BaseModel *model = finfAlls.firstObject;
  584. //
  585. // // 加载网页
  586. // HWWebViewController *vc = [[HWWebViewController alloc] init];
  587. // vc.webUrl = model.webUrl;
  588. // UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:vc];
  589. // self.window.rootViewController = nvc;
  590. // }
  591. }
  592. - (void)loginOk{
  593. [self enterMainVCFromScene];
  594. }
  595. - (void)guideOk:(NSNotification*)not{
  596. NSString *object = not.object;
  597. if(object && [object isEqualToString:@"isLoginAgainType"]){
  598. self.isLoginAgainType = YES;
  599. }
  600. [self enterMainVCFromScene];
  601. //clear下载和上传的已经获取的数据
  602. [[uploadFileManager shareInstance] suspendUploadFileFun:YES withModel:nil];
  603. [uploadFileManager shareInstance].databaseArr = [NSMutableArray new];
  604. [uploadFileManager shareInstance].fileModelDataArr = [NSMutableArray new];
  605. [uploadFileManager shareInstance].curUploadFileDataModel.curUploadStateType = uploadStateWait;
  606. [[downloadManager shareInstance] suspendDownloadFileFun:YES withModel:nil];
  607. [downloadManager shareInstance].databaseArr = [NSMutableArray new];
  608. [downloadManager shareInstance].downLoadFileModelDataArr = [NSMutableArray new];
  609. [[backupsFileManager shareInstance] suspendBackupsFileFun];
  610. }
  611. #pragma mark 上报版本号信息
  612. -(void)reportVersionInfoFun
  613. {
  614. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  615. NSString *vers = [iPhone appVersion];
  616. if(vers){
  617. [paraDict setValue:vers forKey:@"iosClientVersionNumber"];
  618. }
  619. NSDictionary *deviceDict = [HWDataManager getObjectWithKey:Const_Have_Add_Device];
  620. if (deviceDict && [[deviceDict allKeys] containsObject:Const_Have_Add_Device_SN]){
  621. NSString*snStr = deviceDict[Const_Have_Add_Device_SN];
  622. if(snStr){
  623. [paraDict setValue:snStr forKey:@"sn"];
  624. }
  625. else{
  626. return;
  627. }
  628. }
  629. else{
  630. return;;
  631. }
  632. // KWeakSelf
  633. [[netWorkManager shareInstance] CommonPostCallBackCode:reportVersionInfo Parameters:paraDict success:^(id _Nonnull responseObject) {
  634. } failure:^(NSError * _Nonnull error) {
  635. }];
  636. }
  637. #pragma mark 获取NAS相关信息
  638. -(void)getNASMsgFun
  639. {
  640. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  641. NSString *SNStr = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
  642. if(SNStr){
  643. [paraDict setValue:SNStr forKey:@"sn"];
  644. }
  645. else{
  646. return;;
  647. }
  648. KWeakSelf
  649. [[netWorkManager shareInstance] CommonGetWithCallBackCode:getIpFun Parameters:paraDict success:^(id _Nonnull responseObject){
  650. NASMsgModel *model = [[NASMsgModel alloc] initWithDictionary:responseObject error:nil];
  651. if(model){
  652. ksharedAppDelegate.NASMsgMod = model;
  653. }
  654. } failure:^(NSError * _Nonnull error) {
  655. }];
  656. }
  657. #pragma mark 主动上锁
  658. - (void)showLockViewFun:(NSNotification*)not
  659. {
  660. [self showCalculatorVC];
  661. }
  662. #pragma mark 进入设置密码
  663. //- (void)setPwdVCFun:(NSNotification*)not
  664. //{
  665. // _isNeedToShowSecretKey = YES;
  666. //}
  667. #pragma mark 忘记密码
  668. - (void)forgetPwdFun:(NSNotification*)not
  669. {
  670. /*忘记密码*/
  671. forgetPwdViewController *forgetPwdVC = [[forgetPwdViewController alloc] init];
  672. BaseNavigationController *forgetPwdVCNav = [[BaseNavigationController alloc] initWithRootViewController:forgetPwdVC];
  673. self.window.rootViewController = forgetPwdVCNav;
  674. }
  675. #pragma mark 忘记密码返回
  676. - (void)forgetPwdBackFun:(NSNotification*)not
  677. {
  678. // if(_preRootPlayerNav)
  679. // {
  680. // self.window.rootViewController = _preRootPlayerNav;
  681. // }
  682. // else{
  683. [self enterMainVCFromScene];
  684. //}
  685. [self showCalculatorVC];
  686. }
  687. #pragma mark 忘记密码设置密码完成
  688. - (void)forgetPwdDidSetPwdFun:(NSNotification*)not
  689. {
  690. // if(_preRootPlayerNav)
  691. // {
  692. // NSArray *vcArr = _preRootPlayerNav.viewControllers;
  693. // if(vcArr.count > 2){
  694. // [_preRootPlayerNav popToViewController:vcArr[1] animated:NO];
  695. // }
  696. // self.window.rootViewController = _preRootPlayerNav;
  697. // }
  698. // else{
  699. [self enterMainVCFromScene];
  700. //}
  701. [self closeCalculatorVC];
  702. _curPlayerVC.isPwdVCShow = NO;
  703. [_curPlayerVC setShowImgAndVoiceTypeFun:YES];
  704. [connectDeviceManager shareInstance].isFirstInputPwdDone = YES;
  705. }
  706. #pragma mark 扫码切换设备 scanChangeDeviceNotification
  707. - (void)scanChangeDeviceFun:(NSNotification*)not
  708. {
  709. TipsQRCodeForChangeDeviceViewController *nextVC = [[TipsQRCodeForChangeDeviceViewController alloc] init];
  710. nextVC.isRootVCType = YES;
  711. BaseNavigationController *nextNav = [[BaseNavigationController alloc] initWithRootViewController:nextVC];
  712. self.window.rootViewController = nextNav;
  713. }
  714. #pragma mark 扫码切换设备点击返回
  715. - (void)scanChangeDeviceBackFun:(NSNotification*)not
  716. {
  717. // if(_preRootPlayerNav)
  718. // {
  719. // self.window.rootViewController = _preRootPlayerNav;
  720. // }
  721. // else{
  722. [self enterMainVCFromScene];
  723. //}
  724. [self showCalculatorVC];
  725. }
  726. #pragma mark 网络异常弹框
  727. -(void)showNetErrorAlertFun
  728. {
  729. NSInteger maskModel = [HWDataManager getIntegerWithKey:Const_Mask_View_Model];
  730. if(maskModel !=0 && _isDidShowPwdType){
  731. return;
  732. }
  733. NSString *linkErrTip = NSLocalizedString(@"player_link_fail_tip_type9",nil);
  734. if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable){
  735. linkErrTip = NSLocalizedString(@"player_link_fail_phone_Tips",nil);
  736. _isNeedToStopWork = YES;
  737. [self showNetErrorAlertType2Fun];
  738. return;
  739. }
  740. linkErrTip = [[NSString alloc] initWithFormat:@"[9]%@",linkErrTip];
  741. ComontAlretViewController *linkFailAlretVC= [[ComontAlretViewController alloc] initWithTiTle:nil
  742. msg:linkErrTip
  743. imageStr:nil
  744. cancelTitle:NSLocalizedString(@"single_sign_on_exit",nil)
  745. okTitle:NSLocalizedString(@"player_link_fail_tryAgain",nil) isOkBtnHighlight:YES
  746. didClickOk:^{
  747. //[self enterMainVCFromScene];
  748. } didClickCancel:^{
  749. exit(0);
  750. }];
  751. linkFailAlretVC.modalPresentationStyle = UIModalPresentationCustom;
  752. [self.window.rootViewController presentViewController:linkFailAlretVC animated:YES completion:^{
  753. linkFailAlretVC.view.superview.backgroundColor = [UIColor clearColor];
  754. }];
  755. }
  756. #pragma mark 网络异常弹框
  757. -(void)showNetErrorAlertType2Fun
  758. {
  759. if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable){
  760. NSString * linkErrTip = NSLocalizedString(@"netWork_error_tip_content",nil);
  761. ComontAlretViewController *linkFailAlretVC= [[ComontAlretViewController alloc] initWithTiTle:NSLocalizedString(@"netWork_error_tip_title",nil)
  762. msg:linkErrTip
  763. imageStr:nil
  764. cancelTitle:NSLocalizedString(@"single_sign_on_exit",nil)
  765. okTitle:nil isOkBtnHighlight:NO
  766. didClickOk:^{
  767. //[self enterMainVCFromScene];
  768. } didClickCancel:^{
  769. exit(0);
  770. }];
  771. linkFailAlretVC.modalPresentationStyle = UIModalPresentationCustom;
  772. self.window.rootViewController = [UIViewController new];
  773. [self.window.rootViewController presentViewController:linkFailAlretVC animated:YES completion:^{
  774. linkFailAlretVC.view.superview.backgroundColor = [UIColor clearColor];
  775. }];
  776. }
  777. }
  778. - (void)gotoScanAginByThridMsgErrorFun
  779. {
  780. /*扫码界面*/
  781. TipsQRCodeViewController *qrCodeVC = [[TipsQRCodeViewController alloc] init];
  782. qrCodeVC.isNeedToShowAleatType = YES;
  783. BaseNavigationController *qrCodeVCNav = [[BaseNavigationController alloc] initWithRootViewController:qrCodeVC];
  784. self.window.rootViewController = qrCodeVCNav;
  785. }
  786. #pragma mark 分享页面唤醒APP
  787. - (void)shareAwakenAppBy:(NSString*)shareStr
  788. {
  789. //[[iToast makeText:shareStr] show];
  790. NSArray * paraArr = [shareStr componentsSeparatedByString:@"&"];
  791. if(!paraArr || paraArr.count==0){
  792. return;
  793. }
  794. //type=save和download
  795. NSString *type = nil;
  796. NSString *fileIds = nil;
  797. NSString *extractionCode = nil;
  798. NSString *token = nil;
  799. for (NSString*objectStr in paraArr) {
  800. if([objectStr rangeOfString:@"type"].location != NSNotFound){
  801. NSArray * objectArr = [objectStr componentsSeparatedByString:@"="];
  802. if(objectArr.count == 2){
  803. type = objectArr.lastObject;
  804. continue;
  805. }
  806. }
  807. else if([objectStr rangeOfString:@"fileIds"].location != NSNotFound){
  808. NSArray * objectArr = [objectStr componentsSeparatedByString:@"="];
  809. if(objectArr.count == 2){
  810. fileIds = objectArr.lastObject;
  811. continue;
  812. }
  813. }
  814. else if([objectStr rangeOfString:@"extractionCode"].location != NSNotFound){
  815. NSArray * objectArr = [objectStr componentsSeparatedByString:@"="];
  816. if(objectArr.count == 2){
  817. extractionCode = objectArr.lastObject;
  818. continue;
  819. }
  820. }
  821. else if([objectStr rangeOfString:@"token"].location != NSNotFound){
  822. NSArray * objectArr = [objectStr componentsSeparatedByString:@"="];
  823. if(objectArr.count == 2){
  824. token = objectArr.lastObject;
  825. continue;
  826. }
  827. }
  828. }
  829. if(!type || type.length ==0){
  830. HLog(@"分享 type 获取错误");
  831. return;
  832. }
  833. if(!fileIds || fileIds.length ==0){
  834. HLog(@"分享 fileIds 获取错误");
  835. return;
  836. }
  837. if(!token || token.length ==0){
  838. HLog(@"分享 token 获取错误");
  839. return;
  840. }
  841. [self getShareOneFileListFunByToken:token withFileIds:fileIds withExtractionCode:extractionCode withType:type];
  842. }
  843. #pragma mark 分享信息重新获取
  844. - (void)getShareOneFileListFunByToken:(NSString*)token withFileIds:(NSString*)fileIds withExtractionCode:(NSString*)extractionCode withType:(NSString*)type
  845. {
  846. NSMutableDictionary*paraDict = [NSMutableDictionary new];
  847. fileIds = [fileIds stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
  848. NSData *jsonData = [fileIds dataUsingEncoding:NSUTF8StringEncoding];;
  849. NSArray *jsonArray = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:nil];
  850. HLog(@"jsonArray:%@",jsonArray)
  851. if(!jsonArray){
  852. return;
  853. }
  854. [paraDict setValue:token forKey:@"token"];
  855. [paraDict setValue:jsonArray forKey:@"fileIdList"];
  856. [paraDict setValue:extractionCode forKey:@"extractionCode"];
  857. KWeakSelf
  858. [[netWorkManager shareInstance] CommonPostCallBackCode:queryOneShareInfoFun Parameters:paraDict success:^(id _Nonnull responseObject) {
  859. queryOneShareModel*model = [[queryOneShareModel alloc] initWithDictionary:responseObject error:nil];
  860. if(model && model.status == 0){
  861. weakSelf.getShareStr = nil;
  862. [weakSelf gotoVCByModel:model withType:type];
  863. }
  864. else{
  865. }
  866. } failure:^(NSError * _Nonnull error) {
  867. }];
  868. }
  869. #pragma mark 跳转
  870. - (void)gotoVCByModel:(queryOneShareModel*)model withType:(NSString*)type
  871. {
  872. if([type isEqualToString:@"save"]){
  873. [self saveFileToBoxFunBy:model];
  874. }
  875. else if([type isEqualToString:@"download"]){
  876. [self downloadFileToAppFunBy:model];
  877. }
  878. }
  879. #pragma mark 保存文件到盒子
  880. - (void)saveFileToBoxFunBy:(queryOneShareModel*)sharemodel
  881. {
  882. NSMutableDictionary*paraDict = [NSMutableDictionary new];
  883. NSMutableArray *pathArr = [NSMutableArray new];
  884. for (ShareFileDataModel*dataModel in sharemodel.data.fileListVOS){
  885. [pathArr addObject:dataModel.fileUrl];
  886. }
  887. if (pathArr) {
  888. NSString *jsonStr = [iTools toJsonStrWithArray:pathArr];
  889. if(jsonStr){
  890. [paraDict setValue:jsonStr forKey:@"urls"];
  891. }
  892. }
  893. NSString * boxSaveDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_box_save_default_path)];
  894. if(!boxSaveDefaultPath || boxSaveDefaultPath.length == 0){
  895. boxSaveDefaultPath = Const_default_save_path;
  896. [HWDataManager setStringWithKey:stringKeyAddSn(Const_box_save_default_path) value:boxSaveDefaultPath];
  897. }
  898. [paraDict setValue:boxSaveDefaultPath forKey:@"savePath"];
  899. KWeakSelf
  900. [[netWorkManager shareInstance] cloudPhoneGETCallBackCode:@"downFiles" Parameters:paraDict success:^(id _Nonnull responseObject) {
  901. SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
  902. if(model && model.status == 0){
  903. [weakSelf gotoUploadFileRecordVCFunByType:2 withModel:sharemodel];
  904. }
  905. } failure:^(NSError * _Nonnull error) {
  906. }];
  907. }
  908. #pragma mark 下载文件到手机
  909. - (void)downloadFileToAppFunBy:(queryOneShareModel*)sharemodel
  910. {
  911. [self gotoUploadFileRecordVCFunByType:1 withModel:sharemodel];
  912. }
  913. #pragma mark 跳转传输列表
  914. - (void)gotoUploadFileRecordVCFunByType:(NSInteger)type withModel:(queryOneShareModel*)sharemodel
  915. {
  916. if(type == 2){
  917. [[boxSaveFileManager shareInstance] addBoxSaveRecordFunBy:sharemodel.data.fileListVOS];
  918. }
  919. else if (type == 1){
  920. [[boxDownloadFileManager shareInstance] addBoxDownloadRecordFunBy:sharemodel.data.fileListVOS];
  921. }
  922. uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
  923. vc.isReceiveType = type;
  924. if(_curPlayerVC){
  925. [[UIApplication sharedApplication] setStatusBarHidden:NO];
  926. [_curPlayerVC.navigationController pushViewController:vc animated:YES];
  927. }
  928. }
  929. @end