ax / apk.sh

apk.sh makes reverse engineering Android apps easier, automating some repetitive tasks like pulling, decoding, rebuilding and patching an APK.
GNU General Public License v3.0
3.34k stars 189 forks source link

Follow the XDG standard for storing APK_SH_HOME dir #7

Closed meequrox closed 1 year ago

meequrox commented 1 year ago

It is a bad practice in GNU/Linux to keep some dot files in the home directory.

There is an XDG standard that says that the directory to store user data files is defined by $XDG_DATA_HOME variable.

After this refinement, the order for selecting the data directory is as follows:

  1. $XDG_DATA_HOME/.apk.sh (almost always ~/.local/share/.apk.sh)
  2. ~/.apk.sh (if $XDG_DATA_HOME is not set)
ax commented 1 year ago

The directory .apk.sh also keeps some bins, not only data.

meequrox commented 1 year ago

My fault, I missed binaries there.

So, now we have a situation where both the binaries and the data (e.g. keystore) are stored in $HOME/.apk.sh.

You can leave it as is, as some developers do. Then just close this PR. Alternatively, this situation can be resolved by storing the binaries and data in separate XDG directories (or in the same $HOME/.apk.sh if XDG vars are not set).

If you choose second way, please let me know. Then I will implement it.