Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Running patchapk results in IO value error #629

Open
khairm opened this issue Aug 4, 2023 · 1 comment
Open

[bug] Running patchapk results in IO value error #629

khairm opened this issue Aug 4, 2023 · 1 comment
Labels
freshissue Default label for new, untriaged issues.

Comments

@khairm
Copy link

khairm commented Aug 4, 2023

Describe the bug
When I run objection patchapk -s Twitter.apk I get ValueError: I/O operation on closed file

To Reproduce
Steps to reproduce the behavior:

  1. Run command '...'

Expected behavior
I am expecting a rebuild of the apk that has SSL pinning disabled

Evidence / Logs / Screenshots
Any output from objection, such as stack traces or errors that occurred. Be sure to run objection with the --debug flag so that errors from the agent are verbose enough to debug. For example:

objection --debug explore

No architecture specified. Determining it using adb...
Detected target device architecture as: arm64-v8a
Using latest Github gadget version: 16.1.3
Patcher will be using Gadget version: 16.1.3
Detected apktool version as: 2.8.1
Running apktool empty-framework-dir...
I: Removing 1.apk framework file...
Unpacking Twitter.apk
Exception in thread Thread-10 (_readerthread):
Traceback (most recent call last):
File "C:\Users\khair\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
self.run()
File "C:\Users\khair\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\khair\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1497, in _readerthread
buffer.append(fh.read())
File "C:\Users\khair\AppData\Local\Programs\Python\Python310\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 0x8f in position 3744: character maps to
Traceback (most recent call last):
File "C:\Users\khair\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\khair\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\khair\AppData\Local\Programs\Python\Python310\Scripts\objection.exe_main
.py", line 7, in
File "C:\Users\khair\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1130, in call
return self.main(*args, **kwargs)
File "C:\Users\khair\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
File "C:\Users\khair\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\khair\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\khair\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "C:\Users\khair\AppData\Local\Programs\Python\Python310\lib\site-packages\objection\console\cli.py", line 373, in patchapk
patch_android_apk(**locals())
File "C:\Users\khair\AppData\Local\Programs\Python\Python310\lib\site-packages\objection\commands\mobile_packages.py", line 192, in patch_android_apk
patcher.inject_internet_permission()
File "C:\Users\khair\AppData\Local\Programs\Python\Python310\lib\site-packages\objection\utils\patchers\android.py", line 428, in inject_internet_permission
if internet_permission in self._get_appt_output():
File "C:\Users\khair\AppData\Local\Programs\Python\Python310\lib\site-packages\objection\utils\patchers\android.py", line 317, in _get_appt_output
self.aapt = o.out
File "C:\Users\khair\AppData\Local\Programs\Python\Python310\lib\site-packages\delegator.py", line 126, in out
self.__out = self.std_out.read()
ValueError: I/O operation on closed file.
Cleaning up temp files...

Environment (please complete the following information):

  • Device: Pixel 6 pro
  • OS: Android 13
  • Frida Version: ..
  • Objection Version: 1.11.0
  • Machine: Windows 11

Application
Github not allowing that file type

Additional context
Just want to remove ssl pinning. I don't think I installed Frida.... I thought Objection packaged what it needed.

@khairm khairm added the freshissue Default label for new, untriaged issues. label Aug 4, 2023
@gpearson100
Copy link

Having the same issue. Any ideas?
Thx

Seadox added a commit to Seadox/objection that referenced this issue Jun 1, 2024
@Seadox Seadox mentioned this issue Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
freshissue Default label for new, untriaged issues.
Projects
None yet
Development

No branches or pull requests

2 participants