├── .gitignore ├── .swift-version ├── .travis.yml ├── Example ├── Podfile ├── Podfile.lock ├── Pods │ ├── AFNetworking │ │ ├── AFNetworking │ │ │ ├── AFCompatibilityMacros.h │ │ │ ├── AFHTTPSessionManager.h │ │ │ ├── AFHTTPSessionManager.m │ │ │ ├── AFNetworkReachabilityManager.h │ │ │ ├── AFNetworkReachabilityManager.m │ │ │ ├── AFNetworking.h │ │ │ ├── AFSecurityPolicy.h │ │ │ ├── AFSecurityPolicy.m │ │ │ ├── AFURLRequestSerialization.h │ │ │ ├── AFURLRequestSerialization.m │ │ │ ├── AFURLResponseSerialization.h │ │ │ ├── AFURLResponseSerialization.m │ │ │ ├── AFURLSessionManager.h │ │ │ └── AFURLSessionManager.m │ │ ├── LICENSE │ │ ├── README.md │ │ └── UIKit+AFNetworking │ │ │ ├── AFAutoPurgingImageCache.h │ │ │ ├── AFAutoPurgingImageCache.m │ │ │ ├── AFImageDownloader.h │ │ │ ├── AFImageDownloader.m │ │ │ ├── AFNetworkActivityIndicatorManager.h │ │ │ ├── AFNetworkActivityIndicatorManager.m │ │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ │ ├── UIActivityIndicatorView+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 │ ├── Local Podspecs │ │ └── TPFDebugTool.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ ├── Reveal-SDK │ │ └── RevealServer │ │ │ └── iOS │ │ │ └── RevealServer.framework │ │ │ ├── Headers │ │ │ └── RevealServer.h │ │ │ ├── Info.plist │ │ │ ├── Modules │ │ │ └── module.modulemap │ │ │ ├── RevealServer │ │ │ ├── Scripts │ │ │ └── copy_and_codesign_revealserver.sh │ │ │ └── _CodeSignature │ │ │ └── CodeResources │ └── Target Support Files │ │ ├── AFNetworking │ │ ├── AFNetworking-Info.plist │ │ ├── AFNetworking-dummy.m │ │ ├── AFNetworking-prefix.pch │ │ ├── AFNetworking-umbrella.h │ │ ├── AFNetworking.debug.xcconfig │ │ ├── AFNetworking.modulemap │ │ ├── AFNetworking.release.xcconfig │ │ ├── AFNetworking.xcconfig │ │ └── Info.plist │ │ ├── Pods-TPFDebugTool_Example │ │ ├── Info.plist │ │ ├── Pods-TPFDebugTool_Example-Info.plist │ │ ├── Pods-TPFDebugTool_Example-acknowledgements.markdown │ │ ├── Pods-TPFDebugTool_Example-acknowledgements.plist │ │ ├── Pods-TPFDebugTool_Example-dummy.m │ │ ├── Pods-TPFDebugTool_Example-frameworks.sh │ │ ├── Pods-TPFDebugTool_Example-resources.sh │ │ ├── Pods-TPFDebugTool_Example-umbrella.h │ │ ├── Pods-TPFDebugTool_Example.debug.xcconfig │ │ ├── Pods-TPFDebugTool_Example.modulemap │ │ └── Pods-TPFDebugTool_Example.release.xcconfig │ │ ├── Reveal-SDK │ │ ├── Reveal-SDK.debug.xcconfig │ │ ├── Reveal-SDK.release.xcconfig │ │ └── Reveal-SDK.xcconfig │ │ └── TPFDebugTool │ │ ├── Info.plist │ │ ├── ResourceBundle-TPFDebugTool-Info.plist │ │ ├── ResourceBundle-TPFDebugTool-TPFDebugTool-Info.plist │ │ ├── TPFDebugTool-Info.plist │ │ ├── TPFDebugTool-dummy.m │ │ ├── TPFDebugTool-prefix.pch │ │ ├── TPFDebugTool-umbrella.h │ │ ├── TPFDebugTool.debug.xcconfig │ │ ├── TPFDebugTool.modulemap │ │ ├── TPFDebugTool.release.xcconfig │ │ └── TPFDebugTool.xcconfig ├── TPFDebugTool.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── TPFDebugTool-Example.xcscheme ├── TPFDebugTool.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── TPFDebugTool │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── TPFAppDelegate.h │ ├── TPFAppDelegate.m │ ├── TPFDebugTool-Info.plist │ ├── TPFDebugTool-Prefix.pch │ ├── TPFViewController.h │ ├── TPFViewController.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m └── Tests │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── Tests.m │ └── en.lproj │ └── InfoPlist.strings ├── LICENSE ├── README.md ├── TPFDebugTool.podspec ├── TPFDebugTool ├── Assets │ ├── .gitkeep │ ├── YDRequestCell.xib │ └── YDRequestVC.xib └── Classes │ ├── .gitkeep │ ├── JxbBaseVC.h │ ├── JxbBaseVC.m │ ├── JxbContentVC.h │ ├── JxbContentVC.m │ ├── JxbCrashHelper.h │ ├── JxbCrashHelper.m │ ├── JxbCrashVC.h │ ├── JxbCrashVC.m │ ├── JxbDebugTool.h │ ├── JxbDebugTool.m │ ├── JxbDebugVC.h │ ├── JxbDebugVC.m │ ├── JxbHttpCell.h │ ├── JxbHttpCell.m │ ├── JxbHttpDatasource.h │ ├── JxbHttpDatasource.m │ ├── JxbHttpDetailVC.h │ ├── JxbHttpDetailVC.m │ ├── JxbHttpProtocol.h │ ├── JxbHttpProtocol.m │ ├── JxbHttpVC.h │ ├── JxbHttpVC.m │ ├── JxbLogVC.h │ ├── JxbLogVC.m │ ├── JxbMemoryHelper.h │ ├── JxbMemoryHelper.m │ ├── JxbResponseVC.h │ ├── JxbResponseVC.m │ ├── NSURLRequest+Identify.h │ ├── NSURLRequest+Identify.m │ ├── NSURLResponse+Data.h │ ├── NSURLResponse+Data.m │ ├── NSURLSessionTask+Data.h │ ├── NSURLSessionTask+Data.m │ ├── NSURLSessionTask+Swizzling.h │ ├── NSURLSessionTask+Swizzling.m │ ├── TPFDebugTool.pch │ ├── YDHtmlDisplayUtils.h │ ├── YDHtmlDisplayUtils.m │ ├── YDJSONDisplayUtils.h │ ├── YDJSONDisplayUtils.m │ ├── YDNameValueModel.h │ ├── YDNameValueModel.m │ ├── YDRequestCell.h │ ├── YDRequestCell.m │ ├── YDRequestVC.h │ └── YDRequestVC.m └── _Pods.xcodeproj /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | Carthage 26 | # We recommend against adding the Pods directory to your .gitignore. However 27 | # you should judge for yourself, the pros and cons are mentioned at: 28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 29 | # 30 | # Note: if you ignore the Pods directory, make sure to uncomment 31 | # `pod install` in .travis.yml 32 | # 33 | # Pods/ 34 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 2.3 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | # before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild test -workspace Example/TPFDebugTool.xcworkspace -scheme TPFDebugTool-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | target 'TPFDebugTool_Example' do 4 | 5 | pod 'TPFDebugTool', :path => '../' 6 | pod 'AFNetworking' 7 | pod 'Reveal-SDK','24' 8 | 9 | post_install do |installer| 10 | installer.pods_project.build_configurations.each do |config| 11 | config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" 12 | end 13 | end 14 | 15 | end 16 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (3.2.1): 3 | - AFNetworking/NSURLSession (= 3.2.1) 4 | - AFNetworking/Reachability (= 3.2.1) 5 | - AFNetworking/Security (= 3.2.1) 6 | - AFNetworking/Serialization (= 3.2.1) 7 | - AFNetworking/UIKit (= 3.2.1) 8 | - AFNetworking/NSURLSession (3.2.1): 9 | - AFNetworking/Reachability 10 | - AFNetworking/Security 11 | - AFNetworking/Serialization 12 | - AFNetworking/Reachability (3.2.1) 13 | - AFNetworking/Security (3.2.1) 14 | - AFNetworking/Serialization (3.2.1) 15 | - AFNetworking/UIKit (3.2.1): 16 | - AFNetworking/NSURLSession 17 | - Reveal-SDK (24) 18 | - TPFDebugTool (0.2.3) 19 | 20 | DEPENDENCIES: 21 | - AFNetworking 22 | - Reveal-SDK (= 24) 23 | - TPFDebugTool (from `../`) 24 | 25 | SPEC REPOS: 26 | https://github.com/CocoaPods/Specs.git: 27 | - AFNetworking 28 | trunk: 29 | - Reveal-SDK 30 | 31 | EXTERNAL SOURCES: 32 | TPFDebugTool: 33 | :path: "../" 34 | 35 | SPEC CHECKSUMS: 36 | AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057 37 | Reveal-SDK: 5d7e56b8f018c0a88b3a2c10bf68d598bbd3b071 38 | TPFDebugTool: ed0369b4b7abd3e9d6f0c7b8018513da08db991f 39 | 40 | PODFILE CHECKSUM: 6a4f393dbc3d2a902f658616e3e87bc38db23f12 41 | 42 | COCOAPODS: 1.11.2 43 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/AFNetworking/AFCompatibilityMacros.h: -------------------------------------------------------------------------------- 1 | // AFCompatibilityMacros.h 2 | // Copyright (c) 2011–2016 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 | #ifndef AFCompatibilityMacros_h 23 | #define AFCompatibilityMacros_h 24 | 25 | #ifdef API_UNAVAILABLE 26 | #define AF_API_UNAVAILABLE(x) API_UNAVAILABLE(x) 27 | #else 28 | #define AF_API_UNAVAILABLE(x) 29 | #endif // API_UNAVAILABLE 30 | 31 | #if __has_warning("-Wunguarded-availability-new") 32 | #define AF_CAN_USE_AT_AVAILABLE 1 33 | #else 34 | #define AF_CAN_USE_AT_AVAILABLE 0 35 | #endif 36 | 37 | #endif /* AFCompatibilityMacros_h */ 38 | -------------------------------------------------------------------------------- /Example/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 | #import 26 | 27 | #ifndef _AFNETWORKING_ 28 | #define _AFNETWORKING_ 29 | 30 | #import "AFURLRequestSerialization.h" 31 | #import "AFURLResponseSerialization.h" 32 | #import "AFSecurityPolicy.h" 33 | 34 | #if !TARGET_OS_WATCH 35 | #import "AFNetworkReachabilityManager.h" 36 | #endif 37 | 38 | #import "AFURLSessionManager.h" 39 | #import "AFHTTPSessionManager.h" 40 | 41 | #endif /* _AFNETWORKING_ */ 42 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | // AFSecurityPolicy.h 2 | // Copyright (c) 2011–2016 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 | #import 24 | 25 | typedef NS_ENUM(NSUInteger, AFSSLPinningMode) { 26 | AFSSLPinningModeNone, 27 | AFSSLPinningModePublicKey, 28 | AFSSLPinningModeCertificate, 29 | }; 30 | 31 | /** 32 | `AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections. 33 | 34 | Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled. 35 | */ 36 | 37 | NS_ASSUME_NONNULL_BEGIN 38 | 39 | @interface AFSecurityPolicy : NSObject 40 | 41 | /** 42 | The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`. 43 | */ 44 | @property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode; 45 | 46 | /** 47 | The certificates used to evaluate server trust according to the SSL pinning mode. 48 | 49 | By default, this property is set to any (`.cer`) certificates included in the target compiling AFNetworking. Note that if you are using AFNetworking as embedded framework, no certificates will be pinned by default. Use `certificatesInBundle` to load certificates from your target, and then create a new policy by calling `policyWithPinningMode:withPinnedCertificates`. 50 | 51 | Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches. 52 | */ 53 | @property (nonatomic, strong, nullable) NSSet *pinnedCertificates; 54 | 55 | /** 56 | Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`. 57 | */ 58 | @property (nonatomic, assign) BOOL allowInvalidCertificates; 59 | 60 | /** 61 | Whether or not to validate the domain name in the certificate's CN field. Defaults to `YES`. 62 | */ 63 | @property (nonatomic, assign) BOOL validatesDomainName; 64 | 65 | ///----------------------------------------- 66 | /// @name Getting Certificates from the Bundle 67 | ///----------------------------------------- 68 | 69 | /** 70 | Returns any certificates included in the bundle. If you are using AFNetworking as an embedded framework, you must use this method to find the certificates you have included in your app bundle, and use them when creating your security policy by calling `policyWithPinningMode:withPinnedCertificates`. 71 | 72 | @return The certificates included in the given bundle. 73 | */ 74 | + (NSSet *)certificatesInBundle:(NSBundle *)bundle; 75 | 76 | ///----------------------------------------- 77 | /// @name Getting Specific Security Policies 78 | ///----------------------------------------- 79 | 80 | /** 81 | Returns the shared default security policy, which does not allow invalid certificates, validates domain name, and does not validate against pinned certificates or public keys. 82 | 83 | @return The default security policy. 84 | */ 85 | + (instancetype)defaultPolicy; 86 | 87 | ///--------------------- 88 | /// @name Initialization 89 | ///--------------------- 90 | 91 | /** 92 | Creates and returns a security policy with the specified pinning mode. 93 | 94 | @param pinningMode The SSL pinning mode. 95 | 96 | @return A new security policy. 97 | */ 98 | + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode; 99 | 100 | /** 101 | Creates and returns a security policy with the specified pinning mode. 102 | 103 | @param pinningMode The SSL pinning mode. 104 | @param pinnedCertificates The certificates to pin against. 105 | 106 | @return A new security policy. 107 | */ 108 | + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates; 109 | 110 | ///------------------------------ 111 | /// @name Evaluating Server Trust 112 | ///------------------------------ 113 | 114 | /** 115 | Whether or not the specified server trust should be accepted, based on the security policy. 116 | 117 | This method should be used when responding to an authentication challenge from a server. 118 | 119 | @param serverTrust The X.509 certificate trust of the server. 120 | @param domain The domain of serverTrust. If `nil`, the domain will not be validated. 121 | 122 | @return Whether or not to trust the server. 123 | */ 124 | - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust 125 | forDomain:(nullable NSString *)domain; 126 | 127 | @end 128 | 129 | NS_ASSUME_NONNULL_END 130 | 131 | ///---------------- 132 | /// @name Constants 133 | ///---------------- 134 | 135 | /** 136 | ## SSL Pinning Modes 137 | 138 | The following constants are provided by `AFSSLPinningMode` as possible SSL pinning modes. 139 | 140 | enum { 141 | AFSSLPinningModeNone, 142 | AFSSLPinningModePublicKey, 143 | AFSSLPinningModeCertificate, 144 | } 145 | 146 | `AFSSLPinningModeNone` 147 | Do not used pinned certificates to validate servers. 148 | 149 | `AFSSLPinningModePublicKey` 150 | Validate host certificates against public keys of pinned certificates. 151 | 152 | `AFSSLPinningModeCertificate` 153 | Validate host certificates against pinned certificates. 154 | */ 155 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2016 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 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h: -------------------------------------------------------------------------------- 1 | // AFAutoPurgingImageCache.h 2 | // Copyright (c) 2011–2016 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 | #import 24 | 25 | #if TARGET_OS_IOS || TARGET_OS_TV 26 | #import 27 | 28 | NS_ASSUME_NONNULL_BEGIN 29 | 30 | /** 31 | The `AFImageCache` protocol defines a set of APIs for adding, removing and fetching images from a cache synchronously. 32 | */ 33 | @protocol AFImageCache 34 | 35 | /** 36 | Adds the image to the cache with the given identifier. 37 | 38 | @param image The image to cache. 39 | @param identifier The unique identifier for the image in the cache. 40 | */ 41 | - (void)addImage:(UIImage *)image withIdentifier:(NSString *)identifier; 42 | 43 | /** 44 | Removes the image from the cache matching the given identifier. 45 | 46 | @param identifier The unique identifier for the image in the cache. 47 | 48 | @return A BOOL indicating whether or not the image was removed from the cache. 49 | */ 50 | - (BOOL)removeImageWithIdentifier:(NSString *)identifier; 51 | 52 | /** 53 | Removes all images from the cache. 54 | 55 | @return A BOOL indicating whether or not all images were removed from the cache. 56 | */ 57 | - (BOOL)removeAllImages; 58 | 59 | /** 60 | Returns the image in the cache associated with the given identifier. 61 | 62 | @param identifier The unique identifier for the image in the cache. 63 | 64 | @return An image for the matching identifier, or nil. 65 | */ 66 | - (nullable UIImage *)imageWithIdentifier:(NSString *)identifier; 67 | @end 68 | 69 | 70 | /** 71 | The `ImageRequestCache` protocol extends the `ImageCache` protocol by adding methods for adding, removing and fetching images from a cache given an `NSURLRequest` and additional identifier. 72 | */ 73 | @protocol AFImageRequestCache 74 | 75 | /** 76 | Asks if the image should be cached using an identifier created from the request and additional identifier. 77 | 78 | @param image The image to be cached. 79 | @param request The unique URL request identifing the image asset. 80 | @param identifier The additional identifier to apply to the URL request to identify the image. 81 | 82 | @return A BOOL indicating whether or not the image should be added to the cache. YES will cache, NO will prevent caching. 83 | */ 84 | - (BOOL)shouldCacheImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; 85 | 86 | /** 87 | Adds the image to the cache using an identifier created from the request and additional identifier. 88 | 89 | @param image The image to cache. 90 | @param request The unique URL request identifing the image asset. 91 | @param identifier The additional identifier to apply to the URL request to identify the image. 92 | */ 93 | - (void)addImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; 94 | 95 | /** 96 | Removes the image from the cache using an identifier created from the request and additional identifier. 97 | 98 | @param request The unique URL request identifing the image asset. 99 | @param identifier The additional identifier to apply to the URL request to identify the image. 100 | 101 | @return A BOOL indicating whether or not all images were removed from the cache. 102 | */ 103 | - (BOOL)removeImageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; 104 | 105 | /** 106 | Returns the image from the cache associated with an identifier created from the request and additional identifier. 107 | 108 | @param request The unique URL request identifing the image asset. 109 | @param identifier The additional identifier to apply to the URL request to identify the image. 110 | 111 | @return An image for the matching request and identifier, or nil. 112 | */ 113 | - (nullable UIImage *)imageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; 114 | 115 | @end 116 | 117 | /** 118 | The `AutoPurgingImageCache` in an in-memory image cache used to store images up to a given memory capacity. When the memory capacity is reached, the image cache is sorted by last access date, then the oldest image is continuously purged until the preferred memory usage after purge is met. Each time an image is accessed through the cache, the internal access date of the image is updated. 119 | */ 120 | @interface AFAutoPurgingImageCache : NSObject 121 | 122 | /** 123 | The total memory capacity of the cache in bytes. 124 | */ 125 | @property (nonatomic, assign) UInt64 memoryCapacity; 126 | 127 | /** 128 | The preferred memory usage after purge in bytes. During a purge, images will be purged until the memory capacity drops below this limit. 129 | */ 130 | @property (nonatomic, assign) UInt64 preferredMemoryUsageAfterPurge; 131 | 132 | /** 133 | The current total memory usage in bytes of all images stored within the cache. 134 | */ 135 | @property (nonatomic, assign, readonly) UInt64 memoryUsage; 136 | 137 | /** 138 | Initialies the `AutoPurgingImageCache` instance with default values for memory capacity and preferred memory usage after purge limit. `memoryCapcity` defaults to `100 MB`. `preferredMemoryUsageAfterPurge` defaults to `60 MB`. 139 | 140 | @return The new `AutoPurgingImageCache` instance. 141 | */ 142 | - (instancetype)init; 143 | 144 | /** 145 | Initialies the `AutoPurgingImageCache` instance with the given memory capacity and preferred memory usage 146 | after purge limit. 147 | 148 | @param memoryCapacity The total memory capacity of the cache in bytes. 149 | @param preferredMemoryCapacity The preferred memory usage after purge in bytes. 150 | 151 | @return The new `AutoPurgingImageCache` instance. 152 | */ 153 | - (instancetype)initWithMemoryCapacity:(UInt64)memoryCapacity preferredMemoryCapacity:(UInt64)preferredMemoryCapacity; 154 | 155 | @end 156 | 157 | NS_ASSUME_NONNULL_END 158 | 159 | #endif 160 | 161 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | // AFNetworkActivityIndicatorManager.h 2 | // Copyright (c) 2011–2016 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 TARGET_OS_IOS 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 session task 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 manager is currently active. 56 | */ 57 | @property (readonly, nonatomic, assign, getter=isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible; 58 | 59 | /** 60 | A time interval indicating the minimum duration of networking activity that should occur before the activity indicator is displayed. The default value 1 second. If the network activity indicator should be displayed immediately when network activity occurs, this value should be set to 0 seconds. 61 | 62 | Apple's HIG describes the following: 63 | 64 | > Display the network activity indicator to provide feedback when your app accesses the network for more than a couple of seconds. If the operation finishes sooner than that, you don’t have to show the network activity indicator, because the indicator is likely to disappear before users notice its presence. 65 | 66 | */ 67 | @property (nonatomic, assign) NSTimeInterval activationDelay; 68 | 69 | /** 70 | A time interval indicating the duration of time of no networking activity required before the activity indicator is disabled. This allows for continuous display of the network activity indicator across multiple requests. The default value is 0.17 seconds. 71 | */ 72 | 73 | @property (nonatomic, assign) NSTimeInterval completionDelay; 74 | 75 | /** 76 | Returns the shared network activity indicator manager object for the system. 77 | 78 | @return The systemwide network activity indicator manager. 79 | */ 80 | + (instancetype)sharedManager; 81 | 82 | /** 83 | Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator. 84 | */ 85 | - (void)incrementActivityCount; 86 | 87 | /** 88 | Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator. 89 | */ 90 | - (void)decrementActivityCount; 91 | 92 | /** 93 | Set the a custom method to be executed when the network activity indicator manager should be hidden/shown. By default, this is null, and the UIApplication Network Activity Indicator will be managed automatically. If this block is set, it is the responsiblity of the caller to manager the network activity indicator going forward. 94 | 95 | @param block A block to be executed when the network activity indicator status changes. 96 | */ 97 | - (void)setNetworkingActivityActionWithBlock:(nullable void (^)(BOOL networkActivityIndicatorVisible))block; 98 | 99 | @end 100 | 101 | NS_ASSUME_NONNULL_END 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIActivityIndicatorView+AFNetworking.h 2 | // Copyright (c) 2011–2016 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 TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import 29 | 30 | /** 31 | 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 session task. 32 | */ 33 | @interface UIActivityIndicatorView (AFNetworking) 34 | 35 | ///---------------------------------- 36 | /// @name Animating for Session Tasks 37 | ///---------------------------------- 38 | 39 | /** 40 | Binds the animating state to the state of the specified task. 41 | 42 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 43 | */ 44 | - (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task; 45 | 46 | @end 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIActivityIndicatorView+AFNetworking.m 2 | // Copyright (c) 2011–2016 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 "UIActivityIndicatorView+AFNetworking.h" 23 | #import 24 | 25 | #if TARGET_OS_IOS || TARGET_OS_TV 26 | 27 | #import "AFURLSessionManager.h" 28 | 29 | @interface AFActivityIndicatorViewNotificationObserver : NSObject 30 | @property (readonly, nonatomic, weak) UIActivityIndicatorView *activityIndicatorView; 31 | - (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView; 32 | 33 | - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task; 34 | 35 | @end 36 | 37 | @implementation UIActivityIndicatorView (AFNetworking) 38 | 39 | - (AFActivityIndicatorViewNotificationObserver *)af_notificationObserver { 40 | AFActivityIndicatorViewNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver)); 41 | if (notificationObserver == nil) { 42 | notificationObserver = [[AFActivityIndicatorViewNotificationObserver alloc] initWithActivityIndicatorView:self]; 43 | objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 44 | } 45 | return notificationObserver; 46 | } 47 | 48 | - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { 49 | [[self af_notificationObserver] setAnimatingWithStateOfTask:task]; 50 | } 51 | 52 | @end 53 | 54 | @implementation AFActivityIndicatorViewNotificationObserver 55 | 56 | - (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView 57 | { 58 | self = [super init]; 59 | if (self) { 60 | _activityIndicatorView = activityIndicatorView; 61 | } 62 | return self; 63 | } 64 | 65 | - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { 66 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 67 | 68 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 69 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 70 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 71 | 72 | if (task) { 73 | if (task.state != NSURLSessionTaskStateCompleted) { 74 | UIActivityIndicatorView *activityIndicatorView = self.activityIndicatorView; 75 | if (task.state == NSURLSessionTaskStateRunning) { 76 | [activityIndicatorView startAnimating]; 77 | } else { 78 | [activityIndicatorView stopAnimating]; 79 | } 80 | 81 | [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingTaskDidResumeNotification object:task]; 82 | [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidCompleteNotification object:task]; 83 | [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidSuspendNotification object:task]; 84 | } 85 | } 86 | } 87 | 88 | #pragma mark - 89 | 90 | - (void)af_startAnimating { 91 | dispatch_async(dispatch_get_main_queue(), ^{ 92 | [self.activityIndicatorView startAnimating]; 93 | }); 94 | } 95 | 96 | - (void)af_stopAnimating { 97 | dispatch_async(dispatch_get_main_queue(), ^{ 98 | [self.activityIndicatorView stopAnimating]; 99 | }); 100 | } 101 | 102 | #pragma mark - 103 | 104 | - (void)dealloc { 105 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 106 | 107 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 108 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 109 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 110 | } 111 | 112 | @end 113 | 114 | #endif 115 | -------------------------------------------------------------------------------- /Example/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 TARGET_OS_IOS || TARGET_OS_TV 26 | 27 | #import 28 | 29 | @interface UIImage (AFNetworking) 30 | 31 | + (UIImage*) safeImageWithData:(NSData*)data; 32 | 33 | @end 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIImageView+AFNetworking.h 2 | // Copyright (c) 2011–2016 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 TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @class AFImageDownloader; 33 | 34 | /** 35 | This category adds methods to the UIKit framework's `UIImageView` class. The methods in this category provide support for loading remote images asynchronously from a URL. 36 | */ 37 | @interface UIImageView (AFNetworking) 38 | 39 | ///------------------------------------ 40 | /// @name Accessing the Image Downloader 41 | ///------------------------------------ 42 | 43 | /** 44 | Set the shared image downloader used to download images. 45 | 46 | @param imageDownloader The shared image downloader used to download images. 47 | */ 48 | + (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader; 49 | 50 | /** 51 | The shared image downloader used to download images. 52 | */ 53 | + (AFImageDownloader *)sharedImageDownloader; 54 | 55 | ///-------------------- 56 | /// @name Setting Image 57 | ///-------------------- 58 | 59 | /** 60 | Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. 61 | 62 | If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. 63 | 64 | By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:` 65 | 66 | @param url The URL used for the image request. 67 | */ 68 | - (void)setImageWithURL:(NSURL *)url; 69 | 70 | /** 71 | Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. 72 | 73 | If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. 74 | 75 | By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:` 76 | 77 | @param url The URL used for the image request. 78 | @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes. 79 | */ 80 | - (void)setImageWithURL:(NSURL *)url 81 | placeholderImage:(nullable UIImage *)placeholderImage; 82 | 83 | /** 84 | Asynchronously downloads an image from the specified URL request, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. 85 | 86 | If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. 87 | 88 | If a success block is specified, it is the responsibility of the block to set the image of the image view before returning. If no success block is specified, the default behavior of setting the image with `self.image = image` is applied. 89 | 90 | @param urlRequest The URL request used for the image request. 91 | @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes. 92 | @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. 93 | @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. 94 | */ 95 | - (void)setImageWithURLRequest:(NSURLRequest *)urlRequest 96 | placeholderImage:(nullable UIImage *)placeholderImage 97 | success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success 98 | failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; 99 | 100 | /** 101 | Cancels any executing image operation for the receiver, if one exists. 102 | */ 103 | - (void)cancelImageDownloadTask; 104 | 105 | @end 106 | 107 | NS_ASSUME_NONNULL_END 108 | 109 | #endif 110 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIImageView+AFNetworking.m 2 | // Copyright (c) 2011–2016 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 "UIImageView+AFNetworking.h" 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import "AFImageDownloader.h" 29 | 30 | @interface UIImageView (_AFNetworking) 31 | @property (readwrite, nonatomic, strong, setter = af_setActiveImageDownloadReceipt:) AFImageDownloadReceipt *af_activeImageDownloadReceipt; 32 | @end 33 | 34 | @implementation UIImageView (_AFNetworking) 35 | 36 | - (AFImageDownloadReceipt *)af_activeImageDownloadReceipt { 37 | return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, @selector(af_activeImageDownloadReceipt)); 38 | } 39 | 40 | - (void)af_setActiveImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt { 41 | objc_setAssociatedObject(self, @selector(af_activeImageDownloadReceipt), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 42 | } 43 | 44 | @end 45 | 46 | #pragma mark - 47 | 48 | @implementation UIImageView (AFNetworking) 49 | 50 | + (AFImageDownloader *)sharedImageDownloader { 51 | return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance]; 52 | } 53 | 54 | + (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader { 55 | objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 56 | } 57 | 58 | #pragma mark - 59 | 60 | - (void)setImageWithURL:(NSURL *)url { 61 | [self setImageWithURL:url placeholderImage:nil]; 62 | } 63 | 64 | - (void)setImageWithURL:(NSURL *)url 65 | placeholderImage:(UIImage *)placeholderImage 66 | { 67 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; 68 | [request addValue:@"image/*" forHTTPHeaderField:@"Accept"]; 69 | 70 | [self setImageWithURLRequest:request placeholderImage:placeholderImage success:nil failure:nil]; 71 | } 72 | 73 | - (void)setImageWithURLRequest:(NSURLRequest *)urlRequest 74 | placeholderImage:(UIImage *)placeholderImage 75 | success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success 76 | failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure 77 | { 78 | 79 | if ([urlRequest URL] == nil) { 80 | self.image = placeholderImage; 81 | if (failure) { 82 | NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorBadURL userInfo:nil]; 83 | failure(urlRequest, nil, error); 84 | } 85 | return; 86 | } 87 | 88 | if ([self isActiveTaskURLEqualToURLRequest:urlRequest]){ 89 | return; 90 | } 91 | 92 | [self cancelImageDownloadTask]; 93 | 94 | AFImageDownloader *downloader = [[self class] sharedImageDownloader]; 95 | id imageCache = downloader.imageCache; 96 | 97 | //Use the image from the image cache if it exists 98 | UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil]; 99 | if (cachedImage) { 100 | if (success) { 101 | success(urlRequest, nil, cachedImage); 102 | } else { 103 | self.image = cachedImage; 104 | } 105 | [self clearActiveDownloadInformation]; 106 | } else { 107 | if (placeholderImage) { 108 | self.image = placeholderImage; 109 | } 110 | 111 | __weak __typeof(self)weakSelf = self; 112 | NSUUID *downloadID = [NSUUID UUID]; 113 | AFImageDownloadReceipt *receipt; 114 | receipt = [downloader 115 | downloadImageForURLRequest:urlRequest 116 | withReceiptID:downloadID 117 | success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) { 118 | __strong __typeof(weakSelf)strongSelf = weakSelf; 119 | if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) { 120 | if (success) { 121 | success(request, response, responseObject); 122 | } else if(responseObject) { 123 | strongSelf.image = responseObject; 124 | } 125 | [strongSelf clearActiveDownloadInformation]; 126 | } 127 | 128 | } 129 | failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) { 130 | __strong __typeof(weakSelf)strongSelf = weakSelf; 131 | if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) { 132 | if (failure) { 133 | failure(request, response, error); 134 | } 135 | [strongSelf clearActiveDownloadInformation]; 136 | } 137 | }]; 138 | 139 | self.af_activeImageDownloadReceipt = receipt; 140 | } 141 | } 142 | 143 | - (void)cancelImageDownloadTask { 144 | if (self.af_activeImageDownloadReceipt != nil) { 145 | [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:self.af_activeImageDownloadReceipt]; 146 | [self clearActiveDownloadInformation]; 147 | } 148 | } 149 | 150 | - (void)clearActiveDownloadInformation { 151 | self.af_activeImageDownloadReceipt = nil; 152 | } 153 | 154 | - (BOOL)isActiveTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest { 155 | return [self.af_activeImageDownloadReceipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString]; 156 | } 157 | 158 | @end 159 | 160 | #endif 161 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIKit+AFNetworking.h 2 | // 3 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 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 || TARGET_OS_TV 24 | #import 25 | 26 | #ifndef _UIKIT_AFNETWORKING_ 27 | #define _UIKIT_AFNETWORKING_ 28 | 29 | #if TARGET_OS_IOS 30 | #import "AFAutoPurgingImageCache.h" 31 | #import "AFImageDownloader.h" 32 | #import "AFNetworkActivityIndicatorManager.h" 33 | #import "UIRefreshControl+AFNetworking.h" 34 | #import "UIWebView+AFNetworking.h" 35 | #endif 36 | 37 | #import "UIActivityIndicatorView+AFNetworking.h" 38 | #import "UIButton+AFNetworking.h" 39 | #import "UIImageView+AFNetworking.h" 40 | #import "UIProgressView+AFNetworking.h" 41 | #endif /* _UIKIT_AFNETWORKING_ */ 42 | #endif 43 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIProgressView+AFNetworking.h 2 | // Copyright (c) 2011–2016 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 TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | 33 | /** 34 | 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. 35 | */ 36 | @interface UIProgressView (AFNetworking) 37 | 38 | ///------------------------------------ 39 | /// @name Setting Session Task Progress 40 | ///------------------------------------ 41 | 42 | /** 43 | Binds the progress to the upload progress of the specified session task. 44 | 45 | @param task The session task. 46 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 47 | */ 48 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task 49 | animated:(BOOL)animated; 50 | 51 | /** 52 | Binds the progress to the download progress of the specified session task. 53 | 54 | @param task The session task. 55 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 56 | */ 57 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task 58 | animated:(BOOL)animated; 59 | 60 | @end 61 | 62 | NS_ASSUME_NONNULL_END 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIProgressView+AFNetworking.m 2 | // Copyright (c) 2011–2016 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 "UIProgressView+AFNetworking.h" 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import "AFURLSessionManager.h" 29 | 30 | static void * AFTaskCountOfBytesSentContext = &AFTaskCountOfBytesSentContext; 31 | static void * AFTaskCountOfBytesReceivedContext = &AFTaskCountOfBytesReceivedContext; 32 | 33 | #pragma mark - 34 | 35 | @implementation UIProgressView (AFNetworking) 36 | 37 | - (BOOL)af_uploadProgressAnimated { 38 | return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_uploadProgressAnimated)) boolValue]; 39 | } 40 | 41 | - (void)af_setUploadProgressAnimated:(BOOL)animated { 42 | objc_setAssociatedObject(self, @selector(af_uploadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 43 | } 44 | 45 | - (BOOL)af_downloadProgressAnimated { 46 | return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_downloadProgressAnimated)) boolValue]; 47 | } 48 | 49 | - (void)af_setDownloadProgressAnimated:(BOOL)animated { 50 | objc_setAssociatedObject(self, @selector(af_downloadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 51 | } 52 | 53 | #pragma mark - 54 | 55 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task 56 | animated:(BOOL)animated 57 | { 58 | if (task.state == NSURLSessionTaskStateCompleted) { 59 | return; 60 | } 61 | 62 | [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext]; 63 | [task addObserver:self forKeyPath:@"countOfBytesSent" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext]; 64 | 65 | [self af_setUploadProgressAnimated:animated]; 66 | } 67 | 68 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task 69 | animated:(BOOL)animated 70 | { 71 | if (task.state == NSURLSessionTaskStateCompleted) { 72 | return; 73 | } 74 | 75 | [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext]; 76 | [task addObserver:self forKeyPath:@"countOfBytesReceived" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext]; 77 | 78 | [self af_setDownloadProgressAnimated:animated]; 79 | } 80 | 81 | #pragma mark - NSKeyValueObserving 82 | 83 | - (void)observeValueForKeyPath:(NSString *)keyPath 84 | ofObject:(id)object 85 | change:(__unused NSDictionary *)change 86 | context:(void *)context 87 | { 88 | if (context == AFTaskCountOfBytesSentContext || context == AFTaskCountOfBytesReceivedContext) { 89 | if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesSent))]) { 90 | if ([object countOfBytesExpectedToSend] > 0) { 91 | dispatch_async(dispatch_get_main_queue(), ^{ 92 | [self setProgress:[object countOfBytesSent] / ([object countOfBytesExpectedToSend] * 1.0f) animated:self.af_uploadProgressAnimated]; 93 | }); 94 | } 95 | } 96 | 97 | if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesReceived))]) { 98 | if ([object countOfBytesExpectedToReceive] > 0) { 99 | dispatch_async(dispatch_get_main_queue(), ^{ 100 | [self setProgress:[object countOfBytesReceived] / ([object countOfBytesExpectedToReceive] * 1.0f) animated:self.af_downloadProgressAnimated]; 101 | }); 102 | } 103 | } 104 | 105 | if ([keyPath isEqualToString:NSStringFromSelector(@selector(state))]) { 106 | if ([(NSURLSessionTask *)object state] == NSURLSessionTaskStateCompleted) { 107 | @try { 108 | [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(state))]; 109 | 110 | if (context == AFTaskCountOfBytesSentContext) { 111 | [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesSent))]; 112 | } 113 | 114 | if (context == AFTaskCountOfBytesReceivedContext) { 115 | [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesReceived))]; 116 | } 117 | } 118 | @catch (NSException * __unused exception) {} 119 | } 120 | } 121 | } 122 | } 123 | 124 | @end 125 | 126 | #endif 127 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIRefreshControl+AFNetworking.m 2 | // 3 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 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 TARGET_OS_IOS 28 | 29 | #import 30 | 31 | NS_ASSUME_NONNULL_BEGIN 32 | 33 | /** 34 | 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 session task. 35 | */ 36 | @interface UIRefreshControl (AFNetworking) 37 | 38 | ///----------------------------------- 39 | /// @name Refreshing for Session Tasks 40 | ///----------------------------------- 41 | 42 | /** 43 | Binds the refreshing state to the state of the specified task. 44 | 45 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 46 | */ 47 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; 48 | 49 | @end 50 | 51 | NS_ASSUME_NONNULL_END 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m: -------------------------------------------------------------------------------- 1 | // UIRefreshControl+AFNetworking.m 2 | // 3 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 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 "UIRefreshControl+AFNetworking.h" 24 | #import 25 | 26 | #if TARGET_OS_IOS 27 | 28 | #import "AFURLSessionManager.h" 29 | 30 | @interface AFRefreshControlNotificationObserver : NSObject 31 | @property (readonly, nonatomic, weak) UIRefreshControl *refreshControl; 32 | - (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl; 33 | 34 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; 35 | 36 | @end 37 | 38 | @implementation UIRefreshControl (AFNetworking) 39 | 40 | - (AFRefreshControlNotificationObserver *)af_notificationObserver { 41 | AFRefreshControlNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver)); 42 | if (notificationObserver == nil) { 43 | notificationObserver = [[AFRefreshControlNotificationObserver alloc] initWithActivityRefreshControl:self]; 44 | objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 45 | } 46 | return notificationObserver; 47 | } 48 | 49 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { 50 | [[self af_notificationObserver] setRefreshingWithStateOfTask:task]; 51 | } 52 | 53 | @end 54 | 55 | @implementation AFRefreshControlNotificationObserver 56 | 57 | - (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl 58 | { 59 | self = [super init]; 60 | if (self) { 61 | _refreshControl = refreshControl; 62 | } 63 | return self; 64 | } 65 | 66 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { 67 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 68 | 69 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 70 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 71 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 72 | 73 | if (task) { 74 | UIRefreshControl *refreshControl = self.refreshControl; 75 | if (task.state == NSURLSessionTaskStateRunning) { 76 | [refreshControl beginRefreshing]; 77 | 78 | [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingTaskDidResumeNotification object:task]; 79 | [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidCompleteNotification object:task]; 80 | [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidSuspendNotification object:task]; 81 | } else { 82 | [refreshControl endRefreshing]; 83 | } 84 | } 85 | } 86 | 87 | #pragma mark - 88 | 89 | - (void)af_beginRefreshing { 90 | dispatch_async(dispatch_get_main_queue(), ^{ 91 | [self.refreshControl beginRefreshing]; 92 | }); 93 | } 94 | 95 | - (void)af_endRefreshing { 96 | dispatch_async(dispatch_get_main_queue(), ^{ 97 | [self.refreshControl endRefreshing]; 98 | }); 99 | } 100 | 101 | #pragma mark - 102 | 103 | - (void)dealloc { 104 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 105 | 106 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 107 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 108 | [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 109 | } 110 | 111 | @end 112 | 113 | #endif 114 | -------------------------------------------------------------------------------- /Example/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIWebView+AFNetworking.h 2 | // Copyright (c) 2011–2016 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 TARGET_OS_IOS 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | @class AFHTTPSessionManager; 33 | 34 | /** 35 | This category adds methods to the UIKit framework's `UIWebView` class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling. 36 | 37 | @discussion When using these category methods, make sure to assign `delegate` for the web view, which implements `–webView:shouldStartLoadWithRequest:navigationType:` appropriately. This allows for tapped links to be loaded through AFNetworking, and can ensure that `canGoBack` & `canGoForward` update their values correctly. 38 | */ 39 | @interface UIWebView (AFNetworking) 40 | 41 | /** 42 | The session manager used to download all requests. 43 | */ 44 | @property (nonatomic, strong) AFHTTPSessionManager *sessionManager; 45 | 46 | /** 47 | Asynchronously loads the specified request. 48 | 49 | @param request A URL request identifying the location of the content to load. This must not be `nil`. 50 | @param progress A progress object monitoring the current download progress. 51 | @param success A block object to be executed when the request finishes loading successfully. This block returns the HTML string to be loaded by the web view, and takes two arguments: the response, and the response string. 52 | @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. 53 | */ 54 | - (void)loadRequest:(NSURLRequest *)request 55 | progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress 56 | success:(nullable NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success 57 | failure:(nullable void (^)(NSError *error))failure; 58 | 59 | /** 60 | Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding. 61 | 62 | @param request A URL request identifying the location of the content to load. This must not be `nil`. 63 | @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified. 64 | @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified. 65 | @param progress A progress object monitoring the current download progress. 66 | @param success A block object to be executed when the request finishes loading successfully. This block returns the data to be loaded by the web view and takes two arguments: the response, and the downloaded data. 67 | @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. 68 | */ 69 | - (void)loadRequest:(NSURLRequest *)request 70 | MIMEType:(nullable NSString *)MIMEType 71 | textEncodingName:(nullable NSString *)textEncodingName 72 | progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress 73 | success:(nullable NSData * (^)(NSHTTPURLResponse *response, NSData *data))success 74 | failure:(nullable void (^)(NSError *error))failure; 75 | 76 | @end 77 | 78 | NS_ASSUME_NONNULL_END 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/TPFDebugTool.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TPFDebugTool", 3 | "version": "0.2.3", 4 | "summary": "TPFDebugTool is a debugging tool to monitor the network, view the log, collect crash log", 5 | "description": "TPFDebugTool is a debugging tool to monitor the network, view the log, collect crash log", 6 | "homepage": "https://github.com/pzhtpf/TPFDebugTool", 7 | "license": { 8 | "type": "MIT", 9 | "file": "LICENSE" 10 | }, 11 | "authors": { 12 | "pzhtpf": "pftian@yaduo.com" 13 | }, 14 | "source": { 15 | "git": "https://github.com/pzhtpf/TPFDebugTool.git", 16 | "tag": "0.2.3" 17 | }, 18 | "platforms": { 19 | "ios": "8.0" 20 | }, 21 | "source_files": "TPFDebugTool/Classes/**/*", 22 | "resource_bundles": { 23 | "TPFDebugTool": [ 24 | "TPFDebugTool/Assets/*.{storyboard,xib}" 25 | ] 26 | }, 27 | "prefix_header_file": "TPFDebugTool/Classes/TPFDebugTool.pch" 28 | } 29 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (3.2.1): 3 | - AFNetworking/NSURLSession (= 3.2.1) 4 | - AFNetworking/Reachability (= 3.2.1) 5 | - AFNetworking/Security (= 3.2.1) 6 | - AFNetworking/Serialization (= 3.2.1) 7 | - AFNetworking/UIKit (= 3.2.1) 8 | - AFNetworking/NSURLSession (3.2.1): 9 | - AFNetworking/Reachability 10 | - AFNetworking/Security 11 | - AFNetworking/Serialization 12 | - AFNetworking/Reachability (3.2.1) 13 | - AFNetworking/Security (3.2.1) 14 | - AFNetworking/Serialization (3.2.1) 15 | - AFNetworking/UIKit (3.2.1): 16 | - AFNetworking/NSURLSession 17 | - Reveal-SDK (24) 18 | - TPFDebugTool (0.2.3) 19 | 20 | DEPENDENCIES: 21 | - AFNetworking 22 | - Reveal-SDK (= 24) 23 | - TPFDebugTool (from `../`) 24 | 25 | SPEC REPOS: 26 | https://github.com/CocoaPods/Specs.git: 27 | - AFNetworking 28 | trunk: 29 | - Reveal-SDK 30 | 31 | EXTERNAL SOURCES: 32 | TPFDebugTool: 33 | :path: "../" 34 | 35 | SPEC CHECKSUMS: 36 | AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057 37 | Reveal-SDK: 5d7e56b8f018c0a88b3a2c10bf68d598bbd3b071 38 | TPFDebugTool: ed0369b4b7abd3e9d6f0c7b8018513da08db991f 39 | 40 | PODFILE CHECKSUM: 6a4f393dbc3d2a902f658616e3e87bc38db23f12 41 | 42 | COCOAPODS: 1.11.2 43 | -------------------------------------------------------------------------------- /Example/Pods/Reveal-SDK/RevealServer/iOS/RevealServer.framework/Headers/RevealServer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2015 Itty Bitty Apps, Pty Ltd. All rights reserved. 3 | 4 | #import 5 | 6 | //! Project version number for RevealServer. 7 | FOUNDATION_EXPORT double RevealServerVersionNumber; 8 | 9 | //! Project version string for RevealServer. 10 | FOUNDATION_EXPORT const unsigned char RevealServerVersionString[]; 11 | 12 | -------------------------------------------------------------------------------- /Example/Pods/Reveal-SDK/RevealServer/iOS/RevealServer.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzhtpf/TPFDebugTool/66ab53be5d148fd37f314b8f506dd6e2fa9678e3/Example/Pods/Reveal-SDK/RevealServer/iOS/RevealServer.framework/Info.plist -------------------------------------------------------------------------------- /Example/Pods/Reveal-SDK/RevealServer/iOS/RevealServer.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module RevealServer { 2 | umbrella header "RevealServer.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Reveal-SDK/RevealServer/iOS/RevealServer.framework/RevealServer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzhtpf/TPFDebugTool/66ab53be5d148fd37f314b8f506dd6e2fa9678e3/Example/Pods/Reveal-SDK/RevealServer/iOS/RevealServer.framework/RevealServer -------------------------------------------------------------------------------- /Example/Pods/Reveal-SDK/RevealServer/iOS/RevealServer.framework/Scripts/copy_and_codesign_revealserver.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit 3 | set -o nounset 4 | 5 | # Ensure that we have a valid OTHER_LDFLAGS environment variable 6 | OTHER_LDFLAGS=${OTHER_LDFLAGS:=""} 7 | 8 | # Ensure that we have a valid REVEAL_SERVER_FILENAME environment variable 9 | REVEAL_SERVER_FILENAME=${REVEAL_SERVER_FILENAME:="RevealServer.framework"} 10 | 11 | # Ensure that we have a valid REVEAL_SERVER_PATH environment variable 12 | REVEAL_SERVER_PATH=${REVEAL_SERVER_PATH:="${SRCROOT}/${REVEAL_SERVER_FILENAME}"} 13 | 14 | # The path to copy the framework to 15 | app_frameworks_dir="${CODESIGNING_FOLDER_PATH}/Frameworks" 16 | 17 | copy_library() { 18 | mkdir -p "$app_frameworks_dir" 19 | cp -vRf "$REVEAL_SERVER_PATH" "${app_frameworks_dir}/" 20 | } 21 | 22 | codesign_library() { 23 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" ]; then 24 | codesign -fs "${EXPANDED_CODE_SIGN_IDENTITY}" "${app_frameworks_dir}/${REVEAL_SERVER_FILENAME}" 25 | fi 26 | } 27 | 28 | main() { 29 | if [[ $OTHER_LDFLAGS =~ "RevealServer" ]]; then 30 | if [ -e "$REVEAL_SERVER_PATH" ]; then 31 | copy_library 32 | codesign_library 33 | echo "${REVEAL_SERVER_FILENAME} is included in this build, and has been copied to $CODESIGNING_FOLDER_PATH" 34 | else 35 | echo "${REVEAL_SERVER_FILENAME} is not included in this build, as it could not be found at $REVEAL_SERVER_PATH" 36 | fi 37 | else 38 | echo "${REVEAL_SERVER_FILENAME} is not included in this build because RevealServer was not present in the OTHER_LDFLAGS environment variable." 39 | fi 40 | } 41 | 42 | main 43 | -------------------------------------------------------------------------------- /Example/Pods/Reveal-SDK/RevealServer/iOS/RevealServer.framework/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Headers/RevealServer.h 8 | 9 | JavE2LI6bNGfH9W90/bDxwIxVlg= 10 | 11 | Info.plist 12 | 13 | KVRE+icWWattIxwSLkaeZU55jms= 14 | 15 | Modules/module.modulemap 16 | 17 | EuDEeG1dcC1sd+hIW2SkUAImUg8= 18 | 19 | Scripts/copy_and_codesign_revealserver.sh 20 | 21 | yB2zXTggmRD0rra2Hbpxn2zfCRo= 22 | 23 | 24 | files2 25 | 26 | Headers/RevealServer.h 27 | 28 | hash 29 | 30 | JavE2LI6bNGfH9W90/bDxwIxVlg= 31 | 32 | hash2 33 | 34 | weLK/65HyV1EiL9dd4xoAqQhf0/0r/Oy6os2nXCA+Ew= 35 | 36 | 37 | Modules/module.modulemap 38 | 39 | hash 40 | 41 | EuDEeG1dcC1sd+hIW2SkUAImUg8= 42 | 43 | hash2 44 | 45 | tstqiJpIPr4iEd3MDHClLuTB/ciSC/zNlke1AjfSVuU= 46 | 47 | 48 | Scripts/copy_and_codesign_revealserver.sh 49 | 50 | hash 51 | 52 | yB2zXTggmRD0rra2Hbpxn2zfCRo= 53 | 54 | hash2 55 | 56 | SL0x5cGSOyS1RcojHFEmFX5IDfon/vO37cFsjSIX7LA= 57 | 58 | 59 | 60 | rules 61 | 62 | ^.* 63 | 64 | ^.*\.lproj/ 65 | 66 | optional 67 | 68 | weight 69 | 1000 70 | 71 | ^.*\.lproj/locversion.plist$ 72 | 73 | omit 74 | 75 | weight 76 | 1100 77 | 78 | ^Base\.lproj/ 79 | 80 | weight 81 | 1010 82 | 83 | ^version.plist$ 84 | 85 | 86 | rules2 87 | 88 | .*\.dSYM($|/) 89 | 90 | weight 91 | 11 92 | 93 | ^(.*/)?\.DS_Store$ 94 | 95 | omit 96 | 97 | weight 98 | 2000 99 | 100 | ^.* 101 | 102 | ^.*\.lproj/ 103 | 104 | optional 105 | 106 | weight 107 | 1000 108 | 109 | ^.*\.lproj/locversion.plist$ 110 | 111 | omit 112 | 113 | weight 114 | 1100 115 | 116 | ^Base\.lproj/ 117 | 118 | weight 119 | 1010 120 | 121 | ^Info\.plist$ 122 | 123 | omit 124 | 125 | weight 126 | 20 127 | 128 | ^PkgInfo$ 129 | 130 | omit 131 | 132 | weight 133 | 20 134 | 135 | ^embedded\.provisionprofile$ 136 | 137 | weight 138 | 20 139 | 140 | ^version\.plist$ 141 | 142 | weight 143 | 20 144 | 145 | 146 | 147 | 148 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AFNetworking/AFNetworking-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 | FMWK 17 | CFBundleShortVersionString 18 | 3.2.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AFNetworking : NSObject 3 | @end 4 | @implementation PodsDummy_AFNetworking 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #ifndef TARGET_OS_IOS 14 | #define TARGET_OS_IOS TARGET_OS_IPHONE 15 | #endif 16 | 17 | #ifndef TARGET_OS_WATCH 18 | #define TARGET_OS_WATCH 0 19 | #endif 20 | 21 | #ifndef TARGET_OS_TV 22 | #define TARGET_OS_TV 0 23 | #endif 24 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AFNetworking/AFNetworking-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "AFNetworking.h" 14 | #import "AFHTTPSessionManager.h" 15 | #import "AFURLSessionManager.h" 16 | #import "AFCompatibilityMacros.h" 17 | #import "AFNetworkReachabilityManager.h" 18 | #import "AFSecurityPolicy.h" 19 | #import "AFURLRequestSerialization.h" 20 | #import "AFURLResponseSerialization.h" 21 | #import "AFAutoPurgingImageCache.h" 22 | #import "AFImageDownloader.h" 23 | #import "AFNetworkActivityIndicatorManager.h" 24 | #import "UIActivityIndicatorView+AFNetworking.h" 25 | #import "UIButton+AFNetworking.h" 26 | #import "UIImage+AFNetworking.h" 27 | #import "UIImageView+AFNetworking.h" 28 | #import "UIKit+AFNetworking.h" 29 | #import "UIProgressView+AFNetworking.h" 30 | #import "UIRefreshControl+AFNetworking.h" 31 | #import "UIWebView+AFNetworking.h" 32 | 33 | FOUNDATION_EXPORT double AFNetworkingVersionNumber; 34 | FOUNDATION_EXPORT const unsigned char AFNetworkingVersionString[]; 35 | 36 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AFNetworking/AFNetworking.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_LDFLAGS = $(inherited) -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking 9 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AFNetworking/AFNetworking.modulemap: -------------------------------------------------------------------------------- 1 | framework module AFNetworking { 2 | umbrella header "AFNetworking-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AFNetworking/AFNetworking.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_LDFLAGS = $(inherited) -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking 9 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = $(inherited) -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/AFNetworking/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 | FMWK 17 | CFBundleShortVersionString 18 | 3.2.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-TPFDebugTool_Example/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 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-TPFDebugTool_Example/Pods-TPFDebugTool_Example-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 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-TPFDebugTool_Example/Pods-TPFDebugTool_Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AFNetworking 5 | 6 | Copyright (c) 2011-2016 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 | ## TPFDebugTool 28 | 29 | Copyright (c) 2017 pzhtpf 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 | Generated by CocoaPods - https://cocoapods.org 50 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-TPFDebugTool_Example/Pods-TPFDebugTool_Example-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2011-2016 Alamofire Software Foundation (http://alamofire.org/) 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | AFNetworking 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Copyright (c) 2017 pzhtpf <pftian@yaduo.com> 47 | 48 | Permission is hereby granted, free of charge, to any person obtaining a copy 49 | of this software and associated documentation files (the "Software"), to deal 50 | in the Software without restriction, including without limitation the rights 51 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 52 | copies of the Software, and to permit persons to whom the Software is 53 | furnished to do so, subject to the following conditions: 54 | 55 | The above copyright notice and this permission notice shall be included in 56 | all copies or substantial portions of the Software. 57 | 58 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 59 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 60 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 61 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 62 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 63 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 64 | THE SOFTWARE. 65 | 66 | License 67 | MIT 68 | Title 69 | TPFDebugTool 70 | Type 71 | PSGroupSpecifier 72 | 73 | 74 | FooterText 75 | Generated by CocoaPods - https://cocoapods.org 76 | Title 77 | 78 | Type 79 | PSGroupSpecifier 80 | 81 | 82 | StringsTable 83 | Acknowledgements 84 | Title 85 | Acknowledgements 86 | 87 | 88 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-TPFDebugTool_Example/Pods-TPFDebugTool_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_TPFDebugTool_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_TPFDebugTool_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-TPFDebugTool_Example/Pods-TPFDebugTool_Example-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-TPFDebugTool_Example/Pods-TPFDebugTool_Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_TPFDebugTool_ExampleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_TPFDebugTool_ExampleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-TPFDebugTool_Example/Pods-TPFDebugTool_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/TPFDebugTool" "${PODS_ROOT}/Reveal-SDK/RevealServer/iOS" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/TPFDebugTool/TPFDebugTool.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -l"z" -framework "AFNetworking" -framework "CFNetwork" -framework "CoreGraphics" -framework "MobileCoreServices" -framework "QuartzCore" -framework "RevealServer" -framework "Security" -framework "SystemConfiguration" -framework "TPFDebugTool" 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-TPFDebugTool_Example/Pods-TPFDebugTool_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_TPFDebugTool_Example { 2 | umbrella header "Pods-TPFDebugTool_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-TPFDebugTool_Example/Pods-TPFDebugTool_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/TPFDebugTool" "${PODS_ROOT}/Reveal-SDK/RevealServer/iOS" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/TPFDebugTool/TPFDebugTool.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -l"z" -framework "AFNetworking" -framework "CFNetwork" -framework "CoreGraphics" -framework "MobileCoreServices" -framework "QuartzCore" -framework "RevealServer" -framework "Security" -framework "SystemConfiguration" -framework "TPFDebugTool" 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Reveal-SDK/Reveal-SDK.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Reveal-SDK 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Reveal-SDK/RevealServer/iOS" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks 6 | OTHER_LDFLAGS = $(inherited) -l"z" -framework "CFNetwork" -framework "CoreGraphics" -framework "QuartzCore" 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Reveal-SDK 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 13 | SKIP_INSTALL = YES 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Reveal-SDK/Reveal-SDK.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Reveal-SDK 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Reveal-SDK/RevealServer/iOS" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks 6 | OTHER_LDFLAGS = $(inherited) -l"z" -framework "CFNetwork" -framework "CoreGraphics" -framework "QuartzCore" 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Reveal-SDK 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 13 | SKIP_INSTALL = YES 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Reveal-SDK/Reveal-SDK.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Reveal-SDK 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Reveal-SDK/RevealServer-2/iOS" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks 5 | OTHER_LDFLAGS = $(inherited) -l"z" -framework "CFNetwork" -framework "CoreGraphics" -framework "QuartzCore" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Reveal-SDK 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/TPFDebugTool/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 | FMWK 17 | CFBundleShortVersionString 18 | 0.1.7 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/TPFDebugTool/ResourceBundle-TPFDebugTool-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleIdentifier 8 | ${PRODUCT_BUNDLE_IDENTIFIER} 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundleName 12 | ${PRODUCT_NAME} 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 0.1.7 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/TPFDebugTool/ResourceBundle-TPFDebugTool-TPFDebugTool-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleIdentifier 8 | ${PRODUCT_BUNDLE_IDENTIFIER} 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundleName 12 | ${PRODUCT_NAME} 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 0.2.3 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/TPFDebugTool/TPFDebugTool-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 | FMWK 17 | CFBundleShortVersionString 18 | 0.2.3 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/TPFDebugTool/TPFDebugTool-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_TPFDebugTool : NSObject 3 | @end 4 | @implementation PodsDummy_TPFDebugTool 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/TPFDebugTool/TPFDebugTool-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #else 16 | #ifndef FOUNDATION_EXPORT 17 | #if defined(__cplusplus) 18 | #define FOUNDATION_EXPORT extern "C" 19 | #else 20 | #define FOUNDATION_EXPORT extern 21 | #endif 22 | #endif 23 | #endif 24 | 25 | #define TPFColorWithRGB(rgbValue) \ 26 | [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16)) / 255.0 \ 27 | green:((float)((rgbValue & 0xFF00) >> 8)) / 255.0 \ 28 | blue:((float)(rgbValue & 0xFF)) / 255.0 alpha:1.0] 29 | 30 | #define kScreenWidth [UIScreen mainScreen].bounds.size.width 31 | #define kScreenHeight [UIScreen mainScreen].bounds.size.height 32 | 33 | #define kIsIphoneXScreen ({\ 34 | BOOL isBangsScreen = NO; \ 35 | if (@available(iOS 11.0, *)) { \ 36 | UIWindow *window = [[UIApplication sharedApplication].windows firstObject]; \ 37 | isBangsScreen = window.safeAreaInsets.bottom > 0; \ 38 | } \ 39 | isBangsScreen; \ 40 | }) 41 | 42 | #define kStatusBarHeight (kIsIphoneXScreen?44:20) 43 | #define kNavBarHeight 44 44 | #define kTabBarHeight (kIsIphoneXScreen?83:49) 45 | #define KTopBarHeight (kStatusBarHeight+kNavBarHeight) 46 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/TPFDebugTool/TPFDebugTool-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "JxbBaseVC.h" 14 | #import "JxbContentVC.h" 15 | #import "JxbCrashHelper.h" 16 | #import "JxbCrashVC.h" 17 | #import "JxbDebugTool.h" 18 | #import "JxbDebugVC.h" 19 | #import "JxbHttpCell.h" 20 | #import "JxbHttpDatasource.h" 21 | #import "JxbHttpDetailVC.h" 22 | #import "JxbHttpProtocol.h" 23 | #import "JxbHttpVC.h" 24 | #import "JxbLogVC.h" 25 | #import "JxbMemoryHelper.h" 26 | #import "JxbResponseVC.h" 27 | #import "NSURLRequest+Identify.h" 28 | #import "NSURLResponse+Data.h" 29 | #import "NSURLSessionTask+Data.h" 30 | #import "NSURLSessionTask+Swizzling.h" 31 | #import "YDHtmlDisplayUtils.h" 32 | #import "YDJSONDisplayUtils.h" 33 | #import "YDNameValueModel.h" 34 | #import "YDRequestCell.h" 35 | #import "YDRequestVC.h" 36 | 37 | FOUNDATION_EXPORT double TPFDebugToolVersionNumber; 38 | FOUNDATION_EXPORT const unsigned char TPFDebugToolVersionString[]; 39 | 40 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/TPFDebugTool/TPFDebugTool.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/TPFDebugTool 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 8 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/TPFDebugTool/TPFDebugTool.modulemap: -------------------------------------------------------------------------------- 1 | framework module TPFDebugTool { 2 | umbrella header "TPFDebugTool-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/TPFDebugTool/TPFDebugTool.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/TPFDebugTool 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 8 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/TPFDebugTool/TPFDebugTool.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/TPFDebugTool 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_ROOT = ${SRCROOT} 6 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 8 | SKIP_INSTALL = YES 9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 10 | -------------------------------------------------------------------------------- /Example/TPFDebugTool.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/TPFDebugTool.xcodeproj/xcshareddata/xcschemes/TPFDebugTool-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 42 | 48 | 49 | 50 | 51 | 52 | 62 | 64 | 70 | 71 | 72 | 73 | 79 | 81 | 87 | 88 | 89 | 90 | 92 | 93 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /Example/TPFDebugTool.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/TPFDebugTool.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/TPFDebugTool/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Example/TPFDebugTool/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example/TPFDebugTool/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Example/TPFDebugTool/TPFAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // TPFAppDelegate.h 3 | // TPFDebugTool 4 | // 5 | // Created by pzhtpf on 05/08/2017. 6 | // Copyright (c) 2017 pzhtpf. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface TPFAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/TPFDebugTool/TPFAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // TPFAppDelegate.m 3 | // TPFDebugTool 4 | // 5 | // Created by pzhtpf on 05/08/2017. 6 | // Copyright (c) 2017 pzhtpf. All rights reserved. 7 | // 8 | 9 | #define kColorWithRGB(rgbValue) \ 10 | [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16)) / 255.0 \ 11 | green:((float)((rgbValue & 0xFF00) >> 8)) / 255.0 \ 12 | blue:((float)(rgbValue & 0xFF)) / 255.0 alpha:1.0] 13 | 14 | #import "TPFAppDelegate.h" 15 | 16 | #if DEBUG 17 | #import "JxbDebugTool.h" 18 | #endif 19 | 20 | @implementation TPFAppDelegate 21 | 22 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 23 | { 24 | // Override point for customization after application launch. 25 | 26 | #if DEBUG 27 | [[JxbDebugTool shareInstance] setMainColor:kColorWithRGB(0xff755a)]; //设置主色调 28 | [[JxbDebugTool shareInstance] enableDebugMode];//启用debug工具 29 | 30 | // 添加要监测的域名 31 | // NSMutableArray *array = [[JxbDebugTool shareInstance].arrOnlyHosts mutableCopy]; 32 | // if(!array){ 33 | // array = [NSMutableArray new]; 34 | // } 35 | // [array addObject:@"api.yaduo.com"]; 36 | // [JxbDebugTool shareInstance].arrOnlyHosts = array; 37 | 38 | #endif 39 | 40 | return YES; 41 | } 42 | 43 | - (void)applicationWillResignActive:(UIApplication *)application 44 | { 45 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 46 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 47 | } 48 | 49 | - (void)applicationDidEnterBackground:(UIApplication *)application 50 | { 51 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 52 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 53 | } 54 | 55 | - (void)applicationWillEnterForeground:(UIApplication *)application 56 | { 57 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 58 | } 59 | 60 | - (void)applicationDidBecomeActive:(UIApplication *)application 61 | { 62 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 63 | } 64 | 65 | - (void)applicationWillTerminate:(UIApplication *)application 66 | { 67 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 68 | } 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /Example/TPFDebugTool/TPFDebugTool-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | 32 | UILaunchStoryboardName 33 | LaunchScreen 34 | UIMainStoryboardFile 35 | Main 36 | UIRequiredDeviceCapabilities 37 | 38 | armv7 39 | 40 | UISupportedInterfaceOrientations 41 | 42 | UIInterfaceOrientationPortrait 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | UISupportedInterfaceOrientations~ipad 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationPortraitUpsideDown 50 | UIInterfaceOrientationLandscapeLeft 51 | UIInterfaceOrientationLandscapeRight 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /Example/TPFDebugTool/TPFDebugTool-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | @import UIKit; 15 | @import Foundation; 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/TPFDebugTool/TPFViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TPFViewController.h 3 | // TPFDebugTool 4 | // 5 | // Created by pzhtpf on 05/08/2017. 6 | // Copyright (c) 2017 pzhtpf. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface TPFViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/TPFDebugTool/TPFViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TPFViewController.m 3 | // TPFDebugTool 4 | // 5 | // Created by pzhtpf on 05/08/2017. 6 | // Copyright (c) 2017 pzhtpf. All rights reserved. 7 | // 8 | 9 | #import "TPFViewController.h" 10 | #import 11 | 12 | @interface TPFViewController () 13 | 14 | @end 15 | 16 | @implementation TPFViewController 17 | 18 | - (void)viewDidLoad 19 | { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view, typically from a nib. 22 | 23 | [self testNetworkingDebugTool]; 24 | } 25 | 26 | - (void)testNetworkingDebugTool { 27 | NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; 28 | configuration.timeoutIntervalForRequest = 15; 29 | AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration]; 30 | 31 | // app版本 32 | // NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; 33 | // NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; 34 | // 35 | // NSString *urlString = @"http://api.yaduo.com/atourlife/app/checkUpdate"; 36 | // NSDictionary *params = @{ 37 | // @"appVer": app_Version, 38 | // @"channelId": @"20001", 39 | // @"platType": @"2" 40 | // }; 41 | 42 | NSString *baseUrl = @"http://10.0.22.149:7002/self/"; 43 | NSString *urlString = [NSString stringWithFormat:@"%@%@", baseUrl, @"secRe/mobile/getEmpInfo"]; 44 | NSDictionary *params = @{ 45 | }; 46 | 47 | NSMutableURLRequest *request = [[AFJSONRequestSerializer serializer] requestWithMethod:@"POST" URLString:urlString parameters:params error:nil]; 48 | [request setTimeoutInterval:15]; 49 | [request setValue:@"3c62d60f8fb155fd339c413c3646cf59d25c6b66b8203600ef57f997fb740d46" forHTTPHeaderField:@"access_token"]; 50 | 51 | NSURLSessionDataTask *dataTask = [manager dataTaskWithRequest:request uploadProgress:^(NSProgress *_Nonnull uploadProgress) { 52 | } downloadProgress:^(NSProgress *_Nonnull downloadProgress) { 53 | } completionHandler:^(NSURLResponse *_Nonnull response, id _Nullable responseObject, NSError *_Nullable error) { 54 | if (error) { 55 | NSLog(@"网络错误🙅🙅🙅: %@", error); 56 | } else { 57 | NSLog(@"%@ %@", response, responseObject); 58 | } 59 | }]; 60 | 61 | [dataTask resume]; 62 | } 63 | 64 | - (void)didReceiveMemoryWarning 65 | { 66 | [super didReceiveMemoryWarning]; 67 | // Dispose of any resources that can be recreated. 68 | } 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /Example/TPFDebugTool/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/TPFDebugTool/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TPFDebugTool 4 | // 5 | // Created by pzhtpf on 05/08/2017. 6 | // Copyright (c) 2017 pzhtpf. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "TPFAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([TPFAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example/Tests/Tests-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 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // The contents of this file are implicitly included at the beginning of every test case source file. 2 | 3 | #ifdef __OBJC__ 4 | 5 | @import FBSnapshotTestCase; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TPFDebugToolTests.m 3 | // TPFDebugToolTests 4 | // 5 | // Created by pzhtpf on 05/08/2017. 6 | // Copyright (c) 2017 pzhtpf. All rights reserved. 7 | // 8 | 9 | @import XCTest; 10 | 11 | @interface Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Tests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | 36 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 pzhtpf 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TPFDebugTool 2 | 3 | [![CI Status](http://img.shields.io/travis/pzhtpf/TPFDebugTool.svg?style=flat)](https://travis-ci.org/pzhtpf/TPFDebugTool) 4 | [![Version](https://img.shields.io/cocoapods/v/TPFDebugTool.svg?style=flat)](http://cocoapods.org/pods/TPFDebugTool) 5 | [![License](https://img.shields.io/cocoapods/l/TPFDebugTool.svg?style=flat)](http://cocoapods.org/pods/TPFDebugTool) 6 | [![Platform](https://img.shields.io/cocoapods/p/TPFDebugTool.svg?style=flat)](http://cocoapods.org/pods/TPFDebugTool) 7 | 8 | ## Description 9 | 10 | 一个iOS 端的网络抓包工具 11 | 12 | TPFDebugTool is a debugging tool to monitor the network, view the log, collect crash log. 13 | 14 | 这里写图片描述 15 | 16 | ## Usage 17 | 18 | ``` 19 | #import "JxbDebugTool.h" 20 | 21 | [[JxbDebugTool shareInstance] setMainColor:kColorWithRGB(0xff755a)]; //设置主色调 22 | [[JxbDebugTool shareInstance] enableDebugMode];//启用debug工具 23 | 24 | [JxbDebugTool shareInstance].arrOnlyHosts = @[@"www.baidu.com",@"www.qq.com"]; // 设置要监听的域名 25 | 26 | ``` 27 | ## Example 28 | 29 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 30 | 31 | ## Requirements 32 | 33 | ## Installation 34 | 35 | TPFDebugTool is available through [CocoaPods](http://cocoapods.org). To install 36 | it, simply add the following line to your Podfile: 37 | 38 | ```ruby 39 | pod "TPFDebugTool" 40 | ``` 41 | 42 | ## Author 43 | 44 | RocTian, 389744841@qq.com 45 | 46 | ## License 47 | 48 | TPFDebugTool is available under the MIT license. See the LICENSE file for more info. 49 | -------------------------------------------------------------------------------- /TPFDebugTool.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint TPFDebugTool.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'TPFDebugTool' 11 | s.version = '0.2.4' 12 | s.summary = 'TPFDebugTool is a debugging tool to monitor the network, view the log, collect crash log' 13 | 14 | # This description is used to generate tags and improve search results. 15 | # * Think: What does it do? Why did you write it? What is the focus? 16 | # * Try to keep it short, snappy and to the point. 17 | # * Write the description between the DESC delimiters below. 18 | # * Finally, don't worry about the indent, CocoaPods strips it! 19 | 20 | s.description = 'TPFDebugTool is a debugging tool to monitor the network, view the log, collect crash log' 21 | 22 | s.homepage = 'https://github.com/pzhtpf/TPFDebugTool' 23 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 24 | s.license = { :type => 'MIT', :file => 'LICENSE' } 25 | s.author = { 'pzhtpf' => 'pftian@yaduo.com' } 26 | s.source = { :git => 'https://github.com/pzhtpf/TPFDebugTool.git', :tag => s.version.to_s } 27 | # s.social_media_url = 'https://twitter.com/' 28 | 29 | s.ios.deployment_target = '8.0' 30 | 31 | s.source_files = 'TPFDebugTool/Classes/**/*' 32 | 33 | s.resource_bundles = { 34 | 'TPFDebugTool' => ['TPFDebugTool/Assets/*.{storyboard,xib}'] 35 | } 36 | s.prefix_header_file = "TPFDebugTool/Classes/TPFDebugTool.pch" 37 | 38 | # s.public_header_files = 'Pod/Classes/**/*.h' 39 | # s.frameworks = 'UIKit', 'MapKit' 40 | # s.dependency 'Aspects', '~> 1.4.1' 41 | end 42 | -------------------------------------------------------------------------------- /TPFDebugTool/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzhtpf/TPFDebugTool/66ab53be5d148fd37f314b8f506dd6e2fa9678e3/TPFDebugTool/Assets/.gitkeep -------------------------------------------------------------------------------- /TPFDebugTool/Assets/YDRequestCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 28 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pzhtpf/TPFDebugTool/66ab53be5d148fd37f314b8f506dd6e2fa9678e3/TPFDebugTool/Classes/.gitkeep -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbBaseVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // JxbBaseVC.h 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter on 15/11/13. 6 | // Copyright © 2015年 Peter. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JxbBaseVC : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbBaseVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // JxbBaseVC.m 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter on 15/11/13. 6 | // Copyright © 2015年 Peter. All rights reserved. 7 | // 8 | 9 | #import "JxbBaseVC.h" 10 | 11 | @interface JxbBaseVC () 12 | 13 | @end 14 | 15 | @implementation JxbBaseVC 16 | 17 | - (void)dealloc { 18 | // NSLog(@"%@ dealloc",[self class]); 19 | } 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | } 24 | 25 | - (void)viewDidAppear:(BOOL)animated { 26 | [super viewDidAppear:animated]; 27 | 28 | NSInteger count = self.navigationController.viewControllers.count; 29 | self.navigationController.interactivePopGestureRecognizer.enabled = count > 1; 30 | self.navigationController.interactivePopGestureRecognizer.delegate = self; 31 | 32 | } 33 | 34 | #pragma mark - gesture delegate 35 | - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer 36 | { 37 | if (self.navigationController.viewControllers.count == 1)//关闭主界面的右滑返回 38 | { 39 | return NO; 40 | } 41 | else 42 | { 43 | return YES; 44 | } 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbContentVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // JxbContentVC.h 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter Jin @ https://github.com/JxbSir on 15/11/12. 6 | // Copyright (c) 2015年 Mail:i@Jxb.name. All rights reserved. 7 | // 8 | 9 | #import "JxbBaseVC.h" 10 | 11 | @interface JxbContentVC : JxbBaseVC 12 | @property (nonatomic,copy)NSString *content; 13 | @end 14 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbContentVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // JxbContentVC.m 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter Jin @ https://github.com/JxbSir on 15/11/12. 6 | // Copyright (c) 2015年 Mail:i@Jxb.name. All rights reserved. 7 | // 8 | 9 | #import "JxbContentVC.h" 10 | #import "JxbDebugTool.h" 11 | 12 | @interface JxbContentVC () 13 | { 14 | UITextView *txt; 15 | } 16 | @end 17 | 18 | @implementation JxbContentVC 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | self.view.backgroundColor = [UIColor whiteColor]; 23 | UIButton *btnclose = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)]; 24 | btnclose.titleLabel.font = [UIFont systemFontOfSize:13]; 25 | [btnclose setTitle:@"Back" forState:UIControlStateNormal]; 26 | [btnclose addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside]; 27 | [btnclose setTitleColor:[JxbDebugTool shareInstance].mainColor forState:UIControlStateNormal]; 28 | UIBarButtonItem *btnleft = [[UIBarButtonItem alloc] initWithCustomView:btnclose]; 29 | self.navigationItem.leftBarButtonItem = btnleft; 30 | 31 | UIButton *btnCopy = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)]; 32 | btnCopy.titleLabel.font = [UIFont systemFontOfSize:13]; 33 | [btnCopy setTitle:@"Copy" forState:UIControlStateNormal]; 34 | [btnCopy addTarget:self action:@selector(copyAction) forControlEvents:UIControlEventTouchUpInside]; 35 | [btnCopy setTitleColor:[JxbDebugTool shareInstance].mainColor forState:UIControlStateNormal]; 36 | UIBarButtonItem *btnright = [[UIBarButtonItem alloc] initWithCustomView:btnCopy]; 37 | self.navigationItem.rightBarButtonItem = btnright; 38 | 39 | txt = [[UITextView alloc] initWithFrame:self.view.bounds]; 40 | [txt setEditable:NO]; 41 | txt.textContainer.lineBreakMode = NSLineBreakByWordWrapping; 42 | txt.font = [UIFont systemFontOfSize:13]; 43 | txt.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 44 | txt.text = self.content; 45 | 46 | [self.view addSubview:txt]; 47 | 48 | NSStringDrawingOptions option = NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading; 49 | 50 | NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; 51 | [style setLineBreakMode:NSLineBreakByWordWrapping]; 52 | 53 | NSDictionary *attributes = @{NSFontAttributeName : [UIFont systemFontOfSize:13], 54 | NSParagraphStyleAttributeName : style}; 55 | CGRect r = [self.content boundingRectWithSize:CGSizeMake(self.view.bounds.size.width, MAXFLOAT) options:option attributes:attributes context:nil]; 56 | txt.contentSize = CGSizeMake(self.view.bounds.size.width, r.size.height); 57 | } 58 | 59 | - (void)copyAction { 60 | UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; 61 | pasteboard.string = [self.content copy]; 62 | 63 | // txt.text = [NSString stringWithFormat:@"%@\n\n%@",@"复制成功!",self.content]; 64 | // 65 | // __weak typeof (txt) weakTxt = txt; 66 | // __weak typeof (self) wSelf = self; 67 | // 68 | // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 69 | // weakTxt.text = wSelf.content; 70 | // NSLog(@"%@",wSelf.content); 71 | // }); 72 | } 73 | 74 | - (void)backAction { 75 | [self.navigationController popViewControllerAnimated:YES]; 76 | } 77 | @end 78 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbCrashHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // JxbCrashHelper.h 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter Jin @ https://github.com/JxbSir on 15/11/12. 6 | // Copyright (c) 2015年 Mail:i@Jxb.name. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JxbCrashHelper : NSObject 12 | + (instancetype)sharedInstance; 13 | - (void)install; 14 | - (NSDictionary* )crashForKey:(NSString* )key; 15 | - (NSArray* )crashPlist; 16 | - (NSArray* )crashLogs; 17 | @end 18 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbCrashHelper.m: -------------------------------------------------------------------------------- 1 | // 2 | // JxbCrashHelper.m 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter Jin @ https://github.com/JxbSir on 15/11/12. 6 | // Copyright (c) 2015年 Mail:i@Jxb.name. All rights reserved. 7 | // 8 | 9 | #import "JxbCrashHelper.h" 10 | #include 11 | #include 12 | 13 | const int maxCrashLogNum = 20; 14 | 15 | @interface JxbCrashHelper() { 16 | NSString* _crashLogPath; 17 | NSMutableArray* _plist; 18 | } 19 | @property (nonatomic,assign) BOOL isInstalled; 20 | @end 21 | 22 | @implementation JxbCrashHelper 23 | 24 | + (instancetype)sharedInstance 25 | { 26 | static JxbCrashHelper* instance; 27 | static dispatch_once_t onceToken; 28 | dispatch_once(&onceToken, ^{ 29 | instance = [JxbCrashHelper new]; 30 | }); 31 | return instance; 32 | } 33 | 34 | 35 | + (NSArray *)backtrace 36 | { 37 | void* callstack[128]; 38 | int frames = backtrace(callstack, 128); 39 | char **strs = backtrace_symbols(callstack, frames); 40 | 41 | int i; 42 | NSMutableArray *backtrace = [NSMutableArray arrayWithCapacity:frames]; 43 | 44 | for (i = 0;i < 32;i++) 45 | { 46 | [backtrace addObject:[NSString stringWithUTF8String:strs[i]]]; 47 | } 48 | free(strs); 49 | 50 | return backtrace; 51 | } 52 | 53 | - (id)init 54 | { 55 | self = [super init]; 56 | if ( self ) 57 | { 58 | NSArray * paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); 59 | NSString* sandBoxPath = [paths objectAtIndex:0]; 60 | 61 | 62 | _crashLogPath = [sandBoxPath stringByAppendingPathComponent:@"JxbCrashLog"]; 63 | 64 | if ( NO == [[NSFileManager defaultManager] fileExistsAtPath:_crashLogPath] ) 65 | { 66 | [[NSFileManager defaultManager] createDirectoryAtPath:_crashLogPath 67 | withIntermediateDirectories:YES 68 | attributes:nil 69 | error:NULL]; 70 | } 71 | 72 | //creat plist 73 | if (YES == [[NSFileManager defaultManager] fileExistsAtPath:[_crashLogPath stringByAppendingPathComponent:@"crashLog.plist"]]) 74 | { 75 | _plist = [[NSMutableArray arrayWithContentsOfFile:[_crashLogPath stringByAppendingPathComponent:@"crashLog.plist"]] mutableCopy]; 76 | } 77 | else 78 | _plist = [NSMutableArray new]; 79 | } 80 | return self; 81 | } 82 | 83 | - (NSDictionary* )crashForKey:(NSString *)key 84 | { 85 | NSString* filePath = [[_crashLogPath stringByAppendingPathComponent:key] stringByAppendingString:@".plist"]; 86 | NSDictionary* dict = [NSDictionary dictionaryWithContentsOfFile:filePath]; 87 | 88 | return dict; 89 | } 90 | 91 | - (NSArray* )crashPlist 92 | { 93 | return [_plist copy]; 94 | } 95 | 96 | - (NSArray* )crashLogs 97 | { 98 | NSMutableArray* ret = [NSMutableArray new]; 99 | for (NSString* key in _plist) { 100 | 101 | NSString* filePath = [_crashLogPath stringByAppendingPathComponent:key]; 102 | NSString* path = [filePath stringByAppendingString:@".plist"]; 103 | NSDictionary* log = [NSDictionary dictionaryWithContentsOfFile:path]; 104 | if(log) 105 | [ret addObject:log]; 106 | } 107 | return [ret copy]; 108 | } 109 | 110 | 111 | - (NSDictionary* )crashReport 112 | { 113 | for (NSString* key in _plist) { 114 | NSString* filePath = [_crashLogPath stringByAppendingPathComponent:key]; 115 | NSDictionary* dict = [NSDictionary dictionaryWithContentsOfFile:filePath]; 116 | return dict; 117 | } 118 | return nil; 119 | 120 | } 121 | 122 | - (void)saveException:(NSException*)exception 123 | { 124 | NSMutableDictionary * detail = [NSMutableDictionary dictionary]; 125 | if ( exception.name ) 126 | { 127 | [detail setObject:exception.name forKey:@"name"]; 128 | } 129 | if ( exception.reason ) 130 | { 131 | [detail setObject:exception.reason forKey:@"reason"]; 132 | } 133 | if ( exception.userInfo ) 134 | { 135 | [detail setObject:exception.userInfo forKey:@"userInfo"]; 136 | } 137 | if ( exception.callStackSymbols ) 138 | { 139 | [detail setObject:exception.callStackSymbols forKey:@"callStack"]; 140 | } 141 | 142 | NSMutableDictionary * dict = [NSMutableDictionary dictionary]; 143 | [dict setObject:@"exception" forKey:@"type"]; 144 | [dict setObject:detail forKey:@"info"]; 145 | 146 | [self saveToFile:dict]; 147 | 148 | } 149 | 150 | - (void)saveSignal:(int) signal 151 | { 152 | NSMutableDictionary * detail = [NSMutableDictionary dictionary]; 153 | 154 | [detail setObject:@(signal) forKey:@"signal type"]; 155 | 156 | [self saveToFile:detail]; 157 | } 158 | 159 | - (void)saveToFile:(NSMutableDictionary*)dict 160 | { 161 | NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; 162 | [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; 163 | NSString* dateString = [formatter stringFromDate:[NSDate date]]; 164 | 165 | //add date 166 | [dict setObject:dateString forKey:@"date"]; 167 | 168 | //save path 169 | NSString* savePath = [[_crashLogPath stringByAppendingPathComponent:dateString] stringByAppendingString:@".plist"]; 170 | 171 | //save to disk 172 | BOOL succeed = [ dict writeToFile:savePath atomically:YES]; 173 | if ( NO == succeed ) 174 | { 175 | NSLog(@"JxbDebugTool:crash report failed!"); 176 | } 177 | else 178 | NSLog(@"JxbDebugTool:save crash report succeed!"); 179 | 180 | [_plist insertObject:dateString atIndex:0]; 181 | [_plist writeToFile:[_crashLogPath stringByAppendingPathComponent:@"crashLog.plist"] atomically:YES]; 182 | 183 | if (_plist.count > maxCrashLogNum) 184 | { 185 | [[NSFileManager defaultManager] removeItemAtPath:[_crashLogPath stringByAppendingPathComponent:_plist[0]] error:nil]; 186 | [_plist writeToFile:[_crashLogPath stringByAppendingPathComponent:@"crashLog.plist"] atomically:YES]; 187 | } 188 | } 189 | 190 | #pragma mark - register 191 | void jxb_HandleException(NSException *exception) 192 | { 193 | [[JxbCrashHelper sharedInstance] saveException:exception]; 194 | [exception raise]; 195 | } 196 | 197 | void jxb_SignalHandler(int sig) 198 | { 199 | // [[JxbCrashHelper sharedInstance] saveSignal:sig]; 200 | // signal(sig, SIG_DFL); 201 | // raise(sig); 202 | } 203 | 204 | - (void)install 205 | { 206 | if (_isInstalled) { 207 | return; 208 | } 209 | _isInstalled = YES; 210 | //注册回调函数 211 | NSSetUncaughtExceptionHandler(&jxb_HandleException); 212 | signal(SIGABRT, jxb_SignalHandler); 213 | signal(SIGILL, jxb_SignalHandler); 214 | signal(SIGSEGV, jxb_SignalHandler); 215 | signal(SIGFPE, jxb_SignalHandler); 216 | signal(SIGBUS, jxb_SignalHandler); 217 | signal(SIGPIPE, jxb_SignalHandler); 218 | } 219 | 220 | - (void)dealloc 221 | { 222 | signal( SIGABRT, SIG_DFL ); 223 | signal( SIGBUS, SIG_DFL ); 224 | signal( SIGFPE, SIG_DFL ); 225 | signal( SIGILL, SIG_DFL ); 226 | signal( SIGPIPE, SIG_DFL ); 227 | signal( SIGSEGV, SIG_DFL ); 228 | } 229 | @end 230 | 231 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbCrashVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // JxbCrashVC.h 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter Jin @ https://github.com/JxbSir on 15/11/12. 6 | // Copyright (c) 2015年 Mail:i@Jxb.name. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JxbBaseVC.h" 11 | 12 | @interface JxbCrashVC : JxbBaseVC 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbCrashVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // JxbCrashVC.m 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter Jin @ https://github.com/JxbSir on 15/11/12. 6 | // Copyright (c) 2015年 Mail:i@Jxb.name. All rights reserved. 7 | // 8 | 9 | #import "JxbCrashVC.h" 10 | #import "JxbCrashHelper.h" 11 | #import "JxbDebugTool.h" 12 | #import "JxbHttpCell.h" 13 | #import "JxbContentVC.h" 14 | 15 | @interface JxbCrashVC () 16 | @property(nonatomic,strong)UITableView *tableView; 17 | @property(nonatomic,strong)NSArray *listData; 18 | @end 19 | 20 | @implementation JxbCrashVC 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | [self.navigationItem setTitle:@"Crash"]; 25 | 26 | 27 | self.listData = [[JxbCrashHelper sharedInstance] crashLogs]; 28 | 29 | self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped]; 30 | self.tableView.backgroundColor = [UIColor clearColor]; 31 | self.tableView.delegate = self; 32 | self.tableView.dataSource = self; 33 | self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; 34 | self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 35 | [self.view addSubview:self.tableView]; 36 | 37 | } 38 | -(void)viewWillAppear:(BOOL)animated{ 39 | [super viewWillAppear:animated]; 40 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 41 | [self setLeftBarButtonItem]; 42 | }); 43 | } 44 | -(void)setLeftBarButtonItem{ 45 | 46 | UIButton *btnclose = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)]; 47 | btnclose.titleLabel.font = [UIFont systemFontOfSize:13]; 48 | [btnclose setTitle:@"关闭" forState:UIControlStateNormal]; 49 | [btnclose addTarget:self action:@selector(dismissViewController) forControlEvents:UIControlEventTouchUpInside]; 50 | [btnclose setTitleColor:[JxbDebugTool shareInstance].mainColor forState:UIControlStateNormal]; 51 | 52 | UIBarButtonItem *btnleft = [[UIBarButtonItem alloc] initWithCustomView:btnclose]; 53 | self.navigationItem.leftBarButtonItem = btnleft; 54 | } 55 | - (void)dismissViewController { 56 | // [self dismissViewControllerAnimated:YES completion:nil]; 57 | [[JxbDebugTool shareInstance] showDebug]; 58 | } 59 | 60 | 61 | #pragma mark - UITableView Delegate 62 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 63 | return 1; 64 | } 65 | 66 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 67 | return self.listData.count; 68 | } 69 | 70 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 71 | return 55; 72 | } 73 | 74 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { 75 | return 0.1; 76 | } 77 | 78 | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { 79 | return 0.1; 80 | } 81 | 82 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 83 | static NSString *identifer = @"crashcell"; 84 | JxbHttpCell *cell = [tableView dequeueReusableCellWithIdentifier:identifer]; 85 | if (!cell) { 86 | cell = [[JxbHttpCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifer]; 87 | cell.accessoryType = UITableViewCellAccessoryNone; 88 | } 89 | NSDictionary* dic = [self.listData objectAtIndex:indexPath.row]; 90 | [cell setTitle:[dic objectForKey:@"date"] value:[dic objectForKey:@"type"]]; 91 | return cell; 92 | } 93 | 94 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 95 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 96 | NSDictionary* dic = [self.listData objectAtIndex:indexPath.row]; 97 | NSDictionary* dicinfo = [dic objectForKey:@"info"]; 98 | NSString* name = [dicinfo objectForKey:@"name"]; 99 | NSString* reason = [dicinfo objectForKey:@"reason"]; 100 | NSArray* callStack = [dicinfo objectForKey:@"callStack"]; 101 | NSMutableString* str = [[NSMutableString alloc] initWithFormat:@"%@\n\n%@\n\n",name,reason]; 102 | for (NSString* item in callStack) { 103 | [str appendString:item]; 104 | [str appendString:@"\n\n"]; 105 | } 106 | JxbContentVC* vc = [[JxbContentVC alloc] init]; 107 | vc.content = @"Crash日志"; 108 | vc.hidesBottomBarWhenPushed = YES; 109 | vc.content = str; 110 | [self.navigationController pushViewController:vc animated:YES]; 111 | } 112 | @end 113 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbDebugTool.h: -------------------------------------------------------------------------------- 1 | // 2 | // JxbDebugTool.h 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter Jin @ https://github.com/JxbSir on 15/11/12. 6 | // Copyright (c) 2015年 Mail:i@Jxb.name. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | #define kNotifyKeyReloadHttp @"kNotifyKeyReloadHttp" 13 | 14 | 15 | @protocol JxbDebugDelegate 16 | - (NSData*)decryptJson:(NSData*)data; 17 | @end 18 | 19 | @interface JxbDebugTool : NSObject 20 | 21 | /** 22 | * 主色调 23 | */ 24 | @property (nonatomic, copy) UIColor *mainColor; 25 | 26 | /** 27 | * 设置代理 28 | */ 29 | @property (nonatomic, weak) id delegate; 30 | 31 | /** 32 | * http请求数据是否加密,默认不加密 33 | */ 34 | @property (nonatomic, assign) BOOL isHttpRequestEncrypt; 35 | 36 | /** 37 | * http响应数据是否加密,默认不加密 38 | */ 39 | @property (nonatomic, assign) BOOL isHttpResponseEncrypt; 40 | 41 | /** 42 | * 日志最大数量,默认50条 43 | */ 44 | @property (nonatomic, assign) int maxLogsCount; 45 | 46 | /** 47 | * 设置只抓取的域名,忽略大小写,默认抓取所有 48 | */ 49 | @property (nonatomic, strong) NSArray *arrOnlyHosts; 50 | 51 | 52 | + (instancetype)shareInstance; 53 | /** 54 | * 启用 55 | */ 56 | - (void)enableDebugMode; 57 | 58 | - (void)showDebug; 59 | @end 60 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbDebugVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // JxbDebugVC.h 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter Jin @ https://github.com/JxbSir on 15/11/12. 6 | // Copyright (c) 2015年 Mail:i@Jxb.name. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JxbDebugVC : UITabBarController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbDebugVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // JxbDebugVC.m 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter Jin @ https://github.com/JxbSir on 15/11/12. 6 | // Copyright (c) 2015年 Mail:i@Jxb.name. All rights reserved. 7 | // 8 | 9 | #import "JxbDebugVC.h" 10 | 11 | @interface JxbDebugVC () 12 | 13 | @end 14 | 15 | @implementation JxbDebugVC 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | self.view.backgroundColor = [UIColor whiteColor]; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbHttpCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // JxbHttpCell.h 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter Jin @ https://github.com/JxbSir on 15/11/12. 6 | // Copyright (c) 2015年 Mail:i@Jxb.name. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JxbHttpDatasource.h" 11 | 12 | @interface JxbHttpCell : UITableViewCell 13 | 14 | - (void)setTitle:(NSString*)title value:(NSString*)value; 15 | 16 | -(void)setModel:(JxbHttpModel *)model; 17 | @end 18 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbHttpCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // JxbHttpCell.m 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter Jin @ https://github.com/JxbSir on 15/11/12. 6 | // Copyright (c) 2015年 Mail:i@Jxb.name. All rights reserved. 7 | // 8 | 9 | #import "JxbHttpCell.h" 10 | #import "JxbDebugTool.h" 11 | 12 | @interface JxbHttpCell() 13 | { 14 | UILabel *lblTitle; 15 | UILabel *lblValue; 16 | } 17 | @end 18 | 19 | @implementation JxbHttpCell 20 | 21 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { 22 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 23 | if (self) { 24 | self.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 25 | lblTitle = [[UILabel alloc] initWithFrame:CGRectMake(20, 10, [UIScreen mainScreen].bounds.size.width - 40, 20)]; 26 | lblTitle.textColor = [JxbDebugTool shareInstance].mainColor; 27 | lblTitle.font = [UIFont fontWithName:@"Helvetica-Bold" size:19]; 28 | [self addSubview:lblTitle]; 29 | 30 | lblValue = [[UILabel alloc] initWithFrame:CGRectMake(20, 35, [UIScreen mainScreen].bounds.size.width - 40, 16)]; 31 | lblValue.textColor = [UIColor lightGrayColor]; 32 | lblValue.font = [UIFont systemFontOfSize:12]; 33 | [self addSubview:lblValue]; 34 | } 35 | return self; 36 | } 37 | 38 | - (void)setTitle:(NSString*)title value:(NSString*)value { 39 | lblTitle.text = title; 40 | lblValue.text = value; 41 | } 42 | -(void)setModel:(JxbHttpModel *)model{ 43 | 44 | lblTitle.text = model.url.host; 45 | lblValue.text = model.url.path; 46 | [self handlerStatusCode:[model.statusCode intValue]]; 47 | } 48 | -(void)handlerStatusCode:(int)statusCode{ 49 | 50 | if((statusCode>=400 && statusCode<600) || statusCode==0){ 51 | 52 | lblTitle.textColor = [UIColor redColor]; 53 | } 54 | else if(statusCode>=300 && statusCode<400){ 55 | 56 | lblTitle.textColor = [UIColor orangeColor]; 57 | } 58 | else if (statusCode == 100){ 59 | 60 | lblTitle.textColor = [UIColor blueColor]; 61 | } 62 | else{ 63 | 64 | // lblTitle.textColor = [JxbDebugTool shareInstance].mainColor; 65 | lblTitle.textColor = TPFColorWithRGB(0x87d850); 66 | 67 | } 68 | } 69 | @end 70 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbHttpDatasource.h: -------------------------------------------------------------------------------- 1 | // 2 | // JxbHttpDatasource.h 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter on 15/11/13. 6 | // Copyright © 2015年 Peter. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface JxbHttpModel : NSObject 13 | @property (nonatomic,copy)NSString *requestId; 14 | @property (nonatomic,copy)NSURL *url; 15 | @property (nonatomic,copy)NSString *method; 16 | @property (nonatomic,copy)NSString *requestBody; 17 | @property (nonatomic,copy)NSString *statusCode; 18 | @property (nonatomic,copy)NSData *responseData; 19 | @property (nonatomic,assign)BOOL isImage; 20 | @property (nonatomic,copy)NSString *mineType; 21 | @property (nonatomic,copy)NSString *startTime; 22 | @property (nonatomic,copy)NSString *totalDuration; 23 | @property (nonatomic,copy)NSArray *cookies; 24 | @property (nonatomic,copy)NSError *error; 25 | @property (nonatomic,copy)NSDictionary *requestAllHTTPHeaderFields; 26 | @property (nonatomic,copy)NSDictionary *responseAllHTTPHeaderFields; 27 | 28 | @end 29 | 30 | @interface JxbHttpDatasource : NSObject 31 | 32 | @property (nonatomic,strong,readonly) NSMutableArray *httpArray; 33 | @property (nonatomic,strong,readonly) NSMutableArray *arrRequest; 34 | 35 | + (instancetype)shareInstance; 36 | /** 37 | * 记录http请求 38 | * 39 | * @param model http 40 | */ 41 | - (void)addHttpRequset:(JxbHttpModel*)model; 42 | 43 | - (BOOL)arrRequestContainObject:(NSString *)requestId; 44 | /** 45 | * 清空 46 | */ 47 | - (void)clear; 48 | 49 | /** 50 | * 解析 51 | * 52 | * @param data 53 | * 54 | * @return 55 | */ 56 | + (NSString *)prettyJSONStringFromData:(NSData *)data error:(NSError *)error; 57 | @end 58 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbHttpDatasource.m: -------------------------------------------------------------------------------- 1 | // 2 | // JxbHttpDatasource.m 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter on 15/11/13. 6 | // Copyright © 2015年 Peter. All rights reserved. 7 | // 8 | 9 | #import "JxbHttpDatasource.h" 10 | #import "YDNameValueModel.h" 11 | 12 | @implementation JxbHttpModel 13 | @end 14 | 15 | @implementation JxbHttpDatasource 16 | 17 | + (instancetype)shareInstance { 18 | static JxbHttpDatasource* tool; 19 | static dispatch_once_t once; 20 | dispatch_once(&once, ^{ 21 | tool = [[JxbHttpDatasource alloc] init]; 22 | }); 23 | return tool; 24 | } 25 | 26 | - (id)init { 27 | self = [super init]; 28 | if (self) { 29 | _httpArray = [NSMutableArray array]; 30 | _arrRequest = [NSMutableArray array]; 31 | } 32 | return self; 33 | } 34 | 35 | - (void)addHttpRequset:(JxbHttpModel*)model { 36 | @synchronized(self.httpArray) { 37 | model = [self getCookies:model]; 38 | [self.httpArray insertObject:model atIndex:0]; 39 | 40 | } 41 | @synchronized(self.arrRequest) { 42 | if (model.requestId&& model.requestId.length > 0) { 43 | [self.arrRequest addObject:model.requestId]; 44 | } 45 | } 46 | } 47 | -(BOOL)arrRequestContainObject:(NSString *)resquestId{ 48 | @synchronized(self.arrRequest) { 49 | if (resquestId && resquestId.length > 0) { 50 | return [self.arrRequest containsObject:resquestId]; 51 | } 52 | return NO; 53 | } 54 | } 55 | -(JxbHttpModel *)getCookies:(JxbHttpModel*)model{ 56 | 57 | NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; 58 | NSArray *cookies = [cookieStorage cookiesForURL:model.url]; 59 | 60 | NSMutableArray *mutableArray = [NSMutableArray new]; 61 | for (NSHTTPCookie *cookie in cookies) { 62 | NSString *cookieName = [cookie.properties valueForKey:NSHTTPCookieName]; 63 | NSString *cookieValue = [cookie.properties valueForKey:NSHTTPCookieValue]; 64 | YDNameValueModel *model = [YDNameValueModel new]; 65 | model.name = cookieName; 66 | model.value = cookieValue; 67 | [mutableArray addObject:model]; 68 | } 69 | 70 | model.cookies = mutableArray; 71 | return model; 72 | } 73 | - (void)clear { 74 | @synchronized(self.httpArray) { 75 | [self.httpArray removeAllObjects]; 76 | } 77 | @synchronized(self.arrRequest) { 78 | [self.arrRequest removeAllObjects]; 79 | } 80 | } 81 | 82 | 83 | #pragma mark - parse 84 | + (NSString *)prettyJSONStringFromData:(NSData *)data error:(NSError *)error 85 | { 86 | NSString *prettyString = nil; 87 | id jsonObject = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error]; 88 | if ([NSJSONSerialization isValidJSONObject:jsonObject]) { 89 | prettyString = [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:jsonObject options:NSJSONWritingPrettyPrinted error:NULL] encoding:NSUTF8StringEncoding]; 90 | // NSJSONSerialization escapes forward slashes. We want pretty json, so run through and unescape the slashes. 91 | prettyString = [prettyString stringByReplacingOccurrencesOfString:@"\\/" withString:@"/"]; 92 | } else { 93 | prettyString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; 94 | 95 | } 96 | 97 | return prettyString; 98 | } 99 | @end 100 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbHttpDetailVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // JxbHttpDetailVC.h 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter Jin @ https://github.com/JxbSir on 15/11/12. 6 | // Copyright (c) 2015年 Mail:i@Jxb.name. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JxbHttpDatasource.h" 11 | #import "JxbBaseVC.h" 12 | 13 | @interface JxbHttpDetailVC : JxbBaseVC 14 | @property (nonatomic,strong)JxbHttpModel *detail; 15 | @end 16 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbHttpProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // JxbHttpProtocol.h 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter Jin @ https://github.com/JxbSir on 15/11/12. 6 | // Copyright (c) 2015年 Mail:i@Jxb.name. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface JxbHttpProtocol : NSURLProtocol 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbHttpProtocol.m: -------------------------------------------------------------------------------- 1 | // 2 | // JxbHttpProtocol.m 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter Jin @ https://github.com/JxbSir on 15/11/12. 6 | // Copyright (c) 2015年 Mail:i@Jxb.name. All rights reserved. 7 | // 8 | 9 | #import "JxbHttpProtocol.h" 10 | #import 11 | #import "JxbDebugVC.h" 12 | #import "JxbDebugTool.h" 13 | #import "JxbHttpDatasource.h" 14 | 15 | #define myProtocolKey @"JxbHttpProtocol" 16 | 17 | 18 | @interface JxbHttpProtocol() 19 | @property (nonatomic, strong) NSURLConnection *connection; 20 | @property (nonatomic, strong) NSURLResponse *response; 21 | @property (nonatomic, strong) NSMutableData *data; 22 | @property (nonatomic, strong) NSError *error; 23 | @property (nonatomic, assign) NSTimeInterval startTime; 24 | @end 25 | 26 | @implementation JxbHttpProtocol 27 | 28 | 29 | #pragma mark - protocol 30 | + (void)load { 31 | 32 | } 33 | 34 | + (BOOL)canInitWithRequest:(NSURLRequest *)request { 35 | if (![request.URL.scheme isEqualToString:@"http"] && 36 | ![request.URL.scheme isEqualToString:@"https"]) { 37 | return NO; 38 | } 39 | 40 | if ([NSURLProtocol propertyForKey:myProtocolKey inRequest:request] ) { 41 | return NO; 42 | } 43 | 44 | if ([[JxbDebugTool shareInstance] arrOnlyHosts].count > 0) { 45 | NSString* url = [request.URL.absoluteString lowercaseString]; 46 | for (NSString* _url in [JxbDebugTool shareInstance].arrOnlyHosts) { 47 | if ([url rangeOfString:[_url lowercaseString]].location != NSNotFound) 48 | return YES; 49 | } 50 | return NO; 51 | } 52 | 53 | return YES; 54 | } 55 | 56 | + (NSURLRequest *)canonicalRequestForRequest:(NSURLRequest *)request { 57 | NSMutableURLRequest *mutableReqeust = [request mutableCopy]; 58 | [NSURLProtocol setProperty:@YES forKey:myProtocolKey inRequest:mutableReqeust]; 59 | return [mutableReqeust copy]; 60 | } 61 | 62 | - (void)startLoading { 63 | self.data = [NSMutableData data]; 64 | #pragma clang diagnostic push 65 | #pragma clang diagnostic ignored "-Wdeprecated-declarations" 66 | self.connection = [[NSURLConnection alloc] initWithRequest:[[self class] canonicalRequestForRequest:self.request] delegate:self startImmediately:YES]; 67 | #pragma clang diagnostic pop 68 | self.startTime = [[NSDate date] timeIntervalSince1970]; 69 | } 70 | 71 | - (void)stopLoading { 72 | [self.connection cancel]; 73 | 74 | JxbHttpModel* model = [[JxbHttpModel alloc] init]; 75 | model.url = self.request.URL; 76 | model.method = self.request.HTTPMethod; 77 | model.mineType = self.response.MIMEType; 78 | if (self.request && self.request.HTTPBody) { 79 | NSData* data = self.request.HTTPBody; 80 | if ([[JxbDebugTool shareInstance] isHttpRequestEncrypt]) { 81 | if ([[JxbDebugTool shareInstance] delegate] && [[JxbDebugTool shareInstance].delegate respondsToSelector:@selector(decryptJson:)]) { 82 | data = [[JxbDebugTool shareInstance].delegate decryptJson:self.request.HTTPBody]; 83 | } 84 | } 85 | model.requestBody = [JxbHttpDatasource prettyJSONStringFromData:data error:nil]; 86 | } 87 | NSHTTPURLResponse* httpResponse = (NSHTTPURLResponse*)self.response; 88 | model.statusCode = [NSString stringWithFormat:@"%d",(int)httpResponse.statusCode]; 89 | model.responseData = self.data; 90 | model.isImage = [self.response.MIMEType rangeOfString:@"image"].location != NSNotFound; 91 | model.totalDuration = [NSString stringWithFormat:@"%fs",[[NSDate date] timeIntervalSince1970] - self.startTime]; 92 | model.startTime = [NSString stringWithFormat:@"%fs",self.startTime]; 93 | model.error = self.error; 94 | model.requestAllHTTPHeaderFields = self.request.allHTTPHeaderFields; 95 | model.responseAllHTTPHeaderFields = httpResponse.allHeaderFields; 96 | 97 | [[JxbHttpDatasource shareInstance] addHttpRequset:model]; 98 | [[NSNotificationCenter defaultCenter] postNotificationName:kNotifyKeyReloadHttp object:nil]; 99 | } 100 | 101 | #pragma mark - NSURLConnectionDelegate 102 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 103 | { 104 | [[self client] URLProtocol:self didFailWithError:error]; 105 | self.error = error; 106 | } 107 | 108 | - (BOOL)connectionShouldUseCredentialStorage:(NSURLConnection *)connection { 109 | return YES; 110 | } 111 | 112 | - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { 113 | [[self client] URLProtocol:self didReceiveAuthenticationChallenge:challenge]; 114 | } 115 | 116 | - (void)connection:(NSURLConnection *)connection didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { 117 | [[self client] URLProtocol:self didCancelAuthenticationChallenge:challenge]; 118 | } 119 | 120 | #pragma mark - NSURLConnectionDataDelegate 121 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 122 | { 123 | [[self client] URLProtocol:self didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageAllowed]; 124 | self.response = response; 125 | } 126 | 127 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 128 | { 129 | [[self client] URLProtocol:self didLoadData:data]; 130 | [self.data appendData:data]; 131 | } 132 | 133 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 134 | { 135 | return cachedResponse; 136 | } 137 | 138 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection { 139 | [[self client] URLProtocolDidFinishLoading:self]; 140 | } 141 | @end 142 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbHttpVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // JxbHttpVC.h 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter Jin @ https://github.com/JxbSir on 15/11/12. 6 | // Copyright (c) 2015年 Mail:i@Jxb.name. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JxbBaseVC.h" 11 | 12 | @interface JxbHttpVC : JxbBaseVC 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbHttpVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // JxbHttpVC.m 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter Jin @ https://github.com/JxbSir on 15/11/12. 6 | // Copyright (c) 2015年 Mail:i@Jxb.name. All rights reserved. 7 | // 8 | 9 | #import "JxbHttpVC.h" 10 | #import "JxbHttpDetailVC.h" 11 | #import "JxbDebugTool.h" 12 | #import "JxbHttpCell.h" 13 | 14 | @interface JxbHttpVC () 15 | @property (nonatomic, strong) UITableView *tableView; 16 | @property (nonatomic, strong) NSArray *listData; 17 | @end 18 | 19 | @implementation JxbHttpVC 20 | 21 | - (void)dealloc { 22 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 23 | } 24 | 25 | - (void)viewDidLoad { 26 | [super viewDidLoad]; 27 | [self.navigationItem setTitle:@"Http"]; 28 | 29 | UIButton *btnclear = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)]; 30 | btnclear.titleLabel.font = [UIFont systemFontOfSize:13]; 31 | [btnclear setTitle:@"清空" forState:UIControlStateNormal]; 32 | [btnclear addTarget:self action:@selector(clearAction) forControlEvents:UIControlEventTouchUpInside]; 33 | [btnclear setTitleColor:[JxbDebugTool shareInstance].mainColor forState:UIControlStateNormal]; 34 | 35 | UIBarButtonItem *btnright = [[UIBarButtonItem alloc] initWithCustomView:btnclear]; 36 | self.navigationItem.rightBarButtonItem = btnright; 37 | 38 | self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain]; 39 | self.tableView.backgroundColor = [UIColor clearColor]; 40 | self.tableView.delegate = self; 41 | self.tableView.dataSource = self; 42 | self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; 43 | self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 44 | self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; 45 | [self.view addSubview:self.tableView]; 46 | 47 | [self reloadHttp]; 48 | 49 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadHttp) name:kNotifyKeyReloadHttp object:nil]; 50 | } 51 | 52 | - (void)viewWillAppear:(BOOL)animated { 53 | [super viewWillAppear:animated]; 54 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 55 | [self setLeftBarButtonItem]; 56 | }); 57 | } 58 | 59 | - (void)setLeftBarButtonItem { 60 | UIButton *btnclose = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)]; 61 | btnclose.titleLabel.font = [UIFont systemFontOfSize:13]; 62 | [btnclose setTitle:@"关闭" forState:UIControlStateNormal]; 63 | [btnclose addTarget:self action:@selector(dismissViewController) forControlEvents:UIControlEventTouchUpInside]; 64 | [btnclose setTitleColor:[JxbDebugTool shareInstance].mainColor forState:UIControlStateNormal]; 65 | 66 | UIBarButtonItem *btnleft = [[UIBarButtonItem alloc] initWithCustomView:btnclose]; 67 | self.navigationItem.leftBarButtonItem = btnleft; 68 | } 69 | 70 | - (void)dismissViewController { 71 | // [self dismissViewControllerAnimated:YES completion:nil]; 72 | [[JxbDebugTool shareInstance] showDebug]; 73 | } 74 | 75 | - (void)clearAction { 76 | dispatch_async(dispatch_get_main_queue(), ^{ 77 | [[JxbHttpDatasource shareInstance] clear]; 78 | self.listData = nil; 79 | [self.tableView reloadData]; 80 | }); 81 | } 82 | 83 | - (void)reloadHttp { 84 | dispatch_async(dispatch_get_main_queue(), ^{ 85 | self.listData = [[[JxbHttpDatasource shareInstance] httpArray] copy]; 86 | [self.tableView reloadData]; 87 | }); 88 | } 89 | 90 | #pragma mark - UITableView Delegate 91 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 92 | return 1; 93 | } 94 | 95 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 96 | return self.listData.count; 97 | } 98 | 99 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 100 | return 55; 101 | } 102 | 103 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 104 | static NSString *identifer = @"httpcell"; 105 | JxbHttpCell *cell = [tableView dequeueReusableCellWithIdentifier:identifer]; 106 | if (!cell) { 107 | cell = [[JxbHttpCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifer]; 108 | } 109 | JxbHttpModel *model = [self.listData objectAtIndex:indexPath.row]; 110 | // [cell setTitle:model.url.host value:model.url.path]; 111 | [cell setModel:model]; 112 | return cell; 113 | } 114 | 115 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 116 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 117 | JxbHttpModel *model = [self.listData objectAtIndex:indexPath.row]; 118 | JxbHttpDetailVC *vc = [[JxbHttpDetailVC alloc] init]; 119 | vc.hidesBottomBarWhenPushed = YES; 120 | vc.detail = model; 121 | [self.navigationController pushViewController:vc animated:YES]; 122 | } 123 | 124 | @end 125 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbLogVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // JxbLogVC.h 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter on 15/11/16. 6 | // Copyright © 2015年 Peter. All rights reserved. 7 | // 8 | 9 | #import "JxbBaseVC.h" 10 | 11 | @interface JxbLogVC : JxbBaseVC 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbLogVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // JxbLogVC.m 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter on 15/11/16. 6 | // Copyright © 2015年 Peter. All rights reserved. 7 | // 8 | 9 | #import "JxbLogVC.h" 10 | #import 11 | #include 12 | #import "JxbDebugTool.h" 13 | 14 | @interface JxbLogModel:NSObject 15 | @property (nonatomic, strong) NSDate *date; 16 | @property (nonatomic, copy) NSString *sender; 17 | @property (nonatomic, copy) NSString *messageText; 18 | @property (nonatomic, assign) long long messageID; 19 | @end 20 | 21 | @implementation JxbLogModel 22 | 23 | +(instancetype)messageFromASLMessage:(aslmsg)aslMessage 24 | { 25 | JxbLogModel *logMessage = [[JxbLogModel alloc] init]; 26 | 27 | const char *timestamp = asl_get(aslMessage, ASL_KEY_TIME); 28 | if (timestamp) { 29 | NSTimeInterval timeInterval = [@(timestamp) integerValue]; 30 | const char *nanoseconds = asl_get(aslMessage, ASL_KEY_TIME_NSEC); 31 | if (nanoseconds) { 32 | timeInterval += [@(nanoseconds) doubleValue] / NSEC_PER_SEC; 33 | } 34 | logMessage.date = [NSDate dateWithTimeIntervalSince1970:timeInterval]; 35 | } 36 | 37 | const char *sender = asl_get(aslMessage, ASL_KEY_SENDER); 38 | if (sender) { 39 | logMessage.sender = @(sender); 40 | } 41 | 42 | const char *messageText = asl_get(aslMessage, ASL_KEY_MSG); 43 | if (messageText) { 44 | logMessage.messageText = @(messageText); 45 | 46 | } 47 | 48 | const char *messageID = asl_get(aslMessage, ASL_KEY_MSG_ID); 49 | if (messageID) { 50 | logMessage.messageID = [@(messageID) longLongValue]; 51 | 52 | } 53 | 54 | return logMessage; 55 | } 56 | 57 | + (NSString *)stringFormatFromDate:(NSDate *)date 58 | { 59 | static NSDateFormatter *formatter = nil; 60 | static dispatch_once_t onceToken; 61 | dispatch_once(&onceToken, ^{ 62 | formatter = [[NSDateFormatter alloc] init]; 63 | formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss.SSS"; 64 | }); 65 | 66 | return [formatter stringFromDate:date]; 67 | } 68 | @end 69 | 70 | @interface JxbLogVC () 71 | { 72 | int maxCount; 73 | UITextView *txt; 74 | } 75 | @end 76 | 77 | @implementation JxbLogVC 78 | 79 | - (void)viewDidLoad { 80 | [super viewDidLoad]; 81 | self.title = @"Log"; 82 | maxCount = [JxbDebugTool shareInstance].maxLogsCount; 83 | if (maxCount == 0) 84 | maxCount = 50; 85 | 86 | txt = [[UITextView alloc] init]; 87 | [txt setEditable:NO]; 88 | txt.backgroundColor = [UIColor blackColor]; 89 | txt.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 90 | txt.frame = self.view.bounds; 91 | [self.view addSubview:txt]; 92 | 93 | 94 | UIButton *btnrefresh = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)]; 95 | btnrefresh.titleLabel.font = [UIFont systemFontOfSize:13]; 96 | [btnrefresh setTitle:@"刷新" forState:UIControlStateNormal]; 97 | [btnrefresh addTarget:self action:@selector(loadLogs) forControlEvents:UIControlEventTouchUpInside]; 98 | [btnrefresh setTitleColor:[JxbDebugTool shareInstance].mainColor forState:UIControlStateNormal]; 99 | 100 | UIBarButtonItem *barrefresh = [[UIBarButtonItem alloc] initWithCustomView:btnrefresh]; 101 | self.navigationItem.rightBarButtonItem = barrefresh; 102 | 103 | 104 | [self loadLogs]; 105 | } 106 | -(void)viewWillAppear:(BOOL)animated{ 107 | [super viewWillAppear:animated]; 108 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 109 | [self setLeftBarButtonItem]; 110 | }); 111 | } 112 | -(void)setLeftBarButtonItem{ 113 | 114 | UIButton *btnclose = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)]; 115 | btnclose.titleLabel.font = [UIFont systemFontOfSize:13]; 116 | [btnclose setTitle:@"关闭" forState:UIControlStateNormal]; 117 | [btnclose addTarget:self action:@selector(dismissViewController) forControlEvents:UIControlEventTouchUpInside]; 118 | [btnclose setTitleColor:[JxbDebugTool shareInstance].mainColor forState:UIControlStateNormal]; 119 | 120 | UIBarButtonItem *btnleft = [[UIBarButtonItem alloc] initWithCustomView:btnclose]; 121 | self.navigationItem.leftBarButtonItem = btnleft; 122 | } 123 | - (void)dismissViewController { 124 | // [self dismissViewControllerAnimated:YES completion:nil]; 125 | [[JxbDebugTool shareInstance] showDebug]; 126 | } 127 | 128 | - (void)loadLogs { 129 | __weak UITextView* weakTxt = txt; 130 | dispatch_async(dispatch_get_global_queue(0, 0), ^{ 131 | NSArray* arr = [self logs]; 132 | if (arr.count > 0) { 133 | NSMutableAttributedString* string = [[NSMutableAttributedString alloc] init]; 134 | for (JxbLogModel* model in arr) { 135 | NSString* date = [JxbLogModel stringFormatFromDate:model.date]; 136 | NSMutableAttributedString* att = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@:",date]]; 137 | [att addAttribute:NSForegroundColorAttributeName value:[JxbDebugTool shareInstance].mainColor range:NSMakeRange(0, att.string.length)]; 138 | 139 | NSMutableAttributedString* att2 = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@\n\n",model.messageText]]; 140 | [att2 addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(0, att2.string.length)]; 141 | 142 | [string appendAttributedString:att]; 143 | [string appendAttributedString:att2]; 144 | } 145 | 146 | dispatch_async(dispatch_get_main_queue(), ^{ 147 | weakTxt.attributedText = string; 148 | }); 149 | 150 | // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 151 | // [weakTxt scrollRectToVisible:CGRectMake(0, weakTxt.contentSize.height, weakTxt.frame.size.width, 1) animated:NO]; 152 | // }); 153 | } 154 | }); 155 | } 156 | 157 | - (NSArray* )logs { 158 | asl_object_t query = asl_new(ASL_TYPE_QUERY); 159 | char pidStr[100]; 160 | sprintf(pidStr,"%d",[[NSProcessInfo processInfo] processIdentifier]); 161 | asl_set_query(query, ASL_KEY_PID, pidStr, ASL_QUERY_OP_EQUAL); 162 | 163 | //this is too slow! 164 | aslresponse response = asl_search(NULL, query); 165 | NSUInteger numberOfLogs = maxCount; 166 | NSMutableArray *logMessages = [NSMutableArray arrayWithCapacity:numberOfLogs]; 167 | size_t count = asl_count(response); 168 | for (int i=0; i 10 | 11 | @interface JxbMemoryHelper : NSObject 12 | 13 | + (unsigned long long)bytesOfUsedMemory; 14 | @end 15 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbMemoryHelper.m: -------------------------------------------------------------------------------- 1 | // 2 | // JxbMemoryHelper.m 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter on 15/11/13. 6 | // Copyright © 2015年 Peter. All rights reserved. 7 | // 8 | 9 | #import "JxbMemoryHelper.h" 10 | #include 11 | #include 12 | 13 | static vm_size_t jPageSize = 0; 14 | static vm_statistics_data_t jVMStats; 15 | 16 | @implementation JxbMemoryHelper 17 | 18 | + (unsigned long long)bytesOfUsedMemory 19 | { 20 | struct mstats stat = mstats(); 21 | return stat.bytes_used; 22 | } 23 | 24 | //+ (unsigned long long)bytesOfFreeMemory 25 | //{ 26 | // return NSRealMemoryAvailable(); 27 | //} 28 | 29 | + (unsigned long long)bytesOfTotalMemory 30 | { 31 | [self updateHostStatistics]; 32 | 33 | unsigned long long free_count = (unsigned long long)jVMStats.free_count; 34 | unsigned long long active_count = (unsigned long long)jVMStats.active_count; 35 | unsigned long long inactive_count = (unsigned long long)jVMStats.inactive_count; 36 | unsigned long long wire_count = (unsigned long long)jVMStats.wire_count; 37 | unsigned long long pageSize = (unsigned long long)jPageSize; 38 | 39 | unsigned long long mem_free = (free_count + active_count + inactive_count + wire_count) * pageSize; 40 | return mem_free; 41 | } 42 | 43 | //for internal use 44 | + (BOOL)updateHostStatistics { 45 | mach_port_t host_port = mach_host_self(); 46 | mach_msg_type_number_t host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t); 47 | host_page_size(host_port, &jPageSize); 48 | return (host_statistics(host_port, HOST_VM_INFO, (host_info_t)&jVMStats, &host_size) 49 | == KERN_SUCCESS); 50 | } 51 | @end 52 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbResponseVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // JxbResponseVC.h 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter on 16/5/5. 6 | // Copyright © 2016年 Peter. All rights reserved. 7 | // 8 | #import "JxbBaseVC.h" 9 | #import "JxbHttpDatasource.h" 10 | 11 | @interface JxbResponseVC : JxbBaseVC 12 | @property (nonatomic,strong) JxbHttpModel *model; 13 | @end 14 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/JxbResponseVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // JxbResponseVC.m 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter on 16/5/5. 6 | // Copyright © 2016年 Peter. All rights reserved. 7 | // 8 | 9 | #import "JxbResponseVC.h" 10 | #import "JxbDebugTool.h" 11 | #import "JxbHttpDatasource.h" 12 | #import "YDHtmlDisplayUtils.h" 13 | @import WebKit; 14 | 15 | @interface JxbResponseVC () 16 | { 17 | UIImageView *img; 18 | 19 | } 20 | @property (nonatomic, strong) NSString *contentString; 21 | @property (strong, nonatomic) YDHtmlDisplayUtils *JSONDisplayUtils; 22 | @end 23 | 24 | @implementation JxbResponseVC 25 | 26 | - (void)viewDidLoad { 27 | [super viewDidLoad]; 28 | self.view.backgroundColor = [UIColor whiteColor]; 29 | 30 | UIButton *btnclose = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)]; 31 | btnclose.titleLabel.font = [UIFont systemFontOfSize:13]; 32 | [btnclose setTitle:@"Back" forState:UIControlStateNormal]; 33 | [btnclose addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside]; 34 | [btnclose setTitleColor:[JxbDebugTool shareInstance].mainColor forState:UIControlStateNormal]; 35 | UIBarButtonItem *btnleft = [[UIBarButtonItem alloc] initWithCustomView:btnclose]; 36 | self.navigationItem.leftBarButtonItem = btnleft; 37 | 38 | if (!self.model.isImage) { 39 | 40 | NSData* contentdata = self.model.responseData; 41 | if ([[JxbDebugTool shareInstance] isHttpResponseEncrypt]) { 42 | if ([[JxbDebugTool shareInstance] delegate] && [[JxbDebugTool shareInstance].delegate respondsToSelector:@selector(decryptJson:)]) { 43 | contentdata = [[JxbDebugTool shareInstance].delegate decryptJson:self.model.responseData]; 44 | } 45 | } 46 | NSError *error; 47 | NSDictionary *dataDictionary; 48 | if([self.model.mineType rangeOfString:@"html"].location != NSNotFound){ 49 | 50 | dataDictionary = [NSJSONSerialization JSONObjectWithData:self.model.responseData 51 | options:NSJSONReadingMutableContainers 52 | error:&error]; 53 | if(!dataDictionary){ 54 | _contentString = [JxbHttpDatasource prettyJSONStringFromData:contentdata error:error]; 55 | [self addWebView]; 56 | return; 57 | } 58 | } 59 | else if([self.model.mineType rangeOfString:@"json"].location != NSNotFound){ 60 | 61 | dataDictionary = [NSJSONSerialization JSONObjectWithData:self.model.responseData 62 | options:NSJSONReadingMutableContainers 63 | error:&error]; 64 | } 65 | else if([self.model.mineType rangeOfString:@"javascript"].location != NSNotFound){ 66 | 67 | NSStringEncoding gbkEncoding = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000); 68 | NSString *content = [[NSString alloc] initWithData:self.model.responseData encoding:gbkEncoding]; 69 | NSData *data = [content dataUsingEncoding:NSUTF8StringEncoding]; 70 | dataDictionary = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&error]; 71 | 72 | } 73 | else{ 74 | 75 | _contentString = [JxbHttpDatasource prettyJSONStringFromData:contentdata error:error]; 76 | } 77 | 78 | NSMutableAttributedString *mutableAttributedString; 79 | self.JSONDisplayUtils = [YDHtmlDisplayUtils new]; 80 | if(!error){ 81 | 82 | if(dataDictionary){ 83 | mutableAttributedString = [self.JSONDisplayUtils handlerData:dataDictionary]; 84 | _contentString = mutableAttributedString.string; 85 | } 86 | } 87 | else{ 88 | 89 | // _contentString = [[self.JSONDisplayUtils handlerData:error.userInfo] string]; 90 | _contentString = nil; 91 | } 92 | 93 | [self addWebView]; 94 | } 95 | else { 96 | img = [[UIImageView alloc] initWithFrame:self.view.bounds]; 97 | img.contentMode = UIViewContentModeScaleAspectFit; 98 | img.image = [UIImage imageWithData:self.model.responseData]; 99 | [self.view addSubview:img]; 100 | } 101 | } 102 | -(void)addWebView{ 103 | 104 | NSString *jScript = @"var meta = document.createElement('meta'); meta.setAttribute('name', 'viewport'); meta.setAttribute('content', 'width=device-width,height=1500,initial-scale=1,user-scalable=yes,minimum-scale=0.01,maximum-scale=3,minimal-ui'); document.getElementsByTagName('head')[0].appendChild(meta);"; 105 | 106 | WKUserScript *wkUScript = [[WKUserScript alloc] initWithSource:jScript injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES]; 107 | WKUserContentController *wkUController = [[WKUserContentController alloc] init]; 108 | [wkUController addUserScript:wkUScript]; 109 | 110 | WKWebViewConfiguration *wkWebConfig = [[WKWebViewConfiguration alloc] init]; 111 | wkWebConfig.userContentController = wkUController; 112 | 113 | WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.bounds configuration:wkWebConfig]; 114 | [self.view addSubview:webView]; 115 | 116 | if(_contentString) 117 | [webView loadHTMLString:_contentString baseURL:nil]; 118 | else{ 119 | [webView loadData:self.model.responseData MIMEType:self.model.mineType characterEncodingName:@"GBK" baseURL:self.model.url]; 120 | } 121 | 122 | } 123 | - (void)copyAction { 124 | // UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; 125 | // pasteboard.string = [txt.text copy]; 126 | } 127 | 128 | - (void)backAction { 129 | [self.navigationController popViewControllerAnimated:YES]; 130 | } 131 | @end 132 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/NSURLRequest+Identify.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSURLRequest+Identify.h 3 | // Pods 4 | // 5 | // Created by Peter on 16/1/23. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface NSURLRequest (Identify) 12 | 13 | - (NSString *)requestId; 14 | - (void)setRequestId:(NSString *)requestId; 15 | 16 | 17 | - (NSNumber*)startTime; 18 | - (void)setStartTime:(NSNumber*)startTime; 19 | @end 20 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/NSURLRequest+Identify.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSURLRequest+Identify.m 3 | // Pods 4 | // 5 | // Created by Peter on 16/1/23. 6 | // 7 | // 8 | 9 | #import "NSURLRequest+Identify.h" 10 | #import 11 | 12 | @implementation NSURLRequest (Identify) 13 | 14 | - (NSString *)requestId { 15 | return objc_getAssociatedObject(self, @"requestId"); 16 | } 17 | 18 | - (void)setRequestId:(NSString *)requestId { 19 | objc_setAssociatedObject(self, @"requestId", requestId, OBJC_ASSOCIATION_COPY_NONATOMIC); 20 | } 21 | 22 | - (NSNumber*)startTime { 23 | return objc_getAssociatedObject(self, @"startTime"); 24 | } 25 | 26 | - (void)setStartTime:(NSNumber*)startTime { 27 | objc_setAssociatedObject(self, @"startTime", startTime, OBJC_ASSOCIATION_COPY_NONATOMIC); 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/NSURLResponse+Data.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSURLResponse+Data.h 3 | // Pods 4 | // 5 | // Created by Peter on 16/1/23. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface NSURLResponse (Data) 12 | 13 | - (NSData *)responseData; 14 | - (void)setResponseData:(NSData *)responseData; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/NSURLResponse+Data.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSURLResponse+Data.m 3 | // Pods 4 | // 5 | // Created by Peter on 16/1/23. 6 | // 7 | // 8 | 9 | #import "NSURLResponse+Data.h" 10 | #import 11 | 12 | @implementation NSURLResponse (Data) 13 | 14 | - (NSData *)responseData { 15 | return objc_getAssociatedObject(self, @"responseData"); 16 | } 17 | 18 | - (void)setResponseData:(NSData *)responseData { 19 | objc_setAssociatedObject(self, @"responseData", responseData, OBJC_ASSOCIATION_COPY_NONATOMIC); 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/NSURLSessionTask+Data.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSURLSessionTask+Data.h 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter on 16/2/24. 6 | // Copyright © 2016年 Peter. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSURLSessionTask (Data) 12 | 13 | - (NSString*)taskDataIdentify; 14 | - (void)setTaskDataIdentify:(NSString*)name; 15 | 16 | - (NSMutableData*)responseDatas; 17 | - (void)setResponseDatas:(NSMutableData*)data; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/NSURLSessionTask+Data.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSURLSessionTask+Data.m 3 | // JxbHttpProtocol 4 | // 5 | // Created by Peter on 16/2/24. 6 | // Copyright © 2016年 Peter. All rights reserved. 7 | // 8 | 9 | #import "NSURLSessionTask+Data.h" 10 | #import 11 | 12 | @implementation NSURLSessionTask (Data) 13 | 14 | - (NSString*)taskDataIdentify { 15 | return objc_getAssociatedObject(self, @"taskDataIdentify"); 16 | } 17 | - (void)setTaskDataIdentify:(NSString*)name { 18 | objc_setAssociatedObject(self, @"taskDataIdentify", name, OBJC_ASSOCIATION_COPY_NONATOMIC); 19 | } 20 | 21 | - (NSMutableData*)responseDatas { 22 | return objc_getAssociatedObject(self, @"responseDatas"); 23 | } 24 | 25 | - (void)setResponseDatas:(NSMutableData*)data { 26 | objc_setAssociatedObject(self, @"responseDatas", data, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/NSURLSessionTask+Swizzling.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSURLSessionTask+Swizzling.h 3 | // JxbFramework 4 | // 5 | // Created by Peter on 16/1/22. 6 | // Copyright © 2016年 Peter. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSURLSession (Swizzling) 12 | 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/TPFDebugTool.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #define TPFColorWithRGB(rgbValue) \ 14 | [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16)) / 255.0 \ 15 | green:((float)((rgbValue & 0xFF00) >> 8)) / 255.0 \ 16 | blue:((float)(rgbValue & 0xFF)) / 255.0 alpha:1.0] 17 | 18 | #define kScreenWidth [UIScreen mainScreen].bounds.size.width 19 | #define kScreenHeight [UIScreen mainScreen].bounds.size.height 20 | 21 | #define kIsIphoneXScreen ({\ 22 | BOOL isBangsScreen = NO; \ 23 | if (@available(iOS 11.0, *)) { \ 24 | UIWindow *window = [[UIApplication sharedApplication].windows firstObject]; \ 25 | isBangsScreen = window.safeAreaInsets.bottom > 0; \ 26 | } \ 27 | isBangsScreen; \ 28 | }) 29 | 30 | #define kStatusBarHeight (kIsIphoneXScreen?44:20) 31 | #define kNavBarHeight 44 32 | #define kTabBarHeight (kIsIphoneXScreen?83:49) 33 | #define KTopBarHeight (kStatusBarHeight+kNavBarHeight) 34 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/YDHtmlDisplayUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // YDJSONDisplayUtils.h 3 | // YDJSONDisplay 4 | // 5 | // Created by Roc.Tian on 2017/3/17. 6 | // Copyright © 2017年 Roc.Tian. All rights reserved. 7 | // 8 | 9 | #define YDFONT [UIFont systemFontOfSize:15.0f] 10 | #define KEYCOLOR TPFColorWithRGB(0xd68432) 11 | #define INTCOLOR TPFColorWithRGB(0x999933) 12 | #define OTHERVALUECOLOR TPFColorWithRGB(0x3333ee) 13 | 14 | 15 | @interface YDHtmlDisplayUtils : NSObject 16 | 17 | @property(strong,nonatomic) NSMutableAttributedString *mutableAttributedString; 18 | 19 | @property(nonatomic) float maxWidth; 20 | -(NSMutableAttributedString *)handlerData:(id)object; 21 | @end 22 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/YDJSONDisplayUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // YDJSONDisplayUtils.h 3 | // YDJSONDisplay 4 | // 5 | // Created by Roc.Tian on 2017/3/17. 6 | // Copyright © 2017年 Roc.Tian. All rights reserved. 7 | // 8 | 9 | #define YDFONT [UIFont systemFontOfSize:15.0f] 10 | #define KEYCOLOR TPFColorWithRGB(0xd68432) 11 | #define INTCOLOR TPFColorWithRGB(0x999933) 12 | #define OTHERVALUECOLOR TPFColorWithRGB(0x3333ee) 13 | 14 | 15 | @interface YDJSONDisplayUtils : NSObject 16 | 17 | @property(strong,nonatomic) NSMutableAttributedString *mutableAttributedString; 18 | 19 | @property(nonatomic) float maxWidth; 20 | -(NSMutableAttributedString *)handlerData:(id)object; 21 | @end 22 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/YDNameValueModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // YDNameValueModel.h 3 | // Pods 4 | // 5 | // Created by tianpengfei on 2017/3/19. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface YDNameValueModel : NSObject 12 | 13 | @property(strong,nonatomic) NSString *name; 14 | @property(strong,nonatomic) NSString *value; 15 | 16 | @property(nonatomic) float height; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/YDNameValueModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // YDNameValueModel.m 3 | // Pods 4 | // 5 | // Created by tianpengfei on 2017/3/19. 6 | // 7 | // 8 | 9 | #import "YDNameValueModel.h" 10 | 11 | @implementation YDNameValueModel 12 | 13 | -(void)setName:(NSString *)name{ 14 | 15 | name = [NSString stringWithFormat:@"%@",name]; 16 | _name = [name stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];; 17 | } 18 | -(void)setValue:(NSString *)value{ 19 | 20 | value = [NSString stringWithFormat:@"%@",value]; 21 | _value = [value stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 22 | 23 | self.height = [self maxHeight:_value]; 24 | } 25 | 26 | 27 | -(float)maxHeight:(NSString *)text{ 28 | 29 | NSStringDrawingOptions option = NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading; 30 | 31 | NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; 32 | [style setLineBreakMode:NSLineBreakByWordWrapping]; 33 | 34 | NSDictionary *attributes = @{NSFontAttributeName : [UIFont systemFontOfSize:14.0f], 35 | NSParagraphStyleAttributeName : style}; 36 | CGRect r = [text boundingRectWithSize:CGSizeMake([UIScreen mainScreen].bounds.size.width/2-12, MAXFLOAT) options:option attributes:attributes context:nil]; 37 | 38 | float height = r.size.height + 18; 39 | 40 | return height<=35?35:height+15; 41 | } 42 | @end 43 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/YDRequestCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // YDRequestCell.h 3 | // Pods 4 | // 5 | // Created by Roc.Tian on 2017/3/16. 6 | // 7 | // 8 | 9 | @interface YDRequestCell : UITableViewCell 10 | @property (unsafe_unretained, nonatomic) IBOutlet UILabel *nameLabel; 11 | @property (unsafe_unretained, nonatomic) IBOutlet UILabel *valueLabel; 12 | 13 | @property (nonatomic) float height; 14 | @end 15 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/YDRequestCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // YDRequestCell.m 3 | // Pods 4 | // 5 | // Created by Roc.Tian on 2017/3/16. 6 | // 7 | // 8 | 9 | #import "YDRequestCell.h" 10 | 11 | @implementation YDRequestCell 12 | 13 | - (void)awakeFromNib { 14 | [super awakeFromNib]; 15 | // Initialization code 16 | 17 | self.valueLabel.numberOfLines = 0; 18 | } 19 | 20 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 21 | [super setSelected:selected animated:animated]; 22 | 23 | // Configure the view for the selected state 24 | } 25 | 26 | #pragma mark setter 27 | -(void)setHeight:(float)height{ 28 | 29 | _height = height; 30 | 31 | float valueHeight = _height -8; 32 | 33 | self.valueLabel.frame = CGRectMake(self.valueLabel.frame.origin.x, (_height-valueHeight)/2, self.valueLabel.frame.size.width, valueHeight); 34 | self.nameLabel.frame = CGRectMake(self.nameLabel.frame.origin.x, (_height-self.nameLabel.frame.size.height)/2, self.nameLabel.frame.size.width, self.nameLabel.frame.size.height); 35 | } 36 | @end 37 | -------------------------------------------------------------------------------- /TPFDebugTool/Classes/YDRequestVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // YDRequestVC.h 3 | // Pods 4 | // 5 | // Created by Roc.Tian on 2017/3/16. 6 | // 7 | // 8 | #import "JxbHttpDatasource.h" 9 | 10 | @interface YDRequestVC : UIViewController 11 | @property (nonatomic,copy)NSString *content; 12 | @property(nonatomic,strong) JxbHttpModel *model; 13 | @property(nonatomic) BOOL isHeader; 14 | 15 | 16 | @property(strong,nonatomic)NSMutableArray *formData; 17 | @property(strong,nonatomic)NSMutableArray *cookiesData; 18 | @end 19 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj --------------------------------------------------------------------------------