Check for suspicious apps
Often, the opening of unwanted Internet sites on Android is caused by some apps that, in an attempt to propose sponsored apps and sites, do not hesitate to disturb the user with sudden, as much as unwanted, advertising windows. In general, "harassing" ads are not only displayed while browsing the Internet, but also in other areas of the operating system.
As a first step, therefore, I suggest you check the list of installed apps, looking for suspicious apps that can behave similarly: unfortunately, apps of this type are far from rare, so it is not possible for me to provide you with an exhaustive list of software to stay away from.
However, in general, this type of behavior is typical of apps that respond to the "freemium" model (free ones, self-sponsored, with the possibility of purchasing additional features) and free-to-play games, which are also often , designed for in-app purchases.
Clearly, not all freemium apps and not all free-to-play games show unwanted sites and popups, so the discussion remains absolutely general.
In any case, what you can do is access the section relating to the applications installed on Android and delete those that convince you least: to be able to do this, touch the icon Settings (the one in the shape ofgear) located in the drawer of the device, touch the item Apps and notifications / Apps / Applications and, if necessary, tap on the item Show all apps.
At this point, locate the suspicious app in the list displayed on the screen, tap on its name and, to get rid of it, press the buttons Uninstall e OK. If you need more information on how to uninstall apps on Android, you can take a look at the guide I made on this.
Run a malware scan
If, after deleting the apps you found suspicious, you continue to view unwelcome websites when you least expect it, I recommend that you run a malware scan, looking for other well-hidden spyware.
For this purpose, I recommend that you rely on Malwarebytes for Android, the version dedicated to the Google operating system of the famous PC software. The app is available for free on the Play Store, with the possibility of in-app purchases to expand its functionality (by activating, for example, real-time protection).
Anyway, after downloading and launching Malwarebytes, tap the button Start now, repeat the operation with the button Give permission and play the voice Allow, so that the app can scan the files and folders on your device.
At this point, you choose if start the Premium trial 30 days, purchase the Premium version or continue with the free version (in that case, you need to tap on the item Salta located at the top right), touch the button Repair and then tap the button Update database, to download the new malware definitions.
After this step too, you just have to touch the button Run full scan and get Malwarebytes to do its job. At the end of the analysis, you will see a summary of the status of the device, together with the list of any threats present, with relative instructions to eliminate them immediately.
Although Malwarebytes is among the best security apps for Android, it is certainly not the only one: in my guide to the best Android antivirus, in fact, I have listed numerous other apps of this type, which are also very efficient.
Set up your browser to block pop-ups
Another effective method for block sites that open themselves on Android consists of setting the popup blocker in the browser: in this way, the visited Internet pages will no longer be authorized to open others, unless the user voluntarily opens links, images or other contents. Below, I'll explain how to do this in browsers Chrome e Firefox. Keep in mind, though, that blocking pop-ups may affect the functioning of some websites.
To activate the popup blocker on Chrome for Android, start the browser, tap the button (⋮) located at the top right and tap the item Settings located in the menu that appears. Next, tap the voices Site settings e Popups and redirects and move up OFF the lever located at the top of the screen.
Finally, check out the list of Exceptions and verify that, among these, there are no suspicious sites or sites capable of opening harmful, harmful or unwanted popups. If so, tap on the name of the site in question, tap on the item Popups and redirects and check the option next to the option Block.
The steps to take to block pop-ups on Firefox for Android are quite similar to those seen previously for Chrome. To begin with, start the browser, type the string about: config in the address bar and give Submit, to access the browser's advanced configuration page.
At this point, type the dom.disable_open_during_load code in the search field at the top right, tap the first result returned and tap the item Tax, which appears on the right, to set the parameter value to False e disattivare in popup.
In case of second thoughts, you can activate the display of the same again, following the same procedure seen above but touching, this time, the button Restore.
Verificare i DNS
Another method widely used to make Android and its apps open unwanted Internet sites autonomously, is toalternate in DNS used for browsing via Wi-Fi. For your information, DNS servers take care of "translating" literal addresses into corresponding numerical IP addresses, thus allowing data to move easily across the Internet.
Consequently, it is sufficient to use an ad-hoc designed DNS server to make the Android device display unwanted sites, instead of those on which the user intends to browse.
To verify that the Android DNS have not been changed, do this: first, go to the Settings operating system by tapping the d-shaped icongear located in the drawer, tap on the items Rete and Internet e Wi-Fi and selects the wireless network you are currently connected to.
Next, tap on the icon in the shape of pencil located at the top right, touches the item Advanced options, scroll the displayed panel until you find the wording IP settings and, unless you have not manually intervened on the IP address assigned to the device, make sure that the drop-down menu below is set to DHCP. Otherwise, you fail.
If, on the other hand, you had voluntarily assigned a static IP address to the device, check that in the fields DNS 1 e DNS 2 perfectly legal servers are indicated, such as those of Google (184.108.40.206 and 220.127.116.11) or those of OpenDNS (18.104.22.168 and 22.214.171.124). If there are any suspicious options, immediately change the servers in use, choosing them from those I have presented to you in my list of the best DNS.
When you are finished, I recommend that you go back to the Wi-Fi network selection screen and repeat the same check on all the other saved networks: to be able to do this, make a long tap on the network name without wires of your interest, tap on the item Edit network located in the menu that is proposed to you and follow the same steps seen above to verify, or correct, the DNS servers in use.
As regards, however, the cellular networks, it is not possible to change the DNS in use while browsing, unless you use apps such as Cloudflare's 126.96.36.199 (which, however, uses only its own DNS, more than legitimate) or that the device has not been previously subjected to a root. If the device is unlocked with root, you can use an app suitable for the purpose, such as OverrideDNS, to check the DNS set for data browsing and change them if necessary.
In case of doubts or problems, I invite you to consult my guide on how to change DNS on Android, in which I have treated the subject in great detail.
Other methods for blocking sites that open themselves on Android
Although you have slavishly followed the instructions I have given you in the course of this tutorial, you have not been able to block sites that open themselves on Android? Do not throw in the towel, I still have a couple of useful tips which, in this case, could prove to be decisive.
To begin with, if the root permissions were previously activated on the terminal in your possession, I suggest you delete them, so as to increase the security of the device and prevent apps from showing you sites that you would not want to see.
The methods to disable elevated permissions on Android are different and vary depending on the procedure used to obtain them: generally, it is sufficient to start the app used to obtain root privileges (eg. SuperSU), go to the Settings and select the option forfull unroot. To get more detailed information on the procedure to follow, you can do a short search on Google, using as a key delete root [device brand and model].
If, despite the removal of root permissions, the problem continues to arise, I recommend that you consider returning the terminal to factory settings, in order to resolve the issue at its root.
Clearly, before proceeding, make sure you have created a backup of your data, as resetting to the initial settings results in the complete loss of the data saved in the device memory. For more information on that, you can check out my guide on how to format Android.
How do you say? Did you return the device to the initial settings but, after a few days, the problem arose again? If so, the cause could be to be found in the operating system.
Some Custom ROM, especially those highly customized by little-known manufacturers, could integrate within them a sort of spyware, which can be activated remotely, which allows you to start viewing unwanted Internet sites at any time.
Such spyware, being integrated into the operating system, may not be detected by antimalware, nor by the integrated Play Protect system.
In that case, there isn't much you can do but try to change the operating system, by installing a "cleaner" and more reliable ROM. Unfortunately, this is not a risk-free procedure which, in the worst case, could render the device unusable.
Furthermore, not all Android terminals allow such a replacement, as alternative ROMs to those with which they are distributed may not be available.
In any case, to receive more detailed information about the replacement of ROMs on Android, I refer you to my guide on how to change the Android operating system, in which I was able to explain everything in detail.How to block sites that open themselves on Android