How to programmatically disable "Wireless Emergency Alerts" on Android?
Asked Answered
H

3

6

I'm trying to see if it's possible to programmatically disable "Wireless Emergency Alerts" such as Amber Alerts and other emergency alerts. Has anyone been able to accomplish this, or have any helpful information that can point me in the right direction?

Hardened answered 21/10, 2022 at 15:48 Comment(3)
I'm in the process of trying to create an MDM with the ability to configure if emergency alerts are enabled or not, among other things. I have Device admin access, so I would assume it's possible, but I haven't been able to find any information on it.Hardened
I'm using the MDM to essentially turn the phone into a dedicated camera and whenever emergency alerts appear they disrupt what the user is doing. So I want them to be disabled by default entirely.Hardened
I'd love an answer to this too. It seems after years of Android users being able to disable Wireless Emergency Alerts here in Canada, one of the latest updates seems to have enforced them being always set to on.Decollate
D
4

After doing a bit of digging, this may be a possible solution if you're willing to install ADB, connect your device to a computer, and uninstall the Wireless Emergency Alert package manually via ADB.

I'm going to address this question in a manual way, however there is no reason at least some of it can't be scripted, and done so programmatically.


You'll need to do about 3 major steps:

a) Download the SDK Platform Tools package for your platform. You can find them linked here: https://developer.android.com/studio/releases/platform-tools

b) Go into developer mode on your device, and authorize your computer. Here are the steps to do so here: https://developer.android.com/studio/command-line/adb#Enabling

c) Remove the com.android.cellbroadcastreceiver package, using adb shell, and the pm command, as described here: https://www.reddit.com/r/alberta/comments/qw9bmj/how_to_disable_emergency_alerts/


It's good to go over all of that individually, as each of those major steps have many smaller steps in between. I'll try to break them down below for easy consumption, as a step-by-step guide.

  1. Download the (and install) SDK Platform Tools package for your platform. You can find them linked here: https://developer.android.com/studio/releases/platform-tools
  2. As an administrator using the shell/terminal for your system, navigate to the folder, and prepare to run the adb command.
  3. On your device, navigate, following the instructions linked in step 'b' above, to your Build number, and tap it repeatedly until it informs you developer mode is enabled (or requests your PIN to enable developer mode).
  4. Navigate to the first page of your settings app, and you will have a new menu option titled "Developer options" that you must select.
  5. From the Developer options menu, enable the "USB debugging" option (or alternatively you can read the linked docs above to use wireless debugging instead), and confirm that you wish to enable USB debugging when prompted.
  6. Connect your device to your computer, and allow any needed drivers to complete installing. You may need to disconnect and re-connect your device from your computer once the driver are installed. If prompted on your device, permit your computer to connect to your device, and optionally select the Always allow option.
  7. Using the shell we opened in step 2 and the appropriate syntax for your computer's platform, use ADB command to interrogate devices. (e.g. in Windows PowerShell, .\adb.exe devices in Linux or MacOS sudo adb devices) Be sure that your device is listed in the results, and is listed as a 'device' and not as 'unauthorized'. If it is listed as unauthorized, be sure you allowed USB debugging on your device when you were prompted. If it's not listed at all, check your connections, or possibly try one of the alternate connections methods listed in the linked articles.
  8. Using the ADB command, connect to your devices shell. (e.g. .\adb.exe shell or sudo adb shell)
  9. Once in the ADB shell in your device, if on Android 12 run the command pm uninstall -k --user 0 com.android.cellbroadcastreceiver or pm uninstall -k --user 0 com.google.android.cellbroadcastreceiver on Android 13. The pm command is Android's built in package manager, which you are instructing to 'uninstall' and '-k' but keep user data for '--user 0' for the package/app 'com.android.cellbroadcastreceiver'.
  10. Once the package is removed, you can use the 'exit' command to disconnect from your device, you can revoke any connected devices, and you can turn off Developer mode if you wish. It might also be a good idea to reboot your device.

That's pretty much it.

A word of warning: It seems some handset makers handle Wireless Emergency Alerts differently and not all use the com.android.cellbroadcastreceiver package, and while Samsung was called out as being one of those handset manufacturers, on my S10 running Android 12, that package was there and was indeed responsible for Wireless Emergency Alerts.

If 'com.android.cellbroadcastreceiver' is not an installed package on your device, you might need to target a different package or disable it some other way. In Android 13, the package seems to be renamed 'com.google.android.cellbroadcastreceiver'

Good luck!

Decollate answered 10/11, 2022 at 2:23 Comment(4)
I had success here with the S10, but the S22 no longer has com.android.cellbroadcastreceiver. The instructions from the linked Reddit post about revoking permissions from the Samsung Messages app looks like it should work (won't know until the next annoying useless 'emergency' alert my government sends out).Society
Probably Android 12 vs Android 13 differences. I'd imagine there must be a service that handles it that you can disable instead.Decollate
@Society it seems that same package has been renamed com.google.android.cellbroadcastreceiver on Android 13. Were you able to get your solution to work? If not, try this one and let me know how that works out for you.Decollate
I can confirm that your fix works on Android 13 as well, thank you very much.Society
C
0

if you get pm uninstall ... errors sometimes you need to start adb shell before removing packages

on S22 android 13 it was

pm uninstall -k --user 0 com.google.android.cellbroadcastreceiver

Cordate answered 6/8, 2023 at 14:42 Comment(0)
E
-1

I don't think is possible to really uninstall/deactivate such alerts. I uninstalled all on nothing (1), still alerts are coming. But, you can try other non-android phones, as pinephone/librem/volla

Evelinaeveline answered 12/9, 2023 at 20:49 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.