Upgrade a partially Downgraded Moto G4 Plus (XT1644) with unlocked bootloader to Nougat


Question

tl;dr: had a problem rooting on Android N, flashed stock M image. Now running unrooted M, but attempts to OTA upgrade to N fail. I'm unable to relock bootloader by reflashing stock. I think this is because Motorola doesn't want users to downgrade. How can I get back up to N?



For the past year I've been using Android 6.0.1 rooted on my Moto G4 Plus (XT1644), the US retail model. This weekend I wanted to upgrade to Android 7.0 and install the security patches.



I made backups of my phone using FlashFire (standard and fastboot), then followed this guide to return my phone to stock and relock the bootloader. It worked, and I was able to OTA update to Android N and install the latest security updates.



I still wanted root, so I unlocked the bootloader again, booted into TWRP, and flashed the Magisk zip. After doing this, the phone would not boot except to recovery.



Here's where I screwed up. I figured I could just start again, and tried to flash the same 6.0.1 stock image. It worked, and the phone is now running 6.0.1, but is unable to install OTA updates. Further, when I try to flash stock and relock the bootloader, fastboot warns me
(bootloader) Invalid signed image
(bootloader) Preflash validation failed

for most steps, and (bootloader) Still require signed boot.img when I attempt to fastboot oem lock. The same happens when I try to restore my FlashFire backup. I believe this is functionality to prevent users from downgrading, although I was able to revert to 6.0.1.



I can't find a stock Android N rom for XT1644, just an OTA udpate I'm unable to install. What steps can I take to get back to Android N, or to completely revert my phone to stock so I can upgrade again.


Answer

You can update to Nougat by downloading stock firmware and flashing it via fastboot. For full guide go to this xda thread.


Method and files will work for XT1640/XT1641/XT1642/XT1643/XT1644.



fastboot flash boot boot.img


fastboot flash recovery recovery.img


fastboot flash dsp adspso.bin


fastboot flash oem oem.img


fastboot flash system system.img_sparsechunk.0


fastboot flash system system.img_sparsechunk.1


fastboot flash system system.img_sparsechunk.2


fastboot flash system system.img_sparsechunk.3


fastboot flash system system.img_sparsechunk.4


fastboot flash system system.img_sparsechunk.5


fastboot flash system system.img_sparsechunk.6


fastboot flash system system.img_sparsechunk.7


fastboot flash modem NON-HLOS.bin


fastboot erase modemst1


fastboot erase modemst2


fastboot flash fsg fsg.mbn


fastboot erase cache


fastboot erase userdata
fastboot erase customize (optional: will erase any customizations if ordered through motomaker)


fastboot erase clogo (optional: will erase the custom boot logo if ordered through motomaker)


fastboot oem lock


fastboot reboot



As you stated in the question that you are unable to run fastboot oem lock begin so skip this command and you will update to android N with an unlocked bootloader.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes