Text this: Generalized Komar charges and Smarr formulas for black holes and boson stars