Lanchon / haystack

Signature Spoofing Patcher for Android
GNU General Public License v3.0
233 stars 45 forks source link

'readlink: illegal option -f' on macOS #8

Closed olliejm closed 7 years ago

olliejm commented 7 years ago

I'm trying to patch the pulled fileset on macOS, but I'm getting the following error:

./patch-fileset patches/sigspoof-hook-7.0/ 23 fs-oneplus3t/
readlink: illegal option -- f
usage: readlink [-n] [file ...]
readlink: illegal option -- f
usage: readlink [-n] [file ...]
>>> target directory: fs-oneplus3t__sigspoof-hook-7.0
cp: illegal option -- t
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory

It seems like readlink is deprecated on macOS or something, how should I proceed?

simonepsp commented 7 years ago

Hi, essentially there are 2 issues :

To fix the readlink issue you have to install greadlink via brew (brew install coreutils. Give a look here if you don't have Homebrew installed: https://brew.sh/index_it.html) and then replace "readlink" with "greadlink" in every haystack script. Alternatively you can run alias readlink=greadlink.

Now the cp issue: AFAIK macos' cp doesn't have the -t parameter. To fix this you have to replace cp -t "$patched_filterset_dir" "$fileset_dir"/*.{jar,apk} with cp $fileset_dir"/*.{jar,apk} $patched_filterset_dir in the patch-fileset script.

I'm not a mac user but this should do the job. Cheers!

Lanchon commented 7 years ago

thanks for the report. i don't support proprietary tools or OSes. you are on your own here, sorry for letting you down.