Skip to content

Commit

Permalink
[HookLoadMethods] add podspec
Browse files Browse the repository at this point in the history
  • Loading branch information
tripleCC committed May 24, 2019
1 parent fbc9055 commit 2ef7880
Show file tree
Hide file tree
Showing 19 changed files with 185 additions and 231 deletions.
49 changes: 49 additions & 0 deletions HookLoadMethods/A4LoadMeasure.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#
# Be sure to run `pod lib lint OCHooking.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
s.name = 'A4LoadMeasure'
s.version = '0.1.0'

s.summary = 'measure load time consumption.'

s.description = <<-DESC
LoadMeasure measure load time consumption.
DESC

s.homepage = 'https://github.com/tripleCC/Laboratory/tree/master/HookLoadMethods'
s.license = { :type => 'MIT', :text => <<-DOC
Copyright (c) 2019 tripleCC <[email protected]>
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.
DOC
}
s.author = { 'tripleCC' => '[email protected]' }
s.source = { :http => "https://github.com/tripleCC/Laboratory/releases/download/#{s.version}/#{s.name}.zip"}
s.ios.deployment_target = "8.0"
s.osx.deployment_target = "10.11"
s.tvos.deployment_target = "9.0"
s.watchos.deployment_target = "2.0"

s.vendored_frameworks = "#{s.name}.framework"
end
Binary file added HookLoadMethods/A4LoadMeasure.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//
// LoadMeasure.h
// LoadMeasure
// A4LoadMeasure.h
// A4LoadMeasure
//
// Created by tripleCC on 5/22/19.
// Copyright © 2019 tripleCC. All rights reserved.
//

#ifndef LoadMeasure_h
#define LoadMeasure_h
#ifndef A4LoadMeasure_h
#define A4LoadMeasure_h

#import <Foundation/Foundation.h>

Expand All @@ -27,4 +27,4 @@

extern const NSArray <LMLoadInfoWrapper *> *LMLoadInfoWappers;

#endif /* LoadMeasure_h */
#endif /* A4LoadMeasure_h */
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// LoadHook.m
// HookFramework
// A4LoadMeasure.m
// A4LoadMeasure
//
// Created by tripleCC on 5/21/19.
// Copyright © 2019 tripleCC. All rights reserved.
Expand All @@ -10,7 +10,7 @@
#include <mach-o/dyld.h>
#include <objc/runtime.h>
#include <mach-o/getsect.h>
#import "LoadMeasure.h"
#import "A4LoadMeasure.h"

NSArray <LMLoadInfoWrapper *> *LMLoadInfoWappers = nil;
static NSInteger LMAllLoadNumber = 0;
Expand Down
File renamed without changes.
9 changes: 8 additions & 1 deletion HookLoadMethods/DynamicFramework/DynamicFramework.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@

@implementation DynamicFramework
+ (void)load {
NSLog(@"-----------");
NSLog(@"DynamicFramework");
}
@end


@implementation DynamicFramework(sleep_1_s)
+ (void)load {
sleep(1);
}
@end
Loading

0 comments on commit 2ef7880

Please sign in to comment.