yashsingh1/xdaforums huggingface dataset:
[Moto X Android Development] BrownDog99:
How do you remove motoboot.img and got.bin before flashing? I want to be able to downgrade and I never have removed files before flashing. Thanks
[Moto X Android Development] VitaTaf:
Flashing the motoboot.img and gpt.bin are optional (but is included with the modem files in case anyone wants to flash it). There are also instructions included in the modem zip file.
[Moto X Android Development] VitaTaf:
Here is the patch for wave-to-wake ambient display for XT1053. You will need to enable ambient display in Display settings, after which you will be able to wave over the proximity sensor to activate ambient display.
[Moto X Android Development] Smash2Bash:
And so it only works for ambient not Moto Display? Also thanks a bunch, good work man.
[Moto X Android Development] VitaTaf:
Yes, it only works for ambient display. Moto Display will still work alongside with ambient display.
[Moto X Android Development] mastarifla:
Interesting MotoDoze.apk you have there... turned it into a jar and took a look at the code, so you're basically hijacking the proximity sensor intents and using them to execute a screen power on? Wouldn't it be more practical to modify Moto Actions/Display in order to re-instate the wave to wake?

I'll be digging into it more when I have some time, I've recently created a version of MotoActions that supports the Chop Chop gesture without making any build-prop edits, so let me know if you want me to upload it here and you can feel free to include it :)
[Moto X Android Development] VitaTaf:
Thank you for looking into it. I've tried many times to locate the code that activates Moto Display, but I haven't had any success at all. It will be great if you can find a way modify Moto Display to enable wave-to-wake.

And yes, MotoDoze simply uses the proximity sensor to activate ambient display. For the MotoActions apk that doesn't require the build.prop edit to enable chop for flashlight, it is already in use in the XT1058 AT&T modded ROM, thanks anyway.
[Moto X Android Development] mastarifla:
Did you make the changes and compile the APK yourself? Or did you use the APK that I ended up making? Just curious...
[Moto X Android Development] VitaTaf:
Oh, I'll definitely give you credit if I used your apk, but I compiled it myself quite a while ago. I just switch the ghost and victara values in a b.smali.
[Moto X Android Development] mastarifla:
Oh, I did a bit more than that, I created/used the Titan method (which cant support the gesture), and used that so that way it can be used by both the Moto X 2014 and the Moto X 2013 :)
[Moto X Android Development] zoomy942:
Hi there. I downloaded this and the modem and both failed to install.

Here is the error with the debloated. Is twrp outdated? Bad zip?
[Moto X Android Development] VitaTaf:
The modem firmware is not supposed to be flashed in recovery. You would have to open the zip and follow the instructions included.

As for the debloated version, verify the md5 and try rebooting into TWRP recovery and try again. If that doesn't work, try flashing a different version of the recovery or use a different one (such as Philz recovery).
[Moto X Android Development] mastarifla:
I did some digging today and I think I found where it's located in the KitKat version of MotoDisplay (version 1.5.2)

Under the fd package is MDServiceGlimpse and MDGlimpseActivity, these classes (and the fd package) seem to have been removed in the Lollipop version, these classes also reference the sensor type/class for detecting brightness (I think this is our sensor), under the sensor listener in MDServiceGlimpse you'll see the onSensorChanged method, I think this is the root of the action to wake the screen with the sensor

However, I tried something simple first, I tried using an xposed module to allow me to install older versions of any apks, and I installed the KitKat version of the APK directly, but it doesn't seem to work, which means that there has to be something also in the SLPC Service/System or perhaps the MSP firmware that allows it to function in the way we need it too

I just wanted to provide you with what I found so far, if you have some time I hope this helps! Feel free to let me know if you found anything more that way we can work together to try and find out how to make this work :)
[Moto X Android Development] VitaTaf:
It really helps that you are looking into these; I didn't think about comparing the KitKat version to Lollipop. I have a strong suspicion that a critical part of waking Moto Display is located in libmotodisplayqd.so. I tried decompiling it, but reading machine code is beyond my ability. I believe that MotoDisplay_FWProxy.apk also plays a part in waking the display.
[Moto X Android Development] mastarifla:
Yea I figured if it works for KitKat, what is different about the Lollipop version that would remove it? Then I kinda went from there

Ok, so here is the FWProxy jar... mUpdateBreathingWakeLock looks interesting, along with "com.motorola.motodisplay.MDServiceGlimpse" which is nowhere to be seen in the Lollipop Moto Display... interesting so far :P
[Moto X Android Development] VitaTaf:
Another observation that I've made is that an update to the Motorola Sensor Services (when upgrading or downgrading) causes the wave-to-wake to start/stop working. Also, when the DEBUG value is true, I am not getting any logs at all when Moto Display is activated.
[Moto X Android Development] mastarifla:
I'm not sure I understand, are you saying that when you downgrade your Motorola Sensor Services that you have wave-to-wake working on the Lollipop version of Moto Display?

I wouldn't be surprised if it requires debugging to be on in the main Moto app in order to allow debugging, you could also take a look at apktool's debugging flag when you are re-building, it may help some
[Moto X Android Development] VitaTaf:
For example, if you downgrade to 4.4.2 now, you should get a notification to downgrade or uninstall Motorola Sensor Services (or something similar). And if you upgrade to 4.4.4 afterwards, you should get a notification to update the Sensor Services. Only after you update the Sensor Services in 4.4.4 that the "wave to wake bug" works.

I think that the debugging option can be enabled by modifying the build.prop. I'll have to look into it.
[Moto X Android Development] mastarifla:
Interesting observation, I wonder if using 4.4.4's Sensor Services and an older (4.4.2) Moto Display would allow it to work as well, if so, then a lot of this could be tied to a particular version of firmware, but I think it's a combination, as the Lollipop MotoDisplay doesn't have the brightness sensor in it at all

It may have to do with the keys used to sign the package, as there are quite a few references to "release keys" meaning that it wouldn't really be feasible to debug, unless the code was also in there to check/verify debugging and you just removed it :P

I saw that you would have to enable DEBUG in quite a few places if you haven't already, hope this helps!

Utils->Constants

BuildConfig (motolib, motodisplaylib, motodisplay)

LogUtils (may be what you want here)

Logger (also looks promising)

MDSettingsActivity

MDService

MDSettingsConst

MDAnalyticsEventService
[Moto X Android Development] VitaTaf:
I also think that it is a combination of firmware and Moto Display, that's why it is so frustrating. Motorola really optimized and integrated their codes.

For the debug option, I previously saw these lines of codes in Constants.smali that looks for ro.build.type, and if that value equals to user (which by default it is), the debug flag is set to false (0x0). So in theory, if you set it to anything other than user, debugging should be enabled (0x1).

const/4 v1, 0x0

.line 14
const-string v0, "user"

sget-object v2, Landroid/os/Build;->TYPE:Ljava/lang/String;

invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v0

sput-boolean v0, Lcom/motorola/motodisplay/utils/Constants;->PRODUCTION_MODE:Z

.line 15
sget-boolean v0, Lcom/motorola/motodisplay/utils/Constants;->PRODUCTION_MODE:Z

if-nez v0, :cond_0

const/4 v0, 0x1

:goto_0
sput-boolean v0, Lcom/motorola/motodisplay/utils/Constants;->DEBUG:Z

However, I did find a few lines of these:

.field static final DEBUG:Z = false

which could mean that other debug options cannot be enable through the method above.
[Moto X Android Development] mastarifla:
You are using JD-Gui to look at the java classes correct? If not, then you may have a hard time with the smali alone, you can also use dex2jar to create a jar file from the classes.dex and then view the jar file with JD-Gui

Then, you can use JD-Gui to save the sources to a zip file, which in turn outputs the code to .java files, which you can then search through to find various keywords like DEBUG, which is what I did when I came up with that list of classes :)

Correct, there are multiple DEBUG variables in the apk, the list above is the classes that have the DEBUG variable where it is defined/instantiated, you would need to go to each of those classes and turn them to true, then it may be possible to see the debugging logs :)

If not, then I am not sure, it then may have to be something deeper...
[Moto X Android Development] VitaTaf:
I did use JD-GUI to read the jar file that you attached, but to be honest, I am more familiar with reading smali code than java. I'll modify those variables and take a look at it later. Thanks again for looking into it.
[Moto X Android Development] rice923:
Same problem with the modded Verizon version. I'll try Philz recovery and report back.
[Moto X Android Development] abacate123:
Hello [MENTION=5573353]VitaTaf[/MENTION] can you please think about uploading a modded version of the XT1058 Retail Brazil? Would be glad. :)
[Moto X Android Development] fyrmd:
Do I need to have the small update Verizon sent out in June installed on my phone for this to work?
[Moto X Android Development] mastarifla:
Download the Modified Version for AT&T and check which files are different from your Debloated XT1058 Retail Brazil, then replace the files in your Debloated zip with the modified ones that were different, and you now have a modified version for Brazil :)
[Moto X Android Development] VitaTaf:
You can follow the guide here (changing the ro.product.name to victara_retail in build.prop).

