diff --git a/desktop/app/src/devices/ClientDevice.tsx b/desktop/app/src/devices/ClientDevice.tsx deleted file mode 100644 index c745a73ff..000000000 --- a/desktop/app/src/devices/ClientDevice.tsx +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @format - */ - -import BaseDevice, {OS} from './BaseDevice'; - -export default class ClientDevice extends BaseDevice { - constructor(serial: string, title: string, os: OS) { - super(serial, 'emulator', title, os); - this.devicePlugins = []; - } -} diff --git a/desktop/app/src/devices/DummyDevice.tsx b/desktop/app/src/devices/DummyDevice.tsx new file mode 100644 index 000000000..e940cf649 --- /dev/null +++ b/desktop/app/src/devices/DummyDevice.tsx @@ -0,0 +1,20 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +import BaseDevice, {OS} from './BaseDevice'; + +/** + * Use this device when you do not have the actual uuid of the device. For example, it is currently used in the case when, we do certificate exchange through WWW mode. In this mode we do not know the device id of the app and we generate a fake one. + */ +export default class DummyDevice extends BaseDevice { + constructor(serial: string, title: string, os: OS) { + super(serial, 'dummy', title, os); + this.devicePlugins = []; + } +} diff --git a/desktop/app/src/server.tsx b/desktop/app/src/server.tsx index 9de5044e7..b91c7c5dc 100644 --- a/desktop/app/src/server.tsx +++ b/desktop/app/src/server.tsx @@ -38,7 +38,7 @@ import querystring from 'querystring'; import {IncomingMessage} from 'http'; import ws from 'ws'; import {initSelfInpector} from './utils/self-inspection/selfInspectionUtils'; -import ClientDevice from './devices/ClientDevice'; +import DummyDevice from './devices/DummyDevice'; import BaseDevice from './devices/BaseDevice'; import {sideEffect} from './utils/sideEffect'; import {destroyDevice} from './reducers/connections'; @@ -306,7 +306,7 @@ class Server extends EventEmitter { if (transformedMedium === 'WWW') { this.store.dispatch({ type: 'REGISTER_DEVICE', - payload: new ClientDevice(device_id, app, os), + payload: new DummyDevice(device_id, app, os), }); } diff --git a/desktop/pkg/schemas/plugin-package-v2.json b/desktop/pkg/schemas/plugin-package-v2.json index c70cca6f6..b59652da6 100644 --- a/desktop/pkg/schemas/plugin-package-v2.json +++ b/desktop/pkg/schemas/plugin-package-v2.json @@ -58,9 +58,9 @@ "enum": ["iOS", "Android", "Metro"] }, "type": { - "description": "Device type: physical or emulator. Lack of this property means both physical and emulator devices supported.", + "description": "Device type: physical or emulator or dummy. Lack of this property means it supports physical, emulator and dummy devices.", "type": "string", - "enum": ["physical", "emulator"] + "enum": ["physical", "emulator", "dummy"] }, "archived": { "description": "Specifies support for archived devices. Lack of this property means that both live and archived devices supported. False means only live devices supported. True means only archived devices supported.", @@ -84,6 +84,6 @@ "id", "main", "flipperBundlerEntry", - "keywords" + "keywords" ] } diff --git a/desktop/plugin-lib/src/PluginDetails.ts b/desktop/plugin-lib/src/PluginDetails.ts index 6d650837f..072788975 100644 --- a/desktop/plugin-lib/src/PluginDetails.ts +++ b/desktop/plugin-lib/src/PluginDetails.ts @@ -40,7 +40,7 @@ export interface SupportedDevice { export type OS = 'iOS' | 'Android' | 'Metro'; -export type DeviceType = 'emulator' | 'physical'; +export type DeviceType = 'emulator' | 'physical' | 'dummy'; export type PluginType = 'client' | 'device';