Nevertheless, few months back i flashed cm12 and it worked great too.. I had been using it gracefully till i decided to update to cm12.1. So i decided to update, but the update always crashed google play services. The update did not happen automatically so i had to flash the zip through custom recovery (already installed) by myself.
I could not come out of that so i went ahead and did a full wipe and flashed cm12.1 along with gapps. Since then when i am unplugged it goes only to about few minutes (on battery) and shuts down. So, i now decided that this piece of update is buggy and did a full wipe and reflashed the original cm12 zip and gapps which i had placed in the first place. But, to my horror even this time it could not go past the bootscreen even and turns itself off when its about to start up. (Battery is full charged, did an overnight charge as well).One very unusual thing i noticed that almost all the the time i try to power it on it showed me "optimising app X of Y" which is weird. This kinda happens only on first boot.
But if i keep my phone plugged in to ac charge then it works fine.. but only last night it hanged and turned off even on charge. So there i decided that the cm thing is not for me. So i followed this tutorial and flashed the stock 5.1.1 rom (did a full wipe, tried oem lock and re unlocked and proceeded too).
But, i find the same problem same issue!! When unplugged my device, it just turns off even on full battery charge.
Can someone explain me the technical parts of the issue and what has gone wrong and how it can be fixed?
Last time i locked - unlocked bootloader and proceeded with a fresh factory image flash, the device turned off on boot even when plugged in to my mac and it's hot on the back side