Great! Let us know how it goes.

From what I have read, as long as you do not clear modemst cache, you should not loose your unlocked status. But if you do, it seems that unlocking it again is rather straightforward.

I do not have a Sprint device, so I am not able to test. You could make a TWRP backup and restore it later if it doesn't work.
[Moto X Android Development] St.Noigel:
Still have cellular standby battery drain, but in other its the best 5.1 Moto X stock for now )
[Moto X Android Development] mringis:
Can't flash from aosp rom. Do i need to revert back to stock first? How about coming from stock 4.4.4? or it must from 5.1 stock?
[Moto X Android Development] PrayerInc:
Whats different between modded version and debloated?

Rt
[Moto X Android Development] Saythis:
Read the first post.
[Moto X Android Development] VitaTaf:
Coming from stock 4.4.4 should be fine, although if you do encounter any problems, a factory reset may be necessary.

Check the additional features stated under the modded version.
[Moto X Android Development] bushako:
Is it okay to dirty flash the latest moded rom over the previous debloated one? It's really time consuming restoring and setting up everything all over again. Or does it wipe data?
[Moto X Android Development] VitaTaf:
Yes. There shouldn't be any problems. Just remember to clear the dalvik cache.
[Moto X Android Development] LPMatt:
Can someone test Bluetooth connectivity on this ROM? I've heard there is a bug in LP that messes with BT.
[Moto X Android Development] VitaTaf:
If you are talking about Bluetooth audio playback or file transfer, I haven't had any problems with it.
[Moto X Android Development] chaoslimits:
Does anyone experience the "Optimize on Boot" bug on xt1060? That was an issue, at least for my xt1060, on the leaked builds.

Thanks
[Moto X Android Development] VitaTaf:
Did you clear the dalvik cache after updating? If you have, have you tried to factory reset after updating?
[Moto X Android Development] peregon2:
what about Ad-blocked, and update for it?

Xposed flashed, but I can't find in apps
[Moto X Android Development] VitaTaf:
The adblock is located at /system/etc/hosts. You can still update it using apps such as AdAway.

The Xposed zip included is just the framework. You may download the app here.
[Moto X Android Development] peregon2:
Ok,

if I usually use adguard (not adaway) I need to first restore original host?

where to get?
[Moto X Android Development] VitaTaf:
You most likely do not need the original hosts file, but I've attached it just in case there are any problems (remove the .txt extension).
[Moto X Android Development] peregon2:
many thanks !! ;)
[Moto X Android Development] chaoslimits:
I did not try a factory reset after updating but I always clean install.
[Moto X Android Development] vasili_defy:
So the repeated question, can we use this on xt 1052 and flash modem differently?:D
[Moto X Android Development] bushako:
Thank you it works very well no issues so far. One thing though..in the lockscreen i dont see the google search icon on the bottom left like on Android M. Its not an issue really but just curious why it doesn't show.

---------- Post added at 02:34 PM ---------- Previous post was at 02:33 PM ----------

I believe you can flash this on any version since it only contains boot.img and the system files. As long you flash the right modem that works on your device model you should be alright.
[Moto X Android Development] mastarifla:
Edit: Oops, just downloaded the modified Verizon, and it doesn't have a file_contexts in the root, looks like he uses a different verification script for the Verizon version, maybe that's why it's messing up, I'll look into it a bit more

Ok, if you take a look inside the zip at XT1060_5.1_VERIZON_Modded.zip\META-INF\com\google\android\updater-script you'll see that it does the symlnk fairly early on in the process, so at this step in the process it is trying to make soft links on the device, so it seems to fail when trying to create these soft links, you can add more ui_print statements to try and narrow down the file that it cant link, that seems to be your best option
[Moto X Android Development] VitaTaf:
XT1058 Retail Brazil Modded ROM is uploaded.

No, you should be able to install this ROM right away.

