Working out what a package does before removing it
· 2 min read
You have found a package called com.manufacturer.dtvsvc and have no idea what
it does. Before removing it, quite a lot can be worked out.
Permissions are the best clue
adb shell dumpsys package com.example.package | grep -A 30 "requested permissions"
Permissions tell the story. A "product improvement" service asking for
RECORD_AUDIO and ACCESS_FINE_LOCATION is telling you exactly what it does,
whatever it is called.
Permissions worth noticing:
| Permission | What it implies |
|---|---|
RECORD_AUDIO |
Can use the microphone |
INTERNET + READ_PHONE_STATE |
Can identify you and report |
RECEIVE_BOOT_COMPLETED |
Starts with the television |
SYSTEM_ALERT_WINDOW |
Can draw over other apps |
Check whether it is running right now
adb shell ps -A | grep example
If it appears, it is in memory. And if it also starts with the system, it is consuming resources around the clock.
See what services it registers
adb shell dumpsys package com.example.package | grep -A 20 "Service Resolver"
See whether it talks to the internet
The cleanest way is from the router, or from a DNS that logs queries. If the package constantly queries an analytics domain, you know what it is.
We cover that in blocking ads at the router.
The definitive test: disable, do not uninstall
When doubt persists, the prudent route is to disable rather than remove:
adb shell pm disable-user --user 0 com.example.package
Use the television normally for a few days. If nothing fails, you know it is dispensable. If something does:
adb shell pm enable com.example.package
Slower than deleting, and it is the difference between knowing what you are doing and getting lucky.