a long time ago i had o problem when i used 4.1.2 TW rom. the problem was that the lockscreen did not work and when i pressed the power button for 3 secs, the phone restarted directly.
so i repaired everything by writeing these commands in android terminal emulator:
cp /efs/imei/keystr /efs/imei/keystr.bak
echo ON >> /efs/imei/keystr
chmod 0744 /efs/imei/keystr
chown 1000.1000 /efs/imei/keystr
Attention to space and maj ON.good luck