I guess I misunderstood how symlinks work. I thought that it doesn't require the files to exist before making the symlinks. How would I make those symlinks from /data to /system if /data doesn't have any files yet (after a factory reset).
[Moto X Android Development] mastarifla:
No I think I'm probably wrong on this one, I didn't look into how symlinks work, I just assumed the first parameter is the input and the second is the output for a copying action, but it looks like this isn't any kind of copying process, as the first parameter seems to be the target path and the second parameter is the link path...

So in the case of the following symlink...

symlink("/data/misc/audio/mbhc.bin", "/system/etc/firmware/wcd9310/wcd9310_mbhc.bin");

The file originally resides at /data/misc/audio/mbhc.bin and a new soft link is wanting to be created at /system/etc/firmware/wcd9310/wcd9310_mbhc.bin but where does it get these files if they are not in the system folder inside the zip? From the updater-binary? From the device itself?
[Moto X Android Development] VitaTaf:
The files themselves are located in /data/misc/audio/, and their symlinks are located in /system/etc/firmware/wcd9310/, so it seems that wcd9310_anc.bin and mbhc.bin in /data/misc/audio/ are created during the first boot after a factory reset. As to where those files come from, I have no clue.
[Moto X Android Development] mastarifla:
Hah I confused myself again, you're right

The files initially resides in the /data/misc/audio/ and the symlink to it is in the /system/etc/firmware/wcd9310/, OK got it now, which means that the file would already have to be in /data/misc/audio/ in order to create a link to it, however take a look at the symlinks for system...

symlink("/system/lib/libMSPUpdater.so", "/system/priv-app/MSPUpdater/lib/arm/libMSPUpdater.so");

So in theory, should there be a file in the zip at system/priv-app/MSPUpdater/lib/arm/libMSPUpdater.so or on the phones /system already? I think this is where I am getting confused now
[Moto X Android Development] VitaTaf:
It's alright; think of symlinks as Windows shortcuts. This is the syntax for symlinks in the updater-script: symlink("existing_file","destination_link"). That means libMSPUpdater.so should already be in /system/lib/, and /system/priv-app/MSPUpdater/lib/arm/libMSPUpdater.so (which doesn't exist in the zip) is the link (like a shortcut).
[Moto X Android Development] mastarifla:
Alright, I think I get it now, cool!

I've attached a modified updater-script that groups the the symlinks into sections, this should help determine where the symlink is failing, I could have had one for each file, but the logging statements would be kinda crazy at that point
[Moto X Android Development] nexus7lte:
xt1060 vzw dev. It works!!! Thanks so much! every ROM i tried was slow and laggy after a few weeks. I will repost how this "official version" works. Heres what i did:

backed up my data while

Downloaded modded app to computer then transferred to root of phone via usb cable in windows 10 explorer

rebooted to recovery

flashed file

did factory reset

went to reboot, twrp latest offered to install supersu, i said yes but it never confirmed

it rebooted to system, saw the moto world boot animation, saw the big red vz logo for a long time, got scared, took a cold shower

when i got out, phone was ready to set up! logged in, restored apps, BUT NO ROOT / SUPERSU

enabled dev options, enable adb and allow unathorized apps install

plugged in phone to computer, ran adb, accepted prompt on phone, ran adb reboot recovery

phone rebooted to twrp, flashed supersu 2.46

rebooted- have working 5.1, working root (supersu,busybox,twrp app), and DID NOT LOSE my downloads/data

Now, where is the build.prop edit for hotspot? tether isnt shown
[Moto X Android Development] Travisdroidx2:
http://xdaforums.com/showpost.php?p=62837796&postcount=8
[Moto X Android Development] hachamacha:
Thanks for the report! Very cool. Did you flash the radio*.zip file as well or go with the old one? (Just curious).
[Moto X Android Development] tallgrasshawk:
Will the wake to wave patch only work on the XT1053 where it's posted under. Or should it work on any model of the phone. Specifically the XT1055.
[Moto X Android Development] VitaTaf:
Try this first. Let us know how it works!
[Moto X Android Development] tallgrasshawk:
Nothing. Don't see any change, no option anywhere.
[Moto X Android Development] VitaTaf:
Did you enable Ambient display in Display Settings?
[Moto X Android Development] tallgrasshawk:
Ah. That works. I thought this mod was for moto display, not for the baked in ambient display. Can it be turned on for the Moto display?
[Moto X Android Development] VitaTaf:
No, unfortunately it is not possible at the moment.
[Moto X Android Development] tallgrasshawk:
That's a bummer. It's a nice feature to have fixed.

