Skip to content

Commit 689d127

Browse files
authored
Merge pull request #2701 from MobSF/android/stock-physical-devices
Android dynamic analyzer: support stock physical devices
2 parents 7fbcca7 + 59c7c7f commit 689d127

30 files changed

Lines changed: 3477 additions & 721 deletions

‎mobsf/DynamicAnalyzer/forms.py‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,48 @@
22
from django import forms
33

44

5+
class AndroidDeviceSelectionForm(forms.Form):
6+
"""Restrict device selection to connected ADB identifiers."""
7+
8+
identifier = forms.ChoiceField(choices=())
9+
10+
def __init__(self, devices, *args, **kwargs):
11+
super().__init__(*args, **kwargs)
12+
self.fields['identifier'].choices = tuple(
13+
(device['identifier'], device['identifier'])
14+
for device in devices
15+
if device['state'] == 'device'
16+
)
17+
18+
19+
class AndroidDynamicAnalysisForm(forms.Form):
20+
"""Validate Android dynamic-analysis preparation options."""
21+
22+
device_mode = forms.ChoiceField(
23+
required=False,
24+
choices=(
25+
('auto', 'auto'),
26+
('rooted', 'rooted'),
27+
('gadget', 'gadget'),
28+
),
29+
)
30+
install = forms.ChoiceField(
31+
required=False,
32+
choices=(('0', '0'), ('1', '1')),
33+
)
34+
re_install = forms.ChoiceField(
35+
required=False,
36+
choices=(('0', '0'), ('1', '1')),
37+
)
38+
uninstall_existing = forms.ChoiceField(
39+
required=False,
40+
choices=(('0', '0'), ('1', '1')),
41+
)
42+
replace_existing_gadget = forms.ChoiceField(
43+
required=False,
44+
choices=(('0', '0'), ('1', '1')),
45+
)
46+
47+
548
class UploadFileForm(forms.Form):
649
file = forms.FileField()

0 commit comments

Comments
 (0)