diff --git a/src/commands/getMemInfo.js b/src/commands/getMemInfo.js
new file mode 100644
index 00000000..8b175181
--- /dev/null
+++ b/src/commands/getMemInfo.js
@@ -0,0 +1,19 @@
+// @flow
+
+import { createCommand, Command } from 'helpers/ipc'
+import { fromPromise } from 'rxjs/observable/fromPromise'
+
+import { withDevice } from 'helpers/deviceAccess'
+import getMemInfo from 'helpers/devices/getMemInfo'
+
+type Input = {
+ devicePath: string,
+}
+
+type Result = *
+
+const cmd: Command = createCommand('devices', 'getMemInfo', ({ devicePath }) =>
+ fromPromise(withDevice(devicePath)(transport => getMemInfo(transport))),
+)
+
+export default cmd
diff --git a/src/commands/installApp.js b/src/commands/installApp.js
index d9f6d530..792a5661 100644
--- a/src/commands/installApp.js
+++ b/src/commands/installApp.js
@@ -2,8 +2,8 @@
import { createCommand, Command } from 'helpers/ipc'
import { fromPromise } from 'rxjs/observable/fromPromise'
-import { withDevice } from 'helpers/deviceAccess'
+import { withDevice } from 'helpers/deviceAccess'
import installApp from 'helpers/apps/installApp'
import type { LedgerScriptParams } from 'helpers/common'
diff --git a/src/commands/installFinalFirmware.js b/src/commands/installFinalFirmware.js
new file mode 100644
index 00000000..775dd743
--- /dev/null
+++ b/src/commands/installFinalFirmware.js
@@ -0,0 +1,28 @@
+// @flow
+
+import { createCommand, Command } from 'helpers/ipc'
+import { fromPromise } from 'rxjs/observable/fromPromise'
+import { withDevice } from 'helpers/deviceAccess'
+
+import installFinalFirmware from 'helpers/firmware/installFinalFirmware'
+
+type Input = {
+ devicePath: string,
+ firmware: Object,
+}
+
+type Result = {
+ targetId: number | string,
+ version: string,
+ final: boolean,
+ mcu: boolean,
+}
+
+const cmd: Command = createCommand(
+ 'devices',
+ 'installFinalFirmware',
+ ({ devicePath, firmware }) =>
+ fromPromise(withDevice(devicePath)(transport => installFinalFirmware(transport, firmware))),
+)
+
+export default cmd
diff --git a/src/commands/installMcu.js b/src/commands/installMcu.js
new file mode 100644
index 00000000..b1fa57ed
--- /dev/null
+++ b/src/commands/installMcu.js
@@ -0,0 +1,28 @@
+// @flow
+
+import { createCommand, Command } from 'helpers/ipc'
+import { fromPromise } from 'rxjs/observable/fromPromise'
+
+// import { withDevice } from 'helpers/deviceAccess'
+import installMcu from 'helpers/firmware/installMcu'
+
+// type Input = {
+// devicePath: string,
+// firmware: Object,
+// }
+
+// type Result = {
+// targetId: number | string,
+// version: string,
+// final: boolean,
+// mcu: boolean,
+// }
+
+type Input = *
+type Result = *
+
+const cmd: Command = createCommand('devices', 'installMcu', () =>
+ fromPromise(installMcu()),
+)
+
+export default cmd
diff --git a/src/commands/installOsuFirmware.js b/src/commands/installOsuFirmware.js
new file mode 100644
index 00000000..f5110b13
--- /dev/null
+++ b/src/commands/installOsuFirmware.js
@@ -0,0 +1,28 @@
+// @flow
+
+import { createCommand, Command } from 'helpers/ipc'
+import { fromPromise } from 'rxjs/observable/fromPromise'
+import { withDevice } from 'helpers/deviceAccess'
+
+import installOsuFirmware from 'helpers/firmware/installOsuFirmware'
+
+type Input = {
+ devicePath: string,
+ firmware: Object,
+}
+
+type Result = {
+ targetId: number | string,
+ version: string,
+ final: boolean,
+ mcu: boolean,
+}
+
+const cmd: Command = createCommand(
+ 'devices',
+ 'installOsuFirmware',
+ ({ devicePath, firmware }) =>
+ fromPromise(withDevice(devicePath)(transport => installOsuFirmware(transport, firmware))),
+)
+
+export default cmd
diff --git a/src/commands/uninstallApp.js b/src/commands/uninstallApp.js
new file mode 100644
index 00000000..a07a2e8f
--- /dev/null
+++ b/src/commands/uninstallApp.js
@@ -0,0 +1,25 @@
+// @flow
+
+import { createCommand, Command } from 'helpers/ipc'
+import { fromPromise } from 'rxjs/observable/fromPromise'
+import { withDevice } from 'helpers/deviceAccess'
+
+import uninstallApp from 'helpers/apps/uninstallApp'
+
+import type { LedgerScriptParams } from 'helpers/common'
+
+type Input = {
+ appParams: LedgerScriptParams,
+ devicePath: string,
+}
+
+type Result = *
+
+const cmd: Command = createCommand(
+ 'devices',
+ 'uninstallApp',
+ ({ devicePath, ...rest }) =>
+ fromPromise(withDevice(devicePath)(transport => uninstallApp(transport, rest))),
+)
+
+export default cmd
diff --git a/src/components/ManagerPage/AppsList.js b/src/components/ManagerPage/AppsList.js
index 19581ff0..66d8dd88 100644
--- a/src/components/ManagerPage/AppsList.js
+++ b/src/components/ManagerPage/AppsList.js
@@ -107,8 +107,8 @@ class AppsList extends PureComponent {
name={c.name}
version={`Version ${c.version}`}
icon={ICONS_FALLBACK[c.icon] || c.icon}
- onInstall={() => {}}
- onUninstall={() => {}}
+ onInstall={this.handleInstallApp(c)}
+ onUninstall={this.handleUninstallApp()}
/>
))}
{
- // state = {
- // currentTab: 'apps',
- // }
-
- // componentWillReceiveProps(nextProps) {
- // const { device } = this.props
- // const { currentTab } = this.state
- // if (device && !nextProps.device && currentTab === 'device') {
- // this.setState({ currentTab: 'apps' })
- // }
- // }
-
- // handleTabChange = t => this.setState({ currentTab: t.value })
-
- createTabs = (device, nbDevices) => {
- const { t } = this.props
- return TABS.map(i => {
- let label = t(`manager:tabs.${i.key}`)
- if (i.key === 'device') {
- if (!device) {
- return null
- }
- label += ` (${nbDevices})`
- }
- return { ...i, label }
- }).filter(Boolean)
- }
-
render() {
const { t } = this.props
- // const { currentTab } = this.state
return (
@@ -64,26 +29,20 @@ class ManagerPage extends Component {
{deviceInfo => (
- {/* */}
{deviceInfo.mcu && bootloader mode}
{deviceInfo.final && osu mode}
{!deviceInfo.mcu &&
!deviceInfo.final && (
- {/* */}
+ />
)}
diff --git a/src/helpers/apps/uninstallApp.js b/src/helpers/apps/uninstallApp.js
index 5fa45564..99a4175a 100644
--- a/src/helpers/apps/uninstallApp.js
+++ b/src/helpers/apps/uninstallApp.js
@@ -1,12 +1,16 @@
// @flow
-// import type { IPCSend } from 'types/electron'
+import type Transport from '@ledgerhq/hw-transport'
-// import { createTransportHandler, uninstallApp } from 'helpers/common'
+import { createSocketDialog } from 'helpers/common'
+import type { LedgerScriptParams } from 'helpers/common'
-// export default (send: IPCSend, data: any) =>
-// createTransportHandler(send, {
-// action: uninstallApp,
-// successResponse: 'manager.appUninstalled',
-// errorResponse: 'manager.appUninstallError',
-// })(data)
+/**
+ * Install an app on the device
+ */
+export default async function uninstallApp(
+ transport: Transport<*>,
+ { appParams }: { appParams: LedgerScriptParams },
+): Promise {
+ return createSocketDialog(transport, '/update/install', appParams)
+}
diff --git a/src/helpers/devices/getMemInfo.js b/src/helpers/devices/getMemInfo.js
new file mode 100644
index 00000000..5e5ad62e
--- /dev/null
+++ b/src/helpers/devices/getMemInfo.js
@@ -0,0 +1,11 @@
+// @flow
+
+import type Transport from '@ledgerhq/hw-transport'
+
+import { getFirmwareInfo, createSocketDialog } from 'helpers/common'
+
+export default async function getMemInfos(transport: Transport<*>): Promise