Hi, I had the same problem with my S4. Whenever the phone goes off and I try to turn it back on the annoying 'Warning' Custom os comes on and I couldn't turn my phone on.
I read a few articles and discovered that it has to do with your volume button. I dropped my phone a few days ago and read that if the volume button is stuck that this happens. So I went to the kitchen and go a sharp knife, put the blade to the side of the volume button and pulled it up on both ends ever so slightly, to my amazement, the phone turned on!!! (make sure its plugged in because whilst that warning is on the phone doesn't charge)
Now I have to go and get my volume button looked at because it is a stuck volume key that causes this. It must be a secret sequence that the phone companies use to change an os, not a virus.
Hope that helps.