# 脚本编写: 酷安@董小豪
# 编写: 酷安@董小豪
# 版本: v1.0


mod_name="音效共存功能"
mod_name_1="『ViPER4AndroidFX』"
mod_name_2="[杜比音效立体声]"
mod_source="某些不知名大佬.我们只负责整合"
mod_source_1="pittvandewitt, MrWhite214"
mod_source_2="$coolapk@Wyman丶"
mod_install_desc="包含有$mod_name_1 $mod_name_2。$mod_source"
mod_install_info="是否安装[$mod_name]"
mod_select_yes_text="安装[$mod_name]"
mod_select_yes_desc=""
mod_select_no_text="不安装[$mod_name]"
mod_select_no_desc=""
mod_require_device=".{0,}"
mod_require_version=".{0,}"
mod_require_release=".{0,}"


if [ $var_viper = true ]; then
		ui_print "----------------------------"
		ui_print "    已存在类似的[$mod_name]是否继续安装？"
		ui_print "   [音量+]：继续安装[$mod_name]"
		ui_print "   [音量-]：跳过安装[$mod_name]"
	if $VOLKEY_FUNC; then
		ui_print "   继续安装[$mod_name]"
	else
		ui_print "   跳过安装[$mod_name]"
		MOD_SKIP_INSTALL=true
	fi
fi

mod_install_yes()
{
		mkdir -p $MODPATH/system/priv-app
		mkdir -p $MODPATH/system/etc
		mkdir -p $MODPATH/system/etc/permissions
		mkdir -p $MODPATH/system/vendor/bin/hw
		mkdir -p $MODPATH/system/vendor/lib
		mkdir -p $MODPATH/system/vendor/lib/soundfx
		mkdir -p $MODPATH/system/vendor/etc
		mkdir -p $MODPATH/system/vendor/etc/dolby
		mkdir -p $MODPATH/system/vendor/etc/dts
		mkdir -p $MODPATH/system/vendor/etc/dts/acc
		mkdir -p $MODPATH/system/vendor/lib64
		mkdir -p $MODPATH/system/vendor/lib64/soundfx
		mkdir -p $MODPATH/system/media/theme/default
		cp -rf $MOD_FILES_DIR/00*/* $MODPATH/system

		ui_print " "
		ui_print "  $mod_name_1安装"
		ui_print " - 介绍: 用于给音频渲染各种各样的音频效果。"
		ui_print " - 注意: 声音可能会变大。"
		ui_print " - 来自$mod_source_1"
		ui_print "   [音量+]：安装$mod_name_1"
		ui_print "   [音量-]：跳过安装$mod_name_1"
		if $VOLKEY_FUNC; then
			ui_print "   已选择安装$mod_name_1"
		mkdir -p $MODPATH/system/priv-app/ViperFX
		cp -rf $MOD_FILES_DIR/01*/* $MODPATH/system
		installapk $MOD_FILES_DIR/01_ViperFX/priv-app/ViperFX/ViperFX.apk
			INSTALLED_FUNC="$mod_name_1 $INSTALLED_FUNC"
		else
			ui_print "   跳过安装$mod_name_1"
		fi
		ui_print " "
		ui_print "  $mod_name_2安装"
		ui_print " - 介绍: 能营造出异常清晰、饱满、细致而有深度的音效。"
		ui_print " - 注意: 声音可能会变大。"
		ui_print "   $mod_source_2"
		ui_print "   [音量+]：安装$mod_name_2"
		ui_print "   [音量-]：跳过安装$mod_name_2"
		if $VOLKEY_FUNC; then
			ui_print "   已选择安装$mod_name_2"
		dolby=true
		cp -r $MOD_FILES_DIR/02*/* $MODPATH/system
			INSTALLED_FUNC="$mod_name_2 $INSTALLED_FUNC"
		else
			ui_print "   跳过安装$mod_name_2"
		fi

		add_service_sh $MOD_FILES_DIR/service.sh
		add_postfsdata_sh $MOD_FILES_DIR/post-fs-data.sh

		return 0
}

mod_install_no()
{
		return 0
}