Adaptive Resilient Control of Cyber-Physical Systems Under Actuator and Sensor Attacks