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

Apktool needlessly complains about non-writable home directory #1586

Closed
sfzhi opened this Issue Aug 13, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@sfzhi

sfzhi commented Aug 13, 2017

Information

  1. Apktool Version - 2.2.4, the same issue exists in master.
  2. Operating System - Linux
  3. APK From? - N/A

Apktool Output

S: WARNING: Could not write to $HOME (/home/user), using /tmp instead...

Steps to Reproduce

  1. Run apktool when the home directory is not writable, but $HOME/.local/share/apktool is.

Apktool here is assuming too much. It wants to use the directory $HOME/.local/share/apktool/framework, so it should do just that and not poke around in other places. It should complain only when that directory is not writable, or doesn't exist and cannot be created.

By the way, it also complains when framework is a file, which makes sense, but is not entirely correct. On many OS (such as Linux and UNIX) there are other types of directory entries than file and directory, so the check isFile() would better be replaced with !isDirectory().

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Aug 13, 2017

Owner

You are welcome to create a pull request if you believe the detection of an invalid file/pointer in the framework folder location could be enhanced.

As for the first issue. I will run some tests, but seems like I just need to update the error message.

Owner

iBotPeaches commented Aug 13, 2017

You are welcome to create a pull request if you believe the detection of an invalid file/pointer in the framework folder location could be enhanced.

As for the first issue. I will run some tests, but seems like I just need to update the error message.

iBotPeaches added a commit that referenced this issue Aug 15, 2017

Refactor directory checks to prevent assumptions
 - only checks directory path of apktool framework location
 - fixes #1586
@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Aug 15, 2017

Owner

Pull request in (pending review). I adapted the checks to only check the location that Apktool will use.

Owner

iBotPeaches commented Aug 15, 2017

Pull request in (pending review). I adapted the checks to only check the location that Apktool will use.

@iBotPeaches iBotPeaches added this to the 2.2.5 milestone Aug 15, 2017

@iBotPeaches iBotPeaches closed this in #1590 Aug 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment