S4 keeps shutting off and some apps do not work such as music

A

AC Question

so every time i turn on my s4 it will work for a bit then out of nowhere it will shut down. I tried factory resetting twice but nothing works. I also cant get it repaired because it has a crack and when i go to repair shops they say sorry cant fix. Is there anything i can do??