Apktool icon indicating copy to clipboard operation
Apktool copied to clipboard

[BUG] Build keeps failing after an exception

Open beranos opened this issue 3 years ago • 2 comments
trafficstars

Information

  1. Apktool Version (apktool -version) - latest one
  2. Operating System (Mac, Linux, Windows) - Windows
  3. APK From? (Playstore, ROM, Other) - Playstore

i was trying to build an apk with the normal command "java -jar apktool.jar b name" and i got this exception at the end stage: "java.io.IOException: There is not enough space on the disk", which let me know i didn't have enought space on my disk, i solved the problem and now when i retype "java -jar apktool.jar b name" i get the following error: "Unable to rename temporary file" the only thing i did to solve this error is to decompile the apk again. its a small bug but it will be good if it can be solved

beranos avatar Jun 28 '22 21:06 beranos

Apktool dumps some files into tmp for executing aapt. This has issues on systems where execution from tmp is disallowed. You may use -a to point to a copy of the aapt binaries.

https://ibotpeaches.github.io/Apktool/documentation/#rebuild

Maybe I'll look into adapting -a to just redirecting the location of tmp. So I'll hold this open for that.

iBotPeaches avatar Jul 03 '22 10:07 iBotPeaches

Apktool dumps some files into tmp for executing aapt. This has issues on systems where execution from tmp is disallowed. You may use -a to point to a copy of the aapt binaries.

https://ibotpeaches.github.io/Apktool/documentation/#rebuild

Maybe I'll look into adapting -a to just redirecting the location of tmp. So I'll hold this open for that.

isn't a better fix just deleting the remaining temporary files each re-build? or randomizing the temperary file name each build (honestly just guessing what the file is, i havent read any code related to it)? i think you miss understood the problem i was facing.

beranos avatar Jul 06 '22 00:07 beranos

this error is caused by residue of *.apktool_temp need to delete the temporary file before outFile.renameTo(tempFile);

https://github.com/iBotPeaches/Apktool/blob/35ce8fc061d31e30978c6f65d194fe3c4191b0be/brut.apktool/apktool-lib/src/main/java/brut/androlib/Androlib.java#L663

yapcheahshen avatar Jan 10 '23 03:01 yapcheahshen

this error is caused by residue of *.apktool_temp need to delete the temporary file before outFile.renameTo(tempFile);

https://github.com/iBotPeaches/Apktool/blob/35ce8fc061d31e30978c6f65d194fe3c4191b0be/brut.apktool/apktool-lib/src/main/java/brut/androlib/Androlib.java#L663

Could you put up a pull request with what you suggest the solution is? I see the tempFile.delete() so not following.

iBotPeaches avatar Jan 10 '23 11:01 iBotPeaches