Post Reply

[TWEAKS][SCRIPTS] Collection of 'em all - build.prop; init.d; etc.

OP knzo

20th August 2011, 06:04 PM   |  #1  
OP Senior Member
Thanks Meter: 3,915
 
1,979 posts
Join Date:Joined: Nov 2010
On my ROMs adventure 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 fluctuate from device to device, I've found these pretty consistent throughout many.

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=48m
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=8000000
ro.media.enc.hprof.vid.bps=8000000
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)
13. Loopy Smoothness tweak
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

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.


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.
Last edited by knzo; 27th January 2012 at 12:35 PM.
The Following 566 Users Say Thank You to knzo For This Useful Post: [ View ]
20th August 2011, 07:17 PM   |  #2  
DaXmax's Avatar
Recognized Themer
Flag Singapore
Thanks Meter: 10,032
 
10,693 posts
Join Date:Joined: Sep 2008
More
Wow... Neojn, will tis work on lg optimus one? I know u used to have a optimus one...

Sent from LGE Secret phone using tapatalk app...
Last edited by udK; 13th September 2011 at 09:41 PM. Reason: there is not reason to full quote.
The Following 6 Users Say Thank You to DaXmax For This Useful Post: [ View ]
20th August 2011, 07:25 PM   |  #3  
OP Senior Member
Thanks Meter: 3,915
 
1,979 posts
Join Date:Joined: Nov 2010
Most of them will, yeah.
The Following 5 Users Say Thank You to knzo For This Useful Post: [ View ]
20th August 2011, 07:41 PM   |  #4  
DaXmax's Avatar
Recognized Themer
Flag Singapore
Thanks Meter: 10,032
 
10,693 posts
Join Date:Joined: Sep 2008
More
Quote:
Originally Posted by Noejn

Most of them will, yeah.

Will try, thanks...

Sent from LGE Secret phone using tapatalk app...
20th August 2011, 07:50 PM   |  #5  
Senior Member
Flag herne bay
Thanks Meter: 71
 
564 posts
Join Date:Joined: Apr 2011
More
my word thats a MASSIVE list lol thanks, some interesting tweaks there

Sent from my HTC Desire using XDA App
20th August 2011, 07:53 PM   |  #6  
OP Senior Member
Thanks Meter: 3,915
 
1,979 posts
Join Date:Joined: Nov 2010
If I have time in the future I can create a script that applies them all.
(with a check of already existing tweaks / compatibility with the device, etc)
The Following 8 Users Say Thank You to knzo For This Useful Post: [ View ]
22nd August 2011, 12:17 AM   |  #7  
Deaw^^'s Avatar
Junior Member
Flag Bangkok
Thanks Meter: 1
 
16 posts
Join Date:Joined: Jul 2011
More
If some script fail it may cause bootloop? And can use for all device?
thanks for answer.
22nd August 2011, 02:22 PM   |  #8  
OP Senior Member
Thanks Meter: 3,915
 
1,979 posts
Join Date:Joined: Nov 2010
Quote:
Originally Posted by Deaw^^

If some script fail it may cause bootloop? And can use for all device?
thanks for answer.

None of them should cause bootloop, at least if you follow everything I wrote.
Yes, they work on most devices. Just read what it needs.
The Following User Says Thank You to knzo For This Useful Post: [ View ]
22nd August 2011, 11:32 PM   |  #9  
eoghan2t7's Avatar
Recognized Contributor
Flag Belfast
Thanks Meter: 2,152
 
4,189 posts
Join Date:Joined: Jan 2011
Donate to Me
More
how do i test this one because i cant remember what i rename the bold parts to lol

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


thanks in advanced
Eoghan
The Following User Says Thank You to eoghan2t7 For This Useful Post: [ View ]
23rd August 2011, 07:08 PM   |  #10  
Deaw^^'s Avatar
Junior Member
Flag Bangkok
Thanks Meter: 1
 
16 posts
Join Date:Joined: Jul 2011
More
I hav another question..What is "Flags"?

- 18. Miscellaneous flags
- 7. Flags blocks as non-rotational and increases cache size

thanks for answer

The Following User Says Thank You to Deaw^^ For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools
Display Modes


Top Threads in Android Software and Hacking General [Developers Only] by ThreadRank