Skip to content

Instantly share code, notes, and snippets.

@pjhjohn
Created December 19, 2017 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pjhjohn/6355002e1e6bea7ccc4508708c57a8af to your computer and use it in GitHub Desktop.
Save pjhjohn/6355002e1e6bea7ccc4508708c57a8af to your computer and use it in GitHub Desktop.
/* Package Inspection */
val manager = this.packageManager
manager.getInstalledPackages(0)
.map { manager.getApplicationInfo(it.packageName, 0) }
.forEach { Timber.d("${it.packageName} installed at ${it.publicSourceDir} is ${if (it.flags and ApplicationInfo.FLAG_SYSTEM != 0) "a system app" else "not a system app"}") }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment