[Xperia Z General] HSD-Pilot:
Script 1

#!/system/bin/sh

LOG_FILE=/data/Init.d_Tweaks.log

if [ -e $LOG_FILE ]; then

rm $LOG_FILE;

fi;

echo "Init.d is working" | tee -a $LOG_FILE;

echo "@ $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;

echo " " | tee -a $LOG_FILE;

Script 2

#!/system/bin/sh

LOG_FILE=/data/Init.d_Tweaks.log

mount -o remount,rw -t auto /system

chmod -R 755 /system/etc/init.d

mount -o remount,ro -t auto /system

echo "Init.d Permissions set to 0755 / -rwxr-xr-x" | tee -a $LOG_FILE;

echo "@ $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;

echo " " | tee -a $LOG_FILE;

Script 3

#!/system/bin/sh

LOG_FILE=/data/Init.d_Tweaks.log

# Hardware 2D & 3D Rendering

setprop hw3d.force 1

setprop hw2d.force 1

# GPU

setprop debug.egl.hw 1

setprop debug.sf.hw 1

setprop video.accelerate.hw 1

setprop ro.config.disable.hw_accel false

setprop persist.sys.ui.hw 1

setprop debug.egl.profiler 1

setprop debug.enabletr true

#setprop debug.egl.swapinterval 0

setprop ro.sf.compbypass.enable 0

setprop debug.composition.type gpu

setprop persist.sys.composition.type gpu

setprop ro.product.gpu.driver1

setprop persist.android.strictmode 0

setprop ro.secure 0

setprop debug.performance.tuning 1

setprop persist.sys.use.dithering 1

setprop persist.service.lgospd.enable 0

setprop persist.service.pcsync.enable 0

# FPS

setprop persist.sys.NV_FPSLIMIT 60

setprop persist.sys.NV_POWERMODE 1

setprop persist.sys.NV_PROFVER 15

setprop persist.sys.NV_STEREOCTRL 0

setprop persist.sys.NV_STEREOSEPCHG 0

setprop persist.sys.NV_STEREOSEP 20

# 16bit Support

setprop debug.fb.rgb565 1

setprop persist.sys.use_16bpp_alpha 1

# Touchscreen

setprop touch.presure.scale 0.001

setprop ro.max.fling_velocity 15000

setprop ro.min.fling_velocity 10000

setprop windowsmgr.max_events_per_sec 90

setprop ro.min_pointer_dur 1

# Media

setprop ro.media.enc.hprof.vid.bps 8000000

setprop ro.media.enc.hprof.vid.fps 65

setprop ro.media.dec.jpeg.memcap 8000000

setprop ro.media.enc.jpeg.quality 100

# Kernel

setprop ro.kernel.checkjni 0

setprop ro.kernel.android.checkjni 0

# Launcher

setprop ro.HOME_APP_ADJ 1

setprop ro.HOME_APP_MEM 2048

# USB

setprop persist.service.adb.enable 1

setprop persist.service.usb.setting 0

setprop persist.sys.usb.config mtp,adb

setprop persist.adb.notify 0

# Boot

setprop persist.sys.shutdown.mode hibernate

setprop ro.config.hw_quickpoweron true

# Battery

setprop ro.config.hw_fast_dormancy 1

setprop ro.config.hw_power_saving true

setprop ro.ril.disable.power.collapse 1

setprop pm.sleep_mode 1

setprop wifi.supplicant_scan_interval 300

setprop ro.vold.umsdirtyratio 20

# Logging

setprop ro.config.htc.nocheckin 1

setprop ro.config.nocheckin 1

setprop profiler.force_disable_ulog 1

setprop profiler.force_disable_err_rpt 1

# Better Telephony Settings

setprop ro.config.vc_call_vol_steps 10

setprop ro.config.vc_call_steps 15

setprop ro.telephony.call_ring.delay 500

setprop ring.delay 0

# setprop ro.lge.proximity.delay 25

# setprop mot.proximity.delay 25

setprop ro.ril.enable.amr.wideband 1

# Dalvik

# setprop dalvik.vm.checkjni false

setprop dalvik.vm.verify-bytecode false

setprop dalvik.vm.execution-mode int:jit

# setprop dalvik.vm.debug.alloc 0

# Network

setprop net.rmnet0.dns1 8.8.8.8

