yashsingh1/xdaforums huggingface dataset:
[Huawei Watch 2] cdkg:
great work! I'll flash tonight and report back . [MENTION=490110]janjan[/MENTION] do you have the oreo factory image or the ota update.zip for the BX9?
[Huawei Watch 2] zekemo:
Will the changes to PM battery saving impact sleep monitoring?
[Huawei Watch 2] janjan:
I have the extracted images.
[Huawei Watch 2] janjan:
The device shouldn't sleep if the sensors are working. I don't know if the sleeping monitoring functioning constantly or in a short period of time..then go to sleep.. I will keep my eye on it and see if it has any impact.
[Huawei Watch 2] maxal:
Same here one link invalid and decryption key needed for the other link
[Huawei Watch 2] janjan:
Seems the links are broken from first thread. Use the one from this thread.

Download-LinkS

Removed. Need to check some issue.
[Huawei Watch 2] billybong10:
[MENTION=490110]janjan[/MENTION] both ROMs gave me error 7 when trying to flash. Unpacked, deleted model info in updater script (first 2 lines) repacked and they flash. Deodexd booted but crashed and then wouldn't boot again. I couldn't get odexd to boot at all. I had to go to work so I flashed Oreo system in fastboot and I'm back on stock Oreo. Will attempt again this evening.
[Huawei Watch 2] janjan:
You have the BT version right? Can you upload the stock images?
[Huawei Watch 2] billybong10:
I have the BT model.

Stock image files:

https://www.androidfilehost.com/?fid=818070582850494249

Md5:66617153710a849c8104c4adb45f2f68

---------- Post added at 04:11 PM ---------- Previous post was at 04:10 PM ----------

The files are listed on filehost under LTE model only because there is no option for BT model. They were in fact pulled from my BT Huawei Watch 2 Classic.
[Huawei Watch 2] janjan:
Thanks. Let me make another. I will probably need someone to test. Can you try to flash the boot.img and report me back. ( Unzip the zip and flash the boot.img via adb/fastboot )
[Huawei Watch 2] billybong10:
Just to be clear...these are the same files I sent you the other day.
[Huawei Watch 2] janjan:
Yes. Would you mind to flash the boot.img and tell me if it Boot.
[Huawei Watch 2] billybong10:
I will as soon as I get home but it won't be for another 7 hours or so.
[Huawei Watch 2] janjan:
Here is a new ROM for the test. Please flash and report me back. I will add tweaks etc later.

https://mega.nz/#!145xlRAT!YTGx_yAshhfLaEFz_N5UK1FuNg1aXs2Bn8LabtkwOeM
[Huawei Watch 2] billybong10:
Got error 7 again. Deleted first 2 lines in updater script and it flashed. Hung on first boot, I let it reboot and then it booted. Working fine.
[Huawei Watch 2] janjan:
Thanks for the report. What is your watch name? Isn't sawfish? Don't know why it mismatch with the device name. There shouldn't any mismatch with name.. Anyway I will remove the 2 lines in script. I am going to work a bit more with kernel and ROM. Test2 will be up soon. Thank you for your time and testing.
[Huawei Watch 2] billybong10:
It is sawfish. Build.prop lists "ro.product.device", "ro.build.product", and "ro.product.name" all as "sawfish" I'm not sure why it keeps throwing a mismatch error either. Has anybody else tried to flash?
[Huawei Watch 2] janjan:
Anyway I will remove the 2 lines in script. Need to work a bit more with kernel and ROM. Test2 will be up soon. Thank you for your time and testing.
[Huawei Watch 2] billybong10:
No need to thank me I'm here purely for selfish reasons. ?
[Huawei Watch 2] janjan:
Download 27/2/2018

NOTE: FIRST BOOT GONNA TAKE SOME TIME. BE PATIENT

Deodexed-OREO-BT-27-Feb-2018

Odexed-OREO-BT-27-Feb-2018
[Huawei Watch 2] Kianush:
I have hw2 sport bt model leo-bx9 and I am willing to test but there are two problems!

first for some reason I "fastboot devices" wont show any devices maybe its driver issue but I cant find the right drivers...

and second, Im a little afraid to mess things up and not be able to revive my watch...its really expensive in my country :((
[Huawei Watch 2] Ciquem:
Flashes but stocked at boot loop, both versions.
[Huawei Watch 2] janjan:
Yes. Driver issue. Don't be afraid. We are here to help. Are you using windows, Linux etc?
[Huawei Watch 2] janjan:
Umm. I need more info and feedback please. Did you wipe before flashing?
[Huawei Watch 2] Ciquem:
Yes, on both versions.
[Huawei Watch 2] billybong10:
Odexed is working. Took a long time to boot and rebooted a couple of times. I just left it and eventually the tap to begin message came up. I'll try the deodexd later today and report back.

---------- Post added at 02:42 PM ---------- Previous post was at 02:40 PM ----------

I've noticed that flashing custom ROMs on this watch is very finicky. Sometimes I have to flash a couple of times. Not really sure why.

---------- Post added at 02:43 PM ---------- Previous post was at 02:42 PM ----------

Mine did that too...I let it loop a few times and then it booted. I wasn't staring at it so I'm not sure how many.
[Huawei Watch 2] Ciquem:
Weird. I waited like 10-12 min and gave up. Will definitely try later. Thanks for the input!
[Huawei Watch 2] billybong10:
Update on Odexed version: put the watch on the charger @ 30% an hour later it still said 30%. Took it off and the charging icon was still on. Seemed like a glitch so I rebooted. No dice. Boot looping for over minutes. Booted into TWRP and battery was showing fully charged so that's not the issue.

---------- Post added at 04:02 PM ---------- Previous post was at 04:01 PM ----------

Dirty Flashed deodexed rom just to see what happens.
[Huawei Watch 2] billybong10:
Deodexed booted flashed dirty over Odexed but ran like crap. I flashed odexed again and it booted also. I'll play with it longer this time and report on how it goes.
[Huawei Watch 2] Kianush:
thanks! yeah Im using windows 10 and I already use fastboot for my Xperia device so I guess drivers are different right?!
[Huawei Watch 2] janjan:
This quide should fix your driver issue.

https://developer.android.com/studio/run/oem-usb.html
[Huawei Watch 2] janjan:
I will try to change the script and see if it helps. Do you mind to extract the update.zip from Oreo? Or anyone else. I can provide more info if necessary.
[Huawei Watch 2] billybong10:
I can do it tonight. I can probably Google how to do it but if you don't mind sending some directions I'd appreciate it.
[Huawei Watch 2] janjan:
No problem. I will PM you later. Thanks
[Huawei Watch 2] janjan:
New ROM is ready for test. steps

1- Boot into twrp

2- Flash the ROM no need to wipe the device

3- Report back

-----------------------------------------------------

TEST 2

1- Boot into twrp

2- WIPE AND FACTORY RESET and flash the ROM

3- Report back

https://mega.nz/#!NpIwyRAQ!TeupCRTrn6wSDyO1WkBijfjqp5vI4Ok7v6UvG2R9YVA
[Huawei Watch 2] Ciquem:
Tried both methods and got stuck at boot.
[Huawei Watch 2] flocke000:
If anybody can tell me what the best way is to backup my stock ROM I will try to flash as well.
[Huawei Watch 2] zekemo:
Install TWRP and back it up
[Huawei Watch 2] janjan:
I patched this with original OTA (update.zip). It should work for everyone now. Please install and report me back. Thanks

Final-Oreo-BT/Classic
[Huawei Watch 2] billybong10:
I keep getting decrypt error and now I've exceeded my bandwidth on Mega. I'll try again later. Just curious, is this odexed or deodexed? Thanks again for working on this Rom.
[Huawei Watch 2] Ciquem:
Flash without any problems. No longers gets stuck at Huawei logo. Now it gets sticks at Android Wear logo and after a short while boot loop and it repeats.
[Huawei Watch 2] janjan:
Odexed. I will make a deodexed one soon. I just want to see/ ensure that everything is working first.

Dirty flash or clean flash?

Flash the stock images and then flash my kernel. Then let me know, how it goes please. I want to know if there is something wrong with the kernel.

You can extract the kernel from the zip and move the boot.img into your adb/fastboot folder. Then use the following.

fastboot flash boot boot.img

fastboot reboot

I will try to find sawfish Oreo source and the compile with another compiler IF there is something wrong with this kernel.
[Huawei Watch 2] flocke000:
Did a factory reset, flashed your ROM and cleared cache & dalvik.

On first boot it bootlooped several times (the Android Wear logo froze and the watch restarted) but finished eventually.

Has been running good so far, will observe it a bit and report back.
[Huawei Watch 2] booba5185:
I'm in the midst of installing the rom now, I'm timing the boot loop, so far I'm at 4 loops and 4 minutes. I'll edit my post when it finally boots up fully.

Edit: 8 minutes, and I stopped counting loops. It seems to be a bit laggy on the initial sync with Android Wear, but I could be just impatient.

Edit 2 (15 minutes later): seems a bit better, but still kind of laggy. I've also noticed that the Play Store doesn't have this device listed anymore. Before, If I was on my PC I could install an app from the Play Store to my watch. it's no longer on that list. It also won't sync up with my Google Fit. I don't know if this is related to the unknown model number or not.

Edit 3: I blame Google. It finally synced after about 30 minutes.

Edit 4: Okay, final update. internal speaker doesn't seem to work with Wear Media. The app locks up, and eventually closes. Works fine with my BT headphones though. Weird.
[Huawei Watch 2] billybong10:
I only flashed boot.img from the Rom, same as the others, boot looped a few times and then booted. Everything seems to work so far. Not sure about the other reported problems with playstore and media app. I'll test later and report back.
[Huawei Watch 2] janjan:
New Update 2/3/2018

- add some missing files

- add busybox

- some other tweaks

- Tweaked/optimized the scheduler to balance the load across all CPUs without any regards to the power costs

- Tweaked the scheduler to reduce/save power by scaling down the frequency of the CPUs or idling them,

- Tweaked to predict the best time to save power on the CPU without affecting performance

- Tweaked for Best Performance

- And many more can't remember

ROMs_Download-Link-[Deodexed BT(sawfish)]

ROM(2/3/2018)

ROMs_Download-Link-[Odexed BT(sawfish)]

ROM(2/3/2018)
[Huawei Watch 2] flocke000:
I got a few observations concerning the bootloops:

They are still present in the new version

They happen on every reboot (not just the first boot after flashing)

Just before they happen the Android Wear boot animation freezes and there is a slight vibration

I was going to try and take logs but when I try to enter the "Developer options" to enable ADB debugging the Settings app just closes.
[Huawei Watch 2] janjan:
I really don't know what cases the bootloops in latest Oreo. It seems the kernel is fine and there is no issue with that. It could be due to vendor image. I need to check the partitions once again. Can some one tell me the output of the following please.

cat/proc/partitions

Or

ls -l /dev/block

Or
[Huawei Watch 2] janjan:
I am going to compile another boot image and see if it helps. The images you extract was unmodified right? I mean you didn't flash/ edit the system.img after receiving the Oreo update.
[Huawei Watch 2] booba5185:
Just flashed the latest, and it does seem to behave better, and Play Store appears to recognize the watch again. The internal speaker still doesn't seem to work with WearMedia though.
[Huawei Watch 2] billybong10:
That's correct. I didn't do anything to watch after the update just booted TWRP, and instantly performed adb shell and DD commands.
[Huawei Watch 2] janjan:
It seems the system.img is missing some files..Huawei was in hurry to release the update for Oreo. Maybe that is why they don't release any update for 4G/LTE. Anyway I am going to compile a new kernel and see it helps. I will upload two new ROMs tonight..one with stock kernel and one with custom kernel.
[Huawei Watch 2] flocke000:
From what I know from my phone the vibration is when the boot finishes and the System UI takes over.

I would love to test your commands, but as I wrote I am unable to enable ADB debugging.
[Huawei Watch 2] billybong10:
This is what I got with ls -l /dev/block:
[Huawei Watch 2] janjan:
Thank you. Do you mind to send me the output of this too.

adb shell

ls -al /dev/block/platform/soc/7824900.sdhci/by-name
[Huawei Watch 2] janjan:
I just compiled another kernel with latest linaro and patched for the Oreo. Do you mind to flash and report me back.

Short changelog

- Fixed/ enabled init.d for future script

- Disabled dm-verity

- Disabled forceencrypt

- Update some driver Qualcomm MSM8909W, should improve the performance and battery usage

- Patched for Oreo

- SMT scheduler enable

- Multi-core scheduler enable/optimized

- Enable/update performance governor, powersave governor - Enable and update ondemand cpufreq policy governor, interactive cpufreq policy governor and conservative cpufreq governor.

- Several other patches to improve the speed and battery usage

Unzip the boot.img.zip and boot your device into bootloader. Then flash boot.img by following method.

-

- adb devices
- adb reboot bootloader
- fastboot devices
- fastboot flash boot boot.img
- fastboot reboot

Download

Kernel-Linaro

Here is the Stock kernel from Oreo

- flash this if the above kernel doesn't boot at all. JUST INCASE

Download

Stock boot iamge
[Huawei Watch 2] flocke000:
Same deal as before. Still bootloops but eventually boots up.
[Huawei Watch 2] janjan:
So you means after some bootloops it boots up and working correct? Actually i am using the sawshark (4G/LTE) source to compile kernel for sawfish (BT model). Since both models are very similar. That is why i use the same source. Huawei doesn't release the source code yet for sawfish model yet.
[Huawei Watch 2] flocke000:
Exactly, it bootloops a couple of times (every time the Android Wear bootanimation freezes and it resets) but at some point it is successful and boots up. After that it is running fine.
[Huawei Watch 2] janjan:
Thank you for the feedback . Do you mind to send me the output of this. Maybe Huawei change some partitions.

adb devices

adb shell

ls -al /dev/block/platform/soc/7824900.sdhci/by-name

OR

boot into twrp

adb shell

ls -al /dev/block/platform/soc/7824900.sdhci/by-name
[Huawei Watch 2] flocke000:
Here you go: https://pastebin.com/eq2Cziq9
[Huawei Watch 2] booba5185:
I flashed the new Boot.img and it's been bootlooping for 20 minutes, and the stock img file won't download (decryption key problem). I'll try flashing the latest entire rom you posted before this.
[Huawei Watch 2] janjan:
Do you have the EU or US model?
[Huawei Watch 2] booba5185:
US, I flashed the most recent zip you uploaded a few posts up (not the boot.img) and it's working again.
[Huawei Watch 2] janjan:
It think there is something different between US and EU version. I waiting for EU images. I will compare EU and US images and see if there is something different. Hopefully find the bootloop issue.
[Huawei Watch 2] booba5185:
Sounds good. I'm off work until Monday at 6:30 PM (It's 11:30AM Saturday here), so I can try something whenever between now and then.
[Huawei Watch 2] zekemo:
So the link in the first post is stable? I am running stock right now, and am just curious about stability.
[Huawei Watch 2] booba5185:
I'm also having problems with Watchface. It seems that whenever I try to change the Watchface, it crashes. I've tried rebooting a few times, disabling (then re-enabling it), then force stopping it, etc. I can't get it to come back at all. Just a grey screen with the time.
[Huawei Watch 2] janjan:
Try to download a watchface from play store. I didn't include the analog watch faces on the test ROM. I will do that in coming ROM. Or install any watch face from following/ include also Huawei watch face.

https://xdaforums.com/android-wear/development/port-stock-watchfaces-various-oems-t3692708
[Huawei Watch 2] JDBarlow:
Hey [MENTION=490110]janjan[/MENTION] thanks again for a great ROM. Is there anyway you could post a link for the Sleep app from Huawei that dropped with Oreo. Thanks again!

EDIT: Disregard. I fixed it in fastboot flashed system.img CHEERS!
[Huawei Watch 2] janjan:
Here is another ROM (EU-version) should work for US too. Please try and let know if there is any bootloops etc.

ROMs_Download-Link-[Odexed BT(sawfish)]

TEST-ROM-EU-Based(4/3/2018)
[Huawei Watch 2] flocke000:
Sadly still the same problems. Bootlooping a couple of times before it successfully starts. And I still can't access the "Developer options" menu in the settings (the settings just close when I press on it) so I can't take logs. Except that everything seems to work fine.
[Huawei Watch 2] booba5185:
Same results here.
[Huawei Watch 2] flocke000:
Could the bootloops be a kernel issue? I noticed that there is no kernel source available for the Oreo release, maybe that's the problem. [MENTION=490110]janjan[/MENTION] Which kernel sources are you basing your kernel on?
[Huawei Watch 2] janjan:
https://xdaforums.com/showpost.php?p=75756545&postcount=272
[Huawei Watch 2] flocke000:
Thanks, and you did the same thing for the Nougat version (using the sawshark sources)? Because it seemed to work there.

Another thing I noticed is that I don't have MTP when using your Oreo ROM (the watch storage is not shown on my PC).

Maybe it's something with the USB kernel driver (because ADB doesn't work as well).
[Huawei Watch 2] janjan:
Yes I did. Both devices are nearly similar. So You mean you can't use adb when you attach the watch to your PC? How did you flash the boot.img and extract images then? The storage will be appears when you use:

