├── LCDebugger ├── CMD │ ├── LCCMD.h │ ├── LCCMD.m │ ├── LCCMDInput.h │ ├── LCCMDInput.m │ ├── LCUIKeyBoard.h │ └── LCUIKeyBoard.m ├── Category │ ├── MethodSwizzle.h │ ├── MethodSwizzle.m │ ├── NSObject+LCFastSingleton.h │ ├── NSObject+LCFastSingleton.m │ ├── NSObject+ViewTree.h │ ├── NSObject+ViewTree.m │ ├── UIDevice+Reachability.h │ ├── UIDevice+Reachability.m │ ├── UIView+LCExtension.h │ ├── UIView+LCExtension.m │ ├── UIView+LCGesture.h │ ├── UIView+LCGesture.m │ ├── UIView+LCUIViewFrame.h │ ├── UIView+LCUIViewFrame.m │ ├── UIView+Observer.h │ ├── UIView+Observer.m │ ├── UIWindow+LCUIWindowHook.h │ └── UIWindow+LCUIWindowHook.m ├── Crash │ ├── LCCrashReport.h │ └── LCCrashReport.m ├── Debugger │ ├── LCActionSheet.h │ ├── LCActionSheet.m │ ├── LCDebuggerView.h │ └── LCDebuggerView.m ├── LCDebugger.h ├── LCDebugger.m ├── LOGO.txt ├── Log │ ├── LCLog.h │ ├── LCLog.mm │ ├── LCLogView.h │ └── LCLogView.m ├── SystemInfo │ ├── CPU │ │ ├── LCCPUInfo.h │ │ ├── LCCPUInfo.m │ │ ├── LCCPUInfoController.h │ │ ├── LCCPUInfoController.m │ │ ├── LCCPULoad.h │ │ ├── LCCPULoad.m │ │ ├── LCCPULoadFilter.h │ │ ├── LCCPULoadFilter.m │ │ ├── LCCPUTableView.h │ │ └── LCCPUTableView.m │ ├── Device │ │ ├── LCDeviceInfo.h │ │ ├── LCDeviceInfo.m │ │ ├── LCDeviceInfoController.h │ │ ├── LCDeviceInfoController.m │ │ ├── LCDeviceTableView.h │ │ └── LCDeviceTableView.m │ ├── GL │ │ ├── GLGraph │ │ │ ├── LCGLDataLine.h │ │ │ ├── LCGLDataLine.m │ │ │ ├── LCGLLineGraph.h │ │ │ └── LCGLLineGraph.m │ │ ├── GLTube │ │ │ ├── BubbleEffect │ │ │ │ ├── LCGLBubbleEffect.fsh │ │ │ │ ├── LCGLBubbleEffect.h │ │ │ │ ├── LCGLBubbleEffect.m │ │ │ │ └── LCGLBubbleEffect.vsh │ │ │ ├── LCGLTube.h │ │ │ └── LCGLTube.m │ │ ├── LCGLCommon.h │ │ ├── LCGLCommon.m │ │ ├── LCGLEffect.h │ │ └── LCGLEffect.m │ ├── GPU │ │ ├── LCGPUInfo.h │ │ ├── LCGPUInfo.m │ │ ├── LCGPUInfoController.h │ │ ├── LCGPUInfoController.m │ │ ├── LCGPUTableView.h │ │ └── LCGPUTableView.m │ ├── LCDevice.h │ ├── LCDevice.m │ ├── LCHardcodedDeviceData.h │ ├── LCHardcodedDeviceData.m │ ├── LCNetworkTraffic.h │ ├── LCNetworkTraffic.m │ ├── LCSystemInfo.h │ ├── LCSystemInfo.m │ ├── LCSystemInfoImport.h │ ├── LCUtils.h │ ├── LCUtils.m │ ├── Memory │ │ ├── LCRAMInfo.h │ │ ├── LCRAMInfo.m │ │ ├── LCRAMInfoController.h │ │ ├── LCRAMInfoController.m │ │ ├── LCRAMTableView.h │ │ ├── LCRAMTableView.m │ │ ├── LCRAMUsage.h │ │ └── LCRAMUsage.m │ ├── Network │ │ ├── LCActiveConnection.h │ │ ├── LCActiveConnection.m │ │ ├── LCConnectionsTableView.h │ │ ├── LCConnectionsTableView.m │ │ ├── LCNetworkBandwidth.h │ │ ├── LCNetworkBandwidth.m │ │ ├── LCNetworkInfo.h │ │ ├── LCNetworkInfo.m │ │ ├── LCNetworkInfoController.h │ │ ├── LCNetworkInfoController.m │ │ ├── LCNetworkTableView.h │ │ ├── LCNetworkTableView.m │ │ └── bsd_var.h │ ├── Process │ │ ├── LCProcessInfo.h │ │ ├── LCProcessInfo.m │ │ ├── LCProcessInfoController.h │ │ ├── LCProcessInfoController.m │ │ ├── LCProgressTableView.h │ │ └── LCProgressTableView.m │ ├── Storage │ │ ├── LCStorageInfo.h │ │ ├── LCStorageInfo.m │ │ ├── LCStorageInfoController.h │ │ ├── LCStorageInfoController.m │ │ ├── LCStorageTableView.h │ │ └── LCStorageTableView.m │ └── UI │ │ ├── LCDeviceSpecificUI.h │ │ └── LCDeviceSpecificUI.m ├── Tools │ ├── LCDebuggerImport.h │ ├── LCGCD.h │ ├── LCGCD.m │ └── LCTools.h ├── ViewsInspector │ ├── LCViewInspector.h │ └── LCViewInspector.m └── WebBackstage │ ├── LCWebBackstageTableView.h │ ├── LCWebBackstageTableView.m │ ├── LCWebServer.h │ ├── LCWebServer.m │ ├── LCWebServerConnection.h │ ├── LCWebServerConnection.m │ ├── handleRequest │ ├── LCHandleDeviceInfoRequest.h │ ├── LCHandleDeviceInfoRequest.m │ ├── LCHandleMoveViewRequest.h │ ├── LCHandleMoveViewRequest.m │ ├── LCHandleRequest.h │ ├── LCHandleViewHighlightRequest.h │ ├── LCHandleViewHighlightRequest.m │ ├── LCHandleViewTreeRequest.h │ └── LCHandleViewTreeRequest.m │ ├── http │ ├── DDData.h │ ├── DDData.m │ ├── DDNumber.h │ ├── DDNumber.m │ ├── DDRange.h │ ├── DDRange.m │ ├── GCDAsyncSocket.h │ ├── GCDAsyncSocket.m │ ├── HTTPAsyncFileResponse.h │ ├── HTTPAsyncFileResponse.m │ ├── HTTPAuthenticationRequest.h │ ├── HTTPAuthenticationRequest.m │ ├── HTTPConnection.h │ ├── HTTPConnection.m │ ├── HTTPDataResponse.h │ ├── HTTPDataResponse.m │ ├── HTTPDynamicFileResponse.h │ ├── HTTPDynamicFileResponse.m │ ├── HTTPFileResponse.h │ ├── HTTPFileResponse.m │ ├── HTTPMessage.h │ ├── HTTPMessage.m │ ├── HTTPRedirectResponse.h │ ├── HTTPRedirectResponse.m │ ├── HTTPResponse.h │ ├── HTTPServer.h │ ├── HTTPServer.m │ ├── WebSocket.h │ └── WebSocket.m │ └── web.bundle │ ├── index.html │ └── tree │ ├── css │ ├── index.css │ └── reset.css │ ├── image │ └── arrow.png │ ├── js │ ├── index.js │ ├── jquery.js │ ├── modjs.js │ ├── page.js │ ├── request.js │ └── tmpl.js │ └── tree.html ├── LCDebuggerDemo ├── LCDebuggerDemo.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── LichengGuo.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── LichengGuo.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── LCDebuggerDemo.xcscheme │ │ └── xcschememanagement.plist ├── LCDebuggerDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── DetailViewController.h │ ├── DetailViewController.m │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── Main.storyboard │ ├── MasterViewController.h │ ├── MasterViewController.m │ └── main.m └── LCDebuggerDemoTests │ ├── Info.plist │ └── LCDebuggerDemoTests.m ├── LICENSE └── README.md /LCDebugger/CMD/LCCMDInput.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCDebuggerImport.h" 34 | 35 | @interface LCCMDInput : UIView 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /LCDebugger/CMD/LCUIKeyBoard.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import 35 | 36 | @interface LCUIKeyBoard : NSObject 37 | 38 | @property (nonatomic,readonly) float animationDuration; 39 | @property (nonatomic,readonly) float height; 40 | @property (nonatomic,readonly) BOOL isShowing; 41 | 42 | - (void)setAccessor:(UIView *)view; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /LCDebugger/Category/MethodSwizzle.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | 34 | void MethodSwizzle(Class aClass, SEL orig_sel, SEL alt_sel); 35 | void MethodSwizzleClass(Class aClass, SEL orig_sel, SEL alt_sel); 36 | -------------------------------------------------------------------------------- /LCDebugger/Category/MethodSwizzle.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "MethodSwizzle.h" 34 | #import 35 | 36 | void MethodSwizzle(Class aClass, SEL orig_sel, SEL alt_sel) 37 | { 38 | Method orig_method = nil, alt_method = nil; 39 | 40 | // First, look for the methods 41 | orig_method = class_getInstanceMethod(aClass, orig_sel); 42 | alt_method = class_getInstanceMethod(aClass, alt_sel); 43 | 44 | // If both are found, swizzle them 45 | if ((orig_method != nil) && (alt_method != nil)) { 46 | method_exchangeImplementations(orig_method, alt_method); 47 | } 48 | } 49 | 50 | void MethodSwizzleClass(Class aClass, SEL orig_sel, SEL alt_sel) 51 | { 52 | Method orig_method = nil, alt_method = nil; 53 | 54 | // First, look for the methods 55 | orig_method = class_getClassMethod(aClass, orig_sel); 56 | alt_method = class_getClassMethod(aClass, alt_sel); 57 | 58 | // If both are found, swizzle them 59 | if ((orig_method != nil) && (alt_method != nil)) { 60 | method_exchangeImplementations(orig_method, alt_method); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /LCDebugger/Category/NSObject+LCFastSingleton.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCCMD.h" 35 | #import "LCTools.h" 36 | 37 | #undef LC_SINGLETON_CUSTOM_METHOD_NAME 38 | #define LC_SINGLETON_CUSTOM_METHOD_NAME LCS // You can custom the method name, for example: your project prefix + S. 39 | 40 | @interface NSObject (LCFastSingleton) 41 | 42 | + (instancetype) LC_SINGLETON_CUSTOM_METHOD_NAME; 43 | + (instancetype) LCSingleton; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /LCDebugger/Category/NSObject+ViewTree.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface NSObject (ViewTree) 36 | 37 | - (NSMutableDictionary *)toDict; 38 | 39 | - (void)fromDict:(NSDictionary *)dict; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /LCDebugger/Category/UIDevice+Reachability.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @protocol ReachabilityWatcher 36 | - (void) reachabilityChanged; 37 | @end 38 | 39 | 40 | @interface UIDevice (Reachability) 41 | + (NSString *) stringFromAddress: (const struct sockaddr *) address; 42 | + (BOOL)addressFromString:(NSString *)IPAddress address:(struct sockaddr_in *)address; 43 | 44 | + (NSString *) hostname; 45 | + (NSString *) getIPAddressForHost: (NSString *) theHost; 46 | + (NSString *) localIPAddress; 47 | + (NSString *) localWiFiIPAddress; 48 | + (NSString *) whatismyipdotcom; 49 | 50 | + (BOOL) hostAvailable: (NSString *) theHost; 51 | + (BOOL) networkAvailable; 52 | + (BOOL) activeWLAN; 53 | + (BOOL) activeWWAN; 54 | + (BOOL) performWiFiCheck; 55 | 56 | + (BOOL) scheduleReachabilityWatcher: (id) watcher; 57 | + (void) unscheduleReachabilityWatcher; 58 | + (BOOL)isJailBreak; 59 | 60 | 61 | @end 62 | 63 | -------------------------------------------------------------------------------- /LCDebugger/Category/UIView+LCExtension.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCTools.h" 35 | 36 | typedef id (^UIViewAddSubviewBlock)( id obj ); 37 | typedef id (^UIViewSizeToFitBlock)(); 38 | 39 | @interface UIView (LCExtension) 40 | 41 | LC_PROPERTY(readonly) UIViewAddSubviewBlock ADD; 42 | LC_PROPERTY(readonly) UIViewSizeToFitBlock FIT; 43 | 44 | + (instancetype)view; 45 | + (instancetype)viewWithFrame:(CGRect)frame; 46 | 47 | - (void) removeAllSubviews; 48 | 49 | - (UIViewController *)viewController; 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /LCDebugger/Category/UIView+LCExtension.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "UIView+LCExtension.h" 34 | #import 35 | 36 | @implementation UIView (LCExtension) 37 | 38 | - (UIViewAddSubviewBlock)ADD 39 | { 40 | UIViewAddSubviewBlock block = ^ id ( UIView * obj ) 41 | { 42 | [self addSubview:obj]; 43 | return self; 44 | }; 45 | 46 | return block; 47 | } 48 | 49 | - (UIViewSizeToFitBlock)FIT 50 | { 51 | UIViewSizeToFitBlock block = ^ id () 52 | { 53 | [self sizeToFit]; 54 | return self; 55 | }; 56 | 57 | return block; 58 | } 59 | 60 | 61 | - (void)removeAllSubviews 62 | { 63 | NSArray * array = [self.subviews copy]; 64 | 65 | for ( UIView * view in array ) 66 | { 67 | [view removeFromSuperview]; 68 | } 69 | } 70 | 71 | + (instancetype)view 72 | { 73 | return [[self alloc] init]; 74 | } 75 | 76 | + (instancetype)viewWithFrame:(CGRect)frame 77 | { 78 | return [[self alloc] initWithFrame:frame]; 79 | } 80 | 81 | - (UIViewController *)viewController 82 | { 83 | UIView * view = self; 84 | 85 | UIResponder * nextResponder = [view nextResponder]; 86 | 87 | if ( nextResponder && [nextResponder isKindOfClass:[UIViewController class]] ) 88 | { 89 | return (UIViewController *)nextResponder; 90 | } 91 | 92 | return nil; 93 | } 94 | 95 | @end 96 | -------------------------------------------------------------------------------- /LCDebugger/Category/UIView+LCGesture.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCTools.h" 35 | 36 | @interface UIView (LCGesture) 37 | 38 | LC_PROPERTY(readonly) UITapGestureRecognizer * tapGesture; 39 | LC_PROPERTY(readonly) UIPanGestureRecognizer * panGesture; 40 | LC_PROPERTY(readonly) UIPinchGestureRecognizer * pinchGesture; 41 | 42 | LC_PROPERTY(readonly) CGPoint panOffset; 43 | LC_PROPERTY(readonly) CGFloat pinchScale; 44 | 45 | 46 | -(UITapGestureRecognizer *) addTapTarget:(id)target selector:(SEL)selector; 47 | -(UIPanGestureRecognizer *) addPanTarget:(id)target selector:(SEL)selector; 48 | -(UIPinchGestureRecognizer *) addPinchTarget:(id)target selector:(SEL)selector; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /LCDebugger/Category/UIView+LCUIViewFrame.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCTools.h" 35 | 36 | @interface UIView (LCUIViewFrame) 37 | 38 | LC_PROPERTY(assign) CGPoint xy; 39 | LC_PROPERTY(assign) CGSize viewSize; 40 | 41 | LC_PROPERTY(assign) CGFloat viewCenterX; 42 | LC_PROPERTY(assign) CGFloat viewCenterY; 43 | LC_PROPERTY(assign) CGFloat viewFrameX; 44 | LC_PROPERTY(assign) CGFloat viewFrameY; 45 | LC_PROPERTY(assign) CGFloat viewFrameWidth; 46 | LC_PROPERTY(assign) CGFloat viewFrameHeight; 47 | 48 | LC_PROPERTY(readonly) CGFloat viewRightX; 49 | LC_PROPERTY(readonly) CGFloat viewBottomY; 50 | 51 | LC_PROPERTY(readonly) CGFloat viewMidX; 52 | LC_PROPERTY(readonly) CGFloat viewMidY; 53 | 54 | LC_PROPERTY(readonly) CGFloat viewMidWidth; 55 | LC_PROPERTY(readonly) CGFloat viewMidHeight; 56 | 57 | -(instancetype) initWithX:(CGFloat)x Y:(CGFloat)y; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /LCDebugger/Category/UIView+Observer.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface UIView (Observer) 36 | 37 | + (BOOL)needsRefresh; 38 | 39 | + (void)setNeedsRefresh:(BOOL)_needsrefresh; 40 | 41 | + (void)startObserving; 42 | 43 | + (void)stopObserving; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /LCDebugger/Category/UIView+Observer.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "UIView+Observer.h" 34 | #import "MethodSwizzle.h" 35 | 36 | static BOOL needsRefresh; 37 | 38 | static BOOL observing; 39 | 40 | @implementation UIView (Observer) 41 | 42 | + (void)startObserving 43 | { 44 | if (observing == NO) { 45 | MethodSwizzle([UIView class], @selector(setNeedsLayout), @selector(setNeedsLayoutSwizzled)); 46 | MethodSwizzle([UIView class], @selector(setNeedsDisplay), @selector(setNeedsDisplaySwizzled)); 47 | MethodSwizzle([UIView class], @selector(setFrame:), @selector(setFrameSwizzled:)); 48 | 49 | observing = YES; 50 | } 51 | } 52 | 53 | + (void)stopObserving 54 | { 55 | if (observing == YES) { 56 | MethodSwizzle([UIView class], @selector(setNeedsLayout), @selector(setNeedsLayoutSwizzled)); 57 | MethodSwizzle([UIView class], @selector(setNeedsDisplay), @selector(setNeedsDisplaySwizzled)); 58 | MethodSwizzle([UIView class], @selector(setFrame:), @selector(setFrameSwizzled:)); 59 | 60 | observing = NO; 61 | } 62 | } 63 | 64 | + (BOOL)needsRefresh 65 | { 66 | return needsRefresh; 67 | } 68 | 69 | + (void)setNeedsRefresh:(BOOL)_needsrefresh 70 | { 71 | needsRefresh = _needsrefresh; 72 | } 73 | 74 | - (void)setNeedsDisplaySwizzled 75 | { 76 | [self setNeedsDisplaySwizzled]; 77 | needsRefresh = YES; 78 | } 79 | 80 | - (void)setNeedsLayoutSwizzled 81 | { 82 | [self setNeedsLayoutSwizzled]; 83 | needsRefresh = YES; 84 | } 85 | 86 | - (void)setFrameSwizzled:(CGRect)frame 87 | { 88 | [self setFrameSwizzled:frame]; 89 | needsRefresh = YES; 90 | } 91 | 92 | @end 93 | -------------------------------------------------------------------------------- /LCDebugger/Category/UIWindow+LCUIWindowHook.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCTools.h" 35 | 36 | @interface UIWindow (LCUIWindowHook) 37 | 38 | + (void)hook; 39 | 40 | @end 41 | 42 | 43 | 44 | 45 | @interface LCWindowHookBorder : UIView 46 | 47 | - (void)startAnimation; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /LCDebugger/Crash/LCCrashReport.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | #if __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | void LCCrashReportHandler( NSException * exception ); 40 | 41 | #if __cplusplus 42 | }; 43 | #endif 44 | 45 | 46 | @interface LCCrashReport : NSObject 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /LCDebugger/Debugger/LCActionSheet.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCTools.h" 35 | 36 | typedef void (^LCActionSheetDismissed) (NSInteger index); 37 | 38 | @interface LCActionSheet : UIView 39 | 40 | LC_PROPERTY(copy) LCActionSheetDismissed dismissedBlock; 41 | LC_PROPERTY(strong) NSMutableArray * titles; 42 | 43 | -(void) addTitle:(NSString *)title; 44 | 45 | -(void) show; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /LCDebugger/Debugger/LCDebuggerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCTools.h" 35 | 36 | typedef void (^LCAssistiveTouchDidSelected) (); 37 | 38 | @interface LCDebuggerView : UIButton 39 | 40 | LC_PROPERTY(copy) LCAssistiveTouchDidSelected didSelected; 41 | LC_PROPERTY(strong) UIColor * color; 42 | 43 | -(void) addLog:(NSString *)log; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /LCDebugger/LCDebugger.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCDebuggerView.h" 34 | #import "LCCrashReport.h" 35 | 36 | // If you want to add a new command, use it. 37 | // #import "LCCMD.h" 38 | 39 | @interface LCDebugger : NSObject 40 | 41 | /** 42 | @class 43 | @brief If you want to do some settings on the debugger view. 44 | */ 45 | @property(nonatomic,strong) LCDebuggerView * debuggerView; 46 | 47 | /** 48 | @class 49 | @brief If you want to close log printf. 50 | */ 51 | @property(nonatomic,assign) BOOL logEnable; 52 | 53 | 54 | /** 55 | @class 56 | @brief When call sharedInstance method, will automatically generate a debugger view on keyWindow. Debugger view integrates all functions. 57 | */ 58 | + (instancetype)sharedInstance; 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /LCDebugger/LCDebugger.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | 34 | #import "LCDebugger.h" 35 | #import "LCWebServer.h" 36 | #import "NSObject+LCFastSingleton.h" 37 | #import "LCLog.h" 38 | 39 | @implementation LCDebugger 40 | 41 | 42 | + (instancetype)sharedInstance 43 | { 44 | static id sharedInstance = nil; 45 | static dispatch_once_t onceToken; 46 | dispatch_once(&onceToken, ^{ 47 | sharedInstance = [[self class] new]; 48 | }); 49 | return sharedInstance; 50 | } 51 | 52 | 53 | -(instancetype) init 54 | { 55 | if (self = [super init]) { 56 | 57 | // Start debugger view. 58 | self.debuggerView = [[LCDebuggerView alloc] init]; 59 | 60 | // Start web server. 61 | [LCWebServer.LCS performSelector:@selector(start) withObject:nil afterDelay:0]; 62 | 63 | } 64 | 65 | return self; 66 | } 67 | 68 | -(void) setLogEnable:(BOOL)logEnable 69 | { 70 | _logEnable = logEnable; 71 | 72 | LCLogEnable = logEnable; 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /LCDebugger/LOGO.txt: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // -------------------------------------------------------------------------------- /LCDebugger/Log/LCLogView.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCCMD.h" 35 | 36 | @interface LCLogView : UIView 37 | 38 | -(void) appendLogString:(NSString *)logString; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/CPU/LCCPUInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCCPUInfo : NSObject 36 | 37 | @property (nonatomic, copy) NSString *cpuName; 38 | @property (nonatomic, assign) NSUInteger activeCPUCount; 39 | @property (nonatomic, assign) NSUInteger physicalCPUCount; 40 | @property (nonatomic, assign) NSUInteger physicalCPUMaxCount; 41 | @property (nonatomic, assign) NSUInteger logicalCPUCount; 42 | @property (nonatomic, assign) NSUInteger logicalCPUMaxCount; 43 | @property (nonatomic, assign) NSUInteger cpuFrequency; 44 | @property (nonatomic, assign) NSUInteger l1DCache; 45 | @property (nonatomic, assign) NSUInteger l1ICache; 46 | @property (nonatomic, assign) NSUInteger l2Cache; 47 | @property (nonatomic, copy) NSString *cpuType; 48 | @property (nonatomic, copy) NSString *cpuSubtype; 49 | @property (nonatomic, copy) NSString *endianess; 50 | @end 51 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/CPU/LCCPUInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCCPUInfo.h" 34 | 35 | @implementation LCCPUInfo 36 | @synthesize cpuName; 37 | @synthesize activeCPUCount; 38 | @synthesize physicalCPUCount; 39 | @synthesize physicalCPUMaxCount; 40 | @synthesize logicalCPUCount; 41 | @synthesize logicalCPUMaxCount; 42 | @synthesize cpuFrequency; 43 | @synthesize l1DCache; 44 | @synthesize l1ICache; 45 | @synthesize l2Cache; 46 | @synthesize cpuType; 47 | @synthesize cpuSubtype; 48 | @synthesize endianess; 49 | @end 50 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/CPU/LCCPUInfoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCCPULoad.h" 35 | #import "LCCPUInfo.h" 36 | 37 | @protocol LCCPUInfoControllerDelegate 38 | - (void)cpuLoadUpdated:(NSArray*)loadArray; 39 | @end 40 | 41 | @interface LCCPUInfoController : NSObject 42 | @property (nonatomic, weak) id delegate; 43 | @property (nonatomic, strong) NSMutableArray *cpuLoadHistory; 44 | 45 | 46 | - (LCCPUInfo*)getCPUInfo; 47 | - (void)startCPULoadUpdatesWithFrequency:(NSUInteger)frequency; 48 | - (void)stopCPULoadUpdates; 49 | - (void)setCPULoadHistorySize:(NSUInteger)size; 50 | @end 51 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/CPU/LCCPULoad.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCCPULoad : NSObject 36 | // Values are in % 37 | @property (nonatomic, assign) double system; 38 | @property (nonatomic, assign) double user; 39 | @property (nonatomic, assign) double nice; 40 | @property (nonatomic, assign) double systemWithoutNice; 41 | @property (nonatomic, assign) double userWithoutNice; 42 | @property (nonatomic, assign) double total; 43 | @end 44 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/CPU/LCCPULoad.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCCPULoad.h" 34 | 35 | @implementation LCCPULoad 36 | @synthesize system; 37 | @synthesize user; 38 | @synthesize nice; 39 | @synthesize systemWithoutNice; 40 | @synthesize userWithoutNice; 41 | @synthesize total; 42 | @end 43 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/CPU/LCCPULoadFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCCPULoad.h" 35 | 36 | @interface LCCPULoadFilter : NSObject 37 | - (LCCPULoad*)filterLoad:(LCCPULoad*)cpuLoad; 38 | @end 39 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/CPU/LCCPUTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCCPUTableView : UITableView 36 | 37 | - (void)show; 38 | - (void)hide; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Device/LCDeviceInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import 35 | 36 | @interface LCDeviceInfo : NSObject 37 | @property (nonatomic, copy) const NSString *deviceName; 38 | @property (nonatomic, copy) NSString *hostName; 39 | @property (nonatomic, copy) NSString *osName; 40 | @property (nonatomic, copy) NSString *osType; 41 | @property (nonatomic, copy) NSString *osVersion; 42 | @property (nonatomic, copy) NSString *osBuild; 43 | @property (nonatomic, assign) NSInteger osRevision; 44 | @property (nonatomic, copy) NSString *kernelInfo; 45 | @property (nonatomic, assign) NSUInteger maxVNodes; 46 | @property (nonatomic, assign) NSUInteger maxProcesses; 47 | @property (nonatomic, assign) NSUInteger maxFiles; 48 | @property (nonatomic, assign) NSUInteger tickFrequency; 49 | @property (nonatomic, assign) NSUInteger numberOfGroups; 50 | @property (nonatomic, assign) time_t bootTime; 51 | @property (nonatomic, assign) BOOL safeBoot; 52 | 53 | @property (nonatomic, copy) NSString *screenResolution; 54 | @property (nonatomic, assign) CGFloat screenSize; 55 | @property (nonatomic, assign) BOOL retina; 56 | @property (nonatomic, assign) BOOL retinaHD; 57 | @property (nonatomic, assign) NSUInteger ppi; 58 | @property (nonatomic, copy) NSString *aspectRatio; 59 | @end 60 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Device/LCDeviceInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCDeviceInfo.h" 34 | 35 | @implementation LCDeviceInfo 36 | @end 37 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Device/LCDeviceInfoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCDeviceInfo.h" 35 | 36 | @interface LCDeviceInfoController : NSObject 37 | 38 | - (LCDeviceInfo*)getDeviceInfo; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Device/LCDeviceTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCDeviceTableView : UITableView 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/GL/GLGraph/LCGLDataLine.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import 35 | 36 | @class LCGLLineGraph; 37 | 38 | @interface LCGLDataLine : NSObject 39 | @property (nonatomic, strong) UIColor *color; 40 | 41 | - (id)initWithColor:(UIColor*)aColor forGraph:(LCGLLineGraph*)aGraph; 42 | - (void)addLineDataValue:(double)value; 43 | - (void)addLineDataArray:(NSArray*)dataArray; 44 | - (void)resetLineData; 45 | - (void)setLineDataLegendText:(NSString*)text; 46 | - (void)setDataLineLegendIcon:(UIImage*)image; 47 | - (void)render; 48 | - (void)renderLegend:(NSUInteger)lineIndex; 49 | - (NSUInteger)maxDataLineElements; 50 | - (void)setDataLineZoom:(GLfloat)zoom; 51 | @end 52 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/GL/GLGraph/LCGLLineGraph.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import 35 | 36 | @interface LCGLLineGraph : GLKViewController 37 | @property (nonatomic, strong) GLKBaseEffect *effect; 38 | /* Graph boundaries determined based on projection and viewport. */ 39 | @property (nonatomic, assign) GLfloat graphBottom; 40 | @property (nonatomic, assign) GLfloat graphTop; 41 | @property (nonatomic, assign) GLfloat graphRight; 42 | @property (nonatomic, assign) GLfloat graphLeft; 43 | 44 | @property (assign, nonatomic) BOOL useClosestMetrics; 45 | 46 | - (id)initWithGLKView:(GLKView*)aGLView 47 | dataLineCount:(NSUInteger)count 48 | fromValue:(double)from 49 | toValue:(double)to 50 | topLegend:(NSString*)aLegend; 51 | 52 | - (void)setDataLineLegendPostfix:(NSString*)postfix; 53 | - (void)setDataLineLegendFraction:(NSUInteger)desiredFraction; 54 | - (void)setDataLineLegendIcon:(UIImage*)image forLineIndex:(NSUInteger)lineIndex; 55 | 56 | - (void)addDataValue:(NSArray*)data; 57 | - (void)setGraphLegend:(NSString*)aLegend; 58 | - (void)setZoomLevel:(GLfloat)value; 59 | - (void)resetDataArray:(NSArray*)dataArray; 60 | - (NSUInteger)requiredElementToFillGraph; 61 | @end 62 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/GL/GLTube/BubbleEffect/LCGLBubbleEffect.fsh: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | uniform sampler2D u_samplers2D[1]; 34 | 35 | varying lowp float v_visible; 36 | varying lowp float v_color; 37 | 38 | void main() 39 | { 40 | lowp vec4 color; 41 | 42 | if (v_visible > 0.5) 43 | { 44 | color = texture2D(u_samplers2D[0], gl_PointCoord); 45 | } 46 | else 47 | { 48 | color = texture2D(u_samplers2D[0], gl_PointCoord); 49 | color.a = 0.0; 50 | } 51 | 52 | gl_FragColor = color; 53 | } -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/GL/GLTube/BubbleEffect/LCGLBubbleEffect.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import 35 | #import "LCGLEffect.h" 36 | 37 | typedef struct { 38 | GLfloat maxLeftPosition; 39 | GLfloat maxRightPosition; 40 | GLfloat maxTopPosition; 41 | GLfloat maxBottomPosition; 42 | } GLBubbleBounds_t; 43 | 44 | @interface LCGLBubbleEffect : LCGLEffect 45 | @property (nonatomic, assign) GLKMatrix4 mvpMatrix; 46 | @property (nonatomic, assign) GLBubbleBounds_t bounds; 47 | @property (nonatomic, assign) GLfloat elapsedSeconds; 48 | 49 | - (id)initWithBounds:(GLBubbleBounds_t)bound; 50 | - (void)spawnBubbleEffect; 51 | - (void)render; 52 | @end 53 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/GL/GLTube/BubbleEffect/LCGLBubbleEffect.vsh: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | attribute vec3 a_position; 34 | attribute vec3 a_velocity; 35 | attribute float a_size; 36 | attribute float a_starttime; 37 | 38 | uniform highp mat4 u_mvpMatrix; 39 | uniform highp float u_elapsedTime; 40 | uniform highp float u_maxRightPosition; 41 | uniform sampler2D u_samplers2D[1]; 42 | 43 | varying lowp float v_visible; 44 | varying lowp float v_color; 45 | 46 | void main() 47 | { 48 | float xPos = (u_elapsedTime - a_starttime) * a_velocity.x; 49 | 50 | vec4 position = vec4(a_position, 1.0); 51 | position.x += xPos; 52 | 53 | if (position.x < u_maxRightPosition) 54 | { 55 | v_visible = 1.0; 56 | } 57 | else 58 | { 59 | v_visible = 0.0; 60 | } 61 | 62 | gl_Position = u_mvpMatrix * position; 63 | 64 | gl_PointSize = a_size; 65 | } -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/GL/GLTube/LCGLTube.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCGLTube : GLKViewController 36 | - (id)initWithGLKView:(GLKView*)aGLView fromValue:(double)from toValue:(double)to; 37 | - (void)setValue:(double)value; 38 | @end 39 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/GL/LCGLCommon.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import 35 | 36 | #if DEBUG 37 | #define GL_CHECK_ERROR() \ 38 | do { \ 39 | GLenum error = glGetError(); \ 40 | if (error != GL_NO_ERROR) \ 41 | { \ 42 | ERROR(@"GL Error: 0x%x", error);\ 43 | } \ 44 | } while (0) 45 | #else 46 | #define GL_CHECK_ERROR() 47 | #endif 48 | 49 | #define kModelZ (-2.0) 50 | 51 | static const GLfloat kFontScaleMultiplierW = 1.0 / 18.0; 52 | static const GLfloat kFontScaleMultiplierH = 1.0 / 36.0; 53 | 54 | typedef struct { 55 | GLKVector3 positionCoords; 56 | GLKVector2 textureCoords; 57 | } VertexData_t; 58 | 59 | @interface LCGLCommon : NSObject 60 | + (EAGLContext*)context; 61 | + (GLKMatrix4)modelMatrixWithPosition:(GLKVector3)position rotation:(GLKVector3)rotation scale:(GLKMatrix4)scale; 62 | + (UIImage*)imageWithText:(NSString*)text font:(UIFont*)font color:(UIColor*)color; 63 | @end 64 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/GL/LCGLEffect.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @protocol LCGLEffectProtected 36 | - (BOOL)compileShader:(GLuint*)shader filename:(NSString*)filename type:(GLenum)type; 37 | - (BOOL)linkProgram:(GLuint)program; 38 | - (BOOL)validateProgram:(GLuint)program; 39 | @end 40 | 41 | @interface LCGLEffect : NSObject 42 | @end 43 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/GPU/LCGPUInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCGPUInfo : NSObject 36 | @property (nonatomic, copy) NSString *gpuName; 37 | @property (nonatomic, copy) NSString *openGLVersion; 38 | @property (nonatomic, copy) NSString *openGLVendor; 39 | @property (nonatomic, copy) NSArray *openGLExtensions; 40 | @end 41 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/GPU/LCGPUInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCGPUInfo.h" 34 | 35 | @implementation LCGPUInfo 36 | @synthesize gpuName; 37 | @synthesize openGLVersion; 38 | @synthesize openGLVendor; 39 | @synthesize openGLExtensions; 40 | @end 41 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/GPU/LCGPUInfoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCGPUInfo.h" 35 | 36 | @interface LCGPUInfoController : NSObject 37 | - (LCGPUInfo*)getGPUInfo; 38 | @end 39 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/GPU/LCGPUTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCGPUTableView : UITableView 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/GPU/LCGPUTableView.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCGPUTableView.h" 34 | 35 | @interface LCGPUTableView () 36 | 37 | @property(nonatomic, strong) NSMutableArray * titles; 38 | @property(nonatomic, strong) NSMutableArray * values; 39 | 40 | @end 41 | 42 | 43 | @implementation LCGPUTableView 44 | 45 | -(instancetype) initWithFrame:(CGRect)frame 46 | { 47 | if (self = [super initWithFrame:frame]) { 48 | 49 | self.separatorStyle = UITableViewCellSeparatorStyleNone; 50 | self.backgroundColor = [UIColor clearColor]; 51 | 52 | } 53 | 54 | return self; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/LCDevice.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCDeviceInfo.h" 35 | #import "LCCPUInfo.h" 36 | #import "LCRAMInfo.h" 37 | #import "LCNetworkInfo.h" 38 | #import "LCStorageInfo.h" 39 | 40 | #define kDefaultDataHistorySize 300 41 | 42 | #define kCpuLoadUpdateFrequency 2 43 | #define kRamUsageUpdateFrequency 1 44 | #define kNetworkUpdateFrequency 1 45 | 46 | @interface LCDevice : NSObject 47 | @property (nonatomic, strong, readonly) LCDeviceInfo *deviceInfo; 48 | @property (nonatomic, strong, readonly) LCCPUInfo *cpuInfo; 49 | @property (nonatomic, copy, readonly) NSArray *processes; 50 | @property (nonatomic, strong, readonly) LCRAMInfo *ramInfo; 51 | @property (nonatomic, strong, readonly) LCNetworkInfo *networkInfo; 52 | @property (nonatomic, strong, readonly) LCStorageInfo *storageInfo; 53 | 54 | - (void)refreshProcesses; 55 | - (void)refreshStorageInfo; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/LCHardcodedDeviceData.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import 35 | 36 | @interface LCHardcodedDeviceData : NSObject 37 | + (LCHardcodedDeviceData*)sharedDeviceData; 38 | - (void)setHwMachine:(NSString*)hwMachine; 39 | 40 | - (const NSString*)getiDeviceName; 41 | - (const NSString*)getCPUName; 42 | - (NSUInteger)getCPUFrequency; 43 | - (const NSString*)getRAMType; 44 | - (NSUInteger)getBatteryCapacity; 45 | - (CGFloat)getBatteryVoltage; 46 | - (CGFloat)getScreenSize; 47 | - (NSUInteger)getPPI; 48 | - (NSString*)getAspectRatio; 49 | @end 50 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/LCNetworkTraffic.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | // Copy from BSNetworkTraffic ( https://github.com/Bogdan-Stasjuk/BSNetworkTraffic ) 36 | struct LCNetworkTrafficValues 37 | { 38 | NSUInteger WiFiSent; 39 | NSUInteger WiFiReceived; 40 | NSUInteger WWANSent; 41 | NSUInteger WWANReceived; 42 | NSUInteger errorCnt; 43 | }; 44 | 45 | 46 | @interface LCNetworkTraffic : NSObject 47 | 48 | @property(nonatomic, assign, readonly) struct LCNetworkTrafficValues *changes; 49 | @property(nonatomic, assign, readonly) struct LCNetworkTrafficValues *counters; 50 | 51 | @property(nonatomic,assign, readonly) NSString * allTraffic; 52 | 53 | - (void)calcChanges; 54 | - (void)resetChanges; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/LCSystemInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import 35 | 36 | @interface LCSystemInfo : NSObject 37 | 38 | + (CGFloat) cpuUsed; 39 | + (NSString *) freeDiskSpace; 40 | 41 | + (uint64_t)getSysCtl64WithSpecifier:(char*)specifier; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/LCSystemInfoImport.h: -------------------------------------------------------------------------------- 1 | // 2 | // LCSystemInfoImport.h 3 | // LCDebuggerDemo 4 | // 5 | // Created by Leer on 15/3/22. 6 | // Copyright (c) 2015年 Licheng Guo . http://nsobject.me/. All rights reserved. 7 | // 8 | 9 | #ifndef LCDebuggerDemo_LCSystemInfoImport_h 10 | #define LCDebuggerDemo_LCSystemInfoImport_h 11 | 12 | #import "LCDeviceTableView.h" 13 | #import "LCProgressTableView.h" 14 | #import "LCRAMTableView.h" 15 | #import "LCNetworkTableView.h" 16 | #import "LCStorageTableView.h" 17 | #import "LCWebBackstageTableView.h" 18 | #import "LCCPUTableView.h" 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/LCUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import 35 | 36 | #define AM_UNUSED(var) (void)(var) 37 | 38 | #define B_TO_KB(a) ((a) / 1024.0) 39 | #define B_TO_MB(a) (B_TO_KB(a) / 1024.0) 40 | #define B_TO_GB(a) (B_TO_MB(a) / 1024.0) 41 | #define B_TO_TB(a) (B_TO_GB(a) / 1024.0) 42 | #define KB_TO_B(a) ((a) * 1024.0) 43 | #define MB_TO_B(a) (KB_TO_B(a) * 1024.0) 44 | #define GB_TO_B(a) (MB_TO_B(a) * 1024.0) 45 | #define TB_TO_B(a) (GB_TO_B(a) * 1024.0) 46 | 47 | @interface LCUtils : NSObject 48 | /* SysCtl */ 49 | + (uint64_t)getSysCtl64WithSpecifier:(char*)specifier; 50 | + (NSString*)getSysCtlChrWithSpecifier:(char*)specifier; 51 | + (void*)getSysCtlPtrWithSpecifier:(char*)specifier pointer:(void*)ptr size:(size_t)size; 52 | + (uint64_t)getSysCtlHw:(uint32_t)hwSpecifier; 53 | 54 | // Returns a value representing a specified percent of the value between max and min. 55 | // i.e. 20 percent in the range of 0-10 is 2. 56 | + (CGFloat)percentageValueFromMax:(CGFloat)max min:(CGFloat)min percent:(CGFloat)percent; 57 | + (CGFloat)valuePercentFrom:(CGFloat)from to:(CGFloat)to value:(CGFloat)value; 58 | 59 | + (CGFloat)random; 60 | 61 | + (NSString*)toNearestMetric:(uint64_t)value desiredFraction:(NSUInteger)fraction; 62 | 63 | + (BOOL)isIPad; 64 | + (BOOL)isIPhone; 65 | + (BOOL)isIPhone5; 66 | 67 | + (BOOL)dateDidTimeout:(NSDate*)date seconds:(double)sec; 68 | 69 | + (void)openReviewAppPage; 70 | @end 71 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Memory/LCRAMInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCRAMInfo : NSObject 36 | @property (nonatomic, assign) uint64_t totalRam; 37 | @property (nonatomic, copy) NSString *ramType; 38 | @end 39 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Memory/LCRAMInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCRAMInfo.h" 34 | 35 | @implementation LCRAMInfo 36 | @synthesize totalRam; 37 | @synthesize ramType; 38 | @end 39 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Memory/LCRAMInfoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCRAMInfo.h" 35 | #import "LCRAMUsage.h" 36 | 37 | @protocol LCRAMInfoControllerDelegate 38 | - (void)ramUsageUpdated:(LCRAMUsage*)usage; 39 | @end 40 | 41 | @interface LCRAMInfoController : NSObject 42 | @property (nonatomic, weak) id delegate; 43 | @property (nonatomic, strong) NSMutableArray *ramUsageHistory; 44 | 45 | - (LCRAMInfo*)getRAMInfo; 46 | - (void)startRAMUsageUpdatesWithFrequency:(NSUInteger)frequency; 47 | - (void)stopRAMUsageUpdates; 48 | - (void)setRAMUsageHistorySize:(NSUInteger)size; 49 | @end 50 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Memory/LCRAMTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCRAMTableView : UITableView 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Memory/LCRAMUsage.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCRAMUsage : NSObject 36 | @property (nonatomic, assign) uint64_t usedRam; 37 | @property (nonatomic, assign) uint64_t activeRam; 38 | @property (nonatomic, assign) uint64_t inactiveRam; 39 | @property (nonatomic, assign) uint64_t wiredRam; 40 | @property (nonatomic, assign) uint64_t freeRam; 41 | @property (nonatomic, assign) uint64_t pageIns; 42 | @property (nonatomic, assign) uint64_t pageOuts; 43 | @property (nonatomic, assign) uint64_t pageFaults; 44 | @end 45 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Memory/LCRAMUsage.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCRAMUsage.h" 34 | 35 | @implementation LCRAMUsage 36 | @synthesize usedRam; 37 | @synthesize activeRam; 38 | @synthesize inactiveRam; 39 | @synthesize wiredRam; 40 | @synthesize freeRam; 41 | @synthesize pageIns; 42 | @synthesize pageOuts; 43 | @synthesize pageFaults; 44 | @end 45 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Network/LCActiveConnection.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCDebuggerImport.h" 34 | #import 35 | 36 | typedef enum { 37 | CONNECTION_STATUS_ESTABLISHED, 38 | CONNECTION_STATUS_CLOSED, 39 | CONNECTION_STATUS_OTHER 40 | } ConnectionStatus_t; 41 | 42 | @interface LCActiveConnection : NSObject 43 | @property (nonatomic, copy) NSString *localIP; 44 | @property (nonatomic, copy) NSString *localPort; 45 | @property (nonatomic, copy) NSString *localPortService; 46 | 47 | @property (nonatomic, copy) NSString *remoteIP; 48 | @property (nonatomic, copy) NSString *remotePort; 49 | @property (nonatomic, copy) NSString *remotePortService; 50 | 51 | @property (nonatomic, assign) ConnectionStatus_t status; 52 | @property (nonatomic, copy) NSString *statusString; 53 | 54 | @property (nonatomic, assign) CGFloat totalTX; 55 | @property (nonatomic, assign) CGFloat totalRX; 56 | @end 57 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Network/LCActiveConnection.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCActiveConnection.h" 34 | 35 | @implementation LCActiveConnection 36 | @synthesize localIP; 37 | @synthesize localPort; 38 | @synthesize localPortService; 39 | 40 | @synthesize remoteIP; 41 | @synthesize remotePort; 42 | @synthesize remotePortService; 43 | 44 | @synthesize status; 45 | @synthesize statusString; 46 | 47 | @synthesize totalTX; 48 | @synthesize totalRX; 49 | @end 50 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Network/LCConnectionsTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCConnectionsTableView : UITableView 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Network/LCConnectionsTableView.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCConnectionsTableView.h" 34 | 35 | @implementation LCConnectionsTableView 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Network/LCNetworkBandwidth.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCNetworkBandwidth : NSObject 36 | @property (nonatomic, copy) NSString *interface; 37 | @property (nonatomic, strong) NSDate *timestamp; 38 | 39 | @property (nonatomic, assign) float sent; 40 | @property (nonatomic, assign) uint64_t totalWiFiSent; 41 | @property (nonatomic, assign) uint64_t totalWWANSent; 42 | @property (nonatomic, assign) float received; 43 | @property (nonatomic, assign) uint64_t totalWiFiReceived; 44 | @property (nonatomic, assign) uint64_t totalWWANReceived; 45 | @end 46 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Network/LCNetworkBandwidth.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCNetworkBandwidth.h" 34 | 35 | @implementation LCNetworkBandwidth 36 | @synthesize interface; 37 | @synthesize timestamp; 38 | 39 | @synthesize sent; 40 | @synthesize totalWiFiSent; 41 | @synthesize totalWWANSent; 42 | @synthesize received; 43 | @synthesize totalWiFiReceived; 44 | @synthesize totalWWANReceived; 45 | @end 46 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Network/LCNetworkInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCNetworkInfo : NSObject 36 | @property (nonatomic, copy) NSString *readableInterface; 37 | @property (nonatomic, copy) NSString *externalIPAddress; 38 | @property (nonatomic, copy) NSString *internalIPAddress; 39 | @property (nonatomic, copy) NSString *netmask; 40 | @property (nonatomic, copy) NSString *broadcastAddress; 41 | @end 42 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Network/LCNetworkInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCNetworkInfo.h" 34 | 35 | @implementation LCNetworkInfo 36 | @synthesize readableInterface; 37 | @synthesize externalIPAddress; 38 | @synthesize internalIPAddress; 39 | @synthesize netmask; 40 | @synthesize broadcastAddress; 41 | @end 42 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Network/LCNetworkInfoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCNetworkBandwidth.h" 35 | #import "LCNetworkInfo.h" 36 | 37 | @protocol LCNetworkInfoControllerDelegate 38 | @optional 39 | - (void)networkBandwidthUpdated:(LCNetworkBandwidth*)bandwidth; 40 | - (void)networkStatusUpdated; 41 | - (void)networkExternalIPAddressUpdated; 42 | - (void)networkMaxBandwidthUpdated; 43 | - (void)networkActiveConnectionsUpdated:(NSArray*)connections; 44 | @end 45 | 46 | @interface LCNetworkInfoController : NSObject 47 | @property (nonatomic, weak) id delegate; 48 | @property (nonatomic, strong) NSMutableArray *networkBandwidthHistory; 49 | 50 | @property (nonatomic, assign) CGFloat currentMaxSentBandwidth; 51 | @property (nonatomic, assign) CGFloat currentMaxReceivedBandwidth; 52 | 53 | - (LCNetworkInfo*)getNetworkInfo; 54 | 55 | - (void)startNetworkBandwidthUpdatesWithFrequency:(NSUInteger)frequency; 56 | - (void)stopNetworkBandwidthUpdates; 57 | - (void)setNetworkBandwidthHistorySize:(NSUInteger)size; 58 | 59 | - (void)updateActiveConnections; 60 | @end 61 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Network/LCNetworkTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCNetworkTableView : UITableView 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Process/LCProcessInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import 35 | #import 36 | 37 | typedef enum { 38 | PROCESS_STATUS_FORKED = SIDL, 39 | PROCESS_STATUS_RUNNABLE = SRUN, 40 | PROCESS_STATUS_SLEEPING = SSLEEP, 41 | PROCESS_STATUS_SUSPENDED = SSTOP, 42 | PROCESS_STATUS_ZOMBIE_STATE = SZOMB 43 | } ProcessStatus_t; 44 | 45 | @interface LCProcessInfo : NSObject 46 | @property (nonatomic, copy) NSString *name; 47 | @property (nonatomic, assign) NSInteger pid; 48 | @property (nonatomic, assign) NSInteger priority; 49 | @property (nonatomic, assign) ProcessStatus_t status; 50 | @property (nonatomic, assign) time_t startTime; 51 | @property (nonatomic, copy) NSString *commandLine; 52 | @property (nonatomic, strong) UIImage *icon; 53 | 54 | - (NSString*)getStatusString; 55 | @end 56 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Process/LCProcessInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCProcessInfo.h" 34 | 35 | @implementation LCProcessInfo 36 | @synthesize name; 37 | @synthesize pid; 38 | @synthesize priority; 39 | @synthesize status; 40 | @synthesize startTime; 41 | @synthesize commandLine; 42 | @synthesize icon; 43 | 44 | - (NSString*)getStatusString 45 | { 46 | switch (self.status) { 47 | case PROCESS_STATUS_FORKED: return @"Forked"; break; 48 | case PROCESS_STATUS_RUNNABLE: return @"Runnable"; break; 49 | case PROCESS_STATUS_SLEEPING: return @"Sleeping"; break; 50 | case PROCESS_STATUS_SUSPENDED: return @"Suspended"; break; 51 | case PROCESS_STATUS_ZOMBIE_STATE: return @"Zombie"; break; 52 | default: return @"Unknown"; break; 53 | } 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Process/LCProcessInfoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCProcessInfoController : NSObject 36 | - (NSArray*)getProcesses; 37 | @end 38 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Process/LCProgressTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCProgressTableView : UITableView 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Storage/LCStorageInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCStorageInfo : NSObject 36 | 37 | @property (nonatomic, assign) uint64_t totalSapce; 38 | @property (nonatomic, assign) uint64_t usedSpace; 39 | @property (nonatomic, assign) uint64_t freeSpace; 40 | 41 | @property (nonatomic, assign) NSUInteger songCount; 42 | @property (nonatomic, assign) NSUInteger pictureCount; 43 | @property (nonatomic, assign) NSUInteger videoCount; 44 | 45 | @property (nonatomic, assign) uint64_t totalSongSize; 46 | @property (nonatomic, assign) uint64_t totalPictureSize; 47 | @property (nonatomic, assign) uint64_t totalVideoSize; 48 | @end 49 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Storage/LCStorageInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCStorageInfo.h" 34 | 35 | @implementation LCStorageInfo 36 | @synthesize totalSapce; 37 | @synthesize usedSpace; 38 | @synthesize freeSpace; 39 | 40 | @synthesize songCount; 41 | @synthesize pictureCount; 42 | @synthesize videoCount; 43 | 44 | @synthesize totalSongSize; 45 | @synthesize totalPictureSize; 46 | @synthesize totalVideoSize; 47 | @end 48 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Storage/LCStorageInfoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCStorageInfo.h" 35 | 36 | @protocol LCStorageInfoControllerDelegate 37 | - (void)storageInfoUpdated; 38 | @end 39 | 40 | @interface LCStorageInfoController : NSObject 41 | @property (nonatomic, weak) id delegate; 42 | 43 | - (LCStorageInfo*)getStorageInfo; 44 | @end 45 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/Storage/LCStorageTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCStorageTableView : UITableView 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /LCDebugger/SystemInfo/UI/LCDeviceSpecificUI.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import 35 | #import 36 | 37 | @interface LCDeviceSpecificUI : NSObject 38 | 39 | @property (nonatomic, assign) CGFloat pickViewY; 40 | 41 | @property (nonatomic, assign) GLfloat GLdataLineGraphWidth; 42 | @property (nonatomic, assign) GLfloat GLdataLineWidth; 43 | 44 | @property (nonatomic, assign) GLfloat GLtubeTextureSheetW; 45 | @property (nonatomic, assign) GLfloat GLtubeTextureSheetH; 46 | @property (nonatomic, assign) GLfloat GLtubeTextureY; 47 | @property (nonatomic, assign) GLfloat GLtubeTextureH; 48 | @property (nonatomic, assign) GLfloat GLtubeTextureLeftX; 49 | @property (nonatomic, assign) GLfloat GLtubeTextureLeftW; 50 | @property (nonatomic, assign) GLfloat GLtubeTextureRightX; 51 | @property (nonatomic, assign) GLfloat GLtubeTextureRightW; 52 | @property (nonatomic, assign) GLfloat GLtubeTextureLiquidX; 53 | @property (nonatomic, assign) GLfloat GLtubeTextureLiquidW; 54 | @property (nonatomic, assign) GLfloat GLtubeTextureLiquidTopX; 55 | @property (nonatomic, assign) GLfloat GLtubeTextureLiquidTopW; 56 | @property (nonatomic, assign) GLfloat GLtubeTextureGlassX; 57 | @property (nonatomic, assign) GLfloat GLtubeTextureGlassW; 58 | @property (nonatomic, assign) GLfloat GLtubeGlowH; 59 | @property (nonatomic, assign) GLfloat GLtubeLiquidTopGlowL; 60 | @property (nonatomic, assign) CGRect GLtubeGLKViewFrame; 61 | 62 | @end -------------------------------------------------------------------------------- /LCDebugger/Tools/LCDebuggerImport.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import 35 | #import 36 | 37 | #import "LCLog.h" 38 | #import "LCTools.h" 39 | 40 | #import "UIView+LCExtension.h" 41 | #import "UIView+LCGesture.h" 42 | #import "UIView+LCUIViewFrame.h" 43 | 44 | #import "NSObject+LCFastSingleton.h" 45 | -------------------------------------------------------------------------------- /LCDebugger/Tools/LCGCD.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | typedef enum _LC_GCD_PRIORITY{ 36 | 37 | LC_GCD_PRIORITY_HIGH = DISPATCH_QUEUE_PRIORITY_HIGH, 38 | LC_GCD_PRIORITY_DEFAULT = DISPATCH_QUEUE_PRIORITY_DEFAULT, 39 | LC_GCD_PRIORITY_LOW = DISPATCH_QUEUE_PRIORITY_LOW, 40 | LC_GCD_PRIORITY_BACKGROUND = DISPATCH_QUEUE_PRIORITY_BACKGROUND, 41 | 42 | }LC_GCD_PRIORITY; 43 | 44 | typedef void (^LCGCDBlock)(); 45 | 46 | @interface LCGCD : NSObject 47 | 48 | +(void) dispatchAsync:(LC_GCD_PRIORITY)priority block:(LCGCDBlock)block; 49 | 50 | +(void) dispatchAsyncInMainQueue:(LCGCDBlock)block; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /LCDebugger/Tools/LCGCD.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCGCD.h" 34 | 35 | @implementation LCGCD 36 | 37 | +(void) dispatchAsync:(LC_GCD_PRIORITY)priority block:(LCGCDBlock)block 38 | { 39 | dispatch_async(dispatch_get_global_queue(priority, 0), block); 40 | } 41 | 42 | +(void) dispatchAsyncInMainQueue:(LCGCDBlock)block 43 | { 44 | if(![NSThread isMainThread]){ 45 | 46 | dispatch_async(dispatch_get_main_queue(),block); 47 | } 48 | else{ 49 | 50 | block(); 51 | } 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /LCDebugger/ViewsInspector/LCViewInspector.h: -------------------------------------------------------------------------------- 1 | // 2 | // LC_ViewInspector.h 3 | // LCFramework 4 | 5 | // Created by Licheng Guo . ( SUGGESTIONS & BUG titm@tom.com ) on 13-10-9. 6 | // Copyright (c) 2014年 Licheng Guo iOS developer ( http://nsobject.me ).All rights reserved. 7 | // Also see the copyright page ( http://nsobject.me/copyright.rtf ). 8 | // 9 | // 10 | 11 | #import 12 | 13 | // Copy from BeeFramework ( https://github.com/gavinkwoe/BeeFramework ) 14 | @interface LCViewInspector : UIView 15 | 16 | - (void)prepareShow:(UIView *)inView; 17 | - (void)prepareHide; 18 | 19 | - (void)show; 20 | - (void)hide; 21 | 22 | @end 23 | 24 | @interface LCInspectorLayer : UIImageView 25 | 26 | @property (nonatomic, assign) CGFloat depth; 27 | @property (nonatomic, assign) CGRect rect; 28 | @property (nonatomic, strong) UIView * view; 29 | @property (nonatomic, strong) UILabel * label; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/LCWebBackstageTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCWebBackstageTableView : UITableView 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/LCWebServer.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @interface LCWebServer : NSObject 36 | 37 | @property(nonatomic,assign) BOOL isRunning; 38 | @property(nonatomic,assign) NSInteger port; 39 | 40 | - (void) start; 41 | - (void) stop; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/LCWebServerConnection.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "HTTPConnection.h" 34 | 35 | @interface LCWebServerConnection : HTTPConnection 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/handleRequest/LCHandleDeviceInfoRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCHandleRequest.h" 35 | 36 | @interface LCHandleDeviceInfoRequest : NSObject 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/handleRequest/LCHandleDeviceInfoRequest.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCHandleDeviceInfoRequest.h" 34 | #import 35 | #import "UIDevice+Reachability.h" 36 | 37 | @implementation LCHandleDeviceInfoRequest 38 | 39 | -(NSDictionary *) handleRequestPath:(NSString *)path 40 | { 41 | NSString * username = [NSString stringWithFormat:@"%@'s %@",[UIDevice currentDevice].name,[UIDevice currentDevice].model]; 42 | 43 | if ([username rangeOfString:@"Simulator"].length) { 44 | username = [UIDevice currentDevice].name; 45 | } 46 | 47 | return @{ 48 | @"userName":username, 49 | @"phoneInfo":[NSString stringWithFormat:@"%@ %@",[UIDevice currentDevice].systemVersion,[UIDevice currentDevice].systemName], 50 | @"isEscape":@([UIDevice isJailBreak]) 51 | }; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/handleRequest/LCHandleMoveViewRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCHandleRequest.h" 35 | 36 | @interface LCHandleMoveViewRequest : NSObject 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/handleRequest/LCHandleRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | 35 | @protocol LCHandleRequestProtocol 36 | 37 | -(NSDictionary *) handleRequestPath:(NSString *)path; 38 | 39 | @end 40 | 41 | #import "LCHandleDeviceInfoRequest.h" 42 | #import "LCHandleMoveViewRequest.h" 43 | #import "LCHandleViewHighlightRequest.h" 44 | #import "LCHandleViewTreeRequest.h" 45 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/handleRequest/LCHandleViewHighlightRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCHandleRequest.h" 35 | 36 | @interface LCHandleViewHighlightRequest : NSObject 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/handleRequest/LCHandleViewTreeRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import 34 | #import "LCHandleRequest.h" 35 | 36 | @interface LCHandleViewTreeRequest : NSObject 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/handleRequest/LCHandleViewTreeRequest.m: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // _| _|_|_| 4 | // _| _| 5 | // _| _| 6 | // _| _| 7 | // _|_|_|_| _|_|_| 8 | // 9 | // 10 | // Copyright (c) 2014-2015, Licheng Guo. ( http://nsobject.me ) 11 | // http://github.com/titman 12 | // 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a 15 | // copy of this software and associated documentation files (the "Software"), 16 | // to deal in the Software without restriction, including without limitation 17 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 18 | // and/or sell copies of the Software, and to permit persons to whom the 19 | // Software is furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | // 32 | 33 | #import "LCHandleViewTreeRequest.h" 34 | #import "UIView+Observer.h" 35 | #import "NSObject+ViewTree.h" 36 | 37 | 38 | @interface LCHandleViewTreeRequest () 39 | 40 | @property(nonatomic,assign) BOOL firstLoad; 41 | @property(nonatomic,assign) double lastUpdate; 42 | 43 | @end 44 | 45 | @implementation LCHandleViewTreeRequest 46 | 47 | -(instancetype) init 48 | { 49 | if (self = [super init]) { 50 | 51 | 52 | } 53 | 54 | return self; 55 | } 56 | 57 | -(NSDictionary *) handleRequestPath:(NSString *)path 58 | { 59 | NSString * param = [path componentsSeparatedByString:@"?"].lastObject; 60 | 61 | NSTimeInterval timeStamp = [[[param componentsSeparatedByString:@"="] lastObject] doubleValue]; 62 | 63 | if ([UIView needsRefresh] == NO && self.lastUpdate <= timeStamp) 64 | { 65 | return @{ 66 | @"code":@(304) 67 | }; 68 | 69 | }else{ 70 | 71 | [UIView setNeedsRefresh:NO]; 72 | 73 | timeStamp = [[NSDate date] timeIntervalSince1970]; 74 | 75 | self.lastUpdate = timeStamp; 76 | 77 | return @{ 78 | @"code": @(200), 79 | @"lastUpdate": [NSString stringWithFormat:@"%@",@(timeStamp)], 80 | @"content": [[UIApplication sharedApplication] toDict] 81 | }; 82 | } 83 | 84 | return nil; 85 | } 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/http/DDData.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface NSData (DDData) 4 | 5 | - (NSData *)md5Digest; 6 | 7 | - (NSData *)sha1Digest; 8 | 9 | - (NSString *)hexStringValue; 10 | 11 | - (NSString *)base64Encoded; 12 | - (NSData *)base64Decoded; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/http/DDNumber.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface NSNumber (DDNumber) 5 | 6 | + (BOOL)parseString:(NSString *)str intoSInt64:(SInt64 *)pNum; 7 | + (BOOL)parseString:(NSString *)str intoUInt64:(UInt64 *)pNum; 8 | 9 | + (BOOL)parseString:(NSString *)str intoNSInteger:(NSInteger *)pNum; 10 | + (BOOL)parseString:(NSString *)str intoNSUInteger:(NSUInteger *)pNum; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/http/DDNumber.m: -------------------------------------------------------------------------------- 1 | #import "DDNumber.h" 2 | 3 | 4 | @implementation NSNumber (DDNumber) 5 | 6 | + (BOOL)parseString:(NSString *)str intoSInt64:(SInt64 *)pNum 7 | { 8 | if(str == nil) 9 | { 10 | *pNum = 0; 11 | return NO; 12 | } 13 | 14 | errno = 0; 15 | 16 | // On both 32-bit and 64-bit machines, long long = 64 bit 17 | 18 | *pNum = strtoll([str UTF8String], NULL, 10); 19 | 20 | if(errno != 0) 21 | return NO; 22 | else 23 | return YES; 24 | } 25 | 26 | + (BOOL)parseString:(NSString *)str intoUInt64:(UInt64 *)pNum 27 | { 28 | if(str == nil) 29 | { 30 | *pNum = 0; 31 | return NO; 32 | } 33 | 34 | errno = 0; 35 | 36 | // On both 32-bit and 64-bit machines, unsigned long long = 64 bit 37 | 38 | *pNum = strtoull([str UTF8String], NULL, 10); 39 | 40 | if(errno != 0) 41 | return NO; 42 | else 43 | return YES; 44 | } 45 | 46 | + (BOOL)parseString:(NSString *)str intoNSInteger:(NSInteger *)pNum 47 | { 48 | if(str == nil) 49 | { 50 | *pNum = 0; 51 | return NO; 52 | } 53 | 54 | errno = 0; 55 | 56 | // On LP64, NSInteger = long = 64 bit 57 | // Otherwise, NSInteger = int = long = 32 bit 58 | 59 | *pNum = strtol([str UTF8String], NULL, 10); 60 | 61 | if(errno != 0) 62 | return NO; 63 | else 64 | return YES; 65 | } 66 | 67 | + (BOOL)parseString:(NSString *)str intoNSUInteger:(NSUInteger *)pNum 68 | { 69 | if(str == nil) 70 | { 71 | *pNum = 0; 72 | return NO; 73 | } 74 | 75 | errno = 0; 76 | 77 | // On LP64, NSUInteger = unsigned long = 64 bit 78 | // Otherwise, NSUInteger = unsigned int = unsigned long = 32 bit 79 | 80 | *pNum = strtoul([str UTF8String], NULL, 10); 81 | 82 | if(errno != 0) 83 | return NO; 84 | else 85 | return YES; 86 | } 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/http/DDRange.h: -------------------------------------------------------------------------------- 1 | /** 2 | * DDRange is the functional equivalent of a 64 bit NSRange. 3 | * The HTTP Server is designed to support very large files. 4 | * On 32 bit architectures (ppc, i386) NSRange uses unsigned 32 bit integers. 5 | * This only supports a range of up to 4 gigabytes. 6 | * By defining our own variant, we can support a range up to 16 exabytes. 7 | * 8 | * All effort is given such that DDRange functions EXACTLY the same as NSRange. 9 | **/ 10 | 11 | #import 12 | #import 13 | 14 | @class NSString; 15 | 16 | typedef struct _DDRange { 17 | UInt64 location; 18 | UInt64 length; 19 | } DDRange; 20 | 21 | typedef DDRange *DDRangePointer; 22 | 23 | NS_INLINE DDRange DDMakeRange(UInt64 loc, UInt64 len) { 24 | DDRange r; 25 | r.location = loc; 26 | r.length = len; 27 | return r; 28 | } 29 | 30 | NS_INLINE UInt64 DDMaxRange(DDRange range) { 31 | return (range.location + range.length); 32 | } 33 | 34 | NS_INLINE BOOL DDLocationInRange(UInt64 loc, DDRange range) { 35 | return (loc - range.location < range.length); 36 | } 37 | 38 | NS_INLINE BOOL DDEqualRanges(DDRange range1, DDRange range2) { 39 | return ((range1.location == range2.location) && (range1.length == range2.length)); 40 | } 41 | 42 | FOUNDATION_EXPORT DDRange DDUnionRange(DDRange range1, DDRange range2); 43 | FOUNDATION_EXPORT DDRange DDIntersectionRange(DDRange range1, DDRange range2); 44 | FOUNDATION_EXPORT NSString *DDStringFromRange(DDRange range); 45 | FOUNDATION_EXPORT DDRange DDRangeFromString(NSString *aString); 46 | 47 | NSInteger DDRangeCompare(DDRangePointer pDDRange1, DDRangePointer pDDRange2); 48 | 49 | @interface NSValue (NSValueDDRangeExtensions) 50 | 51 | + (NSValue *)valueWithDDRange:(DDRange)range; 52 | - (DDRange)ddrangeValue; 53 | 54 | - (NSInteger)ddrangeCompare:(NSValue *)ddrangeValue; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/http/DDRange.m: -------------------------------------------------------------------------------- 1 | #import "DDRange.h" 2 | #import "DDNumber.h" 3 | 4 | DDRange DDUnionRange(DDRange range1, DDRange range2) 5 | { 6 | DDRange result; 7 | 8 | result.location = MIN(range1.location, range2.location); 9 | result.length = MAX(DDMaxRange(range1), DDMaxRange(range2)) - result.location; 10 | 11 | return result; 12 | } 13 | 14 | DDRange DDIntersectionRange(DDRange range1, DDRange range2) 15 | { 16 | DDRange result; 17 | 18 | if((DDMaxRange(range1) < range2.location) || (DDMaxRange(range2) < range1.location)) 19 | { 20 | return DDMakeRange(0, 0); 21 | } 22 | 23 | result.location = MAX(range1.location, range2.location); 24 | result.length = MIN(DDMaxRange(range1), DDMaxRange(range2)) - result.location; 25 | 26 | return result; 27 | } 28 | 29 | NSString *DDStringFromRange(DDRange range) 30 | { 31 | return [NSString stringWithFormat:@"{%qu, %qu}", range.location, range.length]; 32 | } 33 | 34 | DDRange DDRangeFromString(NSString *aString) 35 | { 36 | DDRange result = DDMakeRange(0, 0); 37 | 38 | // NSRange will ignore '-' characters, but not '+' characters 39 | NSCharacterSet *cset = [NSCharacterSet characterSetWithCharactersInString:@"+0123456789"]; 40 | 41 | NSScanner *scanner = [NSScanner scannerWithString:aString]; 42 | [scanner setCharactersToBeSkipped:[cset invertedSet]]; 43 | 44 | NSString *str1 = nil; 45 | NSString *str2 = nil; 46 | 47 | BOOL found1 = [scanner scanCharactersFromSet:cset intoString:&str1]; 48 | BOOL found2 = [scanner scanCharactersFromSet:cset intoString:&str2]; 49 | 50 | if(found1) [NSNumber parseString:str1 intoUInt64:&result.location]; 51 | if(found2) [NSNumber parseString:str2 intoUInt64:&result.length]; 52 | 53 | return result; 54 | } 55 | 56 | NSInteger DDRangeCompare(DDRangePointer pDDRange1, DDRangePointer pDDRange2) 57 | { 58 | // Comparison basis: 59 | // Which range would you encouter first if you started at zero, and began walking towards infinity. 60 | // If you encouter both ranges at the same time, which range would end first. 61 | 62 | if(pDDRange1->location < pDDRange2->location) 63 | { 64 | return NSOrderedAscending; 65 | } 66 | if(pDDRange1->location > pDDRange2->location) 67 | { 68 | return NSOrderedDescending; 69 | } 70 | if(pDDRange1->length < pDDRange2->length) 71 | { 72 | return NSOrderedAscending; 73 | } 74 | if(pDDRange1->length > pDDRange2->length) 75 | { 76 | return NSOrderedDescending; 77 | } 78 | 79 | return NSOrderedSame; 80 | } 81 | 82 | @implementation NSValue (NSValueDDRangeExtensions) 83 | 84 | + (NSValue *)valueWithDDRange:(DDRange)range 85 | { 86 | return [NSValue valueWithBytes:&range objCType:@encode(DDRange)]; 87 | } 88 | 89 | - (DDRange)ddrangeValue 90 | { 91 | DDRange result; 92 | [self getValue:&result]; 93 | return result; 94 | } 95 | 96 | - (NSInteger)ddrangeCompare:(NSValue *)other 97 | { 98 | DDRange r1 = [self ddrangeValue]; 99 | DDRange r2 = [other ddrangeValue]; 100 | 101 | return DDRangeCompare(&r1, &r2); 102 | } 103 | 104 | @end 105 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/http/HTTPAsyncFileResponse.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "HTTPResponse.h" 3 | 4 | @class HTTPConnection; 5 | 6 | /** 7 | * This is an asynchronous version of HTTPFileResponse. 8 | * It reads data from the given file asynchronously via GCD. 9 | * 10 | * It may be overriden to allow custom post-processing of the data that has been read from the file. 11 | * An example of this is the HTTPDynamicFileResponse class. 12 | **/ 13 | 14 | @interface HTTPAsyncFileResponse : NSObject 15 | { 16 | HTTPConnection *connection; 17 | 18 | NSString *filePath; 19 | UInt64 fileLength; 20 | UInt64 fileOffset; // File offset as pertains to data given to connection 21 | UInt64 readOffset; // File offset as pertains to data read from file (but maybe not returned to connection) 22 | 23 | BOOL aborted; 24 | 25 | NSData *data; 26 | 27 | int fileFD; 28 | void *readBuffer; 29 | NSUInteger readBufferSize; // Malloced size of readBuffer 30 | NSUInteger readBufferOffset; // Offset within readBuffer where the end of existing data is 31 | NSUInteger readRequestLength; 32 | dispatch_queue_t readQueue; 33 | dispatch_source_t readSource; 34 | BOOL readSourceSuspended; 35 | } 36 | 37 | - (id)initWithFilePath:(NSString *)filePath forConnection:(HTTPConnection *)connection; 38 | - (NSString *)filePath; 39 | 40 | @end 41 | 42 | /** 43 | * Explanation of Variables (excluding those that are obvious) 44 | * 45 | * fileOffset 46 | * This is the number of bytes that have been returned to the connection via the readDataOfLength method. 47 | * If 1KB of data has been read from the file, but none of that data has yet been returned to the connection, 48 | * then the fileOffset variable remains at zero. 49 | * This variable is used in the calculation of the isDone method. 50 | * Only after all data has been returned to the connection are we actually done. 51 | * 52 | * readOffset 53 | * Represents the offset of the file descriptor. 54 | * In other words, the file position indidcator for our read stream. 55 | * It might be easy to think of it as the total number of bytes that have been read from the file. 56 | * However, this isn't entirely accurate, as the setOffset: method may have caused us to 57 | * jump ahead in the file (lseek). 58 | * 59 | * readBuffer 60 | * Malloc'd buffer to hold data read from the file. 61 | * 62 | * readBufferSize 63 | * Total allocation size of malloc'd buffer. 64 | * 65 | * readBufferOffset 66 | * Represents the position in the readBuffer where we should store new bytes. 67 | * 68 | * readRequestLength 69 | * The total number of bytes that were requested from the connection. 70 | * It's OK if we return a lesser number of bytes to the connection. 71 | * It's NOT OK if we return a greater number of bytes to the connection. 72 | * Doing so would disrupt proper support for range requests. 73 | * If, however, the response is chunked then we don't need to worry about this. 74 | * Chunked responses inheritly don't support range requests. 75 | **/ -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/http/HTTPAuthenticationRequest.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #if TARGET_OS_IPHONE 4 | // Note: You may need to add the CFNetwork Framework to your project 5 | #import 6 | #endif 7 | 8 | @class HTTPMessage; 9 | 10 | 11 | @interface HTTPAuthenticationRequest : NSObject 12 | { 13 | BOOL isBasic; 14 | BOOL isDigest; 15 | 16 | NSString *base64Credentials; 17 | 18 | NSString *username; 19 | NSString *realm; 20 | NSString *nonce; 21 | NSString *uri; 22 | NSString *qop; 23 | NSString *nc; 24 | NSString *cnonce; 25 | NSString *response; 26 | } 27 | - (id)initWithRequest:(HTTPMessage *)request; 28 | 29 | - (BOOL)isBasic; 30 | - (BOOL)isDigest; 31 | 32 | // Basic 33 | - (NSString *)base64Credentials; 34 | 35 | // Digest 36 | - (NSString *)username; 37 | - (NSString *)realm; 38 | - (NSString *)nonce; 39 | - (NSString *)uri; 40 | - (NSString *)qop; 41 | - (NSString *)nc; 42 | - (NSString *)cnonce; 43 | - (NSString *)response; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/http/HTTPDataResponse.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "HTTPResponse.h" 3 | 4 | 5 | @interface HTTPDataResponse : NSObject 6 | { 7 | NSUInteger offset; 8 | NSData *data; 9 | } 10 | 11 | - (id)initWithData:(NSData *)data; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/http/HTTPDataResponse.m: -------------------------------------------------------------------------------- 1 | #import "HTTPDataResponse.h" 2 | #import "LCLog.h" 3 | 4 | #if ! __has_feature(objc_arc) 5 | #warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). 6 | #endif 7 | 8 | @implementation HTTPDataResponse 9 | 10 | - (id)initWithData:(NSData *)dataParam 11 | { 12 | if((self = [super init])) 13 | { 14 | offset = 0; 15 | data = dataParam; 16 | } 17 | return self; 18 | } 19 | 20 | - (void)dealloc 21 | { 22 | 23 | } 24 | 25 | - (UInt64)contentLength 26 | { 27 | UInt64 result = (UInt64)[data length]; 28 | 29 | return result; 30 | } 31 | 32 | - (UInt64)offset 33 | { 34 | return offset; 35 | } 36 | 37 | - (void)setOffset:(UInt64)offsetParam 38 | { 39 | offset = (NSUInteger)offsetParam; 40 | } 41 | 42 | - (NSData *)readDataOfLength:(NSUInteger)lengthParameter 43 | { 44 | NSUInteger remaining = [data length] - offset; 45 | NSUInteger length = lengthParameter < remaining ? lengthParameter : remaining; 46 | 47 | void *bytes = (void *)([data bytes] + offset); 48 | 49 | offset += length; 50 | 51 | return [NSData dataWithBytesNoCopy:bytes length:length freeWhenDone:NO]; 52 | } 53 | 54 | - (BOOL)isDone 55 | { 56 | BOOL result = (offset == [data length]); 57 | 58 | return result; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/http/HTTPDynamicFileResponse.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "HTTPResponse.h" 3 | #import "HTTPAsyncFileResponse.h" 4 | 5 | /** 6 | * This class is designed to assist with dynamic content. 7 | * Imagine you have a file that you want to make dynamic: 8 | * 9 | * 10 | * 11 | *

