Analytic solution of the resolvent equations for heterogeneous random graphs: spectral and localization properties