Samsung Galaxy and Google Pixel phones have been affected in what researchers fear is a sophisticated type of cyber attack.