[Moto G Android Development] nlra:
I own an actual, honest-to-gosh Moto G GP Edition phone from the U.S. Google Play Store. I can confirm that even though the bootloader is the same -- bit for bit -- as a regular Moto G bootloader, the GPE version does *not* require you to get a code from motorola.com in order to unlock the bootloader of the phone. All you have to do is run 'fastboot oem unlock', select "Yes" on the phone screen, and it will be unlocked.

What this tells me is that Google and Motorola had planned to release a GPE version all along, since the introduction of the phone, and this single version of the bootloader can change its behavior depending on whether it detects that it is running on true GPE hardware or not...it was designed to be able to do so from day 1. I don't know what it is looking for, given that the SKU is the same between GPE and Global editions (XT1032); however, I will note that the 'cid' value returned between different XT1032 phones varies depending on where they come from. Here is the pattern that I think I have detected:

cid 0x0007 == XT1032 from Europe (e.g., I have seen this on both UK and DE/German versions)

cid 0x0009 == XT1032 from Motorola USA

cid 0x00DE == XT1032 from Google Play Store USA

It is conceivable that the Moto G bootloader does not require a valid motorola.com code to unlock if it sees it is running on a phone with a cid value of 0x00DE. I'm not sure what cid stands for ("carrier ID" maybe??).

-- Nathan

---------- Post added at 08:14 AM ---------- Previous post was at 08:01 AM ----------

Just because you are getting invalid signature errors during flashing and cannot relock your bootloader does *not* mean that the images are not properly signed. They *are* signed, and I can tell you this for a fact because I own a genuine GPE Moto G, and I can relock my bootloader after flashing the official GPE image, and I do not get "invalid signature" errors during flashing, either.

Presumably the reason you are having problems is because Motorola surely signed the GPE and various non-GPE versions of the XT1032 firmware with different sets of keys, and you are trying to flash the GPE firmware on a non-GPE phone, and the bootloader on your non-GPE phone is expecting the firmware that you flash to be signed with different set of keys than the GPE firmware is signed with. The keys don't match, so the signature is counted invalid, just as if it wasn't signed at all.

I bet if I took any of the official non-GPE firmwares out there for the XT1032 and tried to flash them to my GPE phone, I would also see "invalid signature" errors during flashing and be prevented from relocking my bootloader, same as you.

Some phones in certain regions of the world appear to be able to cross-flash stock images from other markets, but this appears to be limited in scope to certain geographies (e.g., a retail German XT1032 can successfully flash the retail UK firmware with no signature errors and also be allowed to re-lock afterward). As I made mention in my previous post (above), I strongly suspect this is related to CID. All of the retail XT1032 phones sold in Europe with unlocked SIM slots (ones sold direct to consumers outside of a carrier, like from Amazon) appear to share the same CID amongst each other (0x0007), and my guess is that all phones with the same CID use the same signing keys for their stock ROMS. The GPE phone has a different CID (0x00DE), and thus its ROM would be signed with a different set of keys.

-- Nathan