If you’ve been using Android for a while, you’ve probably noticed gainingroot access on most android phones is much harder than it once was. There were exploits years back that could root almost any Android phone in a few minutes, but that’s much less common now. The last essentially universal exploit was Towelroot in mid-2014, but Google patched that rather quickly.
The reason these exploits are patched so quickly now is that having active exploits on your system is actually a bad thing for most users. These are security holes that can be utilized by malware to take over a device remotely and steal data. Google and the device makers are being responsible when they shut down root methods after they are disclosed. After 2015’s Stagefright issues, there are monthly security patches for some devices like the Pixel and Nexus phones. Carriers and OEMs are also better about rolling out these monthly patches on a semi-monthly basis to patch flaws. Sometimes, that includes root exploits.
Android is more secure, and it takes more work to break that security in a way that can grant root access. As a result of this cat-and-mouse game, root exploits are often pretty involved. You might have to push files to your device over USB, enter terminal commands, and flash modified files.
The effort needed to find, test, and develop exploits of this nature is a big part of the reason some popular devices don’t even have public root methods. That’s not to say there aren’t exploits in these devices, but they’re far too valuable to be given away freely to the community. If you peruse XDA, you might come across one of the many root bounty threads where users pledge thousands of dollars to anyone who can offer a working root method for a phone. This works sometimes, but it’s notoriously hard to collect on these bounties and a few thousand dollars isn’t actually terribly much for a solid exploit.
So there you have it the reason why rooting android phone is now harder