The tertiary C797S mutation in the EGFR tyrosine kinase domain disrupts osimertinib binding, driving resistance in NSCLC. We designed a series of novel diaminopyrimidine derivatives to establish the interaction with Ser797. H8b potently inhibited EGFRL858R/T790M/C797S kinase with an IC50 of 3.86 nM (30-fold lower than osimertinib) and suppressed both double mutant NCI-H1975 and triple mutant H1975-M3 cells with IC50s of 0.03 μM and 0.57 μM (14- and 11-fold reductions over osimertinib, respectively). Cocrystal X-ray analysis revealed that H8b forms a "two-point tethering" in the ATP pocket with a hydrogen bond between its dichloropropionamide oxygen and Ser797, complemented by a hydrogen bond between terminal N of the piperazine ring and Phe795. Mechanistically, H8b suppressed EGFR phosphorylation and downstream AKT, STAT3, and MAPK signaling, inhibiting proliferation, invasion, and migration. In vivo, H8b achieved 71.15% tumor inhibition in H1975-M3 xenografts. This study identifies H8b as a promising EGFR-TKI overcoming C797S-mediated resistance.