In this paper, a self-healing superhydrophobic smart two-layer coating, ZOA/SMP-S, was developed. ZIF-8 was surface hydrophobically modified by octadecylphosphoric acid (OPA) to obtain Z-OPA and then encapsulated with a corrosion inhibitor, AMT ( 2-Amino-5-mercapto-1,3,4-thiadiazole), to obtain the superhydrophobic nanocontainers, ZOA. ZOA was embedded into the SMP (shape memory coating) to obtain the smart coating, and Z-OPA was sprayed to obtain the second superhydrophobic coating. SEM showed that the scratch coatings were rapidly reduced by scratches after a simple heat treatment. The prepared composite coatings showed excellent performance in corrosion inhibitor release, immersion, superhydrophobicity, and self-healing experiments. The contact angle of the superhydrophobic coating reached 158.2°, and the sliding angle was 2.8°. The low-frequency impedance value |Z|