android-ssl-pinning-bypass icon indicating copy to clipboard operation
android-ssl-pinning-bypass copied to clipboard

TypeError: argument of type 'WindowsPath' is not iterable

Open minanagehsalalma opened this issue 3 years ago • 8 comments

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

minanagehsalalma avatar Jun 02 '22 10:06 minanagehsalalma

Hey!

@minanagehsalalma can you post the entire console output?

Plus try to update Python to version 3.9 or above.

ilya-kozyr avatar Jun 08 '22 12:06 ilya-kozyr

@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

minanagehsalalma avatar Jun 23 '22 00:06 minanagehsalalma

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 avatar Nov 16 '22 19:11 cturan

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')]

cturan avatar Nov 16 '22 19:11 cturan

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

ilya-kozyr avatar Nov 17 '22 08:11 ilya-kozyr

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

cturan avatar Nov 17 '22 08:11 cturan

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

ilya-kozyr avatar Nov 17 '22 08:11 ilya-kozyr

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

The latest version works just fine, thanks.

cturan avatar Nov 17 '22 08:11 cturan