Skip to content
This repository has been archived by the owner on Apr 28, 2023. It is now read-only.

linuxct/PhoneAccountDetector

Repository files navigation

logo

PhoneAccount Abuse Detector (PAAD)
Latest Version Compatibility

Simple application to enumerate and detect any application that (ab)uses adding an indefinite amount of PhoneAccount(s) to Android's TelecomManager. As seen on Android Police, XDA-Developers, Xataka Android, Ars Technica.

Check out the project's amazing landing page at paad.linuxct.space.

Background

This application exists because malicious or just improperly programmed applications can, intentionally or not, block your device from the ability to call emergency numbers. If you are in such a situation, this app helps you to find the culprit – which you then can uninstall (or disable).

For the exact details on the vulnerability (why this happens, how it was discovered, fixes timeline, ...), please check the article by Mishaal Rahman here.

About permissions

This application requires two call management permissions, Manifest.permission.READ_PHONE_STATE and Manifest.permission.READ_PHONE_NUMBERS.

READ_PHONE_STATE is used in all supported Android versions, whereas READ_PHONE_NUMBERS is requested on Android 12 and onwards exclusively. This is because on Android, in order to read which applications are adding PhoneAccounts to Android's TelecomManager, these permissions are necessary.

No permission is (ab)used to log, collect or process any personally identifiable user information.

Download

Download button
Click here to download the latest version

Download button
Click here to download from Google Play
(usually a few versions behind GitHub, so GitHub is recommended)

Application usage

The application is very simple, and contains 2 components:

  • A message at the top of the device, explaining if the application detected a possible abuse of this functionality which may cause issues while attempting to call Emergency Services.
  • A list of the applications that have registered a Phone Account in your device, usually including your own SIM Cards, Google Duo, Teams, among others. Alongside each app, the number of accounts is displayed to facilitate the identification of the malfunctioning/hijacking application.

Check this video if you have doubts on how to interpret this data:

Watch on YouTube
(Thanks to Explaining Android for the video)

Screenshots

Permission management
Permissions necessary for the app to work


Abnormal case
Case where Teams added 4 PhoneAccounts to TelecomManager
The app flags this as abnormal behaviour


Normal case
Case without any abnormal app behaviour

Build

You can use Android Studio to build the application, or you can build it by using the CLI.

Navigate to the folder where the source code is located:
cd /path/where/you/downloaded/PhoneAccountDetector/

Then, check that Gradle runs properly by executing:
For Linux/MacOS: ./gradlew tasks
For Windows: gradlew tasks

You can now build the application in release or debug flavor:
./gradlew assemble

After it's done building, you will now need to sign the resulting APK by using apksigner, or jarsigner. Here's an example:
apksigner sign --ks /path/to/example.keystore --ks-pass pass:"EXAMPLEPASSWORD" --v1-signing-enabled true --v2-signing-enabled true --verity-enabled true *.apk