You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def main(argv=None):
import glob # Add this import here
parser = argparse.ArgumentParser()
parser.add_argument(
"-o", "--output-dir", default=os.getcwd(), help="change output directory for decrypted files [%(default)s]"
)
parser.add_argument(
"gmail", help="The gmail address on your phone when the files were encrypted"
)
parser.add_argument("files", nargs="+", help="File(s) to decrypt")
if argv is None:
args = parser.parse_args()
else:
args = parser.parse_args(argv)
# Expand wildcard patterns
args.files = [f for pattern in args.files for f in glob.glob(pattern)]
ext = ".dm"
failed = []
for file in args.files:
if not os.path.isfile(file):
print(f"File not found: '{file}'. Skipping...")
failed.append(file)
continue
# Strip ".dm"
if file.endswith(ext):
out_filename = file[:-len(ext)]
else:
out_filename = file
# make output path
outfile = os.path.abspath(os.path.join(args.output_dir, out_filename))
try:
decrypt_file(file, outfile, bytes(args.gmail, "utf-8"))
except Exception as e:
print(f"Error decrypting '{file}': {e}")
failed.append(file)
if failed:
print(
"Failed to decrypt file{}: {}".format(
"s" if len(failed) else "", ", ".join(f"'{i}'" for i in failed)
)
)
To fix this error:
lgdecryptor.py:131: SyntaxWarning: invalid escape sequence '\-'
lgeflock_searchstring = b'lge/flock(L[0-9\-_][email protected])'
File not found: '*.dm'. Skipping...
Failed to decrypt files: '*.dm'
Updated Main
To fix this error:
Then use:
python lgdecryptor.py [email protected] "*.dm"
The text was updated successfully, but these errors were encountered: