Self-scans reveal that Pegasus, an invasive and powerful spyware that can secretly control phones and track owners, might be more widespread than previously thought. It was discovered on the phones of everyday phone users.
From wikiHow: How to Check Your Smartphone for Pegasus Spyware
Let’s say there are signs of it being infected. What can you do next?
Buy/replace your phone
How do you keep that one from reinfecting?
You can try factory reset, but more than likely they control the boot process, so you can’t get rid of the malware no matter what you do.
You might be able to trade it in with your manufacturer. They might be interested in having an infected phone to study.
Reinstall rom