sensepost / objection

📱 objection - runtime mobile exploration
GNU General Public License v3.0
7.46k stars 854 forks source link

[bug] UnicodeEncodeError #427

Closed Xgomoku closed 3 years ago

Xgomoku commented 3 years ago

Raised an error when use cmd like android hooking list class_methods xxxxxxx

--- Logging error --- Traceback (most recent call last): File "\python37-32\lib\logging__init__.py", line 1037, in emit stream.write(msg + self.terminator) UnicodeEncodeError: 'gbk' codec can't encode character '\ufb84' in position 124: illegal multibyte sequence Call stack: File "\python37-32\lib\site-packages\frida\core.py", line 383, in _on_message callback(message, data) File "\python37-32\lib\site-packages\objection\utils\agent.py", line 63, in on_message click.secho('(agent) ' + message['payload']) File "\python37-32\lib\site-packages\objection\utils__init__.py", line 40, in new_secho logging.info(text.encode("utf-8")) Message: '(agent) Hooking Arguments: ()

Resolve: Solved this problem by encoding the wrong text with utf-8