#!/sbin/sh
#CupumTurbo Installer V2.0
Install_SDK=$(getprop ro.build.version.sdk)
if [ ${Install_SDK} -lt 24 ] ; then
 ui_print "only support Android 7.0+ "
 exit 1
fi
ui_print "==============================================="
ui_print "CCCCCC  U    U  PPPPPP  RRRRRR  U    U  M     M"
ui_print "C       U    U  P    P  R    R  U    U  M  M  M"
ui_print "C       U    U  PPPPPP  RRR     U    U  M     M"
ui_print "C       U    U  P       R  R    U    U  M     M"
ui_print "CCCCCC  UUUUUU  P       R    R  UUUUUU  M     M"
ui_print "===================ADJUSTMENT=================="
ui_print "- Copyright (C) Chenzyadb ALL Rights Reserved."
ui_print "- Install Cuprum Turbo MainService..."
rm -rf /data/CuprumTurbo_Lib/
mkdir -p /data/CuprumTurbo_Lib/
unzip -qjo "$ZIPFILE" 'common/bin/cu_perfmode_switch' -d "/data/CuprumTurbo_Lib/" 
unzip -qjo "$ZIPFILE" 'common/bin/get_udclk_freq' -d "/data/CuprumTurbo_Lib/" 
unzip -qjo "$ZIPFILE" 'common/bin/cuprum_serviced' -d "/data/CuprumTurbo_Lib/" 
unzip -qjo "$ZIPFILE" 'common/bin/perf_monitor' -d "/data/CuprumTurbo_Lib/" 
unzip -qjo "$ZIPFILE" 'common/shell/cuprum_daemon.sh' -d "/data/CuprumTurbo_Lib/" 
chmod -R 7777 /data/CuprumTurbo_Lib/
ui_print "- MainService are configured."
ui_print "- Configuring Config files..."
if [ ! -d /data/media/0/CuprumTurbo/ ] ; then
 mkdir -p /data/media/0/CuprumTurbo/
fi
if [ ! -e /data/media/0/CuprumTurbo/custom_boost_list.txt ] ; then
 unzip -qjo "$ZIPFILE" 'common/config/custom_boost_list.txt' -d "/data/media/0/CuprumTurbo/" 
 chmod 7777 /data/media/0/CuprumTurbo/custom_boost_list.txt
fi
rm -rf /data/Cuprum_Info/
rm -rf /data/Cuprum_Custom/
mkdir -p /data/Cuprum_Info/
mkdir -p /data/Cuprum_Custom/
ui_print "- Config files are configured."
ui_print "- 内置自研负载感知引擎学习用户使用习惯."
ui_print "- 一款真正懂你的智能性能调整调度."

