Skip to content

Instantly share code, notes, and snippets.

@Malinskiy
Created August 29, 2017 14:54
Show Gist options
  • Save Malinskiy/69de5743d60e0004ca60ec4e72e6c2a9 to your computer and use it in GitHub Desktop.
Save Malinskiy/69de5743d60e0004ca60ec4e72e6c2a9 to your computer and use it in GitHub Desktop.
PackageManagerService.java#locationIsPrivileged
static boolean locationIsPrivileged(File path) {
try {
final String privilegedAppDir = new File(Environment.getRootDirectory(), "priv-app")
.getCanonicalPath();
return path.getCanonicalPath().startsWith(privilegedAppDir);
} catch (IOException e) {
Slog.e(TAG, "Unable to access code path " + path);
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment