yashsingh1/xdaforums huggingface dataset:
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] chumpalunski:
https://github.com/MotorolaMobilityLLC/kernel-msm/tree/marshmallow-6.0.1-release-athene?files=1

Maybe something there can help? Messing with source is out of my skill group.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] ansong:
Would flashing the oem.img be likely to have an effect on the issue that I'm having where the cellular data does not pick up when I'm out of wifi range? Currently I have to reboot the phone to get data working after I leave my home or office wifi. I'm on the Amazon XT1625 and have unlocked the bootloader and rooted the phone.

BTW, thank you very much Tomsgt. I appreciate everything you've done with the phone.

edit: I see there's an OTA available from Amazon. Is there a changelog or anything associated with it?
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
So I have fully flashed the stock Motorola firmware to my device and pulled the Amazon ota update from another device then tried to load it to my device and this is what I get. This leads me to believe that once you flash the stock Motorola firmware then you are on the ota path from Motorola not Amazon even with the software channel still reading amz.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] ansong:
By that, it looks like my phone in its current (Amazon) state should be able to flash the OTA.zip from twrp, is that right?
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
Adb sideload it from stock recovery
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
Check it out I restored my Amazon OEM.img that I pulled from a friend's device and then I could take the Amazon ota update with a adb sideload from recovery device is fully back on Amazon ota update path
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] _AI_:
you are a beautiful human being
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
check post 3 in this thread i just added a bunch to it

if you want that ota update straight from Motorola here is the firmware
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] xtermmin:
For those curious, the "Software Channel" bar does show up on the non-ad version, but says "retus" instead of "amz"
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
thanks for checking that out. so if i can edit the software channel we should be on motorola ota updates :)
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] MercurioxD:
you are my hero

hey man, you are my hero, I made a spanish video showing how to do it without RSDLite

https://www.youtube.com/watch?v=97oD1gCIpT4 I have mentioned you in the credits. if there anything wrong with that let me know. greetings from Costa Rica
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Morutimeru:
So we can't take ota's when flashing Motorola's firmware ? Right ?

Just flashed .139-48 build on my Amazon G4 and when I go to system updates it shows that's up to date... It's weird because there's a newer build already right ?
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] xtermmin:
Moto might be rolling it out slowly, as I didn't get the update even when I was still on the Amazon bloat ROM.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
thanks for sharing
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
i think i just figure out how to change the software channel :)
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] tmord1:
Sorry for noob question, but I'm a bit confused. I performed the amazon debloat using rsdlite on both of my amazon g4's (both had and still have locked bootloaders) .

1) Can I flash the 'straight from motorola athena.... 49` 1.05gb file using rsdlite without unlocking the bootloader?

2) if yes to question 1, do i unzip the file and what file do i add to rsdlite?

3) If this is possible, will it allow me to get future ota updates from motorola or will they need to be flashed?

I do not want to void the warranty as these phones are for my 2 twenty-somethings and I'd like to get accident insurance if motocare becomes available (have learned from experience, something always happens!) . Thanks for your help!
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
1 yes

2 yes unzip and load the servicefile.xml into rsdlite

3. not sure at this point you will have to flash unless something changes
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
https://github.com/MotorolaMobility...ch/arm/boot/dts/qcom/carrier-channel-ids.dtsi

"retus",	/* 141 */

"???",	/* 142 */

"rcica",	/* 143 */

"wndca", /* 144 */

"dmc",	/* 145 */

"bby",	/* 146 */

"amz",	/* 147 */
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] shouthouse:
Sorry

Hi, sorry if I'm missing something. But I have to return the phone to Amazon and have purchased a new one. How do I return the device to original factory settings. I tried the thing where you unlock bootloader but now I can't seem to relock the bootloader.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Minto107:
Have you tried this command?

fastboot oem lock
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] shouthouse:
Yea, it says "signed oem needed" or something along those lines
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Minto107:
So it needs trusted ROM I guess... your bad luck is that its not available right now(for XT1625 model)
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] shouthouse:
I found a file on the website everyone uses so we will see. Where it stands right now it won't boot into the system, just into the screen that says it's unlocked. If I can't get it to work is there any way to brick it so it boots to a black screen?
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] xtermmin:
http://www.filefactory.com/file/3t2...PJ24.139-48_cid50_subsidy-DEFAULT_CFC.xml.zip

Install Motorola Device Drivers, install Minimal ADB and Fastboot, download that above linked file, boot your phone into fastboot mode, connect phone to computer, flash that file via RSDLite or manually via fastboot commands. After you finish reflashing, boot back into bootloader, open a command line in the Minimal ADB & Fastboot install folder, and then type the "fastboot oem lock" command. (I believe you can only lock if you're running clean official stock)
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] shouthouse:
OMG you're a lifesaver. I am stuck in the car today going to family stuff and I'm stressing far too much about this. I will report back when I can get to it.

Thank you so much!
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
ok so this is a interesting problem.... to lock the bootloader you need command

fastboot oem lock begin
fastboot flash gpt gpt.bin
fastboot flash bootloader bootloader.img

and so on flashing all of the firmware images this will relock the bootloader.

NOTE recommend restoring the deviec without relocking bootloader then once it is fully working relock it by flashing again its a safety messure.

when it comes to restoring the amazon oem.img that is signed this will be a problem because it isnt available anywhere. I have pulled the Amazon oem.img so that people can restore it but it isnt signed by motorola.

also once the bootloader is unlocked it will always say relocked even after locking it.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
these files http://rootjunkysdl.com/files/?dir=Moto%20G%204th%20Gen%20XT1625/Firmware
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] chumpalunski:
Interesting. How do we go about setting it to another channel or do we edit the line to something else then build the kernel and flash it?
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] rodsayd:
There's no way to prove if we will get Motorola's OTA with this? We just have to wait until they release something? I really want to remove the ads but I don't want to lose the software udpates.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
You can always flash the stock firmware to update with the servicefile.xml it's not that hard.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] rodsayd:
I know, it wouldn't be a problem for me but I intend to give away the phone and I'd like to give it "clean", anyway thanks for all your job and for answering.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] jcitme:
Just asking for some clarifications: (thanks!)

So, [MENTION=4246643]Tomsgt[/MENTION], what would be the current best way to modify this phone to remove ads, while keeping the ability to receive OTA updates? Do you know if using XT1625-Amazon-Bloat-Ads-Remover.zip or XT1625-Remove-oem-config-fully.zip still retain Motorola OTA update ability, and if yes, does they receive OTA updates from Motorola or Amazon? (I highly prefer Motorola, since I don't trust Amazon updates to not mess everything up).

Also, what's the difference between using your XT1625-Remove-oem-config-fully.zip, and using rsd-flash with the ATHENE_MPJ24.139-49_cid50_subsidy-DEFAULT_CFC.xml.zip file? Do both/either method allow you to receive Motorola OTA updates?

<edit> Nevermind, I just saw your "How to Remove Amazon Ads on lock screen and Keep ota updates working." post. Thanks! Are those OTA updates from Motorola or Amazon? </edit>

As far as I'm aware, none of the current methods removes the "software channel: amz" label. However, if I can receive Motorola OTA updates, then I don't really care about the software channel if it's just a cosmetic thing.

Lastly, I unlocked the bootloader, but I'm now getting an annoying warning [IMG="the warning"]http://cdn04.androidauthority.net/wp-content/uploads/2015/10/15-1-840x1165.jpg[/IMG]. I searched for ways to remove/hide it, but I only found logo.bin files for the G4 Plus, not the Amazon G4. When I tried flashing that logo.bin file

fastboot flash logo logo.bin

, it complains about

(bootloader) has-slot:logo: not found

. The warning message turns into text "N/A". Does anyone know of instructions on how to hide the unlocked bootloader warning for the Amazon Moto G4 and replace it with something that looks nice?
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] shouthouse:
Those are good questions. Even this would be fine for what I'm doing. I haven't had time to do anything yet but I hope one of these methods will work.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
Wow that is a lot of questions. Lol

First let's start with the unlock bootloader logo problem from your picture. You can use a tool I created last night to flash the logo.bin that removes the warning on boot. http://rootjunkysdl.com/files/?dir=Moto G 4th Gen XT1625

If you use that thread you mentioned about keeping ota updates but removing lock screen ads the you will be on the amz ota update channel. I haven't found a method to change the ota updates to Motorola yet.

You can always just flash the stock Motorola firmware servicefile.xml in rsdlite to update the device on motorolas firmware.

Last the fully remove OEM config file will basically erase the OEM.img so that the device will not be configured by the OEM
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] jcitme:
Thanks!

So flashing servicefile.xml will initiate an online update, or an offline manual update (depending on what stock firmware you have downloaded on your computer). For example, if I have v48 on my phone and the v49 stock firmware on my computer, then obviously flashing servicefile.xml from my computer will update the phone to v49; however, if I have the v48 downloaded on my computer, that means flashing the servicefile.xml won't do anything, right? Or does it activate some flag on the phone that initiates an online update? (I'm a software engineer, but I'm not familiar with android/moto stuff, so bear with me for simple questions).

And "fully remove OEM config" means removing both Amazon and Moto stuff, right? It basically turns the phone to ASOP. Or is that incorrect?
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
Yes you understand the firmware flash from computer correctly and it does have anything to do with ota updates.

Yes it removes both moto oem.img and amz OEM.img meaning that both config is removed leaving a very stock feel on the phone. No aosp but like that
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] jcitme:
Ok, thanks!

Ok, I'm going to stay away from Amazon OTA updates for now. They're actively patching their phones to deter attempts to remove the ads; the $50 Blu R1 HD phone already received an OTA update from "BLU_R0010UU_V6.1_GENERIC" to "BLU_R0010UU_V6.4_GENERIC_6.0_20160710-0015". The OTA update only contained stuff that patched methods of hiding the ads (patched `pm hide`, patched XDA debloater, etc). I wouldn't be surprised if an OTA update for the Moto G4 reapplied the ads, so I think it's either Moto OTA or nothing.

I'm setting up the phone for a sibling, so figuring out a way to enable Moto OTA would be nice.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
I am working on that but I think we will have to edit the uboot partition to do that. I am still researching.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] lllGurulll:
So basically, we need to avoid Amazon updates until you figure out how to force it to Moto software channel.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
No not really with a unlocked bootloader you can always flash to a different firmware it's not a big deal.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] lllGurulll:
I tried this with rsdlite and it never recognized the device. i tried it using the win10 without rsdlite and it looked like it was downloading files and upgrading but then it just came back up with ads again.

EDIT nevermind. I ran it a second time and now no ads. My amazon bloat is still there but no ads.

\

I need to go back through and figure out this bootloader unlocking. The video only seems to refer to old versions. I assume every step still works the same on the g4
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
yes the steps are the same
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] jcitme:
I'm having a weird problem with the Unlock warning logo.bin files.

After you unlock, I get this warning screen: [IMG="default warning screen"]https://i.imgur.com/uRck6uo.jpg[/IMG]

However, if you try removing this message and flashing the phone with a pure black logo.bin, you will not get a black screen. Instead, I got white text "N/A" in the middle of the screen. [IMG="white text "N/A""]http://i.imgur.com/lYndv8o.jpg[/IMG] Here is a closer view of the text, which looks like a blockier, monospaced font: [IMG="closeup of the white "N/A" text"]http://i.imgur.com/zTUsWbK.jpg[/IMG]. After the warning screen times out, and it goes to the normal loading screen: [IMG="normal Moto loading screen"]http://i.imgur.com/oizhpSk.jpg[/IMG]

However, I tried using the logo.bin from [MENTION=4246643]Tomsgt[/MENTION]'s resstore-stock-logo-after-unlock.zip files. This replaced the warning screen with the Moto loading logo. HOWEVER, the white "N/A" text did not disappear! The text is still superimposed on the loading screen: [IMG="white "N/A" text on top of the Moto loading screen"]http://i.imgur.com/xiePC2J.jpg[/IMG]

How do I remove that text?
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] tdude:
I have ran into a issue.. I have unlocked bootloader. And I run the root/recovery script and it reboots into bootloader then to recovery and that is it. It never installed supersu so I try to install it from twrp and then it gets stuck on the white moto screen and then I have to use rsdlite to recover. I have redownloaded the files a few times to see if I had a bad download. I have checked all the debugging settings. Everything looks good it just does not install supersu when running the root batch file.

[//////////////////////////// ////////// //////////////////////]
[/////////////////////////// /// ////////////// ///////////////////////////]
[////////////////////////// //// ////////////// ////////////////////////////]
[///////////////////////// // /////////////// /////////////////////////////]
[//////////////////////// //// ///////// /// //////////////////////////////]
[/////////////////////// ////// ///////// ////////////////////////////////]
--------------------------------------------------------------------------------
[*] Bootloader unlock is required for this to work.
[*] Big thanks to ChainFire for supersu app
[*] Make sure USB Debugging is enabled on your phone
[*] this will push Supersu and then boot into TWRP recovery to root
--------------------------------------------------------------------------------
[*] press any key to start
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
3601 KB/s (4973493 bytes in 1.348s)
--------------------------------------------------------------------------------
[*] supersu is pushed to device
--------------------------------------------------------------------------------
[*] WARNING the device will reboot a couple times this is normal
[*] just sit back and let it do its thing.
--------------------------------------------------------------------------------
[*] press any key to reboot to recovery
downloading 'boot.img'...
OKAY [ 0.410s]
booting...
OKAY [ 0.095s]
finished. total time: 0.508s
error: no devices found
error: no devices found
error: no devices found
< waiting for any device >
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
Wow no idea on that one :) but is it really that big of a deal.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
Your fastboot drivers aren't installed.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] ansong:
Is there a way to flash just the OS, leaving my data and accounts intact?
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Caltinpla:
Check this video out

[youtube]Rf41ls5hF6c[/youtube]
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
Yes use the servicefile.xml in the firmware files to not wipe your data
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] jcitme:
Not a big deal, but just wondering how it can be fixed...

Certainly not a dealbreaker though.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] ansong:
Flashing it now. I'm hoping this will resolve the WiFi to cellular data handoff issue that I'm still having.

I see it flashed recovery.img, I assume it's stock recovery and I'll need to get twrp on there to re-root, correct?

---------- Post added at 02:20 PM ---------- Previous post was at 01:46 PM ----------

It lives! Now to wait for 5 to see if it worked.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
awesome and yes you will have to root again.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] chumpalunski:
/dev/block/bootdevice/by-name/utags

The line is there ro.carrier amz . Idk if we can edit this file without the bootloader getting fubar'd.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] yaconsult:
Please note that requesting a bootloader unlock key from Motorola ends the warranty on the phone when you click the agree button.

Whether you ever unlock the bootloader or not doesn't matter - requesting the key terminates any and all warranty coverage.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] lllGurulll:
Says my device does not qualify for unlocking
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] yaconsult:
That's what I expected to be the case, but others had reported getting an unlock key. Maybe it took them a while to update their database? The phone's build string does reportedly identify it as an amazon version of the phone, not a retail version. The retail versions have "retus" in the build string. Does this phone also have a model number that is unique to the amazon version?
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] xtermmin:
Did you make sure to clean the output of the "get_unlock_data" command or use Moto's data scrub tool? You need to format the code a certain way before Moto will recognize it.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Tomsgt:
i have hash edited the utags file to change this setting but it gets restored after a restart. i think i need to edit both the utags and utags backup partition to get it fully removed but i really am not sure.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] lllGurulll:
Yes, I cleaned it up before submitting.

My model number lists as Moto G4
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] yaconsult:
Go to Settings->About Phone and scroll down to System Version. Does it contain the string "retus" indicating a U.S. retail version of the phone? Or does the version have something related to amazon, azmn, or something like that? If so, it's just like buying a phone from the carrier - as far as unlocking, if it's the amazon version then motorola won't issue bootloader unlock keys just like they won't for any carrier-branded versions of their phones. As far as I know, only retail versions of the phone qualify for bootloader unlocking.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] xtermmin:
Welp, it looks like it's true.

I already unlocked my bootloader, but for kicks, I re-submitted my bootloader unlock request, and I now get back an error saying that the device does not qualify for unlock.

Looks like Amazon pulled an AT&T/Verizon, and told Moto to restrict their branded devices from getting the bootloader unlock key.

For those of us who have already unlocked the Amazon version, be sure to save the bootloader unlock key that Moto sent you, juuuuust in case.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Doukeyakusha:
Bummer, I waited too long :(
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] jcitme:
Good thing I didn't close my terminal from when I unlocked my bootloader from a few days ago, it was an easy scroll up instead of grepping the zsh history.

RIP no more $125 1080p, 2GB ram, almost stock android phone. Maybe if the new Zmax Pro is bootloader unlockable?
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] Doukeyakusha:
What is the option called "OEM Unlocking" in Developer Options? It says "Allow the bootloader to be unlocked" Or would we still need some key from Motorola? New to this particular kind of thing, sorry.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] xtermmin:
You do need to flip that setting as part of the bootloader unlock process, but you still need to use Motorola's website in order to get the actual unlock code.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] lllGurulll:
well crap. If Amazon patches the ability to remove ads then I may just have to send this back to Amazon. If they would just get rid of the lock screen ad I would be fine. I thought this was going to just have ads pop up similar to how texts display on the lock screen. Not be a lock screen itself. Drives me nuts not being able to us echo lockscreen without having two lockscreens.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] matt_man:
So I missed my opportunity to unlock the bootloader. Can I still flash the stock ROM or remove adds? If I flash the stock ROM will I then be able to unlock the bootloader?
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] lllGurulll:
I was able to remove the ads but didn't try installing the stock rom and wiping everything out. I believe the bootloader is tied to the device so even if you had the stock rom it would still not unlock. At least thats how I understand it.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] purokogi:
I already unlocked the bootloader a while ago... will it stay unlocked? Is there anyway to get back the key that I used just in case?

EDIT:

oops I just realized they sent me an email with the unlock code. It comes from donotreply@motorola.com
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] lllGurulll:
I'm really curious what this means for those of us that couldn't get it unlocked. Was hoping at some point to put custom firmware on this device. If that will no longer be possible I'd like to know.
[Moto G4 ROMs, Kernels, Recoveries, & Other Develop] LeifEricson:
Curiously, the Motorola website itself now says to contact Customer support for Amazon editions of the G4. Does this mean Amazon can provide the key for us?