Huawei ENCRYPTED ZIP doesn't export anymore
Pijussad opened this issue ยท 15 comments
Describe the bug
it doesnt export anymore. In output folder is just file Motion path detail data & description and it is empty
Logs
If applicable, add logging and error information from the application.
To enable full logging, add the command line argument --log_level DEBUG when running the program.

Additional context
Add any other context about the problem here.
Huawei apparently has added an extra layer of security by adding a password to the zip file. I will need to adapt the script for it.
In the meantime, you could use your favorite ZIP tool to extract the JSON file from the ZIP file using the password you provided when you requested your data.
Next, use hitrava with the --json option and pass the extracted file.
Quick update: I requested my privacy data to be able to test. I had to provide a password in the Huawei Health app.
Got the data today, but I'm not able to extract the data using the password I provided (tried with a few ZIP tools on Windows and Linux).
If you (or anyone) is able to extract the data from the downloaded ZIP file, please let me know how you did it and with which tool.
I extracted the zip file with 7-ZIP. The system asked the password and right after I put ut, the extraction was made.
I extracted the zip file with 7-ZIP. The system asked the password and right after I put ut, the extraction was made.
Ok, I think I got what you mean. I right-clicked on the zip file, using the 7-zip, and chose the "Extract to ..." option. If you try to copy paste for the zip file directly the data, then an error warning appears.
Hope that helps more!
Th.
I must have mistyped the password twice when I requested the data then...
Thanks for confirming you could succesfully unzip with 7-zip.
I have prepared an alpha version update in a separate development branch that should work with the encrypted ZIP files.
Mind you, I had to work blind on this one, as I don't have a real encrypted ZIP file from Huawei that I can decrypt (see password story above) and I can't request a new one for a while. Chances are it might not work.
Due to the used encryption method, a new installation and conversion procedure was needed.
You could do me a big favor by trying and testing the new installation and conversion procedures (see README) and posting your feedback in this thread.
You can delete your copy on the download page, then the timer to request a new one will reset. It worked for me!
This is the error that I got when I execute this command
./Hitrava.py --zip HiZip.zip --password password --json_export
Info - External library xmlschema could not be imported.
It is required when using the --validate_xml argument.
It can be installed using: pip install xmlschema
2020-10-29 11:06:55,994 - INFO - main - Hitrava version 3.7.0 (build 2010.2901) started with arguments ['--zip', 'HiZip.zip', '--password', '********', '--json_export']
2020-10-29 11:06:55,994 - INFO - main - Running on Python version 3.8.5
Traceback (most recent call last):
File "./Hitrava.py", line 2032, in <module>
main()
File "./Hitrava.py", line 2014, in main
json_filename = HiZip.extract_json(args.zip, args.output_dir, args.password)
File "./Hitrava.py", line 1094, in extract_json
subprocess.call(unzip_cmd)
File "/usr/lib/python3.8/subprocess.py", line 340, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '7za x -aoa "-o./output" -bb0 -bse0 -bsp2 "-ppassword" -sccUTF-8 "HiZip.zip" -- "Motion path detail data & description/motion path detail data.json"'
@zomervinicius Thanks for your tip to re-enable the data request and for taking the effort to test.
Unfortunately I'm not able to reproduce the exact same error you have.
If you want to, you could check the following points (small chance they're not, just to be sure);
- 7za.exe is in the Hitrava installation folder.
- The password is correct. If you manually run the 7za command of the last line from a command prompt in the Hitrava installation folder, does it extract the file?
- The file 'Motion path detail data & description/motion path detail data.json' exists in the HiZip.zip file.
I will try to add some error condition checks (where possible)
Solved in release version 4.0.0
Please read README for updated installation and usage.
Good evening last night I managed to convert my Huawei Health sports activities and I could upload them to Relive. I have only one problem the activities from August to today cannot be loaded, can you solve this problem? Thanks you are fantastic!
@DavSamp - It is 'normal'. It's currently an alpha version and I decided to release it in trial mode only for now. This means that some of the last activities will be greyed out. It's also mentioned in the alpha software notice here.
I'm trying to continue to work on it in my spare time, but due to personal reasons, I am currently unable to spend the necessary time. I thank you for your patience.
See also #32.
