GurpreetKang / BitwardenDecrypt

Decrypts an encrypted Bitwarden data.json file.
GNU General Public License v3.0
245 stars 30 forks source link

Fix stdout output #25

Open x11x opened 12 months ago

x11x commented 12 months ago

Properly writes JSON output to the file, instead of writing the __repr__ of a Python bytes literal containing the JSON.

Also changes decryptBitwardenJSON to return a dictionary instead of JSON-encoded string, and adds write_json function to handle JSON-encoded output (usingjson.dumpinstead ofprintorTextIO.write`).

Fixes #24

x11x commented 12 months ago

To clarify how this handles output encoding:

This adds an --output-encoding command-line parameter to BitwardenDecrypt.py

On Windows:

On other platforms: