Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Huawei ENCRYPTED ZIP doesn't export anymore #36

Closed
Pijussad opened this issue Oct 27, 2020 · 15 comments
Closed

Huawei ENCRYPTED ZIP doesn't export anymore #36

Pijussad opened this issue Oct 27, 2020 · 15 comments
Assignees

Comments

@Pijussad
Copy link

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.
Screenshot (418)

Files
Screenshot (418)

Additional context
Add any other context about the problem here.

@CTHRU
Copy link
Owner

CTHRU commented Oct 27, 2020

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.

@CTHRU CTHRU pinned this issue Oct 28, 2020
@CTHRU CTHRU self-assigned this Oct 28, 2020
@CTHRU
Copy link
Owner

CTHRU commented Oct 28, 2020

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.

@CTHRU CTHRU added the help wanted Extra attention is needed label Oct 28, 2020
@CTHRU CTHRU changed the title [BUG] doesn't export anymore Huawei ENCRYPTED ZIP doesn't export anymore Oct 28, 2020
@thgian
Copy link

thgian commented Oct 28, 2020

I extracted the zip file with 7-ZIP. The system asked the password and right after I put ut, the extraction was made.

@thgian
Copy link

thgian commented Oct 28, 2020

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.

@CTHRU
Copy link
Owner

CTHRU commented Oct 28, 2020

I must have mistyped the password twice when I requested the data then...

Thanks for confirming you could succesfully unzip with 7-zip.

@CTHRU
Copy link
Owner

CTHRU commented Oct 29, 2020

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.

Access to the development branch

@zomervinicius
Copy link

You can delete your copy on the download page, then the timer to request a new one will reset. It worked for me!

@zomervinicius
Copy link

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"'

@CTHRU
Copy link
Owner

CTHRU commented Oct 29, 2020

@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)

@thgian
Copy link

thgian commented Oct 30, 2020

Done! It's working @CTHRU!!!!!

@CTHRU CTHRU removed the help wanted Extra attention is needed label Oct 30, 2020
@CTHRU
Copy link
Owner

CTHRU commented Oct 30, 2020

Solved in release version 4.0.0

Please read README for updated installation and usage.

@CTHRU CTHRU closed this as completed Oct 30, 2020
@CTHRU CTHRU unpinned this issue Oct 30, 2020
@DavSamp
Copy link

DavSamp commented Jan 17, 2021

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
Copy link

DavSamp commented Jan 17, 2021

Hello and thank you for the great work you are doing. As you can see from the photo, the system does not allow me to convert the activities carried out from August to today. Can you solve the problem?
Thanks
Screenshot (211)

@CTHRU
Copy link
Owner

CTHRU commented Jan 18, 2021

@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.

@DavSamp
Copy link

DavSamp commented Jan 19, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants