Newly declassified and released records show in new detail how F.B.I. hackers worked to defeat encryption over a decade before the agency’s recent fight with Apple over access to a locked iPhone.