[Amazfit] lfom:
** WARNING FOR AmazMod USERS **

Current version of AmazMod activates device owner, which disables backup service, for more info please refer to the post below:

https://xdaforums.com/showpost.php?p=78337675&postcount=34

Latest versions of AmazMod don't use device owner anymore, it uses normal device admin so they are safe.

Compatible with macOS/Linux (tested on High Sierra and Ubuntu 16.04) or Windows. Should work with Pace and Stratos running any ROM (tested with Pace running 2.6.0.12). Java is required only for the Export to TCX feature (#12), it should work with Java version 7 and up, so no requirements for Linux and macOS and Windows need Java installed to use the export tool.

This script will backup and restore the data from your watch, including third party installed apps, music, watchfaces and sports data. Please pay attention to the warnings while running it. The backup files are independent, this means that to restore you need to do the corresponding backup first: the Full Backup Restore (#6) will only work if you have done a Full Backup (#1) first, to restore WatchFace folder (#8) you have to do a backup of the WatchFace folder (#3) first, and so on. Of course, if you did a Full Backup (#1) then you already have all the files backed up, except Sports data (it's a system app, so it's separated). The script generates a log file named "amazebkp.log".

The Export Sports Data feature extracts data directly from the Sports app from the watch, and export them as TCX files (and also to GPX for those activities with GPS data) for each activity that can be found in the export folder. The files includes cadence, as in "Run Cadence" or "steps with just one foot". It seems that some services like Endomondo use this standard. If you have any ideas or suggestions about this feature, please share. ;)

- How to run on Linux

Go to the folder with the uncompressed files in terminal and run "bash amazebkp.command", then follow instructions.

- How to run on macOS

Go to the folder with the uncompressed files in Terminal and run "bash amazebkp.command", or simply double-click "amazebkp.command" then follow instructions.

- How to run on Windows

Go to the folder with the uncompressed files in command prompt and run "amazebkp_win.cmd" or simply double-click "amazebkp_win.cmd" (you may not see the file extension in some cases), then follow instructions.

If you find any errors, please provide a link to download your amazebkp.log.

Thanks to [MENTION=6343170]chincheang[/MENTION] for testing in Windows, Andy Gomez for testing on Mac and [MENTION=576939]1immortal[/MENTION] for support.

Amazfit Exporter Python converter: most work by [MENTION=4490876]pieralle[/MENTION] and [MENTION=289999]fzelle[/MENTION], files from this thread:

https://xdaforums.com/smartwatch/amazfit/xiaomi-huami-amazfit-export-data-t3533292

More info about included files, see readme.txt.

PS: on macOS, to keep file permissions, it's recommended to use TheUnarchiver or Keka to uncompress the file, this way you can simply double-click the file to run the script.

You can buy me a coffee or cheesecake (please, no beers :p) using my XDA donation link, or:

- https://ko-fi.com/lfomartins

- most common cryptocoins here: https://freewallet.org/id/87331be5

##### Changelog #####

Version v1.2

- Added export to GPX for all activities with GPS data

- Fixed small bugs and improvements

Version v1.1

- Fixed TCX export for firmware 1.x;

- Fixed cadence calculation in TCX export (slightly modified calculation too, will update the value every 30 points regardless of the last recorded step value);

- Export to TCX now adds some info to the log file;

- Fixed some typos.

Thanks to Grzegorz Bartoszek for bug report and providing files for debug.

Current Version - v1.2

https://mega.nz/#!lawxAbbS!ovOG4bM9hLhfzxY2UpKNO5y26OrmcSsN6yf63pypMO4

SHA1SUM - 8269BC7F2C2BF078AEE6D1EC1B78851B415BBE90

Previous Versions

v1.1

https://mega.nz/#!YKARmQ4K!jhwyRa-bb6SGT0_ZcEPf_g_WRVTMb9S1DRs0mCKIPf8

SHA1SUM - 375A64692B455457652B62E51728F467E373AAD9

v1.0 - https://mega.nz/#!teo11TTQ!N1OeSG5teUdsO1EnNEj4cpavyecR3Ll-sduK6Yc6CBw

SHA1SUM - D069F76714036414C00BC046A53CE9BE0246431B