Yes, a factory reset does remove the offending app from a device. However, you’ll want to back up the rest of your data onto a cloud because a factory reset also removes other data with it.