Isn't the chop flashlight just a build.prop edit?
[Moto X Android Development] VitaTaf:
Yes, it could be. Look here.
[Moto X Android Development] tallgrasshawk:
Boom. Worked like a charm.
[Moto X Android Development] nexus7lte:
It doesn't work. Tried inserting it in the middle, saved, again and at the end, reboot, tried again no luck. Did this actually work for you with the file listed in the op?

I am on original radio, didn't want to mess around too much yet.
[Moto X Android Development] Travisdroidx2:
I am on 5.1 Verizon developer edition with root. I went into root explorer and opened my build prop with text editor, added that one line to the bottom of the build prop. Hit save, rebooted and it works great. No issues at all.
[Moto X Android Development] ThunderBolt_BR:
Hi [MENTION=5573353]VitaTaf[/MENTION],

Thank you for this ROM. I installed the modded version today on my XT1058 without issues. It was nice to see how clean and optimized it was. Let's hope I can get a better battey life than CM or AOSP with it.

I am here to make a small request: Motorola Brazil has released an update to the ROM that you used as base to XT1058 (222.21.15) basically with stagefright corrections. The version number was bumped to 222.26.7.

Is it possible for you to make a new modded version based on this last build? Thanks a lot for your work!

[]'s
[Moto X Android Development] CsR0501:
+1

Sorry... And thank you for your great support [emoji1]
[Moto X Android Development] nexus7lte:
Are you using this "official" Verizon release listed at the top of this post or a ROM that is 5.1? I never had an issue with the ROM tether but it will not work here with this one and I don't know why. Everything looks fine
[Moto X Android Development] rice923:
Did exactly this and so far I'm at the step of waiting for the big red Verizon boot screen. Seems like my mistake the first time around was doing a system/data wipe prior to flashing the ROM. Still waiting as I'm typing this. Fingers crossed!

Edit: Things are booted up and running so far. Like mentioned prior, all data is in tact and haven't run into any problems yet. So far so good!
[Moto X Android Development] Travisdroidx2:
I am using the official 5.1 from OTA.
[Moto X Android Development] mastarifla:
This explains the problem, as if the files to be symlink-ed are not in the data folder, then it will be impossible to create links to them :)
[Moto X Android Development] PrayerInc:
Will you make a 1052 Modded?
[Moto X Android Development] bisbers:
XT1060 (Verizon) - Can anyone confirm if speakerphone works?
[Moto X Android Development] Travisdroidx2:
Did you upgrade your modem? I know the GSM port build would have broken speaker phone for not having the 5.1 modems.
[Moto X Android Development] bisbers:
Originally no, was on the 4.4 radios.

Just tried to flash the modems in the OP, got bootloop. Was afraid to flash motoboot gpt - if I upgrade the bootloader will it lock? Also would I be able to install KK rom? (Currently sunshine unlocked).
[Moto X Android Development] Travisdroidx2:
I ay be wrong but historically you can not revert your Android version once the bootloader or gpt.bin has been updated.
[Moto X Android Development] bisbers:
Bootloader version or Android version in general? And will bootloader still be unlocked?
[Moto X Android Development] Travisdroidx2:
Bootloader and gpt.bin both usually can NOT be reverted without a chance of a brick.
[Moto X Android Development] roeblatt3:
I upgraded the bootloader on my XT1060 Dev Edition last night and bootloader is still unlocked.
[Moto X Android Development] Travisdroidx2:
Yes upgrading to 5.1 will not lock your bootloader.
[Moto X Android Development] nexus7lte:
this is why Im afraid to flash the latest radios. Cell service is good but NO SPEAKERPHONE, bluetooth has trouble switching from one device to another. Will flashing the radio help speakerphone and bluetooth?
[Moto X Android Development] Travisdroidx2:
In my experience it is usually good to be on the latest radio. If it doesn't work well you can always flash the old ones. The 5.1 radios are working fine for me.
[Moto X Android Development] bisbers:
Upgraded the bootloader and now speakerphone works correctly. Thanks for the help!

---------- Post added at 03:18 PM ---------- Previous post was at 03:17 PM ----------

I gave in and flashed the bootloader and radios - speakerphone working as expected (havent tested bluetooth yet).
[Moto X Android Development] rice923:
Speakerphone does not work for me.
[Moto X Android Development] jco23:
trying to flash the modded version now (coming from Nexus Experience ROM). about how long should it take to get to the boot animation? been about 15 minutes so far....