Hole-transport-layer-free carbon-based CsPbI 2 Br all-inorganic perovskite solar cells (C−IPSCs) have garnered significant attention due to their low cost and remarkable thermal stability. However, the power conversion efficiency (PCE) is still low. In this study, we observed an inhomogeneous halide distribution in the out-of-plane direction of CsPbI 2 Br films. MAI (methylammonium iodide) post-treatment improved the distribution of halides and enhanced the quality of the CsPbI 2 Br perovskite film through recrystallization. Moreover, the energy level of the device exhibits a gradient alignment, while the control exhibits an energy barrier caused by inhomogeneous halide distribution. This improvement obviously facilitates the extraction of electrons and holes, minimizes nonradiative carrier recombination, and ultimately enhances the overall performance of the device. The device exhibits a high conversion efficiency of 15.21%, an open circuit voltage (V oc ) of 1.34 V, and a fill factor of 73.5%. Additionally, the PCE of the device treated with MAI remained at 75.26% of its original value after 300 h of storage in ambient air without encapsulation.