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

TypeError: argument of type 'WindowsPath' is not iterable #3

Open
minanagehsalalma opened this issue Jun 2, 2022 · 8 comments
Open

Comments

@minanagehsalalma
Copy link

Command : python3 apk-rebuild.py tttt.apk

  File "C:\Users\ddddddd\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 524, in list2cmdline
    needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'WindowsPath' is not iterable
@ilya-kozyr
Copy link
Owner

Hey!

@minanagehsalalma can you post the entire console output?

Plus try to update Python to version 3.9 or above.

@minanagehsalalma
Copy link
Author

@ilya-kozyr it took a lot of time to load and i deleted all the files sorry :9

The test was done on The Reddit APP apk since it has ssl pinning like the rest of the social apps

@cturan
Copy link

cturan commented Nov 16, 2022

Hi, same error on windows 11

Traceback (most recent call last):
  File "apk-rebuild.py", line 485, in <module>
    main()
  File "apk-rebuild.py", line 393, in main
    rebuild_single_apk(source_file.full_path, output_files.full_path)
  File "apk-rebuild.py", line 227, in rebuild_single_apk
    subprocess.run(command, stdout=sys.stdout, stderr=sys.stderr)
  File "C:\Users\alfa\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 453, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Users\alfa\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 756, in __init__
    restore_signals, start_new_session)
  File "C:\Users\alfa\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1100, in _execute_child
    args = list2cmdline(args)
  File "C:\Users\alfa\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 511, in list2cmdline
    needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'WindowsPath' is not iterable

@cturan
Copy link

cturan commented Nov 16, 2022

this is happened because in command arrays we have to cast WindowsPath to string.

For example.

['java', '-jar', WindowsPath('C:/Users/alfa/AppData/Roaming/apk-rebuild/apktool_2.6.1.jar'), 'decode', WindowsPath('C:/Users/alfa/Desktop/android-ssl-pinning-bypass-master/target.apk'), '--output', WindowsPath('C:/Users/alfa/Desktop/android-ssl-pinning-bypass-master/target.apk-decompiled')]

@ilya-kozyr
Copy link
Owner

Hey!
@cturan what python version are you using? the script works for me on Windows 10 and python 3.10.6.

@cturan
Copy link

cturan commented Nov 17, 2022

Hey! @cturan what python version are you using? the script works for me on Windows 10 and python 3.10.6.

I have multiple version installed on my system but look like script started by python 3.7.0

@ilya-kozyr
Copy link
Owner

This might be the issue. Anyway, I pushed changes with converting path object to string. Try.

@cturan
Copy link

cturan commented Nov 17, 2022

This might be the issue. Anyway, I pushed changes with converting path object to string. Try.

The latest version works just fine, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants