Skip to content

Commit 0ae0b66

Browse files
committed
Merge branch 'frida-integration'
2 parents cdf5d27 + de0fada commit 0ae0b66

15 files changed

+768
-71
lines changed

src/components/intercept/config/android-adb-config.tsx

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as _ from 'lodash';
22
import * as React from 'react';
3-
import { computed, observable, action } from 'mobx';
4-
import { observer, inject } from 'mobx-react';
3+
import { computed, observable, action, autorun } from 'mobx';
4+
import { observer, inject, disposeOnUnmount } from 'mobx-react';
55

66
import { styled } from '../../../styles';
77

@@ -46,6 +46,10 @@ const ConfigContainer = styled.div`
4646
}
4747
`;
4848

49+
const AdbTargetList = styled(InterceptionTargetList)`
50+
max-height: 280px;
51+
`;
52+
4953
const Footer = styled.p`
5054
font-size: 85%;
5155
font-style: italic;
@@ -81,17 +85,21 @@ class AndroidAdbConfig extends React.Component<{
8185
this.interceptDevice(this.deviceIds[0]);
8286
this.props.closeSelf();
8387
}
88+
89+
disposeOnUnmount(this, autorun(() => {
90+
if (this.deviceIds?.length === 0) {
91+
this.props.closeSelf();
92+
}
93+
}));
8494
}
8595

8696
render() {
8797
return <ConfigContainer>
8898
{ this.deviceIds.length > 1
8999
? <>
90100
<p>
91-
There are multiple ADB devices connected.
92-
</p>
93-
<p>
94-
Pick which device you'd like to intercept:
101+
There are multiple ADB devices connected. Pick which
102+
device you'd like to intercept:
95103
</p>
96104
</>
97105
: this.deviceIds.length === 1
@@ -115,14 +123,20 @@ class AndroidAdbConfig extends React.Component<{
115123
</p>
116124
</> }
117125

118-
<InterceptionTargetList
126+
<AdbTargetList
119127
spinnerText='Waiting for Android devices to intercept...'
120128
targets={this.deviceIds.map(id => {
121129
const activating = this.inProgressIds.includes(id);
122130

131+
// Only new servers (1.17.0+) expose metadata.devices with names
132+
const deviceName = this.props.interceptor.metadata?.devices?.[id].name
133+
?? id;
134+
123135
return {
124136
id,
125-
title: `Intercept Android device ${id}`,
137+
title: `Intercept Android device ${deviceName}${
138+
id !== deviceName ? ` (ID: ${id})` : ''
139+
}`,
126140
status: activating
127141
? 'activating'
128142
: 'available',
@@ -131,7 +145,7 @@ class AndroidAdbConfig extends React.Component<{
131145
: id.match(/\d+\.\d+\.\d+\.\d+:\d+/)
132146
? <Icon icon={['fas', 'network-wired']} />
133147
: <Icon icon={['fas', 'mobile-alt']} />,
134-
content: id
148+
content: deviceName
135149
};
136150
})}
137151
interceptTarget={this.interceptDevice}

src/components/intercept/config/docker-attach-config.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ const ConfigContainer = styled.div`
4242
}
4343
`;
4444

45+
const DockerTargetList = styled(InterceptionTargetList)`
46+
max-height: 262px;
47+
`;
48+
4549
const Footer = styled.p`
4650
font-size: 85%;
4751
font-style: italic;
@@ -101,10 +105,10 @@ class DockerAttachConfig extends React.Component<{
101105
Pick a container to restart it with all traffic intercepted:
102106
</p>
103107

104-
<InterceptionTargetList<string>
108+
<DockerTargetList
105109
spinnerText='Looking for Docker containers to intercept...'
106110
interceptTarget={this.interceptTarget}
107-
ellipseDirection='right'
111+
ellipseDirection='left'
108112
targets={targets.map((target) => {
109113
const activating = this.inProgressIds.includes(target.id);
110114
const interceptedByUs = target.labels[CONTAINER_PROXY_LABEL] === proxyPort.toString();

0 commit comments

Comments
 (0)