Measurements of the temperature of the baryons at the end of the cosmic dark ages can potentially set very precise constraints on energy injection from exotic sources, such as annihilation or decay of the dark matter. However, additional effects that lower the gas temperature can substantially weaken the expected constraints on exotic energy injection, whereas additional radiation backgrounds can conceal the effect of an increased gas temperature in measurements of the 21-cm hyperfine transition of neutral hydrogen. Motivated in part by recent claims of a detection of 21-cm absorption from a redshift of 17 by the EDGES experiment, we derive the constraints on dark matter annihilation and decay that can be placed in the presence of extra radiation backgrounds or effects that modify the gas temperature, such as dark matter-baryon scattering and early baryon-photon decoupling. We find that if the EDGES observation is confirmed, then constraints on light dark matter decaying or annihilating to electrons will in most scenarios be stronger than existing state-of-the-art limits from the cosmic microwave background, potentially by several orders of magnitude. More generally, our results allow mapping any future measurement of the global 21-cm signal into constraints on dark matter annihilation and decay, within the broad range of scenarios we consider.