I had issues when using this with NixOS and the android-sdk in the /nix/store which is completely read-only.
It copied the file from there and kept the permissions of it, running cargo apk a second time resulted in an Permissions denied error, because the file couldn't be overwritten.
This fix just sets the permissions to standard 644 permissions, which is AFAIK recommended for files like .so.
I think this could also be fixed, by just setting the user write permission bit of the file (a matter of preference I guess).
Not sure if it matters but there is Permissions::set_readonly in std which makes it not unix-specific. There is tho a note that it is equivalent to chmod a+w, which is different from 644.
I had issues when using this with NixOS and the android-sdk in the
/nix/store
which is completely read-only.It copied the file from there and kept the permissions of it, running
cargo apk
a second time resulted in an Permissions denied error, because the file couldn't be overwritten.This fix just sets the permissions to standard
644
permissions, which is AFAIK recommended for files like.so
. I think this could also be fixed, by just setting the user write permission bit of the file (a matter of preference I guess).