@@ -104,22 +104,27 @@ identify_the_operating_system_and_architecture() {
104
104
PACKAGE_MANAGEMENT_INSTALL=' apt -y --no-install-recommends install'
105
105
PACKAGE_MANAGEMENT_REMOVE=' apt purge'
106
106
package_provide_tput=' ncurses-bin'
107
+ package_provide_bsdtar=' libarchive-tools'
107
108
elif [[ " $( type -P dnf) " ]]; then
108
109
PACKAGE_MANAGEMENT_INSTALL=' dnf -y install'
109
110
PACKAGE_MANAGEMENT_REMOVE=' dnf remove'
110
111
package_provide_tput=' ncurses'
112
+ package_provide_bsdtar=' bsdtar'
111
113
elif [[ " $( type -P yum) " ]]; then
112
114
PACKAGE_MANAGEMENT_INSTALL=' yum -y install'
113
115
PACKAGE_MANAGEMENT_REMOVE=' yum remove'
114
116
package_provide_tput=' ncurses'
117
+ package_provide_bsdtar=' bsdtar'
115
118
elif [[ " $( type -P zypper) " ]]; then
116
119
PACKAGE_MANAGEMENT_INSTALL=' zypper install -y --no-recommends'
117
120
PACKAGE_MANAGEMENT_REMOVE=' zypper remove'
118
121
package_provide_tput=' ncurses-utils'
122
+ package_provide_bsdtar=' bsdtar'
119
123
elif [[ " $( type -P pacman) " ]]; then
120
124
PACKAGE_MANAGEMENT_INSTALL=' pacman -Syu --noconfirm'
121
125
PACKAGE_MANAGEMENT_REMOVE=' pacman -Rsn'
122
126
package_provide_tput=' ncurses'
127
+ package_provide_bsdtar=' libarchive'
123
128
else
124
129
echo " error: The script does not support the package manager in this operating system."
125
130
exit 1
@@ -291,7 +296,7 @@ download_v2ray() {
291
296
}
292
297
293
298
decompression () {
294
- if ! unzip -q " $1 " -d " $TMP_DIRECTORY " ; then
299
+ if ! bsdtar -C " $TMP_DIRECTORY " -xf " $1 " ; then
295
300
echo ' error: V2Ray decompression failed.'
296
301
" rm" -r " $TMP_DIRECTORY "
297
302
echo " removed: $TMP_DIRECTORY "
@@ -511,7 +516,7 @@ main() {
511
516
echo ' warn: Install V2Ray from a local file, but still need to make sure the network is available.'
512
517
echo -n ' warn: Please make sure the file is valid because we cannot confirm it. (Press any key) ...'
513
518
read
514
- install_software ' unzip ' ' unzip '
519
+ install_software " $package_provide_bsdtar " ' bsdtar '
515
520
decompression " $LOCAL_FILE "
516
521
else
517
522
# Normal way
@@ -526,7 +531,7 @@ main() {
526
531
echo " removed: $TMP_DIRECTORY "
527
532
exit 0
528
533
fi
529
- install_software ' unzip ' ' unzip '
534
+ install_software " $package_provide_bsdtar " ' bsdtar '
530
535
decompression " $ZIP_FILE "
531
536
elif [[ " $NUMBER " -eq ' 1' ]]; then
532
537
echo " info: No new version. The current version of V2Ray is $CURRENT_VERSION ."
0 commit comments