Commit 90ae6bf065746844e52ddf138cc02f2642d32b89
Merge branch 'master' of bj.gitlab.cnlive.com:ios-team/LiveVideoCloud
Showing
10 changed files
with
21 additions
and
866 deletions
LiveVideoCloud.xcodeproj/project.pbxproj
| ... | ... | @@ -42,7 +42,6 @@ |
| 42 | 42 | 4B45CEAB1EB86BFA0079AFB7 /* NSString+ZXExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CEAA1EB86BFA0079AFB7 /* NSString+ZXExtension.m */; }; |
| 43 | 43 | 4B45CEAE1EB873630079AFB7 /* UserInformationModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CEAD1EB873630079AFB7 /* UserInformationModel.m */; }; |
| 44 | 44 | 4BD855CD1EBAC4B70082061D /* CNLiveKeychainWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855CC1EBAC4B70082061D /* CNLiveKeychainWrapper.m */; }; |
| 45 | - 4BD855D11EBAC7220082061D /* DESUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855D01EBAC7220082061D /* DESUtility.m */; }; | |
| 46 | 45 | 4BD855FA1EBACD530082061D /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855D61EBACD530082061D /* AFHTTPRequestOperation.m */; }; |
| 47 | 46 | 4BD855FB1EBACD530082061D /* AFHTTPRequestOperationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855D81EBACD530082061D /* AFHTTPRequestOperationManager.m */; }; |
| 48 | 47 | 4BD855FC1EBACD530082061D /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855DA1EBACD530082061D /* AFHTTPSessionManager.m */; }; |
| ... | ... | @@ -370,8 +369,6 @@ |
| 370 | 369 | 4BD855CB1EBAC4B70082061D /* CNLiveKeychainWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveKeychainWrapper.h; sourceTree = "<group>"; }; |
| 371 | 370 | 4BD855CC1EBAC4B70082061D /* CNLiveKeychainWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveKeychainWrapper.m; sourceTree = "<group>"; }; |
| 372 | 371 | 4BD855CE1EBAC57A0082061D /* Common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Common.h; sourceTree = "<group>"; }; |
| 373 | - 4BD855CF1EBAC7220082061D /* DESUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DESUtility.h; sourceTree = "<group>"; }; | |
| 374 | - 4BD855D01EBAC7220082061D /* DESUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DESUtility.m; sourceTree = "<group>"; }; | |
| 375 | 372 | 4BD855D51EBACD530082061D /* AFHTTPRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFHTTPRequestOperation.h; sourceTree = "<group>"; }; |
| 376 | 373 | 4BD855D61EBACD530082061D /* AFHTTPRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFHTTPRequestOperation.m; sourceTree = "<group>"; }; |
| 377 | 374 | 4BD855D71EBACD530082061D /* AFHTTPRequestOperationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFHTTPRequestOperationManager.h; sourceTree = "<group>"; }; |
| ... | ... | @@ -1605,8 +1602,6 @@ |
| 1605 | 1602 | 4BD856171EBAD35C0082061D /* NSDictionary+Safety.m */, |
| 1606 | 1603 | 4BD856131EBAD31A0082061D /* NSString+UrlEncode.h */, |
| 1607 | 1604 | 4BD856141EBAD31A0082061D /* NSString+UrlEncode.m */, |
| 1608 | - 4BD855CF1EBAC7220082061D /* DESUtility.h */, | |
| 1609 | - 4BD855D01EBAC7220082061D /* DESUtility.m */, | |
| 1610 | 1605 | 4BD855CB1EBAC4B70082061D /* CNLiveKeychainWrapper.h */, |
| 1611 | 1606 | 4BD855CC1EBAC4B70082061D /* CNLiveKeychainWrapper.m */, |
| 1612 | 1607 | 4B45CEA91EB86BFA0079AFB7 /* NSString+ZXExtension.h */, |
| ... | ... | @@ -2397,7 +2392,6 @@ |
| 2397 | 2392 | D2CBC13B1ECC157A00E00279 /* LVCVerifyLiveAuthService.m in Sources */, |
| 2398 | 2393 | D2029D041E6EAE2E0027CD92 /* UILabel+ContentSize.m in Sources */, |
| 2399 | 2394 | 4B45CE7C1EB86A590079AFB7 /* MineSettingViewController.m in Sources */, |
| 2400 | - 4BD855D11EBAC7220082061D /* DESUtility.m in Sources */, | |
| 2401 | 2395 | D25530031E79115100DF38A5 /* AnimQueueManager.m in Sources */, |
| 2402 | 2396 | D2029B861E6EAAA50027CD92 /* main.m in Sources */, |
| 2403 | 2397 | 4B45CEA71EB86B9F0079AFB7 /* NSObject+UserModel.m in Sources */, | ... | ... |
LiveVideoCloud/Classes/Sections/Mine/Controllers/MineLiveController.m
| ... | ... | @@ -55,7 +55,6 @@ |
| 55 | 55 | pageNo += 1; |
| 56 | 56 | |
| 57 | 57 | NSDictionary *param = @{@"pageNo": [NSString stringWithFormat:@"%d", pageNo], @"pageSize": @"20"}; |
| 58 | - weakself | |
| 59 | 58 | [UserTools getPlayRecord:param success:^(AFHTTPRequestOperation * _Nonnull operation, id _Nonnull responseObject) { |
| 60 | 59 | [SVProgressHUD dismiss]; |
| 61 | 60 | [self.table.header endRefreshing]; | ... | ... |
LiveVideoCloud/Classes/Sections/Mine/Login/Controller/LoginViewController.m
| ... | ... | @@ -88,21 +88,14 @@ |
| 88 | 88 | if ([[result allKeys] containsObject:@"errorCode"] && [result[@"errorCode"] isEqualToString:@"0"]) { |
| 89 | 89 | |
| 90 | 90 | [UserTools saveUserinfoDic:result[@"data"]]; |
| 91 | + [SVProgressHUD dismiss]; | |
| 92 | + | |
| 93 | + if(self.isModalButton) { | |
| 94 | + [self dismissViewControllerAnimated:YES completion:NULL]; | |
| 95 | + } else { | |
| 96 | + [self.navigationController popViewControllerAnimated:YES]; | |
| 97 | + } | |
| 91 | 98 | |
| 92 | - [UserTools getChinaCoinCount:^(BOOL success, NSError * _Nullable error, NSString * _Nullable count) { | |
| 93 | - if (!success) { | |
| 94 | - [SVProgressHUD dismiss]; | |
| 95 | - [Tools showHUDInView:self.view withString:error.description autoHide:YES]; | |
| 96 | - return; | |
| 97 | - } | |
| 98 | - [SVProgressHUD dismiss]; | |
| 99 | - [UserTools setLocalUserInfo:chinaCoin withKey:count]; | |
| 100 | - if(self.isModalButton) { | |
| 101 | - [self dismissViewControllerAnimated:YES completion:NULL]; | |
| 102 | - } else { | |
| 103 | - [self.navigationController popViewControllerAnimated:YES]; | |
| 104 | - } | |
| 105 | - }]; | |
| 106 | 99 | |
| 107 | 100 | } else { |
| 108 | 101 | [SVProgressHUD dismiss]; | ... | ... |
LiveVideoCloud/PrefixHeader.pch
| ... | ... | @@ -29,8 +29,8 @@ |
| 29 | 29 | #import <CNLivePlayerSDK/CNLiveWebcastManager.h> |
| 30 | 30 | #import <CNLiveMsgTools/CNLiveMsgManager.h> |
| 31 | 31 | #import <CNLiveChatManager/CNLiveChatManager.h> |
| 32 | +#import <CNLiveUserSystemSDK/CNLiveUserSystemCenter.h> | |
| 32 | 33 | #import "LVCCommentModel.h" |
| 33 | - #import <CNLiveUserSystemSDK/CNLiveUserSystemCenter.h> | |
| 34 | 34 | |
| 35 | 35 | #import "Common.h" |
| 36 | 36 | #import "MJExtension.h" |
| ... | ... | @@ -44,7 +44,6 @@ |
| 44 | 44 | #import "UIImage+ScaleImageSize.h" |
| 45 | 45 | #import "UIView+ViewController.h" |
| 46 | 46 | #import "SevenSwitch.h" |
| 47 | - #import "DESUtility.h" | |
| 48 | 47 | #import "UserInformationModel.h" |
| 49 | 48 | #import "NSString+UrlEncode.h" |
| 50 | 49 | #import "NSDictionary+Safety.h" |
| ... | ... | @@ -83,15 +82,6 @@ |
| 83 | 82 | #define JBAppId @"hdtv" |
| 84 | 83 | #define JBAppVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] ///debug用 "CFBundleVersion" |
| 85 | 84 | |
| 86 | -//#define UserAppId @"60_itax25eq82" | |
| 87 | -//#define UserAppKey @"55a25a7f7e1124937fba06c82999d9a7c18379e2d24784" | |
| 88 | -//#define UserAppSceret @"29798eea30388f71d4a33b75d308c3cbb47077d56ce680" | |
| 89 | - | |
| 90 | - | |
| 91 | -//com.cnlive.shixunyun | |
| 92 | -//#define UserAppId @"60_j0uqrv0u11" | |
| 93 | -//#define UserAppKey @"876c5efece0fc9c98c51ff2180ee1bcfa5c5b5af202c78" | |
| 94 | -//#define UserAppSceret @"ee844ea67b6be7303b6f5d9365af10ac09933c0828aba7" | |
| 95 | 85 | |
| 96 | 86 | #define PlaceholderImage @"placehodler" |
| 97 | 87 | #define appDelegate ((AppDelegate *)[UIApplication sharedApplication].delegate) | ... | ... |
LiveVideoCloud/UtilKits/CNLiveWebView.m
| ... | ... | @@ -207,30 +207,7 @@ |
| 207 | 207 | } |
| 208 | 208 | return [keyValueDic copy]; |
| 209 | 209 | } |
| 210 | -/* | |
| 211 | -- (NSString *)encryptTokenWithUrlStr:(NSString *)urlStr sid:(NSString *)sid | |
| 212 | -{ | |
| 213 | - NSURL *callbackUrl = [NSURL URLWithString:urlStr]; | |
| 214 | -// NSMutableString *token = [[NSMutableString alloc] initWithString:[NSString stringWithFormat:@"plat=i&appid=%@&uuid=%@&sid=%@",AppId,[Tools uidForStat],sid]]; | |
| 215 | - if (callbackUrl.query) { | |
| 216 | -// [token appendFormat:@"&%@",callbackUrl.query]; | |
| 217 | - } | |
| 218 | - NSString *encryptToken = [[EncryptAndDecrypt base64StringFromText:token encryptKey:HuDongDianShiKey] urlEncode]; | |
| 219 | - | |
| 220 | - NSMutableString *newCallbackStr = [[NSMutableString alloc] initWithCapacity:0]; | |
| 221 | - NSString *queryStr = [NSString stringWithFormat:@"spId=%@&token=%@",SpId,encryptToken]; | |
| 222 | - if ([urlStr containsString:@"?"]) { | |
| 223 | -// NSArray *urlArray = [urlStr componentsSeparatedByString:@"?"]; | |
| 224 | -// [newCallbackStr appendFormat:@"%@?%@",[urlArray safetyObjectAtIndex:0],queryStr]; | |
| 225 | - [newCallbackStr appendFormat:@"%@&%@", urlStr, queryStr]; | |
| 226 | - } | |
| 227 | - else { | |
| 228 | -// [newCallbackStr appendFormat:@"%@?%@",urlStr,queryStr]; | |
| 229 | - [newCallbackStr appendFormat:@"%@?%@", urlStr, queryStr]; | |
| 230 | - } | |
| 231 | - return [newCallbackStr copy]; | |
| 232 | -} | |
| 233 | -*/ | |
| 210 | + | |
| 234 | 211 | #pragma mark <LoginViewControllerDelegate> |
| 235 | 212 | - (void)isLogin |
| 236 | 213 | { | ... | ... |
LiveVideoCloud/UtilKits/Category/DESUtility.h deleted
100755 → 0
| 1 | -// | |
| 2 | -// DESUtility.h | |
| 3 | -// DES | |
| 4 | -// | |
| 5 | -// Created by Deli on 14-10-15. | |
| 6 | -// Copyright (c) 2014年 ___Deli___. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import <Foundation/Foundation.h> | |
| 10 | - | |
| 11 | -@interface DESUtility : NSObject | |
| 12 | - | |
| 13 | -/************************************************************ | |
| 14 | - 函数名称 : + (NSString *)base64StringFromText:(NSString *)text | |
| 15 | - 函数描述 : 将文本转换为base64格式字符串 | |
| 16 | - 输入参数 : (NSString *)text 文本 | |
| 17 | - 输出参数 : N/A | |
| 18 | - 返回参数 : (NSString *) base64格式字符串 | |
| 19 | - 备注信息 : | |
| 20 | - **********************************************************/ | |
| 21 | - | |
| 22 | -+ (NSString *)base64StringFromPayText:(NSString *)text; | |
| 23 | - | |
| 24 | -/************************************************************ | |
| 25 | - 函数名称 : + (NSString *)textFromBase64String:(NSString *)base64 | |
| 26 | - 函数描述 : 将base64格式字符串转换为文本 | |
| 27 | - 输入参数 : (NSString *)base64 base64格式字符串 | |
| 28 | - 输出参数 : N/A | |
| 29 | - 返回参数 : (NSString *) 文本 | |
| 30 | - 备注信息 : | |
| 31 | - **********************************************************/ | |
| 32 | -+ (NSString *)textFromBase64String:(NSString *)base64; | |
| 33 | - | |
| 34 | -+ (NSString *)base64StringFromText:(NSString *)text; | |
| 35 | - | |
| 36 | - | |
| 37 | -@end |
LiveVideoCloud/UtilKits/Category/DESUtility.m deleted
100755 → 0
| 1 | -// | |
| 2 | -// DESUtility.m | |
| 3 | -// DES | |
| 4 | -// | |
| 5 | -// Created by Deli on 14-10-15. | |
| 6 | -// Copyright (c) 2014年 ___Deli___. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import "DESUtility.h" | |
| 10 | -#import <CommonCrypto/CommonCrypto.h> | |
| 11 | - | |
| 12 | -//空字符串 | |
| 13 | -#define LocalStr_None @"" | |
| 14 | - | |
| 15 | -static const char encodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | |
| 16 | - | |
| 17 | -@implementation DESUtility | |
| 18 | - | |
| 19 | - | |
| 20 | -+ (NSString *)base64StringFromPayText:(NSString *)text | |
| 21 | -{ | |
| 22 | - if (text && ![text isEqualToString:LocalStr_None]) { | |
| 23 | - | |
| 24 | - NSString *key = SxyAppKey; | |
| 25 | - NSData *data = [text dataUsingEncoding:NSUTF8StringEncoding]; | |
| 26 | - //IOS 自带DES加密 Begin | |
| 27 | - data = [self DESEncrypt:data WithKey:key]; | |
| 28 | - //IOS 自带DES加密 End | |
| 29 | - return [self base64EncodedStringFrom:data]; | |
| 30 | - } | |
| 31 | - else { | |
| 32 | - return LocalStr_None; | |
| 33 | - } | |
| 34 | -} | |
| 35 | - | |
| 36 | -+ (NSString *)textFromBase64String:(NSString *)base64 | |
| 37 | -{ | |
| 38 | - if (base64 && ![base64 isEqualToString:LocalStr_None]) { | |
| 39 | - | |
| 40 | - NSString *key = @"wang!@#$%"; | |
| 41 | - NSData *data = [self dataWithBase64EncodedString:base64]; | |
| 42 | - //IOS 自带DES解密 Begin | |
| 43 | - data = [self DESDecrypt:data WithKey:key]; | |
| 44 | - //IOS 自带DES加密 End | |
| 45 | - return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; | |
| 46 | - } | |
| 47 | - else { | |
| 48 | - return LocalStr_None; | |
| 49 | - } | |
| 50 | -} | |
| 51 | - | |
| 52 | -+ (NSString *)base64StringFromText:(NSString *)text | |
| 53 | -{ | |
| 54 | - if (text && ![text isEqualToString:LocalStr_None]) { | |
| 55 | - | |
| 56 | - NSString *key = @"wang!@#$%"; | |
| 57 | - NSData *data = [text dataUsingEncoding:NSUTF8StringEncoding]; | |
| 58 | - //IOS 自带DES加密 Begin | |
| 59 | - data = [self DESEncrypt:data WithKey:key]; | |
| 60 | - //IOS 自带DES加密 End | |
| 61 | - return [self base64EncodedStringFrom:data]; | |
| 62 | - } | |
| 63 | - else { | |
| 64 | - return LocalStr_None; | |
| 65 | - } | |
| 66 | -} | |
| 67 | - | |
| 68 | - | |
| 69 | -/************************************************************ | |
| 70 | - 函数名称 : + (NSData *)DESEncrypt:(NSData *)data WithKey:(NSString *)key | |
| 71 | - 函数描述 : 文本数据进行DES加密 | |
| 72 | - 输入参数 : (NSData *)data | |
| 73 | - (NSString *)key | |
| 74 | - 输出参数 : N/A | |
| 75 | - 返回参数 : (NSData *) | |
| 76 | - 备注信息 : 此函数不可用于过长文本 | |
| 77 | - **********************************************************/ | |
| 78 | -+ (NSData *)DESEncrypt:(NSData *)data WithKey:(NSString *)key | |
| 79 | -{ | |
| 80 | - char keyPtr[kCCKeySizeAES256*2]; | |
| 81 | - bzero(keyPtr, sizeof(keyPtr)); | |
| 82 | - | |
| 83 | - [key getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding]; | |
| 84 | - | |
| 85 | - NSUInteger dataLength = [data length]; | |
| 86 | - | |
| 87 | - size_t bufferSize = dataLength + kCCBlockSizeAES128; | |
| 88 | - void *buffer = malloc(bufferSize); | |
| 89 | - | |
| 90 | - size_t numBytesEncrypted = 0; | |
| 91 | - CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt, kCCAlgorithmDES, | |
| 92 | - kCCOptionPKCS7Padding | kCCOptionECBMode, | |
| 93 | - keyPtr, kCCBlockSizeDES, | |
| 94 | - NULL, | |
| 95 | - [data bytes], dataLength, | |
| 96 | - buffer, bufferSize, | |
| 97 | - &numBytesEncrypted); | |
| 98 | - if (cryptStatus == kCCSuccess) { | |
| 99 | - return [NSData dataWithBytesNoCopy:buffer length:numBytesEncrypted]; | |
| 100 | - } | |
| 101 | - | |
| 102 | - free(buffer); | |
| 103 | - return nil; | |
| 104 | -} | |
| 105 | - | |
| 106 | -/************************************************************ | |
| 107 | - 函数名称 : + (NSData *)DESEncrypt:(NSData *)data WithKey:(NSString *)key | |
| 108 | - 函数描述 : 文本数据进行DES解密 | |
| 109 | - 输入参数 : (NSData *)data | |
| 110 | - (NSString *)key | |
| 111 | - 输出参数 : N/A | |
| 112 | - 返回参数 : (NSData *) | |
| 113 | - 备注信息 : 此函数不可用于过长文本 | |
| 114 | - **********************************************************/ | |
| 115 | -+ (NSData *)DESDecrypt:(NSData *)data WithKey:(NSString *)key | |
| 116 | -{ | |
| 117 | - char keyPtr[kCCKeySizeAES256+1]; | |
| 118 | - bzero(keyPtr, sizeof(keyPtr)); | |
| 119 | - | |
| 120 | - [key getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding]; | |
| 121 | - | |
| 122 | - NSUInteger dataLength = [data length]; | |
| 123 | - | |
| 124 | - size_t bufferSize = dataLength + kCCBlockSizeAES128; | |
| 125 | - void *buffer = malloc(bufferSize); | |
| 126 | - | |
| 127 | - size_t numBytesDecrypted = 0; | |
| 128 | - CCCryptorStatus cryptStatus = CCCrypt(kCCDecrypt, kCCAlgorithmDES, | |
| 129 | - kCCOptionPKCS7Padding | kCCOptionECBMode, | |
| 130 | - keyPtr, kCCBlockSizeDES, | |
| 131 | - NULL, | |
| 132 | - [data bytes], dataLength, | |
| 133 | - buffer, bufferSize, | |
| 134 | - &numBytesDecrypted); | |
| 135 | - | |
| 136 | - if (cryptStatus == kCCSuccess) { | |
| 137 | - return [NSData dataWithBytesNoCopy:buffer length:numBytesDecrypted]; | |
| 138 | - } | |
| 139 | - | |
| 140 | - free(buffer); | |
| 141 | - return nil; | |
| 142 | -} | |
| 143 | - | |
| 144 | -/************************************************************ | |
| 145 | - 函数名称 : + (NSData *)dataWithBase64EncodedString:(NSString *)string | |
| 146 | - 函数描述 : base64格式字符串转换为文本数据 | |
| 147 | - 输入参数 : (NSString *)string | |
| 148 | - 输出参数 : N/A | |
| 149 | - 返回参数 : (NSData *) | |
| 150 | - 备注信息 : | |
| 151 | - **********************************************************/ | |
| 152 | -+ (NSData *)dataWithBase64EncodedString:(NSString *)string | |
| 153 | -{ | |
| 154 | - if (string == nil) | |
| 155 | - [NSException raise:NSInvalidArgumentException format:nil]; | |
| 156 | - if ([string length] == 0) | |
| 157 | - return [NSData data]; | |
| 158 | - | |
| 159 | - static char *decodingTable = NULL; | |
| 160 | - if (decodingTable == NULL) | |
| 161 | - { | |
| 162 | - decodingTable = malloc(256); | |
| 163 | - if (decodingTable == NULL) | |
| 164 | - return nil; | |
| 165 | - memset(decodingTable, CHAR_MAX, 256); | |
| 166 | - NSUInteger i; | |
| 167 | - for (i = 0; i < 64; i++) | |
| 168 | - decodingTable[(short)encodingTable[i]] = i; | |
| 169 | - } | |
| 170 | - | |
| 171 | - const char *characters = [string cStringUsingEncoding:NSASCIIStringEncoding]; | |
| 172 | - if (characters == NULL) // Not an ASCII string! | |
| 173 | - return nil; | |
| 174 | - char *bytes = malloc((([string length] + 3) / 4) * 3); | |
| 175 | - if (bytes == NULL) | |
| 176 | - return nil; | |
| 177 | - NSUInteger length = 0; | |
| 178 | - | |
| 179 | - NSUInteger i = 0; | |
| 180 | - while (YES) | |
| 181 | - { | |
| 182 | - char buffer[4]; | |
| 183 | - short bufferLength; | |
| 184 | - for (bufferLength = 0; bufferLength < 4; i++) | |
| 185 | - { | |
| 186 | - if (characters[i] == '\0') | |
| 187 | - break; | |
| 188 | - if (isspace(characters[i]) || characters[i] == '=') | |
| 189 | - continue; | |
| 190 | - buffer[bufferLength] = decodingTable[(short)characters[i]]; | |
| 191 | - if (buffer[bufferLength++] == CHAR_MAX) // Illegal character! | |
| 192 | - { | |
| 193 | - free(bytes); | |
| 194 | - return nil; | |
| 195 | - } | |
| 196 | - } | |
| 197 | - | |
| 198 | - if (bufferLength == 0) | |
| 199 | - break; | |
| 200 | - if (bufferLength == 1) // At least two characters are needed to produce one byte! | |
| 201 | - { | |
| 202 | - free(bytes); | |
| 203 | - return nil; | |
| 204 | - } | |
| 205 | - | |
| 206 | - // Decode the characters in the buffer to bytes. | |
| 207 | - bytes[length++] = (buffer[0] << 2) | (buffer[1] >> 4); | |
| 208 | - if (bufferLength > 2) | |
| 209 | - bytes[length++] = (buffer[1] << 4) | (buffer[2] >> 2); | |
| 210 | - if (bufferLength > 3) | |
| 211 | - bytes[length++] = (buffer[2] << 6) | buffer[3]; | |
| 212 | - } | |
| 213 | - | |
| 214 | - bytes = realloc(bytes, length); | |
| 215 | - return [NSData dataWithBytesNoCopy:bytes length:length]; | |
| 216 | -} | |
| 217 | - | |
| 218 | -/************************************************************ | |
| 219 | - 函数名称 : + (NSString *)base64EncodedStringFrom:(NSData *)data | |
| 220 | - 函数描述 : 文本数据转换为base64格式字符串 | |
| 221 | - 输入参数 : (NSData *)data | |
| 222 | - 输出参数 : N/A | |
| 223 | - 返回参数 : (NSString *) | |
| 224 | - 备注信息 : | |
| 225 | - **********************************************************/ | |
| 226 | -+ (NSString *)base64EncodedStringFrom:(NSData *)data | |
| 227 | -{ | |
| 228 | - if ([data length] == 0) | |
| 229 | - return @""; | |
| 230 | - | |
| 231 | - char *characters = malloc((([data length] + 2) / 3) * 4); | |
| 232 | - if (characters == NULL) | |
| 233 | - return nil; | |
| 234 | - NSUInteger length = 0; | |
| 235 | - | |
| 236 | - NSUInteger i = 0; | |
| 237 | - while (i < [data length]) | |
| 238 | - { | |
| 239 | - char buffer[3] = {0,0,0}; | |
| 240 | - short bufferLength = 0; | |
| 241 | - while (bufferLength < 3 && i < [data length]) | |
| 242 | - buffer[bufferLength++] = ((char *)[data bytes])[i++]; | |
| 243 | - | |
| 244 | - // Encode the bytes in the buffer to four characters, including padding "=" characters if necessary. | |
| 245 | - characters[length++] = encodingTable[(buffer[0] & 0xFC) >> 2]; | |
| 246 | - characters[length++] = encodingTable[((buffer[0] & 0x03) << 4) | ((buffer[1] & 0xF0) >> 4)]; | |
| 247 | - if (bufferLength > 1) | |
| 248 | - characters[length++] = encodingTable[((buffer[1] & 0x0F) << 2) | ((buffer[2] & 0xC0) >> 6)]; | |
| 249 | - else characters[length++] = '='; | |
| 250 | - if (bufferLength > 2) | |
| 251 | - characters[length++] = encodingTable[buffer[2] & 0x3F]; | |
| 252 | - else characters[length++] = '='; | |
| 253 | - } | |
| 254 | - | |
| 255 | - return [[NSString alloc] initWithBytesNoCopy:characters length:length encoding:NSASCIIStringEncoding freeWhenDone:YES]; | |
| 256 | -} | |
| 257 | - | |
| 258 | - | |
| 259 | -@end |
LiveVideoCloud/UtilKits/Common.h
| 1 | -// | |
| 1 | + // | |
| 2 | 2 | // Common.h |
| 3 | 3 | // CNLive |
| 4 | 4 | // |
| ... | ... | @@ -13,17 +13,11 @@ |
| 13 | 13 | #ifdef DEBUG |
| 14 | 14 | #define D_NSLog(format, ...) NSLog(format, ## __VA_ARGS__); |
| 15 | 15 | #define AppVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] ///debug用 "CFBundleVersion" |
| 16 | - #define kGeXinAppId @"QbA9InqDcX6Bf7kL5bkYC7" | |
| 17 | - #define kGeXinAppKey @"rvylmRHnkU7fPPDE0VA5v1" | |
| 18 | - #define kGeXinAppSecret @"HX4ZHUiVRA7gAhU0VBa202" | |
| 19 | -//https://sandbox.itunes.apple.com/verifyReceipt | |
| 20 | 16 | #define IAP_URL @"https://sandbox.itunes.apple.com/verifyReceipt" |
| 21 | 17 | #else |
| 22 | 18 | #define D_NSLog(format, ...); |
| 23 | 19 | #define AppVersion ([[[NSBundle mainBundle] infoDictionary] objectForKey: @"CFBundleShortVersionString"]) |
| 24 | - #define kGeXinAppId @"eRHpnUvvHO7U7x75Qd1eR9" | |
| 25 | - #define kGeXinAppKey @"vqYuunXZJY97GnnKiJ9v94" | |
| 26 | - #define kGeXinAppSecret @"fKybhWTRai6bkbxGZ9VwD5" | |
| 20 | + | |
| 27 | 21 | #define IAP_URL @"https://buy.itunes.apple.com/verifyReceipt" |
| 28 | 22 | #endif |
| 29 | 23 | |
| ... | ... | @@ -31,435 +25,33 @@ |
| 31 | 25 | #define KScreenHeight ([UIScreen mainScreen].bounds.size.width > [UIScreen mainScreen].bounds.size.height ? [UIScreen mainScreen].bounds.size.width : [UIScreen mainScreen].bounds.size.height) |
| 32 | 26 | #define KVideoHeight (KScreenWidth*9/16) |
| 33 | 27 | |
| 34 | -//#define kTimeoutInterval 10.0 | |
| 35 | - | |
| 36 | -#define kUploading @"uploading" //上传视频的状态 | |
| 37 | -#define kWait @"wait" | |
| 38 | -#define kFailed @"failed" | |
| 39 | - | |
| 40 | -//#define AppId @"spzg" | |
| 41 | -#define SpId @"82_iunnscwp07" | |
| 42 | -#define SpId1 @"003_003" | |
| 43 | - | |
| 44 | -#define APPSTOREID @"385242275" | |
| 45 | - | |
| 46 | 28 | //视讯云 |
| 47 | -#define SxyAppId @"82_iunnscwp07" | |
| 48 | 29 | #define SxyAppKey @"13c6f0ad6f459cd479834b0b39cff99c6cf20c970815bb" |
| 49 | 30 | |
| 50 | -//互动电视 | |
| 51 | -//#define HuDongDianShiKey @"DNGR001L" | |
| 52 | - | |
| 53 | -#define GuideAppVersion @"guideAppVersion" //记录版本号判断是否显示引导页 | |
| 54 | - | |
| 55 | -#define HistoryTime @"HistoryTime" //播放记录时间 | |
| 56 | - | |
| 57 | -#define AdImageInfo @"adImageInfo" //开机广告信息 | |
| 58 | -#define AdImageUrl @"adImageUrl" //开机广告图片地址 | |
| 59 | -#define AdImageData @"adImageData" //开机广告图片data | |
| 60 | - | |
| 61 | - | |
| 62 | -#define iBeaconAppKey @"60b056a30d1f4c98aa158cc91469ad7b" //ibecon的key | |
| 63 | -#define kUUID @"E2C56DB5DFFB48D2B060D0F5A71096E0" | |
| 64 | - | |
| 65 | -// 首页横版cell比例 | |
| 66 | -#define H_Cell_Ratio (196.0/300) | |
| 67 | - | |
| 68 | -// app版本号 debug用 "CFBundleVersion" release用"CFBundleShortVersionString" | |
| 69 | -//#define AppVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] ///debug用 "CFBundleVersion" | |
| 70 | -//#define AppVersion ([[[NSBundle mainBundle] infoDictionary] objectForKey: @"CFBundleShortVersionString"]) //release用"CFBundleShortVersionString" | |
| 71 | - | |
| 72 | -#define NoMoreData @"没有更多数据" | |
| 73 | -//gift | |
| 74 | -#define GiftCellHeight 80.0 | |
| 75 | -#define KreadGiftImgById @"http://pom.cnlive.com/gf/getGiftImg.action" | |
| 76 | -#define Kfacelength 60 | |
| 77 | -#define Ktextlength 120 | |
| 78 | -#define KheadIconUrl @"http://open.cnlive.com/TVPLive/readHDUserAvatarByNick.action?plat=x&dev=i&uid=" | |
| 79 | - | |
| 80 | -#define KLiveReserve @"KLiveReserve" //本地通知 直播订阅播放通知 | |
| 81 | 31 | #define kUserDefaultsUIDKey (@"uid_stat") //用时间戳和uuid在首次启动app是创建的uid |
| 82 | -#define kLotteryURLKey (@"lottery_url") //试试手气url | |
| 83 | -#define OldChannelVersion @"OldChannelVersion" //首页频道列表版本号 | |
| 84 | -#define NewChannelVersion @"NewChannelVersion" | |
| 85 | -#define NormalChannelArray @"NormalChannelArray" //常用频道 | |
| 86 | -#define OtherChannelArray @"OtherChannelArray" //其他频道 | |
| 87 | - | |
| 88 | -/* --------------------------------------- 上传视频 key ----------------------------------------------------*/ | |
| 89 | -#define app_access_key @"7338ebf9cab441c0843e437a18d85549" //应用id | |
| 90 | -#define user_access_key @"cf34f28db21b46678237bfa849e239ea" //用户id | |
| 91 | 32 | |
| 92 | -/* --------------------------------------- 视频清晰度对应json文件的key -----------------------------------------*/ | |
| 93 | -#define Definition1 @"mamVideoLUrl" //流畅 | |
| 94 | -#define Definition2 @"mamVideoUrl" //标清 | |
| 95 | -#define Definition3 @"mamVideoHUrl" //高清 | |
| 96 | -#define Definition4 @"mamVideoUHUrl" //超清 | |
| 97 | 33 | |
| 98 | -/* --------------------------------------- 通知 NotificationName -----------------------------------------*/ | |
| 99 | -// 个推 | |
| 100 | -#warning 正式版 | |
| 101 | -//#define kGeXinAppId @"eRHpnUvvHO7U7x75Qd1eR9" | |
| 102 | -//#define kGeXinAppKey @"vqYuunXZJY97GnnKiJ9v94" | |
| 103 | -//#define kGeXinAppSecret @"fKybhWTRai6bkbxGZ9VwD5" | |
| 104 | - | |
| 105 | -#warning 测试版 | |
| 106 | -//#define kGeXinAppId @"QbA9InqDcX6Bf7kL5bkYC7" | |
| 107 | -//#define kGeXinAppKey @"rvylmRHnkU7fPPDE0VA5v1" | |
| 108 | -//#define kGeXinAppSecret @"HX4ZHUiVRA7gAhU0VBa202" | |
| 109 | - | |
| 110 | -#define GeTuiRegesterUrl @"https://mobile.cnlive.com/CnliveMobile/json/appClientuid.action" | |
| 111 | -#define GeTuiPushKey @"GeTuiPushKey" | |
| 112 | - | |
| 113 | -//点击推荐页的栏目 跳转到对应栏目详细页 | |
| 114 | -#define ChangeHomeChannel @"changeHomeChannel" | |
| 115 | - | |
| 116 | -//首页pagingView News类型的页面从屏幕上消失 news页面上的播放器同时消失 | |
| 117 | -#define NewsPagingViewDisappear @"NewsPagingViewDisappear" | |
| 118 | - | |
| 119 | -//活动竖屏消失时将 主持人互动详情页隐藏 | |
| 120 | -#define LiveVideoPlayerDisapper @"LiveVideoPlayerDisapper" | |
| 121 | - | |
| 122 | -#define JoinInteract @"JoinInteract" | |
| 123 | - | |
| 124 | -//收到通知 先退出当前播放页 然后打开新播放页 | |
| 125 | -#define ReceivePushInfoNotification @"ReceivePushInfoNotification" | |
| 126 | - | |
| 127 | -#define BuySuccessNotify @"BuySuccessNotify" | |
| 128 | -#define HidHud @"HidHud" | |
| 129 | -#define KUNIQIDURL @"http://ips.cnlive.com/IPS/getUniqId.action" | |
| 130 | -#define KUNIQID @"KUNIQID" | |
| 131 | - | |
| 132 | -//用户红包支付信息 | |
| 133 | -#define UserPaymentInformation @"UserPaymentInformation" | |
| 134 | -#define TemporaryUserPaymentInformation @"TemporaryUserPaymentInformation" | |
| 135 | - | |
| 136 | -//红包支付通知 | |
| 137 | -#define PayNotification @"PayNotification" | |
| 138 | -#define PaySuccess @"PaySucess" | |
| 139 | -#define PayFailure @"PayFailure" | |
| 140 | -#define UserCancel @"UserCancel" | |
| 141 | - | |
| 142 | ||
| 143 | -#define WeChatAppKey @"wxeeb61dff43ecc2fe" | |
| 34 | ||
| 35 | +//#define WeChatAppKey @"wxeeb61dff43ecc2fe" | |
| 144 | 36 | #define WeChatAppSecret @"29460b53af8ebc4798e85a06c936c80e" |
| 145 | ||
| 146 | -#define QQAppKey @"100757437" | |
| 147 | -#define QQAppSecret @"4d8f9a54a50269ba97d5ba92b95a54d4" | |
| 148 | -//Sina | |
| 149 | -#define SinaAppKey @"1523705845" | |
| 150 | -#define SinaAppSecret @"101788682a6ce4d19e4add30d15211f5" | |
| 151 | -//Alipay | |
| 152 | -#define AlipayScheme @"CNLiveAlipay" | |
| 153 | - | |
| 154 | -//弹幕中国币默认值 | |
| 155 | -#define BarrageChinaCoin @"100" | |
| 37 | ||
| 38 | +//#define QQAppKey @"100757437" | |
| 39 | +//#define QQAppSecret @"4d8f9a54a50269ba97d5ba92b95a54d4" | |
| 40 | +////Sina | |
| 41 | +//#define SinaAppKey @"1523705845" | |
| 42 | +//#define SinaAppSecret @"101788682a6ce4d19e4add30d15211f5" | |
| 156 | 43 | |
| 157 | -/* --------------------------------------- H5打开APP -----------------------------------------*/ | |
| 158 | - | |
| 159 | -#define KUrlOpenApp @"KUrlOpenApp" //通过url打开app | |
| 160 | 44 | |
| 161 | 45 | #ifdef __OBJC__ |
| 162 | - | |
| 163 | -/* --------------------------------------- 接口地址 -----------------------------------------*/ | |
| 164 | -//App配置信息 | |
| 165 | -static NSString *const AppStart = @"http://app.jczb.cnlive.com/api/appstart"; | |
| 166 | - | |
| 167 | -//抽奖信息 | |
| 168 | -static NSString *const Market = @"http://data.cnlive.com/export/hd/market.json"; | |
| 169 | - | |
| 170 | -//首页频道列表 | |
| 171 | -//static NSString *const AllChannellist = @"http://app.jczb.cnlive.com/api/channellist"; | |
| 172 | -static NSString *const AllChannellist = @"http://intertv.cnlive.com/zgw/api/channellist"; | |
| 173 | - | |
| 174 | -//首页信息 | |
| 175 | -//static NSString *const Appindex = @"http://app.jczb.cnlive.com/api/appindex"; | |
| 176 | -static NSString *const Appindex = @"http://intertv.cnlive.com/zgw_sp/api/appindex"; | |
| 177 | - | |
| 178 | -//推荐 | |
| 179 | -static NSString *const Appindexpage = @"http://intertv.cnlive.com/zgw/api/appindexpage"; | |
| 180 | - | |
| 181 | -//直播更多 | |
| 182 | -static NSString *const Catprogramlist = @"http://app.jczb.cnlive.com/api/catprogramlist"; | |
| 183 | - | |
| 184 | -//直播中 | |
| 185 | -static NSString *const LiveingList = @"http://app.jczb.cnlive.com/api/ugcLive"; | |
| 186 | - | |
| 187 | -//直播关注 | |
| 188 | -static NSString *const livingFocus = @"http://app.jczb.cnlive.com/api/ugcCare"; | |
| 189 | - | |
| 190 | -//创建聊天室 | |
| 191 | -static NSString *const createRoom = @"https://api.cnlive.com/open/api2/interacitve_chat/createRoom"; | |
| 192 | - | |
| 193 | -//新闻信息 | |
| 194 | 46 | //static NSString *const Newslist = @"http://app.jczb.cnlive.com/api/newslist"; |
| 195 | 47 | static NSString *const Newslist = @"http://intertv.cnlive.com/zgw_sp/api/newslist"; |
| 196 | 48 | |
| 197 | -//明星底页信息 | |
| 198 | -static NSString *const StarAtTheBottomOfPage = @"http://app.jczb.cnlive.com/api/star?"; | |
| 199 | - | |
| 200 | -//互动插件列表 | |
| 201 | -static NSString *const GetLivePlugins = @"https://mobile.cnlive.com/CnliveMobile/hd/getLivePlugins.action"; | |
| 202 | - | |
| 203 | -//活动状态 | |
| 204 | -static NSString *const Albumdetail = @"http://app.jczb.cnlive.com/api/albumdetail"; | |
| 205 | - | |
| 206 | -//主播详情 | |
| 207 | -static NSString *const zhuboDetail = @"http://app.jczb.cnlive.com/api/zhuboDetail"; | |
| 208 | - | |
| 209 | -//视频前贴片广告 和 切西瓜广告 | |
| 210 | -static NSString *const AdInfoDetail = @"http://data.cnlive.com/export/ad/ads_new.json"; | |
| 211 | - | |
| 212 | -//直播底页 | |
| 213 | -static NSString *const Metainfo = @"http://data.cnlive.com/epg/live/*/metainfo.json"; | |
| 214 | - | |
| 215 | -//播放底页信息 | |
| 216 | -static NSString *const PlayingAtTheBottomOfPage = @"http://data.cnlive.com/epg/"; | |
| 217 | - | |
| 218 | -//电视剧集 | |
| 219 | -static NSString *const Series = @"http://data.cnlive.com/epg/"; | |
| 220 | - | |
| 221 | -//本期看点 | |
| 222 | -static NSString *const BqFocus = @"http://app.jczb.cnlive.com/api/bqfocus?"; | |
| 223 | - | |
| 224 | -//往期回顾 | |
| 225 | -static NSString *const BackPlay = @"http://app.jczb.cnlive.com/api/backplay?"; | |
| 226 | - | |
| 227 | -//相关推荐 | |
| 228 | -static NSString *const Xiangguan = @"http://so.cnlive.com/so/programrelative?"; | |
| 229 | - | |
| 230 | -//搜索热词 | |
| 231 | -static NSString *const Readkeywords = @"http://app.jczb.cnlive.com/api/readkeywords"; | |
| 232 | - | |
| 233 | -//搜索频道列表 | |
| 234 | -static NSString *const Getchannels = @"http://so.cnlive.com/so/getchannels"; | |
| 235 | - | |
| 236 | -//搜索详细列表 | |
| 237 | -static NSString *const Programlist = @"http://so.cnlive.com/so/programlist"; | |
| 238 | - | |
| 239 | -//分类 | |
| 240 | -static NSString *const ProgramSort = @"http://app.jczb.cnlive.com/api/catitem"; | |
| 241 | - | |
| 242 | -//分类节目列表 | |
| 243 | -static NSString *const ProgramListSort = @"http://app.jczb.cnlive.com/api/catprogramlist"; | |
| 244 | - | |
| 245 | -//评论列表 | |
| 246 | -static NSString *const ReadAllComment = @"http://comment.cnlive.com/services/commentForHd/readAllComment"; | |
| 247 | - | |
| 248 | -//发表评论 | |
| 249 | -static NSString *const InsertComment = @"http://comment.cnlive.com/services/commentForHd/insertComment"; | |
| 250 | - | |
| 251 | -//点赞评论 | |
| 252 | -static NSString *const PraiseComment = @"http://comment.cnlive.com/services/commentForHd/praiseComment"; | |
| 253 | - | |
| 254 | -//礼物详情 | |
| 255 | -static NSString *const readAllGiftsInter = @"https://mobile.cnlive.com/CnliveMobile/hd/getGiftDetail.action"; | |
| 256 | - | |
| 257 | -//赠送礼物 | |
| 258 | -//static NSString *const presentGiftInter = @"http://pom.cnlive.com/gf/sendGift.action"; | |
| 259 | -static NSString *const presentGiftInter = @"http://vote.cnlive.com/services/gift/presentGift"; | |
| 260 | - | |
| 261 | -//发红包前参数检测 | |
| 262 | -static NSString *const checkRedPackage = @"http://account.cnlive.com/my/preSendRedPackage.action"; | |
| 263 | - | |
| 264 | -//发红包 | |
| 265 | -static NSString *const sendRedPackage = @"http://account.cnlive.com/my/sendRedPackage.action"; | |
| 266 | - | |
| 267 | -static NSString *const readGiftImgById = @"http://pom.cnlive.com/gf/getGiftImg.action"; | |
| 268 | - | |
| 269 | -//投票接口 | |
| 270 | -static NSString *const vote = @"http://vote.cnlive.com/services/voteForHd/vote"; | |
| 271 | - | |
| 272 | -//竞猜接口 | |
| 273 | -static NSString *const guess = @"http://quiz.cnlive.com/services/guessForHd/guess"; | |
| 274 | - | |
| 275 | -//问答接口 | |
| 276 | -static NSString *const qa = @"http://quiz.cnlive.com/services/qaForHd/qa"; | |
| 277 | - | |
| 278 | -//消息列表接口 | |
| 279 | -//static NSString *const getMessage = @"http://123.59.61.116:8888/CnliveUser/my/getMyMessages.action"; | |
| 280 | -static NSString *const getMessage = @"http://uc.cnlive.com/my/getMyMessages.action"; | |
| 281 | - | |
| 282 | -//未读消息 | |
| 283 | -static NSString *const unreadMessage = @"http://uc.cnlive.com/my/getMyNewMessage.action"; | |
| 284 | - | |
| 285 | -//消息标记已读 | |
| 286 | -static NSString *const tagReadMessage = @"http://uc.cnlive.com/my/readMyMessage.action"; | |
| 287 | - | |
| 288 | -//抽奖消息页面 | |
| 289 | -static NSString *const lotteryMessage = @"http://uc.cnlive.com/my/readAward.action"; | |
| 290 | - | |
| 291 | -//互动消息接口 | |
| 292 | -static NSString *const getMyHDMessage = @"http://uc.cnlive.com/my/getMyHDMessage"; | |
| 293 | - | |
| 294 | -//更新历史记录 | |
| 295 | -static NSString *const updateMyPlayRecord = @"http://uc.cnlive.com/my/updateMyPlayRecord.action"; | |
| 296 | - | |
| 297 | -//中奖消息接口 | |
| 298 | -static NSString *const getMyWinningMessage = @"http://uc.cnlive.com/my/getMyWinningMessage"; | |
| 299 | - | |
| 300 | -//申请提取奖品接口 | |
| 301 | -static NSString *const applyForMyGif = @"http://uc.cnlive.com/my/applyForMyGift.action"; | |
| 302 | - | |
| 303 | -//读取历史记录 | |
| 304 | -static NSString *const getMyPlayRecord = @"http://uc.cnlive.com/my/getMyPlayRecord.action"; | |
| 305 | - | |
| 306 | -//更新收藏 | |
| 307 | -static NSString *const updateMyCollection = @"http://uc.cnlive.com/my/updateMyCollection.action"; | |
| 308 | - | |
| 309 | -//读取收藏 | |
| 310 | -static NSString *const getMyCollection = @"http://uc.cnlive.com/my/getMyCollection.action"; | |
| 311 | - | |
| 312 | -//判断收藏状态 | |
| 313 | -static NSString *const inMyCollection = @"http://uc.cnlive.com/my/inMyCollection.action"; | |
| 314 | - | |
| 315 | -//打赏详情接口 | |
| 316 | -static NSString *const getAwardDetail = @"https://mobile.cnlive.com/CnliveMobile/hd/getRewardDetail.action"; | |
| 317 | - | |
| 318 | -//打赏 | |
| 319 | -static NSString *const Award = @"http://vote.cnlive.com/services/awardForHd/award"; | |
| 320 | - | |
| 321 | -//下注详情接口 | |
| 322 | -static NSString *const getBetDetail = @"https://mobile.cnlive.com/CnliveMobile/hd/getBetDetail.action"; | |
| 323 | - | |
| 324 | -//下注 | |
| 325 | -static NSString *const Bet = @"http://vote.cnlive.com/services/betForHd/bet"; | |
| 326 | - | |
| 327 | -//我的钱包列表 | |
| 328 | -static NSString *const myWallet = @"http://uc.cnlive.com/my/getMyWallet.action"; | |
| 329 | - | |
| 330 | -//我的钱包中国币 | |
| 331 | -static NSString *const chinaCoin = @"http://uc.cnlive.com/my/getMyCnCoinDetail.action"; | |
| 332 | - | |
| 333 | -//我的钱包红包 | |
| 334 | -static NSString *const redWallet = @"http://uc.cnlive.com/my/getMyBonusDetail.action"; | |
| 335 | - | |
| 336 | -//红包提现 | |
| 337 | -static NSString *const drawal = @"http://uc.cnlive.com/my/drawRedPackage.action"; | |
| 338 | - | |
| 339 | -//反馈 | |
| 340 | -static NSString *const feedback = @"https://mobile.cnlive.com/CnliveMobile/json/report.action"; | |
| 341 | -//充值 | |
| 342 | -static NSString *const rechargePageInter = @"https://mobile.cnlive.com/CnliveMobile/json/readRechargeStandard.action"; | |
| 343 | - | |
| 344 | -// 中国币订单提交 | |
| 345 | -static NSString *const orderVideoByCnCoin = @"http://pom.cnlive.com/bz/orderVideoByCnCoin.action"; | |
| 346 | - | |
| 347 | -//static NSString *const prepay = @"http://unifypay.cnlive.com/prepay"; | |
| 348 | -static NSString *const prepay = @"https://api.cnlive.com/open/api2/unifypay/prepay"; | |
| 349 | - | |
| 350 | -//static NSString *const payed = @"http://unifypay.cnlive.com/payed"; | |
| 351 | -static NSString *const payed = @"https://api.cnlive.com/open/api2/unifypay/payed"; | |
| 352 | - | |
| 353 | -//购买会员 | |
| 354 | -static NSString *const orderPackageByCnCoin = @"http://pom.cnlive.com/bz/orderPackageByCnCoin.action"; | |
| 355 | - | |
| 356 | -//会员免费券、兑换码使用记录 | |
| 357 | -static NSString *const getOrderByType = @"http://pom.cnlive.com/getOrderByType.action"; | |
| 358 | - | |
| 359 | -//活动中心 | |
| 360 | -static NSString *const activityDetail = @"http://app.jczb.cnlive.com/api/activity"; | |
| 361 | - | |
| 362 | -//获取回看弹幕 | |
| 363 | -static NSString *const playbackBarrage = @"https://mobile.cnlive.com/CnliveMobile/hd/getBarrage.action"; | |
| 364 | - | |
| 365 | -//积分商城 | |
| 366 | -static NSString *const integralShop = @"http://jf.uc.cnlive.com/pointStore/index.action?"; | |
| 367 | - | |
| 368 | -//明星支持 | |
| 369 | -static NSString *const starSupport = @"http://vote.cnlive.com/services/voteForCommonV2/vote"; | |
| 370 | - | |
| 371 | -//分享成功后增加中国币 | |
| 372 | -static NSString *const shareSuccess = @"http://uc.cnlive.com/share.action?"; | |
| 373 | - | |
| 374 | -//我的互动电视 | |
| 375 | -static NSString *const staffrelative = @"http://app.jczb.cnlive.com/intertv/api_v1/staffrelative.do"; | |
| 376 | - | |
| 377 | -//切西瓜增加中国币 | |
| 378 | -static NSString *const updateCnCoin = @"http://account.cnlive.com/updateCnCoin.action"; | |
| 379 | - | |
| 380 | -//读取顶/踩数据 | |
| 381 | -static NSString *const readSupport = @"http://ct.cnlive.com/services/supportForHd/readSupport?"; | |
| 382 | - | |
| 383 | -//顶踩(节目ID) | |
| 384 | -static NSString *const supportProgram = @"http://ct.cnlive.com/services/supportForHd/support"; | |
| 385 | - | |
| 386 | -//红包退款 | |
| 387 | -static NSString *const refund = @"http://unifypay.cnlive.com/refund"; | |
| 388 | - | |
| 389 | -//查看红包支付结果 | |
| 390 | -static NSString *const payResult = @"http://apps.pay.cnlive.com/upappnotify/notify/sendRedPackage/result"; | |
| 391 | - | |
| 392 | -//摇一摇结果 | |
| 393 | -static NSString *const shakeResults = @"http://uc.cnlive.com/my/shake.action"; | |
| 394 | - | |
| 395 | -//赠送主播礼物接口 | |
| 396 | -static NSString *const PresentGift = @"http://vote.cnlive.com/services/giftForHost/presentGift"; | |
| 397 | - | |
| 398 | -//弹幕接口 | |
| 399 | -static NSString *const Barrage = @"http://vote.cnlive.com/services/barrageForHost/barrage"; | |
| 400 | - | |
| 401 | -//内容状态接口 | |
| 402 | -static NSString *const ContentStatus = @"http://app.jczb.cnlive.com/api/getContentStatus"; | |
| 403 | - | |
| 404 | -//进入聊天室 | |
| 405 | -static NSString *const Enterchatroom = @"https://mobile.cnlive.com/CnliveMobile/hd/enterChatroom.action"; | |
| 406 | - | |
| 407 | -/* --------------------------------------- 视频付费 -----------------------------------------*/ | |
| 408 | -// 获取商品详细信息 | |
| 409 | -static NSString *const getProduct = @"http://pom.cnlive.com/getProduct.action"; | |
| 410 | - | |
| 411 | -// 兑码观看 | |
| 412 | -static NSString *const orderForPromCode = @"http://pom.cnlive.com/orderForPromCode.action"; | |
| 413 | - | |
| 414 | -/* --------------------------------------- 上传视频 -----------------------------------------*/ | |
| 415 | - | |
| 416 | -//上传前服务器定向 | |
| 417 | -static NSString *const redirect = @"http://upload02.vlog.cnlive.com/api/video/redirect"; | |
| 418 | - | |
| 419 | -//录入元数据(上传描述信息) | |
| 420 | -static NSString *const descriptionUpload = @"http://upload02.vlog.cnlive.com/api/video/supload"; | |
| 421 | - | |
| 422 | 49 | //视频上传服务协议 |
| 423 | 50 | static NSString *const uploadServiceProtocol = @"http://data.cnlive.com/term/hdtv/upload.html"; |
| 424 | 51 | |
| 425 | -//视频结束通知 | |
| 426 | -static NSString *const finishNotify = @"http://upload02.vlog.cnlive.com/api/video/uploadNotify"; | |
| 427 | - | |
| 428 | -//查询所有源码转码情况 | |
| 429 | -static NSString *const videoList = @"http://upload02.vlog.cnlive.com/api/video/all"; | |
| 430 | - | |
| 431 | -/* --------------------------------------- UGC Live -----------------------------------------*/ | |
| 432 | - | |
| 433 | -//直播状态 | |
| 434 | -static NSString *const getContentStatus = @"http://app.jczb.cnlive.com/api/getContentStatus"; | |
| 435 | - | |
| 436 | -//是否关注 | |
| 437 | -static NSString *const checkCareV2 = @"http://uc.cnlive.com/host/checkCareV2.action"; | |
| 438 | - | |
| 439 | -//关注和取消关注 | |
| 440 | -static NSString *const careV2 = @"http://uc.cnlive.com/host/careV2"; | |
| 441 | - | |
| 442 | -//举报类型 | |
| 443 | -static NSString *const reportType = @"http://uc.cnlive.com/host/reportType.action"; | |
| 444 | - | |
| 445 | -//举报主播 | |
| 446 | -static NSString *const report = @"http://uc.cnlive.com/host/report.action"; | |
| 447 | - | |
| 448 | -//直播结束获取信息 | |
| 449 | -static NSString *const streamEnd = @"http://uc.cnlive.com/host/liveResult.action"; | |
| 450 | - | |
| 451 | 52 | //申请主播 |
| 452 | 53 | static NSString *const applyAnchor = @"https://mobile.cnlive.com/CnliveMobile/host/apply.action"; |
| 453 | 54 | |
| 454 | -//心跳通知 | |
| 455 | -static NSString *const heartBeat = @"http://uc.cnlive.com/heartBeat/hb.action"; | |
| 456 | - | |
| 457 | -//中国网红 | |
| 458 | -static NSString *const chinaWX = @"http://app.jczb.cnlive.com/api/chinaWebCelebrity"; | |
| 459 | - | |
| 460 | -//网红主播标签查询 | |
| 461 | -static NSString *const WHbiaoqian = @"http://app.jczb.cnlive.com/api/zhuboSearch" ; | |
| 462 | - | |
| 463 | 55 | #endif |
| 464 | 56 | |
| 465 | 57 | ... | ... |
LiveVideoCloud/UtilKits/UserTools/UserTools.h
| ... | ... | @@ -10,7 +10,9 @@ |
| 10 | 10 | #import "AFNetworking.h" |
| 11 | 11 | typedef void (^ _Nonnull AFHttpSuccessBlock)(AFHTTPRequestOperation *__nonnull operation, id __nonnull responseObject); |
| 12 | 12 | typedef void (^ _Nonnull AFHttpFailureBlock)(AFHTTPRequestOperation *__nonnull operation, NSString *__nonnull error); |
| 13 | + | |
| 13 | 14 | @interface UserTools : NSObject |
| 15 | + | |
| 14 | 16 | + (BOOL)isLogin; |
| 15 | 17 | |
| 16 | 18 | + (void)setUserLogin:(BOOL)isLogin; |
| ... | ... | @@ -26,27 +28,8 @@ typedef void (^ _Nonnull AFHttpFailureBlock)(AFHTTPRequestOperation *__nonnull o |
| 26 | 28 | |
| 27 | 29 | + (void)toast:( NSString * _Nullable )message; |
| 28 | 30 | |
| 29 | -// 获取我的消息列表用于红点显示 | |
| 30 | -//+ (void)getMessageListSuccess:(void (^__nullable)(AFHTTPRequestOperation *__nonnull operation, id __nonnull responseObject))success failure:(void (^__nullable)(AFHTTPRequestOperation *__nonnull operation, NSError *__nonnull error))failure; | |
| 31 | -+ (void)getMessageListSuccess:(AFHttpSuccessBlock)success failure:(AFHttpFailureBlock)failure; | |
| 32 | - | |
| 33 | 31 | + (NSString * _Nullable)uidForStat; |
| 34 | 32 | |
| 35 | -/** | |
| 36 | - 获取用户所有信息 老接口 | |
| 37 | - | |
| 38 | - @param success 成功回调 | |
| 39 | - @param failure 失败回调 | |
| 40 | - */ | |
| 41 | -+ (void)getChinaCoinSuccess:(AFHttpSuccessBlock)success failure:(AFHttpFailureBlock)failure; | |
| 42 | - | |
| 43 | -/** | |
| 44 | - 异步获得中国币数量 | |
| 45 | - | |
| 46 | - @param block count为中国币数量 | |
| 47 | - */ | |
| 48 | -+ (void)getChinaCoinCount:(void (^_Nullable )(BOOL success, NSError *_Nullable error, NSString * _Nullable count))block; | |
| 49 | - | |
| 50 | 33 | |
| 51 | 34 | /** |
| 52 | 35 | 成为主播查询 | ... | ... |
LiveVideoCloud/UtilKits/UserTools/UserTools.m
| ... | ... | @@ -114,40 +114,6 @@ |
| 114 | 114 | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | -+ (void)getMessageListSuccess:(AFHttpSuccessBlock)success failure:(AFHttpFailureBlock)failure | |
| 118 | -{ | |
| 119 | - | |
| 120 | - NSDictionary *dic = @{@"sid":[UserInformationModel manager].uid, | |
| 121 | - @"plat":@"i", | |
| 122 | - @"uuid":[UserTools uidForStat], | |
| 123 | - @"pageSize":@"20", | |
| 124 | - @"page":@"1"}; | |
| 125 | - NSString *token = [DESUtility base64StringFromPayText:[Tools stringByDictionary:dic]]; | |
| 126 | - NSDictionary *params = @{@"spId":SpId,@"token":token}; | |
| 127 | - [[AFHTTPRequestOperationManager manager] GET:getMessage parameters:params success:success failure:^(AFHTTPRequestOperation *operation, NSError *error) { | |
| 128 | - NSLog(@"%@",error); | |
| 129 | - failure(operation,error.description); | |
| 130 | - }]; | |
| 131 | - | |
| 132 | - | |
| 133 | -// [[AFHTTPRequestOperationManager manager] GET:getMessage parameters:params success:success failure:failure]; | |
| 134 | - /* | |
| 135 | - Printing description of dic: | |
| 136 | - { | |
| 137 | - page = 1; | |
| 138 | - pageSize = 20; | |
| 139 | - plat = i; | |
| 140 | - sid = 0; | |
| 141 | - uuid = "1478048910583_B5BD9AEB2C254D23862877F6B276F30D"; | |
| 142 | - } | |
| 143 | - Printing description of params: | |
| 144 | - { | |
| 145 | - spId = "82_iunnscwp07"; | |
| 146 | - token = "S8k8kpcFB8+HhC4r9w9hj/d9s+IExOEoLjFpKVWXyj0IAUY0iExUdLbE+jxBrIB69PCFcLSkdgZ0OmqPznWBzSdpk/Bo5ehK0pdi/HfSwxM9qozVEv1Scg=="; | |
| 147 | - } | |
| 148 | - */ | |
| 149 | -} | |
| 150 | - | |
| 151 | 117 | + (nullable NSString *)uidForStat { |
| 152 | 118 | |
| 153 | 119 | NSString *uid = @""; |
| ... | ... | @@ -197,49 +163,6 @@ |
| 197 | 163 | return stamp; |
| 198 | 164 | } |
| 199 | 165 | |
| 200 | -/** | |
| 201 | - 获取用户所有信息 老接口 | |
| 202 | - | |
| 203 | - @param success 成功回调 | |
| 204 | - @param failure 失败回调 | |
| 205 | - */ | |
| 206 | -+ (void)getChinaCoinSuccess:(AFHttpSuccessBlock)success failure:(AFHttpFailureBlock)failure | |
| 207 | -{ | |
| 208 | - NSMutableDictionary *parms = [NSMutableDictionary dictionary]; | |
| 209 | - parms[@"plat"] = @"a"; | |
| 210 | - parms[@"uid"] = [UserInformationModel manager].uid; | |
| 211 | - [[AFHTTPRequestOperationManager manager] POST:@"https://mobile.cnlive.com/CnliveMobile/json/readUserById.action" parameters:parms success:^(AFHTTPRequestOperation *operation, id responseObject) { | |
| 212 | - | |
| 213 | - NSString *chinaCoin = (NSString *)responseObject[@"china_coin"]; | |
| 214 | - [UserTools setLocalUserInfo:chinaCoin withKey:@"chinaCoin"]; | |
| 215 | - success(operation,responseObject); | |
| 216 | - | |
| 217 | - } failure:^(AFHTTPRequestOperation *operation, NSError *error) { | |
| 218 | - NSLog(@"%@",error); | |
| 219 | - failure(operation,error.description); | |
| 220 | - }]; | |
| 221 | -} | |
| 222 | - | |
| 223 | -/** | |
| 224 | - 异步获得中国币数量 | |
| 225 | - | |
| 226 | - @param block count为中国币数量 | |
| 227 | - */ | |
| 228 | -+ (void)getChinaCoinCount:(void (^_Nullable )(BOOL success, NSError *_Nullable error, NSString * _Nullable count))block | |
| 229 | -{ | |
| 230 | - __block NSString *chinaCoinCount = 0; | |
| 231 | - __block NSError *err = nil; | |
| 232 | - [self getChinaCoinSuccess:^(AFHTTPRequestOperation * _Nonnull operation, id _Nonnull responseObject) { | |
| 233 | - chinaCoinCount = (NSString *)responseObject[@"china_coin"]; | |
| 234 | - block(YES,err,chinaCoinCount); | |
| 235 | - } failure:^(AFHTTPRequestOperation * _Nonnull operation, NSString * _Nonnull error) { | |
| 236 | - chinaCoinCount = nil; | |
| 237 | - block(NO, nil,chinaCoinCount); | |
| 238 | - }]; | |
| 239 | -} | |
| 240 | - | |
| 241 | - | |
| 242 | - | |
| 243 | 166 | + (void)getAnchor:(NSDictionary *)param success:(AFHttpSuccessBlock)success failure:(AFHttpFailureBlock)failure |
| 244 | 167 | { |
| 245 | 168 | NSInteger time = [[NSDate date] timeIntervalSince1970]; | ... | ... |