void replace() { ReactInstanceDevCommandsHandler originalHandler = getOriginalHandler(); DevCommandsHandlerProxy proxy = new DevCommandsHandlerProxy(originalHandler, listener); replaceInReactInstanceManager(proxy); replaceInDevSupportManager(proxy); }
private ReactInstanceDevCommandsHandler getOriginalHandler() { return (ReactInstanceDevCommandsHandler) ReflectionUtils.getDeclaredField(reactInstanceManager, "mDevInterface"); }
DevCommandsHandlerProxy(ReactInstanceDevCommandsHandler originalReactHandler, Listener listener) { this.originalReactHandler = originalReactHandler; this.listener = listener; }