2020-01-04 23:06:14 +00:00
|
|
|
ui_print " "
|
|
|
|
ui_print "******************************"
|
|
|
|
ui_print "* dnscrypt-proxy-android *"
|
2020-01-31 06:52:26 +00:00
|
|
|
ui_print "* 2.0.38 *"
|
2020-01-04 23:06:14 +00:00
|
|
|
ui_print "******************************"
|
|
|
|
ui_print "* quindecim *"
|
|
|
|
ui_print "******************************"
|
|
|
|
ui_print " "
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$ARCH" == "arm" ];then
|
|
|
|
BINARY_PATH=$TMPDIR/binary/dnscrypt-proxy-arm
|
|
|
|
elif [ "$ARCH" == "arm64" ];then
|
|
|
|
BINARY_PATH=$TMPDIR/binary/dnscrypt-proxy-arm64
|
|
|
|
elif [ "$ARCH" == "x86" ];then
|
|
|
|
BINARY_PATH=$TMPDIR/binary/dnscrypt-proxy-i386
|
|
|
|
elif [ "$ARCH" == "x64" ];then
|
|
|
|
BINARY_PATH=$TMPDIR/binary/dnscrypt-proxy-x86_64
|
|
|
|
fi
|
|
|
|
|
2020-01-05 01:28:44 +00:00
|
|
|
CONFIG_PATH=$TMPDIR/config
|
2020-01-04 23:06:14 +00:00
|
|
|
|
|
|
|
unzip -o "$ZIPFILE" 'config/*' 'binary/*' -d $TMPDIR
|
|
|
|
|
|
|
|
ui_print "* Creating binary path"
|
|
|
|
mkdir -p $MODPATH/system/bin
|
|
|
|
|
|
|
|
ui_print "* Creating config path"
|
|
|
|
mkdir -p /data/media/0/dnscrypt-proxy
|
|
|
|
|
|
|
|
if [ -f "$BINARY_PATH" ]; then
|
2020-01-05 01:28:44 +00:00
|
|
|
ui_print "* Copying binary for $ARCH"
|
2020-01-07 23:35:03 +00:00
|
|
|
cp -af $BINARY_PATH $MODPATH/system/bin/dnscrypt-proxy
|
2020-01-04 23:06:14 +00:00
|
|
|
else
|
|
|
|
abort "Binary file for $ARCH is missing!"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Backup an existing config file before proceed | quindecim
|
|
|
|
|
|
|
|
CONFIG_FILE="/data/media/0/dnscrypt-proxy/dnscrypt-proxy.toml"
|
|
|
|
|
|
|
|
if [ -f "$CONFIG_FILE" ]; then
|
2020-01-05 01:28:44 +00:00
|
|
|
ui_print "* Backing up config file"
|
2020-01-07 23:35:03 +00:00
|
|
|
cp -af $CONFIG_FILE ${CONFIG_FILE}-`date +%Y%m%d%H%M`.bak
|
2020-01-04 23:06:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d "$CONFIG_PATH" ]; then
|
2020-01-05 01:28:44 +00:00
|
|
|
ui_print "* Copying config, example and license files"
|
2020-01-04 23:06:14 +00:00
|
|
|
cp -af $CONFIG_PATH/* /data/media/0/dnscrypt-proxy/
|
|
|
|
else
|
|
|
|
abort "Config file is missing!"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
set_perm_recursive $MODPATH 0 0 0755 0755
|
|
|
|
set_perm $MODPATH/system/bin/dnscrypt-proxy 0 0 0755
|