├── CommonUtils ├── AppMethod.h ├── AppMethod.m ├── AppUtils.h └── CommonInfo.h ├── Helper ├── AlipaySDK │ ├── AlipayHelper.h │ ├── AlipayHelper.m │ ├── AlipaySDK.bundle │ │ ├── bar@2x.png │ │ ├── refresh@2x.png │ │ ├── refresh_click@2x.png │ │ ├── shutdown@2x.png │ │ └── shutdown_click@2x.png │ ├── AlipaySDK.framework │ │ ├── AlipaySDK │ │ ├── Headers │ │ │ ├── APayAuthInfo.h │ │ │ └── AlipaySDK.h │ │ ├── Info.plist │ │ └── en.lproj │ │ │ └── InfoPlist.strings │ ├── Order.h │ ├── Order.m │ ├── Util │ │ ├── DataSigner.h │ │ ├── DataSigner.m │ │ ├── DataVerifier.h │ │ ├── DataVerifier.m │ │ ├── MD5DataSigner.h │ │ ├── MD5DataSigner.m │ │ ├── NSDataEx.h │ │ ├── NSDataEx.m │ │ ├── RSADataSigner.h │ │ ├── RSADataSigner.m │ │ ├── RSADataVerifier.h │ │ ├── RSADataVerifier.m │ │ ├── base64.h │ │ ├── base64.m │ │ ├── config.h │ │ ├── openssl_wrapper.h │ │ └── openssl_wrapper.m │ ├── libcrypto.a │ ├── libssl.a │ └── openssl │ │ ├── aes.h │ │ ├── asn1.h │ │ ├── asn1_mac.h │ │ ├── asn1t.h │ │ ├── bio.h │ │ ├── blowfish.h │ │ ├── bn.h │ │ ├── buffer.h │ │ ├── camellia.h │ │ ├── cast.h │ │ ├── cmac.h │ │ ├── cms.h │ │ ├── comp.h │ │ ├── conf.h │ │ ├── conf_api.h │ │ ├── crypto.h │ │ ├── des.h │ │ ├── des_old.h │ │ ├── dh.h │ │ ├── dsa.h │ │ ├── dso.h │ │ ├── dtls1.h │ │ ├── e_os2.h │ │ ├── ebcdic.h │ │ ├── ec.h │ │ ├── ecdh.h │ │ ├── ecdsa.h │ │ ├── engine.h │ │ ├── err.h │ │ ├── evp.h │ │ ├── hmac.h │ │ ├── idea.h │ │ ├── krb5_asn.h │ │ ├── kssl.h │ │ ├── lhash.h │ │ ├── md4.h │ │ ├── md5.h │ │ ├── mdc2.h │ │ ├── modes.h │ │ ├── obj_mac.h │ │ ├── objects.h │ │ ├── ocsp.h │ │ ├── opensslconf.h │ │ ├── opensslv.h │ │ ├── ossl_typ.h │ │ ├── pem.h │ │ ├── pem2.h │ │ ├── pkcs12.h │ │ ├── pkcs7.h │ │ ├── pqueue.h │ │ ├── rand.h │ │ ├── rc2.h │ │ ├── rc4.h │ │ ├── ripemd.h │ │ ├── rsa.h │ │ ├── safestack.h │ │ ├── seed.h │ │ ├── sha.h │ │ ├── srp.h │ │ ├── srtp.h │ │ ├── ssl.h │ │ ├── ssl2.h │ │ ├── ssl23.h │ │ ├── ssl3.h │ │ ├── stack.h │ │ ├── symhacks.h │ │ ├── tls1.h │ │ ├── ts.h │ │ ├── txt_db.h │ │ ├── ui.h │ │ ├── ui_compat.h │ │ ├── whrlpool.h │ │ ├── x509.h │ │ ├── x509_vfy.h │ │ └── x509v3.h ├── JSONFommater │ ├── NSData+JSONCategoriesData.h │ ├── NSData+JSONCategoriesData.m │ ├── NSString+JSONCategoriesString.h │ └── NSString+JSONCategoriesString.m └── WeChatSDK │ ├── WXApi.h │ ├── WXApiObject.h │ ├── WXHelper │ ├── Constant.h │ ├── GetMessageFromWXResp+responseWithTextOrMediaMessage.h │ ├── GetMessageFromWXResp+responseWithTextOrMediaMessage.m │ ├── SendMessageToWXReq+requestWithTextOrMediaMessage.h │ ├── SendMessageToWXReq+requestWithTextOrMediaMessage.m │ ├── WXApiManager.h │ ├── WXApiManager.m │ ├── WXApiRequestHandler.h │ ├── WXApiRequestHandler.m │ ├── WXApiResponseHandler.h │ ├── WXApiResponseHandler.m │ ├── WXMediaMessage+messageConstruct.h │ └── WXMediaMessage+messageConstruct.m │ ├── WechatAuthSDK.h │ └── libWeChatSDK.a ├── PayDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── wpf.xcuserdatad │ └── xcschemes │ ├── PayDemo.xcscheme │ └── xcschememanagement.plist ├── PayDemo.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ └── wpf.xcuserdatad │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist ├── PayDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── LaunchImage.launchimage │ │ ├── 1-1.png │ │ ├── 1-2.png │ │ ├── 1-3.png │ │ ├── 1-4.png │ │ ├── 1-5.png │ │ ├── 1-6.png │ │ ├── 1.png │ │ └── Contents.json ├── Info.plist ├── PayDemo-Prefix.pch ├── ViewController.h ├── ViewController.m └── main.m ├── PayDemoTests ├── Info.plist └── PayDemoTests.m ├── PayDemoUITests ├── Info.plist └── PayDemoUITests.m ├── Podfile ├── Podfile.lock ├── Pods ├── AFNetworking │ ├── AFNetworking │ │ ├── AFHTTPRequestOperation.h │ │ ├── AFHTTPRequestOperation.m │ │ ├── AFHTTPRequestOperationManager.h │ │ ├── AFHTTPRequestOperationManager.m │ │ ├── AFHTTPSessionManager.h │ │ ├── AFHTTPSessionManager.m │ │ ├── AFNetworkReachabilityManager.h │ │ ├── AFNetworkReachabilityManager.m │ │ ├── AFNetworking.h │ │ ├── AFSecurityPolicy.h │ │ ├── AFSecurityPolicy.m │ │ ├── AFURLConnectionOperation.h │ │ ├── AFURLConnectionOperation.m │ │ ├── AFURLRequestSerialization.h │ │ ├── AFURLRequestSerialization.m │ │ ├── AFURLResponseSerialization.h │ │ ├── AFURLResponseSerialization.m │ │ ├── AFURLSessionManager.h │ │ └── AFURLSessionManager.m │ ├── LICENSE │ ├── README.md │ └── UIKit+AFNetworking │ │ ├── AFNetworkActivityIndicatorManager.h │ │ ├── AFNetworkActivityIndicatorManager.m │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ ├── UIActivityIndicatorView+AFNetworking.m │ │ ├── UIAlertView+AFNetworking.h │ │ ├── UIAlertView+AFNetworking.m │ │ ├── UIButton+AFNetworking.h │ │ ├── UIButton+AFNetworking.m │ │ ├── UIImage+AFNetworking.h │ │ ├── UIImageView+AFNetworking.h │ │ ├── UIImageView+AFNetworking.m │ │ ├── UIKit+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.m │ │ ├── UIRefreshControl+AFNetworking.h │ │ ├── UIRefreshControl+AFNetworking.m │ │ ├── UIWebView+AFNetworking.h │ │ └── UIWebView+AFNetworking.m ├── Headers │ ├── Private │ │ ├── AFNetworking │ │ │ ├── AFHTTPRequestOperation.h │ │ │ ├── AFHTTPRequestOperationManager.h │ │ │ ├── AFHTTPSessionManager.h │ │ │ ├── AFNetworkActivityIndicatorManager.h │ │ │ ├── AFNetworkReachabilityManager.h │ │ │ ├── AFNetworking.h │ │ │ ├── AFSecurityPolicy.h │ │ │ ├── AFURLConnectionOperation.h │ │ │ ├── AFURLRequestSerialization.h │ │ │ ├── AFURLResponseSerialization.h │ │ │ ├── AFURLSessionManager.h │ │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ │ ├── UIAlertView+AFNetworking.h │ │ │ ├── UIButton+AFNetworking.h │ │ │ ├── UIImage+AFNetworking.h │ │ │ ├── UIImageView+AFNetworking.h │ │ │ ├── UIKit+AFNetworking.h │ │ │ ├── UIProgressView+AFNetworking.h │ │ │ ├── UIRefreshControl+AFNetworking.h │ │ │ └── UIWebView+AFNetworking.h │ │ ├── Masonry │ │ │ ├── MASCompositeConstraint.h │ │ │ ├── MASConstraint+Private.h │ │ │ ├── MASConstraint.h │ │ │ ├── MASConstraintMaker.h │ │ │ ├── MASLayoutConstraint.h │ │ │ ├── MASUtilities.h │ │ │ ├── MASViewAttribute.h │ │ │ ├── MASViewConstraint.h │ │ │ ├── Masonry.h │ │ │ ├── NSArray+MASAdditions.h │ │ │ ├── NSArray+MASShorthandAdditions.h │ │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ │ ├── View+MASAdditions.h │ │ │ ├── View+MASShorthandAdditions.h │ │ │ └── ViewController+MASAdditions.h │ │ └── XMLDictionary │ │ │ └── XMLDictionary.h │ └── Public │ │ ├── AFNetworking │ │ ├── AFHTTPRequestOperation.h │ │ ├── AFHTTPRequestOperationManager.h │ │ ├── AFHTTPSessionManager.h │ │ ├── AFNetworkActivityIndicatorManager.h │ │ ├── AFNetworkReachabilityManager.h │ │ ├── AFNetworking.h │ │ ├── AFSecurityPolicy.h │ │ ├── AFURLConnectionOperation.h │ │ ├── AFURLRequestSerialization.h │ │ ├── AFURLResponseSerialization.h │ │ ├── AFURLSessionManager.h │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ ├── UIAlertView+AFNetworking.h │ │ ├── UIButton+AFNetworking.h │ │ ├── UIImage+AFNetworking.h │ │ ├── UIImageView+AFNetworking.h │ │ ├── UIKit+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.h │ │ ├── UIRefreshControl+AFNetworking.h │ │ └── UIWebView+AFNetworking.h │ │ ├── Masonry │ │ ├── MASCompositeConstraint.h │ │ ├── MASConstraint+Private.h │ │ ├── MASConstraint.h │ │ ├── MASConstraintMaker.h │ │ ├── MASLayoutConstraint.h │ │ ├── MASUtilities.h │ │ ├── MASViewAttribute.h │ │ ├── MASViewConstraint.h │ │ ├── Masonry.h │ │ ├── NSArray+MASAdditions.h │ │ ├── NSArray+MASShorthandAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ ├── View+MASAdditions.h │ │ ├── View+MASShorthandAdditions.h │ │ └── ViewController+MASAdditions.h │ │ └── XMLDictionary │ │ └── XMLDictionary.h ├── Manifest.lock ├── Masonry │ ├── LICENSE │ ├── Masonry │ │ ├── MASCompositeConstraint.h │ │ ├── MASCompositeConstraint.m │ │ ├── MASConstraint+Private.h │ │ ├── MASConstraint.h │ │ ├── MASConstraint.m │ │ ├── MASConstraintMaker.h │ │ ├── MASConstraintMaker.m │ │ ├── MASLayoutConstraint.h │ │ ├── MASLayoutConstraint.m │ │ ├── MASUtilities.h │ │ ├── MASViewAttribute.h │ │ ├── MASViewAttribute.m │ │ ├── MASViewConstraint.h │ │ ├── MASViewConstraint.m │ │ ├── Masonry.h │ │ ├── NSArray+MASAdditions.h │ │ ├── NSArray+MASAdditions.m │ │ ├── NSArray+MASShorthandAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.m │ │ ├── View+MASAdditions.h │ │ ├── View+MASAdditions.m │ │ ├── View+MASShorthandAdditions.h │ │ ├── ViewController+MASAdditions.h │ │ └── ViewController+MASAdditions.m │ └── README.md ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── wpf.xcuserdatad │ │ └── xcschemes │ │ ├── AFNetworking.xcscheme │ │ ├── Masonry.xcscheme │ │ ├── Pods.xcscheme │ │ ├── XMLDictionary.xcscheme │ │ └── xcschememanagement.plist ├── Target Support Files │ ├── AFNetworking │ │ ├── AFNetworking-dummy.m │ │ ├── AFNetworking-prefix.pch │ │ └── AFNetworking.xcconfig │ ├── Masonry │ │ ├── Masonry-dummy.m │ │ ├── Masonry-prefix.pch │ │ └── Masonry.xcconfig │ ├── Pods │ │ ├── Pods-acknowledgements.markdown │ │ ├── Pods-acknowledgements.plist │ │ ├── Pods-dummy.m │ │ ├── Pods-frameworks.sh │ │ ├── Pods-resources.sh │ │ ├── Pods.debug.xcconfig │ │ └── Pods.release.xcconfig │ └── XMLDictionary │ │ ├── XMLDictionary-dummy.m │ │ ├── XMLDictionary-prefix.pch │ │ └── XMLDictionary.xcconfig └── XMLDictionary │ ├── LICENCE.md │ ├── README.md │ └── XMLDictionary │ ├── XMLDictionary.h │ └── XMLDictionary.m └── README.md /CommonUtils/AppMethod.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppMethod.h 3 | // PNeayBy 4 | // 5 | // Created by wpf on 15/11/15. 6 | // Copyright © 2015年 wpf. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppMethod : NSObject 12 | 13 | + (AppMethod *)shared; 14 | /** 15 | * 获取32为随机字符串 16 | */ 17 | + (NSString *)getRandomString; 18 | /** 19 | * 获取用户IP地址 20 | */ 21 | + (NSString *)deviceIPAdress; 22 | /** 23 | * 签名,并返回添加签名的完整字典 24 | */ 25 | + (NSMutableDictionary *)partnerSignOrder:(NSDictionary*)paramDic; 26 | /** 27 | * MD5 签名 28 | */ 29 | + (NSString *)signString:(NSString*)origString; 30 | 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /CommonUtils/AppMethod.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppMethod.m 3 | // PNeayBy 4 | // 5 | // Created by wpf on 15/11/15. 6 | // Copyright © 2015年 wpf. All rights reserved. 7 | // 8 | 9 | #import "AppMethod.h" 10 | #include 11 | #include 12 | #import 13 | 14 | @implementation AppMethod 15 | 16 | + (AppMethod *)shared 17 | { 18 | static AppMethod *_share; 19 | static dispatch_once_t onceToken; 20 | dispatch_once(&onceToken, ^{ 21 | _share = [[AppMethod alloc]init]; 22 | }); 23 | return _share; 24 | } 25 | 26 | + (NSString *)getRandomString 27 | { 28 | NSString *str = [NSString stringWithFormat:@"%s",genRandomString(32)]; 29 | return str; 30 | } 31 | 32 | char* genRandomString(int length) 33 | { 34 | int flag, i; 35 | char* string; 36 | srand((unsigned) time(NULL )); 37 | if ((string = (char*) malloc(length)) == NULL ) 38 | { 39 | //NSLog(@"Malloc failed!flag:14\n"); 40 | return NULL ; 41 | } 42 | 43 | for (i = 0; i < length - 1; i++) 44 | { 45 | flag = rand() % 3; 46 | switch (flag) 47 | { 48 | case 0: 49 | string[i] = 'A' + rand() % 26; 50 | break; 51 | case 1: 52 | string[i] = 'a' + rand() % 26; 53 | break; 54 | case 2: 55 | string[i] = '0' + rand() % 10; 56 | break; 57 | default: 58 | string[i] = 'x'; 59 | break; 60 | } 61 | } 62 | string[length - 1] = '\0'; 63 | return string; 64 | } 65 | 66 | + (NSString *)deviceIPAdress 67 | { 68 | NSString *address = @"an error occurred when obtaining ip address"; 69 | struct ifaddrs *interfaces = NULL; 70 | struct ifaddrs *temp_addr = NULL; 71 | int success = 0; 72 | 73 | success = getifaddrs(&interfaces); 74 | 75 | if (success == 0) { // 0 表示获取成功 76 | 77 | temp_addr = interfaces; 78 | while (temp_addr != NULL) { 79 | if( temp_addr->ifa_addr->sa_family == AF_INET) { 80 | // Check if interface is en0 which is the wifi connection on the iPhone 81 | if ([[NSString stringWithUTF8String:temp_addr->ifa_name] isEqualToString:@"en0"]) { 82 | // Get NSString from C String 83 | address = [NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)temp_addr->ifa_addr)->sin_addr)]; 84 | } 85 | } 86 | 87 | temp_addr = temp_addr->ifa_next; 88 | } 89 | } 90 | 91 | freeifaddrs(interfaces); 92 | return address; 93 | } 94 | 95 | + (NSMutableDictionary *)partnerSignOrder:(NSDictionary*)paramDic 96 | { 97 | NSArray *keyArray = [paramDic allKeys]; 98 | // 对字段进行字母序排序 99 | NSMutableArray *sortedKeyArray = [NSMutableArray arrayWithArray:keyArray]; 100 | [sortedKeyArray sortUsingComparator:^NSComparisonResult(NSString* key1, NSString* key2) { 101 | return [key1 compare:key2]; 102 | }]; 103 | 104 | NSMutableString *paramString = [NSMutableString stringWithString:@""]; 105 | // 拼接成 A=B&X=Y 106 | for (NSString *key in sortedKeyArray) 107 | { 108 | if ([paramDic[key] length] != 0) 109 | { 110 | [paramString appendFormat:@"&%@=%@", key, paramDic[key]]; 111 | } 112 | } 113 | 114 | if ([paramString length] > 1) 115 | { 116 | [paramString deleteCharactersInRange:NSMakeRange(0, 1)]; // remove first '&' 117 | } 118 | 119 | [paramString appendFormat:@"&key=%@", WeChatPARTNER_ID]; 120 | NSString *signString = [[AppMethod signString:paramString] uppercaseString]; 121 | 122 | 123 | NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:paramDic]; 124 | [dict setObject:signString forKey:@"sign"]; 125 | return dict; 126 | } 127 | 128 | 129 | + (NSString *)signString:(NSString*)origString 130 | { 131 | const char *original_str = [origString UTF8String]; 132 | unsigned char result[32]; 133 | CC_MD5(original_str, (CC_LONG)strlen(original_str), result);//调用md5 134 | NSMutableString *hash = [NSMutableString string]; 135 | for (int i = 0; i < 16; i++){ 136 | [hash appendFormat:@"%02x", result[i]]; 137 | } 138 | return hash; 139 | } 140 | 141 | 142 | 143 | @end 144 | -------------------------------------------------------------------------------- /CommonUtils/AppUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppUtils.h 3 | // PNeayBy 4 | // 5 | // Created by wpf on 15/11/15. 6 | // Copyright © 2015年 wpf. All rights reserved. 7 | // 8 | //////////////////////////---系统设置,方法替换---////////////////////////////// 9 | 10 | #ifndef AppUtils_h 11 | #define AppUtils_h 12 | 13 | #pragma mark - SDK宏定义 14 | //////////////////////////支付宝////////////////////////////// 15 | #define AlipayPARTNER @"" 16 | #define AlipaySELLER @"" 17 | #define AlipayRSA_PRIVATE @"" 18 | #define AlipayRSA_ALIPAY_PUBLIC @"" 19 | //获取服务器端支付数据地址(商户自定义) 20 | #define AlipayBackURL @"" 21 | 22 | 23 | //////////////////////////微信////////////////////////////// 24 | #define WeChatAppID @"" 25 | #define WeChatAppSecret @"" 26 | //商户号,填写商户对应参数 27 | #define WeChatMCH_ID @"" 28 | //商户API密钥,填写相应参数 29 | #define WeChatPARTNER_ID @"" 30 | //支付结果回调页面 31 | #define WeChatNOTIFY_URL @"" 32 | 33 | 34 | #pragma mark - 方法替换等 35 | //////////////////////////方法替换////////////////////////////// 36 | #ifdef DEBUG 37 | #define WPFLOG(xx, ...) NSLog(@"%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) 38 | #elif RELEASE 39 | #define WPFLOG(xx, ...) ((void)0) 40 | #else 41 | #define WPFLOG(xx, ...) ((void)0) 42 | #endif 43 | 44 | 45 | #define IMAGE(a) [UIImage imageNamed:(a)] 46 | 47 | 48 | // 防止循环引用 49 | #define WS(weakSelf) __weak __typeof(&*self)weakSelf = self; 50 | 51 | 52 | 53 | #pragma mark - 字体 54 | //////////////////////////字体////////////////////////////// 55 | #define mySysFont(a) [UIFont systemFontOfSize:(a)] 56 | #define myBolFont(a) [UIFont boldSystemFontOfSize:(a)] 57 | #define myItaFont(a) [UIFont italicSystemFontOfSize:(a)] 58 | 59 | #pragma mark - 颜色 60 | //////////////////////////颜色////////////////////////////// 61 | 62 | #define RGBIntegerColor(r,g,b,a) [UIColor colorWithRed:((r)/255.0f) green:((g)/255.0f) blue:((b)/255.0f) alpha:(a)/100.0f] 63 | 64 | #define COLOR_WITHIMAGE(a) [UIColor colorWithPatternImage:[UIImage imageNamed:(a)]] 65 | // 66 | #define COLOR_CLEARCOLOR [UIColor clearColor] 67 | #define COLOR_WHITECOLOR [UIColor whiteColor] 68 | #define COLOR_BLACKCOLOR [UIColor blackColor] 69 | #define COLOR_GRAYCOLOR [UIColor grayColor] 70 | #define COLOR_LIGHTGRAYCOLOR [UIColor lightGrayColor] 71 | #define COLOR_REDCOLOR [UIColor redColor] 72 | #define COLOR_BLUECOLOR [UIColor blueColor] 73 | #define COLOR_GREENCOLOR [UIColor greenColor] 74 | 75 | 76 | 77 | 78 | 79 | #pragma mark - 系统属性 80 | //////////////////////////系统属性////////////////////////////// 81 | #define NAVHEIGHT 64 82 | 83 | 84 | 85 | 86 | #endif /* AppUtils_h */ 87 | -------------------------------------------------------------------------------- /CommonUtils/CommonInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // CommonInfo.h 3 | // PNeayBy 4 | // 5 | // Created by wpf on 15/11/15. 6 | // Copyright © 2015年 wpf. All rights reserved. 7 | // 8 | //////////////////////////---通知、Defaults、keychain---////////////////////////////// 9 | 10 | #ifndef CommonInfo_h 11 | #define CommonInfo_h 12 | 13 | #pragma mark - 三方框架引用 14 | //define this constant if you want to use Masonry without the 'mas_' prefix 15 | #define MAS_SHORTHAND 16 | //define this constant if you want to enable auto-boxing for default syntax 17 | #define MAS_SHORTHAND_GLOBALS 18 | #import 19 | 20 | #import 21 | #import 22 | 23 | 24 | 25 | #pragma mark - SDK引用 26 | #import "WXApi.h" 27 | #import "WXApiManager.h" 28 | #import "WXApiRequestHandler.h" 29 | #import "WXApiResponseHandler.h" 30 | #import 31 | #import "AlipayHelper.h" 32 | 33 | 34 | 35 | 36 | 37 | #endif /* CommonInfo_h */ 38 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/AlipayHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // AlipayHelper.h 3 | // PNeayBy 4 | // 5 | // Created by wpf on 15/11/21. 6 | // Copyright © 2015年 wpf. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void(^AlipayResult)(NSDictionary *result); 12 | 13 | 14 | // 15 | //测试商品信息封装在Product中,外部商户可以根据自己商品实际情况定义 16 | // 17 | @interface Product : NSObject{ 18 | @private 19 | float _price; 20 | NSString *_subject; 21 | NSString *_body; 22 | NSString *_orderId; 23 | } 24 | 25 | @property (nonatomic, assign) float price; 26 | @property (nonatomic, copy) NSString *subject; 27 | @property (nonatomic, copy) NSString *body; 28 | @property (nonatomic, copy) NSString *orderId; 29 | 30 | @end 31 | 32 | 33 | @interface AlipayHelper : NSObject 34 | 35 | + (AlipayHelper *)shared; 36 | - (void)alipay:(Product *)product block:(AlipayResult)block; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/AlipayHelper.m: -------------------------------------------------------------------------------- 1 | // 2 | // AlipayHelper.m 3 | // PNeayBy 4 | // 5 | // Created by wpf on 15/11/21. 6 | // Copyright © 2015年 wpf. All rights reserved. 7 | // 8 | 9 | #import "AlipayHelper.h" 10 | #import "Order.h" 11 | #import "DataSigner.h" 12 | 13 | @implementation Product 14 | 15 | 16 | @end 17 | 18 | @implementation AlipayHelper 19 | 20 | + (AlipayHelper *)shared 21 | { 22 | static AlipayHelper *_alipay; 23 | static dispatch_once_t onceToken; 24 | dispatch_once(&onceToken, ^{ 25 | _alipay = [[AlipayHelper alloc]init]; 26 | }); 27 | return _alipay; 28 | } 29 | 30 | 31 | - (void)alipay:(Product *)product block:(AlipayResult)block 32 | { 33 | 34 | /*============================================================================*/ 35 | /*=======================需要填写商户app申请的===================================*/ 36 | /*============================================================================*/ 37 | NSString *partner = AlipayPARTNER; 38 | NSString *seller = AlipaySELLER; 39 | NSString *privateKey = AlipayRSA_PRIVATE; 40 | /*============================================================================*/ 41 | /*============================================================================*/ 42 | /*============================================================================*/ 43 | 44 | //partner和seller获取失败,提示 45 | if ([partner length] == 0 || 46 | [seller length] == 0 || 47 | [privateKey length] == 0) 48 | { 49 | UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" 50 | message:@"缺少partner或者seller或者私钥。" 51 | delegate:self 52 | cancelButtonTitle:@"确定" 53 | otherButtonTitles:nil]; 54 | [alert show]; 55 | return; 56 | } 57 | 58 | /* 59 | *生成订单信息及签名 60 | */ 61 | //将商品信息赋予AlixPayOrder的成员变量 62 | Order *order = [[Order alloc] init]; 63 | order.partner = partner; 64 | order.seller = seller; 65 | order.tradeNO = product.orderId; //订单ID(由商家自行制定) 66 | order.productName = product.subject; //商品标题 67 | order.productDescription = product.body; //商品描述 68 | order.amount = [NSString stringWithFormat:@"%.2f",product.price]; //商品价格 69 | order.notifyURL = @"http://www.xxx.com"; //回调URL 70 | 71 | order.service = @"mobile.securitypay.pay"; 72 | order.paymentType = @"1"; 73 | order.inputCharset = @"utf-8"; 74 | order.itBPay = @"30m"; 75 | order.showUrl = @"m.alipay.com"; 76 | 77 | //应用注册scheme,在AlixPayDemo-Info.plist定义URL types 78 | NSString *appScheme = @"alipayPayDemo"; 79 | 80 | //将商品信息拼接成字符串 81 | NSString *orderSpec = [order description]; 82 | NSLog(@"orderSpec = %@",orderSpec); 83 | 84 | //获取私钥并将商户信息签名,外部商户可以根据情况存放私钥和签名,只需要遵循RSA签名规范,并将签名字符串base64编码和UrlEncode 85 | id signer = CreateRSADataSigner(privateKey); 86 | NSString *signedString = [signer signString:orderSpec]; 87 | 88 | //将签名成功字符串格式化为订单字符串,请严格按照该格式 89 | NSString *orderString = nil; 90 | if (signedString != nil) { 91 | orderString = [NSString stringWithFormat:@"%@&sign=\"%@\"&sign_type=\"%@\"", 92 | orderSpec, signedString, @"RSA"]; 93 | 94 | [[AlipaySDK defaultService] payOrder:orderString fromScheme:appScheme callback:^(NSDictionary *resultDic) { 95 | 96 | 97 | 98 | NSLog(@"reslut = %@",resultDic); 99 | block(resultDic); 100 | }]; 101 | 102 | } 103 | 104 | } 105 | 106 | #pragma mark - 产生随机订单号 107 | 108 | 109 | - (NSString *)generateTradeNO 110 | { 111 | static int kNumber = 15; 112 | 113 | NSString *sourceStr = @"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 114 | NSMutableString *resultStr = [[NSMutableString alloc] init]; 115 | srand((unsigned)time(0)); 116 | for (int i = 0; i < kNumber; i++) 117 | { 118 | unsigned index = rand() % [sourceStr length]; 119 | NSString *oneStr = [sourceStr substringWithRange:NSMakeRange(index, 1)]; 120 | [resultStr appendString:oneStr]; 121 | } 122 | return resultStr; 123 | } 124 | 125 | @end 126 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/AlipaySDK.bundle/bar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codewpf/PayDemo/c55438f182b919f491f3a0bbd4da6dda6f86fd51/Helper/AlipaySDK/AlipaySDK.bundle/bar@2x.png -------------------------------------------------------------------------------- /Helper/AlipaySDK/AlipaySDK.bundle/refresh@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codewpf/PayDemo/c55438f182b919f491f3a0bbd4da6dda6f86fd51/Helper/AlipaySDK/AlipaySDK.bundle/refresh@2x.png -------------------------------------------------------------------------------- /Helper/AlipaySDK/AlipaySDK.bundle/refresh_click@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codewpf/PayDemo/c55438f182b919f491f3a0bbd4da6dda6f86fd51/Helper/AlipaySDK/AlipaySDK.bundle/refresh_click@2x.png -------------------------------------------------------------------------------- /Helper/AlipaySDK/AlipaySDK.bundle/shutdown@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codewpf/PayDemo/c55438f182b919f491f3a0bbd4da6dda6f86fd51/Helper/AlipaySDK/AlipaySDK.bundle/shutdown@2x.png -------------------------------------------------------------------------------- /Helper/AlipaySDK/AlipaySDK.bundle/shutdown_click@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codewpf/PayDemo/c55438f182b919f491f3a0bbd4da6dda6f86fd51/Helper/AlipaySDK/AlipaySDK.bundle/shutdown_click@2x.png -------------------------------------------------------------------------------- /Helper/AlipaySDK/AlipaySDK.framework/AlipaySDK: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codewpf/PayDemo/c55438f182b919f491f3a0bbd4da6dda6f86fd51/Helper/AlipaySDK/AlipaySDK.framework/AlipaySDK -------------------------------------------------------------------------------- /Helper/AlipaySDK/AlipaySDK.framework/Headers/APayAuthInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // APAuthInfo.h 3 | // AliSDKDemo 4 | // 5 | // Created by 方彬 on 14-7-18. 6 | // Copyright (c) 2014年 Alipay.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface APayAuthInfo : NSObject 12 | 13 | @property(nonatomic, copy)NSString *appID; 14 | @property(nonatomic, copy)NSString *pid; 15 | @property(nonatomic, copy)NSString *redirectUri; 16 | 17 | /** 18 | * 初始化AuthInfo 19 | * 20 | * @param appIDStr 应用ID 21 | * @param productIDStr 产品码 该商户在aboss签约的产品,用户获取pid获取的参数 22 | * @param pidStr 商户ID 可不填 23 | * @param uriStr 授权的应用回调地址 比如:alidemo://auth 24 | * 25 | * @return authinfo实例 26 | */ 27 | - (id)initWithAppID:(NSString *)appIDStr 28 | pid:(NSString *)pidStr 29 | redirectUri:(NSString *)uriStr; 30 | 31 | - (NSString *)description; 32 | - (NSString *)wapDescription; 33 | @end 34 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/AlipaySDK.framework/Headers/AlipaySDK.h: -------------------------------------------------------------------------------- 1 | // 2 | // AlipaySDK.h 3 | // AlipaySDK 4 | // 5 | // Created by 方彬 on 14-4-28. 6 | // Copyright (c) 2014年 Alipay. All rights reserved. 7 | // 8 | 9 | 10 | //////////////////////////////////////////////////////// 11 | ////////////////version:2.1 motify:2014.12.24////////// 12 | ///////////////////Merry Christmas=。=////////////////// 13 | //////////////////////////////////////////////////////// 14 | 15 | 16 | #import "APayAuthInfo.h" 17 | typedef enum { 18 | ALIPAY_TIDFACTOR_IMEI, 19 | ALIPAY_TIDFACTOR_IMSI, 20 | ALIPAY_TIDFACTOR_TID, 21 | ALIPAY_TIDFACTOR_CLIENTKEY, 22 | ALIPAY_TIDFACTOR_VIMEI, 23 | ALIPAY_TIDFACTOR_VIMSI, 24 | ALIPAY_TIDFACTOR_CLIENTID, 25 | ALIPAY_TIDFACTOR_APDID, 26 | ALIPAY_TIDFACTOR_MAX 27 | } AlipayTidFactor; 28 | 29 | typedef void(^CompletionBlock)(NSDictionary *resultDic); 30 | 31 | @interface AlipaySDK : NSObject 32 | 33 | /** 34 | * 创建支付单例服务 35 | * 36 | * @return 返回单例对象 37 | */ 38 | + (AlipaySDK *)defaultService; 39 | 40 | /** 41 | * 支付接口 42 | * 43 | * @param orderStr 订单信息 44 | * @param schemeStr 调用支付的app注册在info.plist中的scheme 45 | * @param compltionBlock 支付结果回调Block 46 | */ 47 | - (void)payOrder:(NSString *)orderStr 48 | fromScheme:(NSString *)schemeStr 49 | callback:(CompletionBlock)completionBlock; 50 | 51 | /** 52 | * 处理钱包或者独立快捷app支付跳回商户app携带的支付结果Url 53 | * 54 | * @param resultUrl 支付结果url,传入后由SDK解析,统一在上面的pay方法的callback中回调 55 | * @param completionBlock 跳钱包支付结果回调,保证跳转钱包支付过程中,即使调用方app被系统kill时,能通过这个回调取到支付结果。 56 | */ 57 | - (void)processOrderWithPaymentResult:(NSURL *)resultUrl 58 | standbyCallback:(CompletionBlock)completionBlock; 59 | 60 | /** 61 | * 是否已经使用过 62 | * 63 | * @return YES为已经使用过,NO反之 64 | */ 65 | - (BOOL)isLogined; 66 | 67 | /** 68 | * 当前版本号 69 | * 70 | * @return 当前版本字符串 71 | */ 72 | - (NSString *)currentVersion; 73 | 74 | /** 75 | * 当前版本号 76 | * 77 | * @return tid相关信息 78 | */ 79 | - (NSString*)queryTidFactor:(AlipayTidFactor)factor; 80 | 81 | /** 82 | * 測試所用,realse包无效 83 | * 84 | * @param url 测试环境 85 | */ 86 | - (void)setUrl:(NSString *)url; 87 | 88 | 89 | ////////////////////////////////////////////////////////////////////////////////////////////// 90 | //////////////////////////授权1.0////////////////////////////////////////////////////////////// 91 | ////////////////////////////////////////////////////////////////////////////////////////////// 92 | 93 | /** 94 | * 快登授权 95 | * @param authInfo 需授权信息 96 | * @param completionBlock 授权结果回调 97 | */ 98 | - (void)authWithInfo:(APayAuthInfo *)authInfo 99 | callback:(CompletionBlock)completionBlock; 100 | 101 | 102 | /** 103 | * 处理授权信息Url 104 | * 105 | * @param resultUrl 钱包返回的授权结果url 106 | * @param completionBlock 跳授权结果回调,保证跳转钱包授权过程中,即使调用方app被系统kill时,能通过这个回调取到支付结果。 107 | */ 108 | - (void)processAuthResult:(NSURL *)resultUrl 109 | standbyCallback:(CompletionBlock)completionBlock; 110 | 111 | ////////////////////////////////////////////////////////////////////////////////////////////// 112 | //////////////////////////授权2.0////////////////////////////////////////////////////////////// 113 | ////////////////////////////////////////////////////////////////////////////////////////////// 114 | 115 | /** 116 | * 快登授权2.0 117 | * 118 | * @param infoStr 授权请求信息字符串 119 | * @param schemeStr 调用授权的app注册在info.plist中的scheme 120 | * @param completionBlock 授权结果回调 121 | */ 122 | - (void)auth_V2WithInfo:(NSString *)infoStr 123 | fromScheme:(NSString *)schemeStr 124 | callback:(CompletionBlock)completionBlock; 125 | 126 | /** 127 | * 处理授权信息Url 128 | * 129 | * @param resultUrl 钱包返回的授权结果url 130 | * @param completionBlock 跳授权结果回调,保证跳转钱包授权过程中,即使调用方app被系统kill时,能通过这个回调取到支付结果。 131 | */ 132 | - (void)processAuth_V2Result:(NSURL *)resultUrl 133 | standbyCallback:(CompletionBlock)completionBlock; 134 | 135 | @end 136 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/AlipaySDK.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codewpf/PayDemo/c55438f182b919f491f3a0bbd4da6dda6f86fd51/Helper/AlipaySDK/AlipaySDK.framework/Info.plist -------------------------------------------------------------------------------- /Helper/AlipaySDK/AlipaySDK.framework/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codewpf/PayDemo/c55438f182b919f491f3a0bbd4da6dda6f86fd51/Helper/AlipaySDK/AlipaySDK.framework/en.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /Helper/AlipaySDK/Order.h: -------------------------------------------------------------------------------- 1 | // 2 | // Order.h 3 | // AlixPayDemo 4 | // 5 | // Created by 方彬 on 11/2/13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface Order : NSObject 12 | 13 | @property(nonatomic, copy) NSString * partner; 14 | @property(nonatomic, copy) NSString * seller; 15 | @property(nonatomic, copy) NSString * tradeNO; 16 | @property(nonatomic, copy) NSString * productName; 17 | @property(nonatomic, copy) NSString * productDescription; 18 | @property(nonatomic, copy) NSString * amount; 19 | @property(nonatomic, copy) NSString * notifyURL; 20 | 21 | @property(nonatomic, copy) NSString * service; 22 | @property(nonatomic, copy) NSString * paymentType; 23 | @property(nonatomic, copy) NSString * inputCharset; 24 | @property(nonatomic, copy) NSString * itBPay; 25 | @property(nonatomic, copy) NSString * showUrl; 26 | 27 | 28 | @property(nonatomic, copy) NSString * rsaDate;//可选 29 | @property(nonatomic, copy) NSString * appID;//可选 30 | 31 | @property(nonatomic, readonly) NSMutableDictionary * extraParams; 32 | 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/Order.m: -------------------------------------------------------------------------------- 1 | // 2 | // Order.m 3 | // AlixPayDemo 4 | // 5 | // Created by 方彬 on 11/2/13. 6 | // 7 | // 8 | 9 | #import "Order.h" 10 | 11 | @implementation Order 12 | 13 | - (NSString *)description { 14 | NSMutableString * discription = [NSMutableString string]; 15 | if (self.partner) { 16 | [discription appendFormat:@"partner=\"%@\"", self.partner]; 17 | } 18 | 19 | if (self.seller) { 20 | [discription appendFormat:@"&seller_id=\"%@\"", self.seller]; 21 | } 22 | if (self.tradeNO) { 23 | [discription appendFormat:@"&out_trade_no=\"%@\"", self.tradeNO]; 24 | } 25 | if (self.productName) { 26 | [discription appendFormat:@"&subject=\"%@\"", self.productName]; 27 | } 28 | 29 | if (self.productDescription) { 30 | [discription appendFormat:@"&body=\"%@\"", self.productDescription]; 31 | } 32 | if (self.amount) { 33 | [discription appendFormat:@"&total_fee=\"%@\"", self.amount]; 34 | } 35 | if (self.notifyURL) { 36 | [discription appendFormat:@"¬ify_url=\"%@\"", self.notifyURL]; 37 | } 38 | 39 | if (self.service) { 40 | [discription appendFormat:@"&service=\"%@\"",self.service];//mobile.securitypay.pay 41 | } 42 | if (self.paymentType) { 43 | [discription appendFormat:@"&payment_type=\"%@\"",self.paymentType];//1 44 | } 45 | 46 | if (self.inputCharset) { 47 | [discription appendFormat:@"&_input_charset=\"%@\"",self.inputCharset];//utf-8 48 | } 49 | if (self.itBPay) { 50 | [discription appendFormat:@"&it_b_pay=\"%@\"",self.itBPay];//30m 51 | } 52 | if (self.showUrl) { 53 | [discription appendFormat:@"&show_url=\"%@\"",self.showUrl];//m.alipay.com 54 | } 55 | if (self.rsaDate) { 56 | [discription appendFormat:@"&sign_date=\"%@\"",self.rsaDate]; 57 | } 58 | if (self.appID) { 59 | [discription appendFormat:@"&app_id=\"%@\"",self.appID]; 60 | } 61 | for (NSString * key in [self.extraParams allKeys]) { 62 | [discription appendFormat:@"&%@=\"%@\"", key, [self.extraParams objectForKey:key]]; 63 | } 64 | return discription; 65 | } 66 | 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/Util/DataSigner.h: -------------------------------------------------------------------------------- 1 | // 2 | // DataSigner.h 3 | // AlixPayDemo 4 | // 5 | // Created by Jing Wen on 8/2/11. 6 | // Copyright 2011 alipay.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | typedef enum DataSignAlgorithm { 13 | DataSignAlgorithmRSA, 14 | DataSignAlgorithmMD5, 15 | } DataSignAlgorithm; 16 | 17 | @protocol DataSigner 18 | 19 | - (NSString *)algorithmName; 20 | - (NSString *)signString:(NSString *)string; 21 | 22 | @end 23 | 24 | id CreateRSADataSigner(NSString *privateKey); 25 | 26 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/Util/DataSigner.m: -------------------------------------------------------------------------------- 1 | // 2 | // DataSigner.m 3 | // AlixPayDemo 4 | // 5 | // Created by Jing Wen on 8/2/11. 6 | // Copyright 2011 alipay.com. All rights reserved. 7 | // 8 | 9 | #import "DataSigner.h" 10 | #import "RSADataSigner.h" 11 | #import "MD5DataSigner.h" 12 | 13 | id CreateRSADataSigner(NSString *privateKey) { 14 | 15 | return [[RSADataSigner alloc] initWithPrivateKey:privateKey]; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/Util/DataVerifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // DataVerifier.h 3 | // AlixPayDemo 4 | // 5 | // Created by Jing Wen on 8/2/11. 6 | // Copyright 2011 alipay.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @protocol DataVerifier 13 | 14 | - (NSString *)algorithmName; 15 | - (BOOL)verifyString:(NSString *)string withSign:(NSString *)signString; 16 | 17 | @end 18 | 19 | id CreateRSADataVerifier(NSString *publicKey); 20 | 21 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/Util/DataVerifier.m: -------------------------------------------------------------------------------- 1 | // 2 | // DataVerifier.m 3 | // AlixPayDemo 4 | // 5 | // Created by Jing Wen on 8/2/11. 6 | // Copyright 2011 alipay.com. All rights reserved. 7 | // 8 | 9 | #import "DataVerifier.h" 10 | 11 | 12 | #import "RSADataVerifier.h" 13 | 14 | id CreateRSADataVerifier(NSString *publicKey) { 15 | 16 | return [[RSADataVerifier alloc] initWithPublicKey:publicKey]; 17 | 18 | } -------------------------------------------------------------------------------- /Helper/AlipaySDK/Util/MD5DataSigner.h: -------------------------------------------------------------------------------- 1 | // 2 | // MD5DataSigner.h 3 | // SafepayService 4 | // 5 | // Created by wenbi on 11-4-11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DataSigner.h" 11 | 12 | @interface MD5DataSigner : NSObject { 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/Util/MD5DataSigner.m: -------------------------------------------------------------------------------- 1 | // 2 | // MD5DataSigner.m 3 | // SafepayService 4 | // 5 | // Created by wenbi on 11-4-11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "MD5DataSigner.h" 10 | 11 | 12 | @implementation MD5DataSigner 13 | 14 | - (NSString *)algorithmName { 15 | return @"MD5"; 16 | } 17 | 18 | - (NSString *)signString:(NSString *)string { 19 | return @""; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/Util/NSDataEx.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDataEx.h 3 | // iX3.0 4 | // 5 | // Created by Feng Huajun on 09-4-16. 6 | // Copyright 2009 Infothinker. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface NSData (NSDataBase64Additions) 13 | + (NSData *) dataWithBase64EncodedString:(NSString *) string; 14 | - (id) initWithBase64EncodedString:(NSString *) string; 15 | 16 | - (NSString *) base64Encoding; 17 | - (NSString *) base64EncodingWithLineLength:(unsigned int) lineLength; 18 | //- (NSString*) urlEncodedString; 19 | 20 | @end -------------------------------------------------------------------------------- /Helper/AlipaySDK/Util/RSADataSigner.h: -------------------------------------------------------------------------------- 1 | // 2 | // RSADataSigner.h 3 | // SafepayService 4 | // 5 | // Created by wenbi on 11-4-11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DataSigner.h" 11 | 12 | @interface RSADataSigner : NSObject { 13 | NSString * _privateKey; 14 | } 15 | 16 | - (id)initWithPrivateKey:(NSString *)privateKey; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/Util/RSADataSigner.m: -------------------------------------------------------------------------------- 1 | // 2 | // RSADataSigner.m 3 | // SafepayService 4 | // 5 | // Created by wenbi on 11-4-11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "RSADataSigner.h" 10 | #import "openssl_wrapper.h" 11 | #import "NSDataEx.h" 12 | 13 | @implementation RSADataSigner 14 | 15 | - (id)initWithPrivateKey:(NSString *)privateKey { 16 | if (self = [super init]) { 17 | _privateKey = [privateKey copy]; 18 | } 19 | return self; 20 | } 21 | 22 | - (NSString*)urlEncodedString:(NSString *)string 23 | { 24 | NSString * encodedString = (NSString*) CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (__bridge CFStringRef)string, NULL, (__bridge CFStringRef)@"!*'();:@&=+$,/?%#[]", kCFStringEncodingUTF8 )); 25 | 26 | return encodedString; 27 | } 28 | 29 | 30 | - (NSString *)formatPrivateKey:(NSString *)privateKey { 31 | const char *pstr = [privateKey UTF8String]; 32 | NSUInteger len = [privateKey length]; 33 | NSMutableString *result = [NSMutableString string]; 34 | [result appendString:@"-----BEGIN PRIVATE KEY-----\n"]; 35 | int index = 0; 36 | int count = 0; 37 | while (index < len) { 38 | char ch = pstr[index]; 39 | if (ch == '\r' || ch == '\n') { 40 | ++index; 41 | continue; 42 | } 43 | [result appendFormat:@"%c", ch]; 44 | if (++count == 79) 45 | { 46 | [result appendString:@"\n"]; 47 | count = 0; 48 | } 49 | index++; 50 | } 51 | [result appendString:@"\n-----END PRIVATE KEY-----"]; 52 | return result; 53 | } 54 | 55 | - (NSString *)algorithmName { 56 | return @"RSA"; 57 | } 58 | 59 | //该签名方法仅供参考,外部商户可用自己方法替换 60 | - (NSString *)signString:(NSString *)string { 61 | 62 | //在Document文件夹下创建私钥文件 63 | NSString * signedString = nil; 64 | NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; 65 | NSString *path = [documentPath stringByAppendingPathComponent:@"AlixPay-RSAPrivateKey"]; 66 | 67 | // 68 | // 把密钥写入文件 69 | // 70 | NSString *formatKey = [self formatPrivateKey:_privateKey]; 71 | [formatKey writeToFile:path atomically:YES encoding:NSUTF8StringEncoding error:nil]; 72 | 73 | const char *message = [string cStringUsingEncoding:NSUTF8StringEncoding]; 74 | int messageLength = (int)strlen(message); 75 | unsigned char *sig = (unsigned char *)malloc(256); 76 | unsigned int sig_len; 77 | int ret = rsa_sign_with_private_key_pem((char *)message, messageLength, sig, &sig_len, (char *)[path UTF8String]); 78 | //签名成功,需要给签名字符串base64编码和UrlEncode,该两个方法也可以根据情况替换为自己函数 79 | if (ret == 1) { 80 | NSString * base64String = base64StringFromData([NSData dataWithBytes:sig length:sig_len]); 81 | //NSData * UTF8Data = [base64String dataUsingEncoding:NSUTF8StringEncoding]; 82 | signedString = [self urlEncodedString:base64String]; 83 | } 84 | 85 | free(sig); 86 | return signedString; 87 | } 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/Util/RSADataVerifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // RSADataVerifier.h 3 | // SafepayService 4 | // 5 | // Created by wenbi on 11-4-11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DataVerifier.h" 11 | 12 | @interface RSADataVerifier : NSObject { 13 | NSString *_publicKey; 14 | } 15 | 16 | - (id)initWithPublicKey:(NSString *)publicKey; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/Util/RSADataVerifier.m: -------------------------------------------------------------------------------- 1 | // 2 | // AlixPayDataVerifier.m 3 | // SafepayService 4 | // 5 | // Created by wenbi on 11-4-11. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "RSADataVerifier.h" 10 | #import "openssl_wrapper.h" 11 | #import "NSDataEx.h" 12 | #import "base64.h" 13 | 14 | @implementation RSADataVerifier 15 | 16 | - (id)initWithPublicKey:(NSString *)publicKey { 17 | if (self = [super init]) { 18 | _publicKey = [publicKey copy]; 19 | } 20 | return self; 21 | } 22 | 23 | 24 | - (NSString *)formatPublicKey:(NSString *)publicKey { 25 | 26 | NSMutableString *result = [NSMutableString string]; 27 | 28 | [result appendString:@"-----BEGIN PUBLIC KEY-----\n"]; 29 | 30 | int count = 0; 31 | 32 | for (int i = 0; i < [publicKey length]; ++i) { 33 | 34 | unichar c = [publicKey characterAtIndex:i]; 35 | if (c == '\n' || c == '\r') { 36 | continue; 37 | } 38 | [result appendFormat:@"%c", c]; 39 | if (++count == 76) { 40 | [result appendString:@"\n"]; 41 | count = 0; 42 | } 43 | 44 | } 45 | 46 | [result appendString:@"\n-----END PUBLIC KEY-----\n"]; 47 | 48 | return result; 49 | 50 | } 51 | 52 | - (NSString *)algorithmName { 53 | return @"RSA"; 54 | } 55 | 56 | - (BOOL)verifyString:(NSString *)string withSign:(NSString *)signString { 57 | 58 | // const char *message = [string cStringUsingEncoding:NSUTF8StringEncoding]; 59 | // int messageLength = strlen(message); 60 | // 61 | // unsigned char *signature = (unsigned char *)[signString UTF8String]; 62 | // unsigned int signatureLength = (unsigned int)strlen((char *)signature); 63 | // char *encodedPath = (char *)[_pathForPEMFile cStringUsingEncoding:NSUTF8StringEncoding]; 64 | 65 | NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; 66 | NSString *path = [documentPath stringByAppendingPathComponent:@"AlixPay-RSAPublicKey"]; 67 | 68 | // 69 | // 把密钥写入文件 70 | // 71 | NSString *formatKey = [self formatPublicKey:_publicKey]; 72 | [formatKey writeToFile:path atomically:YES encoding:NSUTF8StringEncoding error:nil]; 73 | 74 | BOOL ret; 75 | rsaVerifyString(string, signString, path, &ret); 76 | return ret; 77 | 78 | } 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/Util/base64.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file base64.h 3 | */ 4 | #ifndef XYSSL_BASE64_H 5 | #define XYSSL_BASE64_H 6 | 7 | #define XYSSL_ERR_BASE64_INVALID_CHARACTER -0x0012 8 | #define XYSSL_ERR_BASE64_BUFFER_TOO_SMALL -0x0010 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | /** 15 | * \brief Encode a buffer into base64 format 16 | * 17 | * \param dst destination buffer 18 | * \param dlen size of the buffer 19 | * \param src source buffer 20 | * \param slen amount of data to be encoded 21 | * 22 | * \return 0 if successful, or XYSSL_ERR_BASE64_BUFFER_TOO_SMALL. 23 | * *dlen is always updated to reflect the amount 24 | * of data that has (or would have) been written. 25 | * 26 | * \note Call this function with *dlen = 0 to obtain the 27 | * required buffer size in *dlen 28 | */ 29 | int base64_encode( unsigned char *dst, int *dlen, 30 | unsigned char *src, int slen ); 31 | 32 | /** 33 | * \brief Decode a base64-formatted buffer 34 | * 35 | * \param dst destination buffer 36 | * \param dlen size of the buffer 37 | * \param src source buffer 38 | * \param slen amount of data to be decoded 39 | * 40 | * \return 0 if successful, XYSSL_ERR_BASE64_BUFFER_TOO_SMALL, or 41 | * XYSSL_ERR_BASE64_INVALID_DATA if the input data is not 42 | * correct. *dlen is always updated to reflect the amount 43 | * of data that has (or would have) been written. 44 | * 45 | * \note Call this function with *dlen = 0 to obtain the 46 | * required buffer size in *dlen 47 | */ 48 | int base64_decode( unsigned char *dst, int *dlen, 49 | unsigned char *src, int slen ); 50 | 51 | /** 52 | * \brief Checkup routine 53 | * 54 | * \return 0 if successful, or 1 if the test failed 55 | */ 56 | int base64_self_test( int verbose ); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | 63 | @interface Base64 : NSObject 64 | 65 | + (NSData *)decodeString:(NSString *)string; 66 | 67 | @end 68 | 69 | 70 | #endif /* base64.h */ 71 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/Util/openssl_wrapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // openssl_wrapper.h 3 | // ThirdDemoApp 4 | // 5 | // Created by Xu Hanjie on 11-1-20. 6 | // Copyright 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | int rsa_sign_with_private_key_pem(char *message, int message_length 10 | , unsigned char *signature, unsigned int *signature_length 11 | , char *private_key_file_path); 12 | int rsa_verify_with_public_key_pem(char *message, int message_length 13 | , unsigned char *signature, unsigned int signature_length 14 | , char *public_key_file_path); 15 | 16 | NSString *base64StringFromData(NSData *signature); 17 | NSData *dataFromBase64String(NSString *base64String); 18 | NSString *rsaSignString(NSString *stringToSign, NSString *privateKeyFilePath, BOOL *signSuccess); 19 | void rsaVerifyString(NSString *stringToVerify, NSString *signature, NSString *publicKeyFilePath, BOOL *verifySuccess); 20 | NSString *formattedPEMString(NSString *originalString); 21 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/libcrypto.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codewpf/PayDemo/c55438f182b919f491f3a0bbd4da6dda6f86fd51/Helper/AlipaySDK/libcrypto.a -------------------------------------------------------------------------------- /Helper/AlipaySDK/libssl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codewpf/PayDemo/c55438f182b919f491f3a0bbd4da6dda6f86fd51/Helper/AlipaySDK/libssl.a -------------------------------------------------------------------------------- /Helper/AlipaySDK/openssl/cmac.h: -------------------------------------------------------------------------------- 1 | /* crypto/cmac/cmac.h */ 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 3 | * project. 4 | */ 5 | /* ==================================================================== 6 | * Copyright (c) 2010 The OpenSSL Project. All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * 3. All advertising materials mentioning features or use of this 21 | * software must display the following acknowledgment: 22 | * "This product includes software developed by the OpenSSL Project 23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 24 | * 25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 26 | * endorse or promote products derived from this software without 27 | * prior written permission. For written permission, please contact 28 | * licensing@OpenSSL.org. 29 | * 30 | * 5. Products derived from this software may not be called "OpenSSL" 31 | * nor may "OpenSSL" appear in their names without prior written 32 | * permission of the OpenSSL Project. 33 | * 34 | * 6. Redistributions of any form whatsoever must retain the following 35 | * acknowledgment: 36 | * "This product includes software developed by the OpenSSL Project 37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 38 | * 39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 50 | * OF THE POSSIBILITY OF SUCH DAMAGE. 51 | * ==================================================================== 52 | */ 53 | 54 | 55 | #ifndef HEADER_CMAC_H 56 | #define HEADER_CMAC_H 57 | 58 | #ifdef __cplusplus 59 | extern "C" { 60 | #endif 61 | 62 | #include 63 | 64 | /* Opaque */ 65 | typedef struct CMAC_CTX_st CMAC_CTX; 66 | 67 | CMAC_CTX *CMAC_CTX_new(void); 68 | void CMAC_CTX_cleanup(CMAC_CTX *ctx); 69 | void CMAC_CTX_free(CMAC_CTX *ctx); 70 | EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx); 71 | int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in); 72 | 73 | int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen, 74 | const EVP_CIPHER *cipher, ENGINE *impl); 75 | int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen); 76 | int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen); 77 | int CMAC_resume(CMAC_CTX *ctx); 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | #endif 83 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/openssl/comp.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef HEADER_COMP_H 3 | #define HEADER_COMP_H 4 | 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | typedef struct comp_ctx_st COMP_CTX; 12 | 13 | typedef struct comp_method_st 14 | { 15 | int type; /* NID for compression library */ 16 | const char *name; /* A text string to identify the library */ 17 | int (*init)(COMP_CTX *ctx); 18 | void (*finish)(COMP_CTX *ctx); 19 | int (*compress)(COMP_CTX *ctx, 20 | unsigned char *out, unsigned int olen, 21 | unsigned char *in, unsigned int ilen); 22 | int (*expand)(COMP_CTX *ctx, 23 | unsigned char *out, unsigned int olen, 24 | unsigned char *in, unsigned int ilen); 25 | /* The following two do NOTHING, but are kept for backward compatibility */ 26 | long (*ctrl)(void); 27 | long (*callback_ctrl)(void); 28 | } COMP_METHOD; 29 | 30 | struct comp_ctx_st 31 | { 32 | COMP_METHOD *meth; 33 | unsigned long compress_in; 34 | unsigned long compress_out; 35 | unsigned long expand_in; 36 | unsigned long expand_out; 37 | 38 | CRYPTO_EX_DATA ex_data; 39 | }; 40 | 41 | 42 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); 43 | void COMP_CTX_free(COMP_CTX *ctx); 44 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, 45 | unsigned char *in, int ilen); 46 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, 47 | unsigned char *in, int ilen); 48 | COMP_METHOD *COMP_rle(void ); 49 | COMP_METHOD *COMP_zlib(void ); 50 | void COMP_zlib_cleanup(void); 51 | 52 | #ifdef HEADER_BIO_H 53 | #ifdef ZLIB 54 | BIO_METHOD *BIO_f_zlib(void); 55 | #endif 56 | #endif 57 | 58 | /* BEGIN ERROR CODES */ 59 | /* The following lines are auto generated by the script mkerr.pl. Any changes 60 | * made after this point may be overwritten when the script is next run. 61 | */ 62 | void ERR_load_COMP_strings(void); 63 | 64 | /* Error codes for the COMP functions. */ 65 | 66 | /* Function codes. */ 67 | #define COMP_F_BIO_ZLIB_FLUSH 99 68 | #define COMP_F_BIO_ZLIB_NEW 100 69 | #define COMP_F_BIO_ZLIB_READ 101 70 | #define COMP_F_BIO_ZLIB_WRITE 102 71 | 72 | /* Reason codes. */ 73 | #define COMP_R_ZLIB_DEFLATE_ERROR 99 74 | #define COMP_R_ZLIB_INFLATE_ERROR 100 75 | #define COMP_R_ZLIB_NOT_SUPPORTED 101 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | #endif 81 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/openssl/conf_api.h: -------------------------------------------------------------------------------- 1 | /* conf_api.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_CONF_API_H 60 | #define HEADER_CONF_API_H 61 | 62 | #include 63 | #include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | /* Up until OpenSSL 0.9.5a, this was new_section */ 70 | CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); 71 | /* Up until OpenSSL 0.9.5a, this was get_section */ 72 | CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); 73 | /* Up until OpenSSL 0.9.5a, this was CONF_get_section */ 74 | STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, 75 | const char *section); 76 | 77 | int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); 78 | char *_CONF_get_string(const CONF *conf, const char *section, 79 | const char *name); 80 | long _CONF_get_number(const CONF *conf, const char *section, const char *name); 81 | 82 | int _CONF_new_data(CONF *conf); 83 | void _CONF_free_data(CONF *conf); 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | #endif 89 | 90 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/openssl/ebcdic.h: -------------------------------------------------------------------------------- 1 | /* crypto/ebcdic.h */ 2 | 3 | #ifndef HEADER_EBCDIC_H 4 | #define HEADER_EBCDIC_H 5 | 6 | #include 7 | 8 | /* Avoid name clashes with other applications */ 9 | #define os_toascii _openssl_os_toascii 10 | #define os_toebcdic _openssl_os_toebcdic 11 | #define ebcdic2ascii _openssl_ebcdic2ascii 12 | #define ascii2ebcdic _openssl_ascii2ebcdic 13 | 14 | extern const unsigned char os_toascii[256]; 15 | extern const unsigned char os_toebcdic[256]; 16 | void *ebcdic2ascii(void *dest, const void *srce, size_t count); 17 | void *ascii2ebcdic(void *dest, const void *srce, size_t count); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/openssl/mdc2.h: -------------------------------------------------------------------------------- 1 | /* crypto/mdc2/mdc2.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_MDC2_H 60 | #define HEADER_MDC2_H 61 | 62 | #include 63 | 64 | #ifdef __cplusplus 65 | extern "C" { 66 | #endif 67 | 68 | #ifdef OPENSSL_NO_MDC2 69 | #error MDC2 is disabled. 70 | #endif 71 | 72 | #define MDC2_BLOCK 8 73 | #define MDC2_DIGEST_LENGTH 16 74 | 75 | typedef struct mdc2_ctx_st 76 | { 77 | unsigned int num; 78 | unsigned char data[MDC2_BLOCK]; 79 | DES_cblock h,hh; 80 | int pad_type; /* either 1 or 2, default 1 */ 81 | } MDC2_CTX; 82 | 83 | 84 | #ifdef OPENSSL_FIPS 85 | int private_MDC2_Init(MDC2_CTX *c); 86 | #endif 87 | int MDC2_Init(MDC2_CTX *c); 88 | int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len); 89 | int MDC2_Final(unsigned char *md, MDC2_CTX *c); 90 | unsigned char *MDC2(const unsigned char *d, size_t n, 91 | unsigned char *md); 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | 97 | #endif 98 | 99 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/openssl/opensslv.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_OPENSSLV_H 2 | #define HEADER_OPENSSLV_H 3 | 4 | /* Numeric release version identifier: 5 | * MNNFFPPS: major minor fix patch status 6 | * The status nibble has one of the values 0 for development, 1 to e for betas 7 | * 1 to 14, and f for release. The patch level is exactly that. 8 | * For example: 9 | * 0.9.3-dev 0x00903000 10 | * 0.9.3-beta1 0x00903001 11 | * 0.9.3-beta2-dev 0x00903002 12 | * 0.9.3-beta2 0x00903002 (same as ...beta2-dev) 13 | * 0.9.3 0x0090300f 14 | * 0.9.3a 0x0090301f 15 | * 0.9.4 0x0090400f 16 | * 1.2.3z 0x102031af 17 | * 18 | * For continuity reasons (because 0.9.5 is already out, and is coded 19 | * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level 20 | * part is slightly different, by setting the highest bit. This means 21 | * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start 22 | * with 0x0090600S... 23 | * 24 | * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.) 25 | * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for 26 | * major minor fix final patch/beta) 27 | */ 28 | #define OPENSSL_VERSION_NUMBER 0x1000108fL 29 | #ifdef OPENSSL_FIPS 30 | #define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1h-fips 5 Jun 2014" 31 | #else 32 | #define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1h 5 Jun 2014" 33 | #endif 34 | #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT 35 | 36 | 37 | /* The macros below are to be used for shared library (.so, .dll, ...) 38 | * versioning. That kind of versioning works a bit differently between 39 | * operating systems. The most usual scheme is to set a major and a minor 40 | * number, and have the runtime loader check that the major number is equal 41 | * to what it was at application link time, while the minor number has to 42 | * be greater or equal to what it was at application link time. With this 43 | * scheme, the version number is usually part of the file name, like this: 44 | * 45 | * libcrypto.so.0.9 46 | * 47 | * Some unixen also make a softlink with the major verson number only: 48 | * 49 | * libcrypto.so.0 50 | * 51 | * On Tru64 and IRIX 6.x it works a little bit differently. There, the 52 | * shared library version is stored in the file, and is actually a series 53 | * of versions, separated by colons. The rightmost version present in the 54 | * library when linking an application is stored in the application to be 55 | * matched at run time. When the application is run, a check is done to 56 | * see if the library version stored in the application matches any of the 57 | * versions in the version string of the library itself. 58 | * This version string can be constructed in any way, depending on what 59 | * kind of matching is desired. However, to implement the same scheme as 60 | * the one used in the other unixen, all compatible versions, from lowest 61 | * to highest, should be part of the string. Consecutive builds would 62 | * give the following versions strings: 63 | * 64 | * 3.0 65 | * 3.0:3.1 66 | * 3.0:3.1:3.2 67 | * 4.0 68 | * 4.0:4.1 69 | * 70 | * Notice how version 4 is completely incompatible with version, and 71 | * therefore give the breach you can see. 72 | * 73 | * There may be other schemes as well that I haven't yet discovered. 74 | * 75 | * So, here's the way it works here: first of all, the library version 76 | * number doesn't need at all to match the overall OpenSSL version. 77 | * However, it's nice and more understandable if it actually does. 78 | * The current library version is stored in the macro SHLIB_VERSION_NUMBER, 79 | * which is just a piece of text in the format "M.m.e" (Major, minor, edit). 80 | * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways, 81 | * we need to keep a history of version numbers, which is done in the 82 | * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and 83 | * should only keep the versions that are binary compatible with the current. 84 | */ 85 | #define SHLIB_VERSION_HISTORY "" 86 | #define SHLIB_VERSION_NUMBER "1.0.0" 87 | 88 | 89 | #endif /* HEADER_OPENSSLV_H */ 90 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/openssl/pem2.h: -------------------------------------------------------------------------------- 1 | /* ==================================================================== 2 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * 3. All advertising materials mentioning features or use of this 17 | * software must display the following acknowledgment: 18 | * "This product includes software developed by the OpenSSL Project 19 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 20 | * 21 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 22 | * endorse or promote products derived from this software without 23 | * prior written permission. For written permission, please contact 24 | * licensing@OpenSSL.org. 25 | * 26 | * 5. Products derived from this software may not be called "OpenSSL" 27 | * nor may "OpenSSL" appear in their names without prior written 28 | * permission of the OpenSSL Project. 29 | * 30 | * 6. Redistributions of any form whatsoever must retain the following 31 | * acknowledgment: 32 | * "This product includes software developed by the OpenSSL Project 33 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 34 | * 35 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 36 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 37 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 38 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 39 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 40 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 41 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 42 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 43 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 44 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 45 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 46 | * OF THE POSSIBILITY OF SUCH DAMAGE. 47 | * ==================================================================== 48 | * 49 | * This product includes cryptographic software written by Eric Young 50 | * (eay@cryptsoft.com). This product includes software written by Tim 51 | * Hudson (tjh@cryptsoft.com). 52 | * 53 | */ 54 | 55 | /* 56 | * This header only exists to break a circular dependency between pem and err 57 | * Ben 30 Jan 1999. 58 | */ 59 | 60 | #ifdef __cplusplus 61 | extern "C" { 62 | #endif 63 | 64 | #ifndef HEADER_PEM_H 65 | void ERR_load_PEM_strings(void); 66 | #endif 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/openssl/pqueue.h: -------------------------------------------------------------------------------- 1 | /* crypto/pqueue/pqueue.h */ 2 | /* 3 | * DTLS implementation written by Nagendra Modadugu 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. 5 | */ 6 | /* ==================================================================== 7 | * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in 18 | * the documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * 3. All advertising materials mentioning features or use of this 22 | * software must display the following acknowledgment: 23 | * "This product includes software developed by the OpenSSL Project 24 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 25 | * 26 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 27 | * endorse or promote products derived from this software without 28 | * prior written permission. For written permission, please contact 29 | * openssl-core@OpenSSL.org. 30 | * 31 | * 5. Products derived from this software may not be called "OpenSSL" 32 | * nor may "OpenSSL" appear in their names without prior written 33 | * permission of the OpenSSL Project. 34 | * 35 | * 6. Redistributions of any form whatsoever must retain the following 36 | * acknowledgment: 37 | * "This product includes software developed by the OpenSSL Project 38 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 39 | * 40 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 41 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 43 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 44 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 46 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 47 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 49 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 50 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51 | * OF THE POSSIBILITY OF SUCH DAMAGE. 52 | * ==================================================================== 53 | * 54 | * This product includes cryptographic software written by Eric Young 55 | * (eay@cryptsoft.com). This product includes software written by Tim 56 | * Hudson (tjh@cryptsoft.com). 57 | * 58 | */ 59 | 60 | #ifndef HEADER_PQUEUE_H 61 | #define HEADER_PQUEUE_H 62 | 63 | #include 64 | #include 65 | #include 66 | 67 | typedef struct _pqueue *pqueue; 68 | 69 | typedef struct _pitem 70 | { 71 | unsigned char priority[8]; /* 64-bit value in big-endian encoding */ 72 | void *data; 73 | struct _pitem *next; 74 | } pitem; 75 | 76 | typedef struct _pitem *piterator; 77 | 78 | pitem *pitem_new(unsigned char *prio64be, void *data); 79 | void pitem_free(pitem *item); 80 | 81 | pqueue pqueue_new(void); 82 | void pqueue_free(pqueue pq); 83 | 84 | pitem *pqueue_insert(pqueue pq, pitem *item); 85 | pitem *pqueue_peek(pqueue pq); 86 | pitem *pqueue_pop(pqueue pq); 87 | pitem *pqueue_find(pqueue pq, unsigned char *prio64be); 88 | pitem *pqueue_iterator(pqueue pq); 89 | pitem *pqueue_next(piterator *iter); 90 | 91 | void pqueue_print(pqueue pq); 92 | int pqueue_size(pqueue pq); 93 | 94 | #endif /* ! HEADER_PQUEUE_H */ 95 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/openssl/rc4.h: -------------------------------------------------------------------------------- 1 | /* crypto/rc4/rc4.h */ 2 | /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_RC4_H 60 | #define HEADER_RC4_H 61 | 62 | #include /* OPENSSL_NO_RC4, RC4_INT */ 63 | #ifdef OPENSSL_NO_RC4 64 | #error RC4 is disabled. 65 | #endif 66 | 67 | #include 68 | 69 | #ifdef __cplusplus 70 | extern "C" { 71 | #endif 72 | 73 | typedef struct rc4_key_st 74 | { 75 | RC4_INT x,y; 76 | RC4_INT data[256]; 77 | } RC4_KEY; 78 | 79 | 80 | const char *RC4_options(void); 81 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); 82 | void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); 83 | void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, 84 | unsigned char *outdata); 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/openssl/ssl23.h: -------------------------------------------------------------------------------- 1 | /* ssl/ssl23.h */ 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 | * All rights reserved. 4 | * 5 | * This package is an SSL implementation written 6 | * by Eric Young (eay@cryptsoft.com). 7 | * The implementation was written so as to conform with Netscapes SSL. 8 | * 9 | * This library is free for commercial and non-commercial use as long as 10 | * the following conditions are aheared to. The following conditions 11 | * apply to all code found in this distribution, be it the RC4, RSA, 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 13 | * included with this distribution is covered by the same copyright terms 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 15 | * 16 | * Copyright remains Eric Young's, and as such any Copyright notices in 17 | * the code are not to be removed. 18 | * If this package is used in a product, Eric Young should be given attribution 19 | * as the author of the parts of the library used. 20 | * This can be in the form of a textual message at program startup or 21 | * in documentation (online or textual) provided with the package. 22 | * 23 | * Redistribution and use in source and binary forms, with or without 24 | * modification, are permitted provided that the following conditions 25 | * are met: 26 | * 1. Redistributions of source code must retain the copyright 27 | * notice, this list of conditions and the following disclaimer. 28 | * 2. Redistributions in binary form must reproduce the above copyright 29 | * notice, this list of conditions and the following disclaimer in the 30 | * documentation and/or other materials provided with the distribution. 31 | * 3. All advertising materials mentioning features or use of this software 32 | * must display the following acknowledgement: 33 | * "This product includes cryptographic software written by 34 | * Eric Young (eay@cryptsoft.com)" 35 | * The word 'cryptographic' can be left out if the rouines from the library 36 | * being used are not cryptographic related :-). 37 | * 4. If you include any Windows specific code (or a derivative thereof) from 38 | * the apps directory (application code) you must include an acknowledgement: 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 40 | * 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 51 | * SUCH DAMAGE. 52 | * 53 | * The licence and distribution terms for any publically available version or 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be 55 | * copied and put under another distribution licence 56 | * [including the GNU Public Licence.] 57 | */ 58 | 59 | #ifndef HEADER_SSL23_H 60 | #define HEADER_SSL23_H 61 | 62 | #ifdef __cplusplus 63 | extern "C" { 64 | #endif 65 | 66 | /*client */ 67 | /* write to server */ 68 | #define SSL23_ST_CW_CLNT_HELLO_A (0x210|SSL_ST_CONNECT) 69 | #define SSL23_ST_CW_CLNT_HELLO_B (0x211|SSL_ST_CONNECT) 70 | /* read from server */ 71 | #define SSL23_ST_CR_SRVR_HELLO_A (0x220|SSL_ST_CONNECT) 72 | #define SSL23_ST_CR_SRVR_HELLO_B (0x221|SSL_ST_CONNECT) 73 | 74 | /* server */ 75 | /* read from client */ 76 | #define SSL23_ST_SR_CLNT_HELLO_A (0x210|SSL_ST_ACCEPT) 77 | #define SSL23_ST_SR_CLNT_HELLO_B (0x211|SSL_ST_ACCEPT) 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | #endif 83 | 84 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/openssl/ui_compat.h: -------------------------------------------------------------------------------- 1 | /* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */ 2 | /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL 3 | * project 2001. 4 | */ 5 | /* ==================================================================== 6 | * Copyright (c) 2001 The OpenSSL Project. All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * 3. All advertising materials mentioning features or use of this 21 | * software must display the following acknowledgment: 22 | * "This product includes software developed by the OpenSSL Project 23 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 24 | * 25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 26 | * endorse or promote products derived from this software without 27 | * prior written permission. For written permission, please contact 28 | * openssl-core@openssl.org. 29 | * 30 | * 5. Products derived from this software may not be called "OpenSSL" 31 | * nor may "OpenSSL" appear in their names without prior written 32 | * permission of the OpenSSL Project. 33 | * 34 | * 6. Redistributions of any form whatsoever must retain the following 35 | * acknowledgment: 36 | * "This product includes software developed by the OpenSSL Project 37 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 38 | * 39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 50 | * OF THE POSSIBILITY OF SUCH DAMAGE. 51 | * ==================================================================== 52 | * 53 | * This product includes cryptographic software written by Eric Young 54 | * (eay@cryptsoft.com). This product includes software written by Tim 55 | * Hudson (tjh@cryptsoft.com). 56 | * 57 | */ 58 | 59 | #ifndef HEADER_UI_COMPAT_H 60 | #define HEADER_UI_COMPAT_H 61 | 62 | #include 63 | #include 64 | 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | /* The following functions were previously part of the DES section, 70 | and are provided here for backward compatibility reasons. */ 71 | 72 | #define des_read_pw_string(b,l,p,v) \ 73 | _ossl_old_des_read_pw_string((b),(l),(p),(v)) 74 | #define des_read_pw(b,bf,s,p,v) \ 75 | _ossl_old_des_read_pw((b),(bf),(s),(p),(v)) 76 | 77 | int _ossl_old_des_read_pw_string(char *buf,int length,const char *prompt,int verify); 78 | int _ossl_old_des_read_pw(char *buf,char *buff,int size,const char *prompt,int verify); 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | #endif 84 | -------------------------------------------------------------------------------- /Helper/AlipaySDK/openssl/whrlpool.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_WHRLPOOL_H 2 | #define HEADER_WHRLPOOL_H 3 | 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define WHIRLPOOL_DIGEST_LENGTH (512/8) 12 | #define WHIRLPOOL_BBLOCK 512 13 | #define WHIRLPOOL_COUNTER (256/8) 14 | 15 | typedef struct { 16 | union { 17 | unsigned char c[WHIRLPOOL_DIGEST_LENGTH]; 18 | /* double q is here to ensure 64-bit alignment */ 19 | double q[WHIRLPOOL_DIGEST_LENGTH/sizeof(double)]; 20 | } H; 21 | unsigned char data[WHIRLPOOL_BBLOCK/8]; 22 | unsigned int bitoff; 23 | size_t bitlen[WHIRLPOOL_COUNTER/sizeof(size_t)]; 24 | } WHIRLPOOL_CTX; 25 | 26 | #ifndef OPENSSL_NO_WHIRLPOOL 27 | #ifdef OPENSSL_FIPS 28 | int private_WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 29 | #endif 30 | int WHIRLPOOL_Init (WHIRLPOOL_CTX *c); 31 | int WHIRLPOOL_Update (WHIRLPOOL_CTX *c,const void *inp,size_t bytes); 32 | void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c,const void *inp,size_t bits); 33 | int WHIRLPOOL_Final (unsigned char *md,WHIRLPOOL_CTX *c); 34 | unsigned char *WHIRLPOOL(const void *inp,size_t bytes,unsigned char *md); 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Helper/JSONFommater/NSData+JSONCategoriesData.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+JSONCategoriesData.h 3 | // tcpoctest 4 | // 5 | // Created by WangQing on 13-12-31. 6 | // Copyright (c) 2013年 gump. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSData (JSONCategoriesData) 12 | 13 | - (id)JSONValue; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Helper/JSONFommater/NSData+JSONCategoriesData.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+JSONCategoriesData.m 3 | // tcpoctest 4 | // 5 | // Created by WangQing on 13-12-31. 6 | // Copyright (c) 2013年 gump. All rights reserved. 7 | // 8 | 9 | #import "NSData+JSONCategoriesData.h" 10 | 11 | @implementation NSData (JSONCategoriesData) 12 | 13 | - (id)JSONValue { 14 | __autoreleasing NSError* error = nil; 15 | id result = [NSJSONSerialization JSONObjectWithData:self options:kNilOptions error:&error]; 16 | if (error != nil) return nil; 17 | return result; 18 | } 19 | @end 20 | -------------------------------------------------------------------------------- /Helper/JSONFommater/NSString+JSONCategoriesString.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+JSONCategoriesString.h 3 | // tcpoctest 4 | // 5 | // Created by WangQing on 13-12-31. 6 | // Copyright (c) 2013年 gump. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (JSONCategoriesString) 12 | 13 | - (id)JSONValue; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Helper/JSONFommater/NSString+JSONCategoriesString.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+JSONCategoriesString.m 3 | // tcpoctest 4 | // 5 | // Created by WangQing on 13-12-31. 6 | // Copyright (c) 2013年 gump. All rights reserved. 7 | // 8 | 9 | #import "NSString+JSONCategoriesString.h" 10 | 11 | @implementation NSString (JSONCategoriesString) 12 | 13 | -(id)JSONValue; 14 | { 15 | NSData* data = [self dataUsingEncoding:NSUTF8StringEncoding]; 16 | __autoreleasing NSError* error = nil; 17 | id result = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error]; 18 | if (error != nil) return nil; 19 | return result; 20 | } 21 | 22 | 23 | 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Helper/WeChatSDK/WXApi.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXApi.h 3 | // 所有Api接口 4 | // 5 | // Created by Wechat on 12-2-28. 6 | // Copyright (c) 2012年 Tencent. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "WXApiObject.h" 11 | 12 | 13 | #pragma mark - WXApiDelegate 14 | /*! @brief 接收并处理来自微信终端程序的事件消息 15 | * 16 | * 接收并处理来自微信终端程序的事件消息,期间微信界面会切换到第三方应用程序。 17 | * WXApiDelegate 会在handleOpenURL:delegate:中使用并触发。 18 | */ 19 | @protocol WXApiDelegate 20 | @optional 21 | 22 | /*! @brief 收到一个来自微信的请求,第三方应用程序处理完后调用sendResp向微信发送结果 23 | * 24 | * 收到一个来自微信的请求,异步处理完成后必须调用sendResp发送处理结果给微信。 25 | * 可能收到的请求有GetMessageFromWXReq、ShowMessageFromWXReq等。 26 | * @param req 具体请求内容,是自动释放的 27 | */ 28 | -(void) onReq:(BaseReq*)req; 29 | 30 | 31 | 32 | /*! @brief 发送一个sendReq后,收到微信的回应 33 | * 34 | * 收到一个来自微信的处理结果。调用一次sendReq后会收到onResp。 35 | * 可能收到的处理结果有SendMessageToWXResp、SendAuthResp等。 36 | * @param resp具体的回应内容,是自动释放的 37 | */ 38 | -(void) onResp:(BaseResp*)resp; 39 | 40 | @end 41 | 42 | 43 | 44 | #pragma mark - WXApi 45 | 46 | /*! @brief 微信Api接口函数类 47 | * 48 | * 该类封装了微信终端SDK的所有接口 49 | */ 50 | @interface WXApi : NSObject 51 | 52 | /*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。 53 | * 54 | * 需要在每次启动第三方应用程序时调用。第一次调用后,会在微信的可用应用列表中出现。 55 | * iOS7及以上系统需要调起一次微信才会出现在微信的可用应用列表中。 56 | * @attention 请保证在主线程中调用此函数 57 | * @param appid 微信开发者ID 58 | * @return 成功返回YES,失败返回NO。 59 | */ 60 | +(BOOL) registerApp:(NSString *)appid; 61 | 62 | 63 | 64 | /*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。 65 | * 66 | * 需要在每次启动第三方应用程序时调用。第一次调用后,会在微信的可用应用列表中出现。 67 | * @see registerApp 68 | * @param appid 微信开发者ID 69 | * @param appdesc 应用附加信息,长度不超过1024字节 70 | * @return 成功返回YES,失败返回NO。 71 | */ 72 | +(BOOL) registerApp:(NSString *)appid withDescription:(NSString *)appdesc; 73 | 74 | 75 | 76 | /*! @brief 处理微信通过URL启动App时传递的数据 77 | * 78 | * 需要在 application:openURL:sourceApplication:annotation:或者application:handleOpenURL中调用。 79 | * @param url 微信启动第三方应用时传递过来的URL 80 | * @param delegate WXApiDelegate对象,用来接收微信触发的消息。 81 | * @return 成功返回YES,失败返回NO。 82 | */ 83 | +(BOOL) handleOpenURL:(NSURL *) url delegate:(id) delegate; 84 | 85 | 86 | 87 | /*! @brief 检查微信是否已被用户安装 88 | * 89 | * @return 微信已安装返回YES,未安装返回NO。 90 | */ 91 | +(BOOL) isWXAppInstalled; 92 | 93 | 94 | 95 | /*! @brief 判断当前微信的版本是否支持OpenApi 96 | * 97 | * @return 支持返回YES,不支持返回NO。 98 | */ 99 | +(BOOL) isWXAppSupportApi; 100 | 101 | 102 | 103 | /*! @brief 获取微信的itunes安装地址 104 | * 105 | * @return 微信的安装地址字符串。 106 | */ 107 | +(NSString *) getWXAppInstallUrl; 108 | 109 | 110 | 111 | /*! @brief 获取当前微信SDK的版本号 112 | * 113 | * @return 返回当前微信SDK的版本号 114 | */ 115 | +(NSString *) getApiVersion; 116 | 117 | 118 | 119 | /*! @brief 打开微信 120 | * 121 | * @return 成功返回YES,失败返回NO。 122 | */ 123 | +(BOOL) openWXApp; 124 | 125 | 126 | 127 | /*! @brief 发送请求到微信,等待微信返回onResp 128 | * 129 | * 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持以下类型 130 | * SendAuthReq、SendMessageToWXReq、PayReq等。 131 | * @param req 具体的发送请求,在调用函数后,请自己释放。 132 | * @return 成功返回YES,失败返回NO。 133 | */ 134 | +(BOOL) sendReq:(BaseReq*)req; 135 | 136 | /*! @brief 发送Auth请求到微信,支持用户没安装微信,等待微信返回onResp 137 | * 138 | * 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持SendAuthReq类型。 139 | * @param req 具体的发送请求,在调用函数后,请自己释放。 140 | * @param viewController 当前界面对象。 141 | * @param delegate WXApiDelegate对象,用来接收微信触发的消息。 142 | * @return 成功返回YES,失败返回NO。 143 | */ 144 | +(BOOL) sendAuthReq:(SendAuthReq*) req viewController : (UIViewController*) viewController delegate:(id) delegate; 145 | 146 | 147 | /*! @brief 收到微信onReq的请求,发送对应的应答给微信,并切换到微信界面 148 | * 149 | * 函数调用后,会切换到微信的界面。第三方应用程序收到微信onReq的请求,异步处理该请求,完成后必须调用该函数。可能发送的相应有 150 | * GetMessageFromWXResp、ShowMessageFromWXResp等。 151 | * @param resp 具体的应答内容,调用函数后,请自己释放 152 | * @return 成功返回YES,失败返回NO。 153 | */ 154 | +(BOOL) sendResp:(BaseResp*)resp; 155 | 156 | 157 | @end 158 | -------------------------------------------------------------------------------- /Helper/WeChatSDK/WXHelper/Constant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Constant.h 3 | // SDKSample 4 | // 5 | // Created by Jeason on 15/7/14. 6 | // 7 | // 8 | 9 | #ifndef SDKSample_Constant_h 10 | #define SDKSample_Constant_h 11 | 12 | #define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1] 13 | 14 | #define TIPSLABEL_TAG 10086 15 | #define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width 16 | #define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height 17 | #define BUFFER_SIZE 1024 * 100 18 | 19 | static const int kHeadViewHeight = 135; 20 | static const int kSceneViewHeight = 100; 21 | 22 | static NSString *kTextMessage = @"人文的东西并不是体现在你看得到的方面,它更多的体现在你看不到的那些方面,它会影响每一个功能,这才是最本质的。但是,对这点可能很多人没有思考过,以为人文的东西就是我们搞一个很小清新的图片什么的。”综合来看,人文的东西其实是贯穿整个产品的脉络,或者说是它的灵魂所在。"; 23 | 24 | static NSString *kImageTagName = @"WECHAT_TAG_JUMP_APP"; 25 | static NSString *kMessageExt = @"这是第三方带的测试字段"; 26 | static NSString *kMessageAction = @"dotalist"; 27 | 28 | static NSString *kLinkURL = @"http://tech.qq.com/zt2012/tmtdecode/252.htm"; 29 | static NSString *kLinkTagName = @"WECHAT_TAG_JUMP_SHOWRANK"; 30 | static NSString *kLinkTitle = @"专访张小龙:产品之上的世界观"; 31 | static NSString *kLinkDescription = @"微信的平台化发展方向是否真的会让这个原本简洁的产品变得臃肿?在国际化发展方向上,微信面临的问题真的是文化差异壁垒吗?腾讯高级副总裁、微信产品负责人张小龙给出了自己的回复。"; 32 | 33 | static NSString *kMusicURL = @"http://y.qq.com/i/song.html#p=7B22736F6E675F4E616D65223A22E4B880E697A0E68980E69C89222C22736F6E675F5761704C69766555524C223A22687474703A2F2F74736D7573696334382E74632E71712E636F6D2F586B30305156342F4141414130414141414E5430577532394D7A59344D7A63774D4C6735586A4C517747335A50676F47443864704151526643473444442F4E653765776B617A733D2F31303130333334372E6D34613F7569643D3233343734363930373526616D703B63743D3026616D703B636869643D30222C22736F6E675F5769666955524C223A22687474703A2F2F73747265616D31342E71716D757369632E71712E636F6D2F33303130333334372E6D7033222C226E657454797065223A2277696669222C22736F6E675F416C62756D223A22E4B880E697A0E68980E69C89222C22736F6E675F4944223A3130333334372C22736F6E675F54797065223A312C22736F6E675F53696E676572223A22E5B494E581A5222C22736F6E675F576170446F776E4C6F616455524C223A22687474703A2F2F74736D757369633132382E74632E71712E636F6D2F586C464E4D313574414141416A41414141477A4C36445039536A457A525467304E7A38774E446E752B6473483833344843756B5041576B6D48316C4A434E626F4D34394E4E7A754450444A647A7A45304F513D3D2F33303130333334372E6D70333F7569643D3233343734363930373526616D703B63743D3026616D703B636869643D3026616D703B73747265616D5F706F733D35227D"; 34 | static NSString *kMusicDataURL = @"http://stream20.qqmusic.qq.com/32464723.mp3"; 35 | static NSString *kMusicTitle = @"一无所有"; 36 | static NSString *kMusicDescription = @"崔健"; 37 | 38 | static NSString *kVideoURL = @"http://v.youku.com/v_show/id_XNTUxNDY1NDY4.html"; 39 | static NSString *kVideoTitle = @"乔布斯访谈"; 40 | static NSString *kVideoDescription = @"饿着肚皮,傻逼着。"; 41 | 42 | static NSString *kAPPContentTitle = @"App消息"; 43 | static NSString *kAPPContentDescription = @"这种消息只有App自己才能理解,由App指定打开方式"; 44 | static NSString *kAppContentExInfo = @"extend info"; 45 | static NSString *kAppContnetExURL = @"http://weixin.qq.com"; 46 | static NSString *kAppMessageExt = @"这是第三方带的测试字段"; 47 | static NSString *kAppMessageAction = @"dotaliTest"; 48 | 49 | static NSString *kAuthScope = @"snsapi_message,snsapi_userinfo,snsapi_friend,snsapi_contact"; 50 | static NSString *kAuthOpenID = @"0c806938e2413ce73eef92cc3"; 51 | static NSString *kAuthState = @"xxx"; 52 | 53 | static NSString *kFileTitle = @"iphone4.pdf"; 54 | static NSString *kFileDescription = @"Pro CoreData"; 55 | static NSString *kFileExtension = @"pdf"; 56 | static NSString *kFileName = @"iphone4"; 57 | 58 | static const NSInteger kRecvGetMessageReqAlertTag = 1000; 59 | static const NSInteger kProfileAppIdAlertTag = 2000; 60 | static const NSInteger kProfileUserNameAlertTag = 3000; 61 | static const NSInteger kBizWebviewAppIdAlerttag = 4000; 62 | static const NSInteger kBizWebviewTousernameAlertTag = 6000; 63 | 64 | static NSString *kProfileExtMsg = @"http://we.qq.com/d/AQCIc9a3EqRfb19z8WnLB6iFNCxX5bO2S3lHwMQL"; 65 | static NSString *kBizWebviewExtMsg = @"KOoCKdavezBjdj2wJZsq67N2j_g3XEQ5JP_pkLhBYS4"; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /Helper/WeChatSDK/WXHelper/GetMessageFromWXResp+responseWithTextOrMediaMessage.h: -------------------------------------------------------------------------------- 1 | // 2 | // GetMessageFromWXResp+responseWithTextOrMediaMessage.h 3 | // SDKSample 4 | // 5 | // Created by Jeason on 15/7/14. 6 | // 7 | // 8 | 9 | #import "WXApiObject.h" 10 | 11 | @interface GetMessageFromWXResp (responseWithTextOrMediaMessage) 12 | 13 | + (GetMessageFromWXResp *)responseWithText:(NSString *)text 14 | OrMediaMessage:(WXMediaMessage *)message 15 | bText:(BOOL)bText; 16 | @end 17 | -------------------------------------------------------------------------------- /Helper/WeChatSDK/WXHelper/GetMessageFromWXResp+responseWithTextOrMediaMessage.m: -------------------------------------------------------------------------------- 1 | // 2 | // GetMessageFromWXResp+responseWithTextOrMediaMessage.m 3 | // SDKSample 4 | // 5 | // Created by Jeason on 15/7/14. 6 | // 7 | // 8 | 9 | #import "GetMessageFromWXResp+responseWithTextOrMediaMessage.h" 10 | 11 | @implementation GetMessageFromWXResp (responseWithTextOrMediaMessage) 12 | 13 | + (GetMessageFromWXResp *)responseWithText:(NSString *)text 14 | OrMediaMessage:(WXMediaMessage *)message 15 | bText:(BOOL)bText { 16 | GetMessageFromWXResp *resp = [[[GetMessageFromWXResp alloc] init] autorelease]; 17 | resp.bText = bText; 18 | if (bText) 19 | resp.text = text; 20 | else 21 | resp.message = message; 22 | return resp; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Helper/WeChatSDK/WXHelper/SendMessageToWXReq+requestWithTextOrMediaMessage.h: -------------------------------------------------------------------------------- 1 | // 2 | // SendMessageToWXReq+requestWithTextOrMediaMessage.h 3 | // SDKSample 4 | // 5 | // Created by Jeason on 15/7/14. 6 | // 7 | // 8 | 9 | #import "WXApiObject.h" 10 | 11 | @interface SendMessageToWXReq (requestWithTextOrMediaMessage) 12 | 13 | + (SendMessageToWXReq *)requestWithText:(NSString *)text 14 | OrMediaMessage:(WXMediaMessage *)message 15 | bText:(BOOL)bText 16 | InScene:(enum WXScene)scene; 17 | @end 18 | -------------------------------------------------------------------------------- /Helper/WeChatSDK/WXHelper/SendMessageToWXReq+requestWithTextOrMediaMessage.m: -------------------------------------------------------------------------------- 1 | // 2 | // SendMessageToWXReq+requestWithTextOrMediaMessage.m 3 | // SDKSample 4 | // 5 | // Created by Jeason on 15/7/14. 6 | // 7 | // 8 | 9 | #import "SendMessageToWXReq+requestWithTextOrMediaMessage.h" 10 | 11 | @implementation SendMessageToWXReq (requestWithTextOrMediaMessage) 12 | 13 | + (SendMessageToWXReq *)requestWithText:(NSString *)text 14 | OrMediaMessage:(WXMediaMessage *)message 15 | bText:(BOOL)bText 16 | InScene:(enum WXScene)scene { 17 | SendMessageToWXReq *req = [[[SendMessageToWXReq alloc] init] autorelease]; 18 | req.bText = bText; 19 | req.scene = scene; 20 | if (bText) 21 | req.text = text; 22 | else 23 | req.message = message; 24 | return req; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Helper/WeChatSDK/WXHelper/WXApiManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXApiManager.h 3 | // SDKSample 4 | // 5 | // Created by Jeason on 16/07/2015. 6 | // 7 | // 8 | 9 | #import 10 | #import "WXApi.h" 11 | 12 | @protocol WXApiManagerDelegate 13 | 14 | @optional 15 | 16 | - (void)managerDidRecvGetMessageReq:(GetMessageFromWXReq *)request; 17 | 18 | - (void)managerDidRecvShowMessageReq:(ShowMessageFromWXReq *)request; 19 | 20 | - (void)managerDidRecvLaunchFromWXReq:(LaunchFromWXReq *)request; 21 | 22 | - (void)managerDidRecvMessageResponse:(SendMessageToWXResp *)response; 23 | 24 | - (void)managerDidRecvAuthResponse:(SendAuthResp *)response; 25 | 26 | - (void)managerDidRecvAddCardResponse:(AddCardToWXCardPackageResp *)response; 27 | 28 | @end 29 | 30 | @interface WXApiManager : NSObject 31 | 32 | @property (nonatomic, assign) id delegate; 33 | 34 | + (instancetype)sharedManager; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Helper/WeChatSDK/WXHelper/WXApiManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // WXApiManager.m 3 | // SDKSample 4 | // 5 | // Created by Jeason on 16/07/2015. 6 | // 7 | // 8 | 9 | #import "WXApiManager.h" 10 | 11 | @implementation WXApiManager 12 | 13 | #pragma mark - LifeCycle 14 | +(instancetype)sharedManager { 15 | static dispatch_once_t onceToken; 16 | static WXApiManager *instance; 17 | dispatch_once(&onceToken, ^{ 18 | instance = [[WXApiManager alloc] init]; 19 | }); 20 | return instance; 21 | } 22 | 23 | - (void)dealloc { 24 | self.delegate = nil; 25 | [super dealloc]; 26 | } 27 | 28 | #pragma mark - WXApiDelegate 29 | - (void)onResp:(BaseResp *)resp { 30 | if ([resp isKindOfClass:[SendMessageToWXResp class]]) { 31 | if (_delegate 32 | && [_delegate respondsToSelector:@selector(managerDidRecvMessageResponse:)]) { 33 | SendMessageToWXResp *messageResp = (SendMessageToWXResp *)resp; 34 | [_delegate managerDidRecvMessageResponse:messageResp]; 35 | } 36 | } else if ([resp isKindOfClass:[SendAuthResp class]]) { 37 | if (_delegate 38 | && [_delegate respondsToSelector:@selector(managerDidRecvAuthResponse:)]) { 39 | SendAuthResp *authResp = (SendAuthResp *)resp; 40 | [_delegate managerDidRecvAuthResponse:authResp]; 41 | } 42 | } else if ([resp isKindOfClass:[AddCardToWXCardPackageResp class]]) { 43 | if (_delegate 44 | && [_delegate respondsToSelector:@selector(managerDidRecvAddCardResponse:)]) { 45 | AddCardToWXCardPackageResp *addCardResp = (AddCardToWXCardPackageResp *)resp; 46 | [_delegate managerDidRecvAddCardResponse:addCardResp]; 47 | } 48 | }else if([resp isKindOfClass:[PayResp class]]){ 49 | 50 | 51 | //支付返回结果,实际支付结果需要去微信服务器端查询 52 | NSString *strMsg,*strTitle = [NSString stringWithFormat:@"支付结果"]; 53 | switch (resp.errCode) { 54 | case WXSuccess: strMsg = @"支付结果:成功!"; break; 55 | case WXErrCodeCommon: strMsg = @"普通错误类型!"; break; 56 | case WXErrCodeUserCancel: strMsg = @"用户取消!"; break; 57 | case WXErrCodeSentFail: strMsg = @"发送失败!"; break; 58 | case WXErrCodeAuthDeny: strMsg = @"授权失败"; break; 59 | case WXErrCodeUnsupport: strMsg = @"微信不支持"; break; 60 | default: strMsg = [NSString stringWithFormat:@"支付结果:失败!retcode = %d, retstr = %@", resp.errCode,resp.errStr]; break; 61 | } 62 | 63 | UIAlertView *alert = [[UIAlertView alloc] initWithTitle:strTitle message:strMsg delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; 64 | [alert show]; 65 | [alert release]; 66 | NSLog(@"retcode = %d, retstr = %@", resp.errCode,resp.errStr); 67 | 68 | } 69 | 70 | } 71 | 72 | - (void)onReq:(BaseReq *)req { 73 | if ([req isKindOfClass:[GetMessageFromWXReq class]]) { 74 | if (_delegate 75 | && [_delegate respondsToSelector:@selector(managerDidRecvGetMessageReq:)]) { 76 | GetMessageFromWXReq *getMessageReq = (GetMessageFromWXReq *)req; 77 | [_delegate managerDidRecvGetMessageReq:getMessageReq]; 78 | } 79 | } else if ([req isKindOfClass:[ShowMessageFromWXReq class]]) { 80 | if (_delegate 81 | && [_delegate respondsToSelector:@selector(managerDidRecvShowMessageReq:)]) { 82 | ShowMessageFromWXReq *showMessageReq = (ShowMessageFromWXReq *)req; 83 | [_delegate managerDidRecvShowMessageReq:showMessageReq]; 84 | } 85 | } else if ([req isKindOfClass:[LaunchFromWXReq class]]) { 86 | if (_delegate 87 | && [_delegate respondsToSelector:@selector(managerDidRecvLaunchFromWXReq:)]) { 88 | LaunchFromWXReq *launchReq = (LaunchFromWXReq *)req; 89 | [_delegate managerDidRecvLaunchFromWXReq:launchReq]; 90 | } 91 | } 92 | } 93 | 94 | @end 95 | -------------------------------------------------------------------------------- /Helper/WeChatSDK/WXHelper/WXApiRequestHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXApiManager.h 3 | // SDKSample 4 | // 5 | // Created by Jeason on 15/7/14. 6 | // 7 | // 8 | 9 | #import 10 | #import "WXApiObject.h" 11 | 12 | @interface WXApiRequestHandler : NSObject 13 | 14 | + (BOOL)sendText:(NSString *)text 15 | InScene:(enum WXScene)scene; 16 | 17 | + (BOOL)sendImageData:(NSData *)imageData 18 | TagName:(NSString *)tagName 19 | MessageExt:(NSString *)messageExt 20 | Action:(NSString *)action 21 | ThumbImage:(UIImage *)thumbImage 22 | InScene:(enum WXScene)scene; 23 | 24 | + (BOOL)sendLinkURL:(NSString *)urlString 25 | TagName:(NSString *)tagName 26 | Title:(NSString *)title 27 | Description:(NSString *)description 28 | ThumbImage:(UIImage *)thumbImage 29 | InScene:(enum WXScene)scene; 30 | 31 | + (BOOL)sendMusicURL:(NSString *)musicURL 32 | dataURL:(NSString *)dataURL 33 | Title:(NSString *)title 34 | Description:(NSString *)description 35 | ThumbImage:(UIImage *)thumbImage 36 | InScene:(enum WXScene)scene; 37 | 38 | + (BOOL)sendVideoURL:(NSString *)videoURL 39 | Title:(NSString *)title 40 | Description:(NSString *)description 41 | ThumbImage:(UIImage *)thumbImage 42 | InScene:(enum WXScene)scene; 43 | 44 | + (BOOL)sendEmotionData:(NSData *)emotionData 45 | ThumbImage:(UIImage *)thumbImage 46 | InScene:(enum WXScene)scene; 47 | 48 | + (BOOL)sendFileData:(NSData *)fileData 49 | fileExtension:(NSString *)extension 50 | Title:(NSString *)title 51 | Description:(NSString *)description 52 | ThumbImage:(UIImage *)thumbImage 53 | InScene:(enum WXScene)scene; 54 | 55 | + (BOOL)sendAppContentData:(NSData *)data 56 | ExtInfo:(NSString *)info 57 | ExtURL:(NSString *)url 58 | Title:(NSString *)title 59 | Description:(NSString *)description 60 | MessageExt:(NSString *)messageExt 61 | MessageAction:(NSString *)action 62 | ThumbImage:(UIImage *)thumbImage 63 | InScene:(enum WXScene)scene; 64 | 65 | + (BOOL)addCardsToCardPackage:(NSArray *)cardIds; 66 | 67 | + (BOOL)sendAuthRequestScope:(NSString *)scope 68 | State:(NSString *)state 69 | OpenID:(NSString *)openID 70 | InViewController:(UIViewController *)viewController; 71 | 72 | + (BOOL)jumpToBizWebviewWithAppID:(NSString *)appID 73 | Description:(NSString *)description 74 | tousrname:(NSString *)tousrname 75 | ExtMsg:(NSString *)extMsg; 76 | 77 | + (NSString *)jumpToBizPay; 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /Helper/WeChatSDK/WXHelper/WXApiResponseHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXApiResponseManager.h 3 | // SDKSample 4 | // 5 | // Created by Jeason on 15/7/14. 6 | // 7 | // 8 | 9 | #import 10 | #import "WXApiObject.h" 11 | 12 | @interface WXApiResponseHandler : NSObject 13 | 14 | + (BOOL)respText:(NSString *)text; 15 | 16 | + (BOOL)respImageData:(NSData *)imageData 17 | MessageExt:(NSString *)messageExt 18 | Action:(NSString *)action 19 | ThumbImage:(UIImage *)thumbImage; 20 | 21 | + (BOOL)respLinkURL:(NSString *)urlString 22 | Title:(NSString *)title 23 | Description:(NSString *)description 24 | ThumbImage:(UIImage *)thumbImage; 25 | 26 | + (BOOL)respMusicURL:(NSString *)musicURL 27 | dataURL:(NSString *)dataURL 28 | Title:(NSString *)title 29 | Description:(NSString *)description 30 | ThumbImage:(UIImage *)thumbImage; 31 | 32 | + (BOOL)respVideoURL:(NSString *)videoURL 33 | Title:(NSString *)title 34 | Description:(NSString *)description 35 | ThumbImage:(UIImage *)thumbImage; 36 | 37 | + (BOOL)respEmotionData:(NSData *)emotionData 38 | ThumbImage:(UIImage *)thumbImage; 39 | 40 | + (BOOL)respFileData:(NSData *)fileData 41 | fileExtension:(NSString *)extension 42 | Title:(NSString *)title 43 | Description:(NSString *)description 44 | ThumbImage:(UIImage *)thumbImage; 45 | 46 | + (BOOL)respAppContentData:(NSData *)data 47 | ExtInfo:(NSString *)info 48 | ExtURL:(NSString *)url 49 | Title:(NSString *)title 50 | Description:(NSString *)description 51 | MessageExt:(NSString *)messageExt 52 | MessageAction:(NSString *)action 53 | ThumbImage:(UIImage *)thumbImage; 54 | @end 55 | -------------------------------------------------------------------------------- /Helper/WeChatSDK/WXHelper/WXMediaMessage+messageConstruct.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXMediaMessage+messageConstruct.h 3 | // SDKSample 4 | // 5 | // Created by Jeason on 15/7/14. 6 | // 7 | // 8 | 9 | #import "WXApiObject.h" 10 | 11 | @interface WXMediaMessage (messageConstruct) 12 | 13 | + (WXMediaMessage *)messageWithTitle:(NSString *)title 14 | Description:(NSString *)description 15 | Object:(id)mediaObject 16 | MessageExt:(NSString *)messageExt 17 | MessageAction:(NSString *)action 18 | ThumbImage:(UIImage *)thumbImage 19 | MediaTag:(NSString *)tagName; 20 | @end 21 | -------------------------------------------------------------------------------- /Helper/WeChatSDK/WXHelper/WXMediaMessage+messageConstruct.m: -------------------------------------------------------------------------------- 1 | // 2 | // WXMediaMessage+messageConstruct.m 3 | // SDKSample 4 | // 5 | // Created by Jeason on 15/7/14. 6 | // 7 | // 8 | 9 | #import "WXMediaMessage+messageConstruct.h" 10 | 11 | @implementation WXMediaMessage (messageConstruct) 12 | 13 | + (WXMediaMessage *)messageWithTitle:(NSString *)title 14 | Description:(NSString *)description 15 | Object:(id)mediaObject 16 | MessageExt:(NSString *)messageExt 17 | MessageAction:(NSString *)action 18 | ThumbImage:(UIImage *)thumbImage 19 | MediaTag:(NSString *)tagName { 20 | WXMediaMessage *message = [WXMediaMessage message]; 21 | message.title = title; 22 | message.description = description; 23 | message.mediaObject = mediaObject; 24 | message.messageExt = messageExt; 25 | message.messageAction = action; 26 | message.mediaTagName = tagName; 27 | [message setThumbImage:thumbImage]; 28 | return message; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Helper/WeChatSDK/WechatAuthSDK.h: -------------------------------------------------------------------------------- 1 | // 2 | // WechatAuthSDK.h 3 | // WechatAuthSDK 4 | // 5 | // Created by 李凯 on 13-11-29. 6 | // Copyright (c) 2013年 Tencent. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | enum AuthErrCode { 13 | WechatAuth_Err_Ok = 0, //Auth成功 14 | WechatAuth_Err_NormalErr = -1, //普通错误 15 | WechatAuth_Err_NetworkErr = -2, //网络错误 16 | WechatAuth_Err_GetQrcodeFailed = -3, //获取二维码失败 17 | WechatAuth_Err_Cancel = -4, //用户取消授权 18 | WechatAuth_Err_Timeout = -5, //超时 19 | }; 20 | 21 | @protocol WechatAuthAPIDelegate 22 | @optional 23 | 24 | - (void)onAuthGotQrcode:(UIImage *)image; //得到二维码 25 | - (void)onQrcodeScanned; //二维码被扫描 26 | - (void)onAuthFinish:(int)errCode AuthCode:(NSString *)authCode; //成功登录 27 | 28 | @end 29 | 30 | @interface WechatAuthSDK : NSObject{ 31 | NSString *_sdkVersion; 32 | __weak id _delegate; 33 | } 34 | 35 | @property(nonatomic, weak) id delegate; 36 | @property(nonatomic, readonly) NSString *sdkVersion; //authSDK版本号 37 | 38 | /*! @brief 发送登录请求,等待WechatAuthAPIDelegate回调 39 | * 40 | * @param appId 微信开发者ID 41 | * @param nonceStr 一个随机的尽量不重复的字符串,用来使得每次的signature不同 42 | * @param timeStamp 时间戳 43 | * @param scope 应用授权作用域,拥有多个作用域用逗号(,)分隔 44 | * @param signature 签名 45 | * @param schemeData 会在扫码后拼在scheme后 46 | * @return 成功返回YES,失败返回NO 47 | 注:该实现只保证同时只有一个Auth在运行,Auth未完成或未Stop再次调用Auth接口时会返回NO。 48 | */ 49 | 50 | - (BOOL)Auth:(NSString *)appId 51 | nonceStr:(NSString *)nonceStr 52 | timeStamp:(NSString*)timeStamp 53 | scope:(NSString *)scope 54 | signature:(NSString *)signature 55 | schemeData:(NSString *)schemeData; 56 | 57 | 58 | /*! @brief 暂停登录请求 59 | * 60 | * @return 成功返回YES,失败返回NO。 61 | */ 62 | - (BOOL)StopAuth; 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /Helper/WeChatSDK/libWeChatSDK.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codewpf/PayDemo/c55438f182b919f491f3a0bbd4da6dda6f86fd51/Helper/WeChatSDK/libWeChatSDK.a -------------------------------------------------------------------------------- /PayDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PayDemo.xcodeproj/xcuserdata/wpf.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PayDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | E3B51D0C1C34078D005A7801 16 | 17 | primary 18 | 19 | 20 | E3B51D251C34078D005A7801 21 | 22 | primary 23 | 24 | 25 | E3B51D301C34078D005A7801 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /PayDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /PayDemo.xcworkspace/xcuserdata/wpf.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /PayDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // PayDemo 4 | // 5 | // Created by wpf on 15/12/30. 6 | // Copyright © 2015年 wpf. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /PayDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /PayDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /PayDemo/Assets.xcassets/LaunchImage.launchimage/1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codewpf/PayDemo/c55438f182b919f491f3a0bbd4da6dda6f86fd51/PayDemo/Assets.xcassets/LaunchImage.launchimage/1-1.png -------------------------------------------------------------------------------- /PayDemo/Assets.xcassets/LaunchImage.launchimage/1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codewpf/PayDemo/c55438f182b919f491f3a0bbd4da6dda6f86fd51/PayDemo/Assets.xcassets/LaunchImage.launchimage/1-2.png -------------------------------------------------------------------------------- /PayDemo/Assets.xcassets/LaunchImage.launchimage/1-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codewpf/PayDemo/c55438f182b919f491f3a0bbd4da6dda6f86fd51/PayDemo/Assets.xcassets/LaunchImage.launchimage/1-3.png -------------------------------------------------------------------------------- /PayDemo/Assets.xcassets/LaunchImage.launchimage/1-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codewpf/PayDemo/c55438f182b919f491f3a0bbd4da6dda6f86fd51/PayDemo/Assets.xcassets/LaunchImage.launchimage/1-4.png -------------------------------------------------------------------------------- /PayDemo/Assets.xcassets/LaunchImage.launchimage/1-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codewpf/PayDemo/c55438f182b919f491f3a0bbd4da6dda6f86fd51/PayDemo/Assets.xcassets/LaunchImage.launchimage/1-5.png -------------------------------------------------------------------------------- /PayDemo/Assets.xcassets/LaunchImage.launchimage/1-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codewpf/PayDemo/c55438f182b919f491f3a0bbd4da6dda6f86fd51/PayDemo/Assets.xcassets/LaunchImage.launchimage/1-6.png -------------------------------------------------------------------------------- /PayDemo/Assets.xcassets/LaunchImage.launchimage/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codewpf/PayDemo/c55438f182b919f491f3a0bbd4da6dda6f86fd51/PayDemo/Assets.xcassets/LaunchImage.launchimage/1.png -------------------------------------------------------------------------------- /PayDemo/Assets.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "extent" : "full-screen", 5 | "idiom" : "iphone", 6 | "subtype" : "736h", 7 | "filename" : "1.png", 8 | "minimum-system-version" : "8.0", 9 | "orientation" : "portrait", 10 | "scale" : "3x" 11 | }, 12 | { 13 | "extent" : "full-screen", 14 | "idiom" : "iphone", 15 | "subtype" : "667h", 16 | "filename" : "1-1.png", 17 | "minimum-system-version" : "8.0", 18 | "orientation" : "portrait", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "orientation" : "portrait", 23 | "idiom" : "iphone", 24 | "filename" : "1-4.png", 25 | "extent" : "full-screen", 26 | "minimum-system-version" : "7.0", 27 | "scale" : "2x" 28 | }, 29 | { 30 | "extent" : "full-screen", 31 | "idiom" : "iphone", 32 | "subtype" : "retina4", 33 | "filename" : "1-2.png", 34 | "minimum-system-version" : "7.0", 35 | "orientation" : "portrait", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "orientation" : "portrait", 40 | "idiom" : "iphone", 41 | "filename" : "1-6.png", 42 | "extent" : "full-screen", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "orientation" : "portrait", 47 | "idiom" : "iphone", 48 | "filename" : "1-5.png", 49 | "extent" : "full-screen", 50 | "scale" : "2x" 51 | }, 52 | { 53 | "orientation" : "portrait", 54 | "idiom" : "iphone", 55 | "filename" : "1-3.png", 56 | "extent" : "full-screen", 57 | "subtype" : "retina4", 58 | "scale" : "2x" 59 | } 60 | ], 61 | "info" : { 62 | "version" : 1, 63 | "author" : "xcode" 64 | } 65 | } -------------------------------------------------------------------------------- /PayDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | PayDemo 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleURLTypes 22 | 23 | 24 | CFBundleTypeRole 25 | Editor 26 | CFBundleURLName 27 | weixin 28 | CFBundleURLSchemes 29 | 30 | wx*************** 31 | 32 | 33 | 34 | CFBundleTypeRole 35 | Editor 36 | CFBundleURLSchemes 37 | 38 | alipayPayDemo 39 | 40 | 41 | 42 | CFBundleVersion 43 | 1 44 | LSApplicationQueriesSchemes 45 | 46 | weixin 47 | 48 | LSRequiresIPhoneOS 49 | 50 | NSAppTransportSecurity 51 | 52 | NSAllowsArbitraryLoads 53 | 54 | 55 | UIRequiredDeviceCapabilities 56 | 57 | armv7 58 | 59 | UISupportedInterfaceOrientations 60 | 61 | UIInterfaceOrientationPortrait 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /PayDemo/PayDemo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PayDemo-Prefix.pch 3 | // PayDemo 4 | // 5 | // Created by wpf on 15/12/30. 6 | // Copyright © 2015年 wpf. All rights reserved. 7 | // 8 | 9 | #ifndef PayDemo_Prefix_pch 10 | #define PayDemo_Prefix_pch 11 | 12 | // Include any system framework and library headers here that should be included in all compilation units. 13 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. 14 | 15 | #import "AppMethod.h" 16 | #import "AppUtils.h" 17 | #import "CommonInfo.h" 18 | 19 | 20 | 21 | 22 | 23 | #endif /* PayDemo_Prefix_pch */ 24 | -------------------------------------------------------------------------------- /PayDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // PayDemo 4 | // 5 | // Created by wpf on 15/12/30. 6 | // Copyright © 2015年 wpf. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /PayDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // PayDemo 4 | // 5 | // Created by wpf on 15/12/30. 6 | // Copyright © 2015年 wpf. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /PayDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /PayDemoTests/PayDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // PayDemoTests.m 3 | // PayDemoTests 4 | // 5 | // Created by wpf on 15/12/30. 6 | // Copyright © 2015年 wpf. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PayDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation PayDemoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /PayDemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /PayDemoUITests/PayDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // PayDemoUITests.m 3 | // PayDemoUITests 4 | // 5 | // Created by wpf on 15/12/30. 6 | // Copyright © 2015年 wpf. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PayDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation PayDemoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | platform :ios, '7.0' 3 | 4 | pod 'AFNetworking', '~> 2.6.3' 5 | pod 'Masonry' 6 | pod 'XMLDictionary', '~> 1.4' 7 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (2.6.3): 3 | - AFNetworking/NSURLConnection (= 2.6.3) 4 | - AFNetworking/NSURLSession (= 2.6.3) 5 | - AFNetworking/Reachability (= 2.6.3) 6 | - AFNetworking/Security (= 2.6.3) 7 | - AFNetworking/Serialization (= 2.6.3) 8 | - AFNetworking/UIKit (= 2.6.3) 9 | - AFNetworking/NSURLConnection (2.6.3): 10 | - AFNetworking/Reachability 11 | - AFNetworking/Security 12 | - AFNetworking/Serialization 13 | - AFNetworking/NSURLSession (2.6.3): 14 | - AFNetworking/Reachability 15 | - AFNetworking/Security 16 | - AFNetworking/Serialization 17 | - AFNetworking/Reachability (2.6.3) 18 | - AFNetworking/Security (2.6.3) 19 | - AFNetworking/Serialization (2.6.3) 20 | - AFNetworking/UIKit (2.6.3): 21 | - AFNetworking/NSURLConnection 22 | - AFNetworking/NSURLSession 23 | - Masonry (0.6.4) 24 | - XMLDictionary (1.4) 25 | 26 | DEPENDENCIES: 27 | - AFNetworking (~> 2.6.3) 28 | - Masonry 29 | - XMLDictionary (~> 1.4) 30 | 31 | SPEC CHECKSUMS: 32 | AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60 33 | Masonry: 281802d04d787ea2973179ee8bcb50500579ede2 34 | XMLDictionary: f9f51601ba76678b594ab485f2b00ec1fed23724 35 | 36 | COCOAPODS: 0.39.0 37 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | // AFNetworking.h 2 | // 3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import 24 | #import 25 | 26 | #ifndef _AFNETWORKING_ 27 | #define _AFNETWORKING_ 28 | 29 | #import "AFURLRequestSerialization.h" 30 | #import "AFURLResponseSerialization.h" 31 | #import "AFSecurityPolicy.h" 32 | #if !TARGET_OS_WATCH 33 | #import "AFNetworkReachabilityManager.h" 34 | #import "AFURLConnectionOperation.h" 35 | #import "AFHTTPRequestOperation.h" 36 | #import "AFHTTPRequestOperationManager.h" 37 | #endif 38 | 39 | #if ( ( defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090) || \ 40 | ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 ) || \ 41 | TARGET_OS_WATCH ) 42 | #import "AFURLSessionManager.h" 43 | #import "AFHTTPSessionManager.h" 44 | #endif 45 | 46 | #endif /* _AFNETWORKING_ */ 47 | -------------------------------------------------------------------------------- /Pods/AFNetworking/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | // AFNetworkActivityIndicatorManager.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | /** 33 | `AFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a network request operation has started or finished, and start or stop animating the indicator accordingly. The number of active requests is incremented and decremented much like a stack or a semaphore, and the activity indicator will animate so long as that number is greater than zero. 34 | 35 | You should enable the shared instance of `AFNetworkActivityIndicatorManager` when your application finishes launching. In `AppDelegate application:didFinishLaunchingWithOptions:` you can do so with the following code: 36 | 37 | [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES]; 38 | 39 | By setting `enabled` to `YES` for `sharedManager`, the network activity indicator will show and hide automatically as requests start and finish. You should not ever need to call `incrementActivityCount` or `decrementActivityCount` yourself. 40 | 41 | See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information: 42 | http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44 43 | */ 44 | NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.") 45 | @interface AFNetworkActivityIndicatorManager : NSObject 46 | 47 | /** 48 | A Boolean value indicating whether the manager is enabled. 49 | 50 | If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO. 51 | */ 52 | @property (nonatomic, assign, getter = isEnabled) BOOL enabled; 53 | 54 | /** 55 | A Boolean value indicating whether the network activity indicator is currently displayed in the status bar. 56 | */ 57 | @property (readonly, nonatomic, assign) BOOL isNetworkActivityIndicatorVisible; 58 | 59 | /** 60 | Returns the shared network activity indicator manager object for the system. 61 | 62 | @return The systemwide network activity indicator manager. 63 | */ 64 | + (instancetype)sharedManager; 65 | 66 | /** 67 | Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator. 68 | */ 69 | - (void)incrementActivityCount; 70 | 71 | /** 72 | Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator. 73 | */ 74 | - (void)decrementActivityCount; 75 | 76 | @end 77 | 78 | NS_ASSUME_NONNULL_END 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIActivityIndicatorView+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | @class AFURLConnectionOperation; 31 | 32 | /** 33 | This category adds methods to the UIKit framework's `UIActivityIndicatorView` class. The methods in this category provide support for automatically starting and stopping animation depending on the loading state of a request operation or session task. 34 | */ 35 | @interface UIActivityIndicatorView (AFNetworking) 36 | 37 | ///---------------------------------- 38 | /// @name Animating for Session Tasks 39 | ///---------------------------------- 40 | 41 | /** 42 | Binds the animating state to the state of the specified task. 43 | 44 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 45 | */ 46 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 47 | - (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task; 48 | #endif 49 | 50 | ///--------------------------------------- 51 | /// @name Animating for Request Operations 52 | ///--------------------------------------- 53 | 54 | /** 55 | Binds the animating state to the execution state of the specified operation. 56 | 57 | @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled. 58 | */ 59 | - (void)setAnimatingWithStateOfOperation:(nullable AFURLConnectionOperation *)operation; 60 | 61 | @end 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+AFNetworking.h 3 | // 4 | // 5 | // Created by Paulo Ferreira on 08/07/15. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 26 | 27 | #import 28 | 29 | @interface UIImage (AFNetworking) 30 | 31 | + (UIImage*) safeImageWithData:(NSData*)data; 32 | 33 | @end 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIKit+AFNetworking.h 2 | // 3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #if TARGET_OS_IOS 24 | #import 25 | 26 | #ifndef _UIKIT_AFNETWORKING_ 27 | #define _UIKIT_AFNETWORKING_ 28 | 29 | #import "AFNetworkActivityIndicatorManager.h" 30 | 31 | #import "UIActivityIndicatorView+AFNetworking.h" 32 | #import "UIAlertView+AFNetworking.h" 33 | #import "UIButton+AFNetworking.h" 34 | #import "UIImageView+AFNetworking.h" 35 | #import "UIProgressView+AFNetworking.h" 36 | #import "UIRefreshControl+AFNetworking.h" 37 | #import "UIWebView+AFNetworking.h" 38 | #endif /* _UIKIT_AFNETWORKING_ */ 39 | #endif 40 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIProgressView+AFNetworking.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @class AFURLConnectionOperation; 33 | 34 | /** 35 | This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task or request operation. 36 | */ 37 | @interface UIProgressView (AFNetworking) 38 | 39 | ///------------------------------------ 40 | /// @name Setting Session Task Progress 41 | ///------------------------------------ 42 | 43 | /** 44 | Binds the progress to the upload progress of the specified session task. 45 | 46 | @param task The session task. 47 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 48 | */ 49 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 50 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task 51 | animated:(BOOL)animated; 52 | #endif 53 | 54 | /** 55 | Binds the progress to the download progress of the specified session task. 56 | 57 | @param task The session task. 58 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 59 | */ 60 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 61 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task 62 | animated:(BOOL)animated; 63 | #endif 64 | 65 | ///------------------------------------ 66 | /// @name Setting Session Task Progress 67 | ///------------------------------------ 68 | 69 | /** 70 | Binds the progress to the upload progress of the specified request operation. 71 | 72 | @param operation The request operation. 73 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 74 | */ 75 | - (void)setProgressWithUploadProgressOfOperation:(AFURLConnectionOperation *)operation 76 | animated:(BOOL)animated; 77 | 78 | /** 79 | Binds the progress to the download progress of the specified request operation. 80 | 81 | @param operation The request operation. 82 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 83 | */ 84 | - (void)setProgressWithDownloadProgressOfOperation:(AFURLConnectionOperation *)operation 85 | animated:(BOOL)animated; 86 | 87 | @end 88 | 89 | NS_ASSUME_NONNULL_END 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIRefreshControl+AFNetworking.m 2 | // 3 | // Copyright (c) 2014 AFNetworking (http://afnetworking.com) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import 24 | 25 | #import 26 | 27 | #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) 28 | 29 | #import 30 | 31 | NS_ASSUME_NONNULL_BEGIN 32 | 33 | @class AFURLConnectionOperation; 34 | 35 | /** 36 | This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically beginning and ending refreshing depending on the loading state of a request operation or session task. 37 | */ 38 | @interface UIRefreshControl (AFNetworking) 39 | 40 | ///----------------------------------- 41 | /// @name Refreshing for Session Tasks 42 | ///----------------------------------- 43 | 44 | /** 45 | Binds the refreshing state to the state of the specified task. 46 | 47 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 48 | */ 49 | #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 50 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; 51 | #endif 52 | 53 | ///---------------------------------------- 54 | /// @name Refreshing for Request Operations 55 | ///---------------------------------------- 56 | 57 | /** 58 | Binds the refreshing state to the execution state of the specified operation. 59 | 60 | @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled. 61 | */ 62 | - (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation; 63 | 64 | @end 65 | 66 | NS_ASSUME_NONNULL_END 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFHTTPRequestOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFHTTPRequestOperationManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFSecurityPolicy.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLConnectionOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLConnectionOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/AFURLSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIAlertView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASCompositeConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint+Private.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraintMaker.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASLayoutConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASUtilities.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewAttribute.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/Masonry.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/ViewController+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Private/XMLDictionary/XMLDictionary.h: -------------------------------------------------------------------------------- 1 | ../../../XMLDictionary/XMLDictionary/XMLDictionary.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFHTTPRequestOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFHTTPRequestOperationManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFHTTPSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworkReachabilityManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFSecurityPolicy.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLConnectionOperation.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLConnectionOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLRequestSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLResponseSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/AFURLSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLSessionManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIAlertView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASCompositeConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint+Private.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraintMaker.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASLayoutConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASUtilities.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewAttribute.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewConstraint.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/Masonry.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/ViewController+MASAdditions.h -------------------------------------------------------------------------------- /Pods/Headers/Public/XMLDictionary/XMLDictionary.h: -------------------------------------------------------------------------------- 1 | ../../../XMLDictionary/XMLDictionary/XMLDictionary.h -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (2.6.3): 3 | - AFNetworking/NSURLConnection (= 2.6.3) 4 | - AFNetworking/NSURLSession (= 2.6.3) 5 | - AFNetworking/Reachability (= 2.6.3) 6 | - AFNetworking/Security (= 2.6.3) 7 | - AFNetworking/Serialization (= 2.6.3) 8 | - AFNetworking/UIKit (= 2.6.3) 9 | - AFNetworking/NSURLConnection (2.6.3): 10 | - AFNetworking/Reachability 11 | - AFNetworking/Security 12 | - AFNetworking/Serialization 13 | - AFNetworking/NSURLSession (2.6.3): 14 | - AFNetworking/Reachability 15 | - AFNetworking/Security 16 | - AFNetworking/Serialization 17 | - AFNetworking/Reachability (2.6.3) 18 | - AFNetworking/Security (2.6.3) 19 | - AFNetworking/Serialization (2.6.3) 20 | - AFNetworking/UIKit (2.6.3): 21 | - AFNetworking/NSURLConnection 22 | - AFNetworking/NSURLSession 23 | - Masonry (0.6.4) 24 | - XMLDictionary (1.4) 25 | 26 | DEPENDENCIES: 27 | - AFNetworking (~> 2.6.3) 28 | - Masonry 29 | - XMLDictionary (~> 1.4) 30 | 31 | SPEC CHECKSUMS: 32 | AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60 33 | Masonry: 281802d04d787ea2973179ee8bcb50500579ede2 34 | XMLDictionary: f9f51601ba76678b594ab485f2b00ec1fed23724 35 | 36 | COCOAPODS: 0.39.0 37 | -------------------------------------------------------------------------------- /Pods/Masonry/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASCompositeConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | #import "MASUtilities.h" 11 | 12 | /** 13 | * A group of MASConstraint objects 14 | */ 15 | @interface MASCompositeConstraint : MASConstraint 16 | 17 | /** 18 | * Creates a composite with a predefined array of children 19 | * 20 | * @param children child MASConstraints 21 | * 22 | * @return a composite constraint 23 | */ 24 | - (id)initWithChildren:(NSArray *)children; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraint+Private.h 3 | // Masonry 4 | // 5 | // Created by Nick Tymchenko on 29/04/14. 6 | // Copyright (c) 2014 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | 11 | @protocol MASConstraintDelegate; 12 | 13 | 14 | @interface MASConstraint () 15 | 16 | /** 17 | * Whether or not to check for an existing constraint instead of adding constraint 18 | */ 19 | @property (nonatomic, assign) BOOL updateExisting; 20 | 21 | /** 22 | * Usually MASConstraintMaker but could be a parent MASConstraint 23 | */ 24 | @property (nonatomic, weak) id delegate; 25 | 26 | /** 27 | * Based on a provided value type, is equal to calling: 28 | * NSNumber - setOffset: 29 | * NSValue with CGPoint - setPointOffset: 30 | * NSValue with CGSize - setSizeOffset: 31 | * NSValue with MASEdgeInsets - setInsets: 32 | */ 33 | - (void)setLayoutConstantWithValue:(NSValue *)value; 34 | 35 | @end 36 | 37 | 38 | @interface MASConstraint (Abstract) 39 | 40 | /** 41 | * Sets the constraint relation to given NSLayoutRelation 42 | * returns a block which accepts one of the following: 43 | * MASViewAttribute, UIView, NSValue, NSArray 44 | * see readme for more details. 45 | */ 46 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation; 47 | 48 | /** 49 | * Override to set a custom chaining behaviour 50 | */ 51 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; 52 | 53 | @end 54 | 55 | 56 | @protocol MASConstraintDelegate 57 | 58 | /** 59 | * Notifies the delegate when the constraint needs to be replaced with another constraint. For example 60 | * A MASViewConstraint may turn into a MASCompositeConstraint when an array is passed to one of the equality blocks 61 | */ 62 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint; 63 | 64 | - (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * When you are debugging or printing the constraints attached to a view this subclass 13 | * makes it easier to identify which constraints have been created via Masonry 14 | */ 15 | @interface MASLayoutConstraint : NSLayoutConstraint 16 | 17 | /** 18 | * a key to associate with this constraint 19 | */ 20 | @property (nonatomic, strong) id mas_key; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASLayoutConstraint.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASLayoutConstraint.h" 10 | 11 | @implementation MASLayoutConstraint 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASAttribute.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * An immutable tuple which stores the view and the related NSLayoutAttribute. 13 | * Describes part of either the left or right hand side of a constraint equation 14 | */ 15 | @interface MASViewAttribute : NSObject 16 | 17 | /** 18 | * The view which the reciever relates to. Can be nil if item is not a view. 19 | */ 20 | @property (nonatomic, weak, readonly) MAS_VIEW *view; 21 | 22 | /** 23 | * The item which the reciever relates to. 24 | */ 25 | @property (nonatomic, weak, readonly) id item; 26 | 27 | /** 28 | * The attribute which the reciever relates to 29 | */ 30 | @property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute; 31 | 32 | /** 33 | * Convenience initializer. 34 | */ 35 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute; 36 | 37 | /** 38 | * The designated initializer. 39 | */ 40 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute; 41 | 42 | /** 43 | * Determine whether the layoutAttribute is a size attribute 44 | * 45 | * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight 46 | */ 47 | - (BOOL)isSizeAttribute; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASViewAttribute.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASAttribute.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | 11 | @implementation MASViewAttribute 12 | 13 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute { 14 | self = [self initWithView:view item:view layoutAttribute:layoutAttribute]; 15 | return self; 16 | } 17 | 18 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute { 19 | self = [super init]; 20 | if (!self) return nil; 21 | 22 | _view = view; 23 | _item = item; 24 | _layoutAttribute = layoutAttribute; 25 | 26 | return self; 27 | } 28 | 29 | - (BOOL)isSizeAttribute { 30 | return self.layoutAttribute == NSLayoutAttributeWidth 31 | || self.layoutAttribute == NSLayoutAttributeHeight; 32 | } 33 | 34 | - (BOOL)isEqual:(MASViewAttribute *)viewAttribute { 35 | if ([viewAttribute isKindOfClass:self.class]) { 36 | return self.view == viewAttribute.view 37 | && self.layoutAttribute == viewAttribute.layoutAttribute; 38 | } 39 | return [super isEqual:viewAttribute]; 40 | } 41 | 42 | - (NSUInteger)hash { 43 | return MAS_NSUINTROTATE([self.view hash], MAS_NSUINT_BIT / 2) ^ self.layoutAttribute; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | #import "MASConstraint.h" 11 | #import "MASLayoutConstraint.h" 12 | #import "MASUtilities.h" 13 | 14 | /** 15 | * A single constraint. 16 | * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view 17 | */ 18 | @interface MASViewConstraint : MASConstraint 19 | 20 | /** 21 | * First item/view and first attribute of the NSLayoutConstraint 22 | */ 23 | @property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute; 24 | 25 | /** 26 | * Second item/view and second attribute of the NSLayoutConstraint 27 | */ 28 | @property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute; 29 | 30 | /** 31 | * initialises the MASViewConstraint with the first part of the equation 32 | * 33 | * @param firstViewAttribute view.mas_left, view.mas_width etc. 34 | * 35 | * @return a new view constraint 36 | */ 37 | - (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute; 38 | 39 | /** 40 | * Returns all MASViewConstraints installed with this view as a first item. 41 | * 42 | * @param view A view to retrieve constraints for. 43 | * 44 | * @return An array of MASViewConstraints. 45 | */ 46 | + (NSArray *)installedConstraintsForView:(MAS_VIEW *)view; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | // 2 | // Masonry.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Masonry. 12 | FOUNDATION_EXPORT double MasonryVersionNumber; 13 | 14 | //! Project version string for Masonry. 15 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[]; 16 | 17 | #import "MASUtilities.h" 18 | #import "View+MASAdditions.h" 19 | #import "View+MASShorthandAdditions.h" 20 | #import "ViewController+MASAdditions.h" 21 | #import "NSArray+MASAdditions.h" 22 | #import "NSArray+MASShorthandAdditions.h" 23 | #import "MASConstraint.h" 24 | #import "MASCompositeConstraint.h" 25 | #import "MASViewAttribute.h" 26 | #import "MASViewConstraint.h" 27 | #import "MASConstraintMaker.h" 28 | #import "MASLayoutConstraint.h" 29 | #import "NSLayoutConstraint+MASDebugAdditions.h" 30 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASAdditions.h 3 | // 4 | // 5 | // Created by Daniel Hammond on 11/26/13. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | typedef NS_ENUM(NSUInteger, MASAxisType) { 14 | MASAxisTypeHorizontal, 15 | MASAxisTypeVertical 16 | }; 17 | 18 | @interface NSArray (MASAdditions) 19 | 20 | /** 21 | * Creates a MASConstraintMaker with each view in the callee. 22 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing on each view 23 | * 24 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 25 | * 26 | * @return Array of created MASConstraints 27 | */ 28 | - (NSArray *)mas_makeConstraints:(void (^)(MASConstraintMaker *make))block; 29 | 30 | /** 31 | * Creates a MASConstraintMaker with each view in the callee. 32 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 33 | * If an existing constraint exists then it will be updated instead. 34 | * 35 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 36 | * 37 | * @return Array of created/updated MASConstraints 38 | */ 39 | - (NSArray *)mas_updateConstraints:(void (^)(MASConstraintMaker *make))block; 40 | 41 | /** 42 | * Creates a MASConstraintMaker with each view in the callee. 43 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 44 | * All constraints previously installed for the views will be removed. 45 | * 46 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 47 | * 48 | * @return Array of created/updated MASConstraints 49 | */ 50 | - (NSArray *)mas_remakeConstraints:(void (^)(MASConstraintMaker *make))block; 51 | 52 | /** 53 | * distribute with fixed spacing 54 | * 55 | * @param axisType which axis to distribute items along 56 | * @param fixedSpacing the spacing between each item 57 | * @param leadSpacing the spacing before the first item and the container 58 | * @param tailSpacing the spacing after the last item and the container 59 | */ 60 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; 61 | 62 | /** 63 | * distribute with fixed item size 64 | * 65 | * @param axisType which axis to distribute items along 66 | * @param fixedItemLength the fixed length of each item 67 | * @param leadSpacing the spacing before the first item and the container 68 | * @param tailSpacing the spacing after the last item and the container 69 | */ 70 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASShorthandAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 22/07/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "NSArray+MASAdditions.h" 10 | 11 | #ifdef MAS_SHORTHAND 12 | 13 | /** 14 | * Shorthand array additions without the 'mas_' prefixes, 15 | * only enabled if MAS_SHORTHAND is defined 16 | */ 17 | @interface NSArray (MASShorthandAdditions) 18 | 19 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 20 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 21 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 22 | 23 | @end 24 | 25 | @implementation NSArray (MASShorthandAdditions) 26 | 27 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block { 28 | return [self mas_makeConstraints:block]; 29 | } 30 | 31 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block { 32 | return [self mas_updateConstraints:block]; 33 | } 34 | 35 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block { 36 | return [self mas_remakeConstraints:block]; 37 | } 38 | 39 | @end 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+MASDebugAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * makes debug and log output of NSLayoutConstraints more readable 13 | */ 14 | @interface NSLayoutConstraint (MASDebugAdditions) 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+MASAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | /** 14 | * Provides constraint maker block 15 | * and convience methods for creating MASViewAttribute which are view + NSLayoutAttribute pairs 16 | */ 17 | @interface MAS_VIEW (MASAdditions) 18 | 19 | /** 20 | * following properties return a new MASViewAttribute with current view and appropriate NSLayoutAttribute 21 | */ 22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_left; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_top; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_right; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottom; 26 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leading; 27 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailing; 28 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_width; 29 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_height; 30 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerX; 31 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerY; 32 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline; 33 | @property (nonatomic, strong, readonly) MASViewAttribute *(^mas_attribute)(NSLayoutAttribute attr); 34 | 35 | #if TARGET_OS_IPHONE || TARGET_OS_TV 36 | 37 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leftMargin; 38 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_rightMargin; 39 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topMargin; 40 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomMargin; 41 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leadingMargin; 42 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailingMargin; 43 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerXWithinMargins; 44 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerYWithinMargins; 45 | 46 | #endif 47 | 48 | /** 49 | * a key to associate with this view 50 | */ 51 | @property (nonatomic, strong) id mas_key; 52 | 53 | /** 54 | * Finds the closest common superview between this view and another view 55 | * 56 | * @param view other view 57 | * 58 | * @return returns nil if common superview could not be found 59 | */ 60 | - (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view; 61 | 62 | /** 63 | * Creates a MASConstraintMaker with the callee view. 64 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing 65 | * 66 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 67 | * 68 | * @return Array of created MASConstraints 69 | */ 70 | - (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *make))block; 71 | 72 | /** 73 | * Creates a MASConstraintMaker with the callee view. 74 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. 75 | * If an existing constraint exists then it will be updated instead. 76 | * 77 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 78 | * 79 | * @return Array of created/updated MASConstraints 80 | */ 81 | - (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *make))block; 82 | 83 | /** 84 | * Creates a MASConstraintMaker with the callee view. 85 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. 86 | * All constraints previously installed for the view will be removed. 87 | * 88 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 89 | * 90 | * @return Array of created/updated MASConstraints 91 | */ 92 | - (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block; 93 | 94 | @end 95 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+MASShorthandAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 22/07/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "View+MASAdditions.h" 10 | 11 | #ifdef MAS_SHORTHAND 12 | 13 | /** 14 | * Shorthand view additions without the 'mas_' prefixes, 15 | * only enabled if MAS_SHORTHAND is defined 16 | */ 17 | @interface MAS_VIEW (MASShorthandAdditions) 18 | 19 | @property (nonatomic, strong, readonly) MASViewAttribute *left; 20 | @property (nonatomic, strong, readonly) MASViewAttribute *top; 21 | @property (nonatomic, strong, readonly) MASViewAttribute *right; 22 | @property (nonatomic, strong, readonly) MASViewAttribute *bottom; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *leading; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *trailing; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *width; 26 | @property (nonatomic, strong, readonly) MASViewAttribute *height; 27 | @property (nonatomic, strong, readonly) MASViewAttribute *centerX; 28 | @property (nonatomic, strong, readonly) MASViewAttribute *centerY; 29 | @property (nonatomic, strong, readonly) MASViewAttribute *baseline; 30 | @property (nonatomic, strong, readonly) MASViewAttribute *(^attribute)(NSLayoutAttribute attr); 31 | 32 | #if TARGET_OS_IPHONE || TARGET_OS_TV 33 | 34 | @property (nonatomic, strong, readonly) MASViewAttribute *leftMargin; 35 | @property (nonatomic, strong, readonly) MASViewAttribute *rightMargin; 36 | @property (nonatomic, strong, readonly) MASViewAttribute *topMargin; 37 | @property (nonatomic, strong, readonly) MASViewAttribute *bottomMargin; 38 | @property (nonatomic, strong, readonly) MASViewAttribute *leadingMargin; 39 | @property (nonatomic, strong, readonly) MASViewAttribute *trailingMargin; 40 | @property (nonatomic, strong, readonly) MASViewAttribute *centerXWithinMargins; 41 | @property (nonatomic, strong, readonly) MASViewAttribute *centerYWithinMargins; 42 | 43 | #endif 44 | 45 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 46 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 47 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 48 | 49 | @end 50 | 51 | #define MAS_ATTR_FORWARD(attr) \ 52 | - (MASViewAttribute *)attr { \ 53 | return [self mas_##attr]; \ 54 | } 55 | 56 | @implementation MAS_VIEW (MASShorthandAdditions) 57 | 58 | MAS_ATTR_FORWARD(top); 59 | MAS_ATTR_FORWARD(left); 60 | MAS_ATTR_FORWARD(bottom); 61 | MAS_ATTR_FORWARD(right); 62 | MAS_ATTR_FORWARD(leading); 63 | MAS_ATTR_FORWARD(trailing); 64 | MAS_ATTR_FORWARD(width); 65 | MAS_ATTR_FORWARD(height); 66 | MAS_ATTR_FORWARD(centerX); 67 | MAS_ATTR_FORWARD(centerY); 68 | MAS_ATTR_FORWARD(baseline); 69 | 70 | #if TARGET_OS_IPHONE || TARGET_OS_TV 71 | 72 | MAS_ATTR_FORWARD(leftMargin); 73 | MAS_ATTR_FORWARD(rightMargin); 74 | MAS_ATTR_FORWARD(topMargin); 75 | MAS_ATTR_FORWARD(bottomMargin); 76 | MAS_ATTR_FORWARD(leadingMargin); 77 | MAS_ATTR_FORWARD(trailingMargin); 78 | MAS_ATTR_FORWARD(centerXWithinMargins); 79 | MAS_ATTR_FORWARD(centerYWithinMargins); 80 | 81 | #endif 82 | 83 | - (MASViewAttribute *(^)(NSLayoutAttribute))attribute { 84 | return [self mas_attribute]; 85 | } 86 | 87 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block { 88 | return [self mas_makeConstraints:block]; 89 | } 90 | 91 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block { 92 | return [self mas_updateConstraints:block]; 93 | } 94 | 95 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block { 96 | return [self mas_remakeConstraints:block]; 97 | } 98 | 99 | @end 100 | 101 | #endif 102 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.h 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | #ifdef MAS_VIEW_CONTROLLER 14 | 15 | @interface MAS_VIEW_CONTROLLER (MASAdditions) 16 | 17 | /** 18 | * following properties return a new MASViewAttribute with appropriate UILayoutGuide and NSLayoutAttribute 19 | */ 20 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide; 21 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide; 22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideTop; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideBottom; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideTop; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideBottom; 26 | 27 | 28 | @end 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Pods/Masonry/Masonry/ViewController+MASAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.m 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "ViewController+MASAdditions.h" 10 | 11 | #ifdef MAS_VIEW_CONTROLLER 12 | 13 | @implementation MAS_VIEW_CONTROLLER (MASAdditions) 14 | 15 | - (MASViewAttribute *)mas_topLayoutGuide { 16 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 17 | } 18 | - (MASViewAttribute *)mas_topLayoutGuideTop { 19 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 20 | } 21 | - (MASViewAttribute *)mas_topLayoutGuideBottom { 22 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 23 | } 24 | 25 | - (MASViewAttribute *)mas_bottomLayoutGuide { 26 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 27 | } 28 | - (MASViewAttribute *)mas_bottomLayoutGuideTop { 29 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 30 | } 31 | - (MASViewAttribute *)mas_bottomLayoutGuideBottom { 32 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 33 | } 34 | 35 | 36 | 37 | @end 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/wpf.xcuserdatad/xcschemes/AFNetworking.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/wpf.xcuserdatad/xcschemes/Masonry.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/wpf.xcuserdatad/xcschemes/Pods.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/wpf.xcuserdatad/xcschemes/XMLDictionary.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/wpf.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AFNetworking.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Masonry.xcscheme 13 | 14 | isShown 15 | 16 | 17 | Pods.xcscheme 18 | 19 | isShown 20 | 21 | 22 | XMLDictionary.xcscheme 23 | 24 | isShown 25 | 26 | 27 | 28 | SuppressBuildableAutocreation 29 | 30 | 3A18DB41D8DCE3C676EE33F8338B11FC 31 | 32 | primary 33 | 34 | 35 | 3D7FB4E8FB2F398305920009F54363C8 36 | 37 | primary 38 | 39 | 40 | 410B25DF16EA5C5B3E2698F74F9625FB 41 | 42 | primary 43 | 44 | 45 | 53480ED0BE09FF49E34B1702D485CAAB 46 | 47 | primary 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AFNetworking : NSObject 3 | @end 4 | @implementation PodsDummy_AFNetworking 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #ifndef TARGET_OS_IOS 6 | #define TARGET_OS_IOS TARGET_OS_IPHONE 7 | #endif 8 | 9 | #ifndef TARGET_OS_WATCH 10 | #define TARGET_OS_WATCH 0 11 | #endif 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AFNetworking" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/XMLDictionary" 3 | OTHER_LDFLAGS = -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Target Support Files/Masonry/Masonry-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Masonry : NSObject 3 | @end 4 | @implementation PodsDummy_Masonry 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Masonry/Masonry-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Masonry/Masonry.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Masonry" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/XMLDictionary" 3 | OTHER_LDFLAGS = -framework "Foundation" -framework "UIKit" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AFNetworking 5 | 6 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | 27 | ## Masonry 28 | 29 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 30 | 31 | Permission is hereby granted, free of charge, to any person obtaining a copy 32 | of this software and associated documentation files (the "Software"), to deal 33 | in the Software without restriction, including without limitation the rights 34 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 35 | copies of the Software, and to permit persons to whom the Software is 36 | furnished to do so, subject to the following conditions: 37 | 38 | The above copyright notice and this permission notice shall be included in 39 | all copies or substantial portions of the Software. 40 | 41 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 42 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 43 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 44 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 45 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 46 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 47 | THE SOFTWARE. 48 | 49 | ## XMLDictionary 50 | 51 | XMLDictionary 52 | version 1.4, April 16th, 2014 53 | 54 | Copyright (C) 2011 Charcoal Design 55 | 56 | This software is provided 'as-is', without any express or implied 57 | warranty. In no event will the authors be held liable for any damages 58 | arising from the use of this software. 59 | 60 | Permission is granted to anyone to use this software for any purpose, 61 | including commercial applications, and to alter it and redistribute it 62 | freely, subject to the following restrictions: 63 | 64 | 1. The origin of this software must not be misrepresented; you must not 65 | claim that you wrote the original software. If you use this software 66 | in a product, an acknowledgment in the product documentation would be 67 | appreciated but is not required. 68 | 2. Altered source versions must be plainly marked as such, and must not be 69 | misrepresented as being the original software. 70 | 3. This notice may not be removed or altered from any source distribution. 71 | Generated by CocoaPods - http://cocoapods.org 72 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods : NSObject 3 | @end 4 | @implementation PodsDummy_Pods 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/XMLDictionary" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/Masonry" -isystem "${PODS_ROOT}/Headers/Public/XMLDictionary" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"Masonry" -l"XMLDictionary" -framework "CoreGraphics" -framework "Foundation" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/XMLDictionary" 3 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/Masonry" -isystem "${PODS_ROOT}/Headers/Public/XMLDictionary" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"Masonry" -l"XMLDictionary" -framework "CoreGraphics" -framework "Foundation" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" 5 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/XMLDictionary/XMLDictionary-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_XMLDictionary : NSObject 3 | @end 4 | @implementation PodsDummy_XMLDictionary 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/XMLDictionary/XMLDictionary-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/XMLDictionary/XMLDictionary.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/XMLDictionary" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/XMLDictionary" 3 | PODS_ROOT = ${SRCROOT} 4 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/XMLDictionary/LICENCE.md: -------------------------------------------------------------------------------- 1 | XMLDictionary 2 | version 1.4, April 16th, 2014 3 | 4 | Copyright (C) 2011 Charcoal Design 5 | 6 | This software is provided 'as-is', without any express or implied 7 | warranty. In no event will the authors be held liable for any damages 8 | arising from the use of this software. 9 | 10 | Permission is granted to anyone to use this software for any purpose, 11 | including commercial applications, and to alter it and redistribute it 12 | freely, subject to the following restrictions: 13 | 14 | 1. The origin of this software must not be misrepresented; you must not 15 | claim that you wrote the original software. If you use this software 16 | in a product, an acknowledgment in the product documentation would be 17 | appreciated but is not required. 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 3. This notice may not be removed or altered from any source distribution. -------------------------------------------------------------------------------- /Pods/XMLDictionary/XMLDictionary/XMLDictionary.h: -------------------------------------------------------------------------------- 1 | // 2 | // XMLDictionary.h 3 | // 4 | // Version 1.4 5 | // 6 | // Created by Nick Lockwood on 15/11/2010. 7 | // Copyright 2010 Charcoal Design. All rights reserved. 8 | // 9 | // Get the latest version of XMLDictionary from here: 10 | // 11 | // https://github.com/nicklockwood/XMLDictionary 12 | // 13 | // This software is provided 'as-is', without any express or implied 14 | // warranty. In no event will the authors be held liable for any damages 15 | // arising from the use of this software. 16 | // 17 | // Permission is granted to anyone to use this software for any purpose, 18 | // including commercial applications, and to alter it and redistribute it 19 | // freely, subject to the following restrictions: 20 | // 21 | // 1. The origin of this software must not be misrepresented; you must not 22 | // claim that you wrote the original software. If you use this software 23 | // in a product, an acknowledgment in the product documentation would be 24 | // appreciated but is not required. 25 | // 26 | // 2. Altered source versions must be plainly marked as such, and must not be 27 | // misrepresented as being the original software. 28 | // 29 | // 3. This notice may not be removed or altered from any source distribution. 30 | // 31 | 32 | #import 33 | #pragma GCC diagnostic push 34 | #pragma GCC diagnostic ignored "-Wobjc-missing-property-synthesis" 35 | 36 | 37 | typedef NS_ENUM(NSInteger, XMLDictionaryAttributesMode) 38 | { 39 | XMLDictionaryAttributesModePrefixed = 0, //default 40 | XMLDictionaryAttributesModeDictionary, 41 | XMLDictionaryAttributesModeUnprefixed, 42 | XMLDictionaryAttributesModeDiscard 43 | }; 44 | 45 | 46 | typedef NS_ENUM(NSInteger, XMLDictionaryNodeNameMode) 47 | { 48 | XMLDictionaryNodeNameModeRootOnly = 0, //default 49 | XMLDictionaryNodeNameModeAlways, 50 | XMLDictionaryNodeNameModeNever 51 | }; 52 | 53 | 54 | static NSString *const XMLDictionaryAttributesKey = @"__attributes"; 55 | static NSString *const XMLDictionaryCommentsKey = @"__comments"; 56 | static NSString *const XMLDictionaryTextKey = @"__text"; 57 | static NSString *const XMLDictionaryNodeNameKey = @"__name"; 58 | static NSString *const XMLDictionaryAttributePrefix = @"_"; 59 | 60 | 61 | @interface XMLDictionaryParser : NSObject 62 | 63 | + (XMLDictionaryParser *)sharedInstance; 64 | 65 | @property (nonatomic, assign) BOOL collapseTextNodes; // defaults to YES 66 | @property (nonatomic, assign) BOOL stripEmptyNodes; // defaults to YES 67 | @property (nonatomic, assign) BOOL trimWhiteSpace; // defaults to YES 68 | @property (nonatomic, assign) BOOL alwaysUseArrays; // defaults to NO 69 | @property (nonatomic, assign) BOOL preserveComments; // defaults to NO 70 | @property (nonatomic, assign) BOOL wrapRootNode; // defaults to NO 71 | 72 | @property (nonatomic, assign) XMLDictionaryAttributesMode attributesMode; 73 | @property (nonatomic, assign) XMLDictionaryNodeNameMode nodeNameMode; 74 | 75 | - (NSDictionary *)dictionaryWithParser:(NSXMLParser *)parser; 76 | - (NSDictionary *)dictionaryWithData:(NSData *)data; 77 | - (NSDictionary *)dictionaryWithString:(NSString *)string; 78 | - (NSDictionary *)dictionaryWithFile:(NSString *)path; 79 | 80 | @end 81 | 82 | 83 | @interface NSDictionary (XMLDictionary) 84 | 85 | + (NSDictionary *)dictionaryWithXMLParser:(NSXMLParser *)parser; 86 | + (NSDictionary *)dictionaryWithXMLData:(NSData *)data; 87 | + (NSDictionary *)dictionaryWithXMLString:(NSString *)string; 88 | + (NSDictionary *)dictionaryWithXMLFile:(NSString *)path; 89 | 90 | - (NSDictionary *)attributes; 91 | - (NSDictionary *)childNodes; 92 | - (NSArray *)comments; 93 | - (NSString *)nodeName; 94 | - (NSString *)innerText; 95 | - (NSString *)innerXML; 96 | - (NSString *)XMLString; 97 | 98 | - (NSArray *)arrayValueForKeyPath:(NSString *)keyPath; 99 | - (NSString *)stringValueForKeyPath:(NSString *)keyPath; 100 | - (NSDictionary *)dictionaryValueForKeyPath:(NSString *)keyPath; 101 | 102 | @end 103 | 104 | 105 | @interface NSString (XMLDictionary) 106 | 107 | - (NSString *)XMLEncodedString; 108 | 109 | @end 110 | 111 | 112 | #pragma GCC diagnostic pop 113 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PayDemo 2 | 支付宝和微信支付两种方式集成 3 | 4 | 做这两个支付集成的时候遇到了一些坑,特此写了一个小的DEMO供大家参考 5 | 6 | 1、支付宝的集成比较简单,主要就是一些设置上的问题; 7 | 2、微信的集成比较坑爹,而且官方文档写的也不清不楚的,坑了我很久。 8 | 9 | 项目中使用的pod添加了三个第三方的框架:AFNetworking Masonry XMLDictionary 10 | 11 | 一些iOS9的设置就不在下面提了,大家自行Google吧。 12 | 13 | # 支付宝支付 14 | 支付宝在官方文档中写的比较详细,给的DEMO也很清楚,大家跟着步骤走一步一步都能实现集成。主要是以下几个需要稍微注意一下 15 | 16 | 1、Header Search Paths的设置 17 | 18 | 添加支付宝官方库,导入系统库,其他的不需要设置太多。但是这一个必须要添加以下,不然openssl中的头文件引用会出现问题。 19 | 20 | 在项目->Build Settings->Header Search Paths中添加下面一行 21 | 22 | $(SRCROOT)/\*\*/\*\*/AlipaySDK 其中$(SRCROOT)是项目根目录,AlipaySDK是官方库所在的文件夹。中间路径需要自己添加。 23 | 24 | 2、appScheme的设置 25 | 26 | 支付宝有三个地方需要设置而且要保持一致,不然支付完成就无法跳转回应用。Demo中写的是alipayPayDemo 27 | 28 | 1)项目->Info->URL Types->“+”符号->URL Schemes 29 | 30 | 2)info.plist->URL Types->URL Schemes 此项一般添加1)后就会自动添加,如有修改记得修改此处。因为修改1),此处不会跟着修改。 31 | 32 | 3)AlipayHelper.m->@selector(alipay:block:)方法中的局部参数appScheme 33 | 34 | 3、跟服务端的交互的地方 35 | 36 | 只有获取订单信息的时候才会跟服务进行交互,所需要的参数在Product中。测试中price一般情况下都给0.01 37 | 38 | 4、系统繁忙,请稍后再试(ALI**) 39 | 40 | **数字类型可能不太一样,大概以下几种问题 41 | 42 | 1)私钥不正确 43 | 44 | 2)公钥、私钥没有上传到支付宝商户的后台 45 | 46 | 3)out_trade_no不能有符号 47 | 48 | 49 | # 微信支付 50 | 微信的设置上没太大问题,但是做的官方支持就非常差劲。而且还使用XML,这一条让一些人可能就懵逼了。 51 | 52 | 客户端需要做的两步,如果服务端做了统一下单的功能就缩短为一步了。 53 | 54 | 1、统一下单 55 | 56 | https://pay.weixin.qq.com/wiki/doc/api/app.php?chapter=9_1 ->API列表->统一下单 57 | 按照文档要求appid,mch_id,nonce_str,sign,body,out_trade_no,total_fee,spbill_create_ip,notify_url,trade_type这十个参数是必须的。 58 | 59 | 其中appid,mch_id是微信给的;trade_type传定值APP;nonce_str,spbill_create_ip是直接在手机上获取到的;body,out_trade_no,total_fee这三个是从服务端上获取的数据。sign根据以上键值对按照签名规则得到的。 60 | 61 | 完成之后要转化成XML格式上传到微信服务器。 62 | 63 | 第一个比较坑的地方在这,如果直接使用AF的POST方式是不行的,总是会返回"XML格式错误"。必须使用NSMutableURLRequest添加method和body,然后用AFHTTPRequestOperation进行网络请求才行。 64 | 65 | 66 | 67 | 然后接收到数据的返回。其中返回数据中有用的只有prepayid,其他的要么本地就有,要么就是恶心你的值。 68 | 69 | 2、客户端调起支付 70 | 71 | https://pay.weixin.qq.com/wiki/doc/api/app.php?chapter=9_1 ->API列表->调起支付接口 72 | 文档要求appid,partnerid,prepayid,package,noncestr,timestamp,sign这七个参数是必须的,但是DEMO中appid根本没有用到,所以其实只需要六个参数,这是第二个坑爹的地方!!! 73 | partnerid就是第一步的mch_id,prepayid是上一步返回的最重要的数据,package传定值Sign=WXPay,noncestr就是上一步中的nonce_str,timestamp这个按照规则生成十位的。 74 | 75 | sign是最最最坑的地方,不是上一步返回的那个sign,不是上一步返回的那个sign,不是上一步返回的那个sign。他是根据上面的五个参数进行签名得出的值。不然每次调用就只看见微信界面只有一个确定。 76 | 77 | 对于返回签名错误的,可以对照他们的签名测试工具检验。https://pay.weixin.qq.com/wiki/tools/signverify/ 78 | 79 | 以上~ 80 | 81 | 因安全原因项目中的一些配置参数已经删除,大家调试的时候需要添加本公司或个人申请的配置参数。 82 | 83 | 如有问题可发邮件至iOS_wpf@163.com、ioswpf@gmail.com,或新浪微博私信@弯弯月儿变鸟飞 84 | 85 | 86 | # ------分割线------ 87 | 88 | 建议各位看官参考此DEMO之前先详细了解官方的文档,熟悉之后如有有问题可以参考此DEMO或者微博、邮件咨询我。有些朋友在微博、邮件中提的问题,在官方文档中讲解的比我本人回答的要详细、专业,部分内容我也是从文档中拷贝出来给各位看官解答的~ 89 | 90 | 91 | 92 | --------------------------------------------------------------------------------