Fixes error when Dump All SMS on Windows#114
Merged
Merged
Conversation
Owner
|
The diff shows unnecessary changes, please edit your PR to show only relevant changes for proper review. |
Contributor
Author
|
that's good ? |
AzeemIdrisi
reviewed
May 17, 2026
|
|
||
| def _write_dump(dest: Path, result: subprocess.CompletedProcess[str]) -> None: | ||
| """Persist adb output: stdout only on success; on failure, record stderr in a sibling file.""" | ||
| stdout = result.stdout or "" |
Owner
There was a problem hiding this comment.
Changes in this file is not needed. Revert back.
Remove unnecessary assignment of stdout variable.
Owner
|
You misunderstood my comment, Keep changes only in |
AzeemIdrisi
approved these changes
May 18, 2026
Owner
AzeemIdrisi
left a comment
There was a problem hiding this comment.
Thank you for your contribution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I forced adb() to decode the output to UTF-8 using
errors="replace"in console.py, which prevents the Windows cp1252 crash on Android bytes. I also secured_write_dump()in data_extraction.py to prevent crashes ifstdoutorstderrisNonethere are errors :
Export all SMS messages from the device to a file on this computer? This accesses private communications. Y / N >
Exception in thread Thread-13 (_readerthread):
Traceback (most recent call last):
File "C:\Users\moka\AppData\Local\Python\pythoncore-3.14-64\Lib\threading.py", line 1082, in _bootstrap_inner
self._context.run(self.run)
~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "C:\Users\moka\AppData\Local\Python\pythoncore-3.14-64\Lib\threading.py", line 1024, in run
self._target(*self._args, **self._kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\moka\AppData\Local\Python\pythoncore-3.14-64\Lib\subprocess.py", line 1614, in _readerthread
buffer.append(fh.read())
~~~~~~~^^
File "C:\Users\moka\AppData\Local\Python\pythoncore-3.14-64\Lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 7957: character maps to
Traceback (most recent call last):
File "C:\Users\moka\Desktop\PhoneSploit-Pro\phonesploitpro.py", line 31, in
run()
~~~^^
File "C:\Users\moka\Desktop\PhoneSploit-Pro\modules\cli.py", line 448, in run
main(config)
~~~~^^^^^^^^
File "C:\Users\moka\Desktop\PhoneSploit-Pro\modules\cli.py", line 312, in main
data_extraction.dump_sms(config)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "C:\Users\moka\Desktop\PhoneSploit-Pro\modules\data_extraction.py", line 54, in dump_sms
_write_dump(dest, result)
~~~~~~~~~~~^^^^^^^^^^^^^^
File "C:\Users\moka\Desktop\PhoneSploit-Pro\modules\data_extraction.py", line 27, in write_dump
dest.write_text(result.stdout, encoding="utf-8")
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\moka\AppData\Local\Python\pythoncore-3.14-64\Lib\pathlib_init.py", line 807, in write_text
raise TypeError('data must be str, not %s' %
data.class.name)
TypeError: data must be str, not NoneType