Ive been wanting to uninstall a camera/microphone monitor i have for a while now. It works exceptional dont get me wrong, but its a power hog. Ive been trying to create my own through flows.
I have successfully done parts like...
Log camera start/end times through app task, log broadcast, ui, package event, etc. I have also made a conditional camera lock. Im fairly pleased with logging however i have no idea how to log the execution path,app, whatever type of trigger outside automagic that initiated the camera.
Microphone is harder. All i jave figured out with the mic is how to mit it..
Any fingers pointing me in the right direction will be as always, graciously appreciated
Mic and camera monitor
Moderator: Martin
Re: Mic and camera monitor
What is the app name? I wonder how the app determine the camera usage.
So far, what I know is you can use logcat to find where the camera is initialized and being used by certain app. The path can be checked when it request the storage permission. But that require root, or at least next AM 1.38 (which support read log permission). The other method is for certain ROM, such as mine, RR 7.0, which is LOS based; for LOS 15 based above, ti has a feature called privacy guard. Any app that request camera/mic will be logged here. I haven't found yet where the database is stored, but again require root to access the log.
Reading the log continuously might be the thing that cause the power hog. So it seems if you can implement the same in Automagic, it will be the same power hog.
So far, what I know is you can use logcat to find where the camera is initialized and being used by certain app. The path can be checked when it request the storage permission. But that require root, or at least next AM 1.38 (which support read log permission). The other method is for certain ROM, such as mine, RR 7.0, which is LOS based; for LOS 15 based above, ti has a feature called privacy guard. Any app that request camera/mic will be logged here. I haven't found yet where the database is stored, but again require root to access the log.
Reading the log continuously might be the thing that cause the power hog. So it seems if you can implement the same in Automagic, it will be the same power hog.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Mic and camera monitor
Ugh... yeah im limited to what i can do bc no root access but there is a way around all googles restrictions, its just a matter of finding it. With the help of you guys i have been able to break through their security bs and read some info on what i want. Just gonna take time to work it properly. But the microphone is the uard one for me. What do i look for to capture it? No idea what package,etc it is.
This is my monitoring app... i have used many but this one lasted
This is my monitoring app... i have used many but this one lasted
Re: Mic and camera monitor
The app use app usage permission to get the usage of all apps permission. I still don't know what is the code, but it probably use some java code I don't understand anyway.
I try dumpsys and found something interesting in the appops service
This will give you all the apps those have been granted the camera permission and when is the last time of the usage. I still can't get the info on how many times it access the permission, just like the info in the privacy guard. But at least we know the last one.
Again, currently in AM 1.37, it still require root to use dumpsys. And it seems you have to do the dumpsys periodically and then use regex to parse the data and rearrange them into a readable format. The informations seems to be useful for troubleshooting. I added it to my to do flow for the dumpsys group.
I try dumpsys and found something interesting in the appops service
Code: Select all
adb shell dumpsys appops --op CAMERA
Again, currently in AM 1.37, it still require root to use dumpsys. And it seems you have to do the dumpsys periodically and then use regex to parse the data and rearrange them into a readable format. The informations seems to be useful for troubleshooting. I added it to my to do flow for the dumpsys group.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.