Вы находитесь на странице: 1из 205

#!

/system/bin/sh
#
# KITANA Tweak
#
# Copyright (C) 2017 tanu598 @ XDA-Developers
# With help from Paget96 & Lennoard Silva
# Thanks to Google, xda and to all users who contribute
#
VER='V6.0.1' > /dev/null 2>&1;
RELEASED='Mon, 20 November' > /dev/null 2>&1;
#
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

DIVIDER='============================================' > /dev/null 2>&1;


CORE='/system/KITANA' > /dev/null 2>&1;
LOGS=$CORE'/LOGS' > /dev/null 2>&1;
INIT='/system/etc/init.d' > /dev/null 2>&1;
BUILD='/system/build.prop' > /dev/null 2>&1;
BIN='/system/bin' > /dev/null 2>&1;
SuperSu='/system/su.d/KI00Init.sh' > /dev/null 2>&1;
MAGISK='/magisk/.core/service.d/KI00Init.sh' > /dev/null 2>&1;
ETC='/system/etc' > /dev/null 2>&1;
SYSCONFIG='/system/etc/sysconfig' > /dev/null 2>&1;
BACKUP=$CORE'/BACKUP' > /dev/null 2>&1;
SDK="$(getprop ro.build.version.sdk)" > /dev/null 2>&1;
SYSINIT_BIN='/system/bin/sysinit' > /dev/null 2>&1;
SYSINIT_XBIN='/system/xbin/sysinit' > /dev/null 2>&1;

BL='\e[01;90m' > /dev/null 2>&1; # Black


R='\e[01;91m' > /dev/null 2>&1; # Red
G='\e[01;92m' > /dev/null 2>&1; # Green
Y='\e[01;93m' > /dev/null 2>&1; # Yellow
B='\e[01;94m' > /dev/null 2>&1; # Blue
P='\e[01;95m' > /dev/null 2>&1; # Purple
C='\e[01;96m' > /dev/null 2>&1; # Cyan
W='\e[01;97m' > /dev/null 2>&1; # White
N='\e[0m' > /dev/null 2>&1; # Null

busybox clear
busybox sleep 0.1
busybox echo -e $Y"$DIVIDER"$N
busybox sleep 0.1
busybox echo ''
busybox sleep 0.1
busybox echo -e $G"WELCOME TO KITANA $VER"$N
busybox sleep 0.1
busybox echo ''
busybox sleep 0.1
busybox echo -e $Y"$DIVIDER"$N
busybox sleep 2
busybox clear
busybox echo -e $W'Checking root'$N; busybox sleep 0.2; busybox clear
busybox echo -e $W'Checking root.'$N; busybox sleep 0.2; busybox clear
busybox echo -e $W'Checking root..'$N; busybox sleep 0.2; busybox clear
busybox echo -e $W'Checking root...'$N; busybox sleep 0.5; busybox clear
busybox echo -e $W'Checking root..'$N; busybox sleep 0.2; busybox clear
busybox echo -e $W'Checking root.'$N; busybox sleep 0.2; busybox clear
busybox echo -e $W'Checking root'$N; busybox sleep 0.2; busybox clear

id="$(id)"; id="${id#*=}"; id="${id%%\(*}"; id="${id%% *}"


if [ "$id" != "0" ] && [ "$id" != "root" ]
then
busybox clear
busybox sleep 0.1
busybox echo -e $Y"$DIVIDER"$N
busybox sleep 0.1
busybox echo ''
busybox sleep 0.1
busybox echo -e $R'Please type su first'$N
busybox sleep 0.1
busybox echo -e $R'then type KITANA...'$N
busybox sleep 0.1
busybox echo ''
busybox sleep 0.1
busybox echo -e $Y"$DIVIDER"$N
exit 0
else
busybox clear
busybox sleep 0.1
busybox echo -e $Y"$DIVIDER"$N
busybox sleep 0.1
busybox echo ''
busybox sleep 0.1
busybox echo -e $G'Cool !!!'$N
busybox sleep 0.1
busybox echo -e $G'your device is rooted...'$N
busybox sleep 0.1
busybox echo ''
busybox sleep 0.1
busybox echo -e $Y"$DIVIDER"$N
busybox sleep 2
fi

setenforce 0 > /dev/null 2>&1;

busybox clear
busybox echo -e $W'Checking init.d support'$N; busybox sleep 0.2; busybox clear
busybox echo -e $W'Checking init.d support.'$N; busybox sleep 0.2; busybox clear
busybox echo -e $W'Checking init.d support..'$N; busybox sleep 0.2; busybox clear
busybox echo -e $W'Checking init.d support...'$N; busybox sleep 0.5; busybox clear
busybox echo -e $W'Checking init.d support..'$N; busybox sleep 0.2; busybox clear
busybox echo -e $W'Checking init.d support.'$N; busybox sleep 0.2; busybox clear
busybox echo -e $W'Checking init.d support'$N; busybox sleep 0.2; busybox clear
if [ -f "$SuperSu" ] || [ -f "$MAGISK" ]
then
busybox clear
busybox sleep 0.1
busybox echo -e $Y"$DIVIDER"$N
busybox sleep 0.1
busybox echo ''
busybox sleep 0.1
busybox echo -e $G'Awesome !!!'$N
busybox sleep 0.1
busybox echo -e $G'you have KITANA init.d enabler'$N
busybox sleep 0.1
busybox echo ''
busybox sleep 0.1
busybox echo -e $Y"$DIVIDER"$N
busybox sleep 2
elif [ -f "$SYSINIT_BIN" ] || [ -f "$SYSINIT_XBIN" ]
then
busybox clear
busybox sleep 0.1
busybox echo -e $Y"$DIVIDER"$N
busybox sleep 0.1
busybox echo ''
busybox sleep 0.1
busybox echo -e $G'Good you have default init.d support'$N
busybox sleep 0.1
busybox echo -e $G'if not work then use KITANA init.d support'$N
busybox sleep 0.1
busybox echo ''
busybox sleep 0.1
busybox echo -e $Y"$DIVIDER"$N
busybox sleep 2
fi

mount -o rw,remount,rw '/system' > /dev/null 2>&1;


mount -o rw,remount,rw '/data' > /dev/null 2>&1;
busybox mount -o rw,remount,rw '/system' > /dev/null 2>&1;
busybox mount -o rw,remount,rw '/data' > /dev/null 2>&1;

if [ ! -d "$INIT" ]
then
busybox mkdir -p "$INIT" > /dev/null 2>&1;
busybox chmod 755 "$INIT" > /dev/null 2>&1;
busybox chown 0:0 "$INIT" > /dev/null 2>&1;
fi
if [ ! -d "$CORE" ]
then
busybox mkdir -p "$CORE" > /dev/null 2>&1;
busybox chmod 755 "$CORE" > /dev/null 2>&1;
busybox chown 0:0 "$CORE" > /dev/null 2>&1;
fi
if [ ! -d "$LOGS" ]
then
busybox mkdir -p "$LOGS" > /dev/null 2>&1;
busybox chmod 755 "$LOGS" > /dev/null 2>&1;
busybox chown 0:0 "$LOGS" > /dev/null 2>&1;
fi
if [ ! -d "$BACKUP" ]
then
busybox mkdir -p "$BACKUP" > /dev/null 2>&1;
busybox chmod 755 "$BACKUP" > /dev/null 2>&1;
busybox chown 0:0 "$BACKUP" > /dev/null 2>&1;
fi
if [ ! -f $BACKUP'/KI00Profile' ]
then
busybox touch $BACKUP'/KI00Profile' > /dev/null 2>&1;
busybox chmod 755 $BACKUP'/KI00Profile' > /dev/null 2>&1;
busybox chown 0:0 $BACKUP'/KI00Profile' > /dev/null 2>&1;
fi
if [ ! -f $BACKUP'/KI00Host' ]
then
CURRENT_HOST="$(getprop net.hostname)" > /dev/null 2>&1;
busybox touch $BACKUP'/KI00Host' > /dev/null 2>&1;
busybox chmod 755 $BACKUP'/KI00Host' > /dev/null 2>&1;
busybox chown 0:0 $BACKUP'/KI00Host' > /dev/null 2>&1;
busybox echo "$CURRENT_HOST" > $BACKUP'/KI00Host'
fi
if [ ! -f $BACKUP'/KI00Backup_DPI' ]
then
busybox echo `getprop ro.sf.lcd_density` > $BACKUP'/KI00Backup_DPI'
busybox chmod 755 $BACKUP'/KI00Backup_DPI' > /dev/null 2>&1;
busybox chown 0:0 $BACKUP'/KI00Backup_DPI' > /dev/null 2>&1;
fi
if [ ! -f $BACKUP'/KI00Google.xml' ]
then
busybox cp -f $SYSCONFIG'/google.xml' $BACKUP'/KI00Google.xml' > /dev/null
2>&1;
busybox chmod 755 $BACKUP'/KI00Google.xml' > /dev/null 2>&1;
busybox chown 0:0 $BACKUP'/KI00Google.xml' > /dev/null 2>&1;
fi
if [ ! -f $BACKUP'/KI00Google_Build.xml' ]
then
busybox cp -f $SYSCONFIG'/google_build.xml' $BACKUP'/KI00Google_Build.xml'
> /dev/null 2>&1;
busybox chmod 755 $BACKUP'/KI00Google_Build.xml' > /dev/null 2>&1;
busybox chown 0:0 $BACKUP'/KI00Google_Build.xml' > /dev/null 2>&1;
fi
if [ ! -f $BACKUP'/KI00Nexus.xml' ]
then
busybox cp -f $SYSCONFIG'/nexus.xml' $BACKUP'/KI00Nexus.xml' > /dev/null
2>&1;
busybox chmod 755 $BACKUP'/KI00Nexus.xml' > /dev/null 2>&1;
busybox chown 0:0 $BACKUP'/KI00Nexus.xml' > /dev/null 2>&1;
fi
if [ ! -f $BACKUP'/KI00Pixel.xml' ]
then
busybox cp -f $SYSCONFIG'/pixel_2017.xml' $BACKUP'/KI00Pixel.xml' > /dev/null
2>&1;
busybox chmod 755 $BACKUP'/KI00Pixel.xml' > /dev/null 2>&1;
busybox chown 0:0 $BACKUP'/KI00Pixel.xml' > /dev/null 2>&1;
fi
if [ ! -f $BACKUP'/KI00Pixel_Ex.xml' ]
then
busybox cp -f $SYSCONFIG'/pixel_2017_exclusive.xml'
$BACKUP'/KI00Pixel_Ex.xml' > /dev/null 2>&1;
busybox chmod 755 $BACKUP'/KI00Pixel_Ex.xml' > /dev/null 2>&1;
busybox chown 0:0 $BACKUP'/KI00Pixel_Ex.xml' > /dev/null 2>&1;
fi
if [ ! -f $BACKUP'/KI00Build' ]
then
busybox cp -f $BUILD $BACKUP/KI00Build
busybox chmod 755 $BACKUP/KI00Build
busybox chown 0:0 $BACKUP/KI00Build
fi

busybox rm -f $BIN'/KITANA_FSTRIM' > /dev/null 2>&1;


busybox rm -f $BIN'/KITANA_BOOST' > /dev/null 2>&1;
busybox rm -f $BIN'/KITANA_CLEANER' > /dev/null 2>&1;
busybox rm -f $BIN'/KITANA_WIFI' > /dev/null 2>&1;

for FILES in $CORE/KI*


do
busybox rm -f "$FILES" > /dev/null 2>&1;
done

###################################################################################
###################################################################################
###############
#
# init.d & Others Property
#
###################################################################################
###################################################################################
###############
#
#
# KITANA init.d Enabler
#
#
busybox cat >> $CORE'/KI00Init.d' << KITANA
#!/system/bin/sh
#
# KITANA
#
busybox run-parts /system/etc/init.d
KITANA
busybox chmod 755 $CORE'/KI00Init.d' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Init.d' > /dev/null 2>&1;
#
#
# Boost binary
#
#
busybox cat >> $CORE'/KI00Boost' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Boost.log' > /dev/null 2>&1;


mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Boosting...' | busybox tee -a \$KI


busybox echo ''
busybox free | busybox awk '/Mem/{print ">>>...Memory before boosting : "\$4/1024"
MB";}' | busybox tee -a \$KI
busybox sleep 1
busybox echo ''
busybox echo 'Dropping cache...' | busybox tee -a \$KI
sync
busybox sleep 1
busybox sysctl -w vm.drop_caches=3
busybox sleep 1
dc=/proc/sys/vm/drop_caches
dc_v=\$(busybox cat \$dc)
if [ "\$dc_v" -gt 1 ]
then
busybox sysctl -w vm.drop_caches=1
fi
busybox echo ''
busybox echo ''
busybox echo 'Boosted !!!' | busybox tee -a \$KI
busybox echo ''
busybox echo ''
busybox free | busybox awk '/Mem/{print ">>>...Memory after oosting : "\$4/1024"
MB";}' | busybox tee -a \$KI
busybox sleep 3

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Boost' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Boost' > /dev/null 2>&1;
#
#
# Fstrim binary
#
#
busybox cat >> $CORE'/KI00Fstrim' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Fstrim.log' > /dev/null 2>&1;


mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Applying Fstrim...' | busybox tee -a \$KI


if [ -d /cache ]
then
busybox fstrim -v /cache | busybox tee -a \$KI
fi
if [ -d /data ]
then
busybox fstrim -v /data | busybox tee -a \$KI
fi
if [ -d /system ]
then
busybox fstrim -v /system | busybox tee -a \$KI
fi
if [ -d /magisk ]
then
busybox fstrim /magisk
fi
if [ -d /preload ]
then
busybox fstrim -v /preload | busybox tee -a \$KI
fi
if [ -d /data/sdext2 ]
then
busybox fstrim -v /data/sdext2 | busybox tee -a \$KI
fi
busybox echo 'Fstrim is done !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Fstrim' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Fstrim' > /dev/null 2>&1;
#
#
# Shortcut Boost binary
#
#
busybox cat >> "$BIN/KITANA_BOOST" << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#
mount -o rw,remount,rw '/system' > /dev/null 2>&1;

busybox clear
busybox echo 'Boosting...'
busybox echo ''
busybox free | busybox awk '/Mem/{print ">>>...Memory before boosting : "\$4/1024"
MB";}'
busybox sleep 1
busybox echo ''
busybox echo 'Dropping cache...'
sync
busybox sleep 1
busybox sysctl -w vm.drop_caches=3
busybox sleep 1
dc=/proc/sys/vm/drop_caches
dc_v=\$(busybox cat \$dc)
if [ "\$dc_v" -gt 1 ]
then
busybox sysctl -w vm.drop_caches=1
fi
busybox echo ''
busybox echo ''
busybox echo 'Boosted !!!'
busybox echo ''
busybox echo ''
busybox free | busybox awk '/Mem/{print ">>>...Memory after Boosting : "\$4/1024"
MB";}'
busybox sleep 3

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $BIN'/KITANA_BOOST' > /dev/null 2>&1;
busybox chown 0:2000 $BIN'/KITANA_BOOST' > /dev/null 2>&1;
#
#
# Shortcut Fstrim binary
#
#
busybox cat >> $BIN'/KITANA_FSTRIM' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

busybox clear
busybox echo 'Applying Fstrim...'
busybox sleep 1
busybox echo ''
if [ -d /cache ]
then
busybox fstrim -v /cache
busybox sleep 0.5
fi
if [ -d /data ]
then
busybox fstrim -v /data
busybox sleep 0.5
fi
if [ -d /system ]
then
busybox fstrim -v /system
busybox sleep 0.5
fi
if [ -d /magisk ]
then
busybox fstrim -v /magisk
busybox sleep 0.5
fi
if [ -d /preload ]
then
busybox fstrim -v /preload
busybox sleep 0.5
fi
if [ -d /data/sdext2 ]
then
busybox fstrim -v /data/sdext2
busybox sleep 0.5
fi
busybox echo ''
busybox sleep 1
busybox echo 'Fstrim is done !!!'

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $BIN'/KITANA_FSTRIM' > /dev/null 2>&1;
busybox chown 0:2000 $BIN'/KITANA_FSTRIM' > /dev/null 2>&1;
#
#
# Shortcut Clean Master
#
#
busybox cat >> $BIN'/KITANA_CLEANER' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

busybox clear
busybox echo 'Cleaning......'
busybox echo ''
busybox echo 'Cleaner script is running...'
busybox sleep 1
busybox rm -f /cache/*.apk > /dev/null 2>&1;
busybox rm -f /cache/*.tmp > /dev/null 2>&1;
busybox rm -f /cache/*.log > /dev/null 2>&1;
busybox rm -f /cache/*.txt > /dev/null 2>&1;
busybox rm -f /cache/recovery/* > /dev/null 2>&1;
busybox rm -f /data/*.log > /dev/null 2>&1;
busybox rm -f /data/*.txt > /dev/null 2>&1;
busybox rm -f /data/anr/*.log > /dev/null 2>&1;
busybox rm -f /data/anr/*.txt > /dev/null 2>&1;
busybox rm -f /data/backup/pending/*.tmp > /dev/null 2>&1;
busybox rm -f /data/cache/*.* > /dev/null 2>&1;
busybox rm -f /data/dalvik-cache/*.apk > /dev/null 2>&1;
busybox rm -f /data/dalvik-cache/*.tmp > /dev/null 2>&1;
busybox rm -f /data/dalvik-cache/*.log > /dev/null 2>&1;
busybox rm -f /data/dalvik-cache/*.txt > /dev/null 2>&1;
busybox rm -f /data/data/*.log > /dev/null 2>&1;
busybox rm -f /data/data/*.txt > /dev/null 2>&1;
busybox rm -f /data/log/*.log > /dev/null 2>&1;
busybox rm -f /data/log/*.txt > /dev/null 2>&1;
busybox rm -f /data/local/*.apk > /dev/null 2>&1;
busybox rm -f /data/local/*.log > /dev/null 2>&1;
busybox rm -f /data/local/*.txt > /dev/null 2>&1;
busybox rm -f /data/local/tmp/*.log > /dev/null 2>&1;
busybox rm -f /data/local/tmp/*.txt > /dev/null 2>&1;
busybox rm -f /data/last_alog/*.log > /dev/null 2>&1;
busybox rm -f /data/last_alog/*.txt > /dev/null 2>&1;
busybox rm -f /data/last_kmsg/*.log > /dev/null 2>&1;
busybox rm -f /data/last_kmsg/*.txt > /dev/null 2>&1;
busybox rm -f /data/mlog/* > /dev/null 2>&1;
busybox rm -f /data/tombstones/*.log > /dev/null 2>&1;
busybox rm -f /data/tombstones/*.txt > /dev/null 2>&1;
busybox rm -f /data/system/*.log > /dev/null 2>&1;
busybox rm -f /data/system/*.txt > /dev/null 2>&1;
busybox rm -f /data/system/dropbox/*.log > /dev/null 2>&1;
busybox rm -f /data/system/dropbox/*.txt > /dev/null 2>&1;
busybox rm -f /data/system/usagestats/*.log > /dev/null 2>&1;
busybox rm -f /data/system/usagestats/*.txt > /dev/null 2>&1;
busybox echo ''
busybox echo 'OK done !!!'

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $BIN'/KITANA_CLEANER' > /dev/null 2>&1;
busybox chown 0:2000 $BIN'/KITANA_CLEANER' > /dev/null 2>&1;
#
#
# Shortcut WiFi Password
#
#
busybox cat >> $BIN'/KITANA_WIFI' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

ssid="grep ssid="*" /data/misc/wifi/wpa_supplicant.conf" > dev/null 2>&1;


psk="grep psk="*" /data/misc/wifi/wpa_supplicant.conf" > dev/null 2>&1;
key_mgmt="grep key_mgmt="*" /data/misc/wifi/wpa_supplicant.conf" > dev/null 2>&1;
while :
do
busybox clear;
busybox echo ''
busybox echo -e 'Wifi names'
\$ssid
busybox echo ''
busybox echo -e 'wifi passwords'
\$psk
busybox echo ''
busybox echo -e 'Security type'
\$key_mgmt
busybox echo ''
busybox echo -e -n 'Options:[ Export to SD = 1 | Exit = 0 ] : '
read option
case \$option in
1)
busybox echo ''
busybox echo 'Wifi names' > /sdcard/PASS.export
busybox grep ssid /data/misc/wifi/wpa_supplicant.conf >> /sdcard/PASS.export
busybox echo '' >> /sdcard/PASS.export
busybox echo 'Wifi passwords' >> /sdcard/PASS.export
busybox grep psk /data/misc/wifi/wpa_supplicant.conf >> /sdcard/PASS.export
busybox echo '' >> /sdcard/PASS.export
busybox echo 'Security type' >> /sdcard/PASS.export
busybox grep key_mgmt /data/misc/wifi/wpa_supplicant.conf >>
/sdcard/PASS.export
busybox echo 'Exporting finished'
busybox sleep 1
;;
*)
exit
esac
done
KITANA
busybox chmod 755 $BIN'/KITANA_WIFI' > /dev/null 2>&1;
busybox chown 0:2000 $BIN'/KITANA_WIFI' > /dev/null 2>&1;
#
#
# Google DNS
#
#
busybox cat >> $CORE'/KI00Google_DNS' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Google_DNS.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Google DNS Tweak is Applying...' | busybox tee -a \$KI


iptables -t nat -I OUTPUT -p tcp --dport 53 -j DNAT --to-destination 8.8.8.8:53
> /dev/null 2>&1;
iptables -t nat -I OUTPUT -p udp --dport 53 -j DNAT --to-destination 8.8.8.8:53
> /dev/null 2>&1;
busybox echo 'Google DNS Tweak is successfully Applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Google_DNS' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Google_DNS' > /dev/null 2>&1;
#
#
# Google Play Service Doze Enabler
#
#
busybox cat >> $CORE'/KI00Google_Doze' << KITANA
<?xml version="1.0" encoding="utf-8"?>
<!-- KITANA -->
<!-- Copyright (C) 2014 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");


you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software


distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- These are configurations that must exist on all GMS devices. -->
<config>
<!-- These are the standard packages that are white-listed to always have
internet
access while in power save mode, even if they aren't in the foreground.
-->

<!-- GmsCore must always have network access for GCM and other things. -->
<!-- allow-in-power-save package="com.google.android.gms" />
<!-- allow-in-data-usage-save package="com.google.android.gms" />

<!-- Play Store likewise must have network access to support other
applications. -->
<!-- allow-in-power-save-except-idle package="com.android.vending" />

<!-- If the volta app is pre-installed (for monitoring power use), let it do
checkins. -->
<!-- allow-in-power-save package="com.google.android.volta" />

<!-- If CarrierServices is installed, it must always have network access to


reliably receive IMS messages. -->
<!-- allow-in-power-save package="com.google.android.ims" />
<allow-in-data-usage-save package="com.google.android.ims" />

<!-- These Google applications all handle URLs to their websites by default -->

<!-- Apps below are required on all GMS devices -->


<app-link package="com.android.vending" />
<app-link package="com.google.android.apps.maps" />
<app-link package="com.google.android.youtube" />
<app-link package="com.google.android.apps.docs" />
<app-link package="com.google.android.talk" />
<app-link package="com.google.android.apps.photos" />
<app-link package="com.google.android.music" />

<!-- Apps below are optional on GMS devices -->


<app-link package="com.google.android.apps.tycho" />
<app-link package="com.google.android.apps.plus" />
<app-link package="com.google.android.apps.docs.editors.sheets" />
<app-link package="com.google.android.apps.docs.editors.slides" />
<app-link package="com.google.android.apps.docs.editors.docs" />
<app-link package="com.google.android.talk" />
<app-link package="com.google.android.videos" />
<app-link package="com.google.android.calendar" />

<!-- These are the packages that are white-listed to be able to run as system
user -->
<system-user-whitelisted-app package="com.android.vending" />
<system-user-whitelisted-app package="com.google.android.gms" />
<system-user-whitelisted-app package="com.google.android.gms.policy_auth" />
<system-user-whitelisted-app package="com.google.android.play.games" />

<!-- These are the packages that are uninstalled for system user -->
<!-- Apps below are required on all GMS devices -->
<system-user-blacklisted-app
package="com.google.android.googlequicksearchbox" />
<!-- Apps below are optional on GMS devices -->
<system-user-blacklisted-app package="com.google.android.launcher" />
<!-- Whitelist of what components are permitted as backup data transports. The
'service' attribute here is a flattened ComponentName string. -->
<backup-transport-whitelisted-service
service="android/com.android.internal.backup.LocalTransportService" />
<backup-transport-whitelisted-service
service="com.google.android.gms/.backup.BackupTransportService" />
<backup-transport-whitelisted-service
service="com.google.android.gms/.backup.component.D2dTransportService" />
</config>
KITANA
busybox chmod 755 $CORE'/KI00Google_Doze' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Google_Doze' > /dev/null 2>&1;
#
#
# Nexus sysconfig for unlimited drive storage
#
#
busybox cat >> $CORE'/KI00Nexus' << KITANA
<?xml version="1.0" encoding="utf-8"?>
<!-- KITANA -->
<!-- These are configurations that should exist on Google's 2016 and newer Nexus
devices. -->
<config>
<!-- This is meant to be the canonical feature identifying 2016 and newer Nexus
devices. -->
<feature name="com.google.android.feature.PIXEL_EXPERIENCE" />

<!-- Both versions of this string are needed due to a miscommunication.


b/29978934 -->
<feature name="com.google.android.apps.photos.NEXUS_PRELOAD" />
<feature name="com.google.android.apps.photos.nexus_preload" />
</config>
KITANA
busybox chmod 755 $CORE'/KI00Nexus' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Nexus' > /dev/null 2>&1;
#
#
# Google Build Sysconfig
#
#
busybox cat >> $CORE'/KI00Google_Build' << KITANA
<?xml version="1.0" encoding="utf-8"?>
<!-- KITANA -->
<!-- Copyright (C) 2014 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");


you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software


distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- These are configurations that should exist on Google's own Nexus and GPe
devices. -->
<config>
<feature name="com.google.android.feature.GOOGLE_BUILD" />
<!-- This should be added to all Nexus and GPe devices -->
<feature name="com.google.android.feature.GOOGLE_EXPERIENCE" />
<!-- This should declare the version of Exchange that ships -->
<feature name="com.google.android.feature.EXCHANGE_6_2" />

<!-- If the tycho app is pre-installed and a matching sim inserted,


it temporarily needs internet for messaging, etc -->
<allow-in-power-save package="com.google.android.apps.tycho" />
</config>
KITANA
busybox chmod 755 $CORE'/KI00Google_Build' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Google_Build' > /dev/null 2>&1;
#
#
# Pixel Exclusive
#
#
busybox cat >> $CORE/KI00Pixel_Exclusive << KITANA
<?xml version="1.0" encoding="utf-8"?>
<!-- KITANA -->
<!-- These are configurations that should exist on Google's 2017 devices (and not
newer/older) -->
<config>
<!-- This defines the Photos preload feature for specifically the 2017 Pixel
devices. -->
<feature name="com.google.android.apps.photos.PIXEL_2017_PRELOAD" />
</config>
KITANA
busybox chmod 755 $CORE/KI00Pixel_Exclusive > /dev/null 2>&1;
busybox chowm 0:0 $CORE/KI00Pixel_Exclusive > /dev/null 2>&1;
#
#
# Pixle
#
#
busybox cat >> $CORE/KI00Pixel << KITANA
<?xml version="1.0" encoding="utf-8"?>
<!-- KITANA -->
<!-- These are configurations that should exist on Google's 2017 and newer Nexus
devices. -->
<config>
<!-- This is meant to be the canonical feature identifying 2017 and newer Nexus
devices. -->
<feature name="com.google.android.feature.PIXEL_2017_EXPERIENCE" />
</config>
KITANA
busybox chmod 755 $CORE/KI00Pixel > /dev/null 2>&1;
busybox chowm 0:0 $CORE/KI00Pixel > /dev/null 2>&1;
#
#
# Balanced ram manager
#
#
busybox cat >> $CORE'/KI00Ram_Manager_Balance' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Ram_Manager.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Ram Manager Balance is applying...' | busybox tee -a \$KI


if [ -e /sys/module/lowmemorykiller/parameters/cost ]
then
busybox chmod 644 /sys/module/lowmemorykiller/parameters/cost > /dev/null
2>&1;
busybox echo '32' > /sys/module/lowmemorykiller/parameters/cost
fi
if [ -e /sys/module/lowmemorykiller/parameters/debug_level ]
then
busybox chmod 644 /sys/module/lowmemorykiller/parameters/debug_level >
/dev/null 2>&1;
busybox echo '0' > /sys/module/lowmemorykiller/parameters/debug_level
fi
RAM=\$((\$(busybox awk '/MemTotal/{print \$2}' /proc/meminfo)/1024)) > /dev/null
2>&1;
lmk1=\$((RAM*3*1024/100/4));
lmk2=\$((RAM*4*1024/100/4));
lmk3=\$((RAM*5*1024/100/4));
lmk4=\$((RAM*7*1024/100/4));
lmk5=\$((RAM*9*1024/100/4));
lmk6=\$((RAM*10*1024/100/4));
if [ -e /sys/module/lowmemorykiller/parameters/minfree ]
then
busybox chmod 644 /sys/module/lowmemorykiller/parameters/minfree > /dev/null
2>&1;
busybox echo "\$lmk1,\$lmk2,\$lmk3,\$lmk4,\$lmk5,\$lmk6" >
/sys/module/lowmemorykiller/parameters/minfree
busybox echo "Balanced RAM manager for \$RAM mb devices successfully
applied..." | busybox tee -a \$KI
else
busybox echo "Balanced RAM manager for \$RAM mb devices successfully not
applied !!!" | busybox tee -a \$KI
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Ram_Manager_Balance' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Ram_Manager_Balance' > /dev/null 2>&1;
#
#
# Gaming ram manager
#
#
busybox cat >> $CORE'/KI00Ram_Manager_Gaming' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Ram_Manager.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Ram Manager Gaming is applying...' | busybox tee -a \$KI


if [ -e /sys/module/lowmemorykiller/parameters/cost ]
then
busybox chmod 644 /sys/module/lowmemorykiller/parameters/cost > /dev/null
2>&1;
busybox echo '16' > /sys/module/lowmemorykiller/parameters/cost
fi
if [ -e /sys/module/lowmemorykiller/parameters/debug_level ]
then
busybox chmod 644 /sys/module/lowmemorykiller/parameters/debug_level >
/dev/null 2>&1;
busybox echo '0' > /sys/module/lowmemorykiller/parameters/debug_level
fi
if [ -e /sys/module/lowmemorykiller/parameters/adj ]
then
busybox chmod 644 /sys/module/lowmemorykiller/parameters/adj > /dev/null
2>&1;
busybox echo '0,1,3,5,7,15' > /sys/module/lowmemorykiller/parameters/adj
fi
RAM=\$((\$(busybox awk '/MemTotal/{print \$2}' /proc/meminfo)/1024)) > /dev/null
2>&1;
lmk1=\$((RAM*2*1024/100/4));
lmk2=\$((RAM*3*1024/100/4));
lmk3=\$((RAM*6*1024/100/4));
lmk4=\$((RAM*10*1024/100/4));
lmk5=\$((RAM*14*1024/100/4));
lmk6=\$((RAM*15*1024/100/4));
if [ -e /sys/module/lowmemorykiller/parameters/minfree ]
then
busybox chmod 644 /sys/module/lowmemorykiller/parameters/minfree > /dev/null
2>&1;
busybox echo "\$lmk1,\$lmk2,\$lmk3,\$lmk4,\$lmk5,\$lmk6" >
/sys/module/lowmemorykiller/parameters/minfree
busybox echo "Gaming RAM manager for \$RAM mb devices successfully
applied !!!" | busybox tee -a \$KI
else
busybox echo "Gaming RAM manager for \$RAM mb devices successfully not
applied !!!"| busybox tee -a \$KI
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Ram_Manager_Gaming' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Ram_Manager_Gaming' > /dev/null 2>&1;
#
#
# Multitasking ram manager
#
#
busybox cat >> $CORE'/KI00Ram_Manager_Multitasking' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Ram_Manager.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Ram Manager Multitasking is applying...' | busybox tee -a \$KI


if [ -e /sys/module/lowmemorykiller/parameters/cost ]
then
busybox chmod 644 /sys/module/lowmemorykiller/parameters/cost > /dev/null
2>&1;
busybox echo '64' > /sys/module/lowmemorykiller/parameters/cost
fi
if [ -e /sys/module/lowmemorykiller/parameters/debug_level ]
then
busybox chmod 644 /sys/module/lowmemorykiller/parameters/debug_level >
/dev/null 2>&1;
busybox echo '0' > /sys/module/lowmemorykiller/parameters/debug_level
fi
if [ -e /sys/module/lowmemorykiller/parameters/adj ]
then
busybox chmod 644 /sys/module/lowmemorykiller/parameters/adj > /dev/null
2>&1;
busybox echo '0,1,3,5,7,15' > /sys/module/lowmemorykiller/parameters/adj
fi
RAM=\$((\$(busybox awk '/MemTotal/{print \$2}' /proc/meminfo)/1024))
lmk1=\$((RAM*2*1024/100/4));
lmk2=\$((RAM*3*1024/100/4));
lmk3=\$((RAM*4*1024/100/4));
lmk4=\$((RAM*5*1024/100/4));
lmk5=\$((RAM*6*1024/100/4));
lmk6=\$((RAM*7*1024/100/4));
if [ -e /sys/module/lowmemorykiller/parameters/minfree ]
then
busybox chmod 644 /sys/module/lowmemorykiller/parameters/minfree > /dev/null
2>&1;
busybox echo "\$lmk1,\$lmk2,\$lmk3,\$lmk4,\$lmk5,\$lmk6" >
/sys/module/lowmemorykiller/parameters/minfree
busybox echo "Multitasking RAM manager for \$RAM mb devices successfully
applied !!!" | busybox tee -a \$KI
else
busybox echo "Multitasking RAM manager for \$RAM mb devices successfully not
applied !!!" | busybox tee -a \$KI
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Ram_Manager_Multitasking' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Ram_Manager_Multitasking' > /dev/null 2>&1;
#
#
# Battery saving kernel tweak
#
#
busybox cat >> $CORE'/KI00Battery_Kernel_Tweak' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Kernel_Tweak.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Battery kernel tweak is applying...' | busybox tee -a \$KI


if [ -e /proc/sys/fs/leases-enable ]
then
busybox echo '1' > /proc/sys/fs/leases-enable
fi
if [ -e /proc/sys/fs/lease-break-time ]
then
busybox echo '10' > /proc/sys/fs/lease-break-time
fi
if [ -e /proc/sys/fs/inotify/max_queued_events ]
then
busybox echo '32768' > /proc/sys/fs/inotify/max_queued_events
fi
if [ -e /proc/sys/fs/inotify/max_user_instances ]
then
busybox echo '256' > /proc/sys/fs/inotify/max_user_instances
fi
if [ -e /proc/sys/fs/inotify/max_user_watches ]
then
busybox echo '16384' > /proc/sys/fs/inotify/max_user_watches
fi
if [ -e /proc/sys/vm/min_free_order_shift ]
then
busybox echo '4' > /proc/sys/vm/min_free_order_shift
fi
if [ -e /proc/sys/vm/dirty_expire_centisecs ]
then
busybox echo '100' > /proc/sys/vm/dirty_expire_centisecs
fi
if [ -e /proc/sys/vm/dirty_writeback_centisecs ]
then
busybox echo '200' > /proc/sys/vm/dirty_writeback_centisecs
fi
if [ -e /proc/sys/vm/dirty_background_ratio ]
then
busybox echo '20' > /proc/sys/vm/dirty_background_ratio
fi
if [ -e /proc/sys/vm/dirty_ratio ]
then
busybox echo '40' > /proc/sys/vm/dirty_ratio
fi
if [ -e /proc/sys/vm/page-cluster ]
then
busybox echo '0' > /proc/sys/vm/page-cluster
fi
if [ -e /proc/sys/vm/highmem_is_dirtyable ]
then
busybox echo '1' > /proc/sys/vm/highmem_is_dirtyable
fi
busybox echo 'Battery kernel tweak is successfully applied !!!' | busybox tee -a \
$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Battery_Kernel_Tweak' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Battery_Kernel_Tweak' > /dev/null 2>&1;
#
#
# Balanced kernel tweak
#
#
busybox cat >> $CORE'/KI00Balanced_Kernel_Tweak' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Kernel_Tweak.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Balanced kernel tweak is applying...' | busybox tee -a \$KI


if [ -e /proc/sys/fs/leases-enable ]
then
busybox echo '1' > /proc/sys/fs/leases-enable
fi
if [ -e /proc/sys/fs/lease-break-time ]
then
busybox echo '10' > /proc/sys/fs/lease-break-time
fi
if [ -e /proc/sys/fs/inotify/max_queued_events ]
then
busybox echo '24576' > /proc/sys/fs/inotify/max_queued_events
fi
if [ -e /proc/sys/fs/inotify/max_user_instances ]
then
busybox echo '192' > /proc/sys/fs/inotify/max_user_instances
fi
if [ -e /proc/sys/fs/inotify/max_user_watches ]
then
busybox echo '12288' > /proc/sys/fs/inotify/max_user_watches
fi
if [ -e /proc/sys/vm/min_free_order_shift ]
then
busybox echo '4' > /proc/sys/vm/min_free_order_shift
fi
if [ -e /proc/sys/vm/dirty_expire_centisecs ]
then
busybox echo '500' > /proc/sys/vm/dirty_expire_centisecs
fi
if [ -e /proc/sys/vm/dirty_writeback_centisecs ]
then
busybox echo '700' > /proc/sys/vm/dirty_writeback_centisecs
fi
if [ -e /proc/sys/vm/dirty_background_ratio ]
then
busybox echo '10' > /proc/sys/vm/dirty_background_ratio
fi
if [ -e /proc/sys/vm/dirty_ratio ]
then
busybox echo '20' > /proc/sys/vm/dirty_ratio
fi
if [ -e /proc/sys/vm/page-cluster ]
then
busybox echo '0' > /proc/sys/vm/page-cluster
fi
if [ -e /proc/sys/vm/highmem_is_dirtyable ]
then
busybox echo '1' > /proc/sys/vm/highmem_is_dirtyable
fi
busybox echo 'Balanced kernel tweak is successfully applied !!!' | busybox tee -a \
$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Balanced_Kernel_Tweak' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Balanced_Kernel_Tweak' > /dev/null 2>&1;
#
#
# Performance kernel tweak
#
#
busybox cat >> $CORE'/KI00Performance_Kernel_Tweak' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Kernel_Tweak.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Performance kernel tweak is applying...' | busybox tee -a \$KI


if [ -e /proc/sys/fs/leases-enable ]
then
busybox echo '1' > /proc/sys/fs/leases-enable
fi
if [ -e /proc/sys/fs/lease-break-time ]
then
busybox echo '10' > /proc/sys/fs/lease-break-time
fi
if [ -e /proc/sys/fs/inotify/max_queued_events ]
then
busybox echo '17408' > /proc/sys/fs/inotify/max_queued_events
fi
if [ -e /proc/sys/fs/inotify/max_user_instances ]
then
busybox echo '136' > /proc/sys/fs/inotify/max_user_instances
fi
if [ -e /proc/sys/fs/inotify/max_user_watches ]
then
busybox echo '8704' > /proc/sys/fs/inotify/max_user_watches
fi
if [ -e /proc/sys/vm/min_free_order_shift ]
then
busybox echo '4' > /proc/sys/vm/min_free_order_shift
fi
if [ -e /proc/sys/vm/dirty_expire_centisecs ]
then
busybox echo '900' > /proc/sys/vm/dirty_expire_centisecs
fi
if [ -e /proc/sys/vm/dirty_writeback_centisecs ]
then
busybox echo '1500' > /proc/sys/vm/dirty_writeback_centisecs
fi
if [ -e /proc/sys/vm/dirty_background_ratio ]
then
busybox echo '5' > /proc/sys/vm/dirty_background_ratio
fi
if [ -e /proc/sys/vm/dirty_ratio ]
then
busybox echo '10' > /proc/sys/vm/dirty_ratio
fi
if [ -e /proc/sys/vm/page-cluster ]
then
busybox echo '0' > /proc/sys/vm/page-cluster
fi
if [ -e /proc/sys/vm/highmem_is_dirtyable ]
then
busybox echo '1' > /proc/sys/vm/highmem_is_dirtyable
fi
busybox echo 'Performance kernel tweak is successfully applied !!!' | busybox tee
-a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Performance_Kernel_Tweak' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Performance_Kernel_Tweak' > /dev/null 2>&1;
#
#
# I/O Boost tweak
#
#
busybox cat >> $CORE'/KI00IOBoost' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00IOBoost.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Applying I/O Boost...' | busybox tee -a \$KI


path="/sys/block/*" > /dev/null 2>&1;
for IOB in \$path
do
if [ -e \$IOB/queue/rq_affinity ]
then
busybox echo '0' > \$IOB/queue/rq_affinity
fi
if [ -e \$IOB/queue/nomerges ]
then
busybox echo '1' > \$IOB/queue/nomerges
fi
if [ -e \$IOB/queue/add_random ]
then
busybox echo '0' > \$IOB/queue/add_random
fi
done
busybox echo 'I/O Boost is Done !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00IOBoost' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00IOBoost' > /dev/null 2>&1;
#
#
# I/O Queue tweak
#
#
busybox cat >> $CORE'/KI00IOQueue' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00IOQueue.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Applying IO Queue...' | busybox tee -a \$KI


MMC=/sys/block/mmc* > /dev/null 2>&1;
for IOQ in \$MMC;
do
if [ -f \$IOQ/queue/nr_requests ]
then
busybox echo '1024' > \$IOQ/queue/nr_requests
else
busybox echo 'nr requests not found !!!' | busybox tee -a \$KI
fi
done
busybox echo 'Done !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00IOQueue' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00IOQueue' > /dev/null 2>&1;
#
#
# Disabled I/O Stats
#
#
busybox cat >> $CORE'/KI00Disabled_IO_Stats' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Disabled_IO_Stats.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;


if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Disabling I/O Stats...' | busybox tee -a \$KI


path="/sys/block/*" > /dev/null 2>&1;
for DIO in \$path;
do
if [ -e \$DIO/queue/iostats ]
then
busybox echo '0' > \$DIO/queue/iostats
fi
done
busybox echo 'OK done !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Disabled_IO_Stats' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Disabled_IO_Stats' > /dev/null 2>&1;
#
#
# Disabled Debugging
#
#
busybox cat >> $CORE'/KI00Disabled_Debugging' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Disabled_Debugging.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Disable Debugging...' | busybox tee -a \$KI


if [ -e /sys/module/lowmemorykiller/parameters/debug_level ]
then
busybox chmod 644 /sys/module/lowmemorykiller/parameters/debug_level >
/dev/null 2>&1;
busybox echo '0' > /sys/module/lowmemorykiller/parameters/debug_level
fi
debug="/sys/module/*" > /dev/null 2>&1;
for DD in \$debug
do
if [ -e \$DD/parameters/debug_mask ]
then
busybox echo '0' > \$DD/parameters/debug_mask
fi
done
busybox echo 'Done !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Disabled_Debugging' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Disabled_Debugging' > /dev/null 2>&1;
#
#
# Disable Kernel Panic
#
#
busybox cat >> $CORE'/KI00Kernel_Panic' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Kernel_Panic.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Kernel panic is Disabling...' | busybox tee -a \$KI


if [ -e /proc/sys/kernel/panic ]
then
busybox echo '0' > /proc/sys/kernel/panic
fi
if [ -e /proc/sys/vm/panic_on_oom ]
then
busybox echo '0' > /proc/sys/vm/panic_on_oom
fi
if [ -e /proc/sys/kernel/panic_on_oops ]
then
busybox echo '0' > /proc/sys/kernel/panic_on_oops
fi
busybox echo 'Kernel Panic is Disabled !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Kernel_Panic' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Kernel_Panic' > /dev/null 2>&1;
#
#
# Assertive Display
#
#
busybox cat >> $CORE'/KI00Ad_Calib' << KITANA
# Assertive Display Calibration Output File Format
# Calibration config file consists of one or more sections. Each section is set
# of parameter values stored on one line each. Number of parameters (hence number
# of lines in each section is fixed. Order in which parameters are specified in
# given section is fixed as well.
# Comments are supported in configuration file to improve readability of
# calibration configuration parameters. Any line begining with '#' is considered
# as comment and will not be processed further.
# Blank lines are allowed and are ignored. They can be used to improve
# readability of assertive display calibration output file.
# Sections: Any line begining with '=' indicates start of new section in
# calibration output file. Sections, parameters which are part of section and
# order in which they will appear in calibration output file is kept outside
# scope of this documentation in order to have flexibility in development of
# assertive display calibration system. This information can be shared between
# APICAL and Qualcomm as part of assertive display bring ups on given platforms.
# There should not be any spaces betweetn '=' and section name.
# Version 1.0 of calibration output format supports following sections:
# version - Contains assertive display calibration output file format version
# init - Contains assertive display parameters which are independent of
# assertive display mode
# config - Contains assertive display parameters which are dependent on specific
# assertive display mode
# Each parameter for assertive display calibration is stored on new line. If
# parameter consists of more than one values (set of values), each value is
# separated by single space (' ') character. In version 1.0 of assertive
# display calibration output file format, all numerical values are in decimal
# unsigned integer format, limited by 32 bits. Range for values or valid value
# for given parameter is outside scope of this documentation. This information
# can be shared between APICAL and Qualcomm as part of assertive display bring
# ups on given platforms.
# Version 1.1 adds two more init parameters (21 in total) to the config file to
support the
# newly added power saving feature, Parameters added are alpha and BL_ATT lut
# Version 1.2 adds two more init parameters (23 in total) to the config file to
support the
# driver change, Parameters added are ALS_offset and ALS_threshold
# Version 1.3 changes the parameters BL linearity LUT and BL inverse LUT
# from 8 bit to 12 bits. This is done to support the precision increase in the AD
Driver
=version
1.3
# APICAL mode indepent initialization Params
=init
# A
0 211 414 609 796 975 1148 1315 1475 1630 1779 1922 2061 2195 2325 2451 2572 2690
2804 2915 3022 3126 3227 3325 3420 3513 3603 3691 3776 3859 3940 4019 4095
# B
255 278 302 326 350 374 398 422 446 470 494 517 541 565 589 613 637 661 684 708 732
755 779 803 826 850 874 897 921 945 968 992 1016
# C
7 134
# D
0
# E
1023
# F
65
# G
240
# H
0
# I
60
# J
128
# dither_control
5
# L
3
# M
0
# frame_width
720
# frame_height
1280
# P
0
# Q
0
# BL_linearity_LUT
0 16 32 48 64 80 96 112 128 145 161 177 193 209 225 241 257 273 289 305 321 337 353
369 385 401 418 434 450 466 482 498 514 530 546 562 578 594 610 626 642 658 674 691
707 723 739 755 771 787 803 819 835 851 867 883 899 915 931 947 964 980 996 1012
1028 1044 1060 1076 1092 1108 1124 1140 1156 1172 1188 1204 1220 1237 1253 1269
1285 1301 1317 1333 1349 1365 1381 1397 1413 1429 1445 1461 1477 1493 1510 1526
1542 1558 1574 1590 1606 1622 1638 1654 1670 1686 1702 1718 1734 1750 1766 1783
1799 1815 1831 1847 1863 1879 1895 1911 1927 1943 1959 1975 1991 2007 2023 2039
2056 2072 2088 2104 2120 2136 2152 2168 2184 2200 2216 2232 2248 2264 2280 2296
2312 2329 2345 2361 2377 2393 2409 2425 2441 2457 2473 2489 2505 2521 2537 2553
2569 2585 2602 2618 2634 2650 2666 2682 2698 2714 2730 2746 2762 2778 2794 2810
2826 2842 2858 2875 2891 2907 2923 2939 2955 2971 2987 3003 3019 3035 3051 3067
3083 3099 3115 3131 3148 3164 3180 3196 3212 3228 3244 3260 3276 3292 3308 3324
3340 3356 3372 3388 3404 3421 3437 3453 3469 3485 3501 3517 3533 3549 3565 3581
3597 3613 3629 3645 3661 3677 3694 3710 3726 3742 3758 3774 3790 3806 3822 3838
3854 3870 3886 3902 3918 3934 3950 3967 3983 3999 4015 4031 4047 4063 4079 4095
# BL_linearity_inverse_LUT
0 16 32 48 64 80 96 112 128 145 161 177 193 209 225 241 257 273 289 305 321 337 353
369 385 401 418 434 450 466 482 498 514 530 546 562 578 594 610 626 642 658 674 691
707 723 739 755 771 787 803 819 835 851 867 883 899 915 931 947 964 980 996 1012
1028 1044 1060 1076 1092 1108 1124 1140 1156 1172 1188 1204 1220 1237 1253 1269
1285 1301 1317 1333 1349 1365 1381 1397 1413 1429 1445 1461 1477 1493 1510 1526
1542 1558 1574 1590 1606 1622 1638 1654 1670 1686 1702 1718 1734 1750 1766 1783
1799 1815 1831 1847 1863 1879 1895 1911 1927 1943 1959 1975 1991 2007 2023 2039
2056 2072 2088 2104 2120 2136 2152 2168 2184 2200 2216 2232 2248 2264 2280 2296
2312 2329 2345 2361 2377 2393 2409 2425 2441 2457 2473 2489 2505 2521 2537 2553
2569 2585 2602 2618 2634 2650 2666 2682 2698 2714 2730 2746 2762 2778 2794 2810
2826 2842 2858 2875 2891 2907 2923 2939 2955 2971 2987 3003 3019 3035 3051 3067
3083 3099 3115 3131 3148 3164 3180 3196 3212 3228 3244 3260 3276 3292 3308 3324
3340 3356 3372 3388 3404 3421 3437 3453 3469 3485 3501 3517 3533 3549 3565 3581
3597 3613 3629 3645 3661 3677 3694 3710 3726 3742 3758 3774 3790 3806 3822 3838
3854 3870 3886 3902 3918 3934 3950 3967 3983 3999 4015 4031 4047 4063 4079 4095
# power_saving_coeff
0
# BL_att_LUT
0 128 256 384 512 539 567 594 622 649 676 704 768 832 896 960 1024 1088 1152 1216
1280 1612 1945 2278 2611 2943 3327 3455 3583 3711 3839 3967 4095
# al_offset
10000
# al_tolarance
0.2
#APICAL mode specific configuration
=config
# mode
1
# R
0 2048 4096 6144 8192 10240 12288 14336 16384 18432 20480 22528 24576 26624 28672
30720 32768 34815 36863 38911 40959 43007 45055 47103 49151 51199 53247 55295 57343
59391 61439 63487 65535
# back_min
0
# back_max
4095
# back_scale
4095
# ambient_light_min
0
# S
1738 6
# calibration_abcd
12 95 0 0
# T
128
# U
5
# V
60
KITANA
busybox chmod 755 $CORE'/KI00Ad_Calib' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Ad_Calib' > /dev/null 2>&1;
#
#
# Entropy Light
#
#
busybox cat >> $CORE/KI00Entropy_Light << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this
program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

KI='/system/KITANA/LOGS/KI00Entropy.log' > /dev/null 2>&1;

if [ -f \$KI ]; then
busybox rm \$KI;
fi;

busybox echo 'Activating light Entropy profile..' | busybox tee -a \$KI

busybox sysctl -e -w kernel.random.read_wakeup_threshold=128


busybox sysctl -e -w kernel.random.write_wakeup_threshold=256

busybox sleep 1

if grep '128' proc/sys/kernel/random/read_wakeup_threshold; then


busybox echo 'Light Entropy profile is activated..' | busybox tee -a \$KI
else
busybox echo 'Light Entropy profile is not activated..' | busybox tee -a \$KI
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;

KITANA
busybox chmod 755 $CORE/KI00Entropy_Light > /dev/null 2>&1;
busybox chown 0:0 $CORE/KI00Entropy_Light > /dev/null 2>&1;
#
#
# Entropy Enlarger
#
#
busybox cat >> $CORE/KI00Entropy_Enlarger << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this
program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

KI='/system/KITANA/LOGS/KI00Entropy.log' > /dev/null 2>&1;

if [ -f \$KI ]; then
busybox rm \$KI;
fi;
busybox echo 'Activating enlarger Entropy profile..' | busybox tee -a \$KI

busybox sysctl -e -w kernel.random.read_wakeup_threshold=64


busybox sysctl -e -w kernel.random.write_wakeup_threshold=896

busybox sleep 1

if grep '64' /proc/sys/kernel/random/read_wakeup_threshold; then


busybox echo 'Enlarger Entropy profile is activated..' | busybox tee -a \$KI
else
busybox echo 'Enlarger Entropy profile is not activated..' | busybox tee -a \$KI
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;

KITANA
busybox chmod 755 $CORE/KI00Entropy_Enlarger > /dev/null 2>&1;
busybox chown 0:0 $CORE/KI00Entropy_Enlarger > /dev/null 2>&1;
#
#
# Entropy Moderate
#
#
busybox cat >> $CORE/KI00Entropy_Moderate << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this
program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

KI='/system/KITANA/LOGS/KI00Entropy.log' > /dev/null 2>&1;

if [ -f \$KI ]; then
busybox rm \$KI;
fi;

busybox echo 'Activating moderate Entropy profile..' | busybox tee -a \$KI

busybox sysctl -e -w kernel.random.read_wakeup_threshold=1366


busybox sysctl -e -w kernel.random.write_wakeup_threshold=2048

busybox sleep 1

if grep '1366' /proc/sys/kernel/random/read_wakeup_threshold; then


busybox echo 'Moderate Entropy profile is activated..' | busybox tee -a \$KI
else
busybox echo 'Moderate Entropy profile is not activated..' | busybox tee -a \$KI
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;

KITANA
busybox chmod 755 $CORE/KI00Entropy_Moderate > /dev/null 2>&1;
busybox chown 0:0 $CORE/KI00Entropy_Moderate > /dev/null 2>&1;
#
#
# Entropy Aggressive
#
#
busybox cat >> $CORE/KI00Entropy_Aggressive << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this
program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

KI='/system/KITANA/LOGS/KI00Entropy.log' > /dev/null 2>&1;

if [ -f \$KI ]; then
busybox rm \$KI;
fi;

busybox echo 'Activating aggressive Entropy profile..' | busybox tee -a \$KI

busybox sysctl -e -w kernel.random.read_wakeup_threshold=1708


busybox sysctl -e -w kernel.random.write_wakeup_threshold=2048

busybox sleep 1

if grep '1708' /proc/sys/kernel/random/read_wakeup_threshold; then


busybox echo 'Aggressive Entropy profile is activated..' | busybox tee -a \$KI
else
busybox echo 'Aggressive Entropy profile is not activated..' | busybox tee -a \$KI
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;

KITANA
busybox chmod 755 $CORE/KI00Entropy_Aggressive > /dev/null 2>&1;
busybox chown 0:0 $CORE/KI00Entropy_Aggressive > /dev/null 2>&1;
#
#
# Kernel Sleepers Optimization
#
#
busybox cat >> $CORE'/KI00Kernel_Sleepers_Optimization' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Kernel_Sleepers_Optimization.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Kernel Sleepers is Applying...' | busybox tee -a \$KI


if [ -e /sys/kernel/debug/sched_features ]
then
busybox echo 'NO_GENTLE_FAIR_SLEEPERS' > /sys/kernel/debug/sched_features
busybox echo 'START_DEBIT' >> /sys/kernel/debug/sched_features
busybox echo 'NO_NEXT_BUDDY' >> /sys/kernel/debug/sched_features
busybox echo 'LAST_BUDDY' >> /sys/kernel/debug/sched_features
busybox echo 'CACHE_HOT_BUDDY' >> /sys/kernel/debug/sched_features
busybox echo 'WAKEUP_PREEMPTION' >> /sys/kernel/debug/sched_features
busybox echo 'ARCH_POWER' >> /sys/kernel/debug/sched_features
busybox echo 'NO_HRTICK' >> /sys/kernel/debug/sched_features
busybox echo 'NO_DOUBLE_TICK' >> /sys/kernel/debug/sched_features
busybox echo 'LB_BIAS' >> /sys/kernel/debug/sched_features
busybox echo 'NONTASK_POWER' >> /sys/kernel/debug/sched_features
busybox echo 'TTWU_QUEUE' >> /sys/kernel/debug/sched_features
busybox echo 'NO_FORCE_SD_OVERLAP' >> /sys/kernel/debug/sched_features
busybox echo 'RT_RUNTIME_SHARE' >> /sys/kernel/debug/sched_features
busybox echo 'NO_LB_MIN' >> /sys/kernel/debug/sched_features
fi
busybox echo 'Kernel sleepers is applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Kernel_Sleepers_Optimization' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Kernel_Sleepers_Optimization' > /dev/null 2>&1;
#
#
# SD card R/W Speed tweak
#
#
busybox cat >> $CORE'/KI00SD_Tweak' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00SD_Tweak.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'SD Card Speed Tweak is Applying...' | busybox tee -a \$KI
VALU=256 > /dev/null 2>&1;
MMC=/sys/block/mmc* > /dev/null 2>&1;
for SD in \$MMC
do
if [ -e \$SD/queue/read_ahead_kb ]
then
busybox echo "\$VALU" > \$SD/queue/read_ahead_kb;
fi
if [ -e \$SD/bdi/read_ahead_kb ];
then
busybox echo "\$VALU" > \$SD/bdi/read_ahead_kb;
fi
done
busybox echo 'SD Card Speed Tweak is successfully Applied !!!' | busybox tee -a \
$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00SD_Tweak' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00SD_Tweak' > /dev/null 2>&1;
#
#
# Scudelar Tuner
#
#
busybox cat >> $CORE'/KI00Scudelar_Tuner' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Scudelar_Tuner.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Applying Scudelar Tuner Tweak...' | busybox tee -a \$KI


path="/system/block/*" > /dev/null 2>&1;
for ST in \$path;
do
if [ -e \$ST/queue/scheduler ]
then
busybox cut -d [ -f2 \$ST/queue/scheduler |busybox cut -d] -f1 > /dev/null 2>&1;
fi
done
busybox echo 'OK done !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Scudelar_Tuner' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Scudelar_Tuner' > /dev/null 2>&1;
#
#
# Partition remount
#
#
busybox cat >> $CORE'/KI00Partition_Remount' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Partition_Remount.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi
busybox echo 'Partition Remounting...' | busybox tee -a \$KI
# Partition Remount Not for Magisk, only for system mode users
for ext4 in \$(busybox mount | busybox grep ext4 | busybox cut -d " " -f3); do
busybox mount -o remount,barrier=1,relatime,discard -t auto "\$ext4";done >
/dev/null 2>&1;
busybox echo 'Partition Remount is successfully Applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Partition_Remount' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Partition_Remount' > /dev/null 2>&1;
#
#
# Clean Master
#
#
busybox cat >> $CORE'/KI00Clean_Master' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Clean_Master.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Cleaning...' | busybox tee -a \$KI


busybox echo '' | busybox tee -a \$KI
busybox echo 'Cleaner script is running...' | busybox tee -a \$KI
busybox rm -f /cache/*.apk > /dev/null 2>&1;
busybox rm -f /cache/*.tmp > /dev/null 2>&1;
busybox rm -f /cache/*.log > /dev/null 2>&1;
busybox rm -f /cache/*.txt > /dev/null 2>&1;
busybox rm -f /cache/recovery/* > /dev/null 2>&1;
busybox rm -f /data/*.log > /dev/null 2>&1;
busybox rm -f /data/*.txt > /dev/null 2>&1;
busybox rm -f /data/anr/*.log > /dev/null 2>&1;
busybox rm -f /data/anr/*.txt > /dev/null 2>&1;
busybox rm -f /data/backup/pending/*.tmp > /dev/null 2>&1;
busybox rm -f /data/cache/*.* > /dev/null 2>&1;
busybox rm -f /data/dalvik-cache/*.apk > /dev/null 2>&1;
busybox rm -f /data/dalvik-cache/*.tmp > /dev/null 2>&1;
busybox rm -f /data/dalvik-cache/*.log > /dev/null 2>&1;
busybox rm -f /data/dalvik-cache/*.txt > /dev/null 2>&1;
busybox rm -f /data/data/*.log > /dev/null 2>&1;
busybox rm -f /data/data/*.txt > /dev/null 2>&1;
busybox rm -f /data/log/*.log > /dev/null 2>&1;
busybox rm -f /data/log/*.txt > /dev/null 2>&1;
busybox rm -f /data/local/*.apk > /dev/null 2>&1;
busybox rm -f /data/local/*.log > /dev/null 2>&1;
busybox rm -f /data/local/*.txt > /dev/null 2>&1;
busybox rm -f /data/local/tmp/*.log > /dev/null 2>&1;
busybox rm -f /data/local/tmp/*.txt > /dev/null 2>&1;
busybox rm -f /data/last_alog/*.log > /dev/null 2>&1;
busybox rm -f /data/last_alog/*.txt > /dev/null 2>&1;
busybox rm -f /data/last_kmsg/*.log > /dev/null 2>&1;
busybox rm -f /data/last_kmsg/*.txt > /dev/null 2>&1;
busybox rm -f /data/mlog/* > /dev/null 2>&1;
busybox rm -f /data/tombstones/*.log > /dev/null 2>&1;
busybox rm -f /data/tombstones/*.txt > /dev/null 2>&1;
busybox rm -f /data/system/*.log > /dev/null 2>&1;
busybox rm -f /data/system/*.txt > /dev/null 2>&1;
busybox rm -f /data/system/dropbox/*.log > /dev/null 2>&1;
busybox rm -f /data/system/dropbox/*.txt > /dev/null 2>&1;
busybox rm -f /data/system/usagestats/*.log > /dev/null 2>&1;
busybox rm -f /data/system/usagestats/*.txt > /dev/null 2>&1;
busybox echo '' | busybox tee -a \$KI
busybox echo 'OK done !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Clean_Master' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Clean_Master' > /dev/null 2>&1;
#
#
# Disabled Location & Cloud Service For Battery
#
#
busybox cat >> $CORE'/KI00DGLCS' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00DGLCS.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi
busybox echo 'Disable Google Location & Clouds Services is applying' | busybox tee
-a \$KI
pm disable
com.google.android.gms/com.google.android.location.fused.FusedLocationService >
/dev/null 2>&1;
pm disable
com.google.android.gms/com.google.android.location.internal.server.GoogleLocationSe
rvice > /dev/null 2>&1;
pm disable
com.google.android.gms/com.google.android.location.geocode.GeocodeService >
/dev/null 2>&1;
pm disable
com.google.android.gms/com.google.android.location.network.NetworkLocationService >
/dev/null 2>&1;
pm disable
com.google.android.gms/com.google.android.location.internal.GoogleLocationManagerSe
rvice > /dev/null 2>&1;
pm disable
com.google.android.gms/com.google.android.location.geofencer.service.GeofenceProvid
erService > /dev/null 2>&1;
pm disable
com.google.android.gms/com.google.android.location.fused.service.FusedProviderServi
ce > /dev/null 2>&1;
pm disable
com.google.android.gms/com.google.android.location.reporting.service.DispatchingSer
vice > /dev/null 2>&1;
pm disable
com.google.android.gms/com.google.location.nearby.direct.service.NearbyDirectServic
e > /dev/null 2>&1;
pm disable com.google.android.gms/.common.stats.GmsCoreStatsService > /dev/null
2>&1;
pm disable com.google.android.gms/.gcm.GcmService > /dev/null 2>&1;
pm disable com.google.android.gms/.chimera.GmsIntentOperationService > /dev/null
2>&1;
busybox echo 'Disable Google Location & Clouds Services is applied' | busybox tee
-a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00DGLCS' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00DGLCS' > /dev/null 2>&1;
#
#
# Doze mod improvement for marshmallow +
#
#
busybox cat >> $CORE'/KI00Doze_Mod' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Doze_Mod.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Doze is Applying...' | busybox tee -a \$KI


SDK=\$(getprop ro.build.version.sdk) > /dev/null 2>&1;
if [ "\$SDK" -ge '23' ]
then
settings put global device_idle_constants light_after_inactive_to=30000 >
/dev/null 2>&1;
settings put global device_idle_constants light_pre_idle_to=30000 > /dev/null
2>&1;
settings put global device_idle_constants light_idle_to=30000 > /dev/null
2>&1;
settings put global device_idle_constants light_idle_factor=2.0 > /dev/null
2>&1;
settings put global device_idle_constants light_max_idle_to=60000 > /dev/null
2>&1;
settings put global device_idle_constants
light_idle_maintenance_min_budget=30000 > /dev/null 2>&1;
settings put global device_idle_constants
light_idle_maintenance_max_budget=60000 > /dev/null 2>&1;
settings put global device_idle_constants min_light_maintenance_time=5000
> /dev/null 2>&1;
settings put global device_idle_constants min_deep_maintenance_time=10000
> /dev/null 2>&1;
settings put global device_idle_constants inactive_to=60000 > /dev/null 2>&1;
settings put global device_idle_constants sensing_to=0 > /dev/null 2>&1;
settings put global device_idle_constants locating_to=0 > /dev/null 2>&1;
settings put global device_idle_constants location_accuracy=20.0 > /dev/null
2>&1;
settings put global device_idle_constants motion_inactive_to=5000 > /dev/null
2>&1;
settings put global device_idle_constants idle_after_inactive_to=0 >
/dev/null 2>&1;
settings put global device_idle_constants idle_pending_to=30000 > /dev/null
2>&1;
settings put global device_idle_constants max_idle_pending_to=60000 >
/dev/null 2>&1;
settings put global device_idle_constants idle_pending_factor=2.0 > /dev/null
2>&1;
settings put global device_idle_constants idle_to=3600000 > /dev/null 2>&1;
settings put global device_idle_constants max_idle_to=21600000 > /dev/null
2>&1;
settings put global device_idle_constants idle_factor=2.0 > /dev/null 2>&1;
settings put global device_idle_constants min_time_to_alarm=3600000 >
/dev/null 2>&1;
settings put global device_idle_constants
max_temp_app_whitelist_duration=20000 > /dev/null 2>&1;
settings put global device_idle_constants
mms_temp_app_whitelist_duration=20000 > /dev/null 2>&1;
settings put global device_idle_constants
sms_temp_app_whitelist_duration=20000 > /dev/null 2>&1;
settings put global device_idle_constants
notification_whitelist_duration=20000 > /dev/null 2>&1;
busybox echo 'Doze is successfully Applied !!!' | busybox tee -a \$KI
else
busybox echo 'Need Marshmallow + devices !!!' | busybox tee -a \$KI
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Doze_Mod' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Doze_Mod' > /dev/null 2>&1;
#
#
# Save Battery By Fixes VM Overuse
#
#
busybox cat >> $CORE'/KI00VMFixes' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00VMFixes.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'VM fixes Tweak is Applying...' | busybox tee -a \$KI


if [ -e /proc/sys/vm/dirty_expire_centisecs ]
then
busybox echo '500' > /proc/sys/vm/dirty_expire_centisecs
if [ -e /proc/sys/vm/dirty_writeback_centisecs ]
then
busybox echo '1000' > /proc/sys/vm/dirty_writeback_centisecs
fi
fi
busybox echo 'VM fixes is successfully Applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00VMFixes' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00VMFixes' > /dev/null 2>&1;
#
#
# Low Power Mode
#
#
busybox cat >> $CORE'/KI00LPM' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00LPM.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Low Power mode Tweak is Applying...' | busybox tee -a \$KI
if [ -e /sys/module/lpm_levels/parameters/sleep_disabled ]
then
busybox echo '0' > /sys/module/lpm_levels/parameters/sleep_disabled
busybox echo 'Sleep disabled !!!' | busybox tee -a \$KI
else
busybox echo 'Sleep Disabled mode not found !!!' | busybox tee -a \$KI
fi
if [ -e /sys/module/pm2/modes/cpu0/power_collapse/suspend_enabled ]
then
busybox echo '1' >
/sys/module/pm2/modes/cpu0/standalone_power_collapse/idle_enabled
busybox echo '1' >
/sys/module/pm2/modes/cpu1/standalone_power_collapse/idle_enabled
busybox echo '1' >
/sys/module/pm2/modes/cpu0/standalone_power_collapse/suspend_enabled
busybox echo '1' >
/sys/module/pm2/modes/cpu1/standalone_power_collapse/suspend_enabled
busybox echo '1' > /sys/module/pm2/modes/cpu0/power_collapse/suspend_enabled
busybox echo '1' > /sys/module/pm2/modes/cpu0/power_collapse/idle_enabled
busybox echo 'Suspended enabled !!!' | busybox tee -a \$KI
else
busybox echo 'Suspended enabled not possible !!!' | busybox tee -a \$KI
fi
if [ -e /sys/module/pm2/parameters/idle_sleep_mode ]
then
busybox echo '1' > /sys/module/pm2/parameters/idle_sleep_mode
busybox echo 'Idle sleep mode is on !!!' | busybox tee -a \$KI
else
busybox echo 'Idle sleep mode not found !!!' | busybox tee -a \$KI
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00LPM' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00LPM' > /dev/null 2>&1;
#
#
# LCD Power Reduced
#
#
busybox cat >> $CORE'/KI00LCD_Power' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00LCD_Power.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'LCD power reduce Tweak is Applying...' | busybox tee -a \$KI
if [ -e /sys/class/lcd/panel/power_reduce ]
then
busybox echo '1' > /sys/class/lcd/panel/power_reduce
busybox echo 'LCD power reduce Tweak is successfully Applied !!!' | busybox
tee -a \$KI
else
busybox echo 'LCD power reduce Tweak not for you !!!' | busybox tee -a \$KI
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00LCD_Power' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00LCD_Power' > /dev/null 2>&1;
#
#
# Medium Cache Allocation
#
#
busybox cat >> $CORE'/KI00Cache_Allocation_Medium' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Cache_Allocation.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Applying Cache Allocation Medium...' | busybox tee -a \$KI


if [ -e /proc/sys/vm/overcommit_memory ]
then
busybox echo '1' > /proc/sys/vm/overcommit_memory
fi
if [ -e /proc/sys/vm/overcommit_ratio ]
then
busybox echo '75' > /proc/sys/vm/overcommit_ratio
fi
busybox echo 'Cache Allocation Medium Applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Cache_Allocation_Medium' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Cache_Allocation_Medium' > /dev/null 2>&1;
#
#
# Cache Allocation Large
#
#
busybox cat >> $CORE'/KI00Cache_Allocation_Large' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Cache_Allocation.log' > /dev/null 2>&1;


mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Applying Cache Allocation Large...' | busybox tee -a \$KI


if [ -e /proc/sys/vm/overcommit_memory ]
then
busybox echo '1' > /proc/sys/vm/overcommit_memory
fi
if [ -e /proc/sys/vm/overcommit_ratio ]
then
busybox echo '100' > /proc/sys/vm/overcommit_ratio
fi
busybox echo 'Cache Allocation Large Applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Cache_Allocation_Large' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Cache_Allocation_Large' > /dev/null 2>&1;
#
#
# Double Cache Reclaiming
#
#
busybox cat >> $CORE'/KI00Cache_Reclaiming_Double' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Cache_Reclaiming.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Applying Double Cache Reclaiming...' | busybox tee -a \$KI


if [ -e /proc/sys/vm/vfs_cache_pressure ]
then
busybox echo '200' > /proc/sys/vm/vfs_cache_pressure
fi
busybox echo 'Double Cache Reclaiming Applied !!!' | busybox tee -a \$KI
mount -o ro,remount,ro '/system' > /dev/null 2>&1;
KITANA
busybox chmod 755 $CORE'/KI00Cache_Reclaiming_Double' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Cache_Reclaiming_Double' > /dev/null 2>&1;
#
#
# Moderate Cache Reclaiming
#
#
busybox cat >> $CORE'/KI00Cache_Reclaiming_Moderate' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Cache_Reclaiming.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Applying Moderate Cache Reclaiming ...' | busybox tee -a \$KI
if [ -e /proc/sys/vm/vfs_cache_pressure ]
then
busybox echo '70' > /proc/sys/vm/vfs_cache_pressure
fi
busybox echo 'Moderate Cache Reclaiming Applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Cache_Allocation_Large' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Cache_Reclaiming_Moderate' > /dev/null 2>&1;
#
#
# Minimum Cache Reclaiming
#
#
busybox cat >> $CORE'/KI00Cache_Reclaiming_Minimum' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Cache_Reclaiming.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Applying Minimum Cache Reclaiming...' | busybox tee -a \$KI


if [ -e /proc/sys/vm/vfs_cache_pressure ]
then
busybox echo '10' > /proc/sys/vm/vfs_cache_pressure
fi
busybox echo 'Minimum Cache Reclaiming Applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Cache_Reclaiming_Minimum' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Cache_Reclaiming_Minimum' > /dev/null 2>&1;
#
#
# OOM Killer Disabler
#
#
busybox cat >> $CORE'/KI00OOM_Kill_Disabled' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00OOM.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'OOM killer is Disabling...' | busybox tee -a \$KI


busybox sysctl -e -w vm.oom_dump_tasks=0 > /dev/null 2>&1;
busybox sysctl -e -w vm.oom_kill_allocating_task=0 > /dev/null 2>&1;
busybox echo 'OOM killer is Successfully Disabled !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00OOM_Kill_Disabled' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00OOM_Kill_Disabled' > /dev/null 2>&1;
#
#
# OOM Killer Enabler
#
#
busybox cat >> $CORE'/KI00OOM_Kill_Enabled' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00OOM.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'OOM killer is Enabling...' | busybox tee -a \$KI


busybox sysctl -e -w vm.oom_dump_tasks=1 > /dev/null 2>&1;
busybox sysctl -e -w vm.oom_kill_allocating_task=1 > /dev/null 2>&1;
busybox echo 'OOM killer is Successfully Applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00OOM_Kill_Enabled' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00OOM_Kill_Enabled' > /dev/null 2>&1;
#
#
# Laptop Mode
#
#
busybox cat >> $CORE'/KI00Laptop_Mode' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Laptop_Mode.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Laptop Mode is applying...' | busybox tee -a \$KI


busybox sysctl -w vm.laptop_mode=1 > /dev/null 2>&1;
busybox echo 'OK Done applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Laptop_Mode' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Laptop_Mode' > /dev/null 2>&1;
#
#
# Swap-ping Disabled
#
#
busybox cat >> $CORE'/KI00Swap_Disabled' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Swap-ping.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Swap-ping Disabled is applying...' | busybox tee -a \$KI


busybox sysctl -w vm.swappiness=0 > /dev/null 2>&1;
busybox echo 'OK Done applied !!!' | busybox tee -a \$KI
mount -o ro,remount,ro '/system' > /dev/null 2>&1;
KITANA
busybox chmod 755 $CORE'/KI00Swap_Disabled' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Swap_Disabled' > /dev/null 2>&1;
#
#
# Minimum Swap-ping
#
#
busybox cat >> $CORE'/KI00Minimum_Swap' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Swap-ping.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Minimum swap-ping applying...' | busybox tee -a \$KI


busybox sysctl -w vm.swappiness=10 > /dev/null 2>&1;
busybox echo 'OK Done applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Minimum_Swap' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Minimum_Swap' > /dev/null 2>&1;
#
#
# Conservative Swap-ping
#
#
busybox cat >> $CORE'/KI00Conservative_Swap' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Swap-ping.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Conservative swap-ping applying...' | busybox tee -a \$KI


busybox sysctl -w vm.swappiness=40 > /dev/null 2>&1;
busybox echo 'OK Done applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Conservative_Swap' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Conservative_Swap' > /dev/null 2>&1;
#
#
# Moderate Swap-ping
#
#
busybox cat >> $CORE'/KI00Moderate_Swap' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Swap-ping.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Moderate Swap is applying...' | busybox tee -a \$KI


busybox sysctl -w vm.swappiness=70 > /dev/null 2>&1;
busybox echo 'OK Done applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Moderate_Swap' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Moderate_Swap' > /dev/null 2>&1;
#
#
# Aggressive Swap-ping
#
#
busybox cat >> $CORE'/KI00Aggressive_Swap' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Swap-ping.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Aggressive Swap is applying...' | busybox tee -a \$KI


busybox sysctl -w vm.swappiness=90 > /dev/null 2>&1;
busybox echo 'OK Done applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Aggressive_Swap' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Aggressive_Swap' > /dev/null 2>&1;
#
#
# Touch Improvement
#
#
busybox cat >> $CORE'/KI00Touch_Tweak' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#
KI='/system/KITANA/LOGS/KI00Touch_Tweak.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Touch Tweak is Applying...' | busybox tee -a \$KI


if [ -e /sys/class/touch/switch/set_touchscreen ]
then
busybox echo '7025' > /sys/class/touch/switch/set_touchscreen
busybox echo '8002' > /sys/class/touch/switch/set_touchscreen
busybox echo '11001' > /sys/class/touch/switch/set_touchscreen
busybox echo '13030' > /sys/class/touch/switch/set_touchscreen
busybox echo '14005' > /sys/class/touch/switch/set_touchscreen
fi
busybox echo 'Touch Tweak is successfully Applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Touch_Tweak' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Touch_Tweak' > /dev/null 2>&1;
#
#
# Improve Deep Sleep
#
#
busybox cat >> $CORE'/KI00Deep_Sleep' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Deep_Sleep.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Deep sleep Tweak is Applying...' | busybox tee -a \$KI


for DSP in \$(busybox ls /sys/class/scsi_disk/)
do
busybox echo 'temporary none' > /sys/class/scsi_disk/"\$DSP"/cache_type
done
busybox echo 'Deep sleep Tweak is successfully Applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Deep_Sleep' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Deep_Sleep' > /dev/null 2>&1;
#
#
# Fsync Enabled Tweak
#
#
busybox cat >> $CORE'/KI00Fsync' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Fsync.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Fsync is applying...' | busybox tee -a \$KI


if [ -e /sys/kernel/dyn_fsync/Dyn_fsync_active ]
then
busybox echo '1' > /sys/kernel/dyn_fsync/Dyn_fsync_active
fi
busybox echo 'OK Done applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Fsync' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Fsync' > /dev/null 2>&1;
#
#
# Fsync Disabled Tweak
#
#
busybox cat >> $CORE'/KI00Fsync_Off' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Fsync.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Fsync off tweak is applying...' | busybox tee -a \$KI


if [ -e /sys/kernel/dyn_fsync/Dyn_fsync_active ]
then
busybox echo '0' > /sys/kernel/dyn_fsync/Dyn_fsync_active
fi
busybox echo 'OK Done applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Fsync_Off' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Fsync_Off' > /dev/null 2>&1;
#
#
# Zram Enabled Tweak
#
#
busybox cat >> $CORE'/KI00Zram_Enabled' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Zram.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi
busybox echo 'Applying Zram Tweak...' | busybox tee -a \$KI
if [ -e /dev/block/zram0 ]
then
busybox swapoff /dev/block/zram0 > /dev/null 2>&1; 2>&1
busybox echo '1' > /sys/block/zram0/reset
busybox echo '202432512' > /sys/block/zram0/disksize
busybox mkswap /dev/block/zram0 > /dev/null 2>&1; 2>&1
busybox swapon /dev/block/zram0 > /dev/null 2>&1; 2>&1
setprop ro.config.zram true
fi
busybox echo 'Applied Zram Tweak !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Zram_Enabled' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Zram_Enabled' > /dev/null 2>&1;
#
#
# Zram Disabled Tweak
#
#
busybox cat >> $CORE'/KI00Zram_Disabled' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Zram.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Disabling Zram Tweak...' | busybox tee -a \$KI


if [ -e /dev/block/zram0 ]
then
busybox swapoff /dev/block/zram0 > /dev/null 2>&1;
busybox echo '0' > /sys/block/zram0/disksize
busybox echo '1' > /sys/block/zram0/reset
setprop ro.config.zram false
fi
busybox echo 'Disabled Zram Tweak !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Zram_Disabled' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Zram_Disabled' > /dev/null 2>&1;
#
#
# Interactive Governor Tweak
#
#
busybox cat >> $CORE'/KI00Interactive_Tweak' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Interactive_Tweak.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Optimizing CPU...' | busybox tee -a \$KI


if [ -e /dev/cpuctl/cpu.shares ]
then
busybox echo '1024' > /dev/cpuctl/cpu.shares
fi
if [ -e /dev/cpuctl/cpu.rt_runtime_us ]
then
busybox echo '800000' > /dev/cpuctl/cpu.rt_runtime_us
fi
if [ -e /dev/cpuctl/cpu.rt_period_us ]
then
busybox echo '1000000' > /dev/cpuctl/cpu.rt_period_us
fi
if [ -e /dev/cpuctl/bg_non_interactive/cpu.shares ]
then
busybox echo '62' > /dev/cpuctl/bg_non_interactive/cpu.shares
fi
if [ -e /dev/cpuctl/bg_non_interactive/cpu.rt_runtime_us ]
then
busybox echo '700000' > /dev/cpuctl/bg_non_interactive/cpu.rt_runtime_us
fi
if [ -e /dev/cpuctl/bg_non_interactive/cpu.rt_runtime_us ]
then
busybox echo '1000000' > /dev/cpuctl/bg_non_interactive/cpu.rt_period_us
fi
busybox echo "CPU is optimized" | busybox tee -a \$KI
mount -o ro,remount,ro '/system' > /dev/null 2>&1;
KITANA
busybox chmod 755 $CORE'/KI00Interactive_Tweak' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Interactive_Tweak' > /dev/null 2>&1;
#
#
# Fast Change Enabler
#
#
busybox cat >> $CORE'/KI00Fast_Charging' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Fast_Charge.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

thunder_charge='/sys/kernel/thundercharge_control' > /dev/null 2>&1;


busybox echo 'Fast Charging is Applying...' | busybox tee -a \$KI
if [ -f /sys/kernel/fast_charge/force_fast_charge ]
then
busybox echo '1' > /sys/kernel/fast_charge/force_fast_charge
elif [ -e \$thunder_charge ]
then
busybox echo '1' > \$thunder_charge/enabled
busybox echo '1000' > \$thunder_charge/custom_usb_current
busybox echo '1000' > \$thunder_charge/custom_ac_current
elif [ -e /sys/devices/platform/sec-
battery/power_supply/battery/charge_current_override ]
then
busybox echo '1500' > /sys/devices/platform/sec-
battery/power_supply/battery/charge_current_override
busybox echo '1500' > /sys/devices/platform/i2c-gpio.15/i2c-15/15-
0034/power_supply/sec-charger/charge_current_override
busybox echo 'Fast Charging is successfully Applied !!!' | busybox tee -a \
$KI
else
busybox echo 'Force Fast Charge Not Support in this kernel !!!' | busybox tee
-a \$KI
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Fast_Charging' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Fast_Charging' > /dev/null 2>&1;
#
#
# KSM & uKSM Enabler
#
#
busybox cat >> $CORE'/KI00Ksm' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00KSM.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

if [ -e /sys/kernel/mm/ksm/run ]
then
busybox echo 'KSM is running...' | busybox tee -a \$KI
busybox echo '1' > /sys/kernel/mm/ksm/run
busybox echo '64' > /sys/kernel/mm/ksm/pages_to_scan
busybox echo '1024' > /sys/kernel/mm/ksm/sleep_millisecs
busybox echo 'OK done !!!' | busybox tee -a \$KI
elif [ -e /sys/kernel/mm/uksm/run ]
then
busybox echo 'uKSM is running...' | busybox tee -a \$KI
busybox chmod 644 /sys/kernel/mm/uksm/run
busybox echo '1' > /sys/kernel/mm/uksm/run
busybox echo 'OK done !!!' | busybox tee -a \$KI
else
busybox echo 'KSM & UKSM not available in this kernel !!!' | busybox tee -a \
$KI
fi
if [ -e /sys/kernel/mm/uksm/sleep_millisecs ]
then
busybox chmod 644 /sys/kernel/mm/uksm/sleep_millisecs
busybox echo '1000' > /sys/kernel/mm/uksm/sleep_millisecs
fi
if [ -e /sys/kernel/mm/uksm/max_cpu_percentage ]
then
busybox chmod 644 /sys/kernel/mm/uksm/max_cpu_percentage
busybox echo '10' > /sys/kernel/mm/uksm/max_cpu_percentage
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Ksm' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Ksm' > /dev/null 2>&1;
#
#
# KSM & uKSM Disabler
#
#
busybox cat >> $CORE'/KI00Ksm_Off' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00KSM.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

if [ -e /sys/kernel/mm/ksm/run ]
then
busybox echo 'KSM running is stopping...' | busybox tee -a \$KI
busybox echo '0' > /sys/kernel/mm/ksm/run
busybox echo '64' > /sys/kernel/mm/ksm/pages_to_scan
busybox echo '1024' > /sys/kernel/mm/ksm/sleep_millisecs
busybox echo 'OK done !!!' | busybox tee -a \$KI
elif [ -e /sys/kernel/mm/uksm/run ]
then
busybox echo 'uKSM running is stopping...' | busybox tee -a \$KI
busybox chmod 644 /sys/kernel/mm/uksm/run
busybox echo '0' > /sys/kernel/mm/uksm/run
busybox echo 'OK done !!!' | busybox tee -a \$KI
else
busybox echo 'KSM & UKSM Not Available In This Kernel !!!' | busybox tee -a \
$KI
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Ksm_Off' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Ksm_Off' > /dev/null 2>&1;
#
#
# Multi Core Power Saver Enabler
#
#
busybox cat >> $CORE'/KI00MCPS' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00MCPS.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Multi core power save is applying...' | busybox tee -a \$KI
if [ -e /sys/devices/system/cpu/sched_mc_power_savings ]
then
busybox echo '2' > /sys/devices/system/cpu/sched_mc_power_savings
busybox echo 'Feature enabled !!!' | busybox tee -a \$KI
else
busybox echo 'This feature is not avaible for you, because your device is not
multi core or your CPU does not support it' | busybox tee -a \$KI
fi
busybox echo 'OK done !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00MCPS' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00MCPS' > /dev/null 2>&1;
#
#
# Media Server Killer Enabler
#
#
busybox cat >> $CORE'/KI00Media_Server_Kill' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Media_Server_Kill.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Media Server Killing is starting...' | busybox tee -a \$KI


if [ "\$(pgrep media)" ] && [ "\$(pgrep mediaserver)" ]
then
busybox killall -9 android.process.media > /dev/null 2>&1;
busybox killall -9 mediaserver > /dev/null 2>&1;
fi
busybox echo 'Media server Kill is successfully Done !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Media_Server_Kill' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Media_Server_Kill' > /dev/null 2>&1;
#
#
# Media Scanner Killer
#
#
busybox cat >> $CORE'/KI00Media_Scanner_Kill' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Media_Scanner_Kill.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Starting Media Scanner Killing...' | busybox tee -a \$KI


pm disable
com.android.providers.media/com.android.providers.media.MediaScannerReceiver >
/dev/null 2>&1;
busybox echo 'successfully Done !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Media_Scanner_Kill' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Media_Scanner_Kill' > /dev/null 2>&1;
#
#
# Sweep To Wake Enabler
#
#
busybox cat >> $CORE'/KI00Sweep2wake_Enabled' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Sweep2wake.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

androidtouch='/sys/android_touch' > /dev/null 2>&1;


if [ -e \$androidtouch/sweep2wake ]
then
busybox echo 'Enabling Sweep2wake...' | busybox tee -a \$KI
busybox echo '1' > \$androidtouch/sweep2wake
busybox echo 'OK Done' | busybox tee -a \$KI
else
busybox echo 'Not Supported' | busybox tee -a \$KI
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Sweep2wake_Enabled' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Sweep2wake_Enabled' > /dev/null 2>&1;
#
#
# Sweep To Wake Disabler
#
#
busybox cat >> $CORE'/KI00Sweep2wake_Disabled' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Sweep2wake.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

androidtouch='/sys/android_touch' > /dev/null 2>&1;


if [ -e \$androidtouch/sweep2wake ]
then
busybox echo 'Disabling Sweep2wake...' | busybox tee -a \$KI
busybox echo '0' > \$androidtouch/sweep2wake
busybox echo 'OK Done' | busybox tee -a \$KI
else
busybox echo 'Not Supported' | busybox tee -a \$KI
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Sweep2wake_Disabled' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Sweep2wake_Disabled' > /dev/null 2>&1;
#
#
# Double Tap To Wake Enabler
#
#
busybox cat >> $CORE'/KI00Tap2wake_Enabled' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#
KI='/system/KITANA/LOGS/KI00Tap2wake.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

androidtouch='/sys/android_touch' > /dev/null 2>&1;


if [ -e \$androidtouch/doubletap2wake ]
then
busybox echo 'Enabling double tap to wake...' | busybox tee -a \$KI
busybox echo '1' > \$androidtouch/doubletap2wake
busybox echo 'OK done !!!' >> \$KI | busybox tee -a \$KI
else
busybox echo 'Not Supported' >> \$KI | busybox tee -a \$KI
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Tap2wake_Enabled' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Tap2wake_Enabled' > /dev/null 2>&1;
#
#
# Double Tap To Wake Disabler
#
#
busybox cat >> $CORE'/KI00Tap2wake_Disabled' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Tap2wake.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

androidtouch='/sys/android_touch' > /dev/null 2>&1;


if [ -e \$androidtouch/doubletap2wake ]
then
busybox echo 'Disabling double tap to wake...' | busybox tee -a \$KI
busybox echo '0' > \$androidtouch/doubletap2wake
busybox echo 'OK done !!!' >> \$KI | busybox tee -a \$KI
else
busybox echo 'Not Supported' >> \$KI | busybox tee -a \$KI
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Tap2wake_Disabled' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Tap2wake_Disabled' > /dev/null 2>&1;
#
#
# Internet Speed Plus
#
#
busybox cat >> $CORE'/KI00Net_Speed+' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Net_Speed+.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Applying Net Speed+ Tweak...' | busybox tee -a \$KI


path="/sys/class/net/*" > /dev/null 2>&1;
for NSP in \$path;
do
if [ -e \$NSP/tx_queue_len ]
then
busybox echo '100' > \$NSP/tx_queue_len
fi
done
busybox echo 'Net Speed+ Tweaks is successfully Applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Net_Speed+' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Net_Speed+' > /dev/null 2>&1;
#
#
# TCP Tuning For Good Internet Speed
#
#
busybox cat >> $CORE'/KI00Net_Tcp' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Net_Tcp.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Net TCP Tweaks is starting...' | busybox tee -a \$KI


busybox sysctl -e -w net.ipv4.tcp_timestamps=0;
busybox sysctl -e -w net.ipv4.tcp_sack=1;
busybox sysctl -e -w net.ipv4.tcp_fack=1;
busybox sysctl -e -w net.ipv4.tcp_window_scaling=1;
busybox echo 'TCP Tweaks is successfully Applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Net_Tcp' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Net_Tcp' > /dev/null 2>&1;
#
#
# Protection against SYN Attacks
#
#
busybox cat >> $CORE'/KI00SYN_Attacks' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00SYN_Attacks.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;


if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'SYN Attack Tweaks is starting...' | busybox tee -a \$KI


busybox sysctl -e -w net.ipv4.tcp_syncookies=1;
busybox sysctl -e -w net.ipv4.conf.all.rp_filter=1;
busybox sysctl -e -w net.ipv4.conf.default.rp_filter=1;
busybox sysctl -e -w net.ipv4.tcp_synack_retries=2;
busybox sysctl -e -w net.ipv4.tcp_syn_retries=2;
busybox sysctl -e -w net.ipv4.tcp_max_syn_backlog=1024;
busybox sysctl -e -w net.ipv4.tcp_max_tw_buckets=16384;
busybox sysctl -e -w net.ipv4.icmp_busybox echo_ignore_all=1;
busybox sysctl -e -w net.ipv4.icmp_ignore_bogus_error_responses=1;
busybox sysctl -e -w net.ipv4.tcp_no_metrics_save=1;
busybox sysctl -e -w net.ipv4.tcp_fin_timeout=15;
busybox sysctl -e -w net.ipv4.tcp_keepalive_intvl=30;
busybox sysctl -e -w net.ipv4.tcp_keepalive_probes=5;
busybox sysctl -e -w net.ipv4.tcp_keepalive_time=1800;
busybox sysctl -e -w net.ipv4.ip_forward=0;
busybox echo 'SYN Attack Tweaks is successfully Applied !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00SYN_Attacks' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00SYN_Attacks' > /dev/null 2>&1;
#
#
# Block Redirects
#
#
busybox cat >> $CORE'/KI00Block_Redirects' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Block_Redirects.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Block Redirects Tweaks is starting...' | busybox tee -a \$KI


busybox sysctl -e -w net.ipv4.conf.all.accept_redirects=0;
busybox sysctl -e -w net.ipv4.conf.default.accept_redirects=0;
busybox sysctl -e -w net.ipv4.conf.all.secure_redirects=0;
busybox sysctl -e -w net.ipv4.conf.default.secure_redirects=0;
busybox echo 'Block Redirects Tweaks is successfully Applied !!!' | busybox tee
-a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Block_Redirects' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Block_Redirects' > /dev/null 2>&1;
#
#
# Avoid Time-Wait
#
#
busybox cat >> $CORE'/KI00Avoid_Time' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Avoid_Time.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Avoid Time-Wait Tweaks is starting...' | busybox tee -a \$KI


busybox sysctl -e -w net.ipv4.tcp_tw_recycle=1;
busybox sysctl -e -w net.ipv4.tcp_tw_reuse=1;
busybox echo 'Avoid Time-Wait Tweaks is successfully Applied !!!' | busybox tee
-a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Avoid_Time' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Avoid_Time' > /dev/null 2>&1;
#
#
# Block Source-Routing
#
#
busybox cat >> $CORE'/KI00Block_Routing' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Block_Routing.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Block Source-Routing Tweaks is starting...' | busybox tee -a \$KI


busybox sysctl -e -w net.ipv4.conf.default.accept_source_route=0;
busybox sysctl -e -w net.ipv4.conf.all.accept_source_route=0;
busybox echo 'Block Source-Routing Tweaks is successfully Applied !!!' | busybox
tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Block_Routing' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Block_Routing' > /dev/null 2>&1;
#
#
# Msm Hsic WS Wakelock Enabler
#
#
busybox cat >> $CORE'/KI00Msm' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Msm.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Enabling Msm Wakelock...' | busybox tee -a \$KI


if [ -e /sys/module/wakeup/parameters/enable_msm_hsic_ws ]
then
busybox echo 'Y' > /sys/module/wakeup/parameters/enable_msm_hsic_ws
busybox echo 'OK Done !!!' | busybox tee -a \$KI
else
busybox echo 'Not Supported !!!' | busybox tee -a \$Ki
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Msm' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Msm' > /dev/null 2>&1;
#
#
# Si Hsic Ws Wakelock Enabler
#
#
busybox cat >> $CORE'/KI00Si' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/"KI00Si.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Enabling Si Hsic Wakelock...' | busybox tee -a \$KI


if [ -e /sys/module/wakeup/parameters/enable_msm_hsic_ws ]
then
busybox echo 'Y' > /sys/module/wakeup/parameters/enable_si_ws
busybox echo 'OK Done !!!' | busybox tee -a \$KI
else
busybox echo 'Not Supported !!!' | busybox tee -a \$Ki
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Si' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Si' > /dev/null 2>&1;
#
#
# Sbm135x Wakelock Enabler
#
#
busybox cat >> $CORE'/KI00Smb' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Smb.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Enabling Sbm 135x Wakelock...' | busybox tee -a \$KI


if [ -e /sys/module/wakeup/parameters/enable_msm_hsic_ws ]
then
busybox echo 'Y' > /sys/module/wakeup/parameters/enable_smb135x_wlan_ws
busybox echo 'OK Done !!!' | busybox tee -a \$KI
else
busybox echo 'Not Supported !!!' | busybox tee -a \$Ki
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Smb' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Smb' > /dev/null 2>&1;
#
#
# Wlan Ctrl Hsic WS Wakelock Enabler
#
#
busybox cat >> $CORE'/KI00Ctrl' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Ctrl.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Enabling Wlan Ctrl Wakelock...' | busybox tee -a \$KI


if [ -e /sys/module/wakeup/parameters/enable_msm_hsic_ws ]
then
busybox echo 'Y' > /sys/module/wakeup/parameters/enable_wlan_ctrl_wake_ws
busybox echo 'OK Done !!!' | busybox tee -a \$KI
else
busybox echo 'Not Supported !!!' | busybox tee -a \$Ki
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Ctrl' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Ctrl' > /dev/null 2>&1;
#
#
# Wlan Rx Hsic WS Wakelock Enabler
#
#
busybox cat >> $CORE'/KI00Rx_Off' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Rx_Off.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Enabling Wlan Ctrl Wakelock...' | busybox tee -a \$KI


if [ -e /sys/module/wakeup/parameters/enable_msm_hsic_ws ]
then
busybox echo 'Y' > /sys/module/wakeup/parameters/enable_wlan_rx_wake_ws
busybox echo 'OK Done !!!' | busybox tee -a \$KI
else
busybox echo 'Not Supported !!!' | busybox tee -a \$Ki
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Rx_Off' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Rx_Off' > /dev/null 2>&1;
#
#
# Wlan Ws Hsic WS Wakelock Enabler
#
#
busybox cat >> $CORE'/KI00Wlan_Ws' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Wlan_Ws.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Enabling Wlan Hsic Ws Wakelock...' | busybox tee -a \$KI


if [ -e /sys/module/wakeup/parameters/enable_msm_hsic_ws ]
then
busybox echo 'Y' > /sys/module/wakeup/parameters/enable_wlan_wake_ws
busybox echo 'OK Done !!!' | busybox tee -a \$KI
else
busybox echo 'Not Supported !!!' | busybox tee -a \$Ki
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Wlan_Ws' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Wlan_Ws' > /dev/null 2>&1;
#
#
# Msm Hsic WS Wakelock Disabler
#
#
busybox cat >> $CORE'/KI00Msm_Off' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Msm.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Disabling Msm Wakelock...' | busybox tee -a \$KI


if [ -e /sys/module/wakeup/parameters/enable_msm_hsic_ws ]
then
busybox echo 'N' > /sys/module/wakeup/parameters/enable_msm_hsic_ws
busybox echo 'OK Done !!!' | busybox tee -a \$KI
else
busybox echo 'Not Supported !!!' | busybox tee -a \$Ki
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Msm_Off' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Msm_Off' > /dev/null 2>&1;
#
#
# Si Hsic Ws Wakelock Disabler
#
#
busybox cat >> $CORE'/KI00Si_Off' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#
KI='/system/KITANA/LOGS/"KI00Si.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Disabling Si Hsic Wakelock...' | busybox tee -a \$KI


if [ -e /sys/module/wakeup/parameters/enable_msm_hsic_ws ]
then
busybox echo 'N' > /sys/module/wakeup/parameters/enable_si_ws
busybox echo 'OK Done !!!' | busybox tee -a \$KI
else
busybox echo 'Not Supported !!!' | busybox tee -a \$Ki
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Si_Off' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Si_Off' > /dev/null 2>&1;
#
#
# Sbm135x Wakelock Disabler
#
#
busybox cat >> $CORE'/KI00Smb_Off' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Smb.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Disabling Sbm 135x Wakelock...' | busybox tee -a \$KI


if [ -e /sys/module/wakeup/parameters/enable_msm_hsic_ws ]
then
busybox echo 'N' > /sys/module/wakeup/parameters/enable_smb135x_wlan_ws
busybox echo 'OK Done !!!' | busybox tee -a \$KI
else
busybox echo 'Not Supported !!!' | busybox tee -a \$Ki
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Smb_Off' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Smb_Off' > /dev/null 2>&1;
#
#
# Wlan Ctrl Hsic WS Wakelock Disabler
#
#
busybox cat >> $CORE'/KI00Ctrl_Off' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Ctrl.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Disabling Wlan Ctrl Wakelock...' | busybox tee -a \$KI


if [ -e /sys/module/wakeup/parameters/enable_msm_hsic_ws ]
then
busybox echo 'N' > /sys/module/wakeup/parameters/enable_wlan_ctrl_wake_ws
busybox echo 'OK Done !!!' | busybox tee -a \$KI
else
busybox echo 'Not Supported !!!' | busybox tee -a \$Ki
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Ctrl_Off' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Ctrl_Off' > /dev/null 2>&1;
#
#
# Wlan Rx Hsic WS Wakelock Disabler
#
#
busybox cat >> $CORE'/KI00Rx_Off' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Rx_Off.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Disabling Wlan Ctrl Wakelock...' | busybox tee -a \$KI


if [ -e /sys/module/wakeup/parameters/enable_msm_hsic_ws ]
then
busybox echo 'N' > /sys/module/wakeup/parameters/enable_wlan_rx_wake_ws
busybox echo 'OK Done !!!' | busybox tee -a \$KI
else
busybox echo 'Not Supported !!!' | busybox tee -a \$Ki
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Rx_Off' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Rx_Off' > /dev/null 2>&1;
#
#
# Wlan Ws Hsic WS Wakelock Disabler
#
#
busybox cat >> $CORE'/KI00Wlan_Ws_Off' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

KI='/system/KITANA/LOGS/KI00Wlan_Ws.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Disabling Wlan Hsic Ws Wakelock...' | busybox tee -a \$KI


if [ -e /sys/module/wakeup/parameters/enable_msm_hsic_ws ]
then
busybox echo 'N' > /sys/module/wakeup/parameters/enable_wlan_wake_ws
busybox echo 'OK Done !!!' | busybox tee -a \$KI
else
busybox echo 'Not Supported !!!' | busybox tee -a \$Ki
fi

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Wlan_Ws_Off' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Wlan_Ws_Off' > /dev/null 2>&1;
#
#
# TCP Algorithm
#
#
busybox cat >> $CORE'/KI00Tcpalgorithm' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

BACKUP='/system/KITANA/BACKUP' > /dev/null 2>&1;


KI='/system/KITANA/LOGS/KI00Tcpalgorithm.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Applying Change...' | busybox tee -a \$KI


tcpd="\$BACKUP/KI00TCP_Algorithm" > /dev/null 2>&1;
tcp="/proc/sys/net/ipv4/tcp_available_congestion_control" > /dev/null 2>&1;
tcp_con="/proc/sys/net/ipv4/tcp_congestion_control" > /dev/null 2>&1;
busybox echo "\$(busybox cat \$tcpd)" > \$tcp_con
busybox echo 'OK done !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Tcpalgorithm' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Tcpalgorithm' > /dev/null 2>&1;
#
#
# Governor Controls
#
#
busybox cat >> $CORE'/KI00Governor' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

BACKUP='/system/KITANA/BACKUP' > /dev/null 2>&1;


KI='/system/KITANA/LOGS/KI00Governor.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Applying Change...' | busybox tee -a \$KI


govd="\$BACKUP/KI00CPU_Governor" > /dev/null 2>&1;
governor="/sys/bus/cpu/devices/cpu0/cpufreq/scaling_governor" > /dev/null 2>&1;
busybox chmod 755 \$governor > /dev/null 2>&1;
busybox echo "\$(busybox cat \$govd)" > \$governor
busybox chmod 644 \$governor > /dev/null 2>&1;
CPUPATH="/sys/bus/cpu/devices/cpu*" > /dev/null 2>&1;
for CPUON in \$CPUPATH
do
busybox chmod 755 \$CPUON/online
busybox echo '1' > \$CPUON/online
busybox chmod 644 \$CPUON/online
done
busybox echo 'OK done !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Governor' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Governor' > /dev/null 2>&1;
#
#
# I/O Schedule Control
#
#
busybox cat >> $CORE'/KI00Schedule' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

BACKUP='/system/KITANA/BACKUP' > /dev/null 2>&1;


KI='/system/KITANA/LOGS/KI00Schedule.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Applying Change...' | busybox tee -a \$KI


schd="\$BACKUP/KI00Schedule" > /dev/null 2>&1;
path="/sys/block/mmcblk*";
for SC in \$path; do
busybox echo "\$(busybox cat \$schd)" > \$SC/queue/scheduler
done
CPUPATH="/sys/bus/cpu/devices/cpu*";
for CPUON in \$CPUPATH
do
busybox chmod 755 \$CPUON/online
busybox echo '1' > \$CPUON/online
busybox chmod 644 \$CPUON/online
done
busybox echo 'OK done !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Schedule' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Schedule' > /dev/null 2>&1;
#
#
# Hostname Changer
#
#
busybox cat >> $CORE'/KI00Host_Name' << KITANA
#!/system/bin/sh
# KITANA
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#

BACKUP='/system/KITANA/BACKUP' > /dev/null 2>&1;


KI='/system/KITANA/LOGS/KI00Host_Name.log' > /dev/null 2>&1;

mount -o rw,remount,rw '/system' > /dev/null 2>&1;

if [ -f \$KI ]
then
busybox rm \$KI > /dev/null 2>&1;
fi

busybox echo 'Host Name Changer is starting...' | busybox tee -a \$KI


NEW_HOST=\$(busybox cat $BACKUP/KI00Custom_Host | tr -d "[[:blank:]]")
setprop net.hostname \$NEW_HOST
busybox echo 'Successfully Done !!!' | busybox tee -a \$KI

mount -o ro,remount,ro '/system' > /dev/null 2>&1;


KITANA
busybox chmod 755 $CORE'/KI00Host_Name' > /dev/null 2>&1;
busybox chown 0:0 $CORE'/KI00Host_Name' > /dev/null 2>&1;
#
###################################################################################
###################################################################################
##############
#
# Build prop property & Related
#
###################################################################################
###################################################################################
##############
wifi_auto_scan ( )
{
if busybox grep -q wifi.supplicant_scan_interval=220 $BUILD
then
busybox sed -i '/wifi.supplicant_scan_interval/d' $BUILD
else
busybox sed -i '/wifi.supplicant_scan_interval/d' $BUILD
busybox echo 'wifi.supplicant_scan_interval=220' >> $BUILD
fi
}
power_collapse ( )
{
if busybox grep -q ro.ril.disable.power.collapse=0 $BUILD && busybox grep -q
ro.vold.umsdirtyratio=20 $BUILD && busybox grep -q pm.sleep_mode=1 $BUILD
then
busybox sed -i '/ro.ril.disable.power.collapse/d' $BUILD
busybox sed -i '/ro.vold.umsdirtyratio/d' $BUILD
busybox sed -i '/pm.sleep_mode/d' $BUILD
else
busybox sed -i '/ro.ril.disable.power.collapse/d' $BUILD
busybox sed -i '/ro.vold.umsdirtyratio/d' $BUILD
busybox sed -i '/pm.sleep_mode/d' $BUILD
busybox echo 'ro.ril.disable.power.collapse=0' >> $BUILD
busybox echo 'ro.vold.umsdirtyratio=20' >> $BUILD
busybox echo 'pm.sleep_mode=1' >> $BUILD
fi
}
portal_captive ( )
{
captivemode=$(settings get global captive_portal_mode) > /dev/null 2>&1;
if [ "$captivemode" == '0' ]
then
settings delete global captive_portal_mode > /dev/null 2>&1;
settings put global captive_portal_mode 1 > /dev/null 2>&1;
elif [ "$captivemode" == '1' ]
then
settings delete global captive_portal_mode > /dev/null 2>&1;
settings put global captive_portal_mode 0 > /dev/null 2>&1;
else
settings delete global captive_portal_mode > /dev/null 2>&1;
settings put global captive_portal_mode 1 > /dev/null 2>&1;
fi
}
power_supply ( )
{
if busybox grep -q power_supply.wakeup=enable $BUILD
then
busybox sed -i '/power_supply.wakeup/d' $BUILD
else
busybox sed -i '/power_supply.wakeup/d' $BUILD
busybox echo 'power_supply.wakeup=enable' >> $BUILD
fi
}
sensors_management ( )
{
if busybox grep -q ro.ril.sensor.sleep.control=1 $BUILD
then
busybox sed -i '/ro.ril.sensor.sleep.control/d' $BUILD
else
busybox sed -i '/ro.ril.sensor.sleep.control/d' $BUILD
busybox echo 'ro.ril.sensor.sleep.control=1' >> $BUILD
fi
}
YouTube_1080 ( )
{
if busybox grep -q sys.display-size=1920x1080 $BUILD
then
busybox sed -i '/sys.display-size/d' $BUILD
else
busybox sed -i '/sys.display-size/d' $BUILD
busybox echo 'sys.display-size=1920x1080' >> $BUILD
fi
}
YouTube_1440 ( )
{
if busybox grep -q sys.display-size=2560x1440 $BUILD
then
busybox sed -i '/sys.display-size/d' $BUILD
else
busybox sed -i '/sys.display-size/d' $BUILD
busybox echo 'sys.display-size=2560x1440' >> $BUILD
fi
}
YouTube_480 ( )
{
if busybox grep -q sys.display-size=640x480 $BUILD
then
busybox sed -i '/sys.display-size/d' $BUILD
else
busybox sed -i '/sys.display-size/d' $BUILD
busybox echo 'sys.display-size=640x480' >> $BUILD
fi
}
YouTube_4K ( )
{
if busybox grep -q sys.display-size=3840x2160 $BUILD
then
busybox sed -i '/sys.display-size/d' $BUILD
else
busybox sed -i '/sys.display-size/d' $BUILD
busybox echo 'sys.display-size=3840x2160' >> $BUILD
fi
}
YouTube_720 ( )
{
if busybox grep -q sys.display-size=1280x720 $BUILD
then
busybox sed -i '/sys.display-size/d' $BUILD
else
busybox sed -i '/sys.display-size/d' $BUILD
busybox echo 'sys.display-size=1280x720' >> $BUILD
fi
}
runtime_optimizer ( )
{
if busybox grep -q dalvik.vm.check-dex-sum=false $BUILD && busybox grep -q
dalvik.vm.checkjni=false $BUILD && busybox grep -q dalvik.vm.execution-mode=int:jit
$BUILD
then
busybox sed -i '/dalvik.vm.check-dex-sum/d' $BUILD
busybox sed -i '/dalvik.vm.checkjni/d' $BUILD
busybox sed -i '/dalvik.vm.execution-mode/d' $BUILD
else
busybox sed -i '/dalvik.vm.check-dex-sum/d' $BUILD
busybox sed -i '/dalvik.vm.checkjni/d' $BUILD
busybox sed -i '/dalvik.vm.execution-mode/d' $BUILD
busybox echo 'dalvik.vm.check-dex-sum=false' >> $BUILD
busybox echo 'dalvik.vm.checkjni=false' >> $BUILD
busybox echo 'dalvik.vm.execution-mode=int:jit' >> $BUILD
fi
}
gpu_rendering ( )
{
if busybox grep -q hw2d.force=1 $BUILD && busybox grep -q hw3d.force=1 $BUILD
&& busybox grep -q ro.product.gpu.driver=1 $BUILD && busybox grep -q
persist.sampling_profiler=0 $BUILD && busybox grep -q
hwui.render_dirty_regions=false $BUILD && busybox grep -q persist.sys.ui.hw=1
$BUILD && busybox grep -q ro.config.disable.hw_accel=false $BUILD && busybox grep
-q video.accelerate.hw=1 $BUILD && busybox grep -q hwui.disable_vsync=true $BUILD
&& busybox grep -q persist.sys.composition.type=gpu $BUILD && busybox grep -q
debug.sf.hw=1 $BUILD && busybox grep -q debug.performance.tuning=1 $BUILD &&
busybox grep -q video.accelerate.hw=1 $BUILD && busybox grep -q
debug.egl.profiler=1 $BUILD && busybox grep -q debug.egl.hw=1 $BUILD && busybox
grep -q debug.composition.type=gpu $BUILD && busybox grep -q debug.enabletr=true
$BUILD && busybox grep -q debug.overlayui.enable=1 $BUILD && busybox grep -q
debug.qctwa.preservebuf=1 $BUILD && busybox grep -q dev.pm.dyn_samplingrate=1
$BUILD && busybox grep -q ro.fb.mode=1 $BUILD && busybox grep -q
ro.sf.compbypass.enable=0 $BUILD
then
busybox sed -i '/hw2d.force/d' $BUILD
busybox sed -i '/hw3d.force/d' $BUILD
busybox sed -i '/ro.product.gpu.driver/d' $BUILD
busybox sed -i '/persist.sampling_profiler/d' $BUILD
busybox sed -i '/hwui.render_dirty_regions/d' $BUILD
busybox sed -i '/persist.sys.ui.hw/d' $BUILD
busybox sed -i '/ro.config.disable.hw_accel/d' $BUILD
busybox sed -i '/video.accelerate.hw/d' $BUILD
busybox sed -i '/hwui.disable_vsync/d' $BUILD
busybox sed -i '/persist.sys.composition.type/d' $BUILD
busybox sed -i '/debug.sf.hw/d' $BUILD
busybox sed -i '/debug.performance.tuning/d' $BUILD
busybox sed -i '/video.accelerate.hw/d' $BUILD
busybox sed -i '/debug.egl.profiler/d' $BUILD
busybox sed -i '/debug.egl.hw/d' $BUILD
busybox sed -i '/debug.composition.type/d' $BUILD
busybox sed -i '/debug.enabletr/d' $BUILD
busybox sed -i '/debug.overlayui.enable/d' $BUILD
busybox sed -i '/debug.qctwa.preservebuf/d' $BUILD
busybox sed -i '/dev.pm.dyn_samplingrate/d' $BUILD
busybox sed -i '/ro.fb.mode/d' $BUILD
busybox sed -i '/ro.sf.compbypass.enable/d' $BUILD
else
busybox sed -i '/hw2d.force/d' $BUILD
busybox sed -i '/hw3d.force/d' $BUILD
busybox sed -i '/ro.product.gpu.driver/d' $BUILD
busybox sed -i '/persist.sampling_profiler/d' $BUILD
busybox sed -i '/hwui.render_dirty_regions/d' $BUILD
busybox sed -i '/persist.sys.ui.hw/d' $BUILD
busybox sed -i '/ro.config.disable.hw_accel/d' $BUILD
busybox sed -i '/video.accelerate.hw/d' $BUILD
busybox sed -i '/hwui.disable_vsync/d' $BUILD
busybox sed -i '/persist.sys.composition.type/d' $BUILD
busybox sed -i '/debug.sf.hw/d' $BUILD
busybox sed -i '/debug.performance.tuning/d' $BUILD
busybox sed -i '/video.accelerate.hw/d' $BUILD
busybox sed -i '/debug.egl.profiler/d' $BUILD
busybox sed -i '/debug.egl.hw/d' $BUILD
busybox sed -i '/debug.composition.type/d' $BUILD
busybox sed -i '/debug.enabletr/d' $BUILD
busybox sed -i '/debug.overlayui.enable/d' $BUILD
busybox sed -i '/debug.qctwa.preservebuf/d' $BUILD
busybox sed -i '/dev.pm.dyn_samplingrate/d' $BUILD
busybox sed -i '/ro.fb.mode/d' $BUILD
busybox sed -i '/ro.sf.compbypass.enable/d' $BUILD
busybox echo 'hw2d.force=1' >> $BUILD
busybox echo 'hw3d.force=1' >> $BUILD
busybox echo 'ro.product.gpu.driver=1' >> $BUILD
busybox echo 'persist.sampling_profiler=0' >> $BUILD
busybox echo 'hwui.render_dirty_regions=false' >> $BUILD
busybox echo 'persist.sys.ui.hw=1' >> $BUILD
busybox echo 'ro.config.disable.hw_accel=false' >> $BUILD
busybox echo 'video.accelerate.hw=1' >> $BUILD
busybox echo 'hwui.disable_vsync=true' >> $BUILD
busybox echo 'persist.sys.composition.type=gpu' >> $BUILD
busybox echo 'debug.sf.hw=1' >> $BUILD
busybox echo 'debug.performance.tuning=1' >> $BUILD
busybox echo 'video.accelerate.hw=1' >> $BUILD
busybox echo 'debug.egl.profiler=1' >> $BUILD
busybox echo 'debug.egl.hw=1' >> $BUILD
busybox echo 'debug.composition.type=gpu' >> $BUILD
busybox echo 'debug.enabletr=true' >> $BUILD
busybox echo 'debug.overlayui.enable=1' >> $BUILD
busybox echo 'debug.qctwa.preservebuf=1' >> $BUILD
busybox echo 'dev.pm.dyn_samplingrate=1' >> $BUILD
busybox echo 'ro.fb.mode=1' >> $BUILD
busybox echo 'ro.sf.compbypass.enable=0' >> $BUILD
fi
}
adb_icon ( )
{
if busybox grep -q persist.adb.notify=0 $BUILD
then
busybox sed -i '/persist.adb.notify/d' $BUILD
else
busybox sed -i '/persist.adb.notify/d' $BUILD
busybox echo 'persist.adb.notify=0' >> $BUILD
fi
}
arm_wideband ( )
{
if busybox grep -q ro.ril.enable.amr.wideband=1 $BUILD
then
busybox sed -i '/ro.ril.enable.amr.wideband/d' $BUILD
else
busybox sed -i '/ro.ril.enable.amr.wideband/d' $BUILD
busybox echo 'ro.ril.enable.amr.wideband=1' >> $BUILD
fi
}
assertive_display ( )
{
if busybox grep -q ro.qcom.ad=1 $BUILD && busybox grep -q
ro.qcom.ad.calib.data=/system/etc/ad_calib.cfg $BUILD
then
busybox sed -i '/ro.qcom.ad/d' $BUILD
busybox sed -i '/ro.qcom.ad.calib.data/d' $BUILD
else
busybox sed -i '/ro.qcom.ad/d' $BUILD
busybox sed -i '/ro.qcom.ad.calib.data/d' $BUILD
busybox echo 'ro.qcom.ad=1' >> $BUILD
busybox echo 'ro.qcom.ad.calib.data=/system/etc/ad_calib.cfg' >> $BUILD
fi
}
better_scrolling ( )
{
if busybox grep -q persist.sys.scrollingcache=3 $BUILD && busybox grep -q
ro.max.fling_velocity=12000 $BUILD && busybox grep -q ro.min.fling_velocity=8000
$BUILD
then
busybox sed -i '/persist.sys.scrollingcache/d' $BUILD
busybox sed -i '/ro.max.fling_velocity/d' $BUILD
busybox sed -i '/ro.min.fling_velocity/d' $BUILD
else
busybox sed -i '/persist.sys.scrollingcache/d' $BUILD
busybox sed -i '/ro.max.fling_velocity/d' $BUILD
busybox sed -i '/ro.min.fling_velocity/d' $BUILD
busybox echo 'persist.sys.scrollingcache=3' >> $BUILD
busybox echo 'ro.max.fling_velocity=12000' >> $BUILD
busybox echo 'ro.min.fling_velocity=8000' >> $BUILD
fi
}
faster_boot ( )
{
if busybox grep -q ro.config.hw_quickpoweron=true $BUILD
then
busybox sed -i '/ro.config.hw_quickpoweron/d' $BUILD
else
busybox sed -i '/ro.config.hw_quickpoweron/d' $BUILD
busybox echo 'ro.config.hw_quickpoweron=true' >> $BUILD
fi
}
faster_reboot ( )
{
if busybox grep -q persist.sys.shutdown.mode=hibernate $BUILD
then
busybox sed -i '/persist.sys.shutdown.mode/d' $BUILD
else
busybox sed -i '/persist.sys.shutdown.mode/d' $BUILD
busybox echo 'persist.sys.shutdown.mode=hibernate' >> $BUILD
fi
}
no_boot_animation ( )
{
if busybox grep -q debug.sf.nobootanimation=1 $BUILD
then
busybox sed -i '/debug.sf.nobootanimation/d' $BUILD
else
busybox sed -i '/debug.sf.nobootanimation/d' $BUILD
busybox echo 'debug.sf.nobootanimation=1' >> $BUILD
fi
}
seeder_default ( )
{
busybox rm -f $INIT/KI00Entropy_Light
busybox rm -f $INIT/KI00Entropy_Enlarger
busybox rm -f $INIT/KI00Entropy_Moderate
busybox rm -f $INIT/KI00Entropy_Aggressive
}
seeder_light ( )
{
if [ -f $INIT/KI00Entropy_Light ]
then
busybox rm -f $INIT/KI00Entropy_Light
else
busybox rm -f $INIT/KI00Entropy_Light
busybox rm -f $INIT/KI00Entropy_Enlarger
busybox rm -f $INIT/KI00Entropy_Moderate
busybox rm -f $INIT/KI00Entropy_Aggressive
busybox cp -f $CORE/KI00Entropy_Light $INIT/KI00Entropy_Light
busybox chmod 755 $INIT/KI00Entropy_Light
busybox chown 0:2000 $INIT/KI00Entropy_Light
fi
}
seeder_enlarger ( )
{
if [ -f $INIT/KI00Entropy_Enlarger ]
then
busybox rm -f $INIT/KI00Entropy_Enlarger
else
busybox rm -f $INIT/KI00Entropy_Light
busybox rm -f $INIT/KI00Entropy_Enlarger
busybox rm -f $INIT/KI00Entropy_Moderate
busybox rm -f $INIT/KI00Entropy_Aggressive
busybox cp -f $CORE/KI00Entropy_Enlarger $INIT/KI00Entropy_Enlarger
busybox chmod 755 $INIT/KI00Entropy_Enlarger
busybox chown 0:2000 $INIT/KI00Entropy_Enlarger
fi
}
seeder_moderate ( )
{
if [ -f $INIT/KI00Entropy_Moderate ]
then
busybox rm -f $INIT/KI00Entropy_Moderate
else
busybox rm -f $INIT/KI00Entropy_Light
busybox rm -f $INIT/KI00Entropy_Enlarger
busybox rm -f $INIT/KI00Entropy_Moderate
busybox rm -f $INIT/KI00Entropy_Aggressive
busybox cp -f $CORE/KI00Entropy_Moderate $INIT/KI00Entropy_Moderate
busybox chmod 755 $INIT/KI00Entropy_Moderate
busybox chown 0:2000 $INIT/KI00Entropy_Moderate
fi
}
seeder_aggressive ( )
{
if [ -f $INIT/KI00Entropy_Aggressive ]
then
busybox rm -f $INIT/KI00Entropy_Aggressive
else
busybox rm -f $INIT/KI00Entropy_Light
busybox rm -f $INIT/KI00Entropy_Enlarger
busybox rm -f $INIT/KI00Entropy_Moderate
busybox rm -f $INIT/KI00Entropy_Aggressive
busybox cp -f $CORE/KI00Entropy_Aggressive $INIT/KI00Entropy_Aggressive
busybox chmod 755 $INIT/KI00Entropy_Aggressive
busybox chown 0:2000 $INIT/KI00Entropy_Aggressive
fi
}
captured ( )
{
if busybox grep -q ro.media.enc.jpeg.quality=100 $BUILD && busybox grep -q
ro.media.enc.hprof.vid.fps=60 $BUILD && busybox grep -q
ro.media.dec.jpeg.memcap=8000000 $BUILD && busybox grep -q
ro.media.enc.hprof.vid.bps=8000000 $BUILD && busybox grep -q
ro.media.capture.maxres=8m $BUILD && busybox grep -q
ro.media.panorama.defres=3264x1840 $BUILD && busybox grep -q
ro.media.panorama.frameres=1280x720 $BUILD && busybox grep -q
ro.camcorder.videoModes=true $BUILD && busybox grep -q
ro.media.enc.hprof.vid.fps=60 $BUILD && busybox grep -q
ro.media.dec.aud.wma.enabled=1 $BUILD && busybox grep -q
ro.media.dec.vid.wmv.enabled=1 $BUILD && busybox grep -q ro.media.cam.preview.fps=0
$BUILD && busybox grep -q ro.media.capture.flash=led $BUILD && busybox grep -q
ro.media.capture.flashMinV=3300000 $BUILD && busybox grep -q
ro.media.capture.torchIntensity=65 $BUILD && busybox grep -q
ro.media.capture.flashIntensity=100 $BUILD && busybox grep -q
ro.media.capture.fast.fps=4 $BUILD && busybox grep -q ro.media.capture.slow.fps=120
$BUILD
then
busybox sed -i '/ro.media.enc.jpeg.quality/d' $BUILD
busybox sed -i '/ro.media.enc.hprof.vid.fps/d' $BUILD
busybox sed -i '/ro.media.dec.jpeg.memcap/d' $BUILD
busybox sed -i '/ro.media.enc.hprof.vid.bps/d' $BUILD
busybox sed -i '/ro.media.capture.maxres/d' $BUILD
busybox sed -i '/ro.media.panorama.defres/d' $BUILD
busybox sed -i '/ro.media.panorama.frameres/d' $BUILD
busybox sed -i '/ro.camcorder.videoModes/d' $BUILD
busybox sed -i '/ro.media.enc.hprof.vid.fps/d' $BUILD
busybox sed -i '/ro.media.dec.aud.wma.enabled/d' $BUILD
busybox sed -i '/ro.media.dec.vid.wmv.enabled/d' $BUILD
busybox sed -i '/ro.media.cam.preview.fps/d' $BUILD
busybox sed -i '/ro.media.capture.flash/d' $BUILD
busybox sed -i '/ro.media.capture.flashMinV/d' $BUILD
busybox sed -i '/ro.media.capture.torchIntensity/d' $BUILD
busybox sed -i '/ro.media.capture.flashIntensity/d' $BUILD
busybox sed -i '/ro.media.capture.fast.fps/d' $BUILD
busybox sed -i '/ro.media.capture.slow.fps/d' $BUILD
else
busybox sed -i '/ro.media.enc.jpeg.quality/d' $BUILD
busybox sed -i '/ro.media.enc.hprof.vid.fps/d' $BUILD
busybox sed -i '/ro.media.dec.jpeg.memcap/d' $BUILD
busybox sed -i '/ro.media.enc.hprof.vid.bps/d' $BUILD
busybox sed -i '/ro.media.capture.maxres/d' $BUILD
busybox sed -i '/ro.media.panorama.defres/d' $BUILD
busybox sed -i '/ro.media.panorama.frameres/d' $BUILD
busybox sed -i '/ro.camcorder.videoModes/d' $BUILD
busybox sed -i '/ro.media.enc.hprof.vid.fps/d' $BUILD
busybox sed -i '/ro.media.dec.aud.wma.enabled/d' $BUILD
busybox sed -i '/ro.media.dec.vid.wmv.enabled/d' $BUILD
busybox sed -i '/ro.media.cam.preview.fps/d' $BUILD
busybox sed -i '/ro.media.capture.flash/d' $BUILD
busybox sed -i '/ro.media.capture.flashMinV/d' $BUILD
busybox sed -i '/ro.media.capture.torchIntensity/d' $BUILD
busybox sed -i '/ro.media.capture.flashIntensity/d' $BUILD
busybox echo 'ro.media.enc.jpeg.quality=100' >> $BUILD
busybox echo 'ro.media.enc.hprof.vid.fps=60' >> $BUILD
busybox echo 'ro.media.dec.jpeg.memcap=8000000' >> $BUILD
busybox echo 'ro.media.enc.hprof.vid.bps=8000000' >> $BUILD
busybox echo 'ro.media.capture.maxres=8m' >> $BUILD
busybox echo 'ro.media.panorama.defres=3264x1840' >> $BUILD
busybox echo 'ro.media.panorama.frameres=1280x720' >> $BUILD
busybox echo 'ro.camcorder.videoModes=true' >> $BUILD
busybox echo 'ro.media.enc.hprof.vid.fps=60' >> $BUILD
busybox echo 'ro.media.dec.aud.wma.enabled=1' >> $BUILD
busybox echo 'ro.media.dec.vid.wmv.enabled=1' >> $BUILD
busybox echo 'ro.media.cam.preview.fps=0' >> $BUILD
busybox echo 'ro.media.capture.flash=led' >> $BUILD
busybox echo 'ro.media.capture.flashMinV=3300000' >> $BUILD
busybox echo 'ro.media.capture.torchIntensity=65' >> $BUILD
busybox echo 'ro.media.capture.flashIntensity=100' >> $BUILD
busybox echo 'ro.media.capture.fast.fps=4' >> $BUILD
busybox echo 'ro.media.capture.slow.fps=120' >> $BUILD
fi
}
fast_dormancy ( )
{
if busybox grep -q ro.fast.dormancy=1 $BUILD && busybox grep -q
ro.ril.fast.dormancy.rule=1 $BUILD && busybox grep -q
persist.radio.data_no_toggle=1 $BUILD
then
busybox sed -i '/ro.fast.dormancy/d' $BUILD
busybox sed -i '/ro.ril.fast.dormancy.rule/d' $BUILD
busybox sed -i '/persist.radio.data_no_toggle/d' $BUILD
else
busybox sed -i '/ro.fast.dormancy/d' $BUILD
busybox sed -i '/ro.ril.fast.dormancy.rule/d' $BUILD
busybox sed -i '/persist.radio.data_no_toggle/d' $BUILD
busybox echo 'ro.fast.dormancy=1' >> $BUILD
busybox echo 'ro.ril.fast.dormancy.rule=1' >> $BUILD
busybox echo 'persist.radio.data_no_toggle=1' >> $BUILD
fi
}
fast_streaming ( )
{
if busybox grep -q media.stagefright.enable-player=true $BUILD && busybox
grep -q media.stagefright.enable-meta=true $BUILD && busybox grep -q
media.stagefright.enable-scan=true $BUILD && busybox grep -q
media.stagefright.enable-http=true $BUILD && busybox grep -q
media.stagefright.enable-record=false $BUILD && busybox grep -q
media.stagefright.enable-aac=true $BUILD && busybox grep -q
media.stagefright.enable-rtsp=true $BUILD && busybox grep -q
media.stagefright.enable-fma2dp=true $BUILD && busybox grep -q
media.stagefright.enable-qcp=true $BUILD
then
busybox sed -i '/media.stagefright.enable-player/d' $BUILD
busybox sed -i '/media.stagefright.enable-meta/d' $BUILD
busybox sed -i '/media.stagefright.enable-scan/d' $BUILD
busybox sed -i '/media.stagefright.enable-http/d' $BUILD
busybox sed -i '/media.stagefright.enable-record/d' $BUILD
busybox sed -i '/media.stagefright.enable-aac/d' $BUILD
busybox sed -i '/media.stagefright.enable-rtsp/d' $BUILD
busybox sed -i '/media.stagefright.enable-fma2dp/d' $BUILD
busybox sed -i '/media.stagefright.enable-qcp/d' $BUILD
else
busybox sed -i '/media.stagefright.enable-player/d' $BUILD
busybox sed -i '/media.stagefright.enable-meta/d' $BUILD
busybox sed -i '/media.stagefright.enable-scan/d' $BUILD
busybox sed -i '/media.stagefright.enable-http/d' $BUILD
busybox sed -i '/media.stagefright.enable-record/d' $BUILD
busybox sed -i '/media.stagefright.enable-aac/d' $BUILD
busybox sed -i '/media.stagefright.enable-rtsp/d' $BUILD
busybox sed -i '/media.stagefright.enable-fma2dp/d' $BUILD
busybox sed -i '/media.stagefright.enable-qcp/d' $BUILD
busybox echo 'media.stagefright.enable-player=true' >> $BUILD
busybox echo 'media.stagefright.enable-meta=true' >> $BUILD
busybox echo 'media.stagefright.enable-scan=true' >> $BUILD
busybox echo 'media.stagefright.enable-http=true' >> $BUILD
busybox echo 'media.stagefright.enable-record=false' >> $BUILD
busybox echo 'media.stagefright.enable-aac=true' >> $BUILD
busybox echo 'media.stagefright.enable-rtsp=true' >> $BUILD
busybox echo 'media.stagefright.enable-fma2dp=true' >> $BUILD
busybox echo 'media.stagefright.enable-qcp=true' >> $BUILD
fi
}
deep_ipv4 ( )
{
if busybox grep -q default_secure_redirects=0 $BUILD && busybox grep -q
default_accept_redirects=0 $BUILD && busybox grep -q default_accept_source_route=0
$BUILD && busybox grep -q all_secure_redirects=0 $BUILD && busybox grep -q
all_accept_redirects=0 $BUILD && busybox grep -q all_accept_source_route=0 $BUILD
&& busybox grep -q ip_forward=0 $BUILD && busybox grep -q ip_dynaddr=0 $BUILD &&
busybox grep -q ip_no_pmtu_disc=0 $BUILD && busybox grep -q tcp_ecn=2 $BUILD &&
busybox grep -q tcp_timestamps=1 $BUILD && busybox grep -q tcp_low_latency=0 $BUILD
&& busybox grep -q tcp_tw_reuse=1 $BUILD && busybox grep -q tcp_fack=1 $BUILD &&
busybox grep -q tcp_sack=1 $BUILD && busybox grep -q tcp_dsack=1 $BUILD && busybox
grep -q tcp_rfc1337=1 $BUILD && busybox grep -q tcp_tw_recycle=1 $BUILD && busybox
grep -q tcp_window_scaling=1 $BUILD && busybox grep -q tcp_moderate_rcvbuf=1 $BUILD
&& busybox grep -q tcp_no_metrics_save=1 $BUILD && busybox grep -q
tcp_synack_retries=2 $BUILD && busybox grep -q tcp_syn_retries=2 $BUILD && busybox
grep -q tcp_keepalive_probes=5 $BUILD && busybox grep -q tcp_keepalive_intvl=30
$BUILD && busybox grep -q tcp_fin_timeout=30 $BUILD
then
busybox sed -i '/default_secure_redirects/d' $BUILD
busybox sed -i '/default_accept_redirects/d' $BUILD
busybox sed -i '/default_accept_source_route/d' $BUILD
busybox sed -i '/all_secure_redirects/d' $BUILD
busybox sed -i '/all_accept_redirects/d' $BUILD
busybox sed -i '/all_accept_source_route/d' $BUILD
busybox sed -i '/ip_forward/d' $BUILD
busybox sed -i '/ip_dynaddr/d' $BUILD
busybox sed -i '/ip_no_pmtu_disc/d' $BUILD
busybox sed -i '/tcp_ecn/d' $BUILD
busybox sed -i '/tcp_timestamps/d' $BUILD
busybox sed -i '/tcp_low_latency/d' $BUILD
busybox sed -i '/tcp_tw_reuse/d' $BUILD
busybox sed -i '/tcp_fack/d' $BUILD
busybox sed -i '/tcp_sack/d' $BUILD
busybox sed -i '/tcp_dsack/d' $BUILD
busybox sed -i '/tcp_rfc1337/d' $BUILD
busybox sed -i '/tcp_tw_recycle/d' $BUILD
busybox sed -i '/tcp_window_scaling/d' $BUILD
busybox sed -i '/tcp_moderate_rcvbuf/d' $BUILD
busybox sed -i '/tcp_no_metrics_save/d' $BUILD
busybox sed -i '/tcp_synack_retries/d' $BUILD
busybox sed -i '/tcp_syn_retries/d' $BUILD
busybox sed -i '/tcp_keepalive_probes/d' $BUILD
busybox sed -i '/tcp_keepalive_intvl/d' $BUILD
busybox sed -i '/tcp_fin_timeout/d' $BUILD
else
busybox sed -i '/default_secure_redirects/d' $BUILD
busybox sed -i '/default_accept_redirects/d' $BUILD
busybox sed -i '/default_accept_source_route/d' $BUILD
busybox sed -i '/all_secure_redirects/d' $BUILD
busybox sed -i '/all_accept_redirects/d' $BUILD
busybox sed -i '/all_accept_source_route/d' $BUILD
busybox sed -i '/ip_forward/d' $BUILD
busybox sed -i '/ip_dynaddr/d' $BUILD
busybox sed -i '/ip_no_pmtu_disc/d' $BUILD
busybox sed -i '/tcp_ecn/d' $BUILD
busybox sed -i '/tcp_timestamps/d' $BUILD
busybox sed -i '/tcp_low_latency/d' $BUILD
busybox sed -i '/tcp_tw_reuse/d' $BUILD
busybox sed -i '/tcp_fack/d' $BUILD
busybox sed -i '/tcp_sack/d' $BUILD
busybox sed -i '/tcp_dsack/d' $BUILD
busybox sed -i '/tcp_rfc1337/d' $BUILD
busybox sed -i '/tcp_tw_recycle/d' $BUILD
busybox sed -i '/tcp_window_scaling/d' $BUILD
busybox sed -i '/tcp_moderate_rcvbuf/d' $BUILD
busybox sed -i '/tcp_no_metrics_save/d' $BUILD
busybox sed -i '/tcp_synack_retries/d' $BUILD
busybox sed -i '/tcp_syn_retries/d' $BUILD
busybox sed -i '/tcp_keepalive_probes/d' $BUILD
busybox sed -i '/tcp_keepalive_intvl/d' $BUILD
busybox sed -i '/tcp_fin_timeout/d' $BUILD
busybox echo 'default_secure_redirects=0' >> $BUILD
busybox echo 'default_accept_redirects=0' >> $BUILD
busybox echo 'default_accept_source_route=0' >> $BUILD
busybox echo 'all_secure_redirects=0' >> $BUILD
busybox echo 'all_accept_redirects=0' >> $BUILD
busybox echo 'all_accept_source_route=0' >> $BUILD
busybox echo 'ip_forward=0' >> $BUILD
busybox echo 'ip_dynaddr=0' >> $BUILD
busybox echo 'ip_no_pmtu_disc=0' >> $BUILD
busybox echo 'tcp_ecn=2' >> $BUILD
busybox echo 'tcp_timestamps=1' >> $BUILD
busybox echo 'tcp_low_latency=0' >> $BUILD
busybox echo 'tcp_tw_reuse=1' >> $BUILD
busybox echo 'tcp_fack=1' >> $BUILD
busybox echo 'tcp_sack=1' >> $BUILD
busybox echo 'tcp_dsack=1' >> $BUILD
busybox echo 'tcp_rfc1337=1' >> $BUILD
busybox echo 'tcp_tw_recycle=1' >> $BUILD
busybox echo 'tcp_window_scaling=1' >> $BUILD
busybox echo 'tcp_moderate_rcvbuf=1' >> $BUILD
busybox echo 'tcp_no_metrics_save=1' >> $BUILD
busybox echo 'tcp_synack_retries=2' >> $BUILD
busybox echo 'tcp_syn_retries=2' >> $BUILD
busybox echo 'tcp_keepalive_probes=5' >> $BUILD
busybox echo 'tcp_keepalive_intvl=30' >> $BUILD
busybox echo 'tcp_fin_timeout=30' >> $BUILD
fi
}
screen_rotation ( )
{
if busybox grep -q windowsmgr.support_rotation_270=true $BUILD
then
busybox sed -i '/windowsmgr.support_rotation_270/d' $BUILD
else
busybox sed -i '/windowsmgr.support_rotation_270/d' $BUILD
busybox echo 'windowsmgr.support_rotation_270=true' >> $BUILD
fi
}
lock_screen_rotation ( )
{
if busybox grep -q log.tag.launcher_force_rotate=VERBOSE $BUILD && busybox
grep -q lockscreen.rot_override=true $BUILD
then
busybox sed -i '/log.tag.launcher_force_rotate/d' $BUILD
busybox sed -i '/lockscreen.rot_override/d' $BUILD
else
busybox sed -i '/log.tag.launcher_force_rotate/d' $BUILD
busybox sed -i '/lockscreen.rot_override/d' $BUILD
busybox echo 'log.tag.launcher_force_rotate=VERBOSE' >> $BUILD
busybox echo 'lockscreen.rot_override=true' >> $BUILD
fi
}
fps_unlocker ( )
{
if busybox grep -q debug.egl.swapinterval=-60 $BUILD && busybox grep -q
debug.gr.swapinterval=1 $BUILD
then
busybox sed -i '/debug.egl.swapinterval/d' $BUILD
busybox sed -i '/debug.gr.swapinterval/d' $BUILD
else
busybox sed -i '/debug.egl.swapinterval/d' $BUILD
busybox sed -i '/debug.gr.swapinterval/d' $BUILD
busybox echo 'debug.egl.swapinterval=-60' >> $BUILD
busybox echo 'debug.gr.swapinterval=1' >> $BUILD
fi
}
profiles_default ( )
{
for INITD in $INIT/KI*
do
busybox rm -f $INITD > /dev/null 2>&1;
done
busybox rm -f $BUILD > /dev/null 2>&1;
busybox cp -f $BACKUP'/KI00Build' $BUILD > /dev/null 2>&1;
busybox chmod 644 $BUILD > /dev/null 2>&1;
busybox chown 0:0 $BUILD > /dev/null 2>&1;
busybox rm -f $ETC/ad_calib.cfg > /dev/null 2>&1;
}
custom_dpi ( )
{
busybox clear
busybox echo -e $W'Please Use Good And Working Value'$N
busybox echo -e $R'Wrong Means Display Problems'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read DPI
if [ "$DPI" == "" ]
then
busybox clear
busybox echo -e $BL'No key entered'$N
busybox sleep 3
return 1
elif [ "$DPI" -le '110' ]
then
busybox echo -e $R'It Is Not A Good Value'$N
busybox sleep 3
busybox clear
return
fi
no=$(busybox echo -e $DDPI | tr -d '0-9')
yes=$(busybox echo -e $DPI | tr -d 'a-z' 'A-Z')
if [ "$no" ]; then
busybox clear
busybox echo -e $P'Numbers Only'$N
busybox sleep 3
return 1
elif [ "$yes" ]
then
busybox sed -i '/ro.sf.lcd_density/d' $BUILD
busybox echo -e 'ro.sf.lcd_density'=$DPI >> $BUILD
wm density $DPI
fi
}
google_dns ( )
{
if busybox grep -q net.dns1=8.8.8.8 $BUILD && busybox grep -q
net.dns2=8.8.4.4 $BUILD && busybox grep -q net.eth0.dns1=8.8.8.8 $BUILD && busybox
grep -q net.eth0.dns2=8.8.4.4 $BUILD && busybox grep -q net.rmnet0.dns1=8.8.8.8
$BUILD && busybox grep -q net.rmnet0.dns2=8.8.4.4 $BUILD && busybox grep -q
net.rmnet1.dns1=8.8.8.8 $BUILD && busybox grep -q net.rmnet1.dns2=8.8.4.4 $BUILD &&
busybox grep -q net.rmnet2.dns1=8.8.8.8 $BUILD && busybox grep -q
net.rmnet2.dns2=8.8.4.4 $BUILD && busybox grep -q net.wlan0.dns1=8.8.8.8 $BUILD &&
busybox grep -q net.wlan0.dns2=8.8.4.4 $BUILD && busybox grep -q
dhcp.eth0.dns1=8.8.8.8 $BUILD && busybox grep -q dhcp.eth0.dns2=8.8.4.4 $BUILD &&
busybox grep -q dhcp.wlan0.dns1=8.8.8.8 $BUILD && busybox grep -q
dhcp.wlan0.dns2=8.8.4.4 $BUILD
then
busybox sed -i '/net.dns1/d' $BUILD
busybox sed -i '/net.dns2/d' $BUILD
busybox sed -i '/net.eth0.dns1/d' $BUILD
busybox sed -i '/net.eth0.dns2/d' $BUILD
busybox sed -i '/net.rmnet0.dns1/d' $BUILD
busybox sed -i '/net.rmnet0.dns2/d' $BUILD
busybox sed -i '/net.rmnet1.dns1/d' $BUILD
busybox sed -i '/net.rmnet1.dns2/d' $BUILD
busybox sed -i '/net.rmnet2.dns1/d' $BUILD
busybox sed -i '/net.rmnet2.dns2/d' $BUILD
busybox sed -i '/net.wlan0.dns1/d' $BUILD
busybox sed -i '/net.wlan0.dns2/d' $BUILD
busybox sed -i '/dhcp.eth0.dns1/d' $BUILD
busybox sed -i '/dhcp.eth0.dns2/d' $BUILD
busybox sed -i '/dhcp.wlan0.dns1/d' $BUILD
busybox sed -i '/dhcp.wlan0.dns2/d' $BUILD
else
busybox sed -i '/net.dns1/d' $BUILD
busybox sed -i '/net.dns2/d' $BUILD
busybox sed -i '/net.eth0.dns1/d' $BUILD
busybox sed -i '/net.eth0.dns2/d' $BUILD
busybox sed -i '/net.rmnet0.dns1/d' $BUILD
busybox sed -i '/net.rmnet0.dns2/d' $BUILD
busybox sed -i '/net.rmnet1.dns1/d' $BUILD
busybox sed -i '/net.rmnet1.dns2/d' $BUILD
busybox sed -i '/net.rmnet2.dns1/d' $BUILD
busybox sed -i '/net.rmnet2.dns2/d' $BUILD
busybox sed -i '/net.wlan0.dns1/d' $BUILD
busybox sed -i '/net.wlan0.dns2/d' $BUILD
busybox sed -i '/dhcp.eth0.dns1/d' $BUILD
busybox sed -i '/dhcp.eth0.dns2/d' $BUILD
busybox sed -i '/dhcp.wlan0.dns1/d' $BUILD
busybox sed -i '/dhcp.wlan0.dns2/d' $BUILD
busybox echo 'net.dns1=8.8.8.8' >> $BUILD
busybox echo 'net.dns2=8.8.4.4' >> $BUILD
busybox echo 'net.eth0.dns1=8.8.8.8' >> $BUILD
busybox echo 'net.eth0.dns2=8.8.4.4' >> $BUILD
busybox echo 'net.rmnet0.dns1=8.8.8.8' >> $BUILD
busybox echo 'net.rmnet0.dns2=8.8.4.4' >> $BUILD
busybox echo 'net.rmnet1.dns1=8.8.8.8' >> $BUILD
busybox echo 'net.rmnet1.dns2=8.8.4.4' >> $BUILD
busybox echo 'net.rmnet2.dns1=8.8.8.8' >> $BUILD
busybox echo 'net.rmnet2.dns2=8.8.4.4' >> $BUILD
busybox echo 'net.wlan0.dns1=8.8.8.8' >> $BUILD
busybox echo 'net.wlan0.dns2=8.8.4.4' >> $BUILD
busybox echo 'dhcp.eth0.dns1=8.8.8.8' >> $BUILD
busybox echo 'dhcp.eth0.dns2=8.8.4.4' >> $BUILD
busybox echo 'dhcp.wlan0.dns1=8.8.8.8' >> $BUILD
busybox echo 'dhcp.wlan0.dns2=8.8.4.4' >> $BUILD
fi
}
ril_tweaks ( )
{
if busybox grep -q ro.ril.hsxpa=2 $BUILD && busybox grep -q ro.ril.hspa=2
$BUILD && busybox grep -q ro.ril.lte=2 $BUILD && busybox grep -q ro.ril.lte=2
$BUILD && busybox grep -q ro.ril.ltea=2 $BUILD && busybox grep -q ro.ril.hep=1
$BUILD && busybox grep -q ro.ril.enable.3g.prefix=1 $BUILD && busybox grep -q
ro.ril.enable.4g.prefix=1 $BUILD && busybox grep -q ro.ril.enable.dtm=1 $BUILD &&
busybox grep -q ro.ril.hspaclass=15 $BUILD && busybox grep -q ro.ril.lteclass=15
$BUILD && busybox grep -q ro.ril.gprsclass=15 $BUILD && busybox grep -q
ro.ril.hsupa.category=10 $BUILD && busybox grep -q ro.ril.hsdpa.category=30 $BUILD
&& busybox grep -q ro.ril.lte.category=10 $BUILD && busybox grep -q
ro.ril.ltea.category=30 $BUILD && busybox grep -q ro.ril.enable.a51=1 $BUILD &&
busybox grep -q ro.ril.enable.a52=1 $BUILD && busybox grep -q ro.ril.enable.a53=1
$BUILD && busybox grep -q ro.ril.enable.a54=1 $BUILD && busybox grep -q
ro.ril.enable.a55=1 $BUILD && busybox grep -q persist.cust.tel.eons=1 $BUILD
then
busybox sed -i '/ro.ril.hsxpa=2/d' $BUILD
busybox sed -i '/ro.ril.hspa=2/d' $BUILD
busybox sed -i '/ro.ril.lte=2/d' $BUILD
busybox sed -i '/ro.ril.lte=2/d' $BUILD
busybox sed -i '/ro.ril.ltea=2/d' $BUILD
busybox sed -i '/ro.ril.hep=1/d' $BUILD
busybox sed -i '/ro.ril.enable.3g.prefix=1/d' $BUILD
busybox sed -i '/ro.ril.enable.4g.prefix=1/d' $BUILD
busybox sed -i '/ro.ril.enable.dtm=1/d' $BUILD
busybox sed -i '/ro.ril.hspaclass=15/d' $BUILD
busybox sed -i '/ro.ril.lteclass=15/d' $BUILD
busybox sed -i '/ro.ril.gprsclass=15/d' $BUILD
busybox sed -i '/ro.ril.hsupa.category=10/d' $BUILD
busybox sed -i '/ro.ril.hsdpa.category=30/d' $BUILD
busybox sed -i '/ro.ril.lte.category=10/d' $BUILD
busybox sed -i '/ro.ril.ltea.category=30/d' $BUILD
busybox sed -i '/ro.ril.enable.a51=1/d' $BUILD
busybox sed -i '/ro.ril.enable.a52=1/d' $BUILD
busybox sed -i '/ro.ril.enable.a53=1/d' $BUILD
busybox sed -i '/ro.ril.enable.a54=1/d' $BUILD
busybox sed -i '/ro.ril.enable.a55=1/d' $BUILD
busybox sed -i '/persist.cust.tel.eons=1/d' $BUILD
else
busybox sed -i '/ro.ril.hsxpa=2/d' $BUILD
busybox sed -i '/ro.ril.hspa=2/d' $BUILD
busybox sed -i '/ro.ril.lte=2/d' $BUILD
busybox sed -i '/ro.ril.lte=2/d' $BUILD
busybox sed -i '/ro.ril.ltea=2/d' $BUILD
busybox sed -i '/ro.ril.hep=1/d' $BUILD
busybox sed -i '/ro.ril.enable.3g.prefix=1/d' $BUILD
busybox sed -i '/ro.ril.enable.4g.prefix=1/d' $BUILD
busybox sed -i '/ro.ril.enable.dtm=1/d' $BUILD
busybox sed -i '/ro.ril.hspaclass=15/d' $BUILD
busybox sed -i '/ro.ril.lteclass=15/d' $BUILD
busybox sed -i '/ro.ril.gprsclass=15/d' $BUILD
busybox sed -i '/ro.ril.hsupa.category=10/d' $BUILD
busybox sed -i '/ro.ril.hsdpa.category=30/d' $BUILD
busybox sed -i '/ro.ril.lte.category=10/d' $BUILD
busybox sed -i '/ro.ril.ltea.category=30/d' $BUILD
busybox sed -i '/ro.ril.enable.a51=1/d' $BUILD
busybox sed -i '/ro.ril.enable.a52=1/d' $BUILD
busybox sed -i '/ro.ril.enable.a53=1/d' $BUILD
busybox sed -i '/ro.ril.enable.a54=1/d' $BUILD
busybox sed -i '/ro.ril.enable.a55=1/d' $BUILD
busybox sed -i '/persist.cust.tel.eons=1/d' $BUILD
busybox echo 'ro.ril.hsxpa=2' >> $BUILD
busybox echo 'ro.ril.hspa=2' >> $BUILD
busybox echo 'ro.ril.lte=2' >> $BUILD
busybox echo 'ro.ril.lte=2' >> $BUILD
busybox echo 'ro.ril.ltea=2' >> $BUILD
busybox echo 'ro.ril.hep=1' >> $BUILD
busybox echo 'ro.ril.enable.3g.prefix=1' >> $BUILD
busybox echo 'ro.ril.enable.4g.prefix=1' >> $BUILD
busybox echo 'ro.ril.enable.dtm=1' >> $BUILD
busybox echo 'ro.ril.hspaclass=15' >> $BUILD
busybox echo 'ro.ril.lteclass=15' >> $BUILD
busybox echo 'ro.ril.gprsclass=15' >> $BUILD
busybox echo 'ro.ril.hsupa.category=10' >> $BUILD
busybox echo 'ro.ril.hsdpa.category=30' >> $BUILD
busybox echo 'ro.ril.lte.category=10' >> $BUILD
busybox echo 'ro.ril.ltea.category=30' >> $BUILD
busybox echo 'ro.ril.enable.a51=1' >> $BUILD
busybox echo 'ro.ril.enable.a52=1' >> $BUILD
busybox echo 'ro.ril.enable.a53=1' >> $BUILD
busybox echo 'ro.ril.enable.a54=1' >> $BUILD
busybox echo 'ro.ril.enable.a55=1' >> $BUILD
busybox echo 'persist.cust.tel.eons=1' >> $BUILD
fi
}
high_quality_graphics ( )
{
if busybox grep -q persist.sys.force_highendgfx=true $BUILD
then
busybox sed -i '/persist.sys.force_highendgfx/d' $BUILD
else
busybox sed -i '/persist.sys.force_highendgfx/d' $BUILD
busybox echo 'persist.sys.force_highendgfx=true' >> $BUILD
fi
}
fstrim_now ( )
{
busybox echo 'Applying Fstrim...'
busybox sleep 1
busybox echo ''
if [ -d /cache ]
then
busybox fstrim -v /cache
busybox sleep 0.5
fi
if [ -d /data ]
then
busybox fstrim -v /data
busybox sleep 0.5
fi
if [ -d /system ]
then
busybox fstrim -v /system
busybox sleep 0.5
fi
if [ -d /magisk ]
then
busybox fstrim -v /magisk
busybox sleep 0.5
fi
if [ -d /preload ]
then
busybox fstrim -v /preload
busybox sleep 0.5
fi
if [ -d /data/sdext2 ]
then
busybox fstrim -v /data/sdext2
busybox sleep 0.5
fi
busybox echo ''
busybox sleep 1
busybox echo 'Fstrim is done !!!'
}
volume_steps ( )
{
if busybox grep -q ro.config.media_vol_steps=30 $BUILD
then
busybox sed -i '/ro.config.media_vol_steps/d' $BUILD
else
busybox sed -i '/ro.config.media_vol_steps/d' $BUILD
busybox echo 'ro.config.media_vol_steps=30' >> $BUILD
fi
}
ipv4_support ( )
{
if busybox grep -q persist.telephony.support.ipv4=1 $BUILD
then
busybox sed -i '/persist.telephony.support.ipv4/d' $BUILD
else
busybox sed -i '/persist.telephony.support.ipv4/d' $BUILD
busybox echo 'persist.telephony.support.ipv4=1' >> $BUILD
fi
}
ipv6_support ( )
{
if busybox grep -q persist.telephony.support.ipv6=1 $BUILD
then
busybox sed -i '/persist.telephony.support.ipv6/d' $BUILD
else
busybox sed -i '/persist.telephony.support.ipv6/d' $BUILD
busybox echo 'persist.telephony.support.ipv6=1' >> $BUILD
fi
}
launcher_lock ( )
{
if busybox grep -q ro.HOME_APP_ADJ=1 $BUILD
then
busybox sed -i '/ro.HOME_APP_ADJ/d' $BUILD
else
busybox sed -i '/ro.HOME_APP_ADJ/d' $BUILD
busybox echo 'ro.HOME_APP_ADJ=1' >> $BUILD
fi
}
liquid_smooth_ui ( )
{
if busybox grep -q touch.pressure.scale=0.001 $BUILD
then
busybox sed -i '/touch.pressure.scale/d' $BUILD
else
busybox sed -i '/touch.pressure.scale/d' $BUILD
busybox echo 'touch.pressure.scale=0.001' >> $BUILD
fi
}
low_ram_flag ( )
{
if busybox grep -q ro.config.low_ram=true $BUILD
then
busybox sed -i '/ro.config.low_ram/d' $BUILD
else
busybox sed -i '/ro.config.low_ram/d' $BUILD
busybox echo 'ro.config.low_ram=true' >> $BUILD
fi
}
performance_tuner ( )
{
if busybox grep -q debug.performance.tuning=1 $BUILD && busybox grep -q
persist.sys.use_dithering=1 $BUILD && busybox grep -q persist.sys.use_16bpp_alpha=1
$BUILD && busybox grep -q persist.service.lgospd.enable=0 $BUILD && busybox grep -q
persist.service.pcsync.enable=0 $BUILD
then
busybox sed -i '/debug.performance.tuning/d' $BUILD
busybox sed -i '/persist.sys.use_dithering/d' $BUILD
busybox sed -i '/persist.sys.use_16bpp_alpha/d' $BUILD
busybox sed -i '/persist.service.lgospd.enable/d' $BUILD
busybox sed -i '/persist.service.pcsync.enable/d' $BUILD
else
busybox sed -i '/debug.performance.tuning/d' $BUILD
busybox sed -i '/persist.sys.use_dithering/d' $BUILD
busybox sed -i '/persist.sys.use_16bpp_alpha/d' $BUILD
busybox sed -i '/persist.service.lgospd.enable/d' $BUILD
busybox sed -i '/persist.service.pcsync.enable/d' $BUILD
busybox echo 'debug.performance.tuning=1' >> $BUILD
busybox echo 'persist.sys.use_dithering=1' >> $BUILD
busybox echo 'persist.sys.use_16bpp_alpha=1' >> $BUILD
busybox echo 'persist.service.lgospd.enable=0' >> $BUILD
busybox echo 'persist.service.pcsync.enable=0' >> $BUILD
fi
}
reduce_in_call ( )
{
if busybox grep -q ro.telephony.call_ring.delay=0 $BUILD
then
busybox sed -i '/ro.telephony.call_ring.delay/d' $BUILD
else
busybox sed -i '/ro.telephony.call_ring.delay/d' $BUILD
busybox echo 'ro.telephony.call_ring.delay=0' >> $BUILD
fi
}
small_net_buffers ( )
{
if busybox grep -q
net.tcp.buffersize.default=4096,87380,110208,4096,16384,110208 $BUILD && busybox
grep -q net.tcp.buffersize.edge=4093,26280,35040,4096,16384,35040 $BUILD && busybox
grep -q net.tcp.buffersize.ethernet=524288,1048576,3145728,524288,1048576,2097152
$BUILD && busybox grep -q
net.tcp.buffersize.evdo=4094,87380,262144,4096,16384,262144 $BUILD && busybox grep
-q net.tcp.buffersize.gprs=4092,8760,11680,4096,8760,11680 $BUILD && busybox grep
-q net.tcp.buffersize.hsdpa=4094,87380,262144,4096,16384,262144 $BUILD && busybox
grep -q net.tcp.buffersize.hspa=4094,87380,262144,4096,16384,262144 $BUILD &&
busybox grep -q net.tcp.buffersize.hspap=4094,87380,1220608,4096,16384,1220608
$BUILD && busybox grep -q
net.tcp.buffersize.hsupa=4094,87380,262144,4096,16384,262144 $BUILD && busybox grep
-q net.tcp.buffersize.lte=524288,1048576,2097152,262144,524288,1048576 $BUILD &&
busybox grep -q net.tcp.buffersize.umts=4094,87380,110208,4096,16384,110208 $BUILD
&& busybox grep -q
net.tcp.buffersize.wifi=524288,1048576,2097152,262144,524288,1048576 $BUILD
then
busybox sed -i '/net.tcp.buffersize.default/d' $BUILD
busybox sed -i '/net.tcp.buffersize.edge/d' $BUILD
busybox sed -i '/net.tcp.buffersize.ethernet/d' $BUILD
busybox sed -i '/net.tcp.buffersize.evdo/d' $BUILD
busybox sed -i '/net.tcp.buffersize.gprs/d' $BUILD
busybox sed -i '/net.tcp.buffersize.hsdpa/d' $BUILD
busybox sed -i '/net.tcp.buffersize.hspa/d' $BUILD
busybox sed -i '/net.tcp.buffersize.hspap/d' $BUILD
busybox sed -i '/net.tcp.buffersize.hsupa/d' $BUILD
busybox sed -i '/net.tcp.buffersize.lte/d' $BUILD
busybox sed -i '/net.tcp.buffersize.umts/d' $BUILD
busybox sed -i '/net.tcp.buffersize.wifi/d' $BUILD
else
busybox sed -i '/net.tcp.buffersize.default/d' $BUILD
busybox sed -i '/net.tcp.buffersize.edge/d' $BUILD
busybox sed -i '/net.tcp.buffersize.ethernet/d' $BUILD
busybox sed -i '/net.tcp.buffersize.evdo/d' $BUILD
busybox sed -i '/net.tcp.buffersize.gprs/d' $BUILD
busybox sed -i '/net.tcp.buffersize.hsdpa/d' $BUILD
busybox sed -i '/net.tcp.buffersize.hspa/d' $BUILD
busybox sed -i '/net.tcp.buffersize.hspap/d' $BUILD
busybox sed -i '/net.tcp.buffersize.hsupa/d' $BUILD
busybox sed -i '/net.tcp.buffersize.lte/d' $BUILD
busybox sed -i '/net.tcp.buffersize.umts/d' $BUILD
busybox sed -i '/net.tcp.buffersize.wifi/d' $BUILD
busybox echo
'net.tcp.buffersize.default=4096,87380,110208,4096,16384,110208' >> $BUILD
busybox echo
'net.tcp.buffersize.edge=4093,26280,35040,4096,16384,35040' >> $BUILD
busybox echo
'net.tcp.buffersize.ethernet=524288,1048576,3145728,524288,1048576,2097152' >>
$BUILD
busybox echo
'net.tcp.buffersize.evdo=4094,87380,262144,4096,16384,262144' >> $BUILD
busybox echo 'net.tcp.buffersize.gprs=4092,8760,11680,4096,8760,11680'
>> $BUILD
busybox echo
'net.tcp.buffersize.hsdpa=4094,87380,262144,4096,16384,262144' >> $BUILD
busybox echo
'net.tcp.buffersize.hspa=4094,87380,262144,4096,16384,262144' >> $BUILD
busybox echo
'net.tcp.buffersize.hspap=4094,87380,1220608,4096,16384,1220608' >> $BUILD
busybox echo
'net.tcp.buffersize.hsupa=4094,87380,262144,4096,16384,262144' >> $BUILD
busybox echo
'net.tcp.buffersize.lte=524288,1048576,2097152,262144,524288,1048576' >> $BUILD
busybox echo
'net.tcp.buffersize.umts=4094,87380,110208,4096,16384,110208' >> $BUILD
busybox echo
'net.tcp.buffersize.wifi=524288,1048576,2097152,262144,524288,1048576' >> $BUILD
fi
}
clean_master ( )
{
busybox rm -f /cache/*.apk > /dev/null 2>&1;
busybox rm -f /cache/*.tmp > /dev/null 2>&1;
busybox rm -f /cache/*.log > /dev/null 2>&1;
busybox rm -f /cache/*.txt > /dev/null 2>&1;
busybox rm -f /cache/recovery/* > /dev/null 2>&1;
busybox rm -f /data/*.log > /dev/null 2>&1;
busybox rm -f /data/*.txt > /dev/null 2>&1;
busybox rm -f /data/anr/*.log > /dev/null 2>&1;
busybox rm -f /data/anr/*.txt > /dev/null 2>&1;
busybox rm -f /data/backup/pending/*.tmp > /dev/null 2>&1;
busybox rm -f /data/cache/*.* > /dev/null 2>&1;
busybox rm -f /data/dalvik-cache/*.apk > /dev/null 2>&1;
busybox rm -f /data/dalvik-cache/*.tmp > /dev/null 2>&1;
busybox rm -f /data/dalvik-cache/*.log > /dev/null 2>&1;
busybox rm -f /data/dalvik-cache/*.txt > /dev/null 2>&1;
busybox rm -f /data/data/*.log > /dev/null 2>&1;
busybox rm -f /data/data/*.txt > /dev/null 2>&1;
busybox rm -f /data/log/*.log > /dev/null 2>&1;
busybox rm -f /data/log/*.txt > /dev/null 2>&1;
busybox rm -f /data/local/*.apk > /dev/null 2>&1;
busybox rm -f /data/local/*.log > /dev/null 2>&1;
busybox rm -f /data/local/*.txt > /dev/null 2>&1;
busybox rm -f /data/local/tmp/*.log > /dev/null 2>&1;
busybox rm -f /data/local/tmp/*.txt > /dev/null 2>&1;
busybox rm -f /data/last_alog/*.log > /dev/null 2>&1;
busybox rm -f /data/last_alog/*.txt > /dev/null 2>&1;
busybox rm -f /data/last_kmsg/*.log > /dev/null 2>&1;
busybox rm -f /data/last_kmsg/*.txt > /dev/null 2>&1;
busybox rm -f /data/mlog/* > /dev/null 2>&1;
busybox rm -f /data/tombstones/*.log > /dev/null 2>&1;
busybox rm -f /data/tombstones/*.txt > /dev/null 2>&1;
busybox rm -f /data/system/*.log > /dev/null 2>&1;
busybox rm -f /data/system/*.txt > /dev/null 2>&1;
busybox rm -f /data/system/dropbox/*.log > /dev/null 2>&1;
busybox rm -f /data/system/dropbox/*.txt > /dev/null 2>&1;
busybox rm -f /data/system/usagestats/*.log > /dev/null 2>&1;
busybox rm -f /data/system/usagestats/*.txt > /dev/null 2>&1;
}
art_interpret_only ( )
{
if ! busybox grep -q dalvik.vm.image-dex2oat-filter=interpret-only $BUILD
then
busybox sed -i '/dalvik.vm.image-dex2oat-filter/d' $BUILD
busybox echo 'dalvik.vm.image-dex2oat-filter=interpret-only' >> $BUILD
busybox rm -rf /data/dalvik-cache/* > /dev/null 2>&1;
busybox rm -rf /cache/* > /dev/null 2>&1;
fi
}
art_speed ( )
{
if ! busybox grep -q dalvik.vm.image-dex2oat-filter=speed $BUILD
then
busybox sed -i '/dalvik.vm.image-dex2oat-filter/d' $BUILD
busybox echo 'dalvik.vm.image-dex2oat-filter=speed' >> $BUILD
busybox rm -rf /data/dalvik-cache/* > /dev/null 2>&1;
busybox rm -rf /cache/* > /dev/null 2>&1;
fi
}
art_balanced ( )
{
if ! busybox grep -q dalvik.vm.image-dex2oat-filter=balanced $BUILD
then
busybox sed -i '/dalvik.vm.image-dex2oat-filter/d' $BUILD
busybox echo 'dalvik.vm.image-dex2oat-filter=balanced' >> $BUILD
busybox rm -rf /data/dalvik-cache/* > /dev/null 2>&1;
busybox rm -rf /cache/* > /dev/null 2>&1;
fi
}
art_space ( )
{
if ! busybox grep -q dalvik.vm.image-dex2oat-filter=space $BUILD
then
busybox sed -i '/dalvik.vm.image-dex2oat-filter/d' $BUILD
busybox echo 'dalvik.vm.image-dex2oat-filter=space' >> $BUILD
busybox rm -rf /data/dalvik-cache/* > /dev/null 2>&1;
busybox rm -rf /cache/* > /dev/null 2>&1;
fi
}
art_everything ( )
{
if ! busybox grep -q dalvik.vm.image-dex2oat-filter=everything $BUILD
then
busybox sed -i '/dalvik.vm.image-dex2oat-filter/d' $BUILD
busybox echo 'dalvik.vm.image-dex2oat-filter=everything' >> $BUILD
busybox rm -rf /data/dalvik-cache/* > /dev/null 2>&1;
busybox rm -rf /cache/* > /dev/null 2>&1;
fi
}
art_verify_none ( )
{
if ! busybox grep -q dalvik.vm.image-dex2oat-filter=verify-none $BUILD
then
busybox sed -i '/dalvik.vm.image-dex2oat-filter/d' $BUILD
busybox echo 'dalvik.vm.image-dex2oat-filter=verify-none' >> $BUILD
busybox rm -rf /data/dalvik-cache/* > /dev/null 2>&1;
busybox rm -rf /cache/* > /dev/null 2>&1;
fi
}
art_default ( )
{
if busybox grep -q dalvik.vm.image-dex2oat-filter $BUILD
then
busybox sed -i '/dalvik.vm.image-dex2oat-filter/d' $BUILD
busybox rm -rf /data/dalvik-cache/* > /dev/null 2>&1;
busybox rm -rf /cache/* > /dev/null 2>&1;
fi
}
mic_fix ( )
{
if busybox grep -q ro.qc.sdk.audio.fluencetype=none $BUILD && busybox grep -q
persist.audio.fluence.voicerec=true $BUILD && busybox grep -q
persist.audio.fluence.speaker=false $BUILD && busybox grep -q
use.voice.path.for.pcm.voip=true $BUILD
then
busybox sed -i '/ro.qc.sdk.audio.fluencetype/d' $BUILD
busybox sed -i '/persist.audio.fluence.voicerec/d' $BUILD
busybox sed -i '/persist.audio.fluence.speaker/d' $BUILD
busybox sed -i '/use.voice.path.for.pcm.voip/d' $BUILD
else
busybox sed -i '/ro.qc.sdk.audio.fluencetype/d' $BUILD
busybox sed -i '/persist.audio.fluence.voicerec/d' $BUILD
busybox sed -i '/persist.audio.fluence.speaker/d' $BUILD
busybox sed -i '/use.voice.path.for.pcm.voip/d' $BUILD
busybox echo 'ro.qc.sdk.audio.fluencetype=none' >> $BUILD
busybox echo 'persist.audio.fluence.voicerec=true' >> $BUILD
busybox echo 'persist.audio.fluence.speaker=false' >> $BUILD
busybox echo 'use.voice.path.for.pcm.voip=true' >> $BUILD
fi
}
big_net_buffers ( )
{
if busybox grep -q
net.tcp.buffersize.default=6144,87380,110208,6144,16384,110208 $BUILD && busybox
grep -q net.tcp.buffersize.edge=6144,26280,35040,6144,16384,35040 $BUILD && busybox
grep -q net.tcp.buffersize.ethernet=524288,1048576,3145728,524288,1048576,2097152
$BUILD && busybox grep -q
net.tcp.buffersize.evdo=6144,87380,262144,6144,16384,262144 $BUILD && busybox grep
-q net.tcp.buffersize.gprs=6144,8760,11680,6144,8760,11680 $BUILD && busybox grep
-q net.tcp.buffersize.hsdpa=6144,87380,262144,6144,16384,262144 $BUILD && busybox
grep -q net.tcp.buffersize.hspa=6144,87380,262144,6144,16384,262144 $BUILD &&
busybox grep -q net.tcp.buffersize.hspap=6144,87380,1220608,6144,16384,1220608
$BUILD && busybox grep -q
net.tcp.buffersize.hsupa=6144,87380,262144,6144,16384,262144 $BUILD && busybox grep
-q net.tcp.buffersize.lte=524288,1048576,2097152,262144,524288,1048576 $BUILD &&
busybox grep -q net.tcp.buffersize.umts=6144,87380,110208,6144,16384,110208 $BUILD
&& busybox grep -q
net.tcp.buffersize.wifi=524288,1048576,2097152,262144,524288,1048576 $BUILD
then
busybox sed -i '/net.tcp.buffersize.default/d' $BUILD
busybox sed -i '/net.tcp.buffersize.edge/d' $BUILD
busybox sed -i '/net.tcp.buffersize.ethernet/d' $BUILD
busybox sed -i '/net.tcp.buffersize.evdo/d' $BUILD
busybox sed -i '/net.tcp.buffersize.gprs/d' $BUILD
busybox sed -i '/net.tcp.buffersize.hsdpa/d' $BUILD
busybox sed -i '/net.tcp.buffersize.hspa/d' $BUILD
busybox sed -i '/net.tcp.buffersize.hspap/d' $BUILD
busybox sed -i '/net.tcp.buffersize.hsupa/d' $BUILD
busybox sed -i '/net.tcp.buffersize.lte/d' $BUILD
busybox sed -i '/net.tcp.buffersize.umts/d' $BUILD
busybox sed -i '/net.tcp.buffersize.wifi/d' $BUILD
else
busybox sed -i '/net.tcp.buffersize.default/d' $BUILD
busybox sed -i '/net.tcp.buffersize.edge/d' $BUILD
busybox sed -i '/net.tcp.buffersize.ethernet/d' $BUILD
busybox sed -i '/net.tcp.buffersize.evdo/d' $BUILD
busybox sed -i '/net.tcp.buffersize.gprs/d' $BUILD
busybox sed -i '/net.tcp.buffersize.hsdpa/d' $BUILD
busybox sed -i '/net.tcp.buffersize.hspa/d' $BUILD
busybox sed -i '/net.tcp.buffersize.hspap/d' $BUILD
busybox sed -i '/net.tcp.buffersize.hsupa/d' $BUILD
busybox sed -i '/net.tcp.buffersize.lte/d' $BUILD
busybox sed -i '/net.tcp.buffersize.umts/d' $BUILD
busybox sed -i '/net.tcp.buffersize.wifi/d' $BUILD
busybox echo
'net.tcp.buffersize.default=6144,87380,110208,6144,16384,110208' >> $BUILD
busybox echo
'net.tcp.buffersize.edge=6144,26280,35040,6144,16384,35040' >> $BUILD
busybox echo
'net.tcp.buffersize.ethernet=524288,1048576,3145728,524288,1048576,2097152' >>
$BUILD
busybox echo
'net.tcp.buffersize.evdo=6144,87380,262144,6144,16384,262144' >> $BUILD
busybox echo 'net.tcp.buffersize.gprs=6144,8760,11680,6144,8760,11680'
>> $BUILD
busybox echo
'net.tcp.buffersize.hsdpa=6144,87380,262144,6144,16384,262144' >> $BUILD
busybox echo
'net.tcp.buffersize.hspa=6144,87380,262144,6144,16384,262144' >> $BUILD
busybox echo
'net.tcp.buffersize.hspap=6144,87380,1220608,6144,16384,1220608' >> $BUILD
busybox echo
'net.tcp.buffersize.hsupa=6144,87380,262144,6144,16384,262144' >> $BUILD
busybox echo
'net.tcp.buffersize.lte=524288,1048576,2097152,262144,524288,1048576' >> $BUILD
busybox echo
'net.tcp.buffersize.umts=6144,87380,110208,6144,16384,110208' >> $BUILD
busybox echo
'net.tcp.buffersize.wifi=524288,1048576,2097152,262144,524288,1048576' >> $BUILD
fi
}
heap_opt ( )
{
if busybox grep -q dalvik.vm.heaptargetutilization=0.75 $BUILD && busybox
grep -q dalvik.vm.heapsize=272m $BUILD && busybox grep -q
dalvik.vm.heapgrowthlimit=68m $BUILD
then
busybox sed -i '/dalvik.vm.heaptargetutilization/d' $BUILD
busybox sed -i '/dalvik.vm.heapsize/d' $BUILD
busybox sed -i '/dalvik.vm.heapgrowthlimit/d' $BUILD
else
busybox sed -i '/dalvik.vm.heaptargetutilization/d' $BUILD
busybox sed -i '/dalvik.vm.heapsize/d' $BUILD
busybox sed -i '/dalvik.vm.heapgrowthlimit/d' $BUILD
busybox echo 'dalvik.vm.heaptargetutilization=0.75' >> $BUILD
busybox echo 'dalvik.vm.heapsize=272m' >> $BUILD
busybox echo 'dalvik.vm.heapgrowthlimit=68m' >> $BUILD
fi
}
runtime ( )
{
if busybox grep -q dalvik.vm.check-dex-sum=false $BUILD && busybox grep -q
dalvik.vm.checkjni=false $BUILD && busybox grep -q dalvik.vm.execution-mode=int:jit
$BUILD && busybox grep -q dalvik.vm.dexopt-data-only=1 $BUILD && busybox grep -q
dalvik.vm.verify-bytecode=false $BUILD && busybox grep -q dalvik.vm.dexopt-
flags=m=y $BUILD
then
busybox sed -i '/dalvik.vm.check-dex-sum/d' $BUILD
busybox sed -i '/dalvik.vm.checkjni/d' $BUILD
busybox sed -i '/dalvik.vm.execution-mode/d' $BUILD
busybox sed -i '/dalvik.vm.dexopt-data-only/d' $BUILD
busybox sed -i '/dalvik.vm.verify-bytecode/d' $BUILD
busybox sed -i '/dalvik.vm.dexopt-flags/d' $BUILD
else
busybox sed -i '/dalvik.vm.check-dex-sum/d' $BUILD
busybox sed -i '/dalvik.vm.checkjni/d' $BUILD
busybox sed -i '/dalvik.vm.execution-mode/d' $BUILD
busybox sed -i '/dalvik.vm.dexopt-data-only/d' $BUILD
busybox sed -i '/dalvik.vm.verify-bytecode/d' $BUILD
busybox sed -i '/dalvik.vm.dexopt-flags/d' $BUILD
busybox echo 'dalvik.vm.check-dex-sum=false' >> $BUILD
busybox echo 'dalvik.vm.checkjni=false' >> $BUILD
busybox echo 'dalvik.vm.execution-mode=int:jit' >> $BUILD
busybox echo 'dalvik.vm.dexopt-data-only=1' >> $BUILD
busybox echo 'dalvik.vm.verify-bytecode=false' >> $BUILD
busybox echo 'dalvik.vm.dexopt-flags=m=y' >> $BUILD
fi
}
disable_location_service ( )
{
pm disable
com.google.android.gms/com.google.android.location.fused.FusedLocationService >
/dev/null 2>&1;
pm disable
com.google.android.gms/com.google.android.location.internal.server.GoogleLocationSe
rvice > /dev/null 2>&1;
pm disable
com.google.android.gms/com.google.android.location.geocode.GeocodeService >
/dev/null 2>&1;
pm disable
com.google.android.gms/com.google.android.location.network.NetworkLocationService >
/dev/null 2>&1;
pm disable
com.google.android.gms/com.google.android.location.internal.GoogleLocationManagerSe
rvice > /dev/null 2>&1;
pm disable
com.google.android.gms/com.google.android.location.geofencer.service.GeofenceProvid
erService > /dev/null 2>&1;
pm disable
com.google.android.gms/com.google.android.location.fused.service.FusedProviderServi
ce > /dev/null 2>&1;
pm disable
com.google.android.gms/com.google.android.location.reporting.service.DispatchingSer
vice > /dev/null 2>&1;
pm disable
com.google.android.gms/com.google.location.nearby.direct.service.NearbyDirectServic
e > /dev/null 2>&1;
}
disable_mobile_cloud_service ( )
{
pm disable com.google.android.gms/.common.stats.GmsCoreStatsService >
/dev/null 2>&1;
pm disable com.google.android.gms/.gcm.GcmService > /dev/null 2>&1;
pm disable com.google.android.gms/.chimera.GmsIntentOperationService >
/dev/null 2>&1;
}
enable_location_service ( )
{
pm enable
com.google.android.gms/com.google.android.location.fused.FusedLocationService >
/dev/null 2>&1;
pm enable
com.google.android.gms/com.google.android.location.internal.server.GoogleLocationSe
rvice > /dev/null 2>&1;
pm enable
com.google.android.gms/com.google.android.location.geocode.GeocodeService >
/dev/null 2>&1;
pm enable
com.google.android.gms/com.google.android.location.network.NetworkLocationService >
/dev/null 2>&1;
pm enable
com.google.android.gms/com.google.android.location.internal.GoogleLocationManagerSe
rvice > /dev/null 2>&1;
pm enable
com.google.android.gms/com.google.android.location.geofencer.service.GeofenceProvid
erService > /dev/null 2>&1;
pm enable
com.google.android.gms/com.google.android.location.fused.service.FusedProviderServi
ce > /dev/null 2>&1;
pm enable
com.google.android.gms/com.google.android.location.reporting.service.DispatchingSer
vice > /dev/null 2>&1;
pm enable
com.google.android.gms/com.google.location.nearby.direct.service.NearbyDirectServic
e > /dev/null 2>&1;
}
enable_mobile_cloud_service ( )
{
pm enable com.google.android.gms/.common.stats.GmsCoreStatsService >
/dev/null 2>&1;
pm enable com.google.android.gms/.gcm.GcmService > /dev/null 2>&1;
pm enable com.google.android.gms/.chimera.GmsIntentOperationService >
/dev/null 2>&1;
}
media_server_kill ( )
{
if [ "$(pgrep media)" ] && [ "$(pgrep mediaserver)" ]
then
busybox killall -9 android.process.media 2 > /dev/null 2>&1;
busybox killall -9 mediaserver 2 > /dev/null 2>&1;
fi
}
media_scanner_kill ( )
{
pm disable
com.android.providers.media/com.android.providers.media.MediaScannerReceiver >
/dev/null 2>&1;
}
media_scanner_on ( )
{
pm enable
com.android.providers.media/com.android.providers.media.MediaScannerReceiver >
/dev/null 2>&1;
}
ram_manager_multitasking ( )
{
if busybox grep -q ro.sys.fw.bg_apps_limit=26 $BUILD && busybox grep -q
ro.config.fha_enable=true $BUILD
then
busybox sed -i '/ro.config.fha_enable/d' $BUILD
busybox sed -i '/ro.sys.fw.bg_apps_limit/d' $BUILD
else
busybox sed -i '/ro.config.fha_enable/d' $BUILD
busybox sed -i '/ro.sys.fw.bg_apps_limit/d' $BUILD
busybox echo 'ro.config.fha_enable=true' >> $BUILD
busybox echo 'ro.sys.fw.bg_apps_limit=26' >> $BUILD
fi
}
ram_manager_balance ( )
{
if busybox grep -q ro.sys.fw.bg_apps_limit=18 $BUILD && busybox grep -q
ro.config.fha_enable=true $BUILD
then
busybox sed -i '/ro.config.fha_enable/d' $BUILD
busybox sed -i '/ro.sys.fw.bg_apps_limit/d' $BUILD
else
busybox sed -i '/ro.config.fha_enable/d' $BUILD
busybox sed -i '/ro.sys.fw.bg_apps_limit/d' $BUILD
busybox echo 'ro.config.fha_enable=true' >> $BUILD
busybox echo 'ro.sys.fw.bg_apps_limit=18' >> $BUILD
fi
}
ram_manager_gaming ( )
{
if busybox grep -q ro.sys.fw.bg_apps_limit=12 $BUILD && busybox grep -q
ro.config.fha_enable=true $BUILD
then
busybox sed -i '/ro.config.fha_enable/d' $BUILD
busybox sed -i '/ro.sys.fw.bg_apps_limit/d' $BUILD
else
busybox sed -i '/ro.config.fha_enable/d' $BUILD
busybox sed -i '/ro.sys.fw.bg_apps_limit/d' $BUILD
busybox echo 'ro.config.fha_enable=true' >> $BUILD
busybox echo 'ro.sys.fw.bg_apps_limit=12' >> $BUILD
fi
}
stop_logging ( )
{
if busybox grep -q ro.config.nocheckin=1 $BUILD && busybox grep -q
profiler.force_disable_err_rpt=1 $BUILD && busybox grep -q
profiler.force_disable_ulog=1 $BUILD && busybox grep -q logcat.live=disabled $BUILD
&& busybox grep -q debugtool.anrhistory=0 $BUILD && busybox grep -q
profiler.debugmonitor=false $BUILD && busybox grep -q profiler.launch=false $BUILD
&& busybox grep -q profiler.hung.dumpdobugreport=false $BUILD && busybox grep -q
persist.android.strictmode=0 $BUILD
then
busybox sed -i '/ro.config.nocheckin=1/d' $BUILD
busybox sed -i '/profiler.force_disable_err_rpt=1/d' $BUILD
busybox sed -i '/profiler.force_disable_ulog=1/d' $BUILD
busybox sed -i '/logcat.live=disabled/d' $BUILD
busybox sed -i '/debugtool.anrhistory=0/d' $BUILD
busybox sed -i '/profiler.debugmonitor=false/d' $BUILD
busybox sed -i '/profiler.launch=false/d' $BUILD
busybox sed -i '/profiler.hung.dumpdobugreport=false/d' $BUILD
busybox sed -i '/persist.android.strictmode=0/d' $BUILD
else
busybox sed -i '/ro.config.nocheckin=1/d' $BUILD
busybox sed -i '/profiler.force_disable_err_rpt=1/d' $BUILD
busybox sed -i '/profiler.force_disable_ulog=1/d' $BUILD
busybox sed -i '/logcat.live=disabled/d' $BUILD
busybox sed -i '/debugtool.anrhistory=0/d' $BUILD
busybox sed -i '/profiler.debugmonitor=false/d' $BUILD
busybox sed -i '/profiler.launch=false/d' $BUILD
busybox sed -i '/profiler.hung.dumpdobugreport=false/d' $BUILD
busybox sed -i '/persist.android.strictmode=0/d' $BUILD
busybox echo 'ro.config.nocheckin=1' >> $BUILD
busybox echo 'profiler.force_disable_err_rpt=1' >> $BUILD
busybox echo 'profiler.force_disable_ulog=1' >> $BUILD
busybox echo 'logcat.live=disabled' >> $BUILD
busybox echo 'debugtool.anrhistory=0' >> $BUILD
busybox echo 'profiler.debugmonitor=false' >> $BUILD
busybox echo 'profiler.launch=false' >> $BUILD
busybox echo 'profiler.hung.dumpdobugreport=false' >> $BUILD
busybox echo 'persist.android.strictmode=0' >> $BUILD
fi
}
disable_usb_charging ( )
{
if busybox grep -q persist.sys.charging.disable=1 $BUILD
then
busybox sed -i '/persist.sys.charging.disable/d' $BUILD
else
busybox sed -i '/persist.sys.charging.disable/d' $BUILD
busybox echo 'persist.sys.charging.disable=1' >> $BUILD
fi
}
wakeup_key ( )
{
if busybox grep -q ro.config.hwfeature_wakeupkey=1 $BUILD
then
busybox sed -i '/ro.config.hwfeature_wakeupkey/d' $BUILD
else
busybox sed -i '/ro.config.hwfeature_wakeupkey/d' $BUILD
busybox echo 'ro.config.hwfeature_wakeupkey=1' >> $BUILD
fi
}
buttonlight_timeout ( )
{
if busybox grep -q ro.mot.buttonlight.timeout=1 $BUILD
then
busybox sed -i '/ro.mot.buttonlight.timeout/d' $BUILD
else
busybox sed -i '/ro.mot.buttonlight.timeout/d' $BUILD
busybox echo 'ro.mot.buttonlight.timeout=1' >> $BUILD
fi
}
purge_ram ( )
{
if busybox grep -q persist.sys.purgeable_assets=1 $BUILD
then
busybox sed -i '/persist.sys.purgeable_assets/d' $BUILD
else
busybox sed -i '/persist.sys.purgeable_assets/d' $BUILD
busybox echo 'persist.sys.purgeable_assets=1' >> $BUILD
fi
}
kernel_error_fix ( )
{
if busybox grep -q ro.kernel.android.checkjni=0 $BUILD && busybox grep -q
ro.kernel.checkjni=0 $BUILD
then
busybox sed -i '/ro.kernel.android.checkjni/d' $BUILD
busybox sed -i '/ro.kernel.checkjni/d' $BUILD
else
busybox sed -i '/ro.kernel.android.checkjni/d' $BUILD
busybox sed -i '/ro.kernel.checkjni/d' $BUILD
busybox echo 'ro.kernel.android.checkjni=0' >> $BUILD
busybox echo 'ro.kernel.checkjni=0' >> $BUILD
fi
}
flag_tuner ( )
{
if busybox grep -q ACTIVITY_INACTIVE_RESET_TIME=false $BUILD && busybox grep
-q CPU_MIN_CHECK_DURATION=false $BUILD && busybox grep -q
ENFORCE_PROCESS_LIMIT=false $BUILD && busybox grep -q GC_TIMEOUT=false $BUILD &&
busybox grep -q MIN_CRASH_INTERVAL=false $BUILD && busybox grep -q
MIN_HIDDEN_APPS=false $BUILD && busybox grep -q MIN_RECENT_TASKS=false $BUILD &&
busybox grep -q PROC_START_TIMEOUT=false $BUILD && busybox grep -q
SERVICE_TIMEOUT=false $BUILD
then
busybox sed -i '/ACTIVITY_INACTIVE_RESET_TIME=false/d' $BUILD
busybox sed -i '/CPU_MIN_CHECK_DURATION=false/d' $BUILD
busybox sed -i '/ENFORCE_PROCESS_LIMIT=false/d' $BUILD
busybox sed -i '/GC_TIMEOUT=false/d' $BUILD
busybox sed -i '/MIN_CRASH_INTERVAL=false/d' $BUILD
busybox sed -i '/MIN_HIDDEN_APPS=false/d' $BUILD
busybox sed -i '/MIN_RECENT_TASKS=false/d' $BUILD
busybox sed -i '/PROC_START_TIMEOUT=false/d' $BUILD
busybox sed -i '/SERVICE_TIMEOUT=false/d' $BUILD
else
busybox sed -i '/ACTIVITY_INACTIVE_RESET_TIME=false/d' $BUILD
busybox sed -i '/CPU_MIN_CHECK_DURATION=false/d' $BUILD
busybox sed -i '/ENFORCE_PROCESS_LIMIT=false/d' $BUILD
busybox sed -i '/GC_TIMEOUT=false/d' $BUILD
busybox sed -i '/MIN_CRASH_INTERVAL=false/d' $BUILD
busybox sed -i '/MIN_HIDDEN_APPS=false/d' $BUILD
busybox sed -i '/MIN_RECENT_TASKS=false/d' $BUILD
busybox sed -i '/PROC_START_TIMEOUT=false/d' $BUILD
busybox sed -i '/SERVICE_TIMEOUT=false/d' $BUILD
busybox echo 'ACTIVITY_INACTIVE_RESET_TIME=false' >> $BUILD
busybox echo 'CPU_MIN_CHECK_DURATION=false' >> $BUILD
busybox echo 'ENFORCE_PROCESS_LIMIT=false' >> $BUILD
busybox echo 'GC_TIMEOUT=false' >> $BUILD
busybox echo 'MIN_CRASH_INTERVAL=false' >> $BUILD
busybox echo 'MIN_HIDDEN_APPS=false' >> $BUILD
busybox echo 'MIN_RECENT_TASKS=false' >> $BUILD
busybox echo 'PROC_START_TIMEOUT=false' >> $BUILD
busybox echo 'SERVICE_TIMEOUT=false' >> $BUILD
fi
}

boost ( )
{
busybox free | busybox awk '/Mem/{print ">>>...Memory Before Boosting:
"$4/1024" MB";}'
busybox sleep 1
busybox echo ''
busybox echo 'Dropping cache'
sync
busybox echo '3' > /proc/sys/vm/drop_caches
dc=/proc/sys/vm/drop_caches
dc_v=$(busybox cat $dc)
if [ "$dc_v" -gt 1 ]
then
busybox echo '1' > /proc/sys/vm/drop_caches
fi
busybox echo ''
busybox echo 'BOOSTED!!!'
busybox echo ''
busybox echo ''
busybox free | busybox awk '/Mem/{print ">>>...Memory After Boosting :
"$4/1024" MB";}'
busybox sleep 3
}

free_form ( )
{
FRFM=$(settings get global enable_freeform_support) > /dev/null 2>&1;
if [ "$FRFM" == '0' ]
then
settings delete global enable_freeform_support > /dev/null 2>&1;
settings put global enable_freeform_support 1 > /dev/null 2>&1;
elif [ "$FRFM" == '1' ]
then
settings delete global enable_freeform_support > /dev/null 2>&1;
settings put global enable_freeform_support 0 > /dev/null 2>&1;
else
settings delete global enable_freeform_support > /dev/null 2>&1;
settings put global enable_freeform_support 1 > /dev/null 2>&1;
fi
}

tcp_algorithm ( )
{
tcpd="$BACKUP/KI00TCP_Algorithm" > /dev/null 2>&1;
tcp="/proc/sys/net/ipv4/tcp_available_congestion_control" > /dev/null 2>&1;
tcp_con="/proc/sys/net/ipv4/tcp_congestion_control" > /dev/null 2>&1;
tcps=($(busybox cat $tcp))
total=${#tcps[@]}
count=0
busybox echo -e $Y"TCP Controller >>>"$N
busybox echo ""
currenttcp=$(busybox cat $tcp_con)
busybox echo -e $W"CURRENT : $currenttcp"$N
for tcpss in "${tcps[@]}"; do
count=$((count+1))
busybox echo "$count : $tcpss"
done
busybox echo -e $W"0. Go Back"$N
busybox echo -e -n $W"[CHOOSE] : "$N
read key
if [ "$key" = "" ]; then
busybox clear
busybox echo -e $BL"No key entered"$N
busybox rm -f $INIT/KI00Tcpalgorithm
busybox sleep "3"
return 1
elif [ "$key" = "0" ]; then
busybox clear
return
fi
no=$(busybox echo $key | tr -d "0-9")
if [ $no ]; then
busybox clear
busybox echo -e $P"Numbers Only"$N
busybox rm -f $INIT/KI00Tcpalgorithm
busybox sleep "3"
return 1
fi
tcpnum=$((key-1))
if [ "$tcpnum" -lt "$total" ]; then
busybox clear
busybox echo -e $G"Changing to ${tcps[$tcpnum]}"$N
busybox echo "${tcps[$tcpnum]}" > $tcpd
busybox rm -f $INIT/KI00Tcpalgorithm
busybox cp -f $CORE/KI00Tcpalgorithm $INIT/KI00Tcpalgorithm
busybox chmod 755 $INIT/KI00Tcpalgorithm
busybox chown 0:2000 $INIT/KI00Tcpalgorithm
busybox echo "$(busybox cat $tcpd)" > $tcp_con
busybox sleep "3"
return
else
busybox clear
busybox echo -e $R"Number out of range!"$N
busybox rm -f $INIT/KI00Tcpalgorithm
busybox sleep "3"
return 1
fi
}
io_schedule ( )
{
schd="$BACKUP/KI00Schedule" > /dev/null 2>&1;
scheduler="/sys/block/mmcblk0/queue/scheduler" > /dev/null 2>&1;
schedulers=($(busybox cat $scheduler))
total=${#schedulers[@]}
count=0
busybox echo -e $Y"I/O Controller >>>"$N
busybox echo ""
currentio=$(busybox cat $scheduler)
busybox echo -e $W"CURRENT : $currentio"$N
for sche in "${schedulers[@]}"; do
count=$((count+1))
busybox echo -e $count : $sche | tr -d "[-]"
done
busybox echo -e $W"0. Go Back"$N
busybox echo -e -n $W"[CHOOSE] : "$N
read key
if [ "$key" = "" ]; then
busybox clear
busybox echo -e $BL"No key entered"$N
busybox rm -f $INIT/KI00Schedule
busybox sleep 3
return 1
elif [ "$key" = "0" ]; then
return
fi
no=$(busybox echo $key | tr -d "0-9")
if [ $no ]; then
busybox clear
busybox echo -e $P"Numbers Only"$N
busybox rm -f $INIT/KI00Schedule
busybox sleep 3
return 1
fi
sednum=$((key-1))
if [ "$sednum" -lt "$total" ]; then
busybox clear
busybox echo -e $G"Changing to ${schedulers[$sednum]}"$N
busybox echo "${schedulers[$sednum]}" | tr -d "[-]" > $schd
busybox rm -f $INIT/KI00Schedule
busybox cp -f $CORE/KI00Schedule $INIT/KI00Schedule
busybox chmod 755 $INIT/KI00Schedule
busybox chown 0:2000 $INIT/KI00Schedule
GREPSCHD=($(busybox cat $schd))
path="/sys/block/mmcblk*";
for Z in $path; do
busybox echo -e $GREPSCHD > $Z/queue/scheduler 2>&1
done
busybox sleep 3
return
else
busybox clear
busybox echo -e $R"Number out of range!"$N
busybox rm -f $INIT/KI00Schedule
busybox sleep 3
return 1
fi
}
cpu_governor ( )
{
govd="$BACKUP/KI00CPU_Governor" > /dev/null 2>&1;
govs="/sys/bus/cpu/devices/cpu0/cpufreq/scaling_available_governors" >
/dev/null 2>&1;
governor="/sys/bus/cpu/devices/cpu0/cpufreq/scaling_governor" > /dev/null
2>&1;
governors=($(busybox cat $govs))
total=${#governors[@]}
count=0
busybox echo -e $C"CPU Controller >>>"$N
busybox echo ""
currentcpu=$(busybox cat $governor)
busybox echo -e $W"CURRENT : $currentcpu"$N
for govc in "${governors[@]}"; do
count=$((count+1))
busybox echo "$count : $govc"
done
busybox echo -e $W"0. Go Back"$N
busybox echo -e -n $W"[CHOOSE] : "$N
read key
if [ "$key" = "" ]; then
busybox clear
busybox echo -e $BL"No key entered"$N
busybox rm -f $INIT/KI00Governor
busybox sleep 3
return 1
elif [ "$key" = "0" ]; then
busybox clear
return
fi
no=$(busybox echo $key | tr -d "0-9")
if [ $no ]; then
busybox clear
busybox echo -e $P"Numbers Only"$N
busybox rm -f $INIT/KI00Governor
busybox sleep 3
return 1
fi
govnum=$((key-1))
if [ "$govnum" -lt "$total" ]; then
busybox clear
busybox echo -e $G"Changing to ${governors[$govnum]}"$N
busybox echo "${governors[$govnum]}" > $govd
busybox rm -f $INIT/KI00Governor
busybox cp -f $CORE/KI00Governor $INIT/KI00Governor
busybox chmod 755 $INIT/KI00Governor
busybox chown 0:2000 $INIT/KI00Governor
busybox chmod 755 $governor
busybox echo "$(busybox cat $govd)" > $governor
busybox chmod 644 $governor
CPUPATH="/sys/bus/cpu/devices/cpu*" > /dev/null 2>&1;
for CPUON in $CPUPATH
do
busybox chmod 755 $CPUON/online
busybox printf '1\n' > $CPUON/online
busybox chmod 644 $CPUON/online
done
busybox sleep 3
return
else
busybox clear
busybox echo -e $R"Number out of range!"$N
busybox rm -f $INIT/KI00Governor
busybox sleep 3
return 1
fi
}
fast_reboot ( )
{
setprop ctl.restart zygote
}
reboots ( )
{
reboot
busybox sleep 3
setprop sys.powerctl reboot
}
reboot_bootloader ( )
{
reboot bootloader
}
reboot_recovery ( )
{
setprop ctl.start pre-recovery
busybox sleep 3
reboot recovery
}
restart_system_ui ( )
{
service call activity 42 s16 com.android.systemui
am startservice -n com.android.systemui/.SystemUIService
}
shutdown ( )
{
setprop sys.powerctl shutdown
busybox sleep 3
reboot -p
}
mount -o ro,remount,ro '/data' > /dev/null 2>&1;
mount -o ro,remount,ro '/system' > /dev/null 2>&1;
###################################################################################
###################################################################################
###############
#
# END
#
###################################################################################
###################################################################################
###############
#
#
while :
do
mount -o rw,remount,rw '/system' > /dev/null 2>&1;
mount -o rw,remount,rw '/data' > /dev/null 2>&1;
busybox clear
if busybox grep -q Battery $BACKUP/KI00Profile
then
PROFILE=$G'Battery'$N
elif busybox grep -q Balance $BACKUP/KI00Profile
then
PROFILE=$B'Balance'$N
elif busybox grep -q Performance $BACKUP/KI00Profile
then
PROFILE=$C'Performance'$N
else
PROFILE=$BL'Default'$N
fi
busybox echo -e $C"$DIVIDER"$N
busybox echo -e $W"1. Profiles | $PROFILE"$N
busybox echo -e $W'2. Dashboard'$N
busybox echo -e $W'3. Main Tweaks'$N
busybox echo -e $W'4. Battery'$N
busybox echo -e $W'5. Performance'$N
busybox echo -e $W'6. Net Optimizer'$N
busybox echo -e $W'7. I/O Tweaks'$N
busybox echo -e $W'8. Virtual Memory'$N
busybox echo -e $W'9. Ram Manager'$N
busybox echo -e $W'10.Debugging'$N
busybox echo -e $W'11.Cleaner'$N
busybox echo -e $W'12.Advanced Options'$N
busybox echo -e $C"$DIVIDER"$N
busybox echo -e $Y'r. Reboot Options'$N
busybox echo -e $R'u. Uninstaller'$N
busybox echo -e $P'e. Exit From KITANA'$N
busybox echo -e $C"$DIVIDER"$N
busybox echo -e -n $W'Please Choose Any One Option : '$N
read -r options
case $options in
1)
while :
do
if busybox grep -q Battery $BACKUP/KI00Profile
then
PROFILE=$G'Battery'$N
elif busybox grep -q Balance $BACKUP/KI00Profile
then
PROFILE=$B'Balance'$N
elif busybox grep -q Performance $BACKUP/KI00Profile
then
PROFILE=$C'Performance'$N
else
PROFILE=$BL'Default'$N
fi
busybox clear
busybox echo -e $Y'Profiles >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT:$PROFILE"$N
busybox echo -e $W'1. Default'$N
busybox echo -e $W'2. Battery'$N
busybox echo -e $W'3. Balance'$N
busybox echo -e $W'4. Performance'$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read profile
case $profile in
1)
busybox clear
profiles_default
busybox echo '' > $BACKUP/KI00Profile
;;
2)
busybox clear
profiles_default
busybox echo 'Battery' > $BACKUP/KI00Profile
wifi_auto_scan
power_collapse
power_supply
sensors_management
ril_tweaks
if [ ! -f $INIT/KI00Disabled_Debugging ]
then
busybox rm -f $INIT/KI00Disabled_Debugging
busybox cp -f $CORE/KI00Disabled_Debugging
$INIT/KI00Disabled_Debugging
busybox chmod 755 $INIT/KI00Disabled_Debugging
busybox chown 0:2000 $INIT/KI00Disabled_Debugging
fi
if [ ! -f $INIT/KI00Kernel_Sleepers_Optimization ]
then
busybox rm -f $INIT/KI00Kernel_Sleepers_Optimization
busybox cp -f $CORE/KI00Kernel_Sleepers_Optimization
$INIT/KI00Kernel_Sleepers_Optimization
busybox chmod 755 $INIT/KI00Kernel_Sleepers_Optimization
busybox chown 0:2000 $INIT/KI00Kernel_Sleepers_Optimization
fi
if [ ! -f $INIT/KI00Kernel_Panic ]
then
busybox rm -f $INIT/KI00Kernel_Panic
busybox cp -f $CORE/KI00Kernel_Panic $INIT/KI00Kernel_Panic
busybox chmod 755 $INIT/KI00Kernel_Panic
busybox chown 0:2000 $INIT/KI00Kernel_Panic
fi
if [ ! -f $INIT/KI00Battery_Kernel_Tweak ]
then
busybox rm -f $INIT/KI00Battery_Kernel_Tweak
busybox cp -f $CORE/KI00Battery_Kernel_Tweak
$INIT/KI00Battery_Kernel_Tweak
busybox chmod 755 $INIT/KI00Battery_Kernel_Tweak
busybox chown 0:2000 $INIT/KI00Battery_Kernel_Tweak
fi
if [ ! -f $INIT/KI00IOBoost ]
then
busybox rm -f $INIT/KI00IOBoost
busybox cp -f $CORE/KI00IOBoost $INIT/KI00IOBoost
busybox chmod 755 $INIT/KI00IOBoost
busybox chown 0:2000 $INIT/KI00IOBoost
fi
if [ ! -f $INIT/KI00Ram_Manager_Balance ]
then
busybox rm -f $INIT/KI00Ram_Manager_Balance
busybox cp -f $CORE/KI00Ram_Manager_Balance
$INIT/KI00Ram_Manager_Balance
busybox chmod 755 $INIT/KI00Ram_Manager_Balance
busybox chown 0:2000 $INIT/KI00Ram_Manager_Balance
fi
ram_manager_balance
if [ ! -f $INIT/KI00MCPS ]
then
busybox rm -f $INIT/KI00MCPS
busybox cp -f $CORE/KI00MCPS $INIT/KI00MCPS
busybox chmod 755 $INIT/KI00MCPS
busybox chown 0:2000 $INIT/KI00MCPS
fi
;;
3)
busybox clear
profiles_default
busybox echo 'Balance' > $BACKUP/KI00Profile
wifi_auto_scan
power_collapse
power_supply
sensors_management
ril_tweaks
small_net_buffers
better_scrolling
if [ ! -f $INIT/KI00Disabled_Debugging ]
then
busybox rm -f $INIT/KI00Disabled_Debugging
busybox cp -f $CORE/KI00Disabled_Debugging
$INIT/KI00Disabled_Debugging
busybox chmod 755 $INIT/KI00Disabled_Debugging
busybox chown 0:2000 $INIT/KI00Disabled_Debugging
fi
if [ ! -f $INIT/KI00Kernel_Sleepers_Optimization ]
then
busybox rm -f $INIT/KI00Kernel_Sleepers_Optimization
busybox cp -f $CORE/KI00Kernel_Sleepers_Optimization
$INIT/KI00Kernel_Sleepers_Optimization
busybox chmod 755 $INIT/KI00Kernel_Sleepers_Optimization
busybox chown 0:2000 $INIT/KI00Kernel_Sleepers_Optimization
fi
if [ ! -f $INIT/KI00Kernel_Panic ]
then
busybox rm -f $INIT/KI00Kernel_Panic
busybox cp -f $CORE/KI00Kernel_Panic $INIT/KI00Kernel_Panic
busybox chmod 755 $INIT/KI00Kernel_Panic
busybox chown 0:2000 $INIT/KI00Kernel_Panic
fi
if [ ! -f $INIT/KI00Balanced_Kernel_Tweak ]
then
busybox rm -f $INIT/KI00Balanced_Kernel_Tweak
busybox cp -f $CORE/KI00Balanced_Kernel_Tweak
$INIT/KI00Balanced_Kernel_Tweak
busybox chmod 755 $INIT/KI00Balanced_Kernel_Tweak
busybox chown 0:2000 $INIT/KI00Balanced_Kernel_Tweak
fi
if [ ! -f $INIT/KI00IOBoost ]
then
busybox rm -f $INIT/KI00IOBoost
busybox cp -f $CORE/KI00IOBoost $INIT/KI00IOBoost
busybox chmod 755 $INIT/KI00IOBoost
busybox chown 0:2000 $INIT/KI00IOBoost
fi
if [ ! -f $INIT/KI00Ram_Manager_Balance ]
then
busybox rm -f $INIT/KI00Ram_Manager_Balance
busybox cp -f $CORE/KI00Ram_Manager_Balance
$INIT/KI00Ram_Manager_Balance
busybox chmod 755 $INIT/KI00Ram_Manager_Balance
busybox chown 0:2000 $INIT/KI00Ram_Manager_Balance
fi
ram_manager_balance
if [ ! -f $INIT/KI00MCPS ]
then
busybox rm -f $INIT/KI00MCPS
busybox cp -f $CORE/KI00MCPS $INIT/KI00MCPS
busybox chmod 755 $INIT/KI00MCPS
busybox chown 0:2000 $INIT/KI00MCPS
fi
if [ ! -f $INIT/KI00SD_Tweak ]
then
busybox rm -f $INIT/KI00SD_Tweak
busybox cp -f $CORE/KI00SD_Tweak $INIT/KI00SD_Tweak
busybox chmod 755 $INIT/KI00SD_Tweak
busybox chown 0:2000 $INIT/KI00SD_Tweak
fi
if [ ! -f $INIT/KI00IOQueue ]
then
busybox rm -f $INIT/KI00IOQueue
busybox cp -f $CORE/KI00IOQueue $INIT/KI00IOQueue
busybox chmod 755 $INIT/KI00IOQueue
busybox chown 0:2000 $INIT/KI00IOQueue
fi
if [ ! -f $INIT/KI00Scudelar_Tuner ]
then
busybox rm -f $INIT/KI00Scudelar_Tuner
busybox cp -f $CORE/KI00Scudelar_Tuner $INIT/KI00Scudelar_Tuner
busybox chmod 755 $INIT/KI00Scudelar_Tuner
busybox chown 0:2000 $INIT/KI00Scudelar_Tuner
fi
;;
4)
busybox clear
profiles_default
busybox echo 'Performance' > $BACKUP/KI00Profile
wifi_auto_scan
power_collapse
power_supply
sensors_management
ril_tweaks
big_net_buffers
better_scrolling
liquid_smooth_ui
google_dns
if [ ! -f $INIT/KI00Google_DNS ]
then
busybox rm -f $INIT/KI00Google_DNS
busybox cp -f $CORE/KI00Google_DNS $INIT/KI00Google_DNS
busybox chmod 755 $INIT/KI00Google_DNS
busybox chown 0:2000 $INIT/KI00Google_DNS
fi
if [ ! -f $INIT/KI00Disabled_Debugging ]
then
busybox rm -f $INIT/KI00Disabled_Debugging
busybox cp -f $CORE/KI00Disabled_Debugging
$INIT/KI00Disabled_Debugging
busybox chmod 755 $INIT/KI00Disabled_Debugging
busybox chown 0:2000 $INIT/KI00Disabled_Debugging
fi
if [ ! -f $INIT/KI00Kernel_Sleepers_Optimization ]
then
busybox rm -f $INIT/KI00Kernel_Sleepers_Optimization
busybox cp -f $CORE/KI00Kernel_Sleepers_Optimization
$INIT/KI00Kernel_Sleepers_Optimization
busybox chmod 755 $INIT/KI00Kernel_Sleepers_Optimization
busybox chown 0:2000 $INIT/KI00Kernel_Sleepers_Optimization
fi
if [ ! -f $INIT/KI00Kernel_Panic ]
then
busybox rm -f $INIT/KI00Kernel_Panic
busybox cp -f $CORE/KI00Kernel_Panic $INIT/KI00Kernel_Panic
busybox chmod 755 $INIT/KI00Kernel_Panic
busybox chown 0:2000 $INIT/KI00Kernel_Panic
fi
if [ ! -f $INIT/KI00Performance_Kernel_Tweak ]
then
busybox rm -f $INIT/KI00Performance_Kernel_Tweak
busybox cp -f $CORE/KI00Performance_Kernel_Tweak
$INIT/KI00Performance_Kernel_Tweak
busybox chmod 755 $INIT/KI00Performance_Kernel_Tweak
busybox chown 0:2000 $INIT/KI00Performance_Kernel_Tweak
fi
if [ ! -f $INIT/KI00IOBoost ]
then
busybox rm -f $INIT/KI00IOBoost
busybox cp -f $CORE/KI00IOBoost $INIT/KI00IOBoost
busybox chmod 755 $INIT/KI00IOBoost
busybox chown 0:2000 $INIT/KI00IOBoost
fi
if [ ! -f $INIT/KI00Ram_Manager_Balance ]
then
busybox rm -f $INIT/KI00Ram_Manager_Balance
busybox cp -f $CORE/KI00Ram_Manager_Balance
$INIT/KI00Ram_Manager_Balance
busybox chmod 755 $INIT/KI00Ram_Manager_Balance
busybox chown 0:2000 $INIT/KI00Ram_Manager_Balance
fi
ram_manager_balance
if [ ! -f $INIT/KI00MCPS ]
then
busybox rm -f $INIT/KI00MCPS
busybox cp -f $CORE/KI00MCPS $INIT/KI00MCPS
busybox chmod 755 $INIT/KI00MCPS
busybox chown 0:2000 $INIT/KI00MCPS
fi
if [ ! -f $INIT/KI00SD_Tweak ]
then
busybox rm -f $INIT/KI00SD_Tweak
busybox cp -f $CORE/KI00SD_Tweak $INIT/KI00SD_Tweak
busybox chmod 755 $INIT/KI00SD_Tweak
busybox chown 0:2000 $INIT/KI00SD_Tweak
fi
if [ ! -f $INIT/KI00IOQueue ]
then
busybox rm -f $INIT/KI00IOQueue
busybox cp -f $CORE/KI00IOQueue $INIT/KI00IOQueue
busybox chmod 755 $INIT/KI00IOQueue
busybox chown 0:2000 $INIT/KI00IOQueue
fi
if [ ! -f $INIT/KI00Scudelar_Tuner ]
then
busybox rm -f $INIT/KI00Scudelar_Tuner
busybox cp -f $CORE/KI00Scudelar_Tuner $INIT/KI00Scudelar_Tuner
busybox chmod 755 $INIT/KI00Scudelar_Tuner
busybox chown 0:2000 $INIT/KI00Scudelar_Tuner
fi
;;
0)
busybox clear
break
;;
esac
done
;;
2)
while :
do
busybox clear
busybox echo -e $Y'Dashboard >>>'$N
busybox echo ''
busybox echo -e $W'1. Device info'$N
busybox echo -e $W'2. CPU information'$N
busybox echo -e $W'3. Kernel information'$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read dashboard
case $dashboard in
1)
busybox clear
id=$(getprop ro.build.id) > /dev/null 2>&1;
SDK_version=$(getprop ro.build.version.sdk) > /dev/null 2>&1;
android_version=$(getprop ro.build.version.release) > /dev/null 2>&1;
brand=$(getprop ro.product.brand) > /dev/null 2>&1;
manufacturer=$(getprop ro.product.manufacturer) > /dev/null 2>&1;
model=$(getprop ro.product.model)
hardware=$(getprop ro.hardware) > /dev/null 2>&1;
busybox echo -e $Y'Device info >>>'$N
busybox echo ''
busybox echo -e $W"Model : $model"$N
busybox echo -e $W"Android Version : $android_version"$N
busybox echo -e $W"Sdk Version : $SDK_version"$N
busybox echo -e $W"Manufacturer : $manufacturer"$N
busybox echo -e $W"Brand : $brand"$N
busybox echo -e $W"Hardware : $hardware"$N
busybox echo -e $W"ID : $id"$N
busybox echo ''
busybox echo -e $R'Tap enter to Go Back...'$N
read
;;
2)
busybox clear
busybox echo -e $Y'CPU information >>>'$N
busybox echo ''
busybox cat /proc/cpuinfo
busybox echo ''
busybox echo -e $R'Tap enter to Go Back...'$N
read
;;
3)
busybox clear
busybox echo -e $Y'Kernel information >>>'$N
busybox echo ''
busybox cat /proc/version
busybox echo ''
busybox echo -e $R'Tap enter to Go Back...'$N
read
;;
0)
busybox clear
break
;;
esac
done
;;
3)
while :
do
busybox clear
busybox echo -e $Y'Main Tweaks >>>'$N
busybox echo ''
busybox echo -e $W'1. Boost Options'$N
busybox echo -e $W'2. Kernel Modification'$N
busybox echo -e $W'3. System Tweaks'$N
busybox echo -e $W'4. UI Optimization'$N
busybox echo -e $W'5. Media Tweaks'$N
busybox echo -e $W'6. Wakelocks'$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read maintweaks
case $maintweaks in
1)
while :
do
if [ -f $INIT/KI00Boost ]
then
BOOST=$G'On'$N
else
BOOST=$R'Off'$N
fi
if [ -f $INIT/KI00Fstrim ]
then
FS=$G'On'$N
else
FS=$R'Off'$N
fi
busybox clear
busybox echo -e $Y'Boost Options >>>'$N
busybox echo ''
busybox echo -e $W'1. Boost now'$N
busybox echo -e $W'2. Fstrim now'$N
busybox echo -e $W"3. Boost on boot | $BOOST"$N
busybox echo -e $W"4. Fstrim on boot | $FS"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read boostoptions
case $boostoptions in
1)
busybox clear
boost
;;
2)
busybox clear
fstrim_now
;;
3)
busybox clear
if [ -f $INIT/KI00Boost ]
then
busybox rm -f $INIT/KI00Boost
else
busybox rm -f $INIT/KI00Boost
busybox cp -f $CORE/KI00Boost $INIT/KI00Boost
busybox chmod 755 $INIT/KI00Boost
busybox chown 0:2000 $INIT/KI00Boost
fi
;;
4)
busybox clear
if [ -f $INIT/KI00Fstrim ]
then
busybox rm -f $INIT/KI00Fstrim
else
busybox rm -f $INIT/KI00Fstrim
busybox cp -f $CORE/KI00Fstrim $INIT/KI00Fstrim
busybox chmod 755 $INIT/KI00Fstrim
busybox chown 0:2000 $INIT/KI00Fstrim
fi
;;
0)
busybox clear
break
;;
esac
done
;;
2)
while :
do
if [ -f $INIT/KI00Balanced_Kernel_Tweak ]
then
KT=$B'Balance'$N
elif [ -f $INIT/KI00Battery_Kernel_Tweak ]
then
KT=$G'Battery'$N
elif [ -f $INIT/KI00Performance_Kernel_Tweak ]
then
KT=$C'Performance'$N
else
KT=$BL'Default'$N
fi
if [ -f $INIT/KI00Fsync ]
then
FSYNC=$G'Enabled'$N
elif [ -f $INIT/KI00Fsync_Off ]
then
FSYNC=$R'Disabled'$N
else
FSYNC=$BL'Default'$N
fi
if [ -f $INIT/KI00Kernel_Sleepers_Optimization ]
then
KSO=$G'On'$N
else
KSO=$R'Off'$N
fi
if [ -f $INIT/KI00Tap2wake_Enabled ]
then
WAKE=$G'Enabled'$N
elif [ -f $INIT/KI00Tap2wake_Disabled ]
then
WAKE=$R'Disabled'$N
else
WAKE=$BL'Default'$N
fi
if [ -f $INIT/KI00Sweep2wake_Enabled ]
then
SWEEP=$G'Enabled'$N
elif [ -f $INIT/KI00Sweep2wake_Enabled_Disabled ]
then
SWEEP=$R'Disabled'$N
else
SWEEP=$BL'Default'$N
fi
if busybox grep -q ro.kernel.android.checkjni=0 $BUILD && busybox grep
-q ro.kernel.checkjni=0 $BUILD
then
ERROR=$G'On'$N
else
ERROR=$R'Off'$N
fi
busybox clear
busybox echo -e $W"1. Kernel Tweaks | $KT"$N
busybox echo -e $W"2. Fsync | $FSYNC"$N
busybox echo -e $W"3. Kernel Sleepers Optimization | $KSO"$N
busybox echo -e $W"4. Wake Control | $WAKE $SWEEP"$N
busybox echo -e $W"5. Kernel Error Fix | $ERROR"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read kernelmodification
case $kernelmodification in
1)
while :
do
if [ -f $INIT/KI00Balanced_Kernel_Tweak ]
then
KT=$B'Balance'$N
elif [ -f $INIT/KI00Battery_Kernel_Tweak ]
then
KT=$G'Battery'$N
elif [ -f $INIT/KI00Performance_Kernel_Tweak ]
then
KT=$C'Performance'$N
else
KT=$BL'Default'$N
fi
busybox clear
busybox echo -e $Y'Kernel Tweaks >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT:$KT"$N
busybox echo -e $W'1. Default'$N
busybox echo -e $W'2. Battery'$N
busybox echo -e $W'3. Balance'$N
busybox echo -e $W'4. Performance'$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read kerneltweaks
case $kerneltweaks in
1)
busybox clear
busybox rm -f $INIT/KI00Performance_Kernel_Tweak
busybox rm -f $INIT/KI00Balanced_Kernel_Tweak
busybox rm -f $INIT/KI00Battery_Kernel_Tweak
;;
2)
busybox clear
if [ -f $INIT/KI00Battery_Kernel_Tweak ]
then
busybox rm -f $INIT/KI00Battery_Kernel_Tweak
else
busybox rm -f $INIT/KI00Performance_Kernel_Tweak
busybox rm -f $INIT/KI00Balanced_Kernel_Tweak
busybox rm -f $INIT/KI00Battery_Kernel_Tweak
busybox cp -f $CORE/KI00Battery_Kernel_Tweak
$INIT/KI00Battery_Kernel_Tweak
busybox chmod 755 $INIT/KI00Battery_Kernel_Tweak
busybox chown 0:2000 $INIT/KI00Battery_Kernel_Tweak
fi
;;
3)
busybox clear
if [ -f $INIT/KI00Balanced_Kernel_Tweak ]
then
busybox rm -f $INIT/KI00Balanced_Kernel_Tweak
else
busybox rm -f $INIT/KI00Performance_Kernel_Tweak
busybox rm -f $INIT/KI00Balanced_Kernel_Tweak
busybox rm -f $INIT/KI00Battery_Kernel_Tweak
busybox cp -f $CORE/KI00Balanced_Kernel_Tweak
$INIT/KI00Balanced_Kernel_Tweak
busybox chmod 755 $INIT/KI00Balanced_Kernel_Tweak
busybox chown 0:2000 $INIT/KI00Balanced_Kernel_Tweak
fi
;;
4)
busybox clear
if [ -f $INIT/KI00Performance_Kernel_Tweak ]
then
busybox rm -f $INIT/KI00Performance_Kernel_Tweak
else
busybox rm -f $INIT/KI00Performance_Kernel_Tweak
busybox rm -f $INIT/KI00Balanced_Kernel_Tweak
busybox rm -f $INIT/KI00Battery_Kernel_Tweak
busybox cp -f $CORE/KI00Performance_Kernel_Tweak
$INIT/KI00Performance_Kernel_Tweak
busybox chmod 755 $INIT/KI00Performance_Kernel_Tweak
busybox chown 0:2000
$INIT/KI00Performance_Kernel_Tweak
fi
;;
0)
busybox clear
break
;;
esac
done
;;
2)
while :
do
if [ -f $INIT/KI00Fsync ]
then
FSYNC=$G'Enabled'$N
elif [ -f $INIT/KI00Fsync_Off ]
then
FSYNC=$R'Disabled'$N
else
FSYNC=$BL'Default'$N
fi
busybox clear
busybox echo -e $Y'Fsync >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT:$FSYNC"$N
busybox echo -e $W'1. Default'$N
busybox echo -e $W'2. Enable'$N
busybox echo -e $W'3. Disable'$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read sync
case $sync in
1)
busybox clear
busybox rm -f $INIT/KI00Fsync
busybox rm -f $INIT/KI00Fsync_Off
;;
2)
busybox clear
if [ -f $INIT/KI00Fsync ]
then
busybox rm -f $INIT/KI00Fsync
else
busybox rm -f $INIT/KI00Fsync
busybox rm -f $INIT/KI00Fsync_Off
busybox cp -f $CORE/KI00Fsync $INIT/KI00Fsync
$busybix chmod 755 $INIT/KI00Fsync
busybox chown 0:2000 $INIT/KI00Fsync
fi
;;
3)
busybox clear
if [ -f $INIT/KI00Fsync_Off ]
then
busybox rm -f $INIT/KI00Fsync_Off
else
busybox rm -f $INIT/KI00Fsync
busybox rm -f $INIT/KI00Fsync_Off
busybox cp -f $CORE/KI00Fsync_Off $INIT/KI00Fsync_Off
$busybix chmod 755 $INIT/KI00Fsync_Off
busybox chown 0:2000 $INIT/KI00Fsync_Off
fi
;;
0)
busybox clear
break
;;
esac
done
;;
3)
busybox clear
if [ -f $INIT/KI00Kernel_Sleepers_Optimization ]
then
busybox rm -f $INIT/KI00Kernel_Sleepers_Optimization
else
busybox rm -f $INIT/KI00Kernel_Sleepers_Optimization
busybox cp -f $CORE/KI00Kernel_Sleepers_Optimization
$INIT/KI00Kernel_Sleepers_Optimization
busybox chmod 755 $INIT/KI00Kernel_Sleepers_Optimization
busybox chown 0:2000 $INIT/KI00Kernel_Sleepers_Optimization
fi
;;
4)
while :
do
if [ -f $INIT/KI00Tap2wake_Enabled ]
then
WAKE=$G'Enabled'$N
elif [ -f $INIT/KI00Tap2wake_Disabled ]
then
WAKE=$R'Disabled'$N
else
WAKE=$BL'Default'$N
fi
if [ -f $INIT/KI00Sweep2wake_Enabled ]
then
SWEEP=$G'Enabled'$N
elif [ -f $INIT/KI00Sweep2wake_Disabled ]
then
SWEEP=$R'Disabled'$N
else
SWEEP=$BL'Default'$N
fi
busybox clear
busybox echo -e $Y'Wake >>>'$N
busybox echo ''
busybox echo -e $W"1. Double Tap | $WAKE"$N
busybox echo -e $W"2. Sweep | $SWEEP"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read WAKE
case $WAKE in
1)
while :
do
if [ -f $INIT/KI00Tap2wake_Enabled ]
then
WAKE=$G'Enabled'$N
elif [ -f $INIT/KI00Tap2wake_Disabled ]
then
WAKE=$R'Disabled'$N
else
WAKE=$BL'Default'$N
fi
busybox clear
busybox echo -e $Y'Double Tap >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT:$WAKE"$N
busybox echo -e $W'1. Default'$N
busybox echo -e $W'2. Enabled'$N
busybox echo -e $W'3. Disabled'$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read DOUBLETAP
case $DOUBLETAP in
1)
busybox clear
busybox rm -f $INIT/KI00Tap2wake_Disabled
busybox rm -f $INIT/KI00Tap2wake_Enabled
;;
2)
busybox clear
if [ -f $INIT/KI00Tap2wake_Enabled ]
then
busybox rm -f $INIT/KI00Tap2wake_Enabled
else
busybox rm -f $INIT/KI00Tap2wake_Enabled
busybox rm -f $INIT/KI00Tap2wake_Disabled
busybox cp -f $CORE/KI00Tap2wake_Enabled
$INIT/KI00Tap2wake_Enabled
busybox chmod 755 $INIT/KI00Tap2wake_Enabled
busybox chown 0:2000 $INIT/KI00Tap2wake_Enabled
fi
;;
3)
busybox clear
if [ -f $INIT/KI00Tap2wake_Disabled ]
then
busybox rm -f $INIT/KI00Tap2wake_Disabled
else
busybox rm -f $INIT/KI00Tap2wake_Enabled
busybox rm -f $INIT/KI00Tap2wake_Disabled
busybox cp -f $CORE/KI00Tap2wake_Disabled
$INIT/KI00Tap2wake_Disabled
busybox chmod 755 $INIT/KI00Tap2wake_Disabled
busybox chown 0:2000
$INIT/KI00Tap2wake_Disabled
fi
;;
0)
busybox clear
break
;;
esac
done
;;
2)
while :
do
if [ -f $INIT/KI00Sweep2wake_Enabled ]
then
SWEEP=$G"Enabled"$N
elif [ -f $INIT/KI00Sweep2wake_Disabled ]
then
SWEEP=$R"Disabled"$N
else
SWEEP=$BL"Default"$N
fi
busybox clear
busybox echo -e $Y'Sweep >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT:$SWEEP"$N
busybox echo -e $W"1. Default"$N
busybox echo -e $W"2. Enabled"$N
busybox echo -e $W"3. Disabled"$N
busybox echo -e $W"0. Go Back"$N
busybox echo -e -n $W"[CHOOSE] : "$N
read WAKESWEEP
case $WAKESWEEP in
1)
busybox clear
busybox rm -f $INIT/KI00Sweep2wake_Enabled
busybox rm -f $INIT/KI00Sweep2wake_Disabled
;;
2)
busybox clear
if [ -f $INIT/KI00Sweep2wake_Enabled ]
then
busybox rm -f $INIT/KI00Sweep2wake_Enabled
else
busybox rm -f $INIT/KI00Sweep2wake_Disabled
busybox rm -f $INIT/KI00Sweep2wake_Enabled
busybox cp -f $CORE/KI00Sweep2wake_Enabled
$INIT/KI00Sweep2wake_Enabled
busybox chmod 755 $INIT/KI00Sweep2wake_Enabled
busybox chown 0:2000
$INIT/KI00Sweep2wake_Enabled
fi
;;
3)
busybox clear
if [ -f $INIT/KI00Sweep2wake_Disabled ]
then
busybox rm -f $INIT/KI00Sweep2wake_Disabled
else
busybox rm -f $INIT/KI00Sweep2wake_Enabled
busybox rm -f $INIT/KI00Sweep2wake_Disabled
busybox cp -f $CORE/KI00Sweep2wake_Disabled
$INIT/KI00Sweep2wake_Disabled
busybox chmod 755 $INIT/KI00Sweep2wake_Disabled
busybox chown 0:2000
$INIT/KI00Sweep2wake_Disabled
fi
;;
0)
busybox clear
break
;;
esac
done
;;
0)
busybox clear
break
;;
esac
done
;;
5)
busybox clear
kernel_error_fix
;;
0)
busybox clear
break
;;
esac
done
;;
3)
while :
do
if busybox grep -q ro.config.hw_quickpoweron=true $BUILD
then
BOOT=$G'On'$N
else
BOOT=$R'Off'$N
fi
if busybox grep -q persist.sys.shutdown.mode=hibernate $BUILD
then
REBOOT=$G'On'$N
else
REBOOT=$R'Off'$N
fi
if busybox grep -q debug.sf.nobootanimation=1 $BUILD
then
NOBOOT=$G'On'$N
else
NOBOOT=$R'Off'$N
fi
if busybox grep -q ro.HOME_APP_ADJ=1 $BUILD
then
HOME=$G'On'$N
else
HOME=$R'Off'$N
fi
if busybox grep -q persist.adb.notify=0 $BUILD
then
ADB=$G'On'$N
else
ADB=$R'Off'$N
fi
captive=$(settings get global captive_portal_mode)
if [ "$captive" -eq '0' ]
then
CPD=$R'Disabled'$N
elif [ "$captive" -eq '1' ]
then
CPD=$G'Enabled'$N
else
CPD=$BL'Unknown/Null'$N
fi
if busybox grep -q windowsmgr.support_rotation_270=true $BUILD
then
RSCREEN=$G'On'$N
else
RSCREEN=$R'Off'$N
fi
if busybox grep -q log.tag.launcher_force_rotate=VERBOSE $BUILD &&
busybox grep -q lockscreen.rot_override=true $BUILD
then
LSR=$G'On'$N
else
LSR=$R'Off'$N
fi
if busybox grep -q ro.config.media_vol_steps=30 $BUILD
then
VST=$G'On'$N
else
VST=$R'Off'$N
fi
if busybox grep -q persist.sys.charging.disable=1 $BUILD
then
USB=$G'On'$N
else
USB=$R'Off'$N
fi
if busybox grep -q ro.config.hwfeature_wakeupkey=1 $BUILD
then
VOL=$G'On'$N
else
VOL=$R'Off'$N
fi
if busybox grep -q ro.mot.buttonlight.timeout=1 $BUILD
then
TOUT=$G'On'$N
else
TOUT=$R'Off'$N
fi
if busybox grep -q ro.qc.sdk.audio.fluencetype=none $BUILD && busybox
grep -q persist.audio.fluence.voicerec=true $BUILD && busybox grep -q
persist.audio.fluence.speaker=false $BUILD && busybox grep -q
use.voice.path.for.pcm.voip=true $BUILD
then
MIC=$G'On'$N
else
MIC=$R'Off'$N
fi
busybox clear
busybox echo -e $Y'System Tweaks >>>'$N
busybox echo ''
busybox echo -e $W"1. Faster Boot | $BOOT"$N
busybox echo -e $W"2. Faster Reboot | $REBOOT"$N
busybox echo -e $W"3. No Boot Animation | $NOBOOT"$N
busybox echo -e $W"4. Home Launcher Lock In Memory | $HOME"$N
busybox echo -e $W"5. Hide Adb Icon | $ADB"$N
busybox echo -e $W"6. Portal Detection | $CPD"$N
busybox echo -e $W"7. Screen Rotation | $RSCREEN"$N
busybox echo -e $W"8. Lock Screen Rotation | $LSR"$N
busybox echo -e $W"9. Increase Volume Steps | $VST"$N
busybox echo -e $W"10.Mic Fix | $MIC"$N
busybox echo -e $W"11.USB Charging Disabled | $USB"$N
busybox echo -e $W"12.WakeUp by Volume | $VOL"$N
busybox echo -e $W"13.Button Light Timeout | $TOUT"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read systemtweaks
case $systemtweaks in
1)
busybox clear
faster_boot
;;
2)
busybox clear
faster_reboot
;;
3)
busybox clear
no_boot_animation
;;
4)
busybox clear
launcher_lock
;;
5)
busybox clear
adb_icon
;;
6)
busybox clear
if [ "$SDK" -ge '21' ]
then
while :
do
portal_captive
busybox clear
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
else
busybox echo -e $R'Need Lollipop + Android Version'$N
busybox sleep 2
fi
;;
7)
busybox clear
screen_rotation
;;
8)
busybox clear
lock_screen_rotation
;;
9)
busybox clear
volume_steps
;;
10)
busybox clear
mic_fix
;;
11)
busybox clear
disable_usb_charging
;;
12)
busybox clear
wakeup_key
;;
13)
busybox clear
buttonlight_timeout
;;
0)
busybox clear
break
;;
esac
done
;;
4)
while :
do
if busybox grep -q sys.display-size=1920x1080 $BUILD
then
YOUTUBE=$C'1080P'$N
elif busybox grep -q sys.display-size=2560x1440 $BUILD
then
YOUTUBE=$Y'1440P'$N
elif busybox grep -q sys.display-size=640x480 $BUILD
then
YOUTUBE=$G'480P'$N
elif busybox grep -q sys.display-size=3840x2160 $BUILD
then
YOUTUBE=$R'4K'$N
elif busybox grep -q sys.display-size=1280x720 $BUILD
then
YOUTUBE=$B'720P'$N
else
YOUTUBE=$BL'Default'$N
fi
if busybox grep -q hw2d.force=1 $BUILD && busybox grep -q hw3d.force=1
$BUILD && busybox grep -q ro.product.gpu.driver=1 $BUILD && busybox grep -q
persist.sampling_profiler=0 $BUILD && busybox grep -q
hwui.render_dirty_regions=false $BUILD && busybox grep -q persist.sys.ui.hw=1
$BUILD && busybox grep -q ro.config.disable.hw_accel=false $BUILD && busybox grep
-q video.accelerate.hw=1 $BUILD && busybox grep -q hwui.disable_vsync=true $BUILD
&& busybox grep -q persist.sys.composition.type=gpu $BUILD && busybox grep -q
debug.sf.hw=1 $BUILD && busybox grep -q debug.performance.tuning=1 $BUILD &&
busybox grep -q video.accelerate.hw=1 $BUILD && busybox grep -q
debug.egl.profiler=1 $BUILD && busybox grep -q debug.egl.hw=1 $BUILD && busybox
grep -q debug.composition.type=gpu $BUILD && busybox grep -q debug.enabletr=true
$BUILD && busybox grep -q debug.overlayui.enable=1 $BUILD && busybox grep -q
debug.qctwa.preservebuf=1 $BUILD && busybox grep -q dev.pm.dyn_samplingrate=1
$BUILD && busybox grep -q ro.fb.mode=1 $BUILD && busybox grep -q
ro.sf.compbypass.enable=0 $BUILD
then
GPU=$G'On'$N
else
GPU=$R'Off'$N
fi
if busybox grep -q touch.pressure.scale=0.001 $BUILD
then
LUI=$G'On'$N
else
LUI=$R'Off'$N
fi
if busybox grep -q persist.sys.scrollingcache=3 $BUILD && busybox grep
-q ro.max.fling_velocity=12000 $BUILD && busybox grep -q ro.min.fling_velocity=8000
$BUILD
then
SCROLLING=$G'On'$N
else
SCROLLING=$R'Off'$N
fi
if busybox grep -q ro.qcom.ad=1 $BUILD && busybox grep -q
ro.qcom.ad.calib.data=/system/etc/ad_calib.cfg $BUILD
then
AD=$G'On'$N
else
AD=$R'Off'$N
fi
if busybox grep -q persist.sys.force_highendgfx=true $BUILD
then
HQG=$G'On'$N
else
HQG=$R'Off'$N
fi
busybox clear
busybox echo -e $Y'UI Optimization >>>'$N
busybox echo ''
busybox echo -e $W"1. YouTube Resolution | $YOUTUBE"$N
busybox echo -e $W"2. GPU Rendering | $GPU"$N
busybox echo -e $W"3. Liquid Smooth UI | $LUI"$N
busybox echo -e $W"4. Better Scrolling | $SCROLLING"$N
busybox echo -e $W"5. Assertive Display | $AD"$N
busybox echo -e $W"6. High Quality Graphics | $HQG"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read uioptimuization
case $uioptimuization in
1)
while :
do
if busybox grep -q sys.display-size=1920x1080 $BUILD
then
YOUTUBE=$C'1080P'$N
elif busybox grep -q sys.display-size=2560x1440 $BUILD
then
YOUTUBE=$Y'1440P'$N
elif busybox grep -q sys.display-size=640x480 $BUILD
then
YOUTUBE=$G'480P'$N
elif busybox grep -q sys.display-size=3840x2160 $BUILD
then
YOUTUBE=$R'4K'$N
elif busybox grep -q sys.display-size=1280x720 $BUILD
then
YOUTUBE=$B'720P'$N
else
YOUTUBE=$BL'Default'$N
fi
busybox clear
busybox echo -e $Y'YouTube Resolution >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT:$YOUTUBE"$N
busybox echo -e $W'1. Default'$N
busybox echo -e $W'2. 480P'$N
busybox echo -e $W'3. 720P'$N
busybox echo -e $W'4. 1080P'$N
busybox echo -e $W'5. 1440P'$N
busybox echo -e $W'6. 4K'$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read YOUTUBE
case $YOUTUBE in
1)
busybox clear
busybox sed -i '/sys.display-size/d' $BUILD
;;
2)
busybox clear
YouTube_480
;;
3)
busybox clear
YouTube_720
;;
4)
busybox clear
YouTube_1080
;;
5)
busybox clear
YouTube_1440
;;
6)
busybox clear
YouTube_4K
;;
0)
busybox clear
break
;;
esac
done
;;
2)
busybox clear
gpu_rendering
;;
3)
busybox clear
liquid_smooth_ui
;;
4)
busybox clear
better_scrolling
;;
5)
busybox clear
if [ ! -f $ETC/ad_calib.cfg ]
then
busybox rm -f $ETC/ad_calib.cfg
busybox cp -f $CORE/KI00Ad_Calib $ETC/ad_calib.cfg
busybox chmod 755 $ETC/ad_calib.cfg
busybox chown 0:0 $ETC/ad_calib.cfg
fi
assertive_display
;;
6)
busybox clear
high_quality_graphics
;;
0)
busybox clear
break
;;
esac
done
;;
5)
while :
do
if busybox grep -q ro.media.enc.jpeg.quality=100 $BUILD && busybox grep
-q ro.media.enc.hprof.vid.fps=60 $BUILD && busybox grep -q
ro.media.dec.jpeg.memcap=8000000 $BUILD && busybox grep -q
ro.media.enc.hprof.vid.bps=8000000 $BUILD && busybox grep -q
ro.media.capture.maxres=8m $BUILD && busybox grep -q
ro.media.panorama.defres=3264x1840 $BUILD && busybox grep -q
ro.media.panorama.frameres=1280x720 $BUILD && busybox grep -q
ro.camcorder.videoModes=true $BUILD && busybox grep -q
ro.media.enc.hprof.vid.fps=60 $BUILD && busybox grep -q
ro.media.dec.aud.wma.enabled=1 $BUILD && busybox grep -q
ro.media.dec.vid.wmv.enabled=1 $BUILD && busybox grep -q ro.media.cam.preview.fps=0
$BUILD && busybox grep -q ro.media.capture.flash=led $BUILD && busybox grep -q
ro.media.capture.flashMinV=3300000 $BUILD && busybox grep -q
ro.media.capture.torchIntensity=65 $BUILD && busybox grep -q
ro.media.capture.flashIntensity=100 $BUILD && busybox grep -q
ro.media.capture.fast.fps=4 $BUILD && busybox grep -q ro.media.capture.slow.fps=120
$BUILD
then
CAPT=$G'On'$N
else
CAPT=$R'Off'$N
fi
if [ -f $INIT/KI00Media_Server_Kill ]
then
KSB=$G'On'$N
else
KSB=$R'Off'$N
fi
if [ -f $INIT/KI00Media_Scanner_Kill ]
then
KMC=$G'On'$N
else
KMC=$R'Off'$N
fi
busybox clear
busybox echo -e $Y'Media Tweaks >>>'$N
busybox echo ''
busybox echo -e $W"1. Kill Media Services"$N
busybox echo -e $W"2. Stop Media Scanner"$N
busybox echo -e $W"3. Start Media Scanner"$N
busybox echo -e $W"4. Kill Media Services On Boot | $KSB"$N
busybox echo -e $W"5. Kill Media Scanner On Boot | $KMC"$N
busybox echo -e $W"6. Captured Tweak | $CAPT"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read MEDIATWEAKS
case $MEDIATWEAKS in
1)
busybox clear
busybox echo -e $R"Media Services Kill Starting"$N
media_server_kill
busybox sleep 1
busybox echo -e $G"OK Done"$N
busybox sleep 3
;;
2)
busybox clear
busybox echo -e $R"Media Scanner Stopping"$N
media_scanner_kill
busybox sleep 1
busybox echo -e $G"OK Done"$N
busybox sleep 3
;;
3)
busybox clear
busybox echo -e $R"Media Scanner Starting"$N
media_scanner_on
busybox sleep 1
busybox echo -e $G"OK Done"$N
busybox sleep 3
;;
4)
busybox clear
if [ -f $INIT/KI00Media_Server_Kill ]
then
busybox rm -f $INIT/KI00Media_Server_Kill
else
busybox rm -f $INIT/KI00Media_Server_Kill
busybox cp -f $CORE/KI00Media_Server_Kill
$INIT/KI00Media_Server_Kill
busybox chmod 755 $INIT/KI00Media_Server_Kill
busybox chown 0:2000 $INIT/KI00Media_Server_Kill
fi
;;
5)
busybox clear
if [ -f $INIT/KI00Media_Scanner_Kill ]
then
busybox rm -f $INIT/KI00Media_Scanner_Kill
media_scanner_on
else
busybox rm -f $INIT/KI00Media_Scanner_Kill
busybox cp -f $CORE/KI00Media_Scanner_Kill
$INIT/KI00Media_Scanner_Kill
busybox chmod 755 $INIT/KI00Media_Scanner_Kill
busybox chown 0:2000 $INIT/KI00Media_Scanner_Kill
media_scanner_kill
fi
;;
6)
busybox clear
captured
;;
0)
busybox clear
break
;;
esac
done
;;
6)
if [ -d /sys/module/wakeup ]
then
while :
do
wakeup="/sys/module/wakeup/parameters" > /dev/null 2>&1;
enable_msm=$(busybox cat $wakeup/enable_msm_hsic_ws)
siws=$(busybox cat $wakeup/enable_si_ws)
smb135ws=$(busybox cat $wakeup/enable_smb135x_wake_ws)
ctrl_ws=$(busybox cat $wakeup/enable_wlan_ctrl_wake_ws)
rx_ws=$(busybox cat $wakeup/enable_wlan_rx_wake_ws)
wlan_ws=$(busybox cat $wakeup/enable_wlan_wake_ws)
if [ "$enable_msm" == Y ]
then
MSM=$G"Yes"$N
elif [ "$enable_msm" == N ]
then
MSM=$R"No"$N
else
MSM=$BL"Unknown"$N
fi
if [ "$siws" == Y ]
then
SIWS=$G"Yes"$N
elif [ "$siws" == N ]
then
SIWS=$R"No"$N
else
SIWS=$BL"Unknown"$N
fi
if [ "$smb135ws" == Y ]
then
SMB=$G"Yes"$N
elif [ "$smb135ws" == N ]
then
SMB=$R"No"$N
else
SMB=$BL"Unknown"$N
fi
if [ "$ctrl_ws" == Y ]
then
CTRL=$G"Yes"$N
elif [ "$ctrl_ws" == N ]
then
CTRL=$R"No"$N
else
CTRL=$BL"Unknown"$N
fi
if [ "$rx_ws" == Y ]
then
RX=$G"Yes"$N
elif [ "$rx_ws" == N ]
then
RX=$R"No"$N
else
RX=$BL"Unknown"$N
fi
if [ "$wlan_ws" == Y ]
then
WLAN=$G"Yes"$N
elif [ "$wlan_ws" == N ]
then
WLAN=$R"No"$N
else
WLAN=$BL"Unknown"$N
fi
busybox clear
busybox echo -e $Y'Wakelocks >>>'$N
busybox echo ''
busybox echo -e $W"1. Msm Hsic Ws | $MSM"$N
busybox echo -e $W"2. Si Ws | $SIWS"$N
busybox echo -e $W"3. Smb135 Wake Ws | $SMB"$N
busybox echo -e $W"4. Wlan Ctrl Wake Ws | $CTRL"$N
busybox echo -e $W"5. Wlan Rx Wake Ws | $RX"$N
busybox echo -e $W"6. Wlan Wake Ws | $WLAN"$N
busybox echo -e $W"0. Go Back"$N
busybox echo -e -n $W"[CHOOSE] : "$N
read WAKELOCKS
case $WAKELOCKS in
1)
busybox clear
if [ "$enable_msm" == N ]
then
busybox echo "Y" > $wakeup/enable_msm_hsic_ws
if [ ! -f $INIT/KI00Msm ]
then
busybox rm -f $INIT/KI00Msm
busybox rm -f $INIT/KI00Msm_Off
busybox cp -f $CORE/KI00Msm $INIT/KI00Msm
busybox chmod 755 $INIT/KI00Msm
busybox chown 0:2000 $INIT/KI00Msm
fi
elif [ "$enable_msm" == Y ]
then
busybox echo "N" > $wakeup/enable_msm_hsic_ws
if [ ! -f $INIT/KI00Msm_Off ]
then
busybox rm -f $INIT/KI00Msm
busybox rm -f $INIT/KI00Msm_Off
busybox cp -f $CORE/KI00Msm_Off
$INIT/KI00Msm_Off
busybox chmod 755 $INIT/KI00Msm_Off
busybox chown 0:2000 $INIT/KI00Msm_Off
fi
else
busybox echo -e $W"Sorry Current Value Is Unvalid"$N
busybox rm -f $INIT/KI00Msm
busybox rm -f $INIT/KI00Msm_Off
fi
;;
2)
busybox clear
if [ "$siws" == N ]
then
busybox echo "Y" > $wakeup/enable_si_ws
if [ ! -f $INIT/KI00Si ]
then
busybox rm -f $INIT/KI00Si
busybox rm -f $INIT/KI00Si_Off
busybox cp -f $CORE/KI00Si $INIT/KI00Si
busybox chmod 755 $INIT/KI00Si
busybox chown 0:2000 $INIT/KI00Si
fi
elif [ "$siws" == Y ]
then
busybox echo "N" > $wakeup/enable_si_ws
if [ ! -f $INIT/KI00Si_Off ]
then
busybox rm -f $INIT/KI00Si
busybox rm -f $INIT/KI00Si_Off
busybox cp -f $CORE/KI00Si_Off $INIT/KI00Si_Off
busybox chmod 755 $INIT/KI00Si_Off
busybox chown 0:2000 $INIT/KI00Si_Off
fi
else
busybox echo -e $W"Sorry Current Value Is Unvalid"$N
busybox rm -f $INIT/KI00Si
busybox rm -f $INIT/KI00Si_Off
fi
;;
3)
busybox clear
if [ "$smb135ws" == N ]
then
busybox echo "Y" > $wakeup/enable_smb135x_wake_ws
if [ ! -f $INIT/KI00Smb ]
then
busybox rm -f $INIT/KI00Smb
busybox rm -f $INIT/KI00Smb_Off
busybox cp -f $CORE/KI00Smb $INIT/KI00Smb
busybox chmod 755 $INIT/KI00Smb
busybox chown 0:2000 $INIT/KI00Smb
fi
elif [ "$smb135ws" == Y ]
then
busybox echo "N" > $wakeup/enable_smb135x_wake_ws
if [ ! -f $INIT/KI00Smb_Off ]
then
busybox rm -f $INIT/KI00Smb
busybox rm -f $INIT/KI00Smb_Off
busybox cp -f $CORE/KI00Smb_Off
$INIT/KI00Smb_Off
busybox chmod 755 $INIT/KI00Smb_Off
busybox chown 0:2000 $INIT/KI00Smb_Off
fi
else
busybox echo -e $W"Sorry Current Value Is Unvalid"$N
busybox rm -f $INIT/KI00Smb
busybox rm -f $INIT/KI00Smb_Off
fi
;;
4)
busybox clear
if [ "$ctrl_ws" == N ]
then
busybox echo "Y" > $wakeup/enable_wlan_ctrl_wake_ws
if [ ! -f $INIT/KI00Ctrl ]
then
busybox rm -f $INIT/KI00Ctrl
busybox rm -f $INIT/KI00Ctrl_Off
busybox cp -f $CORE/KI00Ctrl $INIT/KI00Ctrl
busybox chmod 755 $INIT/KI00Ctrl
busybox chown 0:2000 $INIT/KI00Ctrl
fi
elif [ "$ctrl_ws" == Y ]
then
busybox echo "N" > $wakeup/enable_wlan_ctrl_wake_ws
if [ ! -f $INIT/KI00Ctrl_Off ]
then
busybox rm -f $INIT/KI00Ctrl
busybox rm -f $INIT/KI00Ctrl_Off
busybox cp -f $CORE/KI00Ctrl_Off
$INIT/KI00Ctrl_Off
busybox chmod 755 $INIT/KI00Ctrl_Off
busybox chown 0:2000 $INIT/KI00Ctrl_Off
fi
else
busybox echo -e $W"Sorry Current Value Is Unvalid"$N
busybox rm -f $INIT/KI00Ctrl
busybox rm -f $INIT/KI00Ctrl_Off
fi
;;
5)
busybox clear
if [ "$rx_ws" == N ]
then
busybox echo "Y" > $wakeup/enable_wlan_rx_wake_ws
if [ ! -f $INIT/KI00Rx ]
then
busybox rm -f $INIT/KI00Rx
busybox rm -f $INIT/KI00Rx_Off
busybox cp -f $CORE/KI00Rx $INIT/KI00Rx
busybox chmod 755 $INIT/KI00Rx
busybox chown 0:2000 $INIT/KI00Rx
fi
elif [ "$rx_ws" == Y ]
then
busybox echo "N" > $wakeup/enable_wlan_rx_wake_ws
if [ ! -f $INIT/KI00Rx_Off ]
then
busybox rm -f $INIT/KI00Rx
busybox rm -f $INIT/KI00Rx_Off
busybox cp -f $CORE/KI00Rx_Off $INIT/KI00Rx_Off
busybox chmod 755 $INIT/KI00Rx_Off
busybox chown 0:2000 $INIT/KI00Rx_Off
fi
else
busybox echo -e $W"Sorry Current Value Is Unvalid"$N
busybox rm -f $INIT/KI00Rx
busybox rm -f $INIT/KI00Rx_Off
fi
;;
6)
busybox clear
if [ "$wlan_ws" == N ]
then
busybox echo "Y" > $wakeup/enable_wlan_wake_ws
if [ ! -f $INIT/KI00Wlan_Ws ]
then
busybox rm -f $INIT/KI00Wlan_Ws
busybox rm -f $INIT/KI00Wlan_Ws
busybox cp -f $CORE/KI00Wlan_Ws
$INIT/KI00Wlan_Ws
busybox chmod 755 $INIT/KI00Wlan_Ws
busybox chown 0:2000 $INIT/KI00Wlan_Ws
fi
elif [ "$wlan_ws" == Y ]
then
busybox echo "N" > $wakeup/enable_wlan_wake_ws
if [ ! -f $INIT/KI00Wlan_Ws_Off ]
then
busybox rm -f $INIT/KI00Wlan_Ws
busybox rm -f $INIT/KI00Wlan_Ws_Off
busybox cp -f $CORE/KI00Wlan_Ws_Off
$INIT/KI00Wlan_Ws_Off
busybox chmod 755 $INIT/KI00Wlan_Ws_Off
busybox chown 0:2000 $INIT/KI00Wlan_Ws_Off
fi
else
busybox echo -e $W"Sorry Current Value Is Unvalid"$N
busybox rm -f $INIT/KI00Wlan_Ws
busybox rm -f $INIT/KI00Wlan_Ws_Off
fi
;;
0)
busybox clear
break
;;
esac
done
else
busybox clear
busybox echo -e $R"Wakelocks Not Supported By This Kernel"$N
busybox sleep 2
fi
;;
0)
busybox clear
break
;;
esac
done
;;
4)
while :
do
if busybox grep -q wifi.supplicant_scan_interval=220 $BUILD
then
WiFi=$G'On'$N
else
WiFi=$R'Off'$N
fi
if busybox grep -q ro.ril.disable.power.collapse=0 $BUILD && busybox grep -q
ro.vold.umsdirtyratio=20 $BUILD && busybox grep -q pm.sleep_mode=1 $BUILD
then
EPC=$G'On'$N
else
EPC=$R'Off'$N
fi
if busybox grep -q power_supply.wakeup=enable $BUILD
then
EPS=$G'On'$N
else
EPS=$R'Off'$N
fi
if busybox grep -q ro.ril.sensor.sleep.control=1 $BUILD
then
SM=$G'On'$N
else
SM=$R'Off'$N
fi
if busybox grep -q ro.config.nocheckin=1 $BUILD && busybox grep -q
profiler.force_disable_err_rpt=1 $BUILD && busybox grep -q
profiler.force_disable_ulog=1 $BUILD && busybox grep -q logcat.live=disable $BUILD
&& busybox grep -q debugtool.anrhistory=0 $BUILD && busybox grep -q
profiler.debugmonitor=false $BUILD && busybox grep -q profiler.launch=false $BUILD
&& busybox grep -q profiler.hung.dumpdobugreport=false $BUILD && busybox grep -q
persist.android.strictmode=0 $BUILD
then
DSL=$G'On'$N
else
DSL=$R'Off'$N
fi
if busybox grep -q MIN_HIDDEN_APPS $BUILD && busybox grep -q
ACTIVITY_INACTIVE_RESET_TIME $BUILD && busybox grep -q MIN_RECENT_TASKS $BUILD &&
busybox grep -q PROC_START_TIMEOUT $BUILD && busybox grep -q CPU_MIN_CHECK_DURATION
$BUILD && busybox grep -q GC_TIMEOUT $BUILD && busybox grep -q SERVICE_TIMEOUT
$BUILD && busybox grep -q MIN_CRASH_INTERVAL $BUILD && busybox grep -q
ENFORCE_PROCESS_LIMIT $BUILD
then
DIM=$G'On'$N
else
DIM=$R'Off'$N
fi
if [ -f $INIT/KI00Deep_Sleep ]
then
BDS=$G'On'$N
else
BDS=$R'Off'$N
fi
if [ -f $INIT/KI00Doze_Mod ]
then
DOZE=$G'On'$N
else
DOZE=$R'Off'$N
fi
if [ -f $INIT/KI00LCD_Power ]
then
LCD=$G'On'$N
else
LCD=$R'Off'$N
fi
if [ -f $INIT/KI00VMFixes ]
then
FXVM=$G'On'$N
else
FXVM=$R'Off'$N
fi
if [ -f $INIT/KI00LPM ]
then
LPM=$G'On'$N
else
LPM=$R'Off'$N
fi
if [ -f $INIT/KI00Laptop_Mode ]
then
WD=$G'On'$N
else
WD=$R'Off'$N
fi
if [ -f $INIT/KI00DGLCS ]
then
PST=$G'On'$N
else
PST=$R'Off'$N
fi
if [ -f $INIT/KI00MCPS ]
then
MCPS=$G'On'$N
else
MCPS=$R'Off'$N
fi
if [ -f $INIT/KI00Fast_Charging ]
then
FASTC=$G'On'$N
else
FASTC=$R'Off'$N
fi
if busybox grep -q KITANA $ETC/sysconfig/google.xml > /dev/null 2>&1;
then
GPSD=$G"Enabled"$N
else
GPSD=$R"Disabled"$N
fi
if busybox grep -q ro.config.nocheckin=1 $BUILD && busybox grep -q
profiler.force_disable_err_rpt=1 $BUILD && busybox grep -q
profiler.force_disable_ulog=1 $BUILD && busybox grep -q logcat.live=disabled $BUILD
&& busybox grep -q debugtool.anrhistory=0 $BUILD && busybox grep -q
profiler.debugmonitor=false $BUILD && busybox grep -q profiler.launch=false $BUILD
&& busybox grep -q profiler.hung.dumpdobugreport=false $BUILD && busybox grep -q
persist.android.strictmode=0 $BUILD
then
STOPLOG=$G'On'$N
else
STOPLOG=$R'Off'$N
fi
if busybox grep -q ACTIVITY_INACTIVE_RESET_TIME=false $BUILD && busybox grep
-q CPU_MIN_CHECK_DURATION=false $BUILD && busybox grep -q
ENFORCE_PROCESS_LIMIT=false $BUILD && busybox grep -q GC_TIMEOUT=false $BUILD &&
busybox grep -q MIN_CRASH_INTERVAL=false $BUILD && busybox grep -q
MIN_HIDDEN_APPS=false $BUILD && busybox grep -q MIN_RECENT_TASKS=false $BUILD &&
busybox grep -q PROC_START_TIMEOUT=false $BUILD && busybox grep -q
SERVICE_TIMEOUT=false $BUILD
then
FLAGTUNER=$G'On'$N
else
FLAGTUNER=$R'Off'$N
fi
busybox clear
busybox echo -e $Y'Battery >>>'$N
busybox echo ''
busybox echo -e $W"1. Battery Information"$N
busybox echo -e $W"2. Battery Status reset"$N
busybox echo -e $W"3. Battery Calibration"$N
busybox echo -e $W"4. Improve Doze | $DOZE"$N
busybox echo -e $W"5. LCD Power Reduce | $LCD"$N
busybox echo -e $W"6. Disable Location Service | $PST"$N
busybox echo -e $W"7. Fixes VM Overuse | $FXVM"$N
busybox echo -e $W"8. Increase WiFi Auto Scan Time | $WiFi"$N
busybox echo -e $W"9. Enable Power Collapse | $EPC"$N
busybox echo -e $W"10.Enable Power Supply | $EPS"$N
busybox echo -e $W"11.Sensors Management | $SM"$N
busybox echo -e $W"12.Better Deep Sleep | $BDS"$N
busybox echo -e $W"13.Write Deferral | $WD"$N
busybox echo -e $W"14.Low Power Mode | $LPM"$N
busybox echo -e $W"15.Multi Core Power Save | $MCPS"$N
busybox echo -e $W"16.Fast Charge | $FASTC"$N
busybox echo -e $W"17.Play Service Doze | $GPSD"$N
busybox echo -e $W"18.Stop Logging | $STOPLOG"$N
busybox echo -e $W"19.Disable Multitasking | $FLAGTUNER"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read BATTERY
case $BATTERY in
1)
busybox clear
BATTERY="/sys/class/power_supply/battery" > /dev/null 2>&1;
TYPE=$(busybox cat $BATTERY/type)
LEVEL=$(busybox cat $BATTERY/capacity)
STATUS=$(busybox cat $BATTERY/status)
HEALTH=$(busybox cat $BATTERY/health)
TECHNOLOGY=$(busybox cat $BATTERY/technology)
TEM=$(busybox cat $BATTERY/batt_temp)
VOL=$(busybox cat $BATTERY/batt_vol)
TEMPERATURE=`expr $TEM / 10`
busybox echo -e $Y'Battery Information >>>'$N
busybox echo ''
busybox echo -e $W"Type : $TYPE"$N
busybox echo -e $W"Status : $STATUS"$N
busybox echo -e $W"Health : $HEALTH"$N
busybox echo -e $W"Technology : $TECHNOLOGY"$N
busybox echo -e $W"Level : $LEVEL""%"$N
busybox echo -e $W"Temperature : $TEMPERATURE.0 Degree Centigrade"$N
busybox echo -e $W"Voltage : $VOL mV"$N
busybox echo ''
busybox echo -e $R"Tap enter to Go Back..."$N
read
;;
2)
busybox clear
dumpsys batterystats --reset
busybox sleep 1
;;
3)
busybox clear
LEVEL=$(busybox cat /sys/class/power_supply/battery/capacity)
busybox echo ''
busybox echo -e $C"You need full battery..."$N
busybox echo ''
busybox sleep 0.1
busybox echo -e $Y'Checking, please wait...'$N
busybox echo ''
busybox sleep 0.1
if [ "$LEVEL" = "100" ] ; then
busybox mount -o remount,rw /data > /dev/null 2>&1;
busybox sleep 0.1
busybox rm -f /data/system/batterystats.bin
busybox echo ''
busybox echo ''
busybox sleep 3
busybox echo ''
busybox echo -e $G"Your battery is now calibrated.."$N
busybox echo ''
busybox echo -e $BL"Please reboot the device..."$N
busybox sleep 3
else
busybox echo ''
busybox echo ''
busybox echo ''
busybox echo -e $BL"Your battery is not fully charged..."$N
busybox sleep 3
fi
;;
4)
busybox clear
if [ "$SDK" -ge '23' ]
then
if [ -f $INIT/KI00Doze_Mod ]
then
busybox rm -f $INIT/KI00Doze_Mod
else
busybox rm -f $INIT/KI00Doze_Mod
busybox cp -f $CORE/KI00Doze_Mod $INIT/KI00Doze_Mod
busybox chmod 755 $INIT/KI00Doze_Mod
busybox chown 0:2000 $INIT/KI00Doze_Mod
fi
else
busybox echo -e $W"This Android Version Is Too Old"$N
busybox sleep 3
fi
;;
5)
busybox clear
if [ -f $INIT/KI00LCD_Power ]
then
busybox rm -f $INIT/KI00LCD_Power
else
busybox rm -f $INIT/KI00LCD_Power
busybox cp -f $CORE/KI00LCD_Power $INIT/KI00LCD_Power
busybox chmod 755 $INIT/KI00LCD_Power
busybox chown 0:2000 $INIT/KI00LCD_Power
fi
;;
6)
busybox clear
if [ -f $INIT/KI00DGLCS ]
then
busybox rm -f $INIT/KI00DGLCS
enable_location_service
enable_mobile_cloud_service
else
busybox rm -f $INIT/KI00DGLCS
busybox cp -f $CORE/KI00DGLCS $INIT/KI00DGLCS
busybox chmod 755 $INIT/KI00DGLCS
busybox chown 0:2000 $INIT/KI00DGLCS
disable_location_service
disable_mobile_cloud_service
fi
;;
7)
busybox clear
if [ -f $INIT/KI00VMFixes ]
then
busybox rm -f $INIT/KI00VMFixes
else
busybox rm -f $INIT/KI00VMFixes
busybox cp -f $CORE/KI00VMFixes $INIT/KI00VMFixes
busybox chmod 755 $INIT/KI00VMFixes
busybox chown 0:2000 $INIT/KI00VMFixes
fi
;;
8)
busybox clear
wifi_auto_scan
;;
9)
busybox clear
power_collapse
;;
10)
busybox clear
power_supply
;;
11)
busybox clear
sensors_management
;;
12)
busybox clear
if [ -f $INIT/KI00Deep_Sleep ]
then
busybox rm -f $INIT/KI00Deep_Sleep
else
busybox rm -f $INIT/KI00Deep_Sleep
busybox cp -f $CORE/KI00Deep_Sleep $INIT/KI00Deep_Sleep
busybox chmod 755 $INIT/KI00Deep_Sleep
busybox chown 0:2000 $INIT/KI00Deep_Sleep
fi
;;
13)
busybox clear
if [ -f $INIT/KI00Laptop_Mode ]
then
busybox rm -f $INIT/KI00Laptop_Mode
else
busybox rm -f $INIT/KI00Laptop_Mode
busybox cp -f $CORE/KI00Laptop_Mode $INIT/KI00Laptop_Mode
busybox chmod 755 $INIT/KI00Laptop_Mode
busybox chown 0:2000 $INIT/KI00Laptop_Mode
fi
;;
14)
if [ -f $INIT/KI00LPM ]
then
busybox rm -f $INIT/KI00LPM
else
busybox rm -f $INIT/KI00LPM
busybox cp -f $CORE/KI00LPM $INIT/KI00LPM
busybox chmod 755 $INIT/KI00LPM
busybox chown 0:2000 $INIT/KI00LPM
fi
;;
15)
busybox clear
if [ -f $INIT/KI00MCPS ]
then
busybox rm -f $INIT/KI00MCPS
else
busybox rm -f $INIT/KI00MCPS
busybox cp -f $CORE/KI00MCPS $INIT/KI00MCPS
busybox chmod 755 $INIT/KI00MCPS
busybox chown 0:2000 $INIT/KI00MCPS
fi
;;
16)
busybox clear
if [ -f $INIT/KI00Fast_Charging ]
then
busybox rm -f $INIT/KI00Fast_Charging
else
busybox rm -f $INIT/KI00Fast_Charging
busybox cp -f $CORE/KI00Fast_Charging $INIT/KI00Fast_Charging
busybox chmod 755 $INIT/KI00Fast_Charging
busybox chown 0:2000 $INIT/KI00Fast_Charging
fi
;;
17)
if [ "$SDK" -ge '23' ]
then
while :
do
busybox clear
if busybox grep -q KITANA $ETC/sysconfig/google.xml > /dev/null
2>&1;
then
busybox clear
busybox rm -f $ETC/sysconfig/google.xml
busybox cp -f $BACKUP/KI00Google_Doze.xml
$ETC/sysconfig/google.xml
busybox chmod 644 $ETC/sysconfig/google.xml
busybox chown 0:0 $ETC/sysconfig/google.xml
elif busybox grep -q ! KITANA $ETC/sysconfig/google.xml
then
busybox clear
busybox rm -f $ETC/sysconfig/google.xml
busybox cp -f $CORE/KI00Google_Doze
$ETC/sysconfig/google.xml
busybox chmod 644 $ETC/sysconfig/google.xml
busybox chown 0:0 $ETC/sysconfig/google.xml
fi
busybox clear
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
else
busybox echo -e $R"$Need Marshmallow + Android Version"$N
busybox sleep 2
fi
;;
18)
busybox clear
stop_logging
;;
19)
busybox clear
flag_tuner
;;
0)
busybox clear
break
;;
esac
done
;;
5)
while :
do
if busybox grep -q debug.egl.swapinterval=-60 $BUILD && busybox grep -q
debug.gr.swapinterval=1 $BUILD
then
FPS=$G'On'$N
else
FPS=$R'Off'$N
fi
if busybox grep -q ro.telephony.call_ring.delay=0 $BUILD
then
CALL=$G'On'$N
else
CALL=$R'Off'$N
fi
if busybox grep -q debug.performance.tuning=1 $BUILD && busybox grep -q
persist.sys.use_dithering=1 $BUILD && busybox grep -q persist.sys.use_16bpp_alpha=1
$BUILD && busybox grep -q persist.service.lgospd.enable=0 $BUILD && busybox grep -q
persist.service.pcsync.enable=0 $BUILD
then
PRE=$G'On'$N
else
PRE=$R'Off'$N
fi
if [ -f $INIT/KI00Interactive_Tweak ]
then
CPU=$G'On'$N
else
CPU=$R'Off'$N
fi
if [ -f $INIT/KI00Touch_Tweak ]
then
TI=$G'On'$N
else
TI=$R'Off'$N
fi
busybox clear
busybox echo -e $Y'Performance >>>'$N
busybox echo ''
busybox echo -e $W"1. Performance Tuner | $PRE"$N
busybox echo -e $W"2. Reduce In-Call Delay | $CALL"$N
busybox echo -e $W"3. CPU Optimizer | $CPU"$N
busybox echo -e $W"4. FPS Unlocked | $FPS"$N
busybox echo -e $W"5. Touch Improvement | $TI"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read PERFORMANCE
case $PERFORMANCE in
1)
busybox clear
performance_tuner
;;
2)
busybox clear
reduce_in_call
;;
3)
busybox clear
if [ -f $INIT/KI00Interactive_Tweak ]
then
busybox rm -f $INIT/KI00Interactive_Tweak
else
busybox rm -f $INIT/KI00Interactive_Tweak
busybox cp -f $CORE/KI00Interactive_Tweak
$INIT/KI00Interactive_Tweak
busybox chmod 755 $INIT/KI00Interactive_Tweak
busybox chown 0:2000 $INIT/KI00Interactive_Tweak
fi
;;
4)
busybox clear
fps_unlocker
;;
5)
busybox clear
if [ -f $INIT/KI00Touch_Tweak ]
then
busybox rm -f $INIT/KI00Touch_Tweak
else
busybox rm -f $INIT/KI00Touch_Tweak
busybox cp -f $CORE/KI00Touch_Tweak $INIT/KI00Touch_Tweak
busybox chmod 755 $INIT/KI00Touch_Tweak
busybox chown 0:2000 $INIT/KI00Touch_Tweak
touch
fi
;;
0)
busybox clear
break
;;
esac
done
;;
6)
while :
do
if busybox grep -q ro.ril.enable.amr.wideband=1 $BUILD
then
ARM=$G'On'$N
else
ARM=$R'Off'$N
fi
if busybox grep -q ro.fast.dormancy=1 $BUILD && busybox grep -q
ro.ril.fast.dormancy.rule=1 $BUILD && busybox grep -q
persist.radio.data_no_toggle=1 $BUILD
then
FD=$G'On'$N
else
FD=$R'Off'$N
fi
if busybox grep -q media.stagefright.enable-player=true $BUILD && busybox
grep -q media.stagefright.enable-meta=true $BUILD && busybox grep -q
media.stagefright.enable-scan=true $BUILD && busybox grep -q
media.stagefright.enable-http=true $BUILD && busybox grep -q
media.stagefright.enable-record=false $BUILD && busybox grep -q
media.stagefright.enable-aac=true $BUILD && busybox grep -q
media.stagefright.enable-rtsp=true $BUILD && busybox grep -q
media.stagefright.enable-fma2dp=true $BUILD && busybox grep -q
media.stagefright.enable-qcp=true $BUILD
then
FSTR=$G'On'$N
else
FSTR=$R'Off'$N
fi
if busybox grep -q net.dns1=8.8.8.8 $BUILD && busybox grep -q
net.dns2=8.8.4.4 $BUILD && busybox grep -q net.eth0.dns1=8.8.8.8 $BUILD && busybox
grep -q net.eth0.dns2=8.8.4.4 $BUILD && busybox grep -q net.rmnet0.dns1=8.8.8.8
$BUILD && busybox grep -q net.rmnet0.dns2=8.8.4.4 $BUILD && busybox grep -q
net.rmnet1.dns1=8.8.8.8 $BUILD && busybox grep -q net.rmnet1.dns2=8.8.4.4 $BUILD &&
busybox grep -q net.rmnet2.dns1=8.8.8.8 $BUILD && busybox grep -q
net.rmnet2.dns2=8.8.4.4 $BUILD && busybox grep -q net.wlan0.dns1=8.8.8.8 $BUILD &&
busybox grep -q net.wlan0.dns2=8.8.4.4 $BUILD && busybox grep -q
dhcp.eth0.dns1=8.8.8.8 $BUILD && busybox grep -q dhcp.eth0.dns2=8.8.4.4 $BUILD &&
busybox grep -q dhcp.wlan0.dns1=8.8.8.8 $BUILD && busybox grep -q
dhcp.wlan0.dns2=8.8.4.4 $BUILD
then
DNS=$G'On'$N
else
DNS=$R'Off'$N
fi
if busybox grep -q ro.ril.hsxpa=2 $BUILD && busybox grep -q ro.ril.hspa=2
$BUILD && busybox grep -q ro.ril.lte=2 $BUILD && busybox grep -q ro.ril.lte=2
$BUILD && busybox grep -q ro.ril.ltea=2 $BUILD && busybox grep -q ro.ril.hep=1
$BUILD && busybox grep -q ro.ril.enable.3g.prefix=1 $BUILD && busybox grep -q
ro.ril.enable.4g.prefix=1 $BUILD && busybox grep -q ro.ril.enable.dtm=1 $BUILD &&
busybox grep -q ro.ril.hspaclass=15 $BUILD && busybox grep -q ro.ril.lteclass=15
$BUILD && busybox grep -q ro.ril.gprsclass=15 $BUILD && busybox grep -q
ro.ril.hsupa.category=10 $BUILD && busybox grep -q ro.ril.hsdpa.category=30 $BUILD
&& busybox grep -q ro.ril.lte.category=10 $BUILD && busybox grep -q
ro.ril.ltea.category=30 $BUILD && busybox grep -q ro.ril.enable.a51=1 $BUILD &&
busybox grep -q ro.ril.enable.a52=1 $BUILD && busybox grep -q ro.ril.enable.a53=1
$BUILD && busybox grep -q ro.ril.enable.a54=1 $BUILD && busybox grep -q
ro.ril.enable.a55=1 $BUILD && busybox grep -q persist.cust.tel.eons=1 $BUILD
then
RIL=$G'On'$N
else
RIL=$R'Off'$N
fi
if busybox grep -q persist.telephony.support.ipv4=1 $BUILD
then
ipv4=$G'On'$N
else
ipv4=$R'Off'$N
fi
if busybox grep -q persist.telephony.support.ipv6=1 $BUILD
then
ipv6=$G'On'$N
else
ipv6=$R'Off'$N
fi
if busybox grep -q
net.tcp.buffersize.default=4096,87380,110208,4096,16384,110208 $BUILD && busybox
grep -q net.tcp.buffersize.edge=4093,26280,35040,4096,16384,35040 $BUILD && busybox
grep -q net.tcp.buffersize.ethernet=524288,1048576,3145728,524288,1048576,2097152
$BUILD && busybox grep -q
net.tcp.buffersize.evdo=4094,87380,262144,4096,16384,262144 $BUILD && busybox grep
-q net.tcp.buffersize.gprs=4092,8760,11680,4096,8760,11680 $BUILD && busybox grep
-q net.tcp.buffersize.hsdpa=4094,87380,262144,4096,16384,262144 $BUILD && busybox
grep -q net.tcp.buffersize.hspa=4094,87380,262144,4096,16384,262144 $BUILD &&
busybox grep -q net.tcp.buffersize.hspap=4094,87380,1220608,4096,16384,1220608
$BUILD && busybox grep -q
net.tcp.buffersize.hsupa=4094,87380,262144,4096,16384,262144 $BUILD && busybox grep
-q net.tcp.buffersize.lte=524288,1048576,2097152,262144,524288,1048576 $BUILD &&
busybox grep -q net.tcp.buffersize.umts=4094,87380,110208,4096,16384,110208 $BUILD
&& busybox grep -q
net.tcp.buffersize.wifi=524288,1048576,2097152,262144,524288,1048576 $BUILD
then
BUFF=$G"Small"$N
elif busybox grep -q
net.tcp.buffersize.default=6144,87380,110208,6144,16384,110208 $BUILD && busybox
grep -q net.tcp.buffersize.edge=6144,26280,35040,6144,16384,35040 $BUILD && busybox
grep -q net.tcp.buffersize.ethernet=524288,1048576,3145728,524288,1048576,2097152
$BUILD && busybox grep -q
net.tcp.buffersize.evdo=6144,87380,262144,6144,16384,262144 $BUILD && busybox grep
-q net.tcp.buffersize.gprs=6144,8760,11680,6144,8760,11680 $BUILD && busybox grep
-q net.tcp.buffersize.hsdpa=6144,87380,262144,6144,16384,262144 $BUILD && busybox
grep -q net.tcp.buffersize.hspa=6144,87380,262144,6144,16384,262144 $BUILD &&
busybox grep -q net.tcp.buffersize.hspap=6144,87380,1220608,6144,16384,1220608
$BUILD && busybox grep -q
net.tcp.buffersize.hsupa=6144,87380,262144,6144,16384,262144 $BUILD && busybox grep
-q net.tcp.buffersize.lte=524288,1048576,2097152,262144,524288,1048576 $BUILD &&
busybox grep -q net.tcp.buffersize.umts=6144,87380,110208,6144,16384,110208 $BUILD
&& busybox grep -q
net.tcp.buffersize.wifi=524288,1048576,2097152,262144,524288,1048576 $BUILD
then
BUFF=$B"Big"$N
else
BUFF=$BL"Default"$N
fi
if [ -f $INIT/KI00Net_Tcp ]
then
TCP=$G'On'$N
else
TCP=$R'Off'$N
fi
if [ -f $INIT/KI00Net_Speed+ ]
then
SPEED=$G'On'$N
else
SPEED=$R'Off'$N
fi
if busybox grep -q default_secure_redirects=0 $BUILD && busybox grep -q
default_accept_redirects=0 $BUILD && busybox grep -q default_accept_source_route=0
$BUILD && busybox grep -q all_secure_redirects=0 $BUILD && busybox grep -q
all_accept_redirects=0 $BUILD && busybox grep -q all_accept_source_route=0 $BUILD
&& busybox grep -q ip_forward=0 $BUILD && busybox grep -q ip_dynaddr=0 $BUILD &&
busybox grep -q ip_no_pmtu_disc=0 $BUILD && busybox grep -q tcp_ecn=2 $BUILD &&
busybox grep -q tcp_timestamps=1 $BUILD && busybox grep -q tcp_low_latency=0 $BUILD
&& busybox grep -q tcp_tw_reuse=1 $BUILD && busybox grep -q tcp_fack=1 $BUILD &&
busybox grep -q tcp_sack=1 $BUILD && busybox grep -q tcp_dsack=1 $BUILD && busybox
grep -q tcp_rfc1337=1 $BUILD && busybox grep -q tcp_tw_recycle=1 $BUILD && busybox
grep -q tcp_window_scaling=1 $BUILD && busybox grep -q tcp_moderate_rcvbuf=1 $BUILD
&& busybox grep -q tcp_no_metrics_save=1 $BUILD && busybox grep -q
tcp_synack_retries=2 $BUILD && busybox grep -q tcp_syn_retries=2 $BUILD && busybox
grep -q tcp_keepalive_probes=5 $BUILD && busybox grep -q tcp_keepalive_intvl=30
$BUILD && busybox grep -q tcp_fin_timeout=30 $BUILD
then
DTCP=$G'On'$N
else
DTCP=$R'Off'$N
fi
if [ -f $INIT/KI00SYN_Attacks ]
then
SYN=$G'Protect On'$N
else
SYN=$R'Protect Off'$N
fi
if [ -f $INIT/KI00Block_Redirects ]
then
BR=$G'On'$N
else
BR=$R'Off'$N
fi
if [ -f $INIT/KI00Avoid_Time ]
then
AT=$G'On'$N
else
AT=$R'Off'$N
fi
if [ -f $INIT/KI00Block_Routing ]
then
BRR=$G'On'$N
else
BRR=$R'Off'$N
fi
busybox clear
busybox echo -e $Y'Net Optimizer >>>'$N
busybox echo ''
busybox echo -e $W"1. Ril Tweak | $RIL"$N
busybox echo -e $W"2. Buffers | $BUFF"$N
busybox echo -e $W"3. Net TCP Tweak | $TCP"$N
busybox echo -e $W"4. Net Speed + | $SPEED"$N
busybox echo -e $W"5. Google DNS | $DNS"$N
busybox echo -e $W"6. Faster Streaming | $FSTR"$N
busybox echo -e $W"7. Fast Dormancy | $FD"$N
busybox echo -e $W"8. ARM Wideband | $ARM"$N
busybox echo -e $W"9. ipv4 Support | $ipv4"$N
busybox echo -e $W"10.ipv6 Support | $ipv6"$N
busybox echo -e $W"11.Deep ipv4 Tuning | $DTCP"$N
busybox echo -e $W"12.SYN Attacks | $SYN"$N
busybox echo -e $W"13.Block Redirects | $BR"$N
busybox echo -e $W"14.Avoid Time | $AT"$N
busybox echo -e $W"15.Block Routing | $BRR"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read netoptimizer
case $netoptimizer in
1)
busybox clear
ril_tweaks
;;
2)
while :
do
if busybox grep -q
net.tcp.buffersize.default=4096,87380,110208,4096,16384,110208 $BUILD && busybox
grep -q net.tcp.buffersize.edge=4093,26280,35040,4096,16384,35040 $BUILD && busybox
grep -q net.tcp.buffersize.ethernet=524288,1048576,3145728,524288,1048576,2097152
$BUILD && busybox grep -q
net.tcp.buffersize.evdo=4094,87380,262144,4096,16384,262144 $BUILD && busybox grep
-q net.tcp.buffersize.gprs=4092,8760,11680,4096,8760,11680 $BUILD && busybox grep
-q net.tcp.buffersize.hsdpa=4094,87380,262144,4096,16384,262144 $BUILD && busybox
grep -q net.tcp.buffersize.hspa=4094,87380,262144,4096,16384,262144 $BUILD &&
busybox grep -q net.tcp.buffersize.hspap=4094,87380,1220608,4096,16384,1220608
$BUILD && busybox grep -q
net.tcp.buffersize.hsupa=4094,87380,262144,4096,16384,262144 $BUILD && busybox grep
-q net.tcp.buffersize.lte=524288,1048576,2097152,262144,524288,1048576 $BUILD &&
busybox grep -q net.tcp.buffersize.umts=4094,87380,110208,4096,16384,110208 $BUILD
&& busybox grep -q
net.tcp.buffersize.wifi=524288,1048576,2097152,262144,524288,1048576 $BUILD
then
BUFF=$G"Small"$N
elif busybox grep -q
net.tcp.buffersize.default=6144,87380,110208,6144,16384,110208 $BUILD && busybox
grep -q net.tcp.buffersize.edge=6144,26280,35040,6144,16384,35040 $BUILD && busybox
grep -q net.tcp.buffersize.ethernet=524288,1048576,3145728,524288,1048576,2097152
$BUILD && busybox grep -q
net.tcp.buffersize.evdo=6144,87380,262144,6144,16384,262144 $BUILD && busybox grep
-q net.tcp.buffersize.gprs=6144,8760,11680,6144,8760,11680 $BUILD && busybox grep
-q net.tcp.buffersize.hsdpa=6144,87380,262144,6144,16384,262144 $BUILD && busybox
grep -q net.tcp.buffersize.hspa=6144,87380,262144,6144,16384,262144 $BUILD &&
busybox grep -q net.tcp.buffersize.hspap=6144,87380,1220608,6144,16384,1220608
$BUILD && busybox grep -q
net.tcp.buffersize.hsupa=6144,87380,262144,6144,16384,262144 $BUILD && busybox grep
-q net.tcp.buffersize.lte=524288,1048576,2097152,262144,524288,1048576 $BUILD &&
busybox grep -q net.tcp.buffersize.umts=6144,87380,110208,6144,16384,110208 $BUILD
&& busybox grep -q
net.tcp.buffersize.wifi=524288,1048576,2097152,262144,524288,1048576 $BUILD
then
BUFF=$B"Big"$N
else
BUFF=$BL"Default"$N
fi
busybox clear
busybox echo -e $Y'Buffers >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT:$BUFF"$N
busybox echo -e $W"1. Default"$N
busybox echo -e $W"2. Big"$N
busybox echo -e $W"3. Small"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read BUFFER
case $BUFFER in
1)
busybox clear
busybox sed -i "/net.tcp.buffersize.default/d" $BUILD
busybox sed -i "/net.tcp.buffersize.edge/d" $BUILD
busybox sed -i "/net.tcp.buffersize.ethernet/d" $BUILD
busybox sed -i "/net.tcp.buffersize.evdo/d" $BUILD
busybox sed -i "/net.tcp.buffersize.gprs/d" $BUILD
busybox sed -i "/net.tcp.buffersize.hsdpa/d" $BUILD
busybox sed -i "/net.tcp.buffersize.hspa/d" $BUILD
busybox sed -i "/net.tcp.buffersize.hspap/d" $BUILD
busybox sed -i "/net.tcp.buffersize.hsupa/d" $BUILD
busybox sed -i "/net.tcp.buffersize.lte/d" $BUILD
busybox sed -i "/net.tcp.buffersize.umts/d" $BUILD
busybox sed -i "/net.tcp.buffersize.wifi/d" $BUILD
;;
2)
busybox clear
big_net_buffers
;;
3)
busybox clear
small_net_buffers
;;
0)
busybox clear
break
;;
esac
done
;;
3)
busybox clear
if [ -f $INIT/KI00Net_Tcp ]
then
busybox rm -f $INIT/KI00Net_Tcp
else
busybox rm -f $INIT/KI00Net_Tcp
busybox cp -f $CORE/KI00Net_Tcp $INIT/KI00Net_Tcp
busybox chmod 755 $INIT/KI00Net_Tcp
busybox chown 0:2000 $INIT/KI00Net_Tcp
fi
;;
4)
busybox clear
if [ -f $INIT/KI00Net_Speed+ ]
then
busybox rm -f $INIT/KI00Net_Speed+
else
busybox rm -f $INIT/KI00Net_Speed+
busybox cp -f $CORE/KI00Net_Speed+ $INIT/KI00Net_Speed+
busybox chmod 755 $INIT/KI00Net_Speed+
busybox chown 0:2000 $INIT/KI00Net_Speed+
fi
;;
5)
busybox clear
if [ ! -f $INIT/KI00Google_DNS ]
then
busybox rm -f $INIT/KI00Google_DNS
busybox cp -f $CORE/KI00Google_DNS $INIT/KI00Google_DNS
busybox chmod 755 $INIT/KI00Google_DNS
busybox chown 0:2000 $INIT/KI00Google_DNS
else
busybox rm -f $INIT/KI00Google_DNS
fi
google_dns
;;
6)
busybox clear
fast_streaming
;;
7)
busybox clear
fast_dormancy
;;
8)
busybox clear
arm_wideband
;;
9)
busybox clear
ipv4_support
;;
10)
busybox clear
ipv6_support
;;
11)
busybox clear
deep_ipv4
;;
12)
busybox clear
if [ -f $INIT/KI00SYN_Attacks ]
then
busybox rm -f $INIT/KI00SYN_Attacks
else
busybox rm -f $INIT/KI00SYN_Attacks
busybox cp -f $CORE/KI00SYN_Attacks $INIT/KI00SYN_Attacks
busybox chmod 755 $INIT/KI00SYN_Attacks
busybox chown 0:2000 $INIT/KI00SYN_Attacks
fi
;;
13)
busybox clear
if [ -f $INIT/KI00Block_Redirects ]
then
busybox rm -f $INIT/KI00Block_Redirects
else
busybox rm -f $INIT/KI00Block_Redirects
busybox cp -f $CORE/KI00Block_Redirects $INIT/KI00Block_Redirects
busybox chmod 755 $INIT/KI00Block_Redirects
busybox chown 0:2000 $INIT/KI00Block_Redirects
fi
;;
14)
busybox clear
if [ -f $INIT/KI00Avoid_Time ]
then
busybox rm -f $INIT/KI00Avoid_Time
else
busybox rm -f $INIT/KI00Avoid_Time
busybox cp -f $CORE/KI00Avoid_Time $INIT/KI00Avoid_Time
busybox chmod 755 $INIT/KI00Avoid_Time
busybox chown 0:2000 $INIT/KI00Avoid_Time
fi
;;
15)
busybox clear
if [ -f $INIT/KI00Block_Routing ]
then
busybox rm -f $INIT/KI00Block_Routing
else
busybox rm -f $INIT/KI00Block_Routing
busybox cp -f $CORE/KI00Block_Routing $INIT/KI00Block_Routing
busybox chmod 755 $INIT/KI00Block_Routing
busybox chown 0:2000 $INIT/KI00Block_Routing
fi
;;
0)
busybox clear
break
;;
esac
done
;;
7)
while :
do
if [ -f $INIT/KI00IOBoost ]
then
IOB=$G'On'$N
else
IOB=$R'Off'$N
fi
if [ -f $INIT/KI00IOQueue ]
then
IOQ=$G'On'$N
else
IOQ=$R'Off'$N
fi
if [ -f $INIT/KI00Partition_Remount ]
then
PR=$G'On'$N
else
PR=$R'Off'$N
fi
if [ -f $INIT/KI00Scudelar_Tuner ]
then
SCHD=$G'On'$N
else
SCHD=$R'Off'$N
fi
if [ -f $INIT/KI00SD_Tweak ]
then
SD=$G'On'$N
else
SD=$R'Off'$N
fi
busybox clear
busybox echo -e $Y'I/O Tweaks >>>'$N
busybox echo ''
busybox echo -e $W"1. I/O Boost | $IOB"$N
busybox echo -e $W"2. I/O Queue | $IOQ"$N
busybox echo -e $W"3. SD Tweak | $SD"$N
busybox echo -e $W"4. Scheduler Tuner | $SCHD"$N
busybox echo -e $W"5. Partition Remount | $PR"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read IOTWEAKS
case $IOTWEAKS in
1)
busybox clear
if [ -f $INIT/KI00IOBoost ]
then
busybox rm -f $INIT/KI00IOBoost
else
busybox rm -f $INIT/KI00IOBoost
busybox cp -f $CORE/KI00IOBoost $INIT/KI00IOBoost
busybox chmod 755 $INIT/KI00IOBoost
busybox chown 0:2000 $INIT/KI00IOBoost
fi
;;
2)
busybox clear
if [ -f $INIT/KI00IOQueue ]
then
busybox rm -f $INIT/KI00IOQueue
else
busybox rm -f $INIT/KI00IOQueue
busybox cp -f $CORE/KI00IOQueue $INIT/KI00IOQueue
busybox chmod 755 $INIT/KI00IOQueue
busybox chown 0:2000 $INIT/KI00IOQueue
fi
;;
3)
busybox clear
if [ -f $INIT/KI00SD_Tweak ]
then
busybox rm -f $INIT/KI00SD_Tweak
else
busybox rm -f $INIT/KI00SD_Tweak
busybox cp -f $CORE/KI00SD_Tweak $INIT/KI00SD_Tweak
busybox chmod 755 $INIT/KI00SD_Tweak
busybox chown 0:2000 $INIT/KI00SD_Tweak
fi
;;
4)
busybox clear
if [ -f $INIT/KI00Scudelar_Tuner ]
then
busybox rm -f $INIT/KI00Scudelar_Tuner
else
busybox rm -f $INIT/KI00Scudelar_Tuner
busybox cp -f $CORE/KI00Scudelar_Tuner $INIT/KI00Scudelar_Tuner
busybox chmod 755 $INIT/KI00Scudelar_Tuner
busybox chown 0:2000 $INIT/KI00Scudelar_Tuner
fi
;;
5)
busybox clear
if [ -f $INIT/KI00Partition_Remount ]
then
busybox rm -f $INIT/KI00Partition_Remount
else
busybox rm -f $INIT/KI00Partition_Remount
busybox cp -f $CORE/KI00Partition_Remount
$INIT/KI00Partition_Remount
busybox chmod 755 $INIT/KI00Partition_Remount
busybox chown 0:2000 $INIT/KI00Partition_Remount
fi
;;
0)
busybox clear
break
;;
esac
done
;;
8)
while :
do
busybox clear
busybox echo -e $Y'Virtual Memory >>>'$N
busybox echo ''
busybox echo -e $W"1. Memory Information"$N
busybox echo -e $W"2. Memory Management Tweaks"$N
busybox echo -e $W"3. Zram Option"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read VIRTUALMEMORY
case $VIRTUALMEMORY in
1)
busybox clear
busybox clear
busybox echo -e $Y'Memory Information >>>'$N
busybox echo ''
busybox cat /proc/meminfo
busybox echo ''
busybox echo -e $R"Tap enter to Go Back..."$N
read
;;
2)
while :
do
if [ -f $INIT/KI00OOM_Kill_Enabled ]
then
OOM=$G"Enabled"$N
elif [ -f $INIT/KI00OOM_Kill_Disabled ]
then
OOM=$R"Disable"$N
else
OOM=$BL"Default"$N
fi
if [ -f $INIT/KI00Cache_Reclaiming_Double ]
then
CR=$C"Double"$N
elif [ -f $INIT/KI00Cache_Reclaiming_Minimum ]
then
CR=$G"Minimum"$N
elif [ -f $INIT/KI00Cache_Reclaiming_Moderate ]
then
CR=$B"Moderate"$N
else
CR=$BL"Default"$N
fi
if [ -f $INIT/KI00Cache_Allocation_Large ]
then
CA=$C"Large"$N
elif [ -f $INIT/KI00Cache_Allocation_Medium ]
then
CA=$G"Medium"$N
else
CA=$BL"Default"$N
fi
if [ -f $INIT/KI00Swap_Disabled ]
then
SWAP=$G"Disabled"$N
elif [ -f $INIT/KI00Minimum_Swap ]
then
SWAP=$B"Minimum"$N
elif [ -f $INIT/KI00Conservative_Swap ]
then
SWAP=$C"Conservative"$N
elif [ -f $INIT/KI00Moderate_Swap ]
then
SWAP=$Y"Moderate"$N
elif [ -f $INIT/KI00Aggressive_Swap ]
then
SWAP=$P"Aggressive"$N
else
SWAP=$BL"Default"$N
fi
if busybox grep -q dalvik.vm.heaptargetutilization=0.75 $BUILD &&
busybox grep -q dalvik.vm.heapsize=272m $BUILD && busybox grep -q
dalvik.vm.heapgrowthlimit=68m $BUILD
then
HEAP=$G'On'$N
else
HEAP=$R'Off'$N
fi
if busybox grep -q dalvik.vm.check-dex-sum=false $BUILD && busybox grep
-q dalvik.vm.checkjni=false $BUILD && busybox grep -q dalvik.vm.execution-
mode=int:jit $BUILD && busybox grep -q dalvik.vm.dexopt-data-only=1 $BUILD &&
busybox grep -q dalvik.vm.verify-bytecode=false $BUILD && busybox grep -q
dalvik.vm.dexopt-flags=m=y $BUILD
then
RUN=$G'On'$N
else
RUN=$R'Off'$N
fi
busybox clear
busybox echo -e $Y'Memory Management Tweaks >>>'$N
busybox echo ''
busybox echo -e $W"1. OOM Killer | $OOM"$N
busybox echo -e $W"2. Cache Reclaiming | $CR"$N
busybox echo -e $W"3. Cache Allocation | $CA"$N
busybox echo -e $W"4. Swap-ping Tendency | $SWAP"$N
busybox echo -e $W"5. Heap Optimization | $HEAP"$N
busybox echo -e $W"6. Runtime Optimization | $RUN"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read MEMORYMANAGEMENT
case $MEMORYMANAGEMENT in
1)
while :
do
if [ -f $INIT/KI00OOM_Kill_Enabled ]
then
OOM=$G"Enabled"$N
elif [ -f $INIT/KI00OOM_Kill_Disabled ]
then
OOM=$R"Disable"$N
else
OOM=$BL"Default"$N
fi
busybox clear
busybox echo -e $Y'OOM Killer >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT:$OOM"$N
busybox echo -e $W"1. Default"$N
busybox echo -e $W"2. Enable"$N
busybox echo -e $W"3. Disable"$N
busybox echo -e $W"0. Go Back"$N
busybox echo -e -n $W"[CHOOSE] : "$N
read OOMKILLER
case $OOMKILLER in
1)
busybox clear
busybox rm -f $INIT/KI00OOM_Kill_Enabled
busybox rm -f $INIT/KI00OOM_Kill_Disabled
;;
2)
busybox clear
if [ -f $INIT/KI00OOM_Kill_Enabled ]
then
busybox rm -f $INIT/KI00OOM_Kill_Enabled
else
busybox rm -f $INIT/KI00OOM_Kill_Enabled
$busybix rm -f $INIT/KI00OOM_Kill_Disabled
busybox cp -f $CORE/KI00OOM_Kill_Enabled
$INIT/KI00OOM_Kill_Enabled
busybox chmod 755 $INIT/KI00OOM_Kill_Enabled
busybox chown 0:2000 $INIT/KI00OOM_Kill_Enabled
fi
;;
3)
busybox clear
if [ -f $INIT/KI00OOM_Kill_Disabled ]
then
$busybix rm -f $INIT/KI00OOM_Kill_Disabled
else
busybox rm -f $INIT/KI00OOM_Kill_Enabled
$busybix rm -f $INIT/KI00OOM_Kill_Disabled
busybox cp -f $CORE/KI00OOM_Kill_Disabled
$INIT/KI00OOM_Kill_Disabled
busybox chmod 755 $INIT/KI00OOM_Kill_Disabled
busybox chown 0:2000 $INIT/KI00OOM_Kill_Disabled
fi
;;
0)
busybox clear
break
;;
esac
done
;;
2)
while :
do
if [ -f $INIT/KI00Cache_Reclaiming_Double ]
then
CR=$C"Double"$N
elif [ -f $INIT/KI00Cache_Reclaiming_Minimum ]
then
CR=$G"Minimum"$N
elif [ -f $INIT/KI00Cache_Reclaiming_Moderate ]
then
CR=$B"Moderate"$N
else
CR=$BL"Default"$N
fi
busybox clear
busybox echo -e $Y'Cache Reclaiming >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT:$CR"$N
busybox echo -e $W"1. Default"$N
busybox echo -e $W"2. Minimum"$N
busybox echo -e $W"3. Moderate"$N
busybox echo -e $W"4. Double"$N
busybox echo -e $W"0. Go Back"$N
busybox echo -e -n $W"[CHOOSE] : "$N
read cachereclaiming
case $cachereclaiming in
1)
busybox clear
busybox rm -f $INIT/KI00Cache_Reclaiming_Moderate
busybox rm -f $INIT/KI00Cache_Reclaiming_Minimum
busybox rm -f $INIT/KI00Cache_Reclaiming_Double
;;
2)
busybox clear
if [ -f $INIT/KI00Cache_Reclaiming_Minimum ]
then
busybox rm -f $INIT/KI00Cache_Reclaiming_Minimum
else
busybox rm -f $INIT/KI00Cache_Reclaiming_Moderate
busybox rm -f $INIT/KI00Cache_Reclaiming_Minimum
busybox rm -f $INIT/KI00Cache_Reclaiming_Double
busybox cp -f $CORE/KI00Cache_Reclaiming_Minimum
$INIT/KI00Cache_Reclaiming_Minimum
busybox chmod 755 $INIT/KI00Cache_Reclaiming_Minimum
busybox chown 0:2000
$INIT/KI00Cache_Reclaiming_Minimum
fi
;;
3)
busybox clear
if [ -f $INIT/KI00Cache_Reclaiming_Moderate ]
then
busybox rm -f $INIT/KI00Cache_Reclaiming_Moderate
else
busybox rm -f $INIT/KI00Cache_Reclaiming_Moderate
busybox rm -f $INIT/KI00Cache_Reclaiming_Minimum
busybox rm -f $INIT/KI00Cache_Reclaiming_Double
busybox cp -f $CORE/KI00Cache_Reclaiming_Moderate
$INIT/KI00Cache_Reclaiming_Moderate
busybox chmod 755 $INIT/KI00Cache_Reclaiming_Moderate
busybox chown 0:2000
$INIT/KI00Cache_Reclaiming_Moderate
fi
;;
4)
busybox clear
if [ -f $INIT/KI00Cache_Reclaiming_Double ]
then
busybox rm -f $INIT/KI00Cache_Reclaiming_Double
else
busybox rm -f $INIT/KI00Cache_Reclaiming_Moderate
busybox rm -f $INIT/KI00Cache_Reclaiming_Minimum
busybox rm -f $INIT/KI00Cache_Reclaiming_Double
busybox cp -f $CORE/KI00Cache_Reclaiming_Double
$INIT/KI00Cache_Reclaiming_Double
busybox chmod 755 $INIT/KI00Cache_Reclaiming_Double
busybox chown 0:2000
$INIT/KI00Cache_Reclaiming_Double
fi
;;
0)
busybox clear
break
;;
esac
done
;;
3)
while :
do
if [ -f $INIT/KI00Cache_Allocation_Large ]
then
CA=$C"Large"$N
elif [ -f $INIT/KI00Cache_Allocation_Medium ]
then
CA=$G"Medium"$N
else
CA=$BL"Default"$N
fi
busybox clear
busybox echo -e $Y'Cache Allocation >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT:$CA"$N
busybox echo -e $W"1. Default"$N
busybox echo -e $W"2. Medium"$N
busybox echo -e $W"3. Large"$N
busybox echo -e $W"0. Go Back"$N
busybox echo -e -n $W"[CHOOSE] : "$N
read CACHEALLOCATION
case $CACHEALLOCATION in
1)
busybox clear
busybox rm -f $INIT/KI00Cache_Allocation_Medium
busybox rm -f $INIT/KI00Cache_Allocation_Large
;;
2)
busybox clear
if [ -f $INIT/KI00Cache_Allocation_Medium ]
then
busybox rm -f $INIT/KI00Cache_Allocation_Medium
else
busybox rm -f $INIT/KI00Cache_Allocation_Medium
busybox rm -f $INIT/KI00Cache_Allocation_Large
busybox cp -f $CORE/KI00Cache_Allocation_Medium
$INIT/KI00Cache_Allocation_Medium
busybox chmod 755 $INIT/KI00Cache_Allocation_Medium
busybox chown 0:2000
$INIT/KI00Cache_Allocation_Medium
fi
;;
3)
busybox clear
if [ -f $INIT/KI00Cache_Allocation_Large ]
then
busybox rm -f $INIT/KI00Cache_Allocation_Large
else
busybox rm -f $INIT/KI00Cache_Allocation_Medium
busybox rm -f $INIT/KI00Cache_Allocation_Large
busybox cp -f $CORE/KI00Cache_Allocation_Large
$INIT/KI00Cache_Allocation_Large
busybox chmod 755 $INIT/KI00Cache_Allocation_Large
busybox chown 0:2000 $INIT/KI00Cache_Allocation_Large
fi
;;
0)
busybox clear
break
;;
esac
done
;;
4)
while :
do
if [ -f $INIT/KI00Swap_Disabled ]
then
SWAP=$G"Disabled"$N
elif [ -f $INIT/KI00Minimum_Swap ]
then
SWAP=$B"Minimum"$N
elif [ -f $INIT/KI00Conservative_Swap ]
then
SWAP=$C"Conservative"$N
elif [ -f $INIT/KI00Moderate_Swap ]
then
SWAP=$Y"Moderate"$N
elif [ -f $INIT/KI00Aggressive_Swap ]
then
SWAP=$P"Aggressive"$N
else
SWAP=$BL"Default"$N
fi
busybox clear
busybox echo -e $Y'Swap-ping Tendency >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT:$SWAP"$N
busybox echo -e $W"1. Default"$N
busybox echo -e $W"2. Disabled"$N
busybox echo -e $W"3. Minimum"$N
busybox echo -e $W"4. Conservative"$N
busybox echo -e $W"5. Moderate"$N
busybox echo -e $W"6. Aggressive"$N
busybox echo -e $W"0. Go Back"$N
busybox echo -e -n $W"[CHOOSE] : "$N
read SWAPPING
case $SWAPPING in
1)
busybox clear
busybox rm -f $INIT/KI00Swap_Disable
busybox rm -f $INIT/KI00Minimum_Swap
busybox rm -f $INIT/KI00Conservative_Swap
busybox rm -f $INIT/KI00Moderate_Swap
busybox rm -f $INIT/KI00Aggressive_Swap
;;
2)
busybox clear
if [ -f $INIT/KI00Swap_Disabled ]
then
busybox rm -f $INIT/KI00Swap_Disabled
else
busybox rm -f $INIT/KI00Swap_Disabled
busybox rm -f $INIT/KI00Minimum_Swap
busybox rm -f $INIT/KI00Conservative_Swap
busybox rm -f $INIT/KI00Moderate_Swap
busybox rm -f $INIT/KI00Aggressive_Swap
busybox cp -f $CORE/KI00Swap_Disabled
$INIT/KI00Swap_Disabled
busybox chmod 755 $INIT/KI00Swap_Disabled
busybox chown 0:2000 $INIT/KI00Swap_Disabled
fi
;;
3)
busybox clear
if [ -f $INIT/KI00Minimum_Swap ]
then
busybox rm -f $INIT/KI00Minimum_Swap
else
busybox rm -f $INIT/KI00Swap_Disable
busybox rm -f $INIT/KI00Minimum_Swap
busybox rm -f $INIT/KI00Conservative_Swap
busybox rm -f $INIT/KI00Moderate_Swap
busybox rm -f $INIT/KI00Aggressive_Swap
busybox cp -f $CORE/KI00Minimum_Swap
$INIT/KI00Minimum_Swap
busybox chmod 755 $INIT/KI00Minimum_Swap
busybox chown 0:2000 $INIT/KI00Minimum_Swap
fi
;;
4)
busybox clear
if [ -f $INIT/KI00Conservative_Swap ]
then
busybox rm -f $INIT/KI00Conservative_Swap
else
busybox rm -f $INIT/KI00Swap_Disable
busybox rm -f $INIT/KI00Minimum_Swap
busybox rm -f $INIT/KI00Conservative_Swap
busybox rm -f $INIT/KI00Moderate_Swap
busybox rm -f $INIT/KI00Aggressive_Swap
busybox cp -f $CORE/KI00Conservative_Swap
$INIT/KI00Conservative_Swap
busybox chmod 755 $INIT/KI00Conservative_Swap
busybox chown 0:2000 $INIT/KI00Conservative_Swap
fi
;;
5)
busybox clear
if [ -f $INIT/KI00Moderate_Swap ]
then
busybox rm -f $INIT/KI00Moderate_Swap
else
busybox rm -f $INIT/KI00Swap_Disable
busybox rm -f $INIT/KI00Minimum_Swap
busybox rm -f $INIT/KI00Conservative_Swap
busybox rm -f $INIT/KI00Moderate_Swap
busybox rm -f $INIT/KI00Aggressive_Swap
busybox cp -f $CORE/KI00Moderate_Swap
$INIT/KI00Moderate_Swap
busybox chmod 755 $INIT/KI00Moderate_Swap
busybox chown 0:2000 $INIT/KI00Moderate_Swap
fi
;;
6)
busybox clear
if [ -f $INIT/KI00Aggressive_Swap ]
then
busybox rm -f $INIT/KI00Aggressive_Swap
else
busybox rm -f $INIT/KI00Swap_Disable
busybox rm -f $INIT/KI00Minimum_Swap
busybox rm -f $INIT/KI00Conservative_Swap
busybox rm -f $INIT/KI00Moderate_Swap
busybox rm -f $INIT/KI00Aggressive_Swap
busybox cp -f $CORE/KI00Aggressive_Swap
$INIT/KI00Aggressive_Swap
busybox chmod 755 $INIT/KI00Aggressive_Swap
busybox chown 0:2000 $INIT/KI00Aggressive_Swap
fi
;;
0)
busybox clear
break
;;
esac
done
;;
5)
busybox clear
heap_opt
;;
6)
busybox clear
runtime
;;
0)
busybox clear
break
;;
esac
done
;;
3)
while :
do
if [ -f $INIT/KI00Zram_Enabled ]
then
ZRAM=$G"Enabled"$N
elif [ -f $INIT/KI00Zram_Disabled ]
then
ZRAM=$R"Disabled"$N
else
ZRAM=$BL"Default"$N
fi
busybox clear
busybox echo -e $Y'Zram Options >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT:$ZRAM"$N
busybox echo -e $W"1. Default"$N
busybox echo -e $W"2. Enabled"$N
busybox echo -e $W"3. Disabled"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read ZRAMOPTION
case $ZRAMOPTION in
1)
busybox clear
busybox rm -f $INIT/KI00Zram_Enabled
busybox rm -f $INIT/KI00Zram_Disabled
;;
2)
busybox clear
if [ -f $INIT/KI00Zram_Enabled ]
then
busybox rm -f $INIT/KI00Zram_Enabled
else
busybox rm -f $INIT/KI00Zram_Enabled
busybox rm -f $INIT/KI00Zram_Disabled
busybox cp -f $CORE/KI00Zram_Enabled $INIT/KI00Zram_Enabled
busybox chmod 755 $INIT/KI00Zram_Enabled
busybox chown 0:2000 $INIT/KI00Zram_Enabled
fi
;;
3)
busybox clear
if [ -f $INIT/KI00Zram_Disabled ]
then
busybox rm -f $INIT/KI00Zram_Disabled
else
busybox rm -f $INIT/KI00Zram_Enabled
busybox rm -f $INIT/KI00Zram_Disabled
busybox cp -f $CORE/KI00Zram_Disabled
$INIT/KI00Zram_Disabled
busybox chmod 755 $INIT/KI00Zram_Disabled
busybox chown 0:2000 $INIT/KI00Zram_Disabled
fi
;;
0)
busybox clear
break
;;
esac
done
;;
0)
busybox clear
break
;;
esac
done
;;
9)
while :
do
if busybox grep -q ro.config.low_ram=true $BUILD
then
LOW=$G'On'$N
else
LOW=$R'Off'$N
fi
if [ -f $INIT/KI00Ram_Manager_Balance ]
then
LMK=$B"Balanced"$N
elif [ -f $INIT/KI00Ram_Manager_Gaming ]
then
LMK=$C"Gaming"$N
elif [ -f $INIT/KI00Ram_Manager_Multitasking ]
then
LMK=$G"Multitasking"$N
else
LMK=$BL"Default"$N
fi
if [ -f $INIT/KI00Ksm ]
then
KSM=$G"Enabled"$N
elif [ -f $INIT/KI00Ksm_Off ]
then
KSM=$R"Disabled"$N
else
KSM=$BL"Default"$N
fi
if busybox grep -q persist.sys.purgeable_assets=1 $BUILD
then
FRAM=$G"On"$N
else
FRAM=$R"Off"$N
fi
busybox clear
busybox echo -e $Y'Ram Manager >>>'$N
busybox echo ''
busybox echo -e $W"1. Ram Profile | $LMK"$N
busybox echo -e $W"2. Low Ram Flag | $LOW"$N
busybox echo -e $W"3. Ksm & uKsm | $KSM"$N
busybox echo -e $W"4. Cleanup Ram | $FRAM"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read rammanager
case $rammanager in
1)
while :
do
if [ -f $INIT/KI00Ram_Manager_Balance ]
then
LMK=$B"Balanced"$N
elif [ -f $INIT/KI00Ram_Manager_Gaming ]
then
LMK=$C"Gaming"$N
elif [ -f $INIT/KI00Ram_Manager_Multitasking ]
then
LMK=$G"Multitasking"$N
else
LMK=$BL"Default"$N
fi
busybox clear
busybox echo -e $Y'Ram Profile >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT:$LMK"$N
busybox echo -e $W"1. Default"$N
busybox echo -e $W"2. Multitasking"$N
busybox echo -e $W"3. Balanced"$N
busybox echo -e $W"4. Gaming"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read ramprofile
case $ramprofile in
1)
busybox clear
busybox rm -f $INIT/KI00Ram_Manager_Multitasking
busybox rm -f $INIT/KI00Ram_Manager_Balance
busybox rm -f $INIT/KI00Ram_Manager_Gaming
;;
2)
busybox clear
if [ -f $INIT/KI00Ram_Manager_Multitasking ]
then
busybox rm -f $INIT/KI00Ram_Manager_Multitasking
else
busybox rm -f $INIT/KI00Ram_Manager_Multitasking
busybox rm -f $INIT/KI00Ram_Manager_Balance
busybox rm -f $INIT/KI00Ram_Manager_Gaming
busybox cp -f $CORE/KI00Ram_Manager_Multitasking
$INIT/KI00Ram_Manager_Multitasking
busybox chmod 755 $INIT/KI00Ram_Manager_Multitasking
busybox chown 0:2000 $INIT/KI00Ram_Manager_Multitasking
ram_manager_multitasking
fi
;;
3)
busybox clear
if [ -f $INIT/KI00Ram_Manager_Balance ]
then
busybox rm -f $INIT/KI00Ram_Manager_Balance
else
busybox rm -f $INIT/KI00Ram_Manager_Multitasking
busybox rm -f $INIT/KI00Ram_Manager_Balance
busybox rm -f $INIT/KI00Ram_Manager_Gaming
busybox cp -f $CORE/KI00Ram_Manager_Balance
$INIT/KI00Ram_Manager_Balance
busybox chmod 755 $INIT/KI00Ram_Manager_Balance
busybox chown 0:2000 $INIT/KI00Ram_Manager_Balance
ram_manager_balance
fi
;;
4)
busybox clear
if [ -f $INIT/KI00Ram_Manager_Gaming ]
then
busybox rm -f $INIT/KI00Ram_Manager_Gaming
else
busybox rm -f $INIT/KI00Ram_Manager_Multitasking
busybox rm -f $INIT/KI00Ram_Manager_Balance
busybox rm -f $INIT/KI00Ram_Manager_Gaming
busybox cp -f $CORE/KI00Ram_Manager_Gaming
$INIT/KI00Ram_Manager_Gaming
busybox chmod 755 $INIT/KI00Ram_Manager_Gaming
busybox chown 0:2000 $INIT/KI00Ram_Manager_Gaming
ram_manager_gaming
fi
;;
0)
busybox clear
break
;;
esac
done
;;
2)
busybox clear
low_ram_flag
;;
3)
while :
do
if [ -f $INIT/KI00Ksm ]
then
KSM=$G"Enabled"$N
elif [ -f $INIT/KI00Ksm_Off ]
then
KSM=$R"Disabled"$N
else
KSM=$BL"Default"$N
fi
busybox clear
busybox echo -e $Y'Ksm & uKsm >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT:$KSM"$N
busybox echo -e $W"1. Default"$N
busybox echo -e $W"2. Enabled"$N
busybox echo -e $W"3. Disabled"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read ksmuksm
case $ksmuksm in
1)
busybox clear
busybox rm -f $INIT/KI00Ksm
busybox rm -f $INIT/KI00Ksm_Off
;;
2)
busybox clear
if [ -f $INIT/KI00Ksm ]
then
busybox rm -f $INIT/KI00Ksm
else
busybox rm -f $INIT/KI00Ksm
busybox cp -f $CORE/KI00Ksm $INIT/KI00Ksm
busybox chmod 755 $INIT/KI00Ksm
busybox chown 0:2000 $INIT/KI00Ksm
fi
;;
3)
busybox clear
if [ -f $INIT/KI00Ksm_Off ]
then
busybox rm -f $INIT/KI00Ksm_Off
else
busybox rm -f $INIT/KI00Ksm
busybox cp -f $CORE/KI00Ksm_Off $INIT/KI00Ksm_Off
busybox chmod 755 $INIT/KI00Ksm_Off
busybox chown 0:2000 $INIT/KI00Ksm_Off
fi
;;
0)
busybox clear
break
;;
esac
done
;;
4)
busybox clear
purge_ram
;;
0)
busybox clear
break
;;
esac
done
;;
10)
while :
do
if [ -f $INIT/KI00Disabled_Debugging ]
then
DD=$G'On'$N
else
DD=$R'Off'$N
fi
if [ -f $INIT/KI00Disabled_IO_Stats ]
then
DIO=$G'On'$N
else
DIO=$R'Off'$N
fi
if [ -f $INIT/KI00Kernel_Panic ]
then
DKP=$G'On'$N
else
DKP=$R'Off'$N
fi
busybox clear
busybox echo -e $Y'Debugging >>>'$N
busybox echo ''
busybox echo -e $W"1. Disable I/O Stats | $DIO"$N
busybox echo -e $W"2. Disable Debugging | $DD"$N
busybox echo -e $W"3. Disable Kernel Panic | $DKP"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read DEBUGGING
case $DEBUGGING in
1)
busybox clear
if [ -f $INIT/KI00Disabled_IO_Stats ]
then
busybox rm -f $INIT/KI00Disabled_IO_Stats
else
busybox rm -f $INIT/KI00Disabled_IO_Stats
busybox cp -f $CORE/KI00Disabled_IO_Stats
$INIT/KI00Disabled_IO_Stats
busybox chmod 755 $INIT/KI00Disabled_IO_Stats
busybox chown 0:0 $INIT/KI00Disabled_IO_Stats
fi
;;
2)
busybox clear
if [ -f $INIT/KI00Disabled_Debugging ]
then
busybox rm -f $INIT/KI00Disabled_Debugging
else
busybox rm -f $INIT/KI00Disabled_Debugging
busybox cp -f $CORE/KI00Disabled_Debugging
$INIT/KI00Disabled_Debugging
busybox chmod 755 $INIT/KI00Disabled_Debugging
busybox chown 0:0 $INIT/KI00Disabled_Debugging
fi
;;
3)
busybox clear
if [ -f $INIT/KI00Kernel_Panic ]
then
busybox rm -f $INIT/KI00Kernel_Panic
else
busybox rm -f $INIT/KI00Kernel_Panic
busybox cp -f $CORE/KI00Kernel_Panic $INIT/KI00Kernel_Panic
busybox chmod 755 $INIT/KI00Kernel_Panic
busybox chown 0:0 $INIT/KI00Kernel_Panic
fi
;;
0)
busybox clear
break
;;
esac
done
;;
11)
while :
do
if [ -f $INIT/KI00Clean_Master ]; then
CLM=$G'On'$N
else
CLM=$R'Off'$N
fi
busybox clear
busybox echo -e $Y'Cleaner >>>'$N
busybox echo ''
busybox echo -e $W"1. Clean Junk Files Now"$N
busybox echo -e $W"2. Clean App Cache"$N
busybox echo -e $W"3. Set Cleaner On Boot | $CLM"$N
busybox echo -e $W"4. Wipe Cache Partition"$N
busybox echo -e $W"5. Wipe Dalvik-cache"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read CLEANMASTER
case $CLEANMASTER in
1)
busybox clear
busybox echo -e $C"Cleaning Junk Files"$N
busybox sleep 1
busybox echo ''
busybox echo -e $R"Please wait!!!"$N
clean_master
busybox echo ''
busybox echo -e $G"Cleaning is done"$N
busybox sleep 2
;;
2)
busybox clear
busybox echo -e $C"Cleaning app cache"$N
busybox sleep 1
busybox echo ''
busybox echo -e $R"Please wait!!!"$N
CACHE_DIR=$(busybox find / -type d -iname ./cache* 2>/dev/null)
for dir in ${CACHE_DIR[*]}; do
busybox find "$dir" -type f -delete 2>/dev/null
done
busybox echo ''
busybox echo -e $G"Cleaning is done"$N
busybox sleep 2
;;
3)
busybox clear
if [ -f $INIT/KI00Clean_Master ]; then
busybox rm -f $INIT/KI00Clean_Master
else
busybox rm -f $INIT/KI00Clean_Master
busybox cp -f $CORE/KI00Clean_Master $INIT/KI00Clean_Master
busybox chmod 755 $INIT/KI00Clean_Master
busybox chown 0:2000 $INIT/KI00Clean_Master
fi
;;
4)
while :
do
busybox clear
busybox echo -e $R"Wiping cache parttion..."$N
busybox echo ''
busybox echo ''
busybox sleep 1
busybox rm -rf /cache/*
busybox echo -e $G"dalvik-cache partition wiped"$N
busybox echo ''
busybox sleep 3
busybox clear
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P"Rebooting device"$N
busybox echo -e $R"5"$N
busybox sleep 1
busybox echo -e $P"4"$N
busybox sleep 1
busybox echo -e $B"3"$N
busybox sleep 1
busybox echo -e $C"2"$N
busybox sleep 1
busybox echo -e $G"1"$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
5)
while :
do
busybox clear
busybox echo -e $R"Wiping dalvik-cache parttion..."$N
busybox echo ''
busybox echo ''
busybox sleep 1
busybox rm -rf /data/dalvik-cache/*
busybox echo -e $G"dalvik-cache partition wiped"$N
busybox echo ''
busybox sleep 3
busybox clear
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P"Rebooting device"$N
busybox echo -e $R"5"$N
busybox sleep 1
busybox echo -e $P"4"$N
busybox sleep 1
busybox echo -e $B"3"$N
busybox sleep 1
busybox echo -e $C"2"$N
busybox sleep 1
busybox echo -e $G"1"$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
0)
busybox clear
break
;;
esac
done
;;
12)
while :
do
if [ -f $SuperSu ] || [ -f $MAGISK ]
then
INITD=$G"Enabled By KITANA"$N
elif [ -f $SYSINIT_BIN ] || [ -f $SYSINIT_XBIN ]
then
INITD=$B"Enabled By Default"$N
else
INITD=$BL"Unknown"$N
fi
if busybox grep -q ro.opa.eligible_device=true $BUILD
then
GAL=$G"Enabled"$N
else
GAL=$R"Disabled"$N
fi
if [ -f $INIT/KI00Entropy_Light ]
then
SEEDER=$C'Light'$N
elif [ -f $INIT/KI00Entropy_Enlarger ]
then
SEEDER=$G'Enlarger'$N
elif [ -f $INIT/KI00Entropy_Moderate ]
then
SEEDER=$B'Moderate'$N
elif [ -f $INIT/KI00Entropy_Aggressive ]
then
SEEDER=$P'Aggressive'$N
else
SEEDER=$BL'Default'$N
fi
if busybox grep -q dalvik.vm.image-dex2oat-filter=interpret-only $BUILD
then
ART=$G"Interpret-Only"$N
elif busybox grep -q dalvik.vm.image-dex2oat-filter=speed $BUILD
then
ART=$B"Speed"$N
elif busybox grep -q dalvik.vm.image-dex2oat-filter=balanced $BUILD
then
ART=$C"Balanced"$N
elif busybox grep -q dalvik.vm.image-dex2oat-filter=space $BUILD
then
ART=$Y"Space"$N
elif busybox grep -q dalvik.vm.image-dex2oat-filter=everything $BUILD
then
ART=$P"Everything"$N
elif busybox grep -q dalvik.vm.image-dex2oat-filter=verify-none $BUILD
then
ART=$R"Verify-None"$N
else
ART=$BL"Default"$N
fi
if busybox grep -q adblocker $ETC/hosts > /dev/null 2>&1;
then
ADB=$G"Enabled"$N
else
ADB=$R"Disabled"$N
fi
HNAME=$(getprop net.hostname)
HOST=$G"$HNAME"$N
BUILD_DPI=$(wm density)
LCD_DPI=$BUILD_DPI
if busybox grep -q KITANA $ETC/sysconfig/google_build.xml > /dev/null 2>&1 &&
busybox grep -q KITANA $ETC/sysconfig/nexus.xml > /dev/null 2>&1;
then
HACK=$G"Enabled"$N
elif busybox grep -q ! KITANA $ETC/sysconfig/google_build.xml > /dev/null
2>&1 && busybox grep -q ! KITANA $ETC/sysconfig/nexus.xml > /dev/null 2>&1;
then
HACK=$R"Disabled"$N
else
HACK=$BL"Unknown"$N
fi
FRAMEM=$(settings get global enable_freeform_support)
if [ "$FRAMEM" == "0" ]
then
FREEFM=$R"Disabled"$N
elif [ "$FRAMEM" == "1" ]
then
FREEFM=$G"Enabled"$N
else
FREEFM=$BL"Unknown/Null"$N
fi
current_value=$(pm get-install-location | tr -d "[a-z]")
if [ "$current_value" == '0' ]
then
LOCATION=$G"Auto"$N
elif [ "$current_value" == '1' ]
then
LOCATION=$B"Internal"$N
elif [ "$current_value" == '2' ]
then
LOCATION=$C"External"$N
else
LOCATION=$BL"Unknown/Null"$N
fi
if busybox grep -q KITANA $ETC/sysconfig/google_build.xml > /dev/null 2>&1 &&
busybox grep -q KITANA $ETC/sysconfig/nexus.xml > /dev/null 2>&1 && busybox grep -q
KITANA $ETC/sysconfig/pixel_2017_exclusive.xml > /dev/null 2>&1 && busybox grep -q
KITANA $ETC/sysconfig/pixel_2017.xml > /dev/null 2>&1;
then
LENS=$G'On'$N
else
LENS=$R'Off'$N
fi
busybox clear
busybox echo -e $Y'Advanced Options >>>'$N
busybox echo ''
busybox echo -e $W"1. Init.d Support | $INITD"$N
busybox echo -e $W"2. Google Assistant | $GAL"$N
busybox echo -e $W"3. ART Compiler Filter | $ART"$N
busybox echo -e $W"4. Entropy Generator | $SEEDER"$N
busybox echo -e $W"5. Controls"$N
busybox echo -e $W"6. SD Card R/W Fix"$N
busybox echo -e $W"7. DPI Changer | $LCD_DPI"$N
busybox echo -e $W"8. Ad Blocker | $ADB"$N
busybox echo -e $W"9. Hostname Changer | $HOST"$N
busybox echo -e $W"10.G Drive Space Hack | $HACK"$N
busybox echo -e $W"11.Free Frame Mode | $FREEFM"$N
busybox echo -e $W"12.View WiFi Passwords"$N
busybox echo -e $W"13.Apps Install Location | $LOCATION"$N
busybox echo -e $W"14.Google lens Hack | $LENS"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read ADVANCEDOPTIONS
case $ADVANCEDOPTIONS in
1)
busybox clear
busybox echo -e $G"KITANA init.d installer/uninstaller is running..."$N
busybox sleep 1
busybox echo -e $C"Please Wait"$N
busybox sleep 1
busybox echo -e $Y'Scanning Your System'$N
busybox sleep 2
if [ -e /data/data/eu.chainfire.supersu ] || [ -d /su ]; then
if [ ! -f "$SuperSu" ]
then
busybox rm -f $SYSINIT_BIN
busybox rm -f $SYSINIT_XBIN
busybox echo -e $G'Installing KITANA init.d support...'$N
busybox rm -f $MAGISK > /dev/null 2>&1;
busybox rm -f $SuperSu > /dev/null 2>&1;
if [ ! -d /system/su.d ]
then
busybox mkdir -p /system/su.d > /dev/null 2>&1;
busybox chmod 700 /system/su.d > /dev/null 2>&1;
busybox chown 0:0 /system/su.d > /dev/null 2>&1;
fi
busybox cp -f $CORE'/KI00Init.d' $SuperSu > /dev/null 2>&1;
busybox chmod 700 $SuperSu > /dev/null 2>&1;
busybox chown 0:2000 $SuperSu > /dev/null 2>&1;
busybox sleep 2
busybox echo -e $G'OK done'$N
busybox sleep 1
else
busybox echo -e $R'Removing KITANA init.d support...'$N
busybox rm -f $SuperSu > /dev/null 2>&1;
busybox sleep 2
busybox echo -e $R'OK done'$N
busybox sleep 1
fi
elif [ -d /magisk ]; then
if [ ! -f "$MAGISK" ]
then
busybox rm -f $SYSINIT_BIN
busybox rm -f $SYSINIT_XBIN
busybox echo -e $G'Installing KITANA init.d support...'$N
busybox rm -f $MAGISK > /dev/null 2>&1;
busybox rm -f $MAGISK > /dev/null 2>&1;
if [ ! -d /magisk/.core ]
then
mount -o rw,remount,rw /magisk > /dev/null 2>&1;
busybox mkdir -p /magisk/.core
busybox chmod 755 /magisk/.core
busybox chown 0:0 /magisk/.core
busybox mkdir -p /magisk/.core/service.d
busybox chmod 755 /magisk/.core/service.d
busybox chown 0:0 /magisk/.core/service.d
fi
busybox cp -f $CORE'/KI00Init.d' $MAGISK > /dev/null 2>&1;
busybox chmod 700 $MAGISK > /dev/null 2>&1;
busybox chown 0:2000 $MAGISK > /dev/null 2>&1;
busybox sleep 2
busybox echo -e $G'OK done'$N
busybox sleep 1
else
busybox echo -e $R'Removing KITANA init.d support...'$N
busybox rm -f $MAGISK > /dev/null 2>&1;
busybox sleep 2
busybox echo -e $R'OK done'$N
busybox sleep 1
fi
else
busybox clear
busybox sleep 0.5
busybox echo -e $R'Need SuperSu/Magisk rooted Devices'$N
busybox sleep 2
fi
;;
2)
busybox clear
if [ "$SDK" -ge '24' ]
then
if busybox grep -q ro.opa.eligible_device=true $BUILD
then
busybox sed -i '/ro.opa.eligible_device=true/d' $BUILD
else
busybox sed -i '/ro.opa.eligible_device=true/d' $BUILD
busybox echo 'ro.opa.eligible_device=true' >> $BUILD
fi
else
busybox echo -e $R"Need Android 7.0+ Android Version"$N
busybox sleep 2
fi
;;
3)
if [ "$SDK" -ge "21" ]
then
while :
do
if busybox grep -q dalvik.vm.image-dex2oat-filter=interpret-only $BUILD
then
ART=$G"Interpret-Only"$N
elif busybox grep -q dalvik.vm.image-dex2oat-filter=speed $BUILD
then
ART=$B"Speed"$N
elif busybox grep -q dalvik.vm.image-dex2oat-filter=balanced $BUILD
then
ART=$C"Balanced"$N
elif busybox grep -q dalvik.vm.image-dex2oat-filter=space $BUILD
then
ART=$Y"Space"$N
elif busybox grep -q dalvik.vm.image-dex2oat-filter=everything $BUILD
then
ART=$P"Everything"$N
elif busybox grep -q dalvik.vm.image-dex2oat-filter=verify-none $BUILD
then
ART=$R"Verify-None"$N
else
ART=$BL"Default"$N
fi
busybox clear
busybox echo -e $Y'ART Compiler Filter >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT:$ART"$N
busybox echo -e $W"1. Default"$N
busybox echo -e $W"2. Interpret-Only"$N
busybox echo -e $W"3. Speed"$N
busybox echo -e $W"4. Balanced"$N
busybox echo -e $W"5. Space"$N
busybox echo -e $W"6. Everything"$N
busybox echo -e $W"7. Verify-None"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read ARTCOMPILERFILTER
case $ARTCOMPILERFILTER in
1)
while :
do
art_default
busybox clear
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
2)
while :
do
art_interpret_only
busybox clear
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
3)
while :
do
art_speed
busybox clear
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
4)
while :
do
art_balanced
busybox clear
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
5)
while :
do
art_space
busybox clear
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
6)
while :
do
art_everything
busybox clear
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
7)
while :
do
art_verify_none
busybox clear
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
0)
busybox clear
break
;;
esac
done
else
busybox echo -e $R'Not Possible Need Lollipop + Android
Version'$N
busybox sleep 5
fi
;;
4)
while :
do
if [ -f $INIT/KI00Entropy_Light ]
then
SEEDER=$C'Light'$N
elif [ -f $INIT/KI00Entropy_Enlarger ]
then
SEEDER=$G'Enlarger'$N
elif [ -f $INIT/KI00Entropy_Moderate ]
then
SEEDER=$B'Moderate'$N
elif [ -f $INIT/KI00Entropy_Aggressive ]
then
SEEDER=$P'Aggressive'$N
else
SEEDER=$BL'Default'$N
fi
busybox clear
busybox echo -e $Y'Entropy Generator >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT:$SEEDER"
busybox echo -e $W'1. Default'$N
busybox echo -e $W'2. Light'$N
busybox echo -e $W'3. Enlarger'$N
busybox echo -e $W'4. Moderate'$N
busybox echo -e $W'5. Aggressive'$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read ENTROPYSEEDER
case $ENTROPYSEEDER in
1)
busybox clear
seeder_default
;;
2)
busybox clear
seeder_light
;;
3)
busybox clear
seeder_enlarger
;;
4)
busybox clear
seeder_moderate
;;
5)
busybox clear
seeder_aggressive
;;
0)
busybox clear
break
;;
esac
done
;;
5)
while :
do
busybox clear
busybox echo -e $Y'Controls >>>'$N
busybox echo ''
busybox echo -e $W"1. CPU Governor"$N
busybox echo -e $W"2. I/O Scheduler"$N
busybox echo -e $W"3. TCP Congestion Algorithm"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read CONTROLS
case $CONTROLS in
1)
busybox clear
cpu_governor
;;
2)
busybox clear
io_schedule
;;
3)
busybox clear
tcp_algorithm
;;
0)
busybox clear
break
;;
esac
done
;;
6)
while :
do
busybox clear
busybox echo -e $B'Please Wait'$N
busybox sleep 1
if [ -f $ETC/permissions/platform.xml ]
then
busybox sed -i '/<permission
name="android.permission.WRITE_MEDIA_STORAGE" >/a <group gid="media_rw" />'
$ETC/permissions/platform.xml > /dev/null 2>&1;
busybox sed -i '/<permission
name="android.permission.WRITE_EXTERNAL_STORAGE" >/a <group gid="media_rw" />'
$ETC/permissions/platform.xml > /dev/null 2>&1;
busybox sed -i '/<permission
name="android.permission.WRITE_MEDIA_STORAGE">/a <group gid="media_rw" />'
$ETC/permissions/platform.xml > /dev/null 2>&1;
busybox sed -i '/<permission
name="android.permission.WRITE_EXTERNAL_STORAGE">/a <group gid="media_rw" />'
$ETC/permissions/platform.xml > /dev/null 2>&1;
fi
if [ -f /data/system/packages.xml ]
then
busybox sed -i 's~<perms>~<perms><item
name="android.permission.WRITE_MEDIA_STORAGE" granted="true" flags="0" />~g'
/data/system/packages.xml > /dev/null 2>&1;
busybox sed -i 's~<perms><item
name="android.permission.WRITE_MEDIA_STORAGE" granted="true" flags="0"
/>~<perms>~g' /data/system/packages.xml > /dev/null 2>&1;
fi
busybox sleep 1
busybox echo -e $G'OK done'$N
busybox sleep 2
busybox clear
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P"Rebooting device"$N
busybox echo -e $R"5"$N
busybox sleep 1
busybox echo -e $P"4"$N
busybox sleep 1
busybox echo -e $B"3"$N
busybox sleep 1
busybox echo -e $C"2"$N
busybox sleep 1
busybox echo -e $G"1"$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
7)
while :
do
BUILD_DPI=$(wm density)
LCD_DPI=$BUILD_DPI
busybox clear
busybox echo -e $Y'DPI Changer >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT:$LCD_DPI"$N
busybox echo -e $W"1. Default"$N
busybox echo -e $W"2. 120 DPI"$N
busybox echo -e $W"3. 160 DPI"$N
busybox echo -e $W"4. 240 DPI"$N
busybox echo -e $W"5. 320 DPI"$N
busybox echo -e $W"6. 360 DPI"$N
busybox echo -e $W"7. 390 DPI"$N
busybox echo -e $W"8. 420 DPI"$N
busybox echo -e $W"9. Custom DPI"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read DPICHANGER
case $DPICHANGER in
1)
while :
do
DDPI=$(busybox cat $BACKUP/KI00Backup_DPI)
busybox clear
busybox sed -i "/ro.sf.lcd_density/d" $BUILD
busybox echo "ro.sf.lcd_density"=$DDPI >> $BUILD
wm density $DDPI
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
2)
while :
do
busybox clear
busybox sed -i "/ro.sf.lcd_density/d" $BUILD
busybox echo "ro.sf.lcd_density"=120 >> $BUILD
wm density 120
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
3)
while :
do
busybox clear
busybox sed -i "/ro.sf.lcd_density/d" $BUILD
busybox echo "ro.sf.lcd_density"=160 >> $BUILD
wm density 160
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
4)
while :
do
busybox clear
busybox sed -i "/ro.sf.lcd_density/d" $BUILD
busybox echo "ro.sf.lcd_density"=240 >> $BUILD
wm density 240
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
5)
while :
do
busybox clear
busybox sed -i "/ro.sf.lcd_density/d" $BUILD
busybox echo "ro.sf.lcd_density"=320 >> $BUILD
wm density 320
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
6)
while :
do
busybox clear
busybox sed -i "/ro.sf.lcd_density/d" $BUILD
busybox echo "ro.sf.lcd_density"=360 >> $BUILD
wm density 360
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
7)
while :
do
busybox clear
busybox sed -i "/ro.sf.lcd_density/d" $BUILD
busybox echo "ro.sf.lcd_density"=390 >> $BUILD
wm density 390
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
8)
while :
do
busybox clear
busybox sed -i "/ro.sf.lcd_density/d" $BUILD
busybox echo "ro.sf.lcd_density"=420 >> $BUILD
wm density 420
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
9)
while :
do
busybox clear
custom_dpi
busybox clear
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
0)
busybox clear
break
;;
esac
done
;;
8)
while :
do
if busybox grep -q adblocker $ETC/hosts > /dev/null 2>&1;
then
ADB=$G"Enabled"$N
else
ADB=$R"Disabled"$N
fi
busybox clear
busybox echo -e $Y'Reboot Options >>>'$N
busybox echo -e $Y'info: Internet connection is required'$N
busybox echo ''
busybox echo -e $W"CURRENT:$ADB"$N
busybox echo -e $W"1. Enable/Update"$N
busybox echo -e $W"2. Disable"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read ADBLOCKER
case $ADBLOCKER in
1)
busybox clear
busybox rm -rf /system/etc/hosts
busybox wget -O /system/etc/host3
"http://pgl.yoyo.org/adservers/serverlist.php?
hostformat=hosts&showintro=0&mimetype=plaintext"
busybox wget -O /system/etc/host2 "http://hosts-
file.net/ad_servers.txt"
busybox cat /system/etc/host3 >> /system/etc/host2; busybox rm -rf
/system/etc/host3
busybox wget -O /system/etc/host1
"http://winhelp2002.mvps.org/hosts.txt"
busybox cat /system/etc/host2 >> /system/etc/host1; busybox rm -rf
/system/etc/host2
busybox sed '/^#/ d' /system/etc/host1 > /system/etc/host;
busybox rm -rf /system/etc/host1
busybox sort /system/etc/host | busybox uniq -u > /system/etc/hosts;
busybox rm -rf /system/etc/host
busybox sed '/localhost/d' /system/etc/hosts > /system/etc/host;
busybox rm -rf /system/etc/hosts
busybox sed -i -e 's/0.0.0.0/127.0.0.1/g' /system/etc/host; busybox sed
-i '1i #adblocker' /system/etc/host
busybox sed -i '2i 127.0.0.1 localhost' /system/etc/host; busybox sed
-i '3i ::1 localhost' /system/etc/host
busybox awk '{$1=$1}1' OFS=" " /system/etc/host > /system/etc/hosts
busybox sed -i -e '$a\' /system/etc/hosts
busybox rm -rf '/system/etc/host'
busybox chmod 644 '/system/etc/hosts'
busybox chown 0:0 '/system/etc/hosts'
;;
2)
busybox clear
busybox rm -f $ETC/hosts
busybox touch $ETC/hosts
busybox chmod 755 $ETC/hosts
busybox chown 0:0 $ETC/hosts
busybox echo "127.0.0.1 localhost" >> $ETC/hosts
busybox chmod 644 $ETC/hosts
;;
0)
busybox clear
break
;;
esac
done
;;
9)
while :
do
HNAME=$(getprop net.hostname)
HOST=$G"$HNAME"$N
busybox clear
busybox echo -e $Y'Hostname Changer >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT : $HOST"$N
busybox echo -e $W"1. Default"$N
busybox echo -e $W"2. Open Hostname Changer"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read HOSTNAME
case $HOSTNAME in
1)
busybox clear
oldhost=$(busybox cat $BACKUP/KI00Host)
setprop net.hostname $oldhost
busybox rm -f $INIT/KI00Hostsname
;;
2)
busybox clear
busybox echo -e $C"Please Use A Good Name"$N
busybox echo -e -n $W"[CHOOSE] : "$N
read NEWHOST
busybox echo $NEWHOST > $BACKUP/KI00Custom_Host
ALLNEWHOST=$(busybox cat $BACKUP/KI00Custom_Host | tr -d
"[[:blank:]]")
setprop net.hostname $ALLNEWHOST
busybox rm -f $INIT/KI00Host_Name
busybox cp -f $CORE/KI00Host_Name $INIT/KI00Host_Name
busybox chmod 755 $INIT/KI00Host_Name
busybox chown 0:2000 $INIT/KI00Host_Name
;;
0)
busybox clear
break
;;
esac
done
;;
10)
while :
do
if busybox grep -q KITANA $ETC/sysconfig/google_build.xml > /dev/null
2>&1 && busybox grep -q KITANA $ETC/sysconfig/nexus.xml > /dev/null 2>&1;
then
HACK=$G"Enabled"$N
elif busybox grep -q ! KITANA $ETC/sysconfig/google_build.xml >
/dev/null 2>&1 && busybox grep -q ! KITANA $ETC/sysconfig/nexus.xml > /dev/null
2>&1;
then
HACK=$R"Disabled"$N
else
HACK=$BL'Default'$N
fi
busybox clear
busybox echo -e $Y'G Drive Space Hack >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT : $HACK"$N
busybox echo -e $W"1. Enable"$N
busybox echo -e $W"2. Disable"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read GSHACK
case $GSHACK in
1)
while :
do
busybox clear
if [ -f $CORE/KI00Google_Build ]
then
busybox rm -f $ETC/sysconfig/google_build.xml
busybox rm -f $ETC/sysconfig/nexus.xml
busybox cp -f $CORE/KI00Google_Build
$ETC/sysconfig/google_build.xml
busybox chmod 644 $ETC/sysconfig/google_build.xml
busybox chown 0:0 $ETC/sysconfig/google_build.xml
fi
if [ -f $CORE/KI00Nexus ]
then
busybox cp -f $CORE/KI00Nexus $ETC/sysconfig/nexus.xml
busybox chmod 644 $ETC/sysconfig/nexus.xml
busybox chown 0:0 $ETC/sysconfig/nexus.xml
fi
busybox rm -rf /cache/*
busybox rm -rf /data/dalvik-cache/*
busybox clear
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
2)
while :
do
busybox clear
if [ -f $BACKUP/KI00Google_Build.xml ]
then
busybox rm -f $ETC/sysconfig/google_build.xml
busybox rm -f $ETC/sysconfig/nexus.xml
busybox cp -f $BACKUP/KI00Google_Build.xml
$ETC/sysconfig/google_build.xml
busybox chmod 644 $ETC/sysconfig/google_build.xml
busybox chown 0:0 $ETC/sysconfig/google_build.xml
fi
if [ -f $BACKUP/KI00Nexus.xml ]
then
busybox rm -f $ETC/sysconfig/nexus.xml
busybox cp -f $BACKUP/KI00Nexus.xml $ETC/sysconfig/nexus.xml
busybox chmod 644 $ETC/sysconfig/nexus.xml
busybox chown 0:0 $ETC/sysconfig/nexus.xml
fi
busybox rm -rf /cache/*
busybox rm -rf /data/dalvik-cache/*
busybox clear
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P'Rebooting device'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
;;
0)
busybox clear
break
;;
esac
done
;;
11)
if [ "$SDK" -ge "24" ]
then
while :
do
busybox clear
FRFM=$(settings get global enable_freeform_support) > /dev/null 2>&1;
free_form
busybox clear
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P"Rebooting device"$N
busybox echo -e $R"5"$N
busybox sleep 1
busybox echo -e $P"4"$N
busybox sleep 1
busybox echo -e $B"3"$N
busybox sleep 1
busybox echo -e $C"2"$N
busybox sleep 1
busybox echo -e $G"1"$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
else
busybox echo -e $R'Free Frame Mode Only Available For Android 7 +
Version'$N
busybox sleep 2
fi
;;
12)
ssid="grep ssid="*" /data/misc/wifi/wpa_supplicant.conf" > dev/null
psk="grep psk="*" /data/misc/wifi/wpa_supplicant.conf" > dev/null
key_mgmt="grep key_mgmt="*" /data/misc/wifi/wpa_supplicant.conf" >
dev/null
while :
do
busybox clear;
busybox echo ''
busybox echo -e $Y"Wifi names"$N
$ssid
busybox echo ''
busybox echo -e $P"wifi passwords"$N
$psk
busybox echo ''
busybox echo -e $R"Security type"$N
$key_mgmt
busybox echo ''
busybox echo -e -n $W"Options:[ Export to SD = 1 | Go Back = 0 ] : "$N
read WIFI
case $WIFI in
1)
busybox echo ''
busybox echo "Wifi names" > /sdcard/PASS.export
busybox grep ssid /data/misc/wifi/wpa_supplicant.conf >>
/sdcard/PASS.export
busybox echo '' >> /sdcard/PASS.export
busybox echo "Wifi passwords" >> /sdcard/PASS.export
busybox grep psk /data/misc/wifi/wpa_supplicant.conf >>
/sdcard/PASS.export
busybox echo '' >> /sdcard/PASS.export
busybox echo "Security type" >> /sdcard/PASS.export
busybox grep key_mgmt /data/misc/wifi/wpa_supplicant.conf >>
/sdcard/PASS.export
busybox echo "Exporting finished"
busybox sleep 1
;;
0)
busybox clear
break
;;
esac
done
;;
13)
while :
do
current_value=$(pm get-install-location | tr -d "[a-z]")
if [ "$current_value" == '0' ]
then
LOCATION=$G"Auto"$N
elif [ "$current_value" == '1' ]
then
LOCATION=$B"Internal"$N
elif [ "$current_value" == '2' ]
then
LOCATION=$C"External"$N
else
LOCATION=$BL"Unknown/Null"$N
fi
busybox clear
busybox echo -e $Y'Apps Install Location >>>'$N
busybox echo ''
busybox echo -e $W"CURRENT:$LOCATION"$N
busybox echo -e $W"1. Auto/Default"$N
busybox echo -e $W"2. Internal"$N
busybox echo -e $W"3. External"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read INSTALLLOCATION
case $INSTALLLOCATION in
1)
busybox clear
pm set-install-location 0 > /dev/null 2>&1;
;;
2)
busybox clear
pm set-install-location 1 > /dev/null 2>&1;
;;
3)
busybox clear
pm set-install-location 2 > /dev/null 2>&1;
;;
0)
busybox clear
break
;;
esac
done
;;
14)
if [ "$SDK" -ge '24' ]
then
while :
do
if busybox grep -q KITANA $ETC/sysconfig/google_build.xml > /dev/null
2>&1 && busybox grep -q KITANA $ETC/sysconfig/nexus.xml > /dev/null 2>&1 && busybox
grep -q KITANA $ETC/sysconfig/pixel_2017_exclusive.xml > /dev/null 2>&1 && busybox
grep -q KITANA $ETC/sysconfig/pixel_2017.xml > /dev/null 2>&1;
then
busybox rm -f $ETC/sysconfig/google_build.xml
busybox rm -f $ETC/sysconfig/nexus.xml
busybox rm -f $ETC/sysconfig/pixel_2017.xml
busybox rm -f $ETC/sysconfig/pixel_2017_exclusive.xml
if [ -f $BACKUP'/KI00Google.xml' ]
then
busybox rm -f $SYSCONFIG'/google.xml' > /dev/null 2>&1;
busybox cp -f $BACKUP'/KI00Google.xml' $SYSCONFIG'/google.xml' >
/dev/null 2>&1;
busybox chmod 644 $SYSCONFIG'/google.xml' > /dev/null 2>&1;
busybox chown 0:0 $SYSCONFIG'/google.xml' > /dev/null 2>&1;
fi
if [ -f $BACKUP'/KI00Google_Build.xml' ]
then
busybox cp -f $BACKUP'/KI00Google_Build.xml'
$SYSCONFIG'/google_build.xml' > /dev/null 2>&1;
busybox chmod 644 $SYSCONFIG'/google_build.xml' > /dev/null 2>&1;
busybox chown 0:0 $SYSCONFIG'/google_build.xml' > /dev/null 2>&1;
fi
if [ -f $BACKUP'/KI00Nexus.xml' ]
then
busybox cp -f $BACKUP'/KI00Nexus.xml' $SYSCONFIG'/nexus.xml' >
/dev/null 2>&1;
busybox chmod 755 $SYSCONFIG'/nexus.xml' > /dev/null 2>&1;
busybox chown 0:0 $SYSCONFIG'/nexus.xml' > /dev/null 2>&1;
fi
if [ -f $BACKUP'/KI00Pixel.xml' ]
then
busybox rm -f $SYSCONFIG'/KI00Pixel.xml' > /dev/null 2>&1;
busybox cp -f $BACKUP'/KI00Pixel.xml' $SYSCONFIG'/pixel_2017.xml' >
/dev/null 2>&1;
busybox chmod 644 $SYSCONFIG'/pixel_2017.xml' > /dev/null 2>&1;
busybox chown 0:0 $SYSCONFIG'/pixel_2017.xml' > /dev/null 2>&1;
fi
if [ -f $BACKUP'/KI00Pixel_Ex.xml' ]
then
busybox cp -f $BACKUP'/KI00Pixel_Ex.xml'
$SYSCONFIG'/pixel_2017_exclusive.xml' > /dev/null 2>&1;
busybox chmod 644 $SYSCONFIG'/pixel_2017_exclusive.xml' > /dev/null
2>&1;
busybox chown 0:0 $SYSCONFIG'/pixel_2017_exclusive.xml' > /dev/null
2>&1;
fi
else
busybox rm -f $ETC/sysconfig/google_build.xml
busybox rm -f $ETC/sysconfig/nexus.xml
busybox rm -f $ETC/sysconfig/pixel_2017.xml
busybox rm -f $ETC/sysconfig/pixel_2017_exclusive.xml
if [ -f $CORE/KI00Google_Build ]
then
busybox cp -f $CORE/KI00Google_Build
$ETC/sysconfig/google_build.xml
busybox chmod 644 $ETC/sysconfig/google_build.xml
busybox chown 0:0 $ETC/sysconfig/google_build.xml
fi
if [ -f $CORE/KI00Nexus ]
then
busybox cp -f $CORE/KI00Nexus $ETC/sysconfig/nexus.xml
busybox chmod 644 $ETC/sysconfig/nexus.xml
busybox chown 0:0 $ETC/sysconfig/nexus.xml
fi
if [ -f $CORE/KI00Pixel ]
then
busybox cp -f $CORE/KI00Pixel $ETC/sysconfig/pixel_2017.xml
busybox chmod 644 $ETC/sysconfig/pixel_2017.xml
busybox chown 0:0 $ETC/sysconfig/pixel_2017.xml
fi
if [ -f $CORE/KI00Pixel_Exclusive ]
then
busybox cp -f $CORE/KI00Pixel_Exclusive
$ETC/sysconfig/pixel_2017_exclusive.xml
busybox chmod 644 $ETC/sysconfig/pixel_2017_exclusive.xml
busybox chown 0:0 $ETC/sysconfig/pixel_2017_exclusive.xml
fi
fi
busybox clear
busybox echo -e $W'Do You Want To Reboot Now'$N
busybox echo ''
busybox echo -e $G'1. Yes'$N
busybox echo -e $R'2. No'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read -r options
case $options in
1)
busybox clear
busybox echo ''
busybox echo -e $P"Rebooting device"$N
busybox echo -e $R"5"$N
busybox sleep 1
busybox echo -e $P"4"$N
busybox sleep 1
busybox echo -e $B"3"$N
busybox sleep 1
busybox echo -e $C"2"$N
busybox sleep 1
busybox echo -e $G"1"$N
busybox sleep 1
reboots
;;
2)
busybox clear
break
;;
esac
done
else
busybox echo $R'Need Android 7.0+ Devices'$N
busybox sleep 2
fi
;;
0)
busybox clear
break
;;
esac
done
;;
R|r)
while :
do
busybox clear
busybox echo -e $Y'Reboot Options >>>'$N
busybox echo ''
busybox echo -e $W"1. Fast Reboot"$N
busybox echo -e $W"2. Reboot"$N
busybox echo -e $W"3. Reboot To Recovery"$N
busybox echo -e $W"4. Reboot To Bootloader"$N
busybox echo -e $W"5. Restart System UI"$N
busybox echo -e $W"6. Shutdown"$N
busybox echo -e $W'0. Go Back'$N
busybox echo -e -n $W'[CHOOSE] : '$N
read REBOOTOPTIONS
case $REBOOTOPTIONS in
1)
busybox clear
busybox echo ''
busybox echo -e $W'Please Wait 5 Second'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
fast_reboot
;;
2)
busybox clear
busybox echo ''
busybox echo -e $W'Please Wait 5 Second'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboots
;;
3)
busybox clear
busybox echo ''
busybox echo -e $W'Please Wait 5 Second'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboot_recovery
;;
4)
busybox clear
busybox echo ''
busybox echo -e $W'Please Wait 5 Second'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
reboot_bootloader
;;
5)
busybox clear
busybox echo ''
busybox echo -e $W'Please Wait 5 Second'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
restart_system_ui
;;
6)
busybox clear
busybox echo ''
busybox echo -e $W'Please Wait 5 Second'$N
busybox echo -e $R'5'$N
busybox sleep 1
busybox echo -e $P'4'$N
busybox sleep 1
busybox echo -e $B'3'$N
busybox sleep 1
busybox echo -e $C'2'$N
busybox sleep 1
busybox echo -e $G'1'$N
busybox sleep 1
shutdown
;;
0)
busybox clear
break
;;
esac
done
;;
U|u)
busybox clear
if [ -f $BACKUP'/KI00Build' ]
then
busybox rm -f $BUILD > /dev/null 2>&1;
busybox cp -f $BACKUP'/KI00Build' $BUILD
busybox chmod 644 $BUILD > /dev/null 2>&1;
busybox chown 0:0 $BUILD > /dev/null 2>&1;
fi
if [ -f $BACKUP'/KI00Debuggerd' ]
then
busybox rm -f $DEBUGGERD > /dev/null 2>&1;
busybox cp -f $BACKUP'/KI00Debuggerd' $DEBUGGERD
busybox chmod 755 $DEBUGGERD > /dev/null 2>&1;
busybox chown 0:0 $DEBUGGERD > /dev/null 2>&1;
fi
if [ -f $BACKUP'/KI00Google.xml' ]
then
busybox rm -f $SYSCONFIG'/google.xml' > /dev/null 2>&1;
busybox cp -f $BACKUP'/KI00Google.xml' $SYSCONFIG'/google.xml' >
/dev/null 2>&1;
busybox chmod 644 $SYSCONFIG'/google.xml' > /dev/null 2>&1;
busybox chown 0:0 $SYSCONFIG'/google.xml' > /dev/null 2>&1;
fi
if [ -f $BACKUP'/KI00Google_Build.xml' ]
then
busybox cp -f $BACKUP'/KI00Google_Build.xml'
$SYSCONFIG'/google_build.xml' > /dev/null 2>&1;
busybox chmod 644 $SYSCONFIG'/google_build.xml' > /dev/null 2>&1;
busybox chown 0:0 $SYSCONFIG'/google_build.xml' > /dev/null 2>&1;
fi
if [ -f $BACKUP'/KI00Nexus.xml' ]
then
busybox cp -f $BACKUP'/KI00Nexus.xml' $SYSCONFIG'/nexus.xml' >
/dev/null 2>&1;
busybox chmod 755 $SYSCONFIG'/nexus.xml' > /dev/null 2>&1;
busybox chown 0:0 $SYSCONFIG'/nexus.xml' > /dev/null 2>&1;
fi
busybox rm -f $BIN'/KITANA_FSTRIM' > /dev/null 2>&1;
busybox rm -f $BIN'/KITANA_BOOST' > /dev/null 2>&1;
busybox rm -f $BIN'/KITANA_CLEANER' > /dev/null 2>&1;
busybox rm -f $BIN'/KITANA_WIFI' > /dev/null 2>&1;
for FILES in $INIT/KI*
do
busybox rm -f "$FILES" > /dev/null 2>&1;
done
if [ -f $ETC/ad_calib.cfg ]
then
busybox rm -f $ETC/ad_calib.cfg
fi
busybox rm -f $ETC/hosts
busybox touch $ETC/hosts
busybox chmod 755 $ETC/hosts
busybox chown 0:0 $ETC/hosts
busybox echo "127.0.0.1 localhost" >> $ETC/hosts
busybox chmod 644 $ETC/hosts
busybox rm -rf $CORE
busybox rm -f /system/bin/KITANA
busybox rm -rf /cache/*
busybox rm -rf /data/dalvik-cache/*
busybox clear
exit
busybox echo -e $R'Reboot Now'$N
;;
E|e)
busybox clear
setenforce 1 > /dev/null 2>&1;
mount -o ro,remount,ro '/system' > /dev/null 2>&1;
mount -o ro,remount,ro '/data' > /dev/null 2>&1;
busybox mount -o ro,remount,ro '/system' > /dev/null 2>&1;
busybox mount -o ro,remount,ro '/data' > /dev/null 2>&1;
exit 0
;;
esac
done