setprop net.rmnet0.dns2 8.8.4.4

setprop net.dns1 8.8.8.8

setprop net.dns2 8.8.4.4

setprop net.tcp.buffersize.default 4096,87380,256960,4096,16384,256960

setprop net.tcp.buffersize.wifi 4096,87380,256960,4096,16384,256960

setprop net.tcp.buffersize.umts 4096,87380,256960,4096,16384,256960

setprop net.tcp.buffersize.gprs 4096,87380,256960,4096,16384,256960

setprop net.tcp.buffersize.edge 4096,87380,256960,4096,16384,256960

setprop ro.ril.hsxpa 2

setprop ro.ril.enable.3g.prefix 1

setprop ro.ril.hep 1

setprop ro.ril.enable.dtm 1

setprop ro.ril.gprsclass 12

setprop ro.ril.hsdpa.category 8

setprop ro.ril.enable.a53 1

setprop ro.ril.hsupa.category 5

setprop persist.cust.tel.eons 1

# Misc

setprop debug.kill_allocating_task 0

setprop ro.ext4fs 1

setprop persist.sys.purgeable_assets 1

echo "Build.prop Tweaks applied" | tee -a $LOG_FILE;

echo "@ $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;

echo " " | tee -a $LOG_FILE;

Script 4

NEEDS THE ZIPALIGN BINARY IN XBIN!

#!/system/bin/sh

LOG_FILE=/data/Zipalign.log

if [ -e $LOG_FILE ]; then

rm $LOG_FILE;

fi;

LOG_FILE2=/data/Init.d_Tweaks.log

ZIPALIGNDB=/data/zipalign.db

if [ ! -f $ZIPALIGNDB ]; then

touch $ZIPALIGNDB;

fi;

echo " " | tee -a $LOG_FILE;

echo "Starting Automatic ZipAlign" | tee -a $LOG_FILE

echo " " | tee -a $LOG_FILE;

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 "Already checked: $DIR/$APK" | tee -a $LOG_FILE

else

zipalign -c 4 $APK

if [ $? -eq 0 ] ; then

echo "Already aligned: $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

busybox mount -o ro,remount /system

touch $ZIPALIGNDB

echo " " | tee -a $LOG_FILE;

echo "ZipAlign finished" | tee -a $LOG_FILE

echo " " | tee -a $LOG_FILE;

echo "$( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;

echo "ZipAlign applied" | tee -a $LOG_FILE2

echo "@ $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE2;

echo " " | tee -a $LOG_FILE2;

Script 5

#!/system/bin/sh

LOG_FILE=/data/Init.d_Tweaks.log

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;

# Wifi Sleep

sqlite=/system/xbin/sqlite3;

wifi_idle_wait=10000;

$sqlite /data/data/com.android.providers.settings/databases/settings.db "update secure set value=$wifi_idle_wait where name='wifi_idle_ms'";

echo "Sqlite applied" | tee -a $LOG_FILE;

echo "@ $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;

echo " " | tee -a $LOG_FILE;

Script 6

#!/system/bin/sh

LOG_FILE=/data/Init.d_Tweaks.log

sleep 45

# VM_Tweaks

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 "1" > /proc/sys/vm/laptop_mode;

echo "40" > /proc/sys/vm/swappiness

echo "50" > /proc/sys/vm/vfs_cache_pressure

echo "50" > /proc/sys/vm/dirty_ratio

echo "50" > /proc/sys/vm/dirty_background_ratio

echo "1000" > /proc/sys/vm/dirty_expire_centisecs

echo "2000" > /proc/sys/vm/dirty_writeback_centisecs

echo "3" > /proc/sys/vm/page-cluster;

echo "VM Tweaks applied" | tee -a $LOG_FILE;

# Minfree

echo "0,2,4,8,12,24" > /sys/module/lowmemorykiller/parameters/adj;

echo "2048,4096,6144,8192,16384,24576" > /sys/module/lowmemorykiller/parameters/minfree

echo "Minfree Values applied" | tee -a $LOG_FILE;

# Misc Kernel Tweaks

echo "512 64000 64 1024" > /proc/sys/kernel/sem

echo "10" > /proc/sys/fs/lease-break-time

echo "268435456" > /proc/sys/kernel/shmmax;