adb devices

adb reboot recovery
[Huawei Watch 2] flocke000:
Maybe ADB would work, but I can't enable it because my Settings app just closes when I click on the "Developer options" menu.

I can still manually boot to the bootloader by holding the power button and releasing and clicking again on the vibration on the Huawei logo, so flashing stuff with fastboot is not a problem. And from the bootloader I can boot into TWRP and use it without problem. In TWRP the storage works as well, it's just in the ROM that it doesn't work.
[Huawei Watch 2] janjan:
Does it help if you flash the Stock boot.img? Or try to flash the stock boot image and see if it solve our issue. You can replace the boot.img with Stock one and then flash the zip (The ROM i mean)

I can also provide a new build as boot.img and system.img (As raw images) flashing by adb/fastboot. Sometimes it solve the bootloop issue.

Please report me back if it solve your issue. If it is due to boot.img/kernel then I will take a look and see if if can find a solution for the problem.
[Huawei Watch 2] flocke000:
Currently I am back on stock Oreo just as daily driver.

I am gonna test your suggestions when I find the time.
[Huawei Watch 2] JDBarlow:
I'm in agreement with everything [MENTION=5837930]flocke000[/MENTION] has said. I was to the point where I was having to sideload your ROM because TWRP wasn't recognizing the storage on the watch. I finally fastboot flashed the stock boot recovery and system img's and boots right up now lol
[Huawei Watch 2] Kianush:
[MENTION=490110]janjan[/MENTION] beside the bootloop problem, Unfortunatly I still have the same wifi issue I had with stock rom.

