This script extracts text from .memo files created by the default Memo app on Verizon Samsung Galaxy S phones. No root access required. Share a memo via Bluetooth or USB to your PC and run this script against the file.
I wrote this script to enable storing and reading memos offline on a PC without the need for cloud storage or email transfer. I’ve tested this script for notes created with the default (stock) Samsung Galaxy S6 Memo app that comes preinstalled on Verizon phones. The Memo app I’m referring to is not the "S Memo" app. This script presumably works with other phones that have the same memo app, but I have not tested it.
The image above is the current icon for the default Memo app I am referring to.
These memos, when shared to a PC via Bluetooth or USB, yield an archive with a .memo extension. Changing the file extension to .zip will allow the archive to be decompressed using most zip utilities. However, this can be a chore when multiple files need to be extracted. This script helps automate that process.
The only requirement is that you have Python 2 or 3 installed on your PC. Run this script and add the path to a directory containing the memo file(s) as an argument:
python extractMemos.py /path/[yourfile.memo]
Parsing multiple memo files creates one contiguous output with a message appended to the end of each memo listed.
These examples were written to be N00B friendly. Command line ninjas may skip this section.
The following examples assume your memo files are located on your Desktop in a folder named Memos and that this script is located in your Documents folder. Taylor these commands to your environment by replacing the example paths with paths that reflect where your files are located and replace any instance of username
with your actual username. Your username can be found by typing whoami
and pressing enter.
cd /Users/username/Desktop
python /Users/username/Documents/extractMemos.py ./Memos
python /Users/username/Documents/extractMemos.py ./Memos/filename.memo
python /Users/username/Documents/extractmemos.py ./Memos > myMemos.txt
python /Users/username/Documents/extractmemos.py ./Memos/someMemo.memo > myMemo.txt
Note that the single redirect operator >
(greater-than symbol) overwrites any file with the same name! To add output to an existing file use two greater-than symbols >>
which preserves any data that the file contains by appending new data to the end.
This script relies on Python's XML Processing Modules and is therefore not secure against maliciously constructed data. I highly recommend using this script to only parse data that you have created on your own device. For more information see:
- https://docs.python.org/2/library/xml.html#xml-vulnerabilities
- https://docs.python.org/3/library/xml.html
- Add functionality for extracting images
- Error handling
- Improve Regex
- Cleanup functions