iPhone keeps restarting while not charging
My iPhone 6 restarts randomly and starts boot looping. Sometimes it immediately restarts when unplugged, sometimes it takes opening an app, opening the control center or just doing something in any app. When it is charging, everything works like normal, and it stops boot looping if it currently is. The battery was replaced in 2016 at a third party repair store, and worked until recently. Last December I noticed that the left side of the device was bent open and could not be closed, and inside it looks like the battery is thicker than normal, stopping the device from being closed. I didn’t notice any other damages or anomalies, not even anywhere on the battery. Should I simply replace the battery, or are there any other possible causes?