question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] temp file not being deleted when building

See original GitHub issue

Information

  1. Apktool Version (apktool -version) - 2.6.0
  2. Operating System (Mac, Linux, Windows) - Windows
  3. APK From? (Playstore, ROM, Other) - probably not relevant

Steps to Reproduce

  1. apktool b -o out extractedFolder
  2. Monitor the %TEMP% folder; during build, two APKTOOL{longnumber}.tmp files are created, and one of the is removed again. The other stays there.

Note that this only occurs when (re-)building, not when decompiling an .apk. After digging a bit in the source, I suspect the following lines in buildManifest() to be the problem:

https://github.com/iBotPeaches/Apktool/blob/9bdf3855384414d5e1060bfef263bb0e5b07460a/brut.apktool/apktool-lib/src/main/java/brut/androlib/Androlib.java#L548-L549

Here, the temporary file is being created and then deleted again (I guess to get the temp filename). Then the filename is used in a call to aaptPackage(), but afterwards it isn’t deleted.

Note that buildResourcesFull() also creates a temp filename, but deletes the created file again in line 512, and that’s the difference to buildManifest():

https://github.com/iBotPeaches/Apktool/blob/9bdf3855384414d5e1060bfef263bb0e5b07460a/brut.apktool/apktool-lib/src/main/java/brut/androlib/Androlib.java#L512

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
MFinkBKcommented, Jan 18, 2022

Works! I tested with apktool-2.6.1-797fc3-SNAPSHOT-small.jar. Thanks for the effort to fix this bug, and for making apktool in the first place!

0reactions
MFinkBKcommented, Jan 18, 2022

I’d like to test the PR, but unfortunately the GitHub action doesn’t provide a built apktool.jar, only when merged to master

Read more comments on GitHub >

github_iconTop Results From Across the Web

Top 3 Ways to Fix Windows 10 Temporary Files Not Deleting
Top 3 Ways to Fix Windows 10 Temporary Files Not Deleting · 1. Use Disk Cleanup · 2. Use Command Prompt · 3....
Read more >
Temporary Files Won't Delete on Windows 11: 7 Thorough Fixes
To resolve this issue, you should first try deleting all the files manually and then follow the other methods.
Read more >
Temporary Files will not Delete in Windows 10 Creator
The last option is to use the Command Prompt to clean up temporary files immediately. Follow the steps below: Press the Windows key...
Read more >
Windows 10 Won't Delete Temporary Files [SOLVED]
If Windows 10 won't delete temporary files, then you are in the right spot. We have discussed the methods here to fix the...
Read more >
Windows 10 temporary files will not delete: why does this error ...
Windows 10 temporary files will not delete: why does this error happen? · Delete the files manually: · Remove the files using the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found