echo "2097152" > /proc/sys/kernel/shmall;

echo "4096" > /proc/sys/kernel/shmmni;

echo "8192" > /proc/sys/kernel/msgmni;

echo "64000" > /proc/sys/kernel/msgmax;

echo "30" > /proc/sys/kernel/panic;

echo "0" > /proc/sys/kernel/panic_on_oops;

echo "5000" > /proc/sys/kernel/threads-max;

echo "65536" > /proc/sys/fs/file-max;

echo "NO_GENTLE_FAIR_SLEEPERS" > /sys/kernel/debug/sched_features;

echo "NO_NEW_FAIR_SLEEPERS" > /sys/kernel/debug/sched_features;

echo "NO_NORMALIZED_SLEEPER" > /sys/kernel/debug/sched_features;

echo "Kernel Tweaks applied" | tee -a $LOG_FILE;

# Remove Logger

if [ -e /dev/log/main ]

then

rm -f /dev/log/main

fi

echo "Logging is off" | tee -a $LOG_FILE;

# File System Tweaks & Cleanup

busybox mount -o remount,noatime,nodiratime,remount,rw,barrier=0,data=writeback /data;

busybox mount -o remount,noatime,nodiratime,remount,rw,barrier=0,data=writeback /cache;

busybox mount -o remount,noatime,nodiratime /dev;

busybox mount -o remount,noatime,nodiratime /proc;

busybox mount -o remount,noatime,nodiratime /sys;

busybox mount -o remount,noatime,nodiratime /system;

busybox mount -o remount,rw,noatime,noauto_da_alloc,nodiratime,barrier=0,nobh /system

busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,nodev,barrier=0,nobh /data

busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,nodev,barrier=0,nobh /cache

