Random apps keep installing by themselves

A

AC Question

I tried to Format factory reset but still not working and also i am getting a notification "Unfortunately GPS Speed has stopped working" every second. I am fed up i did hard reset and everything still the Same issue unknown and Porn apps are installing themselves and more. Is there any Solution or Not i tried every thing. Changing Google Password, Un check unknown resources and even factory reset. What could be the reason that its coming again after factory reset