[Moto G5 Questions & Answers] K3n H1mur4:
Hey everybody, here's my story: I bought earlier today a second-hand G5, it was already soft bricked when I purchased it. It was already unlocked (had the warning message when turned on), so I first proceeded to install TWRP, try and flash a custom ROM.

Everything was working fine on bootloader mode, phone was snappy (more on that in a bit) and not lagging.

Then the issues started: on TWRP, it took ages to do anything. The phone's boot logo lasted almost a minute, then TWRP's splash screen stood there for over another minute, and each action I made in it (like touching options on menus and stuff like that) needed a good 10+ seconds to be processed. Tried formatting data, changing FS to from F2FS to EXT4, and other stuff like that, nothing solved the tremendous lag. I also faced some random reboots and many USB disconnecting/reconnecting episodes (like one per second, sometimes) at TWRP as well. Getting the phone to boot TWRP is also a pain, because it keeps switching between a bootlogo with "N/A" (as if there is a custom ROM/recovery installed) and a bootlogo with "bad key" (as if bootloader is unlocked, but ROM and recovery are stock), remains a few minutes in each, and eventually it decides to boot up on TWRP.

Eventually I just gave up and flashed a stock firmware using both RSDLite and fastboot. Flashing times were just about alright, as was everything done via bootloader mode, no stuttering here. Stock recovery (which is operated via volume/power keys, not touch) seemed to work without speed issues as well.

At some point (after many failed efforts, reboots that went straight to recovery, wiping everything multiple times using both TWRP and stock recovery, and so on) I managed to start booting it and... It was sluggish as hell. The boot animation took around 10 minutes to complete (not looping through the animation multiple times, it was just really slow, and it actually just showed about 2 or 3 frames from different moments of the animation and stuck in these frames for several minutes each), the "Hello Moto" tone also played very slowly (as if I were streaming it in 1080p using a 256kbps modem), and when it reached the Lenovo logo (which I presume is the last stage in the boot animation), it bootlooped back to the first frame (Motorola's logo, same as the splash screen but without the "bad key" or "N/A" warning - I had changed from that annoying "bootloader unlocked, device can't be trusted" screen by flashing a modified logo.bin, thus the only difference between splash screen and bootanimation's first frame was the abscence of the text), did so a few times (I think I let it run that way for about 40 minutes) before battery got depleted. Never got into OS.

I did run into a few secondary issues (tried to relock bootloader then unlock again just to find that I couldn't get an unlock code from Motorola's site; had it booting straight into recovery; couldn't wipe data and cache, had TWRP ask for encryption key; etc), but managed to solve all of them.

The point is that right now I have a phone that I can boot either TWRP or stock recovery, or go into bootloader (or sometimes bootloop whilst taking 10 minutes to display the boot animation), but TWRP is slower than a Celeron rendering GTA V, barely usable. Flashing custom (through TWRP) or stock (through fastboot or RSDLite) ROMs seem to complete successfully, but they never get to boot.

If there's any difference, I don't know which version the phone was when I purchased it, but right now bootloader is B8.31, and I tried flashing both 16-2 then 16-4 Oreo versions. Phone model is 1672.

Any help is appreciated, I bought this phone as a gift to my girlfriend and it's specially frustrating I didn't manage to fix it for her.