未验证 提交 bea5a8f1 编写于 作者: Y yixiangboy 提交者: GitHub

Merge branch 'master' into master

......@@ -23,7 +23,7 @@ dependencies {
@Override
public void onCreate() {
...
DoraemonKit.install(application
DoraemonKit.install(application)
// H5任意门功能需要,非必须
DoraemonKit.setWebDoorCallback(new WebDoorManager.WebDoorCallback() {
......@@ -109,4 +109,4 @@ public void onCreate() {
DoraemonKit.install(application, kits);
...
}
```
\ No newline at end of file
```
......@@ -11,7 +11,7 @@ dependencies {
}
```
Please use [the lastest release](android-ReleaseNotes.md)
Please use [the latest release](android-ReleaseNotes.md)
......@@ -109,4 +109,4 @@ public void onCreate() {
DoraemonKit.install(application, kits);
...
}
```
\ No newline at end of file
```
......@@ -15,12 +15,16 @@ typedef void (^DoraemonH5DoorBlock)(NSString *);
- (void)install;
- (void)installWithCustomBlock:(void(^)())customBlock;
@property (nonatomic,strong) NSMutableArray *dataArray;
@property (nonatomic, copy) DoraemonH5DoorBlock h5DoorBlock;
- (void)addPluginWithTitle:(NSString *)title icon:(NSString *)iconName desc:(NSString *)desc pluginName:(NSString *)entryName atModule:(NSString *)moduleName;
- (void)removePluginWithPluginName:(NSString *)pluginName atModule:(NSString *)moduleName;
- (void)addStartPlugin:(NSString *)pluginName;
- (void)addH5DoorBlock:(void(^)(NSString *h5Url))block;
......
......@@ -55,6 +55,12 @@ typedef void (^DoraemonPerformanceBlock)(NSDictionary *);
}
- (void)install{
[self installWithCustomBlock:^{
//什么也没发生
}];
}
- (void)installWithCustomBlock:(void(^)())customBlock{
for (int i=0; i<_startPlugins.count; i++) {
NSString *pluginName = _startPlugins[i];
Class pluginClass = NSClassFromString(pluginName);
......@@ -63,8 +69,10 @@ typedef void (^DoraemonPerformanceBlock)(NSDictionary *);
[plugin pluginDidLoad];
}
}
[self initData];
customBlock();
[self initEntry];
//根据开关判断是否收集Crash日志
......@@ -192,6 +200,10 @@ typedef void (^DoraemonPerformanceBlock)(NSDictionary *);
}
}
- (void)removePluginWithPluginName:(NSString *)pluginName atModule:(NSString *)moduleName{
[self unregisterPlugin:pluginName withModule:moduleName];
}
- (void)registerPluginArray:(NSMutableArray*)array withModule:(NSString*)moduleName{
if (!_dataArray){
_dataArray = [[NSMutableArray alloc]init];
......@@ -202,6 +214,27 @@ typedef void (^DoraemonPerformanceBlock)(NSDictionary *);
[_dataArray addObject:dic];
}
- (void)unregisterPlugin:(NSString*)pluginName withModule:(NSString*)moduleName{
if (!_dataArray){
return;
}
id object;
for (object in _dataArray) {
NSString *tempModuleName = [((NSMutableDictionary *)object) valueForKey:@"moduleName"];
if ([tempModuleName isEqualToString:moduleName]) {
NSMutableArray *tempPluginArray = [((NSMutableDictionary *)object) valueForKey:@"pluginArray"];
id pluginObject;
for (pluginObject in tempPluginArray) {
NSString *tempPluginName = [((NSMutableDictionary *)pluginObject) valueForKey:@"pluginName"];
if ([tempPluginName isEqualToString:pluginName]) {
[tempPluginArray removeObject:pluginObject];
return;
}
}
}
}
}
- (void)hiddenDoraemon{
_entryView.hidden = YES;
}
......
......@@ -568,7 +568,7 @@
GCC_PREFIX_HEADER = "DoraemonKitDemo/DoraemonKitDemo-PrefixHeader.pch";
INFOPLIST_FILE = DoraemonKitDemo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = yixiang.DoraemonKitDemoC;
PRODUCT_BUNDLE_IDENTIFIER = yixiang.DoraemonKitDemoXXX;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
};
......@@ -586,7 +586,7 @@
GCC_PREFIX_HEADER = "DoraemonKitDemo/DoraemonKitDemo-PrefixHeader.pch";
INFOPLIST_FILE = DoraemonKitDemo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = yixiang.DoraemonKitDemoC;
PRODUCT_BUNDLE_IDENTIFIER = yixiang.DoraemonKitDemoXXX;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
};
......
......@@ -27,11 +27,15 @@
}
[[DoraemonManager shareInstance] addPluginWithTitle:@"测试插件" icon:@"doraemon_default" desc:@"测试插件" pluginName:@"TestPlugin" atModule:@"业务工具"];
[[DoraemonManager shareInstance] addStartPlugin:@"StartPlugin"];
[[DoraemonManager shareInstance] install];
// [[DoraemonManager shareInstance] addH5DoorBlock:^(NSString *h5Url) {
// NSLog(@"使用自带容器打开H5链接: %@",h5Url);
// }];
[[DoraemonManager shareInstance] install];
// 例子:移除 GPS Mock
// [[DoraemonManager shareInstance] installWithCustomBlock:^{
// [[DoraemonManager shareInstance] removePluginWithPluginName:@"DoraemonGPSPlugin" atModule:@"常用工具"];
// }];
for (int i=0; i<10; i++) {
// DDLogInfo(@"点击添加埋点22222");
}
......
......@@ -430,7 +430,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 2M632FEG3H;
DEVELOPMENT_TEAM = RSV7DQ57L7;
INFOPLIST_FILE = DoraemonLoadAnalyzeDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = (
......@@ -438,7 +438,7 @@
"@executable_path/Frameworks",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = com.javer.yi.DoraemonLoadAnalyzeDemo;
PRODUCT_BUNDLE_IDENTIFIER = com.javer.yi.DoraemonLoadAnalyzeDemoXXXX;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
};
......@@ -449,7 +449,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 2M632FEG3H;
DEVELOPMENT_TEAM = RSV7DQ57L7;
INFOPLIST_FILE = DoraemonLoadAnalyzeDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = (
......@@ -457,7 +457,7 @@
"@executable_path/Frameworks",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = com.javer.yi.DoraemonLoadAnalyzeDemo;
PRODUCT_BUNDLE_IDENTIFIER = com.javer.yi.DoraemonLoadAnalyzeDemoXXXX;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册