// // RQVIPModule.m // jiaPei // // Created by 张嵘 on 2022/2/28. // Copyright © 2022 JCZ. All rights reserved. // #import "RQVIPModule.h" #include @interface RQVIPModule () @end @implementation RQVIPModule static id rq_VIPModule = nil; #pragma mark - init + (instancetype)sharedInstance { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ rq_VIPModule = [[self alloc] init]; }); return rq_VIPModule; } - (instancetype)init { if (self = [super init]) { } return self; } #pragma mark - PublicMethods - (void)gotoBuyVipWithVipPageType:(RQVIPPageType)vipPageType { [self gotoBuyVipWithVipPageType:vipPageType subject:RQ_YDTQuestion_Module.subject]; } - (void)gotoBuyVipWithVipPageType:(RQVIPPageType)vipPageType subject:(RQHomePageSubjectType)subject { WeakSelf(weakSelf) [RQ_VIP_Module isActiveWithCcomplete:^(RQActivationModel * _Nullable activationModel, BOOL isSuccess) { if (isSuccess) { if (activationModel.isShare) { if (vipPageType == RQVIPPageType_Alert) { [weakSelf showVipAlertWithDictType:RQ_USER_MANAGER.currentUser.city subject:subject]; } else { [weakSelf gotoVipViewWithDictType:RQ_USER_MANAGER.currentUser.city subject:subject]; } } else { NSString *typeStr = subject > 4? @"vip_coach_package": @"vip_package"; if (vipPageType == RQVIPPageType_Alert) { [weakSelf showVipAlertWithDictType:typeStr subject:subject]; } else { [weakSelf gotoVipViewWithDictType:typeStr subject:subject]; } } } }]; } - (void)showVipAlertWithDictType:(NSString *)dictType subject:(RQHomePageSubjectType)subject { if (RQ_USER_MANAGER.isShouldLogin) { [MBProgressHUD rq_showProgressHUD:@"获取VIP套餐..."]; [[RQ_HTTP_Service getTypeWithDictType:dictType] subscribeNext:^(NSArray *typeModels) { [MBProgressHUD rq_hideHUD]; RQVipViewModel *vipViewModel = [[RQVipViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{ RQViewModelIDKey : @(RQVIPPageType_Alert), RQViewModelUtilKey : typeModels, RQViewCommonValueKey : @(subject), }]; RQVipViewController *vipViewController = [[RQVipViewController alloc] initWithViewModel:vipViewModel]; [RQControllerHelper.topViewController presentPanModal:vipViewController]; } error:^(NSError * _Nullable error) { [MBProgressHUD rq_hideHUD]; [MBProgressHUD rq_showErrorTips:error]; }]; } } - (void)gotoVipViewWithDictType:(NSString *)dictType { [self gotoVipViewWithDictType:dictType subject:RQ_YDTQuestion_Module.subject]; } - (void)gotoVipViewWithDictType:(NSString *)dictType subject:(RQHomePageSubjectType)subject { if (RQ_USER_MANAGER.isShouldLogin) { [MBProgressHUD rq_showProgressHUD:@"获取VIP套餐..."]; [[RQ_HTTP_Service getTypeWithDictType:dictType] subscribeNext:^(NSArray *typeModels) { [MBProgressHUD rq_hideHUD]; if(subject>4){ NYLIVipCoachViewModel *livipCoachViewModel = [[NYLIVipCoachViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{ RQViewModelIDKey : @(RQVIPPageType_Full), RQViewModelUtilKey : typeModels, RQViewCommonValueKey : @(subject), }]; [RQ_APPDELEGATE.services pushViewModel:livipCoachViewModel animated:YES]; }else{ [RQ_APPDELEGATE.services pushViewModel:[[RQVipViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{ RQViewModelIDKey : @(RQVIPPageType_Full), RQViewModelUtilKey : typeModels, RQViewCommonValueKey : @(subject), }] animated:YES]; } } error:^(NSError * _Nullable error) { [MBProgressHUD rq_hideHUD]; [MBProgressHUD rq_showErrorTips:error]; }]; } } - (void)gotoVipCenter { [self gotoVipCenterWithSubject:RQ_YDTQuestion_Module.subject]; } - (void)gotoVipCenterWithSubject:(RQHomePageSubjectType)subject { @weakify(self) [RQ_VIP_Module isActiveWithCcomplete:^(RQActivationModel * _Nullable activationModel, BOOL isSuccess) { @strongify(self) if (isSuccess) { if (activationModel.isShare) { [self gotoVipCenterWithDictType:RQ_USER_MANAGER.currentUser.city subject:subject]; } else { // NSString *typeStr = subject > 4? @"vip_coach_package": @"vip_package"; NSString *typeStr = @"vip_package"; [self gotoVipCenterWithDictType:typeStr subject:subject]; } } }]; } - (void)gotoVipCenterWithDictType:(NSString *)dictType subject:(RQHomePageSubjectType)subject { if (RQ_USER_MANAGER.isShouldLogin) { [MBProgressHUD rq_showProgressHUD:@"获取VIP套餐..."]; [[RQ_HTTP_Service getTypeWithDictType:dictType] subscribeNext:^(NSArray *typeModels) { [MBProgressHUD rq_hideHUD]; // if(subject>4){ // NYLIVipCoachViewModel *livipCoachViewModel = [[NYLIVipCoachViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{ // RQViewModelIDKey : @(RQVIPPageType_Full), // RQViewModelUtilKey : typeModels, // RQViewCommonValueKey : @(subject), // }]; // [RQ_APPDELEGATE.services pushViewModel:livipCoachViewModel animated:YES]; // }else{ RQVipCenterViewModel *vipCenterViewModel = [[RQVipCenterViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{ RQViewModelUtilKey : [typeModels isKindOfClass:[NSArray class]]? typeModels : @[], RQViewCommonValueKey : @(subject), }]; [RQ_APPDELEGATE.services pushViewModel:vipCenterViewModel animated:YES]; // } } error:^(NSError * _Nullable error) { [MBProgressHUD rq_hideHUD]; [MBProgressHUD rq_showErrorTips:error]; }]; } } //vip处理 - (void)isVipWithSubjectDto:(NSInteger)subject complete:(VoidBlock_Bool)complete { if (RQ_USER_MANAGER.isShouldLogin) { __block BOOL isVerify; [[RQ_HTTP_Service getVideoVipWithUserId:RQ_USER_MANAGER.currentUser._id] subscribeNext:^(RQVideoVipModel *videoVipModel) { //rsa 公钥 NSString *publicKey = [NSString stringWithFormat:@"%@%@%@",@"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCzR04LMmDlwyVRfK+Kgsm/vFMOFyqvGk4QIVC",@"Gj2CKKfhycRExm15N3tKOOouIjl/EU79It45oS+ltJkscvYrJn1zz+1bSoBLelZzJrn7K0NpHF8k", @"bCprsFHd60x+YJ4l8C3SDxfFebo4kqveJzx6JNZKwzFm7LPEO5XB9pEBRwIDAQAB"]; // 构造被签名串 NSMutableString *mutableVerifyString = [[NSMutableString alloc] initWithString:[NSString stringWithFormat:@"%ld",videoVipModel.userId]]; if (RQStringIsNotEmpty(videoVipModel.subject1)) { [mutableVerifyString appendFormat:@"%ld",[RQ_SHARE_FUNCTION getTimeStampWithTimeStr:videoVipModel.subject1 formatter:@"yyyy-MM-dd HH:mm:ss"]]; } if (RQStringIsNotEmpty(videoVipModel.subject2)) { [mutableVerifyString appendFormat:@"%ld",[RQ_SHARE_FUNCTION getTimeStampWithTimeStr:videoVipModel.subject2 formatter:@"yyyy-MM-dd HH:mm:ss"]]; } if (RQStringIsNotEmpty(videoVipModel.subject3)) { [mutableVerifyString appendFormat:@"%ld",[RQ_SHARE_FUNCTION getTimeStampWithTimeStr:videoVipModel.subject3 formatter:@"yyyy-MM-dd HH:mm:ss"]]; } if (RQStringIsNotEmpty(videoVipModel.subject4)) { [mutableVerifyString appendFormat:@"%ld",[RQ_SHARE_FUNCTION getTimeStampWithTimeStr:videoVipModel.subject4 formatter:@"yyyy-MM-dd HH:mm:ss"]]; } [mutableVerifyString appendFormat:@"%ld",videoVipModel.subject1Int]; [mutableVerifyString appendFormat:@"%ld",videoVipModel.subject2Int]; [mutableVerifyString appendFormat:@"%ld",videoVipModel.subject3Int]; [mutableVerifyString appendFormat:@"%ld",videoVipModel.subject4Int]; if (RQStringIsNotEmpty(videoVipModel.spSubject1)) { [mutableVerifyString appendFormat:@"%ld",[RQ_SHARE_FUNCTION getTimeStampWithTimeStr:videoVipModel.spSubject1 formatter:@"yyyy-MM-dd HH:mm:ss"]]; } if (RQStringIsNotEmpty(videoVipModel.spSubject4)) { [mutableVerifyString appendFormat:@"%ld",[RQ_SHARE_FUNCTION getTimeStampWithTimeStr:videoVipModel.spSubject4 formatter:@"yyyy-MM-dd HH:mm:ss"]]; } [mutableVerifyString appendFormat:@"%ld",videoVipModel.spSubject1Int]; [mutableVerifyString appendFormat:@"%ld",videoVipModel.spSubject4Int]; //公钥验签 isVerify = [self verify:mutableVerifyString.copy signature:RQStringIsNotEmpty(videoVipModel.sign)? videoVipModel.sign : @"" withPublivKey:publicKey]; NSLog(@"验签通过了吧------%@", isVerify ? @"YES":@"NO"); if (complete) { BOOL result; RQ_VIP_Module.isSubject1Vip = videoVipModel.subject1Int; RQ_VIP_Module.isSubject2Vip = videoVipModel.subject2Int; RQ_VIP_Module.isSubject3Vip = videoVipModel.subject3Int; RQ_VIP_Module.isSubject4Vip = videoVipModel.subject4Int; RQ_VIP_Module.isSubjectAllVip = RQ_VIP_Module.isSubject1Vip && RQ_VIP_Module.isSubject2Vip && RQ_VIP_Module.isSubject3Vip && RQ_VIP_Module.isSubject4Vip; self.videoVipModel = videoVipModel; RQ_VIP_Module.isSpSubject1Vip = videoVipModel.spSubject1Int; RQ_VIP_Module.isSpSubject4Vip = videoVipModel.spSubject4Int; RQ_VIP_Module.isSpSubjectAllVip = RQ_VIP_Module.isSpSubject1Vip && RQ_VIP_Module.isSpSubject4Vip; NSInteger isAds = 0; if (subject == 1) { isAds ++; result = isVerify? RQ_VIP_Module.isSubject1Vip : NO; } else if (subject == 2) { isAds ++; result = isVerify? RQ_VIP_Module.isSubject2Vip : NO; } else if (subject == 3) { isAds ++; result = isVerify? RQ_VIP_Module.isSubject3Vip : NO; } else if (subject == 4) { isAds ++; result = isVerify? RQ_VIP_Module.isSubject4Vip : NO; } else if (subject == 5) {//1-4全 isAds ++; result = isVerify? RQ_VIP_Module.isSubjectAllVip : NO; } else if (subject == 6) { //科一特 isAds ++; result = isVerify? RQ_VIP_Module.isSpSubject1Vip : NO; } else if (subject == 7) { //科四特 isAds ++; result = isVerify? RQ_VIP_Module.isSpSubject4Vip : NO; } else { result = isVerify? (RQ_VIP_Module.isSubject1Vip || RQ_VIP_Module.isSubject2Vip || RQ_VIP_Module.isSubject3Vip || RQ_VIP_Module.isSubject4Vip ||RQ_VIP_Module.isSpSubject1Vip || RQ_VIP_Module.isSpSubject4Vip) : NO; } RQ_VIP_Module.isADVip = (isAds >=2); RQ_VIP_Module.isVip = result; // complete(result? result : (RQ_COMMON_MANAGER.APP_SWITCH? YES : NO)); complete(result? result :NO); } } error:^(NSError * _Nullable error) { [MBProgressHUD rq_showErrorTips:error]; if (complete) { RQ_VIP_Module.isSubject1Vip = NO; RQ_VIP_Module.isSubject2Vip = NO; RQ_VIP_Module.isSubject3Vip = NO; RQ_VIP_Module.isSubject4Vip = NO; RQ_VIP_Module.isSubject4Vip = NO; RQ_VIP_Module.isSpSubject1Vip = NO; RQ_VIP_Module.isSpSubject4Vip = NO; RQ_VIP_Module.isSubjectAllVip = NO; RQ_VIP_Module.isSpSubjectAllVip = NO; RQ_VIP_Module.isVip = NO; RQ_VIP_Module.isADVip = NO; self.videoVipModel = nil; complete(NO); } }]; } else { if (complete) { RQ_VIP_Module.isSubject1Vip = NO; RQ_VIP_Module.isSubject2Vip = NO; RQ_VIP_Module.isSubject3Vip = NO; RQ_VIP_Module.isSubject4Vip = NO; RQ_VIP_Module.isSpSubject1Vip = NO; RQ_VIP_Module.isSpSubject4Vip = NO; RQ_VIP_Module.isSubjectAllVip = NO; RQ_VIP_Module.isSpSubjectAllVip = NO; RQ_VIP_Module.isVip = NO; RQ_VIP_Module.isADVip = NO; self.videoVipModel = nil; complete(NO); } } } /// 是否Vip - (void)isVipWithSubject:(NSInteger)subject complete:(VoidBlock_Bool)complete { if( RQ_COMMON_MANAGER.APP_SWITCH && !RQ_USER_MANAGER.isLogin ){//审核时提示 - v2.1.1 [RQ_SHARE_FUNCTION showAlertWithTitle:@"提示" message:@"使用计时平台账号登录极速驾培,可享受跨平台使用权益,直接购买只会绑定当前设备" alertControllerStyle:UIAlertControllerStyleAlert cancelButtonTitle:@"取消" otherButtonTitles:@[@"登录账号购买(推荐)",@"游客登录"] otherButtonStyles:nil showInWindow:NO completion:^(NSUInteger selectedOtherButtonIndex) { if (selectedOtherButtonIndex == 0) { //登录账号 if(RQ_USER_MANAGER.isShouldLogin){ NSLog(@"跳转登录"); } }else if (selectedOtherButtonIndex == 1) {//游客登录 NSString *deviceidStr = [SAMKeychain deviceId]; NSArray *components = [deviceidStr componentsSeparatedByString:@"-"]; NSString *logincode = [components lastObject]; [MBProgressHUD rq_showProgressHUD:@""]; [[RQ_HTTP_Service getAppleUserInfo:logincode] subscribeNext:^(RQUserModel *userModel) { [MBProgressHUD rq_hideHUD]; if(userModel){ userModel.nickName = userModel.userName; /// 存储用户数据nickName [RQ_USER_MANAGER loginUser:userModel]; if (userModel.channel == RQUserLoginChannelTypePhone) { /// 切换更控制器 dispatch_async(dispatch_get_main_queue(), ^{ /// 发通知 [[NSNotificationCenter defaultCenter] postNotificationName:RQSwitchRootViewControllerNotification object:nil userInfo:@{RQSwitchRootViewControllerUserInfoKey:@(RQSwitchRootViewControllerFromTypeLogin)}]; }); } [MBProgressHUD rq_showTips:@"登录成功"]; } } error:^(NSError * _Nullable error) { [MBProgressHUD rq_hideHUD]; [MBProgressHUD rq_showTips:error.description]; } completed:^{ }]; } NSLog(@"index=%zd",selectedOtherButtonIndex); }]; } else { [self isVipWithSubjectDto:subject complete:complete]; } } - (void)isActiveWithCcomplete:(RQGetActivationModelBlock)complete { if (RQ_USER_MANAGER.isShouldLogin) { if([RQ_USER_MANAGER.currentUser.userName containsString:@"游客"]){//游客特殊处理 if (complete) { self.activationModel = [[RQActivationModel alloc] init]; self.activationModel.isActive = 1; self.activationModel.isShare = 0; self.activationModel.userId = RQ_USER_MANAGER.currentUser._id.intValue; if (!RQObjectIsNil(self.activationModel)) { if ([self.activationModel isKindOfClass:[RQActivationModel class]]) { complete(self.activationModel, YES); } else { [MBProgressHUD rq_showTips:@"获取激活信息失败"]; complete(self.activationModel, NO); } } else { [MBProgressHUD rq_showTips:@"获取激活信息失败"]; complete(self.activationModel, NO); } } return; } [[RQ_HTTP_Service getActivationWithUserId:RQ_USER_MANAGER.currentUser._id] subscribeNext:^(RQActivationModel *activationModel) { if (complete) { self.activationModel = activationModel; if (!RQObjectIsNil(self.activationModel)) { if ([self.activationModel isKindOfClass:[RQActivationModel class]]) { complete(self.activationModel, YES); } else { [MBProgressHUD rq_showTips:@"获取激活信息失败"]; complete(self.activationModel, NO); } } else { [MBProgressHUD rq_showTips:@"获取激活信息失败"]; complete(self.activationModel, NO); } } } error:^(NSError * _Nullable error) { [MBProgressHUD rq_showErrorTips:error]; if (complete) { self.activationModel = nil; complete(self.activationModel, NO); } }]; } else { if (complete) { self.activationModel = nil; complete(self.activationModel, NO); } } } #pragma mark - PrivateMethods // verify Signature - (BOOL)verify:(NSString *)content signature:(NSString *)signature withPublivKey:(NSString *)publicKey { SecKeyRef publicKeyRef = [self addPublicKey:publicKey]; if (!publicKeyRef) { NSLog(@"添加公钥失败"); return NO; } NSData *originData = [self sha256:content]; NSData *signatureData = [[NSData alloc] initWithBase64EncodedString:signature options:NSDataBase64DecodingIgnoreUnknownCharacters]; if (!originData || !signatureData) { return NO; } OSStatus status = SecKeyRawVerify(publicKeyRef, kSecPaddingPKCS1SHA256, [originData bytes], originData.length, [signatureData bytes], signatureData.length); if (status ==noErr) { return YES; } else{ NSLog(@"验签失败:%d",status); return NO; } } // digest message with sha1 - (NSData *)sha256:(NSString *)str { const void *data = [str cStringUsingEncoding:NSUTF8StringEncoding]; CC_LONG len = (CC_LONG)strlen(data); uint8_t * md = malloc( CC_SHA256_DIGEST_LENGTH * sizeof(uint8_t) );; CC_SHA256(data, len, md); return [NSData dataWithBytes:md length:CC_SHA256_DIGEST_LENGTH]; } - (SecKeyRef)addPublicKey:(NSString *)pubKey { NSData *data = [[NSData alloc] initWithBase64EncodedString:pubKey options:NSDataBase64DecodingIgnoreUnknownCharacters]; //a tag to read/write keychain storage NSString *tag = @"RSA_PUBLIC_KEY"; NSData *d_tag = [NSData dataWithBytes:[tag UTF8String] length:[tag length]]; // Delete any old lingering key with the same tag NSMutableDictionary *publicKey = [[NSMutableDictionary alloc] init]; [publicKey setObject:(__bridge id) kSecClassKey forKey:(__bridge id)kSecClass]; [publicKey setObject:(__bridge id) kSecAttrKeyTypeRSA forKey:(__bridge id)kSecAttrKeyType]; [publicKey setObject:d_tag forKey:(__bridge id)kSecAttrApplicationTag]; SecItemDelete((__bridge CFDictionaryRef)publicKey); // Add persistent version of the key to system keychain [publicKey setObject:data forKey:(__bridge id)kSecValueData]; [publicKey setObject:(__bridge id) kSecAttrKeyClassPublic forKey:(__bridge id)kSecAttrKeyClass]; [publicKey setObject:[NSNumber numberWithBool:YES] forKey:(__bridge id)kSecReturnPersistentRef]; CFTypeRef persistKey = nil; OSStatus status = SecItemAdd((__bridge CFDictionaryRef)publicKey, &persistKey); if (persistKey != nil){ CFRelease(persistKey); } if ((status != noErr) && (status != errSecDuplicateItem)) { return nil; } [publicKey removeObjectForKey:(__bridge id)kSecValueData]; [publicKey removeObjectForKey:(__bridge id)kSecReturnPersistentRef]; [publicKey setObject:[NSNumber numberWithBool:YES] forKey:(__bridge id)kSecReturnRef]; [publicKey setObject:(__bridge id) kSecAttrKeyTypeRSA forKey:(__bridge id)kSecAttrKeyType]; // Now fetch the SecKeyRef version of the key SecKeyRef keyRef = nil; status = SecItemCopyMatching((__bridge CFDictionaryRef)publicKey, (CFTypeRef *)&keyRef); if(status != noErr){ return nil; } return keyRef; } - (BOOL)isVip { id object = [RQ_SHARE_FUNCTION getObjectWithKey:@"isVip"]; if (RQObjectIsNil(object)) { return NO; } else { BOOL isVip = [object boolValue]; return isVip; } } - (void)setIsVip:(BOOL)isVip { [RQ_SHARE_FUNCTION saveObjectWithObject:[NSNumber numberWithBool:isVip] ForKey:@"isVip"]; } - (BOOL)isADVip { id object = [RQ_SHARE_FUNCTION getObjectWithKey:@"isADVip"]; if (RQObjectIsNil(object)) { return NO; } else { BOOL isADVip = [object boolValue]; return isADVip; } } - (void)setIsADVip:(BOOL)isADVip { [RQ_SHARE_FUNCTION saveObjectWithObject:[NSNumber numberWithBool:isADVip] ForKey:@"isADVip"]; } - (BOOL)isSubject1Vip { id object = [RQ_SHARE_FUNCTION getObjectWithKey:@"isSubject1Vip"]; if (RQObjectIsNil(object)) { return NO; } else { BOOL isSubject1Vip = [object boolValue]; return isSubject1Vip; } } - (void)setIsSubject1Vip:(BOOL)isSubject1Vip { [RQ_SHARE_FUNCTION saveObjectWithObject:[NSNumber numberWithBool:isSubject1Vip] ForKey:@"isSubject1Vip"]; } - (BOOL)isSubject2Vip { id object = [RQ_SHARE_FUNCTION getObjectWithKey:@"isSubject2Vip"]; if (RQObjectIsNil(object)) { return NO; } else { BOOL isSubject2Vip = [object boolValue]; return isSubject2Vip; } } - (void)setIsSubject2Vip:(BOOL)isSubject2Vip { [RQ_SHARE_FUNCTION saveObjectWithObject:[NSNumber numberWithBool:isSubject2Vip] ForKey:@"isSubject2Vip"]; } - (BOOL)isSubject3Vip { id object = [RQ_SHARE_FUNCTION getObjectWithKey:@"isSubject3Vip"]; if (RQObjectIsNil(object)) { return NO; } else { BOOL isSubject3Vip = [object boolValue]; return isSubject3Vip; } } - (void)setIsSubject3Vip:(BOOL)isSubject3Vip { [RQ_SHARE_FUNCTION saveObjectWithObject:[NSNumber numberWithBool:isSubject3Vip] ForKey:@"isSubject3Vip"]; } - (BOOL)isSubject4Vip { id object = [RQ_SHARE_FUNCTION getObjectWithKey:@"isSubject4Vip"]; if (RQObjectIsNil(object)) { return NO; } else { BOOL isSubject4Vip = [object boolValue]; return isSubject4Vip; } } - (void)setIsSubject4Vip:(BOOL)isSubject4Vip { [RQ_SHARE_FUNCTION saveObjectWithObject:[NSNumber numberWithBool:isSubject4Vip] ForKey:@"isSubject4Vip"]; } - (BOOL)isSpSubject1Vip { id object = [RQ_SHARE_FUNCTION getObjectWithKey:@"isSpSubject1Vip"]; if (RQObjectIsNil(object)) { return NO; } else { BOOL isSpSubject1Vip = [object boolValue]; return isSpSubject1Vip; } } - (void)setIsSpSubject1Vip:(BOOL)isSpSubject1Vip { [RQ_SHARE_FUNCTION saveObjectWithObject:[NSNumber numberWithBool:isSpSubject1Vip] ForKey:@"isSpSubject1Vip"]; } - (BOOL)isSpSubject4Vip { id object = [RQ_SHARE_FUNCTION getObjectWithKey:@"isSpSubject4Vip"]; if (RQObjectIsNil(object)) { return NO; } else { BOOL isSpSubject4Vip = [object boolValue]; return isSpSubject4Vip; } } - (void)setIsSpSubject4Vip:(BOOL)isSpSubject4Vip { [RQ_SHARE_FUNCTION saveObjectWithObject:[NSNumber numberWithBool:isSpSubject4Vip] ForKey:@"isSpSubject4Vip"]; } - (BOOL)isSubjectAllVip { id object = [RQ_SHARE_FUNCTION getObjectWithKey:@"isSubjectAllVip"]; if (RQObjectIsNil(object)) { return NO; } else { BOOL isSubjectAllVip = [object boolValue]; return isSubjectAllVip; } } - (void)setIsSubjectAllVip:(BOOL)isSubjectAllVip { [RQ_SHARE_FUNCTION saveObjectWithObject:[NSNumber numberWithBool:isSubjectAllVip] ForKey:@"isSubjectAllVip"]; } - (BOOL)isSpSubjectAllVip { id object = [RQ_SHARE_FUNCTION getObjectWithKey:@"isSpSubjectAllVip"]; if (RQObjectIsNil(object)) { return NO; } else { BOOL isSubjectAllVip = [object boolValue]; return isSubjectAllVip; } } - (void)setIsSpSubjectAllVip:(BOOL)isSubjectAllVip { [RQ_SHARE_FUNCTION saveObjectWithObject:[NSNumber numberWithBool:isSubjectAllVip] ForKey:@"isSpSubjectAllVip"]; } - (NSUInteger)freeLookSimExamNum { id object = [RQ_COMMON_MANAGER getObjectWithKey:@"freeLookSimExamNum"]; if (RQObjectIsNil(object)) { return NO; } else { NSInteger freeLookSimExamNum = [object integerValue]; return freeLookSimExamNum; } } - (void)setFreeLookSimExamNum:(NSUInteger)freeLookSimExamNum { [RQ_COMMON_MANAGER saveObjectWithObject:[NSNumber numberWithInteger:freeLookSimExamNum] ForKey:@"freeLookSimExamNum"]; } @end