ComputerName Control Panel

12 | * ... 13 | *
  • System Time: SysTime
  • 14 | * 15 | * 16 | * 17 | * Now you could generate the entire file in Objective-C, 18 | * but this would be a horribly tedious process. 19 | * Beside, you want to design the file with professional tools to make it look pretty. 20 | * 21 | * So all you have to do is escape your dynamic content like this: 22 | * 23 | * ... 24 | *

    %%ComputerName%% Control Panel

    25 | * ... 26 | *
  • System Time: %%SysTime%%
  • 27 | * 28 | * And then you create an instance of this class with: 29 | * 30 | * - separator = @"%%" 31 | * - replacementDictionary = { "ComputerName"="Black MacBook", "SysTime"="2010-04-30 03:18:24" } 32 | * 33 | * This class will then perform the replacements for you, on the fly, as it reads the file data. 34 | * This class is also asynchronous, so it will perform the file IO using its own GCD queue. 35 | * 36 | * All keys for the replacementDictionary must be NSString's. 37 | * Values for the replacementDictionary may be NSString's, or any object that 38 | * returns what you want when its description method is invoked. 39 | **/ 40 | 41 | @interface HTTPDynamicFileResponse : HTTPAsyncFileResponse 42 | { 43 | NSData *separator; 44 | NSDictionary *replacementDict; 45 | } 46 | 47 | - (id)initWithFilePath:(NSString *)filePath 48 | forConnection:(HTTPConnection *)connection 49 | separator:(NSString *)separatorStr 50 | replacementDictionary:(NSDictionary *)dictionary; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/http/HTTPFileResponse.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "HTTPResponse.h" 3 | 4 | @class HTTPConnection; 5 | 6 | 7 | @interface HTTPFileResponse : NSObject 8 | { 9 | HTTPConnection *connection; 10 | 11 | NSString *filePath; 12 | UInt64 fileLength; 13 | UInt64 fileOffset; 14 | 15 | BOOL aborted; 16 | 17 | int fileFD; 18 | void *buffer; 19 | NSUInteger bufferSize; 20 | } 21 | 22 | - (id)initWithFilePath:(NSString *)filePath forConnection:(HTTPConnection *)connection; 23 | - (NSString *)filePath; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/http/HTTPMessage.h: -------------------------------------------------------------------------------- 1 | /** 2 | * The HTTPMessage class is a simple Objective-C wrapper around Apple's CFHTTPMessage class. 3 | **/ 4 | 5 | #import 6 | 7 | #if TARGET_OS_IPHONE 8 | // Note: You may need to add the CFNetwork Framework to your project 9 | #import 10 | #endif 11 | 12 | #define HTTPVersion1_0 ((NSString *)kCFHTTPVersion1_0) 13 | #define HTTPVersion1_1 ((NSString *)kCFHTTPVersion1_1) 14 | 15 | 16 | @interface HTTPMessage : NSObject 17 | { 18 | CFHTTPMessageRef message; 19 | } 20 | 21 | - (id)initEmptyRequest; 22 | 23 | - (id)initRequestWithMethod:(NSString *)method URL:(NSURL *)url version:(NSString *)version; 24 | 25 | - (id)initResponseWithStatusCode:(NSInteger)code description:(NSString *)description version:(NSString *)version; 26 | 27 | - (BOOL)appendData:(NSData *)data; 28 | 29 | - (BOOL)isHeaderComplete; 30 | 31 | - (NSString *)version; 32 | 33 | - (NSString *)method; 34 | - (NSURL *)url; 35 | 36 | - (NSInteger)statusCode; 37 | 38 | - (NSDictionary *)allHeaderFields; 39 | - (NSString *)headerField:(NSString *)headerField; 40 | 41 | - (void)setHeaderField:(NSString *)headerField value:(NSString *)headerFieldValue; 42 | 43 | - (NSData *)messageData; 44 | 45 | - (NSData *)body; 46 | - (void)setBody:(NSData *)body; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/http/HTTPMessage.m: -------------------------------------------------------------------------------- 1 | #import "HTTPMessage.h" 2 | 3 | #if ! __has_feature(objc_arc) 4 | #warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). 5 | #endif 6 | 7 | 8 | @implementation HTTPMessage 9 | 10 | - (id)initEmptyRequest 11 | { 12 | if ((self = [super init])) 13 | { 14 | message = CFHTTPMessageCreateEmpty(NULL, YES); 15 | } 16 | return self; 17 | } 18 | 19 | - (id)initRequestWithMethod:(NSString *)method URL:(NSURL *)url version:(NSString *)version 20 | { 21 | if ((self = [super init])) 22 | { 23 | message = CFHTTPMessageCreateRequest(NULL, 24 | (__bridge CFStringRef)method, 25 | (__bridge CFURLRef)url, 26 | (__bridge CFStringRef)version); 27 | } 28 | return self; 29 | } 30 | 31 | - (id)initResponseWithStatusCode:(NSInteger)code description:(NSString *)description version:(NSString *)version 32 | { 33 | if ((self = [super init])) 34 | { 35 | message = CFHTTPMessageCreateResponse(NULL, 36 | (CFIndex)code, 37 | (__bridge CFStringRef)description, 38 | (__bridge CFStringRef)version); 39 | } 40 | return self; 41 | } 42 | 43 | - (void)dealloc 44 | { 45 | if (message) 46 | { 47 | CFRelease(message); 48 | } 49 | } 50 | 51 | - (BOOL)appendData:(NSData *)data 52 | { 53 | return CFHTTPMessageAppendBytes(message, [data bytes], [data length]); 54 | } 55 | 56 | - (BOOL)isHeaderComplete 57 | { 58 | return CFHTTPMessageIsHeaderComplete(message); 59 | } 60 | 61 | - (NSString *)version 62 | { 63 | return (__bridge_transfer NSString *)CFHTTPMessageCopyVersion(message); 64 | } 65 | 66 | - (NSString *)method 67 | { 68 | return (__bridge_transfer NSString *)CFHTTPMessageCopyRequestMethod(message); 69 | } 70 | 71 | - (NSURL *)url 72 | { 73 | return (__bridge_transfer NSURL *)CFHTTPMessageCopyRequestURL(message); 74 | } 75 | 76 | - (NSInteger)statusCode 77 | { 78 | return (NSInteger)CFHTTPMessageGetResponseStatusCode(message); 79 | } 80 | 81 | - (NSDictionary *)allHeaderFields 82 | { 83 | return (__bridge_transfer NSDictionary *)CFHTTPMessageCopyAllHeaderFields(message); 84 | } 85 | 86 | - (NSString *)headerField:(NSString *)headerField 87 | { 88 | return (__bridge_transfer NSString *)CFHTTPMessageCopyHeaderFieldValue(message, (__bridge CFStringRef)headerField); 89 | } 90 | 91 | - (void)setHeaderField:(NSString *)headerField value:(NSString *)headerFieldValue 92 | { 93 | CFHTTPMessageSetHeaderFieldValue(message, 94 | (__bridge CFStringRef)headerField, 95 | (__bridge CFStringRef)headerFieldValue); 96 | } 97 | 98 | - (NSData *)messageData 99 | { 100 | return (__bridge_transfer NSData *)CFHTTPMessageCopySerializedMessage(message); 101 | } 102 | 103 | - (NSData *)body 104 | { 105 | return (__bridge_transfer NSData *)CFHTTPMessageCopyBody(message); 106 | } 107 | 108 | - (void)setBody:(NSData *)body 109 | { 110 | CFHTTPMessageSetBody(message, (__bridge CFDataRef)body); 111 | } 112 | 113 | @end 114 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/http/HTTPRedirectResponse.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "HTTPResponse.h" 3 | 4 | 5 | @interface HTTPRedirectResponse : NSObject 6 | { 7 | NSString *redirectPath; 8 | } 9 | 10 | - (id)initWithPath:(NSString *)redirectPath; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/http/HTTPRedirectResponse.m: -------------------------------------------------------------------------------- 1 | #import "HTTPRedirectResponse.h" 2 | #import "LCLog.h" 3 | 4 | #if ! __has_feature(objc_arc) 5 | #warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). 6 | #endif 7 | 8 | @implementation HTTPRedirectResponse 9 | 10 | - (id)initWithPath:(NSString *)path 11 | { 12 | if ((self = [super init])) 13 | { 14 | redirectPath = [path copy]; 15 | } 16 | return self; 17 | } 18 | 19 | - (UInt64)contentLength 20 | { 21 | return 0; 22 | } 23 | 24 | - (UInt64)offset 25 | { 26 | return 0; 27 | } 28 | 29 | - (void)setOffset:(UInt64)offset 30 | { 31 | // Nothing to do 32 | } 33 | 34 | - (NSData *)readDataOfLength:(NSUInteger)length 35 | { 36 | return nil; 37 | } 38 | 39 | - (BOOL)isDone 40 | { 41 | return YES; 42 | } 43 | 44 | - (NSDictionary *)httpHeaders 45 | { 46 | return [NSDictionary dictionaryWithObject:redirectPath forKey:@"Location"]; 47 | } 48 | 49 | - (NSInteger)status 50 | { 51 | return 302; 52 | } 53 | 54 | - (void)dealloc 55 | { 56 | 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/http/WebSocket.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class HTTPMessage; 4 | @class GCDAsyncSocket; 5 | 6 | 7 | #define WebSocketDidDieNotification @"WebSocketDidDie" 8 | 9 | @interface WebSocket : NSObject 10 | { 11 | dispatch_queue_t websocketQueue; 12 | 13 | HTTPMessage *request; 14 | GCDAsyncSocket *asyncSocket; 15 | 16 | NSData *term; 17 | 18 | BOOL isStarted; 19 | BOOL isOpen; 20 | BOOL isVersion76; 21 | 22 | id __unsafe_unretained delegate; 23 | } 24 | 25 | + (BOOL)isWebSocketRequest:(HTTPMessage *)request; 26 | 27 | - (id)initWithRequest:(HTTPMessage *)request socket:(GCDAsyncSocket *)socket; 28 | 29 | /** 30 | * Delegate option. 31 | * 32 | * In most cases it will be easier to subclass WebSocket, 33 | * but some circumstances may lead one to prefer standard delegate callbacks instead. 34 | **/ 35 | @property (/* atomic */ unsafe_unretained) id delegate; 36 | 37 | /** 38 | * The WebSocket class is thread-safe, generally via it's GCD queue. 39 | * All public API methods are thread-safe, 40 | * and the subclass API methods are thread-safe as they are all invoked on the same GCD queue. 41 | **/ 42 | @property (nonatomic, readonly) dispatch_queue_t websocketQueue; 43 | 44 | /** 45 | * Public API 46 | * 47 | * These methods are automatically called by the HTTPServer. 48 | * You may invoke the stop method yourself to close the WebSocket manually. 49 | **/ 50 | - (void)start; 51 | - (void)stop; 52 | 53 | /** 54 | * Public API 55 | * 56 | * Sends a message over the WebSocket. 57 | * This method is thread-safe. 58 | **/ 59 | - (void)sendMessage:(NSString *)msg; 60 | 61 | /** 62 | * Subclass API 63 | * 64 | * These methods are designed to be overriden by subclasses. 65 | **/ 66 | - (void)didOpen; 67 | - (void)didReceiveMessage:(NSString *)msg; 68 | - (void)didClose; 69 | 70 | @end 71 | 72 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 73 | #pragma mark - 74 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 75 | 76 | /** 77 | * There are two ways to create your own custom WebSocket: 78 | * 79 | * - Subclass it and override the methods you're interested in. 80 | * - Use traditional delegate paradigm along with your own custom class. 81 | * 82 | * They both exist to allow for maximum flexibility. 83 | * In most cases it will be easier to subclass WebSocket. 84 | * However some circumstances may lead one to prefer standard delegate callbacks instead. 85 | * One such example, you're already subclassing another class, so subclassing WebSocket isn't an option. 86 | **/ 87 | 88 | @protocol WebSocketDelegate 89 | @optional 90 | 91 | - (void)webSocketDidOpen:(WebSocket *)ws; 92 | 93 | - (void)webSocket:(WebSocket *)ws didReceiveMessage:(NSString *)msg; 94 | 95 | - (void)webSocketDidClose:(WebSocket *)ws; 96 | 97 | @end -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/web.bundle/tree/css/index.css: -------------------------------------------------------------------------------- 1 | html,body{margin:0;padding:0;height:100%;font-family: Menlo, monospace;} 2 | 3 | h1{font-size:20px;background-color:#333;color:#fff;padding-left:5px;height:25px;} 4 | article{background-color:#fff;line-height: 20px;overflow-y:scroll;height:auto;position:absolute;top:25px;left:0px;right:0px;bottom: 0} 5 | 6 | 7 | #viewtree{width:100%;height:100%;font-size:12px;color:#444;position: relative;} 8 | #viewtree h1{font-size:20px;background-color:#6a60ea;color:#fff;padding-left:5px;} 9 | #viewtree article{} 10 | 11 | #viewtree li.viewnode{list-style-type:none;position: relative;margin-left:5px;} 12 | #viewtree li.viewnode:hover{background-color:#e9f1fb;} 13 | 14 | #viewtree li.viewnode a.viewinfo, 15 | #viewtree li.viewnode a.viewinfo:focus{margin-left:12px;text-decoration: none;color:#8c1d7e;} 16 | #viewtree li.viewnode a.viewinfo span.h1{color: #8c1d7e} 17 | #viewtree li.viewnode a.viewinfo span.h2{color: #9e4500} 18 | #viewtree li.viewnode a.viewinfo span.h3{color: #0229b7} 19 | #viewtree li.viewnode.selected{background-color:#6a60ea;color: #fff;} 20 | #viewtree li.viewnode.selected a.viewinfo, 21 | #viewtree li.viewnode.selected a.viewinfo span{color: #fff;} 22 | 23 | #viewtree ol{padding-left:20px;list-style-type:none;display:none} 24 | 25 | a.arrow{ 26 | background-image: url(http://imgcache.qq.com/vipstyle/global/img/bg_toolbar.png); 27 | background-repeat: no-repeat; 28 | overflow: hidden; 29 | position: absolute; 30 | top:2px; 31 | width: 12px; 32 | height: 12px; 33 | background-position: -153px -23px; 34 | transform: translate(0,0) rotate(-90deg); 35 | -webkit-transform: translate(0,0) rotate(-90deg); 36 | } 37 | 38 | #viewtree li.expanded a.arrow{-webkit-transform: translate(0,0) rotate(0deg);top: 4px;} 39 | #viewtree li.expanded+ol{display: block;} 40 | 41 | #console{width:100%;height:50%;font-size:12px;color:#333;position: relative;} 42 | #console h1{} 43 | #console article{left:200px;top:0;overflow-y:scroll} 44 | #console div.cell {width:100%;height:20px;line-height:20px;border-bottom:1px #ccc solid;color:#333;} 45 | #console div.cell span{margin-left:5px;} 46 | #console div.cell span.time{color:#aaa;} 47 | 48 | #console .container{position:absolute;top:25px;bottom:0;width:100%;} 49 | #systeminfo{float:left;width:200px;background-color:#eee;height:100%;} 50 | #systeminfo header{height:20px;line-height: 20px;background-color: #ccc} 51 | #systeminfo h2{font-size:16px;width:80px;float:left} 52 | #systeminfo span.currentvalue{width:80px;float:right;text-align:right;margin-right:10px;} 53 | #systeminfo div.timeline{width:200px;height:50%;margin-top:-20px;position:relative;} 54 | #systeminfo div.timeline div.momentblock{background-color:#aaa;width:18px;height:50px;position:absolute;bottom: 0;} 55 | 56 | -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/web.bundle/tree/css/reset.css: -------------------------------------------------------------------------------- 1 | html{color:#000;background:#FFF;-webkit-text-size-adjust:none;-webkit-user-select:none;} 2 | body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0} 3 | table{border-collapse:collapse;border-spacing:0} 4 | fieldset,img{border:0} 5 | address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal} 6 | ol,ul{list-style:none} 7 | caption,th{text-align:left} 8 | h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal} 9 | q:before,q:after{content:''} 10 | abbr,acronym{border:0;font-variant:normal} 11 | sup{vertical-align:text-top} 12 | sub{vertical-align:text-bottom} 13 | input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit} 14 | input,textarea,select{*font-size:100%} 15 | legend{color:#000} 16 | #yui3-css-stamp.cssreset{display:none} 17 | 18 | /* 19 | * This section is for webapp 20 | */ 21 | 22 | html,body{ 23 | -webkit-text-size-adjust:none; 24 | -webkit-user-select:none; 25 | -webkit-tap-highlight-color:rgba(0,0,0,0); 26 | -webkit-touch-callout:none; 27 | word-break:break-word; 28 | font-family:"Arial"; 29 | } 30 | 31 | /* 使用translate3D时加下面2个属性可缓解页面跳动问题 */ 32 | body>*{ 33 | -webkit-backface-visibility:hidden; 34 | -webkit-transform:translate3d(0,0,0) rotate(0) scale(1); 35 | } -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/web.bundle/tree/image/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/titman/LCDebugger/a6b46cae449a8b1a3445e79a516a632cc25728c3/LCDebugger/WebBackstage/web.bundle/tree/image/arrow.png -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/web.bundle/tree/js/modjs.js: -------------------------------------------------------------------------------- 1 | /* modjs v2.0 2 | * 1.加入loader功能,开发者无需手动添加script标签 3 | * 2.根路径在config中设置 4 | */ 5 | ;(function(window){ 6 | var module = {}, loadList = {}; 7 | var define = function(id,dependencies,exports){ 8 | if(typeof(id)==="function") return use(id);//如果前面两个都省略,则通过use转换成define(id,exports) 9 | if(id.push) return use(id,dependencies);//如果第一个是数组,则通过use转换成define(id,dependencies,exports) 10 | if(!exports){//如果只有两个参数,且第一个不是数组,则第一个为id,第二个为export,重置一下 11 | exports = dependencies; 12 | dependencies = []; 13 | }else if(typeof(dependencies) === "string"){//看看第二个参数是否字符串,若是,则转换一下 14 | dependencies = [dependencies]; 15 | } 16 | module[id] = {id:id,dependencies:dependencies,exports:null,factory:exports,isexcuted:false}; 17 | debug(id+ " is initialized."); 18 | for(var i = 0;i)[^\t]*)'/g, "$1\r") 24 | .replace(/\t=(.*?)%>/g, "',$1,'") 25 | .split("\t").join("');") 26 | .split("%>").join("p.push('") 27 | .split("\r").join("\\'") 28 | + "');}return p.join('');"); 29 | 30 | // Provide some basic currying to the user 31 | return data ? fn( data ) : fn; 32 | }; 33 | })(); -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/web.bundle/tree/js/request.js: -------------------------------------------------------------------------------- 1 | define("request","jquery",function(require,exports,module){ 2 | 3 | var taskList = {}; 4 | 5 | var startReuqest = function(url){ 6 | 7 | if (taskList[url].length > 0) { 8 | 9 | var info = taskList[url][0]; 10 | 11 | $.get(info.url,info.params,info.cb) 12 | .always(function(){ 13 | 14 | taskList[url] = taskList[url].slice(1); 15 | startReuqest(url); 16 | 17 | }); 18 | }; 19 | 20 | }; 21 | 22 | module.exports = function(url,params,cb){ 23 | 24 | if (!taskList[url]) { 25 | taskList[url] = []; 26 | }; 27 | 28 | taskList[url].push({url:url,params:params,cb:cb}); 29 | 30 | if (taskList[url].length == 1) { 31 | 32 | startReuqest(url); 33 | }; 34 | }; 35 | 36 | }); -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/web.bundle/tree/js/tmpl.js: -------------------------------------------------------------------------------- 1 | define("tmpl",function(require,exports,module){ 2 | var cache = {}; 3 | 4 | module.exports = function tmpl(str, data){ 5 | // Figure out if we're getting a template, or if we need to 6 | // load the template - and be sure to cache the result. 7 | var fn = !/\W/.test(str) ? 8 | cache[str] = cache[str] || 9 | tmpl(document.getElementById(str).innerHTML) : 10 | 11 | // Generate a reusable function that will serve as a template 12 | // generator (and which will be cached). 13 | new Function("obj", 14 | "var p=[],print=function(){p.push.apply(p,arguments);};" + 15 | 16 | // Introduce the data as local variables using with(){} 17 | "with(obj){p.push('" + 18 | 19 | // Convert the template into pure JavaScript 20 | str 21 | .replace(/[\r\t\n]/g, " ") 22 | .split("<%").join("\t") 23 | .replace(/((^|%>)[^\t]*)'/g, "$1\r") 24 | .replace(/\t=(.*?)%>/g, "',$1,'") 25 | .split("\t").join("');") 26 | .split("%>").join("p.push('") 27 | .split("\r").join("\\'") 28 | + "');}return p.join('');"); 29 | 30 | // Provide some basic currying to the user 31 | return data ? fn( data ) : fn; 32 | }; 33 | }); -------------------------------------------------------------------------------- /LCDebugger/WebBackstage/web.bundle/tree/tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | View Tree ( Click to highlight view, or double click to change frame of view ) 6 | 7 | 8 | 9 | 10 | 14 | 15 | 16 | 17 |
    18 |

    View Tree ( Click to highlight view, or double click to change frame of view )

    19 |
    20 |
    21 | 22 | 23 | -------------------------------------------------------------------------------- /LCDebuggerDemo/LCDebuggerDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LCDebuggerDemo/LCDebuggerDemo.xcodeproj/project.xcworkspace/xcuserdata/LichengGuo.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/titman/LCDebugger/a6b46cae449a8b1a3445e79a516a632cc25728c3/LCDebuggerDemo/LCDebuggerDemo.xcodeproj/project.xcworkspace/xcuserdata/LichengGuo.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /LCDebuggerDemo/LCDebuggerDemo.xcodeproj/xcuserdata/LichengGuo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /LCDebuggerDemo/LCDebuggerDemo.xcodeproj/xcuserdata/LichengGuo.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | LCDebuggerDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | BFBFBD0F1AAF0BB400854A11 16 | 17 | primary 18 | 19 | 20 | BFBFBD281AAF0BB400854A11 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /LCDebuggerDemo/LCDebuggerDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // LCDebuggerDemo 4 | // 5 | // Created by Licheng Guo . http://nsobject.me/ on 15/3/10. 6 | // Copyright (c) 2015年 Licheng Guo . http://nsobject.me/. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "LCDebugger.h" 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (strong, nonatomic) UIWindow *window; 15 | 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /LCDebuggerDemo/LCDebuggerDemo/DetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.h 3 | // test 4 | // 5 | // Created by Licheng Guo . http://nsobject.me/ on 15/3/20. 6 | // Copyright (c) 2015年 Licheng Guo . http://nsobject.me/. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DetailViewController : UIViewController 12 | 13 | @property (strong, nonatomic) id detailItem; 14 | @property (weak, nonatomic) IBOutlet UILabel *detailDescriptionLabel; 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /LCDebuggerDemo/LCDebuggerDemo/DetailViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.m 3 | // test 4 | // 5 | // Created by Licheng Guo . http://nsobject.me/ on 15/3/20. 6 | // Copyright (c) 2015年 Licheng Guo . http://nsobject.me/. All rights reserved. 7 | // 8 | 9 | #import "DetailViewController.h" 10 | 11 | @interface DetailViewController () 12 | 13 | @end 14 | 15 | @implementation DetailViewController 16 | 17 | #pragma mark - Managing the detail item 18 | 19 | - (void)setDetailItem:(id)newDetailItem { 20 | if (_detailItem != newDetailItem) { 21 | _detailItem = newDetailItem; 22 | 23 | // Update the view. 24 | [self configureView]; 25 | } 26 | } 27 | 28 | - (void)configureView { 29 | // Update the user interface for the detail item. 30 | if (self.detailItem) { 31 | self.detailDescriptionLabel.text = [self.detailItem description]; 32 | } 33 | } 34 | 35 | - (void)viewDidLoad { 36 | [super viewDidLoad]; 37 | // Do any additional setup after loading the view, typically from a nib. 38 | [self configureView]; 39 | } 40 | 41 | - (void)didReceiveMemoryWarning { 42 | [super didReceiveMemoryWarning]; 43 | // Dispose of any resources that can be recreated. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /LCDebuggerDemo/LCDebuggerDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /LCDebuggerDemo/LCDebuggerDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.lc.c.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /LCDebuggerDemo/LCDebuggerDemo/MasterViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MasterViewController.h 3 | // test 4 | // 5 | // Created by Licheng Guo . http://nsobject.me/ on 15/3/20. 6 | // Copyright (c) 2015年 Licheng Guo . http://nsobject.me/. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MasterViewController : UITableViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /LCDebuggerDemo/LCDebuggerDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LCDebuggerDemo 4 | // 5 | // Created by Licheng Guo . http://nsobject.me/ on 15/3/10. 6 | // Copyright (c) 2015年 Licheng Guo . http://nsobject.me/. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /LCDebuggerDemo/LCDebuggerDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.lc.c.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /LCDebuggerDemo/LCDebuggerDemoTests/LCDebuggerDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // LCDebuggerDemoTests.m 3 | // LCDebuggerDemoTests 4 | // 5 | // Created by Licheng Guo . http://nsobject.me/ on 15/3/10. 6 | // Copyright (c) 2015年 Licheng Guo . http://nsobject.me/. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface LCDebuggerDemoTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation LCDebuggerDemoTests 17 | 18 | - (void)setUp { 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 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 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 all 13 | 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 THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## LCDebugger 2 | LCDebugger is a local/remote debugging tools. LCDebugger has a set of useful commands, and enables you to simply use it like using terminal. (Without needing you to jailbreak) 3 | 4 | ## What LCDebugger Does 5 | - Real-time remote preview screen of device . 6 | - Remote control device. 7 | - Remote browser view tree and change frame to one of views. 8 | - Command(CMD) module. 9 | - 3d view tree. 10 | - Crash report. 11 | - Various system information. 12 | 13 | ## How LCDebugger Works 14 | LCDebugger build a local web server for remote debugging, and use CMD module to interact. 15 | 16 | ## The Scenario 17 | Remote debugging, and more helpful for testers. 18 | 19 | ## Getting Started 20 | 1. Download the source code. 21 | 2. Drag and drop /LCDebugger folder into your project. 22 | 3. Build and run it! 23 | 24 | ## Preview 25 | ### Real-time remote preview screen of device 26 | ![image](https://github.com/titman/Pictures-of-the-warehouse/blob/master/remotepreview.gif?raw=false) 27 | 28 | ### Remote preview view tree and change it! 29 | ![image](https://github.com/titman/Pictures-of-the-warehouse/blob/master/viewtree.gif?raw=false) 30 | 31 | ### Remote perform some commands 32 | ![image](https://github.com/titman/Pictures-of-the-warehouse/blob/master/remotecontrol.gif?raw=false) 33 | 34 | ### 3d view tree 35 | wait... 36 | 37 | ## Version History 38 | - 1.0 39 | 40 | ## Thanks 41 | #### [Gavinkwoe/BeeFramework](https://github.com/gavinkwoe/BeeFramework) 42 | #### [rockanita](https://github.com/rockanita) 43 | #### [vinqon/Realtime-Debug-Portal](https://github.com/vinqon/Realtime-Debug-Portal) 44 | 45 | ## License 46 | 47 | --------------------------------------------------------------------------------