This repository has been archived by the owner on Jun 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
snoopdroid.py
58 lines (48 loc) · 1.9 KB
/
snoopdroid.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# -*- coding: utf-8 -*-
# This file is part of Viper - https://github.com/viper-framework/viper
# See the file 'LICENSE' for copying permission.
from viper.common.abstracts import Module
from viper.core.project import __project__
try:
import snoopdroid
HAVE_SNOOPDROID = True
except ImportError:
HAVE_SNOOPDROID = False
class Snoopdroid(Module):
cmd = "snoopdroid"
description = "Download applications from Android phone"
authors = ["nex"]
categories = ["android"]
def __init__(self):
super(Snoopdroid, self).__init__()
self.parser.add_argument("-l", "--list", action="store_true", help="Get a list of packages installed")
self.parser.add_argument("-p", "--packages", action="store", help="Download only specific package names (comma separated)")
self.parser.add_argument("-a", "--all", action="store_true", help="Download all installed applications from Android phone (and store in open project)")
def _get_packages(self):
acq = snoopdroid.Acquisition(all_apks=True)
acq.connect()
acq.get_packages()
acq.disconnect()
for package in acq.packages:
self.log("item", package.name)
def _download_all(self):
project_path = __project__.get_path()
acq = snoopdroid.Acquisition(storage_folder="/tmp", all_apks=True)
acq.connect()
acq.get_packages()
acq.pull_packages()
acq.disconnect()
def run(self):
super(Snoopdroid, self).run()
if self.args is None:
return
if not HAVE_SNOOPDROID:
self.log("error", "Missing dependency, install snoopdroid (`pip3 install snoopdroid`)")
return
if self.args.list:
self._get_packages()
elif self.args.all:
self._download_all()
elif self.args.packages:
# TODO
self.log("warning", "Not implemented yet")