Watch wont find any wifi network and wont actually work!

Now that I have twrp, if I do a clear cache and clear dalvik/art, after rebooting the watch will conmect to wifi and work! But if I turn wifi off and turn it on it wont work anymore...

i think its somehow related to location restriction or something.

Would you help me on how to get logs?

For now Im on stock rom with twrp
[Huawei Watch 2] janjan:
Try to connect to another wifi and see if it is related to your wifi setting or related with your watch. Seems you have the same issue with stock rom too.
[Huawei Watch 2] Kianush:
no you didnt understand, the watch wont find ANY wifi network! yes I have this problem with stock rom also!

but everytime I clear cache via twrp and reboot system, on the first boot wifi is ok! but if I turn wifi off and turn it on again, it wont work anymore! I cant take a video if you need but I dont know how to take logs...
[Huawei Watch 2] ArtaxXP:
Hey Jan,

I know you're still busy with the Wifi-version to work properly, but maybe you could modify the rom, so we can also test it on the LTE-version? That would be awesome!

Keep up your great work!
[Huawei Watch 2] janjan:
Sounds strange it works on the first boot and then stop working. To be clear a bit more doesn't it see and find any other WiFi after you turn off and On the WiFi ? Do you use any automation apps?

adb shell

logcat
[Huawei Watch 2] flocke000:
[MENTION=490110]janjan[/MENTION] I decided to try something that didn't require me to wipe my watch and install everything new:

