raleighlittles / SMS-backup-and-restore-extractor

A simple Python script for extracting images out of an "SMS Backup & Restore" backup.

Home Page:https://play.google.com/store/apps/details?id=com.riteshsahu.SMSBackupRestore&hl=en_US

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

name attribute should be cl

jthomasser opened this issue · comments

thanks for the script helped me recover some memories i would have otherwise lost.

the name attribute does not properly pull the identified name for the media file. using cl will do the trick. changing as follows helped me pull original names out of the xml. i just substituted name for cl in this code block.

        for ext in image_ext_types:
            xpath_search_expr = xpath_search_str_base + ext + "']"
            b64_results_list.append([(b.attrib['data'], b.attrib['cl']) for b in root.findall(xpath_search_expr)])

        for result_type in b64_results_list:
            for (data, cl) in result_type:
                if cl == "" or cl == "null":
                    cl = "".join(random.sample(string.ascii_letters, 10))
                with open(os.path.join(output_dir, cl), 'wb') as f:
                    f.write(base64.b64decode(data))
                    orig_files_count += 1

Thanks for the feedback. I'll apply this change

Applied this change in the latest commit: cda5a18