The title doesn't grasp the body much. Edits are requested.
I've a string android.permission.CAMERA
to match in the output of adb shell dumpsys package
. My goal is to list the package name of the apps which are using the permission android.permission.CAMERA
.
Consider this example: If I do adb shell dumpsys com.google.android.GoogleCamera
I would get:
Package [com.google.android.GoogleCamera] (cbd5725): ... applicationInfo=ApplicationInfo{235b16ab com.google.android.GoogleCamera} ... dataDir=/data/data/com.google.android.GoogleCamera ... grantedPermissions: ... ... android.permission.CAMERA ...
That was a specific example which was given because I knew the package name. In the original command i.e. adb shell dumpsys package
you would get to see the permissions et al, of all the apps installed.
What I want to do is find out which apps have declared the permission android.permission.CAMERA
.
If you consider all the varied apps installed in the system then there is no fixed distance between:
Package [PKG_NAME] (ID):
andandroid.permission.CAMERA
applicationInfo=ApplicationInfo{235b16ab PKG_NAME}
andandroid.permission.CAMERA
dataDir=/data/data/PKG_NAME
andandroid.permission.CAMERA
which means I at least cannot use grep -Bn
on the output.
It is definitely doable but I don't know where to begin with.
Complete dump of adb shell dumpsys package
: http://pasted.co/e0cd2d4d or https://paste.ee/p/ylpax
It it matters, I'm using Slackware 14.1 on Laptop and COS12 on my rooted Android device.
Package
blocks delimited? Is there a blank line between them, or ... ? – thrig Sep 10 '15 at 1:14