[mod][tweaks]*liquid speed*[ics,jb]][17/09/2013] - Sony Ericsson Xperia Mini, Mini Pro, Xperia Pro, A

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.)

Related

Supremacy Script

{
"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

[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*[gb,ics,jb][07/10/2013][xplay]

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 2.3 +
- 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)
User praise :-
1c3_5n0w :- I'm not usually this vulgar but HOLY SH*T. My device is flying, look up in the sky!!! I come from xElite 2.0 which is a lag free GB ROM and I switched to an ICS ROM which is the Xperia Play Z Final v5 and look at the free RAM, and the battery, oh wowwww. Thanks a lot BOSS, this makes my Play, like a BOSS
fliperpl :- Installed with ROM ULTIMATE HD 5.1 and works pretty well. Phone is faster and UI seems to be smoother. Thanks
$lim $hady :- Awesome....!!!!!!!!! One word Awesome....!!!! Playing Subway Surfers without a Single Lag... Feels like my phone is running on GB.
skaloyskie :- Thanks man! I've noticed that my phone suffered less lag even I'm using Opera mini (Multi-tabbed browsing) and downloading movies via torrent. Nice
iossux :- U rock bro really boosted my performance
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" )"
credits
persanno
exblaze
kuro
Niceeee.
Sent from my GT-N7000 using XDA Premium 4 mobile app

			
				
Installed with ROM ULTIMATE HD 5.1 and works pretty well. Phone is faster and UI seems to be smoother. Thanks
thnxx
fliperpl said:
Installed with ROM ULTIMATE HD 5.1 and works pretty well. Phone is faster and UI seems to be smoother. Thanks
Click to expand...
Click to collapse
:good: will add it in user praise for next version
I'm not usually this vulgar but HOLY SH*T. My device is flying, look up in the sky!!! I come from xElite 2.0 which is a lag free GB ROM and I switched to an ICS ROM which is the Xperia Play Z Final v5 and look at the free RAM, and the battery, oh wowwww. Thanks a lot BOSS, this makes my Play, like a BOSS (no pun intended)
Sent from my GT-N7000 using XDA Premium 4 mobile app
thnxx
1c3_5n0w said:
I'm not usually this vulgar but HOLY SH*T. My device is flying, look up in the sky!!! I come from xElite 2.0 which is a lag free GB ROM and I switched to an ICS ROM which is the Xperia Play Z Final v5 and look at the free RAM, and the battery, oh wowwww. Thanks a lot BOSS, this makes my Play, like a BOSS (no pun intended)
Sent from my GT-N7000 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
will add in user praise
really happy that u liked it :highfive:
It's for GB too?
title says "liquid speed*[gb,ics,jb]" and requirements says "android 4.0+"
i think its for 4+ only because for other xperia devices title is "liquid speed*[ics,jb]"
I will test this on MIUI 5 with dolby cuz I know that ROM doesn't have too good ram management and games run bad on it
yup
(30 said:
It's for GB too?
title says "liquid speed*[gb,ics,jb]" and requirements says "android 4.0+"
Click to expand...
Click to collapse
it's for gb too tested on gin2jellybean. sorry for confusion
BOSS said:
it's for gb too tested on gin2jellybean. sorry for confusion
Click to expand...
Click to collapse
its awesome
i have install it in UHD 5 rom with lupus kernel.. but after i flashed this tweak i got FIFA 14 force closed..
MAN !!!0
what you have done on my phone ??!! now ican play Drstic-DS games on my phone ( xperia Z final 5 ) without any lag !!!!!!!1
YOU ROCK MAN !!
---------- Post added at 09:35 AM ---------- Previous post was at 09:35 AM ----------
MAN !!!0
what you have done on my phone ??!! now ican play Drstic-DS games on my phone ( xperia Z final 5 ) without any lag !!!!!!!1
YOU ROCK MAN !!
I have little trouble.
Actually My phone did a 4 FC for about one day. I dont know what happend,but when game need to have more ram than i have (like gta3) phone is just lagged and nothing to do with him. Also before 9 hours of not used phone had lagged for nothing Just black screen
What happend? I am using intellidemand2/sio [email protected]
fliperpl said:
I have little trouble.
Actually My phone did a 4 FC for about one day. I dont know what happend,but when game need to have more ram than i have (like gta3) phone is just lagged and nothing to do with him. Also before 9 hours of not used phone had lagged for nothing Just black screen
What happend? I am using intellidemand2/sio [email protected]
Click to expand...
Click to collapse
Some scripts mess up with rom...before you flash this,remove all init.d on your system/etc..works good on HD 5.1 but not so good on HONAMI 2.1.3..only ones i ve tested.
Causes Fifa to lag on xplaystation jb.
Sent from my R800i using xda app-developers app
I've been using this for the past few days. Usually im very skeptical when it comes to these types of tweaks.
But battery life of my phone has definitely improved. I used to get a little over a days use before having to recharge. But im at 1d 6h on this charge and still at 58%! If nothing else, this was worth it for the battery increase.
Sent from my R800i using xda app-developers app
korrectmethod said:
I've been using this for the past few days. Usually im very skeptical when it comes to these types of tweaks.
But battery life of my phone has definitely improved. I used to get a little over a days use before having to recharge. But im at 1d 6h on this charge and still at 58%! If nothing else, this was worth it for the battery increase.
Sent from my R800i using xda app-developers app
Click to expand...
Click to collapse
Damn... a bit more than 1 day, thats pretty good What ROM are you using?
How long were you using each app? And PPSSPP is a battery eater for me...
RoboticBuddy said:
Damn... a bit more than 1 day, thats pretty good What ROM are you using?
How long were you using each app? And PPSSPP is a battery eater for me...
Click to expand...
Click to collapse
Gin2Jb 2.5.1, I only played ppsspp for about 30 minutes, and mostly just used the phone to play music. Also probably a few hours of browsing youtube/9gag/xda. I could get a lot better battery life but I have brightness set to max.
Sent from my R800i using xda app-developers app

How I can zipalign apks on boot?

Hi guys...like title...how I can zipalign apks on boot?
With a init.d script
Garcia98 said:
With a init.d script
Click to expand...
Click to collapse
So I should add this code on init.d?
Code:
#!/system/bin/sh
# Automatic ZipAlign by Wes Garner
# ZipAlign files in /data that have not been previously ZipAligned (using md5sum)
# Thanks to oknowton for the changes
# Changelog:
# 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/zipalign.log
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 /system/sd/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;

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