I did exactly like what you did and I finally found this way to solve the problem, it is simple but need you to foucs :
First of all you should have custom recovery (TWRP) , and of course to have this you should unlock you bootloader.
XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality. Are you a developer? | Terms of Service