iOS Developer NoisyFlake published a new jailbreak tweak named NoLSPowerDown, with this tweak you can only turn off your iDevice under unlock screen state.
NoLSPowerDown is a good choice for those iOS users who want to limit the iOS lock screen. After installing it on your iDevice, it will take affect at once. But iDevice won’t give you the reminder that “slide to power off” if your iPhone is in lock screen state when you long press the home button of your iDevice.
It is worth mentioning that NoLSPowerDown doesn’t offer users with any configuration options. Although the practical function of NoLSPowerDown is limited, it can be used with PowerDown and other modified iOS jailbreak tweaks.
If you are interested in this tweak and want to try it out on your iOS device then you can download and install NoLSPowerDown from Cydia’s BigBoss Repo. It is available for free and is compatible with iOS 9 and iOS 10 Jailbroken devices.