Charmless charged two-body b-hadron decays to final states containing kaons and pions represent an important test-bed for the Standard Model. The time-dependent $CP$ asymmetries of $B^0\to \pi^+\pi^-$ and $B_s^0\to K^+K^-$ decays are measured using a data sample of $pp$ collisions collected in Run~1, corresponding to an integrated luminosity of 3 fb$^−1$. The same data sample is used to measure the time-integrated $CP$ asymmetries of $B^0\to K^+\pi^-$ and $B_s^0\to K^- \pi^+$.