[Droid RAZR M Q&A, Help & Troubleshooting] DragonFire1024:
[Tutorial] Flashing CM 12.1 custom ROM (Lollipop 5.1), SuperSU and Xposed Framework

***REQUIRES UNLOCKED BOOTLOADER***

If you don't want to downgrade your XT907 to a JBBL (Jellybean bootloader) then follow the tutorial below to flash the CyanogenMod 12.1 (Lollipop 5.1) custom ROM, SuperSU and install Xposed Framework onto your UNLOCKED XT907. This is for the KitKat BOOTLOADER ONLY.

WARNING: I am not responsible for any damage you may cause to your device and or other individuals. Use this guide AT YOUR OWN RISK.

1) Please download the appropriate folder labeled 5.1-Android-CM12.1-KKBL from my Google Drive link.

2) Make sure to have the appropriate Motorola and ADB drivers installed or this will not work.

3) Power off your phone.

4) Now press and hold, all at the same time, volume down + volume up + power button for 5 seconds. Release the power button first and 2 seconds later, release the volume buttons.

5) You should now be in your recovery screen. Use the volume down button to navigate to AP fastboot and press volume up to select it.

6) Now plug your phone into your PC. Make sure to have a good cable.

7) Now open the folder you just downloaded from Google Drive. Extract the file named TWRP-KKBL-XT907.zip to the same folder, or your desktop (whatever is easy for you).

8) Open the folder you just unzipped and place the file 'recovery.img' in the same folder as ADB.

9) Open an ADB command window (right click on your opened ADB folder and select 'open command window here') and type fastboot devices. This will show you if your device is properly connected. If you see a serial number and the word 'device' next to it, continue to the next step.

10) Now it's time to install a custom recovery. Type in the following code below. Make sure you placed the recovery.img into your ADB folder.

fastboot flash recovery recovery.img

11) You will see about 3 lines of errors. Just ignore them. When the process is complete (you'll know it's done when you see something like C:\) type the following line below:

fastboot reboot

12) Please keep your phone plugged in. When it's finished rebooting, in the ADB window type:

adb reboot recovery

13) If all goes well, you should have TWRP custom recovery properly installed on your XT907. You will see a list of several things. Now we are going to flash CM 12.1 to your device. Keeping your phone plugged in, you should be able to freely move files while in TWRP recovery. On your desktop PC click: start > computer > XT907 > Double click internal storage. (NOTE: If you can't move files in recovery, reboot normally and place the files into your device's internal storage manually as described below).

14) Go back to the folder you downloaded earlier and copy the file labeled cm-12.1-20160822-NIGHTLY-xt907.zip. Paste it into the INTERNAL STORAGE of your device. DO NOT place it in any other folder or directory. Again go back to the folder you downloaded earlier and copy the file labeled open_gapps-arm-5.1-nano-20170830.zip. Also paste it into your phone's internal storage (the same place as the CM file).

15) Now on your phone, from TWRP recovery main screen, tap 'wipe'. Now look at the bottom where the arrows are. It should say 'swipe to factory reset.' Please swipe the button. When it's finished, go back to the TWRP home screen and tap 'install'. Navigate to where you placed the CM12.1 file and select it. Now tap 'Add more zips' on the screen near the bottom left. Navigate to the open_gaaps file and select it. Look at the top of the screen and it should say you have '2 of max of 10 files queued'. If so find the arrows at the bottom where it says 'swipe to confirm flash'. Go ahead and swipe it.

16) When the process is finished (it might take a minute or two), from the TWRP home screen, tap 'Reboot' and select 'System'. Your phone will reboot. The reboot process can and usually will take SEVERAL minutes to complete the first time. During the reboot process, DO NOT TURN OFF YOUR PHONE or attempt to reset it. Just let it go about it's business. In about 5-8 minutes you should have booted to your new custom CyanogenMod 12.1 (Lollipop 5.1.1). Go ahead and continue with the setup process.

Flashing SuperSU and installing Xposed Framework

1) When done with your general setup, navigate to the folder you downloaded from Google Drive earlier. Copy the file labeled SuperSU-v2.82-201705271822.zip and paste it into the internal storage of your device (The same place as before). If you've been successful up to this point, you can delete the other zip files you added to your device earlier.

2) Use ADB to reboot to recovery. From TWRP home screen tap install and navigate to the SuperSU zip file you just added and select it. Now go down to the arrows at the bottom and please 'swipe to confirm flash'. When the steps have completed, go back to TWRP home screen and tap reboot then system. SuperSU (Super User) is now flashed to your system and you are now ROOTED. With Wifi on, you can go to the Google Play Store and download the updated SuperSU app. When installed, open it and it will ask you to update the binary. Please install using the 'normal' method. If successful, allow SuperSU to reboot your device.

3) If you would like to install the Xposed Framework onto your phone, you can follow the guide here. Also available at the link are the files to install Xposed. You can also use the ones I provided inside the folder you downloaded from Google Drive earlier. They are the same files as in the guide linked in this step.

If you have any trouble or if I missed a step, please post comments. Also post success stories so I know I did something good!