Court documents show how investigators can track digital activities, and reveal ways to harden journalists’ devices