The best way to protect yourself from StingRay devices in particular is to jailbreak your phone and install software that lets you disable 2G connectivity. This still leaves you open to automatic downgrades on 3G and 4G networks, though, so if you’re worried about this type of surveillance, you’ll want to run a VPN as well. Connecting to a true 5G network also protects your data as there are no known IMSI catchers for 5G networks.