Apple has secured a major legal victory after a federal judge threw out the majority of claims in a proposed class action lawsuit targeting the AirPods Max.