
for l in xp xg lg nd mc;do
 z=`eval echo '$'"$l"`
 if [ $z != 0 ]; then
  cp -rf $TMPDIR/$l/$z/图片/* $MODPATH/zhiwen/res/$a
  cp -rf $TMPDIR/$l/$z/图片/* $MODPATH/zhiwen/nightmode/res/$a
  cp -rf $TMPDIR/$l/$z/图片/* $MODPATH/zhiwen/res/drawable-xxhdpi
  cp -rf $TMPDIR/$l/$z/图片/* $MODPATH/zhiwen/nightmode/res/drawable-xxhdpi
  cd $MODPATH/zhiwen/
  $zip -r ${MODPATH}/com.android.systemui ./* >/dev/null
  sleep 1
 fi
 cp -rf $MODPATH/com.android.systemui /data/system/theme/
 set_perm_recursive /data/system/theme/com.android.systemui 9801 9801 0775 0755  
 echo "$l=$z" >> $MODFILE/beifen
done
  
if $xdc;then
  if [ -e $MODPATH/zhiwen/theme_values.xml ];then
    nl $MODPATH/zhiwen/theme_values.xml | sed  '/battery_meter_use_legacy_drawable/d' -i $MODPATH/zhiwen/theme_values.xml
    sed -i '/<\MIUI_Theme_Values>/a\<bool name="battery_meter_use_legacy_drawable">false<\/bool>' $MODPATH/zhiwen/theme_values.xml
    sed -i '/<\/MIUI_Theme_Values>/i\<bool name="battery_meter_use_legacy_drawable">false<\/bool>' $MODPATH/zhiwen/theme_values.xml
  else
    cp -rf $TMPDIR/theme_values.xml $MODPATH/zhiwen/
  fi
  if [ -e $MODPATH/zhiwen/nightmode/theme_values.xml ];then
    nl $MODPATH/zhiwen/nightmode/theme_values.xml | sed  '/battery_meter_use_legacy_drawable/d' -i $MODPATH/zhiwen/nightmode/theme_values.xml
    sed -i '/<\MIUI_Theme_Values>/a\<bool name="battery_meter_use_legacy_drawable">false<\/bool>' $MODPATH/zhiwen/nightmode/theme_values.xml
    sed -i '/<\/MIUI_Theme_Values>/i\<bool name="battery_meter_use_legacy_drawable">false<\/bool>' $MODPATH/zhiwen/nightmode/theme_values.xml
  else
    cp -rf $TMPDIR/nightmode/theme_values.xml $MODPATH/zhiwen/nightmode/
  fi
  echo "xdc=true" >> $MODFILE/beifen
fi

time6=$(date +%H%M%S)
let "t2=time6-time5"
echo "- 本次压缩共用时$t2 s"
ui_print "- 将在5秒后强制重启系统UI以应用主题"
ui_print "- 5s"
sleep 1
ui_print "- 4s"
sleep 1
ui_print "- 3s"
sleep 1
ui_print "- 2s"
sleep 1
ui_print "- 1s，即将重启系统ui"
sleep 1
killall com.android.systemui
