Polyaniline (PANI) is a promising organic cathode material for electrochemical batteries. Its specific capacity is limited by irreversible formation of pernigraniline base, and its energy density is limited by the voltage which could be improved. We present an ab initio study of PANI and PANI functionalized with functional groups which lead to increased voltage and stabilization of the pernigraniline salt. Specifically, the oxidation potential achieved by functionalization with CN on the nitrogen is computed to be 1.3 V higher than that of pristine PANI oligomer, leading to a higher voltage, and the formation of the pernigraniline base is predicted to be simultaneously suppressed, leading to a higher reversible capacity. Therefore, functionalized PANI could be a promising candidate organic cathode for Li-ion batteries.