-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
HDB-Li
committed
Sep 19, 2018
1 parent
70f331c
commit 3017cec
Showing
263 changed files
with
394 additions
and
486 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// | ||
// LLRoute.h | ||
// | ||
// Copyright (c) 2018 LLDebugTool Software Foundation (https://github.com/HDB-Li/LLDebugTool) | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "LLConfig.h" | ||
|
||
// Event | ||
FOUNDATION_EXPORT NSString * _Nonnull const kLLDebugToolEvent; | ||
FOUNDATION_EXPORT NSString * _Nonnull const kLLFailedLoadingResourceEvent; | ||
|
||
// Define | ||
FOUNDATION_EXPORT NSString * _Nonnull const kLLUseBetaAlertPrompt; | ||
FOUNDATION_EXPORT NSString * _Nonnull const kLLOpenIssueInGithubPrompt; | ||
|
||
static NSString *const kLLNetworkVCName = @"LLNetworkVC"; | ||
static NSString *const kLLLogVCName = @"LLLogVC"; | ||
static NSString *const kLLNetworkModelName = @"LLNetworkModel"; | ||
static NSString *const kLLLogModelName = @"LLLogModel"; | ||
|
||
@interface LLRoute : NSObject | ||
|
||
#pragma mark - DebugTool Route | ||
/** | ||
If LLDebugTool exists, set new availables to LLDebugTool, otherwise nothing will be done. | ||
*/ | ||
+ (void)setNewAvailables:(LLConfigAvailableFeature)availables; | ||
|
||
/** | ||
If LLDebugTool exists, LLDebugTool's window called showWindow method, otherwise nothing will be done. | ||
*/ | ||
+ (void)showWindow; | ||
|
||
/** | ||
If LLDebugTool exists, LLDebugTool's window called hideWindow method, otherwise nothing will be done. | ||
*/ | ||
+ (void)hideWindow; | ||
|
||
#pragma mark - Log Route | ||
/** | ||
If LLLogHelper exists, LLLogHelper is called, otherwise NSLog is called. | ||
*/ | ||
+ (void)logWithMessage:(NSString *_Nonnull)message event:(NSString *_Nullable)event; | ||
|
||
#pragma mark - App Route | ||
/** | ||
If LLAppHelper exists, LLAppHelper is called, otherwise nothing will be done. | ||
*/ | ||
+ (void)updateRequestDataTraffic:(unsigned long long)requestDataTraffic responseDataTraffic:(unsigned long long)responseDataTraffic; | ||
|
||
/** | ||
If LLAppHelper exists, LLAppHelper is called, otherwise nothing will be done. | ||
*/ | ||
+ (NSMutableArray <NSArray <NSDictionary <NSString *,NSString *>*>*>*_Nonnull)appInfos; | ||
|
||
/** | ||
If LLAppHelper exists, LLAppHelper is called, otherwise nothing will be done. | ||
*/ | ||
+ (NSDictionary <NSString *, NSString *>*_Nonnull)dynamicAppInfos; | ||
|
||
#pragma mark - Base | ||
+ (UIViewController *_Nullable)viewControllerWithName:(NSString *_Nonnull)name params:(NSDictionary <NSString *,id>*)params; | ||
|
||
@end |
146 changes: 146 additions & 0 deletions
146
LLDebugTool/Components/General/Function/Route/LLRoute.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
// | ||
// LLRoute.m | ||
// | ||
// Copyright (c) 2018 LLDebugTool Software Foundation (https://github.com/HDB-Li/LLDebugTool) | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
#import "LLRoute.h" | ||
#import "LLBaseViewController.h" | ||
|
||
#ifndef INSTALLED_LLDEBUGTOOL | ||
#define INSTALLED_LLDEBUGTOOL (__has_include("LLDebugTool.h") || __has_include("<LLDebugTool/LLDebugTool.h>")) | ||
#endif | ||
|
||
#ifndef LL_HAS_INCLUDE_LOG_HELPER | ||
#define LL_HAS_INCLUDE_LOG_HELPER (__has_include("LLLogHelper.h") || __has_include("<LLDebugTool/LLLogHelper.h>")) | ||
#endif | ||
|
||
#ifndef LL_HAS_INCLUDE_APP_HELPER | ||
#define LL_HAS_INCLUDE_APP_HELPER (__has_include("LLAppHelper.h") || __has_include("<LLDebugTool/LLAppHelper.h>")) | ||
#endif | ||
|
||
#if __has_include("LLDebugTool.h") | ||
#import "LLDebugTool.h" | ||
#import "LLNetworkHelper.h" | ||
#import "LLLogHelper.h" | ||
#import "LLCrashHelper.h" | ||
#import "LLAppHelper.h" | ||
#import "LLScreenshotHelper.h" | ||
#import "LLWindow.h" | ||
#elif __has_include("<LLDebugTool/LLDebugTool.h>") | ||
#import "<LLDebugTool/LLDebugTool.h>" | ||
#import "<LLDebugTool/LLNetworkHelper.h>" | ||
#import "<LLDebugTool/LLLogHelper.h>" | ||
#import "<LLDebugTool/LLCrashHelper.h>" | ||
#import "<LLDebugTool/LLAppHelper.h>" | ||
#import "<LLDebugTool/LLScreenshotHelper.h>" | ||
#import "<LLDebugTool/LLWindow.h>" | ||
#endif | ||
|
||
#if __has_include("LLLogHelper.h") | ||
#import "LLLogHelper.h" | ||
#elif __has_include("<LLDebugTool/LLLogHelper.h>") | ||
#import "<LLDebugTool/LLLogHelper.h>" | ||
#endif | ||
|
||
#if __has_include("LLAppHelper.h") | ||
#import "LLAppHelper.h" | ||
#elif __has_include("<LLDebugTool/LLAppHelper.h>") | ||
#import "<LLDebugTool/LLAppHelper.h>" | ||
#endif | ||
|
||
// Event | ||
NSString * const kLLDebugToolEvent = @"LLDebugTool"; | ||
NSString * const kLLFailedLoadingResourceEvent = @"Resource Failed"; | ||
|
||
// Define | ||
NSString * const kLLUseBetaAlertPrompt = @"You are using a Beta version, please use release version."; | ||
NSString * const kLLOpenIssueInGithubPrompt = @" Open an issue in \"https://github.com/HDB-Li/LLDebugTool\" if you need to get more help."; | ||
|
||
@implementation LLRoute | ||
|
||
+ (void)logWithMessage:(NSString *_Nonnull)message event:(NSString *_Nullable)event { | ||
#if LL_HAS_INCLUDE_LOG_HELPER | ||
LLog_Alert_Event(event, message); | ||
#else | ||
NSLog(@"%@" , message); | ||
#endif | ||
} | ||
|
||
+ (void)setNewAvailables:(LLConfigAvailableFeature)availables { | ||
#if INSTALLED_LLDEBUGTOOL | ||
if ([LLDebugTool sharedTool].isWorking) { | ||
[[LLNetworkHelper sharedHelper] setEnable:networkEnable]; | ||
[[LLLogHelper sharedHelper] setEnable:logEnable]; | ||
[[LLCrashHelper sharedHelper] setEnable:crashEnable]; | ||
[[LLAppHelper sharedHelper] setEnable:appInfoEnable]; | ||
[[LLScreenshotHelper sharedHelper] setEnable:screenshotEnable]; | ||
} | ||
#endif | ||
} | ||
|
||
+ (void)showWindow { | ||
#if INSTALLED_LLDEBUGTOOL | ||
[[LLDebugTool sharedTool].window showWindow]; | ||
#endif | ||
} | ||
|
||
+ (void)hideWindow { | ||
#if INSTALLED_LLDEBUGTOOL | ||
[[LLDebugTool sharedTool].window hideWindow]; | ||
#endif | ||
} | ||
|
||
+ (void)updateRequestDataTraffic:(unsigned long long)requestDataTraffic responseDataTraffic:(unsigned long long)responseDataTraffic { | ||
#if LL_HAS_INCLUDE_APP_HELPER | ||
[[LLAppHelper sharedHelper] updateRequestDataTraffic:requestDataTraffic responseDataTraffic:responseDataTraffic]; | ||
#endif | ||
} | ||
|
||
+ (NSMutableArray <NSArray <NSDictionary <NSString *,NSString *>*>*>*_Nonnull)appInfos { | ||
#if LL_HAS_INCLUDE_APP_HELPER | ||
return [[LLAppHelper sharedHelper] appInfos]; | ||
#endif | ||
return nil; | ||
} | ||
|
||
+ (NSDictionary <NSString *, NSString *>*_Nonnull)dynamicAppInfos { | ||
#if LL_HAS_INCLUDE_APP_HELPER | ||
return [[LLAppHelper sharedHelper] dynamicAppInfos]; | ||
#endif | ||
return nil; | ||
} | ||
|
||
+ (UIViewController *_Nullable)viewControllerWithName:(NSString *_Nonnull)name params:(NSDictionary <NSString *,id>*)params { | ||
Class cls = NSClassFromString(name); | ||
if (cls) { | ||
if ([cls isKindOfClass:[LLBaseViewController class]]) { | ||
LLBaseViewController *vc = [[cls alloc] initWithStyle:UITableViewStyleGrouped]; | ||
for (NSString *key in params) { | ||
id value = params[key]; | ||
[vc setValue:value forKey:key]; | ||
} | ||
return vc; | ||
} | ||
} | ||
return nil; | ||
} | ||
|
||
@end |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.