while obviously slower, running RmPerm on the de-
vice requires less than 30 seconds on average, and the
times are still linear in the size of the DEX file, even
though the slope is less steep and there is a constant
cost, presumably due to the start-up time of RmPerm
on Android.
4 RELATED WORK
As shown by previous work (Felt et al., 2011b;
Felt et al., 2011a) , many Android apps are over-
privileged, that is, they request more permissions than
they actually need, thereby making the built-in per-
mission system rather inadequate to protect the users
and their privacy. To address these concerns, some
authors have proposed to enrich the built-in security
framework, by modifying the underlying operating
system, and requiring changes to the app sources, in
order to exploit the new features.
One of the top problems related to Android permis-
sions is the fact that, up to Android 6, the protection
offered by the system was an all-or-nothing choice
at installation time, when the user was asked to ac-
cept all permissions requested by the app, or to abort
the installation altogether. Moreover, with the current
permissions management, if an app requests a dan-
gerous permission, belonging to a certain permission
group, and the user agrees on its usage, then the user is
actually agreeing on accepting all permissions of the
same group. That is, any subsequent update of the app
can request, and be silently granted, any other permis-
sion belonging to an accepted group. Clearly, a fine-
grained control was needed. For this reason, many
proposals, including ours, tackle the built-in permis-
sion system directly. Apex (Nauman et al., 2010) is
a policy enforcement framework that allows users to
selectively grant permissions to apps, as well as im-
pose constraints on the usage of resources. This im-
plementation requires some changes to the Android
code base so, while we share a similar goal, the strik-
ing difference is that we require no changes to the un-
derlying system.
Some work addresses privacy concerns directly:
AppFence (Hornyack et al., 2011) retrofits the An-
droid operating system to protect private data from
being exfiltrated, by replacing shadow data, in place
of data that the user wants to keep private, and
by blocking network transmissions that contain data
the user marked for on-device use only. Mock-
Droid (Beresford et al., 2011) modifies the Android
operating system to allow users to
mock
the app’s ac-
cesses to a resources . We use a similar
trick
to avoid
that apps crash due to unexpected exceptions, once
we have removed some of their permissions. How-
ever, we repackage apps and leave the operating sys-
tem untouched. Finally, TISSA (Zhou et al., 2011) is
a privacy-mode implementation in Android. All the
above proposals allow to run unmodified apps more
safely, at the cost of modifying the underlying An-
droid operating system, which severely hampers the
widespread adoption of these solutions.
Other proposals (Xu et al., 2012; Jeon et al., 2012;
Davis et al., 2012; Backes et al., 2013; Davis and
Chen, 2013; Reddy et al., 2011) bypass the need to
modify the underlying operating system by repackag-
ing arbitrary apps to attach user-level sandboxing and
policy enforcement code. These proposals, like ours,
use static analysis to identify the usage of API meth-
ods and instrument the bytecode to control the access
to these invocations. However, with the exception
of (Jeon et al., 2012), discussed below, all of these
do not remove permissions from the manifest of the
original app A, when creating the repackaged app A
′
;
thus, the underlying OS process that runs A
′
retains all
permissions of the original app A. This means that in-
complete/flawed implementations of bytecode rewrit-
ing can lead to bypassing access control mechanisms,
e.g., by using Java reflection and/or native code (Hao
et al., 2013).
Dr. Android (Jeon et al., 2012) is a tool that uses byte-
code rewriting to replace Android permissions with
a specified set of fine-grained versions, that are ac-
cessed through a separate service, called Mr. Hide.
In this case bytecode rewriting is adopted for replac-
ing API calls, used by the original app, with interpro-
cess communication primitives to query Mr. Hide ser-
vice. These primitives are rather expensive, so there
is a significant slowdown on API invocations. With
our approach, instead, API invocations are “short-
circuited” or removed altogether, making repackaged
apps slightly faster than the original.
Finally, Boxify (Backes et al., 2015) has introduced a
concept of app sandboxing on stock Android, based
on app virtualization and process-based privilege sep-
aration. While this approach eliminates the need to
repackage apps, it requires a lot of additional code
(about 12 K lines of Java code, plus 3.5 K LoC of
C/C++, according to the paper), which should be care-
fully audited
4
. On the contrary, our approach simply
requires to customize 57 trivial Java methods. More-
over, Boxify requires the presence of a fully privi-
leged controller process, called Broker, which is an
attractive target for privilege escalation attacks.
4
Authors promised to make the source code available, but
at the time of writing, more than a year later, it is still un-
available.