My android phone shuts itself down. It is apparently random, no obvious cause like overheating. It's only begun doing this yesterday. I had the phone since 2013.

What I have done so far is

Let the battery charge down all the way, charge it up to 100%, then see how it goes. This had no effect.

Opened the phone. Took the SD card and the other card and the battery out. INspected the contacts. Waited an hour, put it all back together. This also had no effect.

Any ideas? My area of expertise is Linux software, not phone hardware. Thank you.