I downloaded your ROM, extracted the boot image from it and flashed on the stock ROM to try and test if it's a kernel issue.

And it seems that it is because I also got the bootloops with stock and just your boot image/kernel.

Follow up: On the stock ROM adb worked and I was able to take some logs:

Logcat after successful boot: https://pastebin.com/8Hdfb1vw

last_kmsg (kernel log of the last failed boot): https://pastebin.com/j0tRCuAZ
[Huawei Watch 2] Kianush:
I dont know what automation apps are or how to use logcat or adb shell... (noobish...)
[Huawei Watch 2] janjan:
I just re-compile a new kernel and modified some driver. Hopefully it fix the bootloop issue. Otherwise we have to wait for Huawei and Google to release/update the kernel source.

https://mega.nz/#!A14EhSKS!c2t7YzihVxOY8LQN92PSIt4dddj371Z7-ALAymhjfCk
[Huawei Watch 2] flocke000:
Will try tomorrow and report back, thank you :good:

Update: Sadly still bootlooping, I think we will have to wait for Google to release the Oreo sources for the watch.
[Huawei Watch 2] iliketrains:
Mine just got stuck at the Huawei logo. Let it sit for 30 minutes and finally gave up and flashed stock firmware. I want to try this ROM in hopes that the tilt to wake delay is fixed with it.
[Huawei Watch 2] soweic:
"move the build", how do I move while in TWRP?
[Huawei Watch 2] JDBarlow:
You need to move the ROM to the device before booting TWRP.
[Huawei Watch 2] soweic:
I tried "NOUGAT_N7176C [25-DEC-2017]", but it is not for Sawfish. Which one to download?
[Huawei Watch 2] Kianush:
I mistakenly wiped system and then I tried to use twrp to restore my backup but after restoring, the watch wont boot up and is stuck at huawei logo... any idea why twrp does not restore my own backup?!?
[Huawei Watch 2] flocke000:
That is because TWRP doesn't backup the system as an image but instead backups the files in the system partition. When restoring it writes to the system partition which triggers the dm-verity check and prevents Android from booting (at least I think that is what's happening). You could try dirty-flashing the whole ROM again to restore system.
[Huawei Watch 2] Kianush:
well I didnt quite get what you said! but I want to restore my stock rom now, what should I do?!?!

so do you mean twrp backup feature is useless?!!
[Huawei Watch 2] flocke000:
Sadly yes. I haven't found a way to restore system from a TWRP backup so far, maybe there is a way but I don't know it.
[Huawei Watch 2] janjan:
Restore your TWRP backup and flash (flash via adb/fastboot) stock boot image from first thread. It should work for you.

Short.

Restore your TWRP backup and then

fastboot flash boot boot.img
[Huawei Watch 2] flocke000:
Am I right about dm-verity being the issue? I kind of suspect it to be but I'm not sure ...

I read somewhere that TWRP has an option to backup system as image and not only the files, which could solve the issue. Would it be possible to build a TWRP for our watch with that option enabled?
[Huawei Watch 2] Kianush:
thanks but the link for stock boot.img asks for decryption key!
[Huawei Watch 2] janjan:
Restore your TWRP backup and boot into bootloader and flash the following.

https://mega.nz/#!h5wT2QCJ!05VhSDghyIvY-UOpdgyjdVjEMtVuFa-YYIwiiwN-FSw

Let me know how it goes.