Supremacy Script - Sony Xperia P, U, Sola, Go

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I had posted my Supremacy script in the android developments for XS and XU. Tho it will work on P, Go etc.
Decided to have one thread for all. Here: http://forum.xda-developers.com/showthread.php?t=1928200
——————————————————————————————————————————————————————————
Don't know what it is? Read up the thread! ^^
——————————————————————————————————————————————————————————
Here, I will answer your questions and/or anything else.​

Are you working to v3?
Nebunia lu Salam

oache said:
Are you working to v3?
Nebunia lu Salam
Click to expand...
Click to collapse
V3 is out
Tapatalked Xperia S

Mmm... Init.d , will it work in locked rooted stock rom?

LiveSquare said:
Mmm... Init.d , will it work in locked rooted stock rom?
Click to expand...
Click to collapse
The kernel needs init.d support. Check XU dev section there is a thread on how to enable it
Tapatalked !

Rapier07 said:
The kernel needs init.d support. Check XU dev section there is a thread on how to enable it
Tapatalked !
Click to expand...
Click to collapse
You mean enable on stock Kernel?
EDIT: Found and will try. Thanks.
EDIT2: How to test whether it's working?

Sadly this script causes freezes and reboots at random. Tested with KA and AS kernels. Haven't tried v3 but doubt it will make a difference. It's a shame
Skickat från min LT26i via Tapatalk 2

Galaxen said:
Sadly this script causes freezes and reboots at random. Tested with KA and AS kernels. Haven't tried v3 but doubt it will make a difference. It's a shame
Skickat från min LT26i via Tapatalk 2
Click to expand...
Click to collapse
I have no issues on xsspeed kernel V7 and 2.50 firmware
Tapatalked Xperia S

Ben36 said:
I have no issues on xsspeed kernel V7 and 2.50 firmware
Tapatalked Xperia S
Click to expand...
Click to collapse
Im still running .45 so it could be that.

Galaxen said:
Sadly this script causes freezes and reboots at random. Tested with KA and AS kernels. Haven't tried v3 but doubt it will make a difference. It's a shame
Skickat från min LT26i via Tapatalk 2
Click to expand...
Click to collapse
Reboots? Check the kernel Changelog or something, if it includes tweaks such as cache clearingg etc. those might have been conflicting this these scripts

sorry to say it...the script is a lil bit messy. the sysctl.conf is written in wrong way and the command isn't consistent.

Written wrong you say? Well you must be right. I don't know a lot here. Maybe you could helpme out?

emwno said:
Written wrong you say? Well you must be right. I don't know a lot here. Maybe you could helpme out?
Click to expand...
Click to collapse
It works well for me. The device is snappier.
Tapatalked !

kurotsugi said:
sorry to say it...the script is a lil bit messy. the sysctl.conf is written in wrong way and the command isn't consistent.
Click to expand...
Click to collapse
Yes do help and explain
Tapatalked Xperia S

Yup the device became snappier bt there is a decrease in quadrant score
Earlier I used to get above 3000 bt nw I can't go beyond 2900
Still I liked it coz this script actually makes a difference

