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

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: #40

Closed
masteradit opened this issue Mar 23, 2021 · 21 comments · Fixed by #41 or #45
Labels
bug Something isn't working

Comments

@masteradit
Copy link

After issue #37 was fixed, I cloned the repo and tried testing it again.

Here's the command I entered: python .\apkleaks.py -f <path-to-apk>\app-armeabi-v7a-release.apk

Here's the output:

     _    ____  _  ___               _
    / \  |  _ \| |/ / |    ___  __ _| | _____
   / _ \ | |_) | ' /| |   / _ \/ _` | |/ / __|
  / ___ \|  __/| . \| |__|  __/ (_| |   <\__ \
 /_/   \_\_|   |_|\_\_____\___|\__,_|_|\_\___/
 v2.3.0
 --
 Scanning APK file for URIs, endpoints & secrets
 (c) 2020-2021, dwisiswant0

** Decompiling APK...
The filename, directory name, or volume label syntax is incorrect.

** Scanning against 'com.<package-name>'
Traceback (most recent call last):
  File ".\apkleaks.py", line 5, in <module>
    main()
  File "C:\Users\username\Documents\apkleaks\apkleaks\cli.py", line 38, in main
    init.cleanup()
  File "C:\Users\username\Documents\apkleaks\apkleaks\apkleaks.py", line 144, in cleanup
    os.remove(self.output)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\username\\AppData\\Local\\Temp\\apkleaks-fimv9xye.txt'
@dwisiswant0 dwisiswant0 added the bug Something isn't working label Mar 23, 2021
@dwisiswant0
Copy link
Owner

Again, thank you so much for reporting this, @masteradit! Can you confirm whether it's still reproduced on hotfix PR #41 (v2.3.2)?

@masteradit
Copy link
Author

Hey @dwisiswant0! I am still getting the same error on v2.3.2. Should I create another issue?

Also, a small unrelated bug: the ASCII art (I am not sure what it is called), still shows v2.3.0. I tried to figure out how to fix this, but I am not a very advanced Python user, so I could not figure it out. Maybe it is related to the header() function in cli.py file from line 12 to 17. Let me know if I should make a separate issue for this too.

Thank you for your quick responses!

@dwisiswant0
Copy link
Owner

Did you install with setup.py build?

@masteradit
Copy link
Author

Thank you! Running python .\setup.py build updated the version to 2.3.2.

But python .\apkleaks.py -f <path-to-apk>\app-armeabi-v7a-release.apk is still giving the same error.

@dwisiswant0
Copy link
Owner

Thank you! Running python .\setup.py build updated the version to 2.3.2.

But python .\apkleaks.py -f <path-to-apk>\app-armeabi-v7a-release.apk is still giving the same error.

It still prompted PermissionError: [WinError 32]?

@dwisiswant0 dwisiswant0 reopened this Mar 24, 2021
@masteradit
Copy link
Author

It still prompted PermissionError: [WinError 32]?

Yes, here's the complete output:

     _    ____  _  ___               _
    / \  |  _ \| |/ / |    ___  __ _| | _____
   / _ \ | |_) | ' /| |   / _ \/ _` | |/ / __|
  / ___ \|  __/| . \| |__|  __/ (_| |   <\__ \
 /_/   \_\_|   |_|\_\_____\___|\__,_|_|\_\___/
 v2.3.2
 --
 Scanning APK file for URIs, endpoints & secrets
 (c) 2020-2021, dwisiswant0

** Decompiling APK...
The filename, directory name, or volume label syntax is incorrect.

** Scanning against 'com.com.<package-name>'
Traceback (most recent call last):
  File "apkleaks.py", line 5, in <module>
    main()
  File "C:\Users\username\Documents\apkleaks\apkleaks\cli.py", line 38, in main
    init.cleanup()
  File "C:\Users\username\Documents\apkleaks\apkleaks\apkleaks.py", line 145, in cleanup
    os.remove(self.output)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\username\\AppData\\Local\\Temp\\apkleaks-va_bn39s.txt'

@terminatordoink
Copy link

Same here, having the same error after following the steps above

@Linusten
Copy link

Same here, installed also via setup.py

`←[0m←[94m** Decompiling APK...
←[0mDie Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch.

** Scanning against ''
Traceback (most recent call last):
File "C:\Users\P\Downloads\apkleaks-master\apkleaks-master\apkleaks.py", line 5, in
main()
File "C:\Users\P\Downloads\apkleaks-master\apkleaks-master\apkleaks\cli.py", line 38, in main
init.cleanup()
File "C:\Users\P\Downloads\apkleaks-master\apkleaks-master\apkleaks\apkleaks.py", line 145, in cleanup
os.remove(self.output)
PermissionError: [WinError 32] Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird: 'C:\Users\P\AppData\Local\Temp\apkleaks-ewc_6o52.txt'

C:\Users\P\Downloads\apkleaks-master\apkleaks-master>`

@Ch3nYe
Copy link
Contributor

Ch3nYe commented Mar 29, 2021

try update comm = "%s" % (" ".join(quote(arg) for arg in args)) to comm = "%s" % (" ".join(arg for arg in args)) in apkleaks/apkleaks.py line 96. It works on windows.
this error may cause by command error.

@Linusten
Copy link

`←[0m
←[93mIt's not a valid file!
←[0mTraceback (most recent call last):
  File "C:\Users\P\Downloads\apkleaks-master\apkleaks-master\apkleaks\cli.py", line 34, in main
    init.integrity()
  File "C:\Users\P\Downloads\apkleaks-master\apkleaks-master\apkleaks\apkleaks.py", line 87, in integrity
    sys.exit(util.writeln("It's not a valid file!", col.WARNING))
SystemExit

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\P\Downloads\apkleaks-master\apkleaks-master\apkleaks.py", line 5, in <module>
    main()
  File "C:\Users\P\Downloads\apkleaks-master\apkleaks-master\apkleaks\cli.py", line 38, in main
    init.cleanup()
  File "C:\Users\P\Downloads\apkleaks-master\apkleaks-master\apkleaks\apkleaks.py", line 145, in cleanup
    os.remove(self.output)
PermissionError: [WinError 32] Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird: 'C:\\Users\\P\\AppData\\Local\\Temp\\apkleaks-mbqw8ja1.txt'

` Does not work with this fix...

@masteradit
Copy link
Author

try update comm = "%s" % (" ".join(quote(arg) for arg in args)) to comm = "%s" % (" ".join(arg for arg in args)) in apkleaks/apkleaks.py line 96. It works on windows.
this error may cause by command error.

Thank you @Ch3nYe! It fixed it! Please make a pull request.

Ch3nYe added a commit to Ch3nYe/apkleaks that referenced this issue Mar 31, 2021
This update can fix issue dwisiswant0#40 on windows
@Ch3nYe Ch3nYe mentioned this issue Mar 31, 2021
dwisiswant0 added a commit that referenced this issue Apr 3, 2021
@ravirajdarisi
Copy link

I am facing the same problem,I am using windows 10 machine with python 3.8 and apk leaks version 2.3.2
/ \ | _ | |/ / | ___ __ | | _____
/ _ \ | |
) | ' /| | / _ / ` | |/ / __|
/ ___ | /| . | || __/ (
| | <__
// __| ||______|_,||____/
v2.3.2

Scanning APK file for URIs, endpoints & secrets
(c) 2020-2021, dwisiswant0
�[0m
�[94m** Decompiling APK...
�[0mThe filename, directory name, or volume label syntax is incorrect.

** Scanning against 'com.symbol.datawedge'
Traceback (most recent call last):
File "C:\Python38\Scripts\apkleaks-script.py", line 11, in
load_entry_point('apkleaks==2.3.2', 'console_scripts', 'apkleaks')()
File "c:\python38\lib\site-packages\apkleaks\cli.py", line 38, in main
init.cleanup()
File "c:\python38\lib\site-packages\apkleaks\apkleaks.py", line 145, in cleanup
os.remove(self.output)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\pkbh43\AppData\Local\Temp\apkleaks-bw0e4h_x.txt'

@bomask
Copy link

bomask commented Apr 29, 2021

my pc is Win10 - 64bit
python V3.8.5

F:\apk\apkleaks>python apkleaks.py   -f   home.apk
�[95m     _    ____  _  ___               _
    / \  |  _ \| |/ / |    ___  __ _| | _____
   / _ \ | |_) | ' /| |   / _ \/ _` | |/ / __|
  / ___ \|  __/| . \| |__|  __/ (_| |   <\__ \
 /_/   \_\_|   |_|\_\_____\___|\__,_|_|\_\___/
 v2.3.2
 --
 Scanning APK file for URIs, endpoints & secrets
 (c) 2020-2021, dwisiswant0
�[0m
�[94m** Decompiling APK...
�[0m
** Scanning against 'com.ludashi.benchmark'
Traceback (most recent call last):
  File "apkleaks.py", line 5, in <module>
    main()
  File "F:\apk\apkleaks\apkleaks\cli.py", line 38, in main
    init.cleanup()
  File "F:\apk\apkleaks\apkleaks\apkleaks.py", line 145, in cleanup
    os.remove(self.output)
PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'C:\\Users\\yangb-i\\AppData\\Local\\Temp\\apkleaks-2_uh685h.txt'

@dwisiswant0
Copy link
Owner

Just want to let you know that PR (#45) doesn't fix this issue, @Ch3nYe.

Lemme know if anyone here can solve this problem, feel free to open PR.

Kaaveh added a commit to Kaaveh/apkleaks that referenced this issue May 30, 2021
@Kaaveh
Copy link

Kaaveh commented May 30, 2021

Just want to let you know that PR (#45) doesn't fix this issue, @Ch3nYe.

Lemme know if anyone here can solve this problem, feel free to open PR.

I'll do it.

@Kaaveh Kaaveh mentioned this issue Jun 7, 2021
@w1th0ut
Copy link

w1th0ut commented Jun 15, 2021

try update comm = "%s" % (" ".join(quote(arg) for arg in args)) to comm = "%s" % (" ".join(arg for arg in args)) in apkleaks/apkleaks.py line 96. It works on windows.
this error may cause by command error.

Hello,
any update about this? I tried this but still got this error PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\User\\AppData\\Local\\Temp\\apkleaks-0qts4nn7.txt'.
win 10
python 3.8.1

@w1th0ut
Copy link

w1th0ut commented Jun 16, 2021

try update comm = "%s" % (" ".join(quote(arg) for arg in args)) to comm = "%s" % (" ".join(arg for arg in args)) in apkleaks/apkleaks.py line 96. It works on windows.
this error may cause by command error.

Hello,
any update about this? I tried this but still got this error PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\User\\AppData\\Local\\Temp\\apkleaks-0qts4nn7.txt'.
win 10
python 3.8.1

Solved by this PR #45 😄

@weujieytt
Copy link

same bug
image

@w1th0ut
Copy link

w1th0ut commented Jun 16, 2021

@weujieytt some apk works, and some error like that, idk why.

@weujieytt
Copy link

@w1th0ut no problem with linux

@dwisiswant0
Copy link
Owner

Hi, everyone! Please check the latest version (v2.5.2) for this workaround.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
10 participants