rm -r /data/local/tmp/*

rm -r /data/tmp/*

rm -r /data/system/usagestats/*

rm -r /data/system/appusagestats/*

rm -r /data/system/dropbox/*

rm -r /data/tombstones/*

rm -r /data/anr/*

busybox chmod 000 /data/system/userbehavior.db

busybox chmod 000 /data/system/usagestats/

busybox chmod 000 /data/system/dropbox/

busybox chmod 000 /data/anr/

busybox chmod 000 /data/tombstones/

busybox chmod 000 /data/system/appusagestats/

busybox chmod 000 /data/data/com.google.android.location/files/cache.cell

busybox chmod 000 /data/data/com.google.android.location/files/cache.wifi

echo "File System Tweaked & Cleaned" | tee -a $LOG_FILE;

# Clear Ram

/bin/mount -o remount,rw /

/bin/rm -r /voodoo/root/usr/*

/bin/mount -o remount,ro /

echo "Ram cleaned" | tee -a $LOG_FILE;

echo " " | tee -a $LOG_FILE;

echo "@$( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;

echo " " | tee -a $LOG_FILE;

Script 7

#!/system/bin/sh

LOG_FILE=/data/Init.d_Tweaks.log

sleep 60

# Set Scaling Governor

GOVERNOR="ondemand"

echo $GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

echo $GOVERNOR > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor

echo $GOVERNOR > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor

echo $GOVERNOR > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor

echo "$GOVERNOR Governor is running" | tee -a $LOG_FILE;

# Set Min & Max Frequency

# 384000 486000 594000 702000 810000 918000 1026000 1134000 1242000 1350000 1458000 1512000

CPU_MIN="384000"

CPU_MAX="1512000"

echo $CPU_MIN > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

echo $CPU_MAX > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

echo $CPU_MIN > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq

echo $CPU_MAX > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq

echo $CPU_MIN > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq

echo $CPU_MAX > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq

echo $CPU_MIN > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq

echo $CPU_MAX > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq

echo "Min / Max Frequency is set to $CPU_MIN / $CPU_MAX" | tee -a $LOG_FILE;

# Set IO Sheduler

SHEDULER="cfq"

echo $SHEDULER > /sys/block/mmcblk0/queue/scheduler

echo $SHEDULER > /sys/block/mmcblk1/queue/scheduler

echo "$SHEDULER Sheduler is running" | tee -a $LOG_FILE;

# Set SD Cache

READ_AHEAD_KB="1024"

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/254:0/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/254:1/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:0/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:32/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/0:18/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:0/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:1/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:2/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:3/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:4/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:5/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:6/read_ahead_kb

echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/7:7/read_ahead_kb

echo "256" > /sys/devices/virtual/bdi/default/read_ahead_kb

echo "SD Cache is set to $READ_AHEAD_KB kb" | tee -a $LOG_FILE;

# Tweak Governor

# Ondemand

if [ -d "/sys/devices/system/cpu/cpufreq/$GOVERNOR" ]; then

# Ondemand Tweaked

# echo "90" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold

# echo "80" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load

# echo "80" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core

# echo "55000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate

# echo "2" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor

#echo "384000" > /sys/devices/system/cpu/cpufreq/ondemand/sync_freq

# echo "702000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq

# echo "10" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential

# echo "25" > /sys/devices/system/cpu/cpufreq/ondemand/freq_step

# echo "1" > /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias

# Ondemand Battery

echo "90" /sys/devices/system/cpu/cpufreq/ondemand/up_threshold

echo "90" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load

echo "90" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core

echo "70000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate

echo "1" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor

echo "384000" > /sys/devices/system/cpu/cpufreq/ondemand/sync_freq

echo "384000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq

echo "5" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential

echo "10" > /sys/devices/system/cpu/cpufreq/ondemand/freq_step

echo "1" > /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias

# Ondemand Performance

# echo "70" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold

# echo "60" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load

# echo "60" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core

# echo "50000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate

# echo "2" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor

# echo "702000" > /sys/devices/system/cpu/cpufreq/ondemand/sync_freq

# echo "1512000" > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq

# echo "15" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential

# echo "50" > /sys/devices/system/cpu/cpufreq/ondemand/freq_step

# echo "1" > /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias

fi;

# Interactive

if [ -d "/sys/devices/system/cpu/cpufreq/$GOVERNOR" ]; then

# Interactive Tweaked

echo "90" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load

echo "1242000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq

echo "20000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time

echo "30000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate

# Interactive Battery

# echo "95" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load

# echo "1026000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq

# echo "10000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time

# echo "40000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate

# Interactive Performance

# echo "80" > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load

# echo "1512000" > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq

# echo "40000" > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time

# echo "20000" > /sys/devices/system/cpu/cpufreq/interactive/timer_rate

fi;

# Conservative

if [ -d "/sys/devices/system/cpu/cpufreq/$GOVERNOR" ]; then

# Conservative Tweaked

echo "90" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold

echo "100000" > /sys/devices/system/cpu/cpufreq/conservative/sampling_rate

echo "2" > /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor

echo "40" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold

echo "10" > /sys/devices/system/cpu/cpufreq/conservative/freq_step

# Conservative Battery

# echo "95" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold

# echo "120000" > /sys/devices/system/cpu/cpufreq/conservative/sampling_rate

# echo "1" > /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor

# echo "40" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold

# echo "10" > /sys/devices/system/cpu/cpufreq/conservative/freq_step

# Conservative Performance

# echo "60" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold

# echo "40000" > /sys/devices/system/cpu/cpufreq/conservative/sampling_rate

# echo "5" > /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor

# echo "20" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold

# echo "25" > /sys/devices/system/cpu/cpufreq/conservative/freq_step

fi;

echo "$GOVERNOR Governor is Tweaked" | tee -a $LOG_FILE;

# Custom Kernel Tweaks

# reduce / increase [mv] for all Frequencys

# echo "-90000" > /sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels

# Set GPU Governor

# echo "simple" > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/pwrscale/trustzone/governor

# Set GPU Clock

# echo "325000000" > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/max_gpuclk

# Swap / Tap 2 Wake

# echo "0" > /sys/android_touch/doubletap2wake

# echo "0" > /sys/android_touch/sweep2wake

# echo "Custom Kernel Settings are applied" | tee -a $LOG_FILE;

echo " " | tee -a $LOG_FILE;

echo "@ $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;

echo " " | tee -a $LOG_FILE;

The # comments in Build.prop doesn't play well 4 me. Try & Error ;)

To check the prop Tweaks type getprop in an Terminal Emulator.

Every script has an log @ the End. If one is missing, there was an Error during start.

Look in data/init.d_tweaks.log

Gesendet von meinem Full Android on C6603 mit Tapatalk