if you have time, you can rewrite all the stuff by yourself to avoid double typed script with different value. its easy but need a lil more patience. I'll try to give quick explanation. our tweaks mostly work via init.d script. the basic structure will be.
Code:
#!/system/bin/sh --> the header. tell the system to use "sh" command on the script below
echo bla bla bla. --> the script
I'll differentiate the scripts into two parts. the one run a bash script and the one used to change our device setting. the first one is quite complicated and usually written on separated file. the famous one might be zipalign script and sqlite script. basicly you only need to add the script and the required files (the libs and the binary file in /system/bin) into your system and need no modification. just add and leave it.
the second part is the one used to change our device setting. we can differentiate this stuff into two things. the setprop stuff and the "other stuff". the setprop stuff is quite easy to use. the setprop stuff basic form is "setprop <key> <value>" for an example:
Code:
setprop ro.ril.enable.dtm 1
setprop ro.ril.gprsclass 10
setprop ro.ril.hep 1
setprop ro.ril.enable.3g.prefix 1
setprop ro.ril.hsdpa.category 8
setprop ro.ril.hsupa.category 6
setprop ro.ril.hsxpa 2
setprop ro.ril.enable.a53 1
some of these script written in form of "setprop ro.ril.hep=1". that's the wrong way. the correct way is as I've described above.
the second part, the "other stuff" work in three different way. for an example, look at these files
Code:
/proc/sys/kernel/shmmni
/proc/sys/kernel/shmmax
/proc/sys/kernel/shmall
these files have certain value on it. if we want to change the value written on it, we can use three different way.
1. use "sysctl -w <key>=<value>" form. in your init.d script you'll type
Code:
sysctl -w kernel.shmmni=4096
sysctl -w kernel.shmmax=268435456
sysctl -w kernel.shmall=2097152
2. use sysctl.conf file. in your sysctl.conf file, you'll write
Code:
kernel.shmmni=4096
kernel.shmmax=268435456
kernel.shmall=2097152
while in your init.d script you'll write "sysctl -p".
personally I prefer the number 1 since I can made a simple test to check whether if the script is running or not and add it into my log files. anyway, these trick only work for the files under /proc/sys. if you want to change the value of different files, you'll need to use method number 3.
3. use echo command. the form is "echo "<value>" > /path/to/file". in your init.d you'll write
Code:
echo "0" > /sys/module/lowmemorykiller/parameters/debug_level
echo "64" > /sys/module/lowmemorykiller/parameters/cost
echo "0,1,3,5,7,15" > /sys/module/lowmemorykiller/parameters/adj
echo "4096,5182,6400,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
to avoid double typed script, we can categorize our tweak into several group. I'll show you my tweak as an example. you can learn it or start with it. I don't take credits, so that you can modify it anytime without asking my permission.
Code:
#!/system/bin/sh
# kuro tweak1: the echo stuff
# [email protected] (2012) - lol...i'm just joking. no copyright or whatsoever
# contact : [email protected]
# v.1 - first release
# v.1.1 - new log system and new tweak added.
# v.1.2 - new tweak for xperia
# v.1.3(4-11-12) - new form
LOG_FILE=/data/kuro_tweak1.log
LOG_FILEZ=/data/kuro_sqlite.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
if [ -e $LOG_FILEZ ]; then
rm $LOG_FILEZ;
fi;
# the preface
echo "==========================
# TWEAK KURO1-LOG FILE #
==========================
in the name of Allah,
the most beneficent,
the most mercifull
==========================
system information:
vendor : $( getprop ro.product.brand )
model : $( getprop ro.product.model )
ROM : $( getprop ro.build.display.id )
running the script...
start at:
$( date +"%m-%d-%Y %H:%M:%S" )
==========================" | tee -a $LOG_FILE;
# perfect mount
mount -o remount,noatime,commit=500,noauto_da_alloc,barrier=0 /system /system;
mount -o remount,noatime,commit=500,noauto_da_alloc,barrier=0 /data /data;
mount -o remount,noatime,commit=500,noauto_da_alloc,barrier=0 /cache /cache;
echo "perfect mount---------[OK]" | tee -a $LOG_FILE;
# sdcard speed fix
# not working yet - need root permission to change these value
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then
busybox echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
busybox echo "2048" > /sys/devices/virtual/bdi/179:32/read_ahead_kb
echo "sdcard speed fix------[OK]
-value set to $( cat /sys/devices/virtual/bdi/179:0/read_ahead_kb )
-value set to $( cat /sys/devices/virtual/bdi/179:32/read_ahead_kb )" | tee -a $LOG_FILE; else
echo "sdcard speed fix----[FAIL]" | tee -a $LOG_FILE;
fi
# kernel kick
sysctl -w kernel.shmmni=4096
sysctl -w kernel.shmmax=268435456
sysctl -w kernel.shmall=2097152
sysctl -w kernel.msgmni=4096
sysctl -w kernel.msgmax=64000
# sysctl -w kernel.sched_latency_ns=20000000
# sysctl -w kernel.sched_wakeup_granularity_ns=2500000
# sysctl -w kernel.sched_min_granularity_ns=10000000
sysctl -w kernel.sem="500 512000 64 2048"
sysctl -w kernel.panic=30
sysctl -w kernel.panic_on_oops=0
sysctl -w kernel.threads-max=10000
sysctl -w kernel.panic=30
# sysctl -w kernel.sched_compat_yield=1
# sysctl -w kernel.sched_shares_ratelimit=256000
sysctl -w kernel.ctrl-alt-del=0
sysctl -w fs.lease-break-time=10
sysctl -w fs.file-max=65536
echo "kernel kick-----------[OK]" | tee -a $LOG_FILE;
# OOM
sysctl -w vm.laptop_mode=0
sysctl -w vm.swappiness=40
sysctl -w vm.dirty_writeback_centisecs=3000
sysctl -w vm.dirty_expire_centisecs=500
sysctl -w vm.dirty_ratio=15
sysctl -w vm.dirty_background_ratio=10
sysctl -w vm.lowmem_reserve_ratio="100 100"
sysctl -w vm.overcommit_ratio=70
sysctl -w vm.highmem_is_dirtyable=1
sysctl -w vm.min_free_order_shift=4
sysctl -w vm.oom_kill_allocating_task=0
sysctl -w vm.panic_on_oom=0
sysctl -w vm.page-cluster=3
sysctl -w vm.drop_caches=3
sysctl -w vm.min_free_kbytes=5120
sysctl -w vm.vfs_cache_pressure=50
sysctl -w vm.block_dump=0
echo "memory management-----[OK]" | tee -a $LOG_FILE;
# network boost
sysctl -w net.ipv4.tcp_congestion_control=cubic
sysctl -w net.ipv4.tcp_timestamps=0
sysctl -w net.ipv4.tcp_tw_reuse=1
sysctl -w net.ipv4.tcp_sack=1
sysctl -w net.ipv4.tcp_dsack=1
sysctl -w net.ipv4.tcp_tw_recycle=1
sysctl -w net.ipv4.tcp_window_scaling=1
sysctl -w net.ipv4.tcp_keepalive_probes=5
sysctl -w net.ipv4.tcp_keepalive_intvl=30
sysctl -w net.ipv4.tcp_fin_timeout=30
sysctl -w net.ipv4.tcp_moderate_rcvbuf=1
sysctl -w net.ipv4.tcp_max_tw_buckets=1440000
sysctl -w net.ipv4.tcp_mem="57344 57344 524288"
sysctl -w net.ipv4.tcp_synack_retries=2
sysctl -w net.ipv4.tcp_syn_retries=2
sysctl -w net.ipv4.tcp_max_syn_backlog=1024
sysctl -w net.ipv4.icmp_echo_ignore_all=1
sysctl -w net.ipv4.route/flush=1
sysctl -w net.ipv4.udp_rmem_min=6144
sysctl -w net.ipv4.udp_wmem_min=6144
sysctl -w net.ipv4.tcp_rfc1337=1
sysctl -w net.ipv4.ip_no_pmtu_disc=0
sysctl -w net.ipv4.tcp_ecn=0
sysctl -w net.ipv4.tcp_wmem="6144 87380 524288"
sysctl -w net.ipv4.tcp_rmem="6144 87380 524288"
sysctl -w net.ipv4.tcp_fack=1
sysctl -w net.ipv4.tcp_synack_retries=2
sysctl -w net.ipv4.tcp_syn_retries=2
sysctl -w net.ipv4.tcp_no_metrics_save=1
sysctl -w net.ipv4.tcp_keepalive_time=1800
sysctl -w net.ipv4.ip_forward=0
sysctl -w net.ipv4.ip_dynaddr=0
sysctl -w net.ipv4.conf.all.accept_source_route=0
sysctl -w net.ipv4.conf.all.accept_redirects=0
sysctl -w net.ipv4.conf.all.rp_filter=1
sysctl -w net.ipv4.conf.all.secure_redirects=0
sysctl -w net.ipv4.conf.default.accept_redirects=0
sysctl -w net.ipv4.conf.default.secure_redirects=0
sysctl -w net.ipv4.conf.default.accept_source_route=0
sysctl -w net.core.rmem_max=524288
sysctl -w net.core.wmem_max=524288
sysctl -w net.core.rmem_default=262144
sysctl -w net.core.wmem_default=262144
sysctl -w net.core.optmem_max=20480
sysctl -w net.core.netdev_max_backlog=25000
sysctl -w net.unix.max_dgram_qlen=50
echo "network boost---------[OK]" | tee -a $LOG_FILE;
# cleaner
busybox rm -f /data/anr/*.*
busybox rm -f /data/cache/*.*
busybox rm -f /data/local/log/*.*
busybox rm -f /data/local/tmp/*.*
busybox rm -f /data/last_alog/*
busybox rm -f /data/last_kmsg/*
busybox rm -f /data/mlog/*
busybox rm -f /data/tombstones/*
busybox rm -f /data/system/dropbox/*
chmod 400 /data/system/dropbox
busybox rm /dev/log/main
busybox rm -f /data/system/usagestats/*
busybox chmod 400 /data/system/usagestats
export sampling_rate=10000
export up_threshold=80
echo "memory cleaner--------[OK]" | tee -a $LOG_FILE;
if [ -e /data/anr/*.* ]; then
echo "-anr not cleaned" | tee -a $LOG_FILE; else
echo "-anr cleaned" | tee -a $LOG_FILE
fi;
if [ -e /data/local/tmp/*.* ]; then
echo "-local/tmp not cleaned" | tee -a $LOG_FILE; else
echo "-local/tmp cleaned" | tee -a $LOG_FILE
fi;
if [ -e /data/cache/*.* ]; then
echo "-cache not cleaned" | tee -a $LOG_FILE; else
echo "-cache cleaned" | tee -a $LOG_FILE
fi;
if [ -e /data/last_log/*.* ]; then
echo "-log not cleaned" | tee -a $LOG_FILE; else
echo "-log cleaned" | tee -a $LOG_FILE
fi;
if [ -e /data/tombstones/*.* ]; then
echo "-tombstones not cleaned" | tee -a $LOG_FILE; else
echo "-tombstones cleaned" | tee -a $LOG_FILE
fi;
# minfree
echo "64" > /sys/module/lowmemorykiller/parameters/cost
echo "0,1,3,5,7,15" > /sys/module/lowmemorykiller/parameters/adj
echo "4096,5182,6400,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
echo "minfree setting-------[OK]
-minfree value
$( cat /sys/module/lowmemorykiller/parameters/adj )
$( cat /sys/module/lowmemorykiller/parameters/minfree )" | tee -a $LOG_FILE;
# end
echo "==========================
done at:
$( date +"%m-%d-%Y %H:%M:%S" )
all praise is due to Allah
==========================
-- have a nice day --
[email protected]
==========================" | tee -a $LOG_FILE;
note that the line started with # are not executed.
Code:
#!/system/bin/sh
# kuro tweak2: the setprop stuffs and journalismoff
# [email protected] (2012) - lol...i'm just joking. no copyright or whatsoever
# contact : [email protected]
# v.1 - first release
# v.1.1 - new log system and new tweak added.
# v.1.2 - new tweak for xperia
LOG_FILE=/data/kuro_tweak2.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
# the preface
echo "==========================
# TWEAK KURO2-LOG FILE #
==========================
in the name of Allah,
the most beneficent,
the most mercifull
==========================
system information:
vendor : $( getprop ro.product.brand )
model : $( getprop ro.product.model )
ROM : $( getprop ro.build.display.id )
running the script...
start at:
$( date +"%m-%d-%Y %H:%M:%S" )
==========================" | tee -a $LOG_FILE;
# 3g mod
setprop ro.ril.enable.dtm 1
setprop ro.ril.gprsclass 10
setprop ro.ril.hep 1
setprop ro.ril.enable.3g.prefix 1
setprop ro.ril.hsdpa.category 8
setprop ro.ril.hsupa.category 6
setprop ro.ril.hsxpa 2
setprop ro.ril.enable.a53 1
setprop ro.ril.htcmaskw1.bitmask 4294967295
setprop ro.ril.htcmaskw1 14449
setprop ro.config.hw_fast_dormancy 1
echo "3g signal mod---------[OK]" | tee -a $LOG_FILE;
# battery mod n media
setprop debug.performance.tuning 1
setprop pm.sleep_mode 1
setprop windowsmgr.max_events_per_sec 90
setprop ro.ril.disable.power.collapse 0
setprop wifi.supplicant_scan_interval 180
setprop ro.media.enc.jpeg.quality 100
setprop debug.sf.hw 1
setprop ro.vold.umsdirtyratio 20
echo "battery n media-------[OK]" | tee -a $LOG_FILE;
# performance
# setprop persist.sys.purgeable_assets 1
setprop dalvik.vm.execution-mode int:jit
setprop dalvik.vm.dexopt-flags l=x,n=z,m=y
setprop dalvik.vm.verify-bytecode false
setprop dalvik.vm.heapsize 64m
setprop dalvik.vm.heapgrowthlimit 48m
setprop dalvik.vm.dexopt-data-only 1
setprop dalvik.vm.jmiopts forcecopy
setprop dalvik.vm.lockprof.treshold 250
setprop ro.kernel.android.checkjni 0
setprop ro.telephony.call_ring.delay 0
setprop debug.kill_allocating_task 1
# defaul is zero
# mem adj
setprop ro.FOREGROUND_APP_ADJ 0
setprop ro.VISIBLE_APP_ADJ 4
setprop ro.SECONDARY_SERVER_ADJ 6
setprop ro.HIDDEN_APP_MIN_ADJ 8
setprop ro.CONTENT_PROVIDER_ADJ 12
setprop ro.EMPTY_APP_ADJ 15
# mem minfree
setprop ro.FOREGROUND_APP_MEM 1536
setprop ro.VISIBLE_APP_MEM 2048
setprop ro.SECONDARY_SERVER_MEM 4096
setprop ro.HIDDEN_APP_MEM 5120
setprop ro.CONTENT_PROVIDER_MEM 5632
setprop ro.EMPTY_APP_MEM 6144
echo "performance-----------[OK]" | tee -a $LOG_FILE;
# Disable debugging notify icon on statusbar
setprop persist.adb.notify 0
# Disable blackscreen issue after a call
setprop ro.lge.proximity.delay 0
setprop mot.proximity.delay 0
# Phone will not wake up from hitting the volume rocker
# setprop ro.config.hwfeature_wakeupkey 0
# Enable display Dithering
# setprop persist.sys.use_dithering 1
# xperia mental
setprop persist.android.strictmode 0
setprop persist.sys.ui.hw 1
setprop ro.max.fling_velocity 12000
setprop ro.min.fling_velocity 2000
setprop ro.mot.eri.losalert.delay 1000
setprop ro.kernel.checkjni 0
setprop ro.config.nocheckin 1
setprop debug.qctwa.statusbar 1
setprop debug.qctwa.preservebuf 1
setprop debug.qc.hardware true
setprop com.qc.hardware true
setprop profiler.force_disable_err_rpt 1
setprop profiler.force_disable_ulog 1
setprop logcat.live disable
setprop net.ppp0.dns1 8.8.8.8
setprop net.ppp0.dns2 8.8.4.4
setprop net.dns1 8.8.8.8
setprop net.rmnet0.dns1 8.8.8.8
setprop net.rmnet0.dns2 8.8.4.4
setprop net.dns2 8.8.4.4
setprop debug.egl.profiler 1
setprop debug.egl.hw 1
setprop debug.composition.type gpu
echo "Xperia tweak----------[OK]" | tee -a $LOG_FILE;
# no journal
tune2fs -o journal_data_writeback /dev/block/mmcblk0p10
tune2fs -o journal_data_writeback /dev/block/mmcblk0p11
tune2fs -o journal_data_writeback /dev/block/mmcblk0p15
echo "no journal------------[OK]" | tee -a $LOG_FILE;
# end
echo "==========================
done at:
$( date +"%m-%d-%Y %H:%M:%S" )
all praise is due to Allah
==========================
-- have a nice day --
[email protected]
==========================" | tee -a $LOG_FILE;
the journalism stuff require tune2fs binary file installed into your system.
Code:
#!/system/bin/sh
#keep beats
PPID=$(pidof org.equalizerapp);
echo "17" > /proc/$PPID/oom_adj;
renice -18 $PPID;
#set
setprop.keep_app_1 org.equalizerapp
#audio resample
setprop af.resample 48000;
setprop af.resampler.quality 255;
setprop ro.audio.samplerate 48000;
setprop ro.audio.pcm.samplerate 48000;
setprop persyst.af.resample 48000;
setprop persyst.af.resampler.quality 255;
setprop persyst.ro.audio.samplerate 48000;
setprop persyst.ro.audio.pcm.samplerate 48000;
setprop persyst.dev.pm.dyn_samplingrate 1;
this one is modifying our sound quality. some of the part are still under my investigation but the audio resample part is really working.
Code:
#!/system/bin/sh
# DarkyROM 2011
# Much faster zipalign.
# Changelog:
# 1.3 (5/8/12) new log system. system remount deleted (by: kurotsugi)
# 1.2 (17/1/11) Added /data/zipalign.db file for faster apk check (ninpo,Bo$s)
# 1.1 (12/1/09) Switched to zipalign -c 4 to check the apk instead of MD5 (oknowton)
# 1.0 (11/30/09) Original
LOG_FILE=/data/kuro_zalign.log
ZIPALIGNDB=/data/kuro_zalign.db
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
if [ ! -f $ZIPALIGNDB ]; then
touch $ZIPALIGNDB;
fi;
# the preface
echo "==========================
# TWEAK KURO-ZALIGN FILE #
==========================
in the name of Allah,
the most beneficent,
the most mercifull
==========================
system information:
vendor : $( getprop ro.product.brand )
model : $( getprop ro.product.model )
ROM : $( getprop ro.build.display.id )
running the script...
start at:
$( date +"%m-%d-%Y %H:%M:%S" )
==========================" | tee -a $LOG_FILE;
# zipalign script (not modified)
for DIR in /system/app /data/app ; do
cd $DIR
for APK in *.apk ; do
if [ $APK -ot $ZIPALIGNDB ] && [ $(grep "$DIR/$APK" $ZIPALIGNDB|wc -l) -gt 0 ] ; then
echo "zipaligned: $DIR/$APK" | tee -a $LOG_FILE
else
zipalign -c 4 $APK
if [ $? -eq 0 ] ; then
echo "now zipaligned: $DIR/$APK" | tee -a $LOG_FILE
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
else
echo "Now aligning: $DIR/$APK" | tee -a $LOG_FILE
zipalign -f 4 $APK /cache/$APK
busybox mount -o rw,remount /system
cp -f -p /cache/$APK $APK
busybox rm -f /cache/$APK
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
fi
fi
done
done
touch $ZIPALIGNDB
# end
echo "==========================
done at:
$( date +"%m-%d-%Y %H:%M:%S" )
all praise is due to Allah
==========================
-- have a nice day --
[email protected]
==========================" | tee -a $LOG_FILE;
the famous zipalign script. i modify the log system. you need the zipalign binary to use it
Code:
#!/system/bin/sh
# kuro akuro: new data2sd method
# [email protected] (2012) - lol...i'm just joking. no copyright or whatsoever
# contact : [email protected]
# v.1 - first release
# v.1.1 - automated system, new build,
LOG_FILE=/data/kuro_akuro.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
# the preface
echo "==========================
# TWEAK AKURO-LOG FILE #
==========================
in the name of Allah,
the most beneficent,
the most mercifull
==========================
system information:
vendor : $( getprop ro.product.brand )
model : $( getprop ro.product.model )
ROM : $( getprop ro.build.display.id )
running the script...
start at:
$( date +"%m-%d-%Y %H:%M:%S" )
==========================" | tee -a $LOG_FILE;
# fix sdcard speed
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo "fix sdcard speed tweak [OK]" | tee -a $LOG_FILE;
fi;
# create sdext dir in /system
if [ ! -e /system/sd ]; then
echo "WARNING!: no sdext dir
please create dir /system/sd" | tee -a $LOG_FILE;
fi;
echo "SDEXT directory check [OK]" | tee -a $LOG_FILE;
# mount sdcard all type
busybox mount -o noatime,nodiratime,nosuid,nodev /dev/block/mmcblk0p2 /system/sd;
mountext=`busybox mount | egrep 'ext2|ext3|ext4'`;
if [ -n "$mountext" ]; then
chown 1000:1000 /system/sd;
chmod 771 /system/sd;
fi;
echo "akuro: sd-ext mount [OK]" | tee -a $LOG_FILE;
# create the directories
if [ ! -e /system/sd/app ]; then
mkdir /system/sd/app;
busybox mv /data/app/* /system/sd/app;
fi;
if [ ! -e /system/sd/dalvik-cache ]; then
mkdir /system/sd/dalvik-cache;
busybox mv /data/dalvik-cache/* /system/sd/dalvik-cache;
fi;
echo "akuro: preparation step [OK]" | tee -a $LOG_FILE;
# mount sd to data directories
mount -o bind /system/sd/app /data/app;
chown 1000:1000 /system/sd/app;
chmod 771 /system/sd/app;
if [ -e /system/sd/app ]; then
echo "akuro: app mount step [OK]" | tee -a $LOG_FILE; else
echo "akuro: app mount step [FAIL]" | tee -a $LOG_FILE;
fi;
mount -o bind /system/sd/dalvik-cache /data/dalvik-cache;
chown 1000:1000 /system/sd/dalvik-cache;
chmod 771 /system/sd/dalvik-cache;
if [ -e /system/sd/dalvik-cache ]; then
echo "akuro: dalvik mount step [OK]" | tee -a $LOG_FILE; else
echo "akuro: dalvik mount step [FAIL]" | tee -a $LOG_FILE;
fi;
if [ -e /system/sd/data ]; then
mount -o bind /system/sd/data /data/data;
chown 1000:1000 /system/sd/data;
chmod 771 /system/sd/data;
fi;
if [ -e /system/sd/data ]; then
echo "akuro: data mount step [OK]" | tee -a $LOG_FILE; else
echo "akuro: data mount step [FAIL]" | tee -a $LOG_FILE;
fi;
# end
echo "==========================
done at:
$( date +"%m-%d-%Y %H:%M:%S" )
all praise is due to Allah
==========================
-- have a nice day --
[email protected]
==========================" | tee -a $LOG_FILE;
my own made akuro script. it works to move dalvik-cache,app, and /data/folder from our internal memory to ext2/3/4 partition on our sdcard. it will save our internal mem space. sadly this one is for samsung device. you need to modify some part of it.
have a nice tweaking
EDIT: btw, for my first and second tweak, you should use your own value. my value is taken from sgy and still under investigation to get better result.

Did not work for me using stock rom... It had gfx errors after flashing
Sent from my Xperia S using xda app-developers app

Gfx errors?

emwno said:
Gfx errors?
Click to expand...
Click to collapse
It showed the SIM menu on top of the launcher and after I entered settings this came back and then reboot. I will never apply this again.
Sent from my Xperia S using xda app-developers app

Related

[TUTORIAL] How to test if scripts (tweaks) actually work

Hello!
As some of you know, pvyParts and I have been working on a custom stock-based ROM, T.E.A.M., which was initially released as a themed ROM to offer transparency and replace the Theme Chooser that we haven't been able to port properly, giving endless options on custom backgrounds (since your wallpaper is the system background).
As the ROM evolved and custom kernels became available, I wanted to tweak it using init.d scripts.
As all good developers here do, I searched the Android Software and Hacking General section,
browsed other devices' forums and came up with some tweaks that were really good -on paper.
To my disappointment, most of these did not work.
And I am not saying this because I didn't "feel" a difference
or because I could not spread my X10's smoothness on a cracker.
There is actually a way to test if a script runs with no errors, a.k.a actually works.
Without further adieu, here is how:
1. Place the script you want to test (let's say test.sh)
in /system and give it all permissions,
either with Root Explorer or via adb:
Code:
adb shell chmod 777 /system/test.sh
NOTE: Sometimes scripts don't have an extension (sh).
It's OK, you can still test it with this method.
2. Now install an app like Script Manager and run the script.
Or, do it via adb:
Code:
adb shell sh /system/test.sh
3. Now there are 3 things you might face:
- If you get an error in return, it means the script doesn't work,
so no point in placing it in init.d and running it at every boot, right?
- Some scripts include debug, so you may get a message saying Done, Success, or whatever, which means you are good to go.
- You might not get any output at all, but still that means the script ran fine.
For the latter two cases, you can safely run the script at boot by placing it in init.d folder.
The reason this thread is in development, is because I feel that since the X10 is getting old and many developers have left,
(but luckily new ones still appear, which is plainly AWESOME ), quality of ROMs is very important.
We have fewer choices, so let's make them worthwhile!
Doing it right now.
BTW- I'm first! Again!
Prodigy said:
Doing it right now.
BTW- I'm first! Again!
Click to expand...
Click to collapse
Let us know how it went!
its good to see dev sharing their dev knowledge and skills. this will make more dev for x10. more dev, more improvement we can do on our phone. Thanks My Immortal / iridaki. you're awsome
Thank
cause script stress me well
Now i can see if work or not
X10-tripmiui,iris,00
so if my rom has a init.d folder, does it means it supports or run script (on init.d folder) at boot? is there a way to check if my rom has init.d support??
draiyan said:
so if my rom has a init.d folder, does it means it supports or run script (on init.d folder) at boot? is there a way to check if my rom has init.d support??
Click to expand...
Click to collapse
Yes, support at boot.
To my less knowledge, just look if there is a init. d folder in system/etc/
When you make an own rom check if the kernel you wanna use,has init. d support.
Hope I didn't talk crap and this is right
Sent from my X10i using Tapatalk
but im really confuse here, i found this script,
Code:
/etc/init.d/03sdcardspeedfix
at some line of this script, it reads;
READ_AHEAD_KB="2048"
Click to expand...
Click to collapse
i know some c++ programming, and from what i know the value 2048 is assigned to read_ahead_kb, so i assume its the same in android. BUT, after reboot, i jumped to
Code:
/sys/devices/virtual/bdi/179:0/read_ahead_kb
to found out that its still 128, then i started thinking that the script didnt run, but the dev says the rom is init.d supported.
is there a way to test if init.d is reallty working? like at terminal emulator?
sure man !
you have two way for run tweak
in install-recovery.sh
or ini.d folder
but for be sure
create a file in system/etc
name it "install-recovery.sh"
copy this in and give all permission.
#!/system/bin/sh
#Mount Points
busybox mount -o remount,rw,noatime,nodiratime / -t rootfs
busybox mount -o remount,rw,noatime,nodiratime /sys -t sysfs
busybox mount -o remount,rw,noatime,nodiratime /system
busybox mount -o remount,rw,noatime,nodiratime /data
busybox mount -o remount,rw,noatime,nodiratime /cache
#init.d support
busybox run-parts /system/etc/init.d
run-parts /system/etc/init.d >> /data/local/tmp/runparts.log 2>&1
now put your tweak in ini.d folder and reboot
be carefull !
if you have zipalign tweak
this tweak kill all tweak at boot because it unmount partition
and make it r/o instead of r/w
well,
tweak cannot access system or data like VM or sdcard tweak like read-ahead kb 2048.
now go in data/local/tmp
and check the log
to see if all it ok
but if ini.d does not run,
you could
insert tweak in install-recovery.sh
like this
#!/system/bin/sh
#give system permissions
busybox mount -o remount,rw /system
chmod 777 /system
#init.d support
busybox run-parts /system/etc/init.d
run-parts /system/etc/init.d >> /data/local/tmp/runparts.log 2>&1
#uncap fps
mount -t debugfs debugfs /sys/kernel/debug
echo '0' > /sys/kernel/debug/msm_fb/0/vsync_enable
#th config
echo '0' > /sys/kernel/debug/msm_fb/0/hw_vsync_mode
echo '0' > /sys/kernel/debug/msm_fb/0/sw_refreshing_enable
echo '2' > /sys/kernel/debug/msm_fb/0/ref_cnt
echo '8' > /sys/kernel/debug/msm_fb/0/backbuff
echo '6000' > /sys/kernel/debug/msm_fb/0/refx100
#echo '1' > /sys/power/wake_lock *dangerous
#echo '1' > /sys/kernel/debug/kgsl/cache_enable *dangerous
echo '8192' > /sys/block/mmcblk0/queue/read_ahead_kb
echo '128' > /sys/block/mmcblk0/queue/max_sectors_kb
echo '8192' > /sys/block/mmcblk1/queue/read_ahead_kb
echo '128' > /sys/block/mmcblk1/queue/max_sectors_kb
#rm -f -rf /data/idd
#rm -f -rf /data/semc-checkin
umount /sys/kernel/debug
echo 0 > /sys/kernel/logger/log_main/enable
echo 0 > /sys/kernel/logger/log_event/enable
echo 0 > /sys/kernel/logger/log_radio/enable
echo 1024 > /sys/devices/virtual/bdi/179:0/read_ahead_kb
echo 1024 > /sys/devices/virtual/bdi/default/read_ahead_kb
echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
echo 30 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/down_differential
echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice_load
# Delay the Media Scanner to help boot times
pm disable com.android.providers.media/com.android.providers.media.MediaScannerReceiver &
sleep 80 && pm enable com.android.providers.media/com.android.providers.media.MediaScannerReceiver &
#I/O Scheduler Tweaks
mount -o remount,noatime / -t rootfs
mount -o remount,noatime /dev -t devpts
mount -o remount,noatime /proc -t proc
mount -o remount,noatime /sys -t sysfs
mount -o remount,noatime /mnt/asec -t tmpfs
mount -o remount,noatime /system -t yaffs2
mount -o remount,noatime /data -t yaffs2
mount -o remount,noatime /cache -t yaffs2
mount -o remount,noatime /mnt/sdcard -t vfat
mount -o remount,noatime /mnt/secure/asec -t vfat
mount -o remount,noatime /mnt/sdcard/.android_secure -t tmpfs
i=`ls -d /sys/block/mtdblock3/queue/scheduler`;
STL=`ls -d /sys/block/stl*`;
BML=`ls -d /sys/block/bml*`;
MMC=`ls -d /sys/block/mmc*`;
TFSR=`ls -d /sys/block/tfsr*`;
DM=`ls -d /sys/block/dm*`;
MTD=`ls -d /sys/block/mtd*`;
LOOP=`ls -d /sys/block/loop*`;
RAM=`ls -d /sys/block/ram*`;
SYSDEV=`mount | grep '/system' | cut -d '/' -f 4`;
IO_SCHEDULER=`echo "noop" > /sys/block/mtdblock3/queue/scheduler/queue/rotational`;
for i in `busybox ls -1 /sys/block/mtdblock*`; do
echo "deadline" > $i/queue/scheduler;
done;
for k in $(busybox mount | cut -d " " -f3)
do
sync;
busybox mount -o remount,noatime,nodiratime $k;
done;
echo "deadline" > /sys/block/mmcblk0/queue/scheduler
echo "deadline" > /sys/block/dm-0/queue/scheduler
echo "deadline" > /sys/block/dm-1/queue/scheduler
for i in $MMC $MTD $LOOP; do
echo 0 > $i/queue/rotational;
done;
for i in $MMC $MTD; do
echo "deadline" > $i/queue/scheduler;
done;
for i in $MMC; do
echo 4096 > $i/queue/read_ahead_kb;
echo 0 > $i/queue/rotational;
echo 1 > $i/queue/iosched/low_latency;
echo 16 > $i/queue/iosched/quantum;
echo 8192 > $i/queue/nr_requests;
echo 1000000000 > $i/queue/iosched/back_seek_max;
for i in $STL $BML $MMC;
do
echo $IO_SCHEDULER > $i/queue/scheduler;
case $IO_SCHEDULER in
"deadline")
echo 1 > $i/queue/iosched/fifo_batch;;
"cfq")
echo 1 > $i/queue/iosched/back_seek_penalty;
echo 3 > $i/queue/iosched/slice_idle;;
"bfq")
echo 1 > $i/queue/iosched/back_seek_penalty;
echo 3 > $i/queue/iosched/slice_idle;;
"noop")
echo 1 > $i/queue/iosched/back_seek_penalty;
echo 3 > $i/queue/iosched/slice_idle;;
esac;
done;
#Dalvik Cache
if [ ! -d /cache/dalvik-cache ]
then
busybox rm -rf /cache/dalvik-cache /data/dalvik-cache
mkdir /cache/dalvik-cache /data/dalvik-cache
fi
#Dalvik Cache
busybox chown 1000:1000 /cache/dalvik-cache
busybox chmod 0771 /cache/dalvik-cache
#bind mount dalvik-cache so we can still boot without the sdcard
busybox mount -o bind /cache/dalvik-cache /data/dalvik-cache
busybox chown 1000:1000 /data/dalvik-cache
busybox chmod 0771 /data/dalvik-cache
#Remove
busybox rm -rf /data/tombstones/*
#Zipalign
mount -o remount,rw -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /system
cd /system/app
for z in *.apk; do
zipalign -c 4 $z
if [ "$?" -ne "0" ]; then
echo zipalign $z !
zipalign -f 4 $z /tmp/$z
cp /tmp/$z $z
rm /tmp/$z
fi
done
mount -o remount,ro -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /system
mount -o remount,rw -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /data
cd /data/app
for z in *.apk; do
zipalign -c 4 $z
if [ "$?" -ne "0" ]; then
echo zipalign $z !
zipalign -f 4 $z /tmp/$z
cp /tmp/$z $z
rm /tmp/$z
fi
done
mount -o remount,ro -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /data
#Phone Lag Tweaks
MAX_PHONE() {
pidphone=`pidof com.android.phone`;
if [ $pidphone ]; then
echo -17 > /proc/$pidphone/oom_adj;
renice -20 $pidphone;
exit;
else
sleep 5;
MAX_PHONE;
fi;
}
(while [ 1 ]; do
sleep 10;
MAX_PHONE;
done &);
if [ $ENABLE_MAXPHONE -eq 1 ];
then
PROC_ADJUST "com.android.phone" "-20" &
fi;
for j in $DM $MTD $LOOP $RAM; do
echo 0 > $j/queue/rotational;
done;
strace -p $(pidof yourapp) # for all your running applications
ps aux | awk '{print$10,$11}' | sort -n # will list all running softs sorted by used cpu time
#CPUTweak's Variables
last_source="unknown";
charging_source=$(cat /sys/class/power_supply/battery/charging_source);
capacity=$(cat /sys/class/power_supply/battery/capacity);
if [ $ENABLE_SWITCH -eq 1 ];
then
ALLFREQS=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies`;
(while [ 1 ];
do
cat /sys/power/wait_for_fb_wake;
AWAKE_MODE;
cat /sys/power/wait_for_fb_sleep;
SLEEP_MODE;
done &)
fi;
BAT_SLEEP_GOV="powersave"
USB_SLEEP_GOV="powersave"
POW_SLEEP_GOV="powersave"
#CPUTweak's Functions
Battery() {
(while [ 1 ]; do
if [ $AWAKE = "awake" ]; then
echo $BAT_AWAKE_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
echo 100000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
echo 100 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias
AWAKE=
fi;
if [ $SLEEPING = "sleeping" ]; then
echo $BAT_SLEEP_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 80 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/up_threshold
echo 40000 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/sampling_rate
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/powersave_bias
SLEEPING=
fi;
done &)
mount -o remount,ro -t yaffs2 /dev/block/mtdblock3
}
USB() {
(while [ 1 ]; do
if [ $AWAKE = "awake" ]; then
echo $USB_AWAKE_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias
AWAKE=
fi;
if [ $SLEEPING = "sleeping" ]; then
echo $USB_SLEEP_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/up_threshold
echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/sampling_rate
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/powersave_bias
SLEEPING=
fi;
done &)
}
Power() {
(while [ 1 ]; do
if [ $AWAKE = "awake" ]; then
echo $POW_AWAKE_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias
AWAKE=
fi;
if [ $SLEEPING = "sleeping" ]; then
echo $POW_SLEEP_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/up_threshold
echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/sampling_rate
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/powersave_bias
SLEEPING=
fi;
done &)
}
#
# Loopy Smoothness Tweak for X10
#
for n in 1 2
do
USER_LAUNCHER="com.sonyericsson.home" # Change this to your launcher app
NUMBER_OF_CHECKS=35 # Total number of rechecks before ending 1st loop
SLEEP_TIME=3 # Number of seconds between rechecking processes
PROCESSES_TOTAL=4 # Must be edited to match the number of processes to be checked
DEBUG_ECHO=0 # Debug on/off
CHECK_COUNT=0 # Don't edit
P_CHECK=0 # Don't edit
CHECK_OK=0 # Unused
PROCESS_1=0; PROCESS_2=0; PROCESS_3=0; PROCESS_4=0; PROCESS_5=0; PROCESS_6=0;
PROCESS_7=0; PROCESS_8=0; PROCESS_9=0; PROCESS_10=0; PROCESS_11=0; PROCESS_12=0;
PROCESS_13=0; PROCESS_14=0; PROCESS_15=0; PROCESS_16=0; PROCESS_17=0; PROCESS_18=0;
PROCESS_19=0; PROCESS_20=0; PROCESS_21=0; PROCESS_22=0; PROCESS_23=0; PROCESS_24=0;
if [ $n -eq "1" ]; then
if [ $DEBUG_ECHO -eq "1" ]; then
echo ""
echo "LST Debug: $(date)"
echo "LST Debug: Initiate"
fi;
# Pause and then loop until kswapd0 is found, which should be instant anyway
sleep 1
SWAP_SLEEP_TIME=3; SWAP_NUMBER_OF_CHECKS=30; SWAP_CHECK_COUNT=0; SWAP_CHECK_COUNT_OK=0; while [ $SWAP_CHECK_COUNT -lt $SWAP_NUMBER_OF_CHECKS ]; do if [ `pidof kswapd0` ]; then renice 19 `pidof kswapd0`; SWAP_CHECK_COUNT=$SWAP_NUMBER_OF_CHECKS; SWAP_CHECK_COUNT_OK=1; else sleep $SWAP_SLEEP_TIME; fi; SWAP_CHECK_COUNT=`expr $SWAP_CHECK_COUNT + 1`; done; if [ $SWAP_CHECK_COUNT_OK -lt 1 ]; then echo "LST Debug: 'kswapd0' expired after `expr $SWAP_CHECK_COUNT \* $SWAP_SLEEP_TIME` seconds"; fi;
if [ $DEBUG_ECHO -eq "1" ]; then
echo "LST Debug: $(date)";
echo "LST Debug: kswapd0 found";
fi;
fi;
# Check briefly one more time
if [ $n -eq "2" ]; then
if [ $DEBUG_ECHO -eq "1" ]; then
echo "LST Debug: 2nd loop"
fi;
NUMBER_OF_CHECKS=6 # Editing not recommended
SLEEP_TIME=5 # Editing not recommended
fi;
while [ $CHECK_COUNT -lt $NUMBER_OF_CHECKS ];
do
# Resident system apps
if [ $PROCESS_1 -eq "0" ]; then PNAME="com.android.phone"; NICELEVEL=-20; if [ `pidof $PNAME` ]; then renice $NICELEVEL `pidof $PNAME`; PROCESS_1=1; P_CHECK=`expr $P_CHECK + 1`; fi; fi;
if [ $PROCESS_2 -eq "0" ]; then PNAME="$USER_LAUNCHER"; NICELEVEL=-19; if [ `pidof $PNAME` ]; then renice $NICELEVEL `pidof $PNAME`; PROCESS_2=1; P_CHECK=`expr $P_CHECK + 1`; fi; fi;
if [ $PROCESS_3 -eq "0" ]; then PNAME="com.sonyericsson.conversations"; NICELEVEL=-19; if [ `pidof $PNAME` ]; then renice $NICELEVEL `pidof $PNAME`; PROCESS_3=1; P_CHECK=`expr $P_CHECK + 1`; fi; fi;
if [ $PROCESS_4 -eq "0" ]; then PNAME="com.sonyericsson.music"; NICELEVEL=-19; if [ `pidof $PNAME` ]; then renice $NICELEVEL `pidof $PNAME`; PROCESS_4=1; P_CHECK=`expr $P_CHECK + 1`; fi; fi;
# If all processes are done, loop can finish early
if [ $P_CHECK -ge $PROCESSES_TOTAL ]; then CHECK_COUNT=$NUMBER_OF_CHECKS; else sleep $SLEEP_TIME; fi;
CHECK_COUNT=`expr $CHECK_COUNT + 1`;
done
if [ $DEBUG_ECHO -eq "1" ]; then
echo "LST Debug: $(date)"
if [ $PROCESS_1 -eq "0" ]; then echo "LST Debug: PROCESS_1 expired after `expr $CHECK_COUNT \* $SLEEP_TIME` seconds"; fi;
if [ $PROCESS_2 -eq "0" ]; then echo "LST Debug: PROCESS_2 expired after `expr $CHECK_COUNT \* $SLEEP_TIME` seconds"; fi;
if [ $PROCESS_3 -eq "0" ]; then echo "LST Debug: PROCESS_3 expired after `expr $CHECK_COUNT \* $SLEEP_TIME` seconds"; fi;
if [ $PROCESS_3 -eq "0" ]; then echo "LST Debug: PROCESS_3 expired after `expr $CHECK_COUNT \* $SLEEP_TIME` seconds"; fi;
echo "LST Debug: Checking complete"
fi;
done
if [ $DEBUG_ECHO -eq "1" ]; then
echo "LST Debug: Done"
echo ""
fi;
this is an exemple!
but you could use it !
it improve speed of your phone hahaha !!!
bip
i tried install-recovery but i got no file at local/temp??? there should be a log file in it rigth?
Another tip - add this command to the top of the script:
Code:
set -xv
This will give full command echoing when you run the script so you can see where the error is. The android shell doesn't report lines accurately, I think it's because it doesn't count comments as lines. It will also make easily visible syntax errors that dont error but cause a conditional to report incorrect, e.g. if you accidentally use == instead of = or forget double-quotes when comparing strings.

[TWEAKS][SCRIPTS] Collection build.prop; init.d; etc. Now with Tewaks-Combo

I've been collecting some tweaks and scripts and seems to me it's now time to share it. While some values in terms of optimization might be different from device to device, I've found these pretty consistent throughout many.
I didn't tested all of them, and i don't assume any risk!!! Use them at you own risk!!!
Some useful tips on how to use them at the end of the post
This thread will be updated when new/better things come out
Superuser, Busybox install/update
1. Easily install Busybox (YOU NEED ROOT FIRST)
Code:
https://play.google.com/store/apps/details?id=com.jrummy.busybox.installer&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5qcnVtbXkuYnVzeWJveC5pbnN0YWxsZXIiXQ..
2. UPDATE SuperUser (root app)
Code:
http://goo.im/superuser/
Build.prop
(edit your /system/build.prop with a file manager with root access)
Careful for already existing settings. In this case, just change the values.
1. Force launcher into memory
Code:
ro.HOME_APP_ADJ=1
2. Raise JPG quality to 100%
Code:
ro.media.enc.jpeg.quality=100
3. VM Heapsize; higher the RAM, higher the hp can be
Code:
dalvik.vm.heapsize=96m
4. Render UI with GPU
Code:
debug.sf.hw=1
5. Decrease dialing out delay
Code:
ro.telephony.call_ring.delay=0
6. Helps scrolling responsiveness
Code:
windowsmgr.max_events_per_sec=150
7. Save battery
Code:
wifi.supplicant_scan_interval=180
pm.sleep_mode=1
ro.ril.disable.power.collapse=0
8. Disable debugging notify icon on statusbar
Code:
persist.adb.notify=0
9. Increase overall touch responsiveness
Code:
debug.performance.tuning=1
video.accelerate.hw=1
10. Raise photo and video recording quality
Code:
ro.media.dec.jpeg.memcap=12000000
ro.media.enc.hprof.vid.bps=12000000
11. Signal (3G) tweaks
Code:
ro.ril.hsxpa=2
ro.ril.gprsclass=10
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=10
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=5
12. Net speed tweaks
Code:
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
13. Disable blackscreen issue after a call
Code:
ro.lge.proximity.delay=25
mot.proximity.delay=25
14. Fix some application issues
Code:
ro.kernel.android.checkjni=0
15. Phone will not wake up from hitting the volume rocker
Code:
ro.config.hwfeature_wakeupkey=0
16. Force button lights on when screen is on
Code:
ro.mot.buttonlight.timeout=0
17. Disable boot animation for faster boot
Code:
debug.sf.nobootanimation=1
18. Miscellaneous flags
Code:
ro.config.hw_menu_unlockscreen=false
persist.sys.use_dithering=0
persist.sys.purgeable_assets=1
dalvik.vm.dexopt-flags=m=y
ro.mot.eri.losalert.delay=1000
19. Specifics to some LG devices
Code:
persist.service.pcsync.enable=0
persist.service.lgospd.enable=0
user.feature.flex=true
user.feature.lgdrm=false
user.feature.lgresource=false
user.feature.lgpoweroff=false
user.feature.ls_event=false
user.feature.ls_normal=false
user.feature.sui=false
Init.d
(needs ROM with init.d access and busybox, open empty file, insert header #!/system/bin/sh and put these there, save in /system/etc/init.d and name it something like 77tweaks)
1. strict minfree handler tweak
Code:
echo "2048,3072,6144,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
2. internet speed tweaks
Code:
echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout;
echo "404480" > /proc/sys/net/core/wmem_max;
echo "404480" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem;
echo "4096,87380,404480" > /proc/sys/net/ipv4/tcp_rmem;
3. vm management tweaks
Code:
echo "4096" > /proc/sys/vm/min_free_kbytes
echo "0" > /proc/sys/vm/oom_kill_allocating_task;
echo "0" > /proc/sys/vm/panic_on_oom;
echo "0" > /proc/sys/vm/laptop_mode;
echo "0" > /proc/sys/vm/swappiness
echo "50" > /proc/sys/vm/vfs_cache_pressure
echo "90" > /proc/sys/vm/dirty_ratio
echo "70" > /proc/sys/vm/dirty_background_ratio
4. misc kernel tweaks
Code:
echo "8" > /proc/sys/vm/page-cluster;
echo "64000" > /proc/sys/kernel/msgmni;
echo "64000" > /proc/sys/kernel/msgmax;
echo "10" > /proc/sys/fs/lease-break-time;
echo "500,512000,64,2048" > /proc/sys/kernel/sem;
5. battery tweaks
Code:
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
6. EXT4 tweaks (greatly increase I/O)
(needs /system, /cache, /data partitions formatted to EXT4)
a) removes journalism
Code:
tune2fs -o journal_data_writeback /block/path/to/system
tune2fs -O ^has_journal /block/path/to/system
tune2fs -o journal_data_writeback /block/path/to/cache
tune2fs -O ^has_journal /block/path/to/cache
tune2fs -o journal_data_writeback /block/path/to/data
tune2fs -O ^has_journal /block/path/to/data
b) perfect mount options
Code:
busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,barrier=0,nobh /system
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /data
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /cache
7. Flags blocks as non-rotational and increases cache size
Code:
LOOP=`ls -d /sys/block/loop*`;
RAM=`ls -d /sys/block/ram*`;
MMC=`ls -d /sys/block/mmc*`;
for j in $LOOP $RAM
do
echo "0" > $j/queue/rotational;
echo "2048" > $j/queue/read_ahead_kb;
done
8. microSD card speed tweak
Code:
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
9. Defrags database files
Code:
for i in \
`find /data -iname "*.db"`
do \
sqlite3 $i 'VACUUM;';
done
9. Remove logger
Code:
rm /dev/log/main
10. Ondemand governor tweaks
Code:
SAMPLING_RATE=$(busybox expr `cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency` \* 750 / 1000)
echo 95 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo $SAMPLING_RATE > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
11. Auto change governor and I/O Scheduler
a) I/O Scheduler (Best: MTD devices - VR; EMMC devices - SIO) - needs kernel with these
Code:
echo "vr" > /sys/block/mmcblk0/queue/scheduler
or
echo "sio" > /sys/block/mmcblk0/queue/scheduler
b) Governor (Best: Minmax > SavagedZen > Smoothass > Smartass > Interactive) - needs kernel with these
Code:
echo "governor-name-here" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
12. Auto-zipalign on boot
(needs zipalign bin)
Code:
[url]http://forum.xda-developers.com/showthread.php?t=860586[/url]
13. Loopy Smoothness tweak
Code:
[url]http://forum.xda-developers.com/showthread.php?t=1137554[/url]
[url]http://forum.xda-developers.com/showthread.php?t=1205744[/url]
14. Move dalvik-cache to cache partition (if it's big enough) to free up data partition space
Code:
CACHESIZE=$(df -k /cache | tail -n1 | tr -s ' ' | cut -d ' ' -f2)
if [ $CACHESIZE -gt 80000 ]
then
echo "Large cache detected, moving dalvik-cache to /cache"
if [ ! -d /cache/dalvik-cache ]
then
busybox rm -rf /cache/dalvik-cache /data/dalvik-cache
mkdir /cache/dalvik-cache /data/dalvik-cache
fi
busybox chown 1000:1000 /cache/dalvik-cache
busybox chmod 0771 /cache/dalvik-cache
# bind mount dalvik-cache so we can still boot without the sdcard
busybox mount -o bind /cache/dalvik-cache /data/dalvik-cache
busybox chown 1000:1000 /data/dalvik-cache
busybox chmod 0771 /data/dalvik-cache
else
echo "Small cache detected, dalvik-cache will remain on /data"
fi
15. Disable normalize sleeper
Code:
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
16. OOM groupings and priorities tweaks - SuperCharger
Code:
[url]http://forum.xda-developers.com/showthread.php?t=991276[/url]
GPS.conf
(create or edit your /system/etc/gps.conf with a file manager with root access)
For improving GPS lock time and signal.
a) European NTP server (replace for america or asia in your case)
Code:
NTP_SERVER=europe.pool.ntp.org
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
b) SE supl for A-GPS (better than Nokia's or Google's)
Code:
SUPL_HOST=supl.sonyericsson.com
SUPL_PORT=7275
Other tweaks or guidelines
1. Patch your hosts file for blocking Ads
(please think before doing this; many developers are supported through this way)
Code:
You can use AdFree application for this or changing manually your hosts file.
Here are some databases:
http://www.mvps.org/winhelp2002/hosts.txt
http://pgl.yoyo.org/adservers/serverlist.php?showintro=0;hostformat=hosts
2. Use CyanogenMOD's APN list file - it's one of the most complete.
Code:
It's located in /system/etc/apns-conf.xml
3. Use UOT kitchen for basic theming on your device.
Code:
http://uot.dakra.lt/
4. Use Google's dns servers
Code:
Create an empty file, name it resolv.conf and put there these 2 lines:
nameserver 8.8.8.8
nameserver 8.8.4.4
Save to /system/etc/.
5. Update Superuser and su binary to latest version (3.0 beta)
Code:
http://goo-inside.me/superuser/
6. Disable sync feature in sqlite
(author: ownhere - needs a source for your device so you can compile the /system/lib/libsqlite.so)
Code:
Patch file here: http://forum.xda-developers.com/showthread.php?t=903507
7. Do not use task killers.
sysctl_tweaks and sysctl.conf tweaks
added by krabappel2548 Thank him
To make them work:
1. make a new file in /system/etc/init.d, name it sysctl_tweaks
2. make a new file in /system/etc, name it sysctl.conf
3. Paste the right code in the right file
1. sysctl_tweaks
Code:
#!/system/bin/sh
# grep sysctl /etc/init.d/*
/etc/init.d/02vm:# Load /sys/etc/sysctl.conf
/etc/init.d/02vm:sysctl -p
2. sysctl.conf
Code:
#sysctl.conf file
############################
# Battery life tweaks #
############################
sysctl -w vm.dirty_writeback_centisecs=3000;
sysctl -w vm.dirty_expire_centisecs=500;
############################
# kernel tweaks #
############################
sysctl -w kernel.sched_features=15834233;
sysctl -w kernel.msgmni=1024;
sysctl -w kernel.msgmax=64000;
sysctl -w kernel.shmmax=268435456;
sysctl -w kernel.shmall=2097152;
sysctl -w kernel.sem="500 512000 100 2048";
sysctl -w kernel.hung_task_timeout_secs=0;
sysctl -w kernel.sched_latency_ns=18000000;
sysctl -w kernel.sched_compat_yield=1;
sysctl -w kernel.sched_shares_ratelimit=256000;
sysctl -w kernel.sched_child_runs_first=0;
sysctl -w kernel.threads-max=10000;
sysctl -w kernel.panic=30;
sysctl -w kernel.panic_on_oops=1;
sysctl -w kernel.sched_features=24189;
sysctl -w kernel.sched_min_granularity_ns=1500000;
sysctl -w kernel.sched_wakeup_granularity_ns=3000000;
############################
# CPU tweaks #
############################
# Queue size modifications
sysctl -w net.core.optmem_max=20480;
sysctl -w net.unix.max_dgram_qlen=50;
# Net Core Settings
# Location: /proc/sys/net/core
sysctl -w net.core.wmem_max=524288;
sysctl -w net.core.rmem_max=524288;
sysctl -w net.core.rmem_default=256960;
sysctl -w net.core.wmem_default=256960;
############################
# VM & Filesystem tweaks #
############################
sysctl -w fs.lease-break-time=10;
sysctl -w fs.file-max=65536;
sysctl -w vm.overcommit_memory=1;
sysctl -w vm.min_free_order_shift=4;
sysctl -w vm.block_dump=0;
sysctl -w vm.oom_dump_tasks=1;
sysctl -w vm.page-cluster=3;
############################
# Net Speed tweaks #
############################
# UnderUtilized Networking Tweaks below as recommended by avgjoemomma (from XDA)
sysctl -w net.ipv4.tcp_congestion_control=cubic;
# Hardening the TCP/IP stack to SYN attacks
sysctl -w net.ipv4.tcp_syncookies=1;
sysctl -w net.ipv4.conf.all.rp_filter=1;
sysctl -w net.ipv4.conf.default.rp_filter=1;
sysctl -w net.ipv4.tcp_synack_retries=2;
sysctl -w net.ipv4.tcp_syn_retries=2;
sysctl -w net.ipv4.tcp_max_syn_backlog=1024;
sysctl -w net.ipv4.tcp_max_tw_buckets=16384;
sysctl -w net.ipv4.icmp_echo_ignore_all=1;
sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1;
sysctl -w net.ipv4.tcp_no_metrics_save=1;
sysctl -w net.ipv4.tcp_fin_timeout=15;
sysctl -w net.ipv4.tcp_keepalive_time=1800;
sysctl -w net.ipv4.ip_forward=0;
sysctl -w net.ipv4.tcp_moderate_rcvbuf=1;
sysctl -w net.ipv4.route.flush=1;
sysctl -w net.ipv4.udp_rmem_min=6144;
sysctl -w net.ipv4.udp_wmem_min=6144;
sysctl -w net.ipv4.tcp_rfc1337=1;
sysctl -w net.ipv4.ip_no_pmtu_disc=0;
sysctl -w net.ipv4.tcp_ecn=0;
sysctl -w net.ipv4.tcp_sack=1;
sysctl -w net.ipv4.tcp_fack=1;
# Don't accept source routing
sysctl -w net.ipv4.conf.default.accept_source_route=0 ;
sysctl -w net.ipv4.conf.all.accept_source_route=0;
# Don't accept redirects
sysctl -w net.ipv4.conf.all.accept_redirects=0;
sysctl -w net.ipv4.conf.default.accept_redirects=0;
sysctl -w net.ipv4.conf.all.secure_redirects=0;
sysctl -w net.ipv4.conf.default.secure_redirects=0;
This is another init.d tweak It's a battery calibration script
3. This is my battery calibration tweak
Code:
#!/system/bin/sh
# ========================================
# init.d script for KA Xperia SSpeed
# made by krabappel2548
# ========================================
SLEEP=120
if [ -e /data/.battery-calibrated ] ; then
exit 0
fi
(
while : ; do
LEVEL=$(cat /sys/class/power_supply/battery/capacity)
CUR=$(cat /sys/class/power_supply/battery/batt_current)
if [ "$LEVEL" == "100" ] && [ "$CUR" == "0" ] ; then
log -p i -t battery-calibration "*** LEVEL: $LEVEL CUR: $CUR***: calibrating..."
rm -f /data/system/batterystats.bin
touch /data/.battery-calibrated
exit 0
fi
# log -p i -t battery-calibration "*** LEVEL: $LEVEL CUR: $CUR ***: sleeping for $SLEEP s..."
sleep $SLEEP
done
) &
#Disable normalize sleeper
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
#battery tweaks (sleepers)
mount -t debugfs none /sys/kernel/debug
echo NO_NEW_FAIR_SLEEPERS > /sys/kernel/debug/sched_features;
echo NO_NORMALIZED_SLEEPERS > /sys/kernel/debug/sched_features;
umount /sys/kernel/debug
Tips Combined twaks and apps
Still testing better values to add!
1. incredibile fast browsing in zoomed pages with no shutters!
♦ VM Heapsize; higher the RAM, higher the hp can be
Code:
dalvik.vm.heapsize=96m
♦ Helps scrolling responsiveness
Code:
windowsmgr.max_events_per_sec=250
♦ Opera Mobile Browser
2. Faster internet speed
♦ Signal (3G) tweaks
Code:
ro.ril.hsxpa=2
ro.ril.gprsclass=10
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=10
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=5
♦ Net speed tweaks
Code:
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
Alright, I think this is it for now.
If you have any other tweaks or better values, you can PM me and I'll include them
thanks to
kenzo
krabappel2548
thanks ve been waiting for this
Nice work been looking for some of these
Sent from my LT26i using xda premium
can i use it for xperia u?
10/40 said:
can i use it for xperia u?
Click to expand...
Click to collapse
Yes you can.
Sent from my LT26i using Tapatalk 2
gm007 said:
Yes you can.
Sent from my LT26i using Tapatalk 2
Click to expand...
Click to collapse
thx ...have to try it, soon
added Tweaks Combination to make it easier to understand for new people
nice job u done here very useful,
The Mods should make this thread sticky
May I put those scripts everywhere I can in build.prop ?
mpttrung said:
May I put those scripts everywhere I can in build.prop ?
Click to expand...
Click to collapse
nope add them at the end of the page and leave a free row between them to avoid problems
WebMuth said:
nope add them at the end of the page and leave a free row between them to avoid problems
Click to expand...
Click to collapse
ok, thanks ! lets me check it out
optik19918 said:
4. Render UI with GPU
Code:
debug.sf.hw=1
Click to expand...
Click to collapse
This one was already added by Sony in build.prop
optik19918 said:
7. Save battery
Code:
pm.sleep_mode=1
ro.ril.disable.power.collapse=0
Click to expand...
Click to collapse
I tested these a while ago and found them not effective. I even experienced less battery drain without these 2 lines
optik19918 said:
10. Raise photo and video recording quality
Code:
ro.media.dec.jpeg.memcap=8000000
Click to expand...
Click to collapse
I'm not sure if these help because we have 12mp camera and not 8.
optik19918 said:
b) SE supl for A-GPS (better than Nokia's or Google's)
Code:
SUPL_HOST=supl.sonyericsson.com
SUPL_PORT=7275
Click to expand...
Click to collapse
These are also already added by Sony
btw I'll post some more tweaks here later so you can add them to first post
krabappel2548 said:
This one was already added by Sony in build.prop
I tested these a while ago and found them not effective. I even experienced less battery drain without these 2 lines
I'm not sure if these help because we have 12mp camera and not 8.
These are also already added by Sony
btw I'll post some more tweaks here later so you can add them to first post
Click to expand...
Click to collapse
thanks for all i'l update when i go home now i'm at work!
some values are wrong becose i have those tweaks since the time of the x10
and i left the one already added by Sony in build.prop to make them easier to understand
Sent from my LT26i using xda premium
Here are some more tweaks Feel free to add them to the first post
To make them work:
1. make a new file in /system/etc/init.d, name it sysctl_tweaks
2. make a new file in /system/etc, name it sysctl.conf
3. Paste the right code in the right file
1. sysctl_tweaks
Code:
#!/system/bin/sh
# grep sysctl /etc/init.d/*
/etc/init.d/02vm:# Load /sys/etc/sysctl.conf
/etc/init.d/02vm:sysctl -p
2. sysctl.conf
Code:
#sysctl.conf file
############################
# Battery life tweaks #
############################
sysctl -w vm.dirty_writeback_centisecs=3000;
sysctl -w vm.dirty_expire_centisecs=500;
############################
# kernel tweaks #
############################
sysctl -w kernel.sched_features=15834233;
sysctl -w kernel.msgmni=1024;
sysctl -w kernel.msgmax=64000;
sysctl -w kernel.shmmax=268435456;
sysctl -w kernel.shmall=2097152;
sysctl -w kernel.sem="500 512000 100 2048";
sysctl -w kernel.hung_task_timeout_secs=0;
sysctl -w kernel.sched_latency_ns=18000000;
sysctl -w kernel.sched_compat_yield=1;
sysctl -w kernel.sched_shares_ratelimit=256000;
sysctl -w kernel.sched_child_runs_first=0;
sysctl -w kernel.threads-max=10000;
sysctl -w kernel.panic=30;
sysctl -w kernel.panic_on_oops=1;
sysctl -w kernel.sched_features=24189;
sysctl -w kernel.sched_min_granularity_ns=1500000;
sysctl -w kernel.sched_wakeup_granularity_ns=3000000;
############################
# CPU tweaks #
############################
# Queue size modifications
sysctl -w net.core.optmem_max=20480;
sysctl -w net.unix.max_dgram_qlen=50;
# Net Core Settings
# Location: /proc/sys/net/core
sysctl -w net.core.wmem_max=524288;
sysctl -w net.core.rmem_max=524288;
sysctl -w net.core.rmem_default=256960;
sysctl -w net.core.wmem_default=256960;
############################
# VM & Filesystem tweaks #
############################
sysctl -w fs.lease-break-time=10;
sysctl -w fs.file-max=65536;
sysctl -w vm.overcommit_memory=1;
sysctl -w vm.min_free_order_shift=4;
sysctl -w vm.block_dump=0;
sysctl -w vm.oom_dump_tasks=1;
sysctl -w vm.page-cluster=3;
############################
# Net Speed tweaks #
############################
# UnderUtilized Networking Tweaks below as recommended by avgjoemomma (from XDA)
sysctl -w net.ipv4.tcp_congestion_control=cubic;
# Hardening the TCP/IP stack to SYN attacks
sysctl -w net.ipv4.tcp_syncookies=1;
sysctl -w net.ipv4.conf.all.rp_filter=1;
sysctl -w net.ipv4.conf.default.rp_filter=1;
sysctl -w net.ipv4.tcp_synack_retries=2;
sysctl -w net.ipv4.tcp_syn_retries=2;
sysctl -w net.ipv4.tcp_max_syn_backlog=1024;
sysctl -w net.ipv4.tcp_max_tw_buckets=16384;
sysctl -w net.ipv4.icmp_echo_ignore_all=1;
sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1;
sysctl -w net.ipv4.tcp_no_metrics_save=1;
sysctl -w net.ipv4.tcp_fin_timeout=15;
sysctl -w net.ipv4.tcp_keepalive_time=1800;
sysctl -w net.ipv4.ip_forward=0;
sysctl -w net.ipv4.tcp_moderate_rcvbuf=1;
sysctl -w net.ipv4.route.flush=1;
sysctl -w net.ipv4.udp_rmem_min=6144;
sysctl -w net.ipv4.udp_wmem_min=6144;
sysctl -w net.ipv4.tcp_rfc1337=1;
sysctl -w net.ipv4.ip_no_pmtu_disc=0;
sysctl -w net.ipv4.tcp_ecn=0;
sysctl -w net.ipv4.tcp_sack=1;
sysctl -w net.ipv4.tcp_fack=1;
# Don't accept source routing
sysctl -w net.ipv4.conf.default.accept_source_route=0 ;
sysctl -w net.ipv4.conf.all.accept_source_route=0;
# Don't accept redirects
sysctl -w net.ipv4.conf.all.accept_redirects=0;
sysctl -w net.ipv4.conf.default.accept_redirects=0;
sysctl -w net.ipv4.conf.all.secure_redirects=0;
sysctl -w net.ipv4.conf.default.secure_redirects=0;
This is another init.d tweak It's a battery calibration script
3. This is my battery calibration tweak
Code:
#!/system/bin/sh
# ========================================
# init.d script for KA Xperia SSpeed
# made by krabappel2548
# ========================================
SLEEP=120
if [ -e /data/.battery-calibrated ] ; then
exit 0
fi
(
while : ; do
LEVEL=$(cat /sys/class/power_supply/battery/capacity)
CUR=$(cat /sys/class/power_supply/battery/batt_current)
if [ "$LEVEL" == "100" ] && [ "$CUR" == "0" ] ; then
log -p i -t battery-calibration "*** LEVEL: $LEVEL CUR: $CUR***: calibrating..."
rm -f /data/system/batterystats.bin
touch /data/.battery-calibrated
exit 0
fi
# log -p i -t battery-calibration "*** LEVEL: $LEVEL CUR: $CUR ***: sleeping for $SLEEP s..."
sleep $SLEEP
done
) &
#Disable normalize sleeper
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
#battery tweaks (sleepers)
mount -t debugfs none /sys/kernel/debug
echo NO_NEW_FAIR_SLEEPERS > /sys/kernel/debug/sched_features;
echo NO_NORMALIZED_SLEEPERS > /sys/kernel/debug/sched_features;
umount /sys/kernel/debug
Big thanks for krabappel and optik!!
Sent from my Sony Xperia™ S
@krabappel2548: are the tweaks you posted already in your ka08 rom?
Apology11 said:
@krabappel2548: are the tweaks you posted already in your ka08 rom?
Click to expand...
Click to collapse
Yes
Sent from my LT26i using XDA
@Optik @Krabappel
i've just added all tweaks right now...bt i recognized my benchmark decreased it's now 6693 and it was 6900..im using doomkernel..maybe some tweaks or not compatible with it??
I added ro.mot.buttonlight.timeout=0 in the end of build.prop but it doesn't seem to have effect. Reboot didn't help either.
amfirbek92 said:
@Optik @Krabappel
i've just added all tweaks right now...bt i recognized my benchmark decreased it's now 6693 and it was 6900..im using doomkernel..maybe some tweaks or not compatible with it??
Click to expand...
Click to collapse
Stop looking at synthetic benchmark scores if your phone otherwise feels snappy.
mikbe said:
I added ro.mot.buttonlight.timeout=0 in the end of build.prop but it doesn't seem to have effect. Reboot didn't help either.
Stop looking at synthetic benchmark scores if your phone otherwise feels snappy.
Click to expand...
Click to collapse
Just removed ondemand governor tweak..everything seems very good now..and the benchmark is around 7400
Sent from my Sony Xperia™ S

[SCRIPTS][INIT.D] KangBang Kernel [DEVELOPMENT]

KangBang Kernel Scripts Development
This thread is dedicated to the development of bash scripts to control several aspects of KangBang Kernel.
The scripts below, are there for that. most of the work have been done already (but more additions to be made), but be are with problems on the logs files... the output indicates that the scripts are giving errors...
these are scripts so far​
S91voltctrl​
Spoiler
Code:
#!/system/bin/sh
##############################################################
## CPU/GPU Voltage and Frequency Control script by infected_ #
##############################################################
LOG_FILE=/data/log/cpu_gpu_control.log
rm -Rf $LOG_FILE
exec &> $LOG_FILE
# ************************************
# CPU Clock Control
# ************************************
echo "Starting Voltage and Frequency Control $( date +"%m-%d-%Y %H:%M:%S" )"
echo "Sleeping for 20 seconds to workaround oc not setting properly on stock derivatve roms..."
sleep 20
echo "Ok lets start working"
echo "Set MIN Scaling Frequency"
echo "200000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo ""
echo "---------------"
echo "Set MAX Scaling Frequency"
echo "1000000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo ""
echo "---------------"
# ************************************
# CPU Governor and I/O Scheduler
# ************************************
echo "Set Scheduler for stl, bml and mmc"
for i in `ls /sys/block/stl*` /sys/block/bml* /sys/block/mmcblk* /sys/block/mtdblock* ; do
echo "zen" > $i/queue/scheduler;
echo "$i/queue/scheduler";
done;
echo "---------------";
echo "Set governor"
echo "zzmoove" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ""
echo "---------------"
#
echo "Set zzmove extra options"
# *************************************
# "zzmove" cpu governor extra settings
# *************************************
echo "85" > /sys/devices/system/cpu/cpufreq/zzmoove/up_threshold;
echo "85" > /sys/devices/system/cpu/cpufreq/zzmoove/up_threshold_hotplug1;
echo "80" > /sys/devices/system/cpu/cpufreq/zzmoove/down_threshold;
echo "75" > /sys/devices/system/cpu/cpufreq/zzmoove/down_threshold_hotplug1;
echo "85" > /sys/devices/system/cpu/cpufreq/zzmoove/down_threshold_sleep;
echo "5" > /sys/devices/system/cpu/cpufreq/zzmoove/freq_step;
echo "1" > /sys/devices/system/cpu/cpufreq/zzmoove/hotplug_sleep;
echo "4" > /sys/devices/system/cpu/cpufreq/zzmoove/sampling_down_factor;
echo "100000" > /sys/devices/system/cpu/cpufreq/zzmoove/sampling_rate;
echo "500000" > /sys/devices/system/cpu/cpufreq/zzmoove/freq_limit_sleep;
echo "75" > /sys/devices/system/cpu/cpufreq/zzmoove/smooth_up;
echo "95" > /sys/devices/system/cpu/cpufreq/zzmoove/up_threshold_sleep;
# ************************************
# CPU Voltage Control
# ************************************
echo "Set UV" | tee -a $LOG_FILE;
echo "1275 1250 1200 1175 1150 1100 1050 1000 950 900 875 925 850 850 825 825 800 775" > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table #change voltages according to your device !!!
echo ""
echo "---------------"
# ************************************
# Screen Off CPU Policy
# ************************************
# Disable second CPU core when screen is off (default 0=second core enabled)
echo "Disable second CPU core when screen is off"
echo "1" /sys/devices/system/cpu/cpufreq/zzmoove/hotplug_sleep;
echo ""
echo "---------------"
# ************************************
# GPU Clock, Voltages & Thresholds
# ************************************
# Set GPU clocks (Valid values are: 100 160 200 267)
echo "Set GPU frequencies"
echo "100 160 267" > /sys/class/misc/gpu_clock_control/gpu_control;
echo ""
echo "---------------"
# Set GPU Up and Down thresholds
echo "Set GPU thresholds"
echo "80% 50% 85% 60%" > /sys/class/misc/gpu_clock_control/gpu_control;
echo ""
echo "---------------"
# Set GPU voltages (Changes possible at +/-50mV ie at 50000 steps)
echo "Set GPU UV"
echo "850000 900000 950000" > /sys/class/misc/gpu_voltage_control/gpu_control;
echo ""
echo "---------------"
#
echo "Voltage and Frequency Control finished at $( date +"%m-%d-%Y %H:%M:%S" )"
S92zipalign (credits goes to darky for original)​
Spoiler
Code:
#!/system/bin/sh
##############################################################
## Automatic ZipAlign script by infected_ #
##############################################################
su
LOG_FILE=/data/log/zipalign.log
rm -Rf $LOG_FILE
exec &> $LOG_FILE
#
if [ -n $zipalign ] && [ $zipalign = "true" ];
then
busybox mount -o remount,rw /;
busybox mount -o remount,rw -t auto /system;
busybox mount -o remount,rw -t auto /data;
fi;
busybox mount -t tmpfs -o size=70m none /mnt/tmp;
echo "Starting Automatic ZipAlign " `date`
echo "Starting Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )"
for apk in /data/app/*.apk ; do
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
echo ZipAligning $(basename $apk)
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed
fi;
else
echo ZipAlign already completed on $apk
fi;
done;
for apk in /system/app/*.apk ; do
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
echo ZipAligning $(basename $apk)
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed
fi;
else
echo ZipAlign already completed on $apk
fi;
done;
for apk in /system/framework/*.apk ; do
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
echo ZipAligning $(basename $apk)
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed
fi;
else
echo ZipAlign already completed on $apk
fi;
done;
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )"
S93sqlite​
Spoiler
Code:
#!/system/bin/sh
##############################################################
## SQLite database VACUUM and REINDEX script by infected_ #
##############################################################
LOG_FILE=/data/log/sqlite.log
rm -Rf $LOG_FILE
exec &> $LOG_FILE
# echo "";
echo "*********************************************";
echo "Optimizing and defragging your database files (*.db)";
echo "Ignore the 'database disk image is malformed' error";
echo "Ignore the 'no such collation sequence' error";
echo "*********************************************";
echo "";
#
#
echo "SQLite database VACUUM and REINDEX started at $( date +"%m-%d-%Y %H:%M:%S" )"
for i in \
`busybox find /data -iname "*.db"`;
do \
/system/xbin/sqlite3 $i 'VACUUM;';
/system/xbin/sqlite3 $i 'REINDEX;';
done;
if [ -d "/dbdata" ]; then
for i in \
`busybox find /dbdata -iname "*.db"`;
do \
/system/xbin/sqlite3 $i 'VACUUM;';
/system/xbin/sqlite3 $i 'REINDEX;';
done;
fi;
if [ -d "/datadata" ]; then
for i in \
`busybox find /datadata -iname "*.db"`;
do \
/system/xbin/sqlite3 $i 'VACUUM;';
/system/xbin/sqlite3 $i 'REINDEX;';
done;
fi;
for i in \
`busybox find /sdcard -iname "*.db"`;
do \
/system/xbin/sqlite3 $i 'VACUUM;';
/system/xbin/sqlite3 $i 'REINDEX;';
done;
echo "SQLite database VACUUM and REINDEX finished at $( date +"%m-%d-%Y %H:%M:%S" )"
S94tweaks​
Code:
#!/system/bin/sh
##############################################################
## Miscellaneous Tweaks script by infected_ #
##############################################################
#
LOG_FILE=/data/log/tweaks.log
rm -Rf $LOG_FILE
exec &> $LOG_FILE
#
echo "Applying Tweaks $( date +"%m-%d-%Y %H:%M:%S" )"
#
# ***************************************
# Turn logging off
# ***************************************
#
echo "Turning off logging"
su
mount -o remount,rw /
rm -rf /dev/log
echo "0" > /sys/module/ump/parameters/ump_debug_level
echo "0" > /sys/module/mali/parameters/mali_debug_level
echo "0" > /sys/module/kernel/parameters/initcall_debug
echo "0" > /sys//module/lowmemorykiller/parameters/debug_level
echo "0" > /sys/module/earlysuspend/parameters/debug_mask
echo "0" > /sys/module/alarm/parameters/debug_mask
echo "0" > /sys/module/alarm_dev/parameters/debug_mask
echo "0" > /sys/module/binder/parameters/debug_mask
echo "0" > /sys/module/xt_qtaguid/parameters/debug_mask
echo ""
echo "---------------"
# ************************************************
# VM Tweaks
# ************************************************
echo "Enabling VM Tweaks"
sysctl -w vm.swappiness=0
sysctl -w vm.vfs_cache_pressure=10
sysctl -w vm.dirty_background_ratio=45
sysctl -w vm.dirty_ratio=50
sysctl -w vm.dirty_writeback_centisecs=2000
sysctl -w vm.dirty_expire_centisecs=1000
sysctl -w vm.min_free_kbytes=4096
sysctl -w kernel.sched_min_granularity_ns=200000 > /dev/null
sysctl -w kernel.sched_latency_ns=400000 > /dev/null
sysctl -w kernel.sched_wakeup_granularity_ns=100000 > /dev/null
echo ""
echo "---------------"
# ********************************************************
# Enable JIT Packet Filter Compiler (needs kernel support)
# ********************************************************
echo "Enabling JIT Packet Filter Compiler"
echo "1" > /proc/sys/net/core/bpf_jit_enable
echo ""
echo "---------------"
# ********************************************************
# microSD card speed tweak
# ********************************************************
echo "Enabling microSD card speed tweak"
echo "4096" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo ""
echo "---------------"
# ********************************************************
# Flags blocks as non-rotational and increases cache size
# ********************************************************
echo "Flagging blocks as non-rotational and increasig cache size"
LOOP=`ls -d /sys/block/loop*`;
RAM=`ls -d /sys/block/ram*`;
MMC=`ls -d /sys/block/mmc*`;
for j in $LOOP $RAM
do
echo "0" > $j/queue/rotational;
echo "4096" > $j/queue/read_ahead_kb;
done
echo ""
echo "---------------"
# ********************************************************
# Battery tweaks
# ********************************************************
echo "Enabling battery tweaks"
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
echo ""
echo "---------------"
# ********************************************************
# EXT4 tweaks
# ********************************************************
echo "Enabling EXT4 tweaks"
# a) remove journals
echo "Removing journals"
tune2fs -f -o journal_data_writeback /dev/block/mmcblk0p9
tune2fs -f -O ^has_journal /dev/block/mmcblk0p9
tune2fs -f -o journal_data_writeback /dev/block/mmcblk0p7
tune2fs -f -O ^has_journal /dev/block/mmcblk0p7
tune2fs -f -o journal_data_writeback /dev/block/mmcblk0p10
tune2fs -f -O ^has_journal /dev/block/mmcblk0p10
echo ""
echo "---------------"
# b) better mount options
echo "Applying better mount options"
busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,barrier=0,nobh /system
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /data
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /cache
echo ""
echo "---------------"
#
echo "Tweaks applying finished at $( date +"%m-%d-%Y %H:%M:%S" )"
S95bln​
Spoiler
Code:
#!/system/bin/sh
#######################################
# ************************************
# BLN and leds timeout
# ************************************
#
LOG_FILE=/data/log/bln.log
rm -Rf $LOG_FILE
exec &> $LOG_FILE
#
# ***************************************
# Enable Button Light Notification (BLN)
# ***************************************
#
echo "Enabling BLN $( date +"%m-%d-%Y %H:%M:%S" )"
echo 1 > /sys/class/misc/backlightnotification/enabled
echo ""
echo "---------------"
#
echo "Enabling BLN finished at $( date +"%m-%d-%Y %H:%M:%S" )"
# **************************************
# Enable Button Light Timeout
# **************************************
#
echo "Enabling leds timeout $( date +"%m-%d-%Y %H:%M:%S" )"
echo 3 > /sys/class/misc/notification/bl_timeout
echo ""
echo "---------------"
#
echo "Enabling leds timeout finished at $( date +"%m-%d-%Y %H:%M:%S" )"
#
# **************************************
# leds voltage setting
# **************************************
echo "setting leds voltage $( date +"%m-%d-%Y %H:%M:%S" )"
#
echo "---------------"
echo 2500 > /sys/devices/virtual/sec/sec_touchkey/touchkey_brightness
echo ""
echo "setting leds voltage finished at $( date +"%m-%d-%Y %H:%M:%S" )"
S91 is partially working, it sets the correct governor, speed, voltage and i/o scheduler, but gives other errors...
S92 no sure. zipalign binary seems to be doing its job, but strange output on log...
S93 seem to be working, sometimes it gives an error about *db being locked" or "permission denied" ...
S94 not working. lots of errors on log...
S95 is working properly.
Click to expand...
Click to collapse
We appreciate ALL the help we can't get from the XDA community..
This is a fantastic kernel compilded and mantained by @sakindia123, but there aren't lots of options to control it, besides the init.d scripts...
So please, if you have suggestions, corrections and additions to be made, please do so ! ​
reserved ..
Thank you for the topic. As i'm very new to kernel scripting would you mind explain what exacly each script is designed for?
Thank you in advance
Envoyé depuis mon GT-I9100 avec Tapatalk
@infected_
Nice idea mate!
A small tip/request: can you put the scripts inside spoilers?
Could be much easier to search for what we need
Reserved...
Thanks mate:beer::beer::beer:
Inviato dal mio GT-I9100 con Tapatalk 2
ive attached the scripts that i use in my roms to be placed in the init.d folder. the zipalign file needs to go in the system\bin folder and sqlite3 goes in the system\xbin folder
dead0 said:
ive attached the scripts that i use in my roms to be placed in the init.d folder. the zipalign file needs to go in the system\bin folder and sqlite3 goes in the system\xbin folder
Click to expand...
Click to collapse
many thank for your contribution !!
just a quick (and maybe silly question) .. normally on all zipalign scripts the binary goes to pah /system/xbin .. is it the same thing, or in the future i may have problems, using same some scripts that use zipalign or something for ex..?
infected_ said:
many thank for your contribution !!
just a quick (and maybe silly question) .. normally on all zipalign scripts the binary goes to pah /system/xbin .. is it the same thing, or in the future i may have problems, using same some scripts that use zipalign or something for ex..?
Click to expand...
Click to collapse
ive had no problem with the zipalign binary being in the system\bin folder. the log shows everything completes successfully without any errors. i dont think it matters too much tho
Just we wondering if there is a script for turning off the menu and back button lights after 3 seconds or so and for then to turn on when you touch the screen.
I set it using the settings in advanced/display but they are either always on or always off?
Thanks for any help :thumbup:
Sent From My Galaxy S2
Running SentinelROM 4.75
Powered By KangBang Kernel v1.3
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Nos_20 said:
Just we wondering if there is a script for turning off the menu and back button lights after 3 seconds or so and for then to turn on when you touch the screen.
I set it using the settings in advanced/display but they are either always on or always off?
Thanks for any help :thumbup:
Sent From My Galaxy S2
Running SentinelROM 4.75
Powered By KangBang Kernel v1.3
Click to expand...
Click to collapse
S95bln ..
Enviado do meu GT-I9100
infected_ said:
S95bln ..
Enviado do meu GT-I9100
Click to expand...
Click to collapse
I copied the script into notepad++, I save as an .xml? Like S95bln.xml?
Then copy the script to system/etc/init.d and reboot and voila???
Thanks for helping! I really do not understand all this scripting !
Nos_20 said:
I copied the script into notepad++, I save as an .xml? Like S95bln.xml?
Then copy the script to system/etc/init.d and reboot and voila???
Thanks for helping! I really do not understand all this scripting !
Click to expand...
Click to collapse
You dont need to change anything on the script. Just place it on init.d folder and set permissions to 0755. NO extension to the file!
Enviado do meu GT-I9100
infected_ said:
You dont need to change anything on the script. Just place it on init.d folder and set permissions to 0755. NO extension to the file!
Enviado do meu GT-I9100
Click to expand...
Click to collapse
OK thanks.
Is this looking correct?
Sent From My Galaxy S2
Running SentinelROM 4.75
Powered By KangBang Kernel v1.3
Nos_20 said:
OK thanks.
Is this looking correct?
Sent From My Galaxy S2
Running SentinelROM 4.75
Powered By KangBang Kernel v1.3
Click to expand...
Click to collapse
Yes.
Restart your phone and check the log in /data/log
axpira said:
Yes.
Restart your phone and check the log in /data/log
Click to expand...
Click to collapse
The directory of /data/log is empty?
Does this mean the script has not run? Any idea how I get it going as the behaviour of the leds is still the same!
Nos_20 said:
The directory of /data/log is empty?
Does this mean the script has not run? Any idea how I get it going as the behaviour of the leds is still the same!
Click to expand...
Click to collapse
If don't have this file: /data/log/bln.log , then the script not run.
Do you restart your phone?
axpira said:
If don't have this file: /data/log/bln.log , then the script not run.
Do you restart your phone?
Click to expand...
Click to collapse
Yes I just restarted my phone and checked the directory, empty!
What should I do to get it working?
Edit. Got the script to run at boot, but it still doesn't work.
Here is the log from /data/log
Enabling BLN 06-28-2013 13:56:30
/system/etc/init.d/S95Bln[16]: can't create /sys/class/misc/backlightnotification/enabled
: No such file or directory
---------------
Enabling BLN finished at 06-28-2013 13:56:30
Enabling leds timeout 06-28-2013 13:56:30
/system/etc/init.d/S95Bln[26]: can't create /sys/class/misc/notification/bl_timeout
: No such file or directory
---------------
Enabling leds timeout finished at 06-28-2013 13:56:30
setting leds voltage 06-28-2013 13:56:30
---------------
/system/etc/init.d/S95Bln[38]: can't create /sys/devices/virtual/sec/sec_touchkey/touchkey_brightness
: No such file or directory
setting leds voltage finished at 06-28-2013 13:56:30
Edit
I was looking at the directory /sys/class/misc/backlightnotification/enabled.
On my Rom - SentinelROM it looks like this directory is symlinked to /sys/devices/virtual/misc/backlightnotification
Just wondering if this would impact on the script and why it says "No such file or directory" as the error??
Sent From My Galaxy S2
Running SentinelROM 4.75
Powered By KangBang Kernel v1.3
the original (base) zip algin script is from darky one of my co devs please give credits
pxrave said:
the original (base) zip algin script is from darky one of my co devs please give credits
Click to expand...
Click to collapse
Done
Could you ask to him to give a jump to this thread, and have a look to see whats causing all the errors in log file?
Thanks!
Thanks a lot for this thread
Posté via Vanilla Rootbox

[mod][tweaks]*liquid speed*[ics,jb]][17/09/2013]

Code:
* Your warranty is now void..
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, you getting dumped or you getting fired because your phone
* bootloops and alarm does not go off. Please do some research if you have any
* YOU are choosing to make these modifications.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Requirements :-
- Android 4.0+
- Custom kernel (with init.d support)
- Root and Busybox installed
- 3MB of free space in "/system".
Feature :-
- Full memory management.
- kernel tweaks and improvements for better performance and battery life.
- Entropy generator engine used to reduce lags.
- Zipalign apps in "/system" and apps in "/data" every 48 hours which result in less RAM usage.
- Sqlite optimizations and faster database access.
- CPU governors tweaks and improvements for better performance and battery life.
- Increased SD Card read-ahead cache to 2048 KB .
- Ad blocking.
- Default.prop tweaks and improvements.
- Cleans log files and tombstones at every boot.
- Many other tweaks for better performance and battery life!
Steps :-
- go to system/etc/init.d/delete all files in it
- Download the zip
- Flash zip via recovery
- Feel the difference (1st boot may take time)
Some part of my Default .prop
#enable harware egl profile
debug.egl.profiler=1
#16BIT transparency , Smother Scrolling
persist.sys.use_16bpp_alpha=1
#debug.composition.type=gpu
debug.composition.type=c2d
debug.performance.tuning=1
debug.enabletr=true
debug.qctwa.preservebuf=1
dev.pm.dyn_samplingrate=1
video.accelerate.hw=1
ro.vold.umsdirtyratio=20
debug.overlayui.enable=1
debug.egl.hw=1
ro.fb.mode=1
hw3d.force=1
persist.sys.composition.type=c2d
persist.sys.ui.hw=1
ro.sf.compbypass.enable=0
#Enable tile rendering
debug.enabletr=true
persist.sys.composition.type=gpu
#3d performance
persist.android.strictmode=0
ro.min_pointer_dur=1
ro.secure=0
#Media quality
ro.media.enc.jpeg.quality=100
ro.media.dec.jpeg.memcap=8000000
ro.media.enc.hprof.vid.bps=8000000
ro.media.dec.aud.wma.enabled=1
ro.media.dec.vid.wmv.enabled=1
ro.media.cam.preview.fps=0
ro.media.codec_priority_for_thumb=so
#Speed liquid
persist.service.lgospd.enable=0
persist.service.pcsync.enable=0
# For sensor sleep control
ro.ril.sensor.sleep.control=1
#loggers
ro.config.htc.nocheckin=1
ro.config.nocheckin=1
profiler.force_disable_ulog=1
profiler.force_disable_err_rpt=1
#Scrolling
windowsmgr.max_events_per_sec=90
ro.max.fling_velocity=12000
ro.min.fling_velocity=8000
#battery saver
ro.ril.disable.power.collapse=1
pm.sleep_mode=1
usb_wakeup=enable
proximity_incall=enable
power_supply.wakeup=enable
ro.config.hw_power_saving=1
ro.config.hw_fast_dormancy=1
ro.config.hw_quickpoweron=true
persist.sys.use_dithering=0
#improve battery under no signal -- need test
ro.mot.eri.losalert.delay=1000
#net speedtweaks
net.tcp.buffersize.default=4096,87380,256960,4096, 16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.hspda=4096,87380,256960,4096,16 384,256960
net.tcp.buffersize.hspa=4096,87380,256960,4096,163 84,256960
#streaming faster
media.stagefright.enable-player=true
media.stagefright.enable-meta=true
media.stagefright.enable-scan=true
media.stagefright.enable-http=true
media.stagefright.enable-aac=true
media.stagefright.enable-qcp=true
media.stagefright.enable-record=true
Some part of INIT.D :-
# Disable Logger
busybox rm /dev/log/main
# Busybox Remounting
busybox mount -o remount,noatime,barrier=0,nobh /system
busybox mount -o remount,noatime,barrier=0,nobh /data
busybox mount -o remount,noatime,barrier=0,nobh /cache
echo "Mounted Busybox"
# clearing junk files
busybox find /data/data -type d -iname "*cache*" -exec busybox rm -f {}/* ';' -exec echo "Cleared {}" ';'
rm -f /data/local/*.apk
rm -f /data/local/tmp/*.apk
rm -f /data/*.log
rm -f /data/log/*.log
rm -f /cache/*.*
rm -f /cache/recovery/*.*
rm -f /data/system/dropbox/*.txt
rm -f /data/backup/pending/*.tmp
rm -f /data/tombstones/*.*
echo "Junk cleared"
# Defrag Database Files
for i in \
`find /data -iname "*.db"`
do \
sqlite3 $i 'VACUUM;';
# Move Dalvik-Cache To Cache Partition
CACHESIZE=$(df -k /cache | tail -n1 | tr -s ' ' | cut -d ' ' -f2)
if [ $CACHESIZE -gt 4000 ]
then
echo "Large cache detected, moving dalvik-cache to /cache"
if [ ! -d /cache/dalvik-cache ]
then
busybox rm -rf /cache/dalvik-cache /data/dalvik-cache
mkdir /cache/dalvik-cache /data/dalvik-cache
fi
busybox chown 1000:1000 /cache/dalvik-cache
busybox chmod 0771 /cache/dalvik-cache
busybox mount -o bind /cache/dalvik-cache /data/dalvik-cache
busybox chown 1000:1000 /data/dalvik-cache
busybox chmod 0771 /data/dalvik-cache
else
echo "Small cache detected, dalvik-cache will remain on /data"
fi
echo "Moved Dalvik-Cache To Cache Partition"
# Mod: Battery
setprop wifi.supplicant_scan_interval=180
setprop pm.sleep_mode=1
setprop ro.ril.disable.power.collapse=1
# Mod: Performance
setprop ro.kernel.android.checkjni=0
setprop persist.sys.purgeable_assets=1
setprop debug.sf.hw=1
setprop ro.telephony.call_ring.delay=0
setprop ro.foreground_app_mem=1280
setprop ro.visible_app_mem=2560
setprop ro.perceptible_app_mem=3840
setprop ro.heavy_weight_app_mem=6400
setprop ro.secondary_server_mem=7680
setprop ro.backup_app_mem=8960
setprop ro.home_app_mem=2048
setprop ro.hidden_app_mem=12800
setprop ro.content_provider_mem=15360
setprop ro.empty_app_mem=20480
setprop ro.foreground_app_adj=0
setprop ro.visible_app_adj=1
setprop ro.perceptible_app_adj=2
setprop ro.heavy_weight_app_adj=4
setprop ro.secondary_server_adj=5
setprop ro.backup_app_adj=6
setprop ro.home_app_adj=1
setprop ro.hidden_app_min_adj=7
setprop ro.empty_app_adj=15
# Mod: Graphics
setprop debug.performance.tuning=1
setprop video.accelerate.hw=1
setprop ro.media.dec.jpeg.memcap=8000000
setprop ro.media.enc.hprof.vid.bps=8000000
setprop persist.sys.use_dithering 1
# Touch Screen Sensitivity
echo 7035 > /sys/class/touch/switch/set_touchscreen;
echo 8002 > /sys/class/touch/switch/set_touchscreen;
echo 11000 > /sys/class/touch/switch/set_touchscreen;
echo 13060 > /sys/class/touch/switch/set_touchscreen;
echo 14005 > /sys/class/touch/switch/set_touchscreen;
# Renice Apps
renice -20 `pidof com.android.phone`
renice -19 `pidof com.android.inputmethod.latin`
renice -19 `pidof com.swype.android.inputmethod`
renice -17 `pidof com.android.systemui`
renice -9 `pidof com.android.settings`
renice -9 `pidof com.android.vending`
renice -6 `pidof com.sec.android.app.camera`
renice -6 `pidof com.sec.android.app.fm`
renice -6 `pidof com.google.android.apps.maps`
renice -4 `pidof com.google.android.apps.googlevoice`
renice -3 `pidof android.process.media`
# SqLite Optimize
for i in \
`busybox find /data -iname "*.db"`;
do \
/system/xbin/sqlite3 $i 'VACUUM;';
/system/xbin/sqlite3 $i 'REINDEX;';
done;
if [ -d "/dbdata" ]; then
for i in \
`busybox find /dbdata -iname "*.db"`;
do \
/system/xbin/sqlite3 $i 'VACUUM;';
/system/xbin/sqlite3 $i 'REINDEX;';
done;
fi;
if [ -d "/datadata" ]; then
for i in \
`busybox find /datadata -iname "*.db"`;
do \
/system/xbin/sqlite3 $i 'VACUUM;';
/system/xbin/sqlite3 $i 'REINDEX;';
done;
fi;
for i in \
`busybox find /sdcard -iname "*.db"`;
do \
/system/xbin/sqlite3 $i 'VACUUM;';
/system/xbin/sqlite3 $i 'REINDEX;';
done;
echo "SqLite Database Optimized"
echo "System Optimized And Boosted at $( date +"%m-%d-%Y %H:%M:%S" )"
function mountrw {
mount|grep "/system "|grep rw >/dev/null
[ $? -eq 1 ] && mount -o remount,rw $(mount|grep "/system "|awk '{ print $1 }') /system
}
function mountro {
mount|grep "/system "|grep ro >/dev/null
[ $? -eq 1 ] && mount -o remount,ro $(mount|grep "/system "|awk '{ print $1 }') /system
}
echo " Starting package optimization"
echo "Starting ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )"
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
mountrw;
echo ZipAligning $(basename $apk)
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed DC;
fi;
else
echo Velocity ZipAlign already completed on $apk
fi;
done;
for apk in /data/app/*.apk ; do
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
echo ZipAligning $(basename $apk)
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed DC
fi;
else
echo Velocity ZipAlign already completed on $apk
fi;
done;
mountro;
echo "ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )"
​
Tested on Xperia Ray
nice tweak....
but wrong tread....
you should create topic in here... http://forum.xda-developers.com/forumdisplay.php?f=1242
sory for my english....
This is just for custom kernel? Or works on stock?
Sent from my SK17i using xda app-developers app
Awesome....!!!!!!!!!
One word Awesome....!!!!
Playing Subway Surfers without a Single Lag... Feels like my phone is running on GB..
PS: Z1 Honami Rom Odexed + Raedon Kernel at 652 MHz Conservative & SIO
$lim $hady said:
One word Awesome....!!!!
Playing Subway Surfers without a Single Lag... Feels like my phone is running on GB..
PS: Z1 Honami Rom Odexed + Raedon Kernel at 652 MHz Conservative & SIO
Click to expand...
Click to collapse
:good:
NOpe
koyog said:
nice tweak....
but wrong tread....
you should create topic in here... http://forum.xda-developers.com/forumdisplay.php?f=1242
sory for my english....
Click to expand...
Click to collapse
bro this tweaks for mini,mini pro,ray so i dont want to create in each of there development i mean (creating multiple threads bro):good:
AlexGT-R said:
This is just for custom kernel? Or works on stock?
Sent from my SK17i using xda app-developers app
Click to expand...
Click to collapse
it will work on stock
install pimp my rom
activate init.d
Thanks for this one, im observing this tweaks, my device is below my signature
yes
Pranto Roy said:
it will work on stock
install pimp my rom
activate init.d
Click to expand...
Click to collapse
yes bro
BRUTAL DEATH said:
yes bro
Click to expand...
Click to collapse
Hey man. How to check if all of your features are working after I flash it?
Sent from my ST18i using Tapatalk 2
I think you should take a look at that post of mine with list of build.prop entries that do nothing. almost all of them are in this pack of yours.
???????
najodleglejszy said:
I think you should take a look at that post of mine with list of build.prop entries that do nothing. almost all of them are in this pack of yours.
Click to expand...
Click to collapse
the default prop and init.d tweaks I have taken from Persians tweaks
I don't care where did you get them from. I'm just showing you the list of lines that do nothing and there's no need to include them.
ohh
najodleglejszy said:
I don't care where did you get them from. I'm just showing you the list of lines that do nothing and there's no need to include them.
Click to expand...
Click to collapse
ohhh lol i was online from mobile so didnt read it proplerly kk alright checking ur thread for working and nonworking ones
..
Joakim112 said:
Hey man. How to check if all of your features are working after I flash it?
Sent from my ST18i using Tapatalk 2
Click to expand...
Click to collapse
this all things will happen
- Zipalign apps in "/system" and apps in "/data" every 48 hours which result in less RAM usage.
- Full memory management.
- kernel tweaks and improvements for better performance and battery life.
- Entropy generator engine used to reduce lags.
- Sqlite optimizations and faster database access.
- CPU governors tweaks and improvements for better performance and battery life.
- Increased SD Card read-ahead cache to 2048 KB .
- Ad blocking.
- Default.prop tweaks and improvements.
- Cleans log files and tombstones at every boot.
- Many other tweaks for better performance and battery life!
BRUTAL DEATH said:
bro this tweaks for mini,mini pro,ray so i dont want to create in each of there development i mean (creating multiple threads bro):good:
Click to expand...
Click to collapse
so, it won't work on lww?
not sure
azzazelium said:
so, it won't work on lww?
Click to expand...
Click to collapse
test and report
Does it work on 4.3?
Good work man! Keep it up!
najodleglejszy said:
I think you should take a look at that post of mine with list of build.prop entries that do nothing. almost all of them are in this pack of yours.
Click to expand...
Click to collapse
I see most of your explanation pointed to ICS. So, does it mean they work in JB? Especially in CM10.1? (Althought some are very specific to one's manufacturer.)

Unexpected slowndowns on CM11 (high I/O activity, ANR and black screens)

Hi, I'm an hopeless but advanced user who is suffering from his f***ing S3 device.
No one was able to help me, as simply suggest to do thousands of tests, factory reset, turn to stock rom etc. etc. etc. ...
I haven't free time to dedicate to my device, I want to know the problems cause without time losing, so I thought to attach many logcat files related to happened issues.
I want a definitive help from advanced users, I won't to see bunch of enthusiasts who purpose the easiest ways.
Now I explain them with words: I've a very unstable device in performance terms, at random moments the I/O usage increase to high values causing slowdown, ANR and FCs due to "Input dispatching", rarely also forced reboots (probably system_server keep crashing).
RAM cleaning sometimes is resolutive as it kill many background services, but useless when system processes like mmcqd/0 and the already cited system_server are involved.
I never known the cause, but I know that my phone, with a ridiculous amount of free RAM (often 100-150 MB) and a large amount of installed apps, works greatful... until some f***ed mess happens.
I'm on latest CM 11 M releases (actually M10) with related Gapps and latest BOEFFLA NG Kernel (but its experimental status is not cause of issues, as I had the same situation with the stable kernel).
No OC (only the 5th gpu clock step on 533 Mhz by default), little UV (-25v for both cpu and gpu, the minimum tolerated by AnTuTu Benchmark), governor and scheduler respectively pegasusqplus and sio for both storages.
Then... the Xposed Framework enabled with GravityBox module (with few enabled functions, so might not be conflicts), build.prop and init.d edits, in summary related to have the JIT compiler enabled, gpu for display composition, better deep sleep, lower minfree values and VM optimization.
All the lines are thoughtful since almost an year and used by lot of users, I reported them below.
Build.prop
Code:
# Faster soft reboots #
persist.sys.purgeable_assets=1
# The better Deep Sleep mode #
ro.ril.sensor.sleep.control=1
pm.sleep_mode=1
# Better power saving #
power_supply.wakeup=enable
# Better Dalvik management #
dalvik.vm.checkjni=true
dalvik.vm.verify-bytecode=true
dalvik.vm.execution-mode=int:jit
dalvik.vm.dexopt-flags=m=y
# Enable FPS capping #
debug.gr.swapinterval=1
# Hardware acceleration for UI #
debug.composition.type=gpu
debug.sf.hw=1
persist.sys.ui.hw=1
# Hardware acceleration for videos #
video.accelerate.hw=1
# Performance improvements #
debug.performance.tuning=1
# Performance statistics in logcat #
debug.egl.hw=1
debug.egl.profiler=1
# Better OOM and LMK management #
ro.HOME_APP_MEM=2048
ro.FOREGROUND_APP_MEM=4096
ro.PERCEPTIBLE_APP_MEM=4096
ro.VISIBLE_APP_MEM=6144
ro.SECONDARY_SERVER_MEM=8192
ro.BACKUP_APP_MEM=8192
ro.HIDDEN_APP_MEM=10240
ro.HEAVY_WEIGHT_APP_MEM=10240
ro.CONTENT_PROVIDER_MEM=12228
ro.EMPTY_APP_MEM=14336
ro.HOME_APP_ADJ=1
ro.MIN_CRASH_INTERVAL=10
# Better upload speed #
ro.ril.hsxpa=3
# Better battery saving while losting telephony signal #
ro.mot.eri.losalert.delay=1000
# Enable IPv4 and IPv6 support #
persist.telephony.support.ipv4=1
persist.telephony.support.ipv6=1
# Better Wi-Fi bandwidth usage #
net.tcp.buffersize.wifi=524288,1048576,2097152,524288,1048576,2097152
# OpenDNS for all the networks #
net.dns1=208.67.222.222
net.dns2=208.67.220.220
net.gprs.dns1=208.67.222.222
net.gprs.dns2=208.67.220.220
net.ppp0.dns1=208.67.222.222
net.ppp0.dns2=208.67.220.220
net.rmnet0.dns1=208.67.222.222
net.rmnet0.dns2=208.67.220.220
net.wlan0.dns1=208.67.222.222
net.wlan0.dns2=208.67.220.220
net.secondary.dns=208.67.220.220
# Prevent blackscreen issues after calls #
mot.proximity.delay=25
ro.lge.proximity.delay=25
# Better scrolling #
ro.min_pointer_dur=8
ro.min.fling_velocity=8000
ro.max.fling_velocity=12000
# Call ringtone delay #
ro.telephony.call_ring.delay=500
# Better picture quality #
persist.sys.use_dithering=1
# Better speech quality #
ro.ril.enable.amr.wideband=1
# Better audio quality #
persist.af.resampler.quality=255
af.resampler.quality=255
# Better camera quality #
ro.media.enc.jpeg.quality=100
# Better camcorder #
ro.camcorder.videoModes=true
# Better camera flash #
ro.media.capture.flashIntensity=70
ro.media.capture.torchIntensity=70
# Faster video streaming #
media.stagefright.enable-player=true
media.stagefright.enable-meta=true
media.stagefright.enable-scan =true
media.stagefright.enable-http=true
media.stagefright.enable-rtsp=true
Init.d script
Code:
## Filesystem trim for each partition ##
#!/system/bin/sh
fstrim -v /system
fstrim -v /data
fstrim -v /cache
## Ext4 filesystem instant mount ##
#!/system/bin/sh
busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,barrier=0,nobh /system
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodir atime,barrier=0,nobh /data
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodir atime,barrier=0,nobh /cache
## Tweaks for better performance and battery saving ##
sysctl -p
sysctl -w vm.dirty_background_ratio=70;
sysctl -w vm.dirty_expire_centisecs=250;
sysctl -w vm.dirty_ratio=90;
sysctl -w vm.dirty_writeback_centisecs=1000;
sysctl -w vm.drop_caches=3;
sysctl -w vm.min_free_kbytes=8192;
sysctl -w vm.vfs_cache_pressure=10;
## Tweaks for better security ##
sysctl -w net.ipv4.tcp_syncookies=1;
sysctl -w net.ipv4.conf.all.rp_filter=1;
sysctl -w net.ipv4.conf.default.rp_filter=1;
sysctl -w net.ipv4.tcp_synack_retries=2;
sysctl -w net.ipv4.tcp_syn_retries=2;
sysctl -w net.ipv4.tcp_max_syn_backlog=1024;
sysctl -w net.ipv4.tcp_max_tw_buckets=16384;
sysctl -w net.ipv4.icmp_echo_ignore_all=1;
sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1;
sysctl -w net.ipv4.tcp_no_metrics_save=1;
sysctl -w net.ipv4.tcp_fin_timeout=15;
sysctl -w net.ipv4.tcp_keepalive_time=1800;
sysctl -w net.ipv4.ip_forward=0;
sysctl -w net.ipv4.tcp_moderate_rcvbuf=1;
sysctl -w net.ipv4.route.flush=1;
sysctl -w net.ipv4.udp_rmem_min=6144;
sysctl -w net.ipv4.udp_wmem_min=6144;
sysctl -w net.ipv4.tcp_rfc1337=1;
sysctl -w net.ipv4.ip_no_pmtu_disc=0;
sysctl -w net.ipv4.tcp_ecn=0;
sysctl -w net.ipv4.tcp_sack=1;
sysctl -w net.ipv4.tcp_fack=1;
sysctl -w net.ipv4.conf.default.accept_source_route=0;
sysctl -w net.ipv4.conf.all.accept_source_route=0;
sysctl -w net.ipv4.conf.all.accept_redirects=0;
sysctl -w net.ipv4.conf.default.accept_redirects=0;
sysctl -w net.ipv4.conf.all.secure_redirects=0;
sysctl -w net.ipv4.conf.default.secure_redirects=0;
## Extended I/O scheduler queue ##
if [ -e /queue/nr_requests ]; then
echo 1024 > /queue/nr_requests; fi;
## Enable V-Sync ##
#!/system/bin/sh
mount -o remount,rw /sys /sys
busybox mount -t debugfs debugfs /sys/kernel/debug
busybox echo '1' > /sys/kernel/debug/msm_fb/0/vsync_enable
umount /sys/kernel/debug
## Fix apps permissions (by Einherjar Dev Team - www.edtdev.com) ##
logFile=/data/edt/logs/S30edt_perms.log
if [ -f $logFile ]; then
rm $logFile
fi
touch $logFile
mount -o rw,remount /dev/block/stl9 /system
echo "Setting permissions" >> $logFile
for file in /system/app/* /system/framework/* /data/app/*; do
echo " setting permissions (644) for $file" >> $logFile
chmod 644 $file
done
echo "chmodding init.d folder"
chmod 777 /system/etc/init.d
for file in /system/etc/init.d/*; do
echo " setting permissions (777) for $file" >> $logFile
chmod 777 $file
done
echo "Permissions set" >> $logFile
## Zipalign apps (by Wes Garner) ##
#!/system/bin/sh
LOG_FILE=/data/zipalign.log
CURRDATE=`date +%s`
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
echo "Starting Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
for apk in /data/app/*.apk ; do
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
echo ZipAligning $(basename $apk) | tee -a $LOG_FILE;
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk | tee -a $LOG_FILE;
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed | tee -a $LOG_FILE;
fi;
else
echo ZipAlign already completed on $apk | tee -a $LOG_FILE;
fi;
done;
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
fi
## Optimization of all sqlite databases ##
if [ -d "/system" ]; then
for i in \ `find /system -iname "*.db"` do \ sqlite3 $i 'VACUUM;'; done
if [ -d "/dbdata" ]; then
for i in \ `find /dbdata -iname "*.db"` do \ sqlite3 $i 'VACUUM;'; done
if [ -d "/data" ]; then
for i in \ `find /data -iname "*.db"` do \ sqlite3 $i 'VACUUM;'; done
if [ -d "/datadata" ]; then
for i in \ `find /datadata -iname "*.db"` do \ sqlite3 $i 'VACUUM;'; done
## Scheduled cron jobs - Copyright (C) 2010 Jared Rummler (JRummy16) GNUv3 License ##
#!/system/bin/sh
symlink_system_bin() {
# crond has "/bin/sh" hardcoded
if busybox [ ! -h /bin ]
then
mount -o remount,rw rootfs /
busybox ln -s /system/bin /bin
mount -o remount,ro rootfs /
fi
}
export_timezone() {
# set timezone (if you're not between -0500 and -0800 you get PST)
# todo - support other timezones
timezone=`date +%z`
if busybox [ $timezone = "-0800" ]; then
TZ=PST8PDT
elif busybox [ $timezone = "-0700" ]; then
TZ=MST7MDT
elif busybox [ $timezone = "-0600" ]; then
TZ=CST6CDT
elif busybox [ $timezone = "-0500" ]; then
TZ=EST5EDT
else
TZ=PST8PDT
fi
export TZ
}
set_crontab() {
# use /data/cron, call the crontab file "root"
if busybox [ -e /data/cron/root ]
then
mkdir -p /data/cron
cat > /data/cron/root
Thank you so much... may the best win!
I've to survive almost until Christmas.

Categories

Resources