Xiaomi, China’s largest smartphone maker, has been accused of shipping products riddled with security flaws.