移动叔叔

标题: [资料] [ROM教程] SuperCharger V6优化脚本在ROM中添加教程 [打印本页]

作者: sunyz1990    时间: 2013-5-1 09:48
标题: [资料] [ROM教程] SuperCharger V6优化脚本在ROM中添加教程

首先说明本人只是搬运工,不懂技术从别的论坛发现的,不知道是否适合 小+ ,请各位大大鉴定。如有人发过就请版主把这删了吧!顺便问下各位大大到底ROM优化脚本有哪些呢?希望知道的就告诉下谢谢,也让我们这些伸手党多了解点知识。。。下面有所有脚本优化不知道哪些有用http://kuai.xunlei.com/d/OGPGHUKRLSGW

//------------------------------------
Supercharger V6脚本加入教程

感谢xda的zep大神!这个脚本确实巨给力!
//------------------------------------

原帖地址:http://bbs.hiapk.com/thread-3845353-1-1.html

-----------------------------------------------------------------------------------------------------
一、在/system/etc/init.d文件夹下

a.建立一个文本文件,去掉扩展名,名为:99SuperCharger

用文本方式打开,复制入以下代码:

#!/system/bin/sh
# V6 SuperCharger, OOM Grouping &Priority Fixes created by zeppelinrox.
execute=0;
currentadj=`cat/sys/module/lowmemorykiller/parameters/adj`;
currentminfree=`cat/sys/module/lowmemorykiller/parameters/minfree`;
scadj=`cat /data/SuperChargerAdj`;
scminfree=`cat /data/SuperChargerMinfree`;
if [ "$currentadj" !="$scadj" ]; then
         execute=1;
elif [[ -n "$scminfree" ]]&& [ "$currentminfree" != "$scminfree" ]; then
         execute=1;
fi;
if [ "$execute" -eq 1 ]; then
         mount-o remount,rw /system 2>/dev/null;
         form in /dev/block/mtdblock*;
         do
         mount-o remount,rw $m /system 2>/dev/null;
         done;
         echo$scadj > /sys/module/lowmemorykiller/parameters/adj;
         echo$scminfree > /sys/module/lowmemorykiller/parameters/minfree;
         sed-i '/.*_ADJ/d' /system/build.prop;
         sed-i '/.*_MEM/d' /system/build.prop;
         busyboxsysctl -w vm.oom_kill_allocating_task=0;
         busyboxsysctl -w vm.panic_on_oom=0;
         busyboxsysctl -w kernel.panic_on_oops=1;
         busyboxsysctl -w kernel.panic=0;
         mount-o remount,ro /system 2>/dev/null;
         form in /dev/block/mtdblock*;
         do
         mount-o remount,ro $m /system 2>/dev/null;
         done;
fi;
# End of V6 SuperCharged Entries
sh /data/99SuperCharger.sh;

保存退出。

b.建立一个文本文件,去掉扩展名,名为:98TweakKernel

复制以下代码:

#!/system/bin/sh
# Put together and refined by zeppelinrox.See included links for resources.
mount -o remount,rw /system 2>/dev/null;
for m in /dev/block/mtdblock*;
do
mount -o remount,rw $m /system2>/dev/null;
done;
busybox sysctl -p;
#
# Disable normalized sleeper
#
mount -t debugfs none /sys/kernel/debug2>/dev/null;
echo NO_NORMALIZED_SLEEPER >/sys/kernel/debug/sched_features 2>/dev/null;
#
# Memory management
busybox sysctl -e -wvm.oom_kill_allocating_task=0;
busybox sysctl -e -w vm.panic_on_oom=0;
busybox sysctl -e -wvm.dirty_background_ratio=60;
busybox sysctl -e -w vm.dirty_ratio=95;
busybox sysctl -e -wvm.min_free_kbytes=8192;
busybox sysctl -e -wvm.vfs_cache_pressure=10;
busybox sysctl -e -wvm.overcommit_memory=1;
busybox sysctl -e -wvm.min_free_order_shift=4;
busybox sysctl -e -w kernel.panic=0;
busybox sysctl -e -wkernel.panic_on_oops=1;
busybox sysctl -e -w kernel.msgmni=2048;
busybox sysctl -e -w kernel.msgmax=64000;
busybox sysctl -e -wkernel.shmmax=268435456;
busybox sysctl -e -w kernel.sem='500 51200064 2048';
busybox sysctl -e -w kernel.sched_features=24189;
busybox sysctl -e -wkernel.hung_task_timeout_secs=30; # Set to 0 to disable but can cause blackscreen on incoming calls
busybox sysctl -e -wkernel.sched_latency_ns=18000000;
busybox sysctl -e -wkernel.sched_min_granularity_ns=1500000;
busybox sysctl -e -wkernel.sched_wakeup_granularity_ns=3000000;
busybox sysctl -e -wkernel.sched_compat_yield=1;
busybox sysctl -e -wkernel.sched_shares_ratelimit=256000;
busybox sysctl -e -wkernel.sched_child_runs_first=0;
busybox sysctl -e -wkernel.threads-max=5000;
busybox sysctl -e -wnet.core.wmem_max=524288;
busybox sysctl -e -wnet.core.rmem_max=524288;
busybox sysctl -e -wnet.ipv4.tcp_tw_recycle=1;
busybox sysctl -e -wnet.ipv4.tcp_rmem='6144 87380 524288';
busybox sysctl -e -w net.ipv4.tcp_wmem='614487380 524288';
#
# Misc tweaks for battery life
#
busybox sysctl -wvm.dirty_writeback_centisecs=2000;
busybox sysctl -wvm.dirty_expire_centisecs=1000;
mount -o remount,ro /system 2>/dev/null;
for m in /dev/block/mtdblock*;
do
mount -o remount,ro $m /system2>/dev/null;
done;

保存退出。

二、来到/data文件夹下

a.建立文本文件,扩展名sh,以文本方式打开,文件名为99SuperCharger

复制以下代码:

#!/system/bin/sh
# V6 SuperCharger, OOM Grouping &Priority Fixes created by zeppelinrox.
execute=0;
currentadj=`cat/sys/module/lowmemorykiller/parameters/adj`;
currentminfree=`cat/sys/module/lowmemorykiller/parameters/minfree`;
scadj=`cat /data/SuperChargerAdj`;
scminfree=`cat /data/SuperChargerMinfree`;
if [ "$currentadj" !="$scadj" ]; then
         execute=1;
elif [[ -n "$scminfree" ]]&& [ "$currentminfree" != "$scminfree" ]; then
         execute=1;
fi;
if [ "$execute" -eq 1 ]; then
         mount-o remount,rw /system 2>/dev/null;
         form in /dev/block/mtdblock*;
         do
         mount-o remount,rw $m /system 2>/dev/null;
         done;
         echo$scadj > /sys/module/lowmemorykiller/parameters/adj;
         echo$scminfree > /sys/module/lowmemorykiller/parameters/minfree;
         sed-i '/.*_ADJ/d' /system/build.prop;
         sed-i '/.*_MEM/d' /system/build.prop;
         busyboxsysctl -w vm.oom_kill_allocating_task=0;
         busyboxsysctl -w vm.panic_on_oom=0;
         busyboxsysctl -w kernel.panic_on_oops=1;
         busyboxsysctl -w kernel.panic=0;
         mount-o remount,ro /system 2>/dev/null;
         form in /dev/block/mtdblock*;
         do
         mount-o remount,ro $m /system 2>/dev/null;
         done;
fi;
# End of V6 SuperCharged Entries

保存退出。

b.建立一个文本文件,去掉扩展名,名为:SuperChargerOptions

内容如下:

1,0

保存退出。

c.建立一个文本文件,扩展名为prop,名为:local

内容如下:

# V6 SuperCharger, OOM Grouping & Priority Fixes created by zeppelinrox.
# DO NOT DELETE COMMENTS. DELETING COMMENTSWILL BREAK UNINSTALL ROUTINE!
# BEGIN OOM_MEM_Settings
ro.FOREGROUND_APP_MEM=1536
ro.VISIBLE_APP_MEM=3072
ro.PERCEPTIBLE_APP_MEM=1024
ro.HEAVY_WEIGHT_APP_MEM=10240
ro.SECONDARY_SERVER_MEM=10240
ro.BACKUP_APP_MEM=15360
ro.HOME_APP_MEM=1024
ro.HIDDEN_APP_MEM=15360
ro.EMPTY_APP_MEM=25600
# END OOM_MEM_Settings
# BEGIN OOM_ADJ_Settings
ro.FOREGROUND_APP_ADJ=0
ro.VISIBLE_APP_ADJ=3
ro.PERCEPTIBLE_APP_ADJ=2
ro.HEAVY_WEIGHT_APP_ADJ=4
ro.SECONDARY_SERVER_ADJ=5
ro.BACKUP_APP_ADJ=6
ro.HOME_APP_ADJ=2
ro.HIDDEN_APP_MIN_ADJ=7
ro.EMPTY_APP_ADJ=15
# END OOM_ADJ_Settings
# End of V6 SuperCharged Entries

保存退出。

d.建立一个文本文件,去掉扩展名,名为:SuperChargerAdj

内容如下:

0,3,5,7,14,15

保存退出。

e.建立一个文本文件,去掉扩展名,名为:SuperChargerMinfree

内容如下:

1536,3072,10240,15360,20480,25600

保存退出。

三、/system下的build.prop

打开/system/build.prop

在最底下加入以下代码:

# Nitro Lag Nullifier by zeppelinrox.
# DO NOT DELETE COMMENTS. DELETING COMMENTSWILL BREAK UNINSTALL ROUTINE!
ENFORCE_PROCESS_LIMIT=false
MAX_SERVICE_INACTIVITY=
MIN_HIDDEN_APPS=
MAX_HIDDEN_APPS=
CONTENT_APP_IDLE_OFFSET=
EMPTY_APP_IDLE_OFFSET=
MAX_ACTIVITIES=
ACTIVITY_INACTIVE_RESET_TIME=
# End of Nullified Entries

保存退出。
--------------------------------------------------------------------------------------------
本人小白 ,不知道如何更改权限,还希望知道的大大们 将你们的方法告诉大家





欢迎光临 移动叔叔 (http://bbs.ydss.cn/) Powered by Discuz! X3.2