diff --git a/doric-android/devkit/src/main/java/pub/doric/devkit/DevKit.java b/doric-android/devkit/src/main/java/pub/doric/devkit/DevKit.java index 8281be03..365b16e2 100644 --- a/doric-android/devkit/src/main/java/pub/doric/devkit/DevKit.java +++ b/doric-android/devkit/src/main/java/pub/doric/devkit/DevKit.java @@ -14,6 +14,7 @@ import pub.doric.Doric; import pub.doric.DoricContext; import pub.doric.DoricContextManager; import pub.doric.DoricLibrary; +import pub.doric.DoricNativeDriver; import pub.doric.DoricRegistry; import pub.doric.devkit.event.ConnectExceptionEvent; import pub.doric.devkit.event.EOFExceptionEvent; @@ -34,16 +35,7 @@ public class DevKit implements IDevKit { } private DevKit() { - Doric.registerLibrary(new DoricLibrary() { - @Override - public void load(DoricRegistry registry) { - registry.registerMonitor(new DoricDevMonitor()); - } - }); - for (DoricContext context : DoricContextManager.aliveContexts()) { - context.getDriver().getRegistry().registerMonitor(new DoricDevMonitor()); - break; - } + DoricNativeDriver.getInstance().getRegistry().registerMonitor(new DoricDevMonitor()); EventBus.getDefault().register(this); } diff --git a/doric-iOS/Devkit/Classes/DoricDev.m b/doric-iOS/Devkit/Classes/DoricDev.m index 710eda62..9c4e5f07 100644 --- a/doric-iOS/Devkit/Classes/DoricDev.m +++ b/doric-iOS/Devkit/Classes/DoricDev.m @@ -30,15 +30,6 @@ #import "DoricDevViewController.h" #import "DoricDevMonitor.h" -@interface DoricDevLibrary : DoricLibrary -@end - -@implementation DoricDevLibrary -- (void)load:(DoricRegistry *)registry { - -} -@end - @interface DoricDev () @property(nonatomic, strong) DoricWSClient *wsclient; @property(nonatomic, strong) DoricContext *context; @@ -56,12 +47,7 @@ - (instancetype)init { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onEnterDebugEvent) name:@"EnterDebugEvent" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onStopDebugEvent) name:@"StopDebugEvent" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onDebuggerReadyEvent) name:@"DebuggerReadyEvent" object:nil]; - [Doric registerLibrary:[DoricDevLibrary new]]; - NSValue *value = DoricContextManager.instance.aliveContexts.firstObject; - if (value) { - DoricContext *context = value.nonretainedObjectValue; - [context.driver.registry registerMonitor:[DoricDevMonitor new]]; - } + [DoricNativeDriver.instance.registry registerMonitor:[DoricDevMonitor new]]; } return self; }