Skip to content

Commit

Permalink
Merge pull request #56 from meitu/feature/upgrade
Browse files Browse the repository at this point in the history
upgrade 0.12.2
  • Loading branch information
euanchan authored Apr 20, 2020
2 parents 05ca75c + 13d439a commit 07dd95b
Show file tree
Hide file tree
Showing 9 changed files with 139 additions and 141 deletions.
6 changes: 3 additions & 3 deletions MTHawkeye.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MTHawkeye"
s.version = "0.12.1"
s.version = "0.12.2"
s.summary = "Profiling/Debugging assist tools for iOS."

s.description = <<-DESC
Expand All @@ -17,7 +17,7 @@ Pod::Spec.new do |s|

s.author = { "Euan Chan" => "[email protected]" }

s.platform = :ios, "8.0"
s.platform = :ios, "9.0"

s.source = { :git => "https://github.com/meitu/MTHawkeye.git", :tag => "#{s.version}" }

Expand Down Expand Up @@ -409,7 +409,7 @@ Pod::Spec.new do |s|
s.subspec 'FLEXExtension' do |flex|
flex.public_header_files = 'MTHawkeye/FLEXExtension/**/*.{h}'
flex.source_files = 'MTHawkeye/FLEXExtension/**/*.{h,m}'
flex.dependency 'FLEX', '3.0.0'
flex.dependency 'FLEX', '4.1.1'
flex.dependency 'MTHawkeye/UISkeleton'
flex.libraries = "sqlite3"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ + (UIViewController *)detailViewControllerForMIMEType:(NSString *)mimeType data:
#pragma clang diagnostic pop
}
}
detailViewController = [[FLEXImagePreviewViewController alloc] initWithImage:image];
detailViewController = [FLEXImagePreviewViewController forImage:image];
} else if ([mimeType isEqual:@"application/x-plist"]) {
id propertyList = [NSPropertyListSerialization propertyListWithData:data options:0 format:NULL error:NULL];
detailViewController = [[MTHawkeyeWebViewController alloc] initWithText:[propertyList description]];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ - (MTAppenderFile *)networkRecordsFile {

- (void)storeNetworkTransaction:(MTHNetworkTransaction *)transaction {
NSDictionary *dict = [transaction dictionaryFromAllProperty];
if ([dict count] == 0) {
if ([dict count] == 0 || ![NSJSONSerialization isValidJSONObject:dict]) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#import "MTHawkeyeUserDefaults+DirectorWatcher.h"
#import "UIViewController+MTHawkeyeLayoutSupport.h"

#import "FLEXFileBrowserTableViewController.h"
#import "FLEXFileBrowserController.h"
#import "FLEXImagePreviewViewController.h"
#import "FLEXTableListViewController.h"
#import "FLEXUtility.h"
Expand Down Expand Up @@ -195,10 +195,10 @@ - (void)presentFlexFileBrowserWithPath:(NSString *)fullPath {
NSString *pathExtension = [subpath pathExtension];
UIViewController *vc = nil;
if (isDir) {
vc = [[FLEXFileBrowserTableViewController alloc] initWithPath:fullPath];
} else if ([FLEXUtility isImagePathExtension:pathExtension]) {
vc = [[FLEXFileBrowserController alloc] initWithPath:fullPath];
} else if ([@[@"jpg", @"jpeg", @"png", @"gif", @"tiff", @"tif"] containsObject:pathExtension]) {
UIImage *image = [UIImage imageWithContentsOfFile:fullPath];
vc = [[FLEXImagePreviewViewController alloc] initWithImage:image];
vc = [FLEXImagePreviewViewController forImage:image];
} else {
// Special case keyed archives, json, and plists to get more readable data.
NSString *prettyString = nil;
Expand Down
2 changes: 1 addition & 1 deletion MTHawkeye/Utils/MTHawkeyeInnerLogger.m
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ + (void)setupConsoleLoggerWithLevel:(DDLogLevel)logLevel {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self setup];
_ttyLogger = [[DDTTYLogger alloc] init];
_ttyLogger = [DDTTYLogger sharedInstance];
_ttyLogger.logFormatter = [[MTHawkeyeInnerDDLogFormatter alloc] initWithType:MTHawkeyeInnerDDLogFormatterTypeConsole];
[_mth_log addLogger:_ttyLogger withLevel:logLevel];
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ - (void)fireRequestTask {
manager.requestSerializer = [AFJSONRequestSerializer serializer];
[manager.requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[manager.requestSerializer setValue:@"test-value" forHTTPHeaderField:@"custom-http-field"];
[manager GET:mockRequest[index] parameters:@{@"custom-key" : @"custom-value"} progress:nil success:nil failure:nil];
[manager GET:mockRequest[index] parameters:@{@"custom-key" : @"custom-value"} headers:nil progress:nil success:nil failure:nil];

[self.log appendFormat:@">> %@ \n", radomRequestURL];
dispatch_async(dispatch_get_main_queue(), ^(void) {
Expand Down
4 changes: 2 additions & 2 deletions MTHawkeyeDemo/MTHawkeyeDemoTests/AFURLSessionManagerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ - (void)setUp {
- (void)tearDown {
[super tearDown];
[self.localManager.session.configuration.URLCache removeAllCachedResponses];
[self.localManager invalidateSessionCancelingTasks:YES];
[self.localManager invalidateSessionCancelingTasks:YES resetSession:NO];
self.localManager = nil;

[self.backgroundManager invalidateSessionCancelingTasks:YES];
[self.backgroundManager invalidateSessionCancelingTasks:YES resetSession:NO];
self.backgroundManager = nil;
}

Expand Down
Loading

0 comments on commit 07dd95b

Please sign in to comment.