[DEV/TOOL] Automated(ish) T-Mobile Theme Generator - Android Software Development

A script I've been working on for a couple of days. Still a work in progress so if you suck less, I could use improvements. It's real simple:
** Put this script in a stock theme template like Cyanbread
1.) Place a source ROM you want to theme for, the base ROM/THROM you're taking images from and a stock theme template (like Cyanbread) and set them in the script at the top.
2.) Modify the script as needed (it's not done as of this writing) and set verbosity out the output, etc.
2.) Run the script and it will do the work
The code should be pretty self explanatory and I'll update it as I go. Just about finished at this point.
Screenshot shows you what it does
Code:
#!/bin/bash
# ------------------------- Set theme name TODO
# themeName=$(cat Android.mk | grep LOCAL_PACKAGE_NAME | sed 's/^LOCAL_PACKAGE_NAME\s:=\s//g')
# read -p "Enter theme name. Enter for default [$themeName]: " REPLY
# REPLY=${REPLY:-$themeName}
# echo "Theme name is $themeName"
# ------------------------- for testing to spare the parameters
SRCROM="ABSOLUTE/PATH/TO/ROOT/OF/SOURCEROM"
BASEROM="ABSOLUTE/PATH/TO/ROOT/OF/BASEROM/YOURE/THEMING/FOR"
# my example:
# SRCROM=~/GBSense2.1/
# BASEROM=~/cm_glacier_full-42/
# running this script from ~/haxzamatic-Templatebread--918313e/
DSTROM=$(pwd)
LOGFILE=$DSTROM/logfile.log
decompile_rom(){
cd $1/app
if [ ! -d $1/app/Browser/ ]; then # need apktool for drawables
#apktool if framework/framework_res.apk
#if [ -e framework/com.htc.resources.apk ]; then
# apktool if framework/com.htc.resources.apk
#fi
for i in `ls $1/app/*.apk`; do echo "Decompiling $i"; apktool d $i; done
cd ../framework
for i in `ls $1/framework/*.apk`; do echo "Decompiling $i"; apktool d $i; done
else
echo "Already decompiled"
fi
}
decompile_rom $SRCROM/system
decompile_rom $BASEROM/system
cd $DSTROM
rm $DSTROM/res/xml/*.xml
echo "" > appendleftovers.tmp
# ------------------------- Log file purge and title
cat <<EOF > $LOGFILE
*********************************************************
Missing files from $SRCROM
*********************************************************
EOF
# ------------------------- Redirections.xml
cat <<EOF > res/xml/redirections.xml
<?xml version="1.0" encoding="utf-8"?>
<theme-redirections
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:pluto="http://www.w3.org/2001/pluto.html">
EOF
# ------------------------- Android.xml
echo "<resource-redirections>">$DSTROM/res/xml/android.xml
# ------------------------- Main Loop
find "$BASEROM" -type f -name "*.png" | while read fimg; do
# ------------------------- Base Params
FIMGFNAME=$(cat $(dirname $fimg)"/../../apktool.yml" | grep "apkFileName" | sed 's/apkFileName:\s//g' | sed 's/\.apk//g' )
FIMGPNAME=$(cat $(dirname $fimg)"/../../AndroidManifest.xml" | grep "package" | tr " " "\n" | grep package= | cut -d \" -f 2)
if [ $FIMGPNAME = "android" ]; then FIMGPNAME=framework_res; fi
FIMGDNAME=$(echo $(dirname $fimg) | sed "s/\(.*\)\///" )
cd $DSTROM
if [ "$FIMGFNAME" = "framework-res" ] || [ "$FIMGFNAME" = "com.htc.resources" ]; then wp="framework"
else wp="app"
fi
# -------------------------
SRCFILEPATH=$SRCROM/system/$wp/$FIMGFNAME/res/$FIMGDNAME/$DESTFILE
SRCFILENAME=$(echo $(basename $fimg))
DSTFILEPATH=$DSTROM/system/$wp/$FIMGFNAME/res/$FIMGDNAME/$DESTFILE
DSTFILENAME=$(echo $(echo $FIMGPNAME|sed 's/\./_/g')"_$(basename $fimg)")
BSEFILEPATH=$BASEROM/system/$wp/$FIMGFNAME/res/$FIMGDNAME/$DESTFILE
BSEFILENAME=$(echo $(basename $fimg))
# -------------------------
[ -d res ] || mkdir res
[ -d res/$FIMGDNAME ] || mkdir res/$FIMGDNAME
# -------------------------
if [ -f $SRCFILEPATH$SRCFILENAME ]; then
echo "cp $SRCFILEPATH$SRCFILENAME $DSTROM/res/$FIMGDNAME/$DSTFILENAME"
cp $SRCFILEPATH$SRCFILENAME $DSTROM/res/$FIMGDNAME/$DSTFILENAME
# ------------------------- Redirections.xml
thispname=$(cat $(dirname $fimg)"/../../AndroidManifest.xml" | grep "package" | tr " " "\n" | grep package= | cut -d \" -f 2)
if ! grep -iq $thispname $DSTROM/res/xml/redirections.xml ; then
echo "<package-redirections android:name=\"$thispname\" android:minSdkVersion=\"7\" android:resource=\"@xml/$(echo $thispname|sed 's/\./_/g')\" />" >>$DSTROM/res/xml/redirections.xml
fi
# ------------------------- Android.xml
drawrsrc=$(echo $SRCFILENAME | sed 's/\(.*\)\..*/\1/' | sed 's/\.9//g')
drawrdst=$(echo $DSTFILENAME | sed 's/\(.*\)\..*/\1/' | sed 's/\.9//g')
echo "<item name=\"@drawable/$drawrsrc\">@drawable/$drawrdst</item>" >>$DSTROM/res/xml/android.xml
# ------------------------- Package Redirections
drawrfnamenoext=$(echo $drawrsrc | sed 's/\./_/g')
dstfilenameparsed=$(echo $drawrdst | sed 's/\./_/g')
dstredirfname=`echo "$DSTROM/res/xml/$(echo $FIMGPNAME | sed 's/\./_/g').xml"`
if [ ! -f $dstredirfname ]; then
cat <<EOF > $dstredirfname
<?xml version="1.0" encoding="utf-8"?>
<resource-redirections>
EOF
echo "$dstredirfname" >> appendleftovers.tmp
fi
echo "<item name=\"drawable/$drawrfnamenoext\">@drawable/$dstfilenameparsed</item>" >>$dstredirfname
else
echo "[MISSING]: $SRCFILEPATH$SRCFILENAME" >> $LOGFILE
#echo "1.) $fimg" >> $LOGFILE
#echo "2.) $FIMGFNAME" >> $LOGFILE
#echo "3.) $FIMGPNAME" >> $LOGFILE
#echo "4.) $FIMGDNAME" >> $LOGFILE
#echo "5.) $SRCFILEPATH" >> $LOGFILE
#echo "6.) $SRCFILENAME" >> $LOGFILE
#echo "7.) $DSTFILEPATH" >> $LOGFILE
#echo "8.) $DSTFILENAME" >> $LOGFILE
#echo "9.) $BSEFILEPATH" >> $LOGFILE
#echo "10.)$BSEFILENAME" >> $LOGFILE
#echo "------------------------------" >> $LOGFILE
fi
# echo "1.) $fimg"
# echo "2.) $FIMGFNAME"
# echo "3.) $FIMGPNAME"
# echo "4.) $FIMGDNAME"
# echo "5.) $SRCFILEPATH"
# echo "6.) $SRCFILENAME"
# echo "7.) $DSTFILEPATH"
# echo "8.) $DSTFILENAME"
# echo "9.) $BSEFILEPATH"
# echo "10.)$BSEFILENAME"
# echo "------------------------------"
# ------------------------- Example output:
# 1.) ~/cm_glacier_full-42/system/app/Browser/res/drawable-hdpi/fav_icn_background.png
# 2.) Browser
# 3.) com.android.browser
# 4.) drawable-hdpi
# 5.) ~/GBSense2.1/system/app/Browser/res/drawable-hdpi/
# 6.) fav_icn_background.png
# 7.) ~/haxzamatic-Templatebread--918313e/system/app/Browser/res/drawable-hdpi/
# 8.) com_android_browser_fav_icn_background.png
# 9.) ~/cm_glacier_full-42/system/app/Browser/res/drawable-hdpi/
# 10.)fav_icn_background.png
done
# ------------------------- Close out the XML tags
echo "</resource-redirections>">>$DSTROM/res/xml/android.xml
echo "</theme-redirections>">>$DSTROM/res/xml/redirections.xml
cat $DSTROM/appendleftovers.tmp | while read thistmp; do
echo "</resource-redirections>" >> $thistmp
done
rm $DSTROM/appendleftovers.tmp
echo "FINISHED:::::::::::::::::::::::::::::::::::::::::::::::::::::::"

reserved for spam

Related

[Q]zipalign on boot code

Hey there
I just found out that robocik zipalign on boot code was as same as maxisma ones
robocik​
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;
[B]echo "Starting Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
for apk in /system/sd/app/*.apk ; do[/B]
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;
Maxisma​
Code:
#!/system/bin/sh
echo "++++ ZIP ALIGNMENT PROCESS STARTING ++++"
LOG_FILE=/data/zipalign.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
[B]echo "Starting DC Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
for apk in /data/app/*.apk ; do[/B]
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 DC | tee -a $LOG_FILE;
fi;
else
echo DCZipAlign 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;
echo "++++ ZIP ALIGNMENT PROCESS FINISHED ++++"
I have bold the differences between this two codes
So are this two codes work the same? Does it need /system/bin/sh in order to run the command line? If I change the #!/system/bin/sh (the first line) to #!/system/xbin/bash,will it work too? If I have don't have the bash file in /system/xbin/ ,will it work too? Are bash and sh the same?
BTW,erasmux's boot OC pack also included a 09betterzipalign in it (he said it wasn't his)
Here is the code
Code:
#!/system/xbin/bash
LOG_FILE=/data/zipalign.log
ZIPALIGNDB=/data/zipalign.db
SYSTEM=$(mount|grep "/system "|awk '{ print $1 }')
function mountrw {
mount | grep "/system " | grep rw >/dev/null || mount -o remount,rw $SYSTEM /system
}
function mountro {
mount | grep "/system " | grep ro >/dev/null || mount -o remount,ro $SYSTEM /system
}
[ -e $LOG_FILE ] && rm $LOG_FILE
[ -f $ZIPALIGNDB ] || touch $ZIPALIGNDB
echo "Starting FV Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
for DIR in /system/app /data/app /data/app-private ; 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
mountrw
cp -f -p /cache/$APK $APK
rm -f /cache/$APK
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
fi
fi
done
done
mountro
touch $ZIPALIGNDB
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
the first line is #!/system/xbin/bash,so it needs the bash file in the /system/xbin folder in order to work,rite? Is it the same as robocik and maxisma code?
What is this?
make something clear!!
robocik's script looks for apks to zipalign at "/system/sd/app/"
while Maxisma's looks at "/data/app/"
When looking at the dirs, robably robocik's mounts things as well in another script. Maybe apps2sd?
The first long line is quite unimportant, it just states "hey I'm zipalign and ready to work", with different names/texts.
I believed bash was based on sh, can't tell for sure. I always learned to follow the sh guidelines to get max compability. Maybe some linux-expert can tell you for sure, or just try to google it a little
riemervdzee said:
robocik's script looks for apks to zipalign at "/system/sd/app/"
while Maxisma's looks at "/data/app/"
When looking at the dirs, robably robocik's mounts things as well in another script. Maybe apps2sd?
The first long line is quite unimportant, it just states "hey I'm zipalign and ready to work", with different names/texts.
I believed bash was based on sh, can't tell for sure. I always learned to follow the sh guidelines to get max compability. Maybe some linux-expert can tell you for sure, or just try to google it a little
Click to expand...
Click to collapse
After some hours of research,I found out most of the ROM in XDA all include sh file (I didn't check all of it but most of them included sh file) but not all included bash file (10 out of 4 rom included bash file),this means in order to run the code,I need bash file in xbin (did a adb logcat and found out a line that says busybox runparts - blah blah blah /system/etc/init.d/09betterzipalign [the one that has #!/system/xbin/bash line on it] error running something like that)
BTW,robocik and maxisma one are almost the same,how can robocik ones can zipalign /system/sd/app/,he didn't change the code or anything,just type in the log file,thats all...
One more thing,y can't we run zipalign-on-boot on all the apps that were installed through the Android Market or wasn't installed on the /data/app?
Ng LC said:
Hey there
I just found out that robocik zipalign on boot code was as same as maxisma ones
robocik​
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;
[B]echo "Starting Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
for apk in /system/sd/app/*.apk ; do[/B]
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;
Maxisma​
Code:
#!/system/bin/sh
echo "++++ ZIP ALIGNMENT PROCESS STARTING ++++"
LOG_FILE=/data/zipalign.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
[B]echo "Starting DC Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
for apk in /data/app/*.apk ; do[/B]
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 DC | tee -a $LOG_FILE;
fi;
else
echo DCZipAlign 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;
echo "++++ ZIP ALIGNMENT PROCESS FINISHED ++++"
I have bold the differences between this two codes
So are this two codes work the same? Does it need /system/bin/sh in order to run the command line? If I change the #!/system/bin/sh (the first line) to #!/system/xbin/bash,will it work too? If I have don't have the bash file in /system/xbin/ ,will it work too? Are bash and sh the same?
BTW,erasmux's boot OC pack also included a 09betterzipalign in it (he said it wasn't his)
Here is the code
Code:
#!/system/xbin/bash
LOG_FILE=/data/zipalign.log
ZIPALIGNDB=/data/zipalign.db
SYSTEM=$(mount|grep "/system "|awk '{ print $1 }')
function mountrw {
mount | grep "/system " | grep rw >/dev/null || mount -o remount,rw $SYSTEM /system
}
function mountro {
mount | grep "/system " | grep ro >/dev/null || mount -o remount,ro $SYSTEM /system
}
[ -e $LOG_FILE ] && rm $LOG_FILE
[ -f $ZIPALIGNDB ] || touch $ZIPALIGNDB
echo "Starting FV Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
for DIR in /system/app /data/app /data/app-private ; 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
mountrw
cp -f -p /cache/$APK $APK
rm -f /cache/$APK
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
fi
fi
done
done
mountro
touch $ZIPALIGNDB
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
the first line is #!/system/xbin/bash,so it needs the bash file in the /system/xbin folder in order to work,rite? Is it the same as robocik and maxisma code?
Click to expand...
Click to collapse
Thanks mate, getting this error
I//system/xbin/busybox( 1215): /system/etc/init.d/97zipalign: line 24: tee: command not found
I//system/xbin/busybox( 1215): /system/etc/init.d/97zipalign: line 15: tee: command not found
I//system/xbin/busybox( 1215): /system/etc/init.d/97zipalign: line 16: basename: command not found
I//system/xbin/busybox( 1215): /system/etc/init.d/97zipalign: line 15: basename: command not found
Any idea?

[DEV\HELP] ICS Optimization Script

I have written a script that lets all users to customize the official ICS released by Huawei. I have tested the script but it does not work, so i want to share my work to find my errors and to help other users to optimize their phone.
I need someone who knows how to write scripts in bash......this is the script:
Code:
#! /system/bin/sh
################################
# ICS Optimizer #
# #
# by matteof93 #
################################
mount -o remount,rw -t yaffs2 /dev/block/mmcblk0 /system
main_menu()
{
clear
echo "-----------------------------------------------------"
echo "- ICS Optimizer Script -"
echo "-----------------------------------------------------"
echo "01. Unlock FPS"
echo "02. Change CPU scheduler"
echo "03. Enable Jit"
echo "04. Change Dalvik VM heapsize"
echo "05. Force Launcher in memory"
echo "06. Disable Bootanimation"
echo "07. Increase touch and scrolling responsiveness"
echo "08. Apply other build.prop tweaks"
echo "09. Prepare Android for optimization process"
echo "10. Restore defaults"
echo
echo "11. Reboot"
echo
echo "12. Exit"
echo "----------------------------"
echo -n "Select an option: "
read unlockfps
case $unlockfps in
01)
unlockfps
;;
02)
scheduler
;;
03)
jit
;;
04)
changedalvik
;;
05)
launchermemory
;;
06)
bootanimation
;;
07)
increaseresponsiveness
;;
08)
othertweaks
;;
09)
prepareandroid
;;
10)
resotredefaultsettings
;;
11)
rebootxx
;;
12)
exitxx
esac
}
main_menu
echo "Invalid Option!"
read -p "Press ENTER to continue..."
clear
main_menu
#######################################################################
noop(){
clear
cp /sdcard/ICS-Optimization-Script/Schedulers/Noop/06scheduler /system/etc/init.d
cd /system/etc/init.d
chmod 777 06scheduler
echo "Scheduler changed..."
echo "Reboot to apply the new settings..."
read -p "Press ENTER to continue..."
clear
scheduler
}
cfq(){
clear
cp /sdcard/ICS-Optimization-Script/Schedulers/Cfq/06scheduler
/system/etc/init.d
cd /system/etc/init.d
chmod 777 06scheduler
echo "Scheduler chenged..."
echo "Reboot to apply the new settings..."
read -p "Press ENTER to continue..."
clear
scheduler
}
scheduler()
{
clear
echo "-----------------------------------------------------"
echo "- CPU Scheduler Changer -"
echo "-----------------------------------------------------"
echo "01. Noop"
echo "02. Cfq"
echo
echo "03. Main Menu"
echo "----------------------------"
echo -n "Select an option: "
read noop
case $noop in
01)
noop
;;
02)
cfq
;;
03)
main menu
esac
}
#######################################################################
removefpslimit()
{
clear
cp /sdcard/ICS-Optimization-Script/UnlockFPS/08uncapfps /system/etc/init.d
cd /system/etc/init.d
chmod 777 08uncapfps
echo "FPS Unlocked..."
echo "Reboot to apply the new settings..."
read -p "Press ENTER to continue..."
clear
unlockfps
}
unlockfps()
{
clear
echo "-----------------------------------------------------"
echo "- Unlock FPS -"
echo "-----------------------------------------------------"
echo "01. Remove FPS limit"
echo
echo "02. Main Menu"
echo "--------------------------"
echo -n "Select an option: "
read removefpslimit
case $removefpslimit in
01)
removefpslimit
;;
02)
main menu
esac
}
#######################################################################
enablejit()
{
clear
echo "#Jit enabled" | tee -a /system/build.prop
echo "dalvik.vm.execution-mode=int:jit" | tee -a /system/build.prop
echo "Jit enabled..."
echo "Reboot to apply the new settings..."
read -p "Press ENTER to continue..."
clear
jit
}
disablejit()
{
clear
sed -i '/#Jit enabled/d' /system/build.prop
sed -i '/dalvik.vm.execution-mode=int:jit/d' /system/build.prop
echo "Jit disabled..."
echo "Reboot to apply the new settings..."
read -p "Press ENTER to continue..."
clear
jit
}
jit()
{
clear
echo "-----------------------------------------------------"
echo "- Enable Jit -"
echo "-----------------------------------------------------"
echo "01. Enable Jit"
echo "02. Disable Jit"
echo
echo "03. Main Menu"
echo "--------------------------"
echo -n "Select an option: "
read enablejit
case $enablejit in
01)
enablejit
;;
02)
disablejit
;;
03)
main menu
esac
}
#######################################################################
prepareandroid()
{
clear
cp /system/build.prop /sdcard/build.prop
mv /sdcard/build.prop /sdcard/build.prop.bak
mkdir /system/etc/init.d
echo "Android System prepared to optimization..."
echo "Please Reboot..."
read -p "Press ENTER to continue..."
clear
main_menu
}
#######################################################################
dalvik64()
{
clear
cd /system
sed -i 's/dalvik.vm.heapstartsize=5m/dalvik.vm.heapstartsize=64m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=12m/dalvik.vm.heapstartsize=64m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=16m/dalvik.vm.heapstartsize=64m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=24m/dalvik.vm.heapstartsize=64m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=32m/dalvik.vm.heapstartsize=64m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=48m/dalvik.vm.heapstartsize=64m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=64m/dalvik.vm.heapstartsize=64m/g' build.prop
sed -i 's/dalvik.vm.heapsize=12m /dalvik.vm.heapsize=64m/g' build.prop
sed -i 's/dalvik.vm.heapsize=16m /dalvik.vm.heapsize=64m/g' build.prop
sed -i 's/dalvik.vm.heapsize=24m /dalvik.vm.heapsize=64m/g' build.prop
sed -i 's/dalvik.vm.heapsize=32m /dalvik.vm.heapsize=64m/g' build.prop
sed -i 's/dalvik.vm.heapsize=48m /dalvik.vm.heapsize=64m/g' build.prop
sed -i 's/dalvik.vm.heapsize=64m /dalvik.vm.heapsize=64m/g' build.prop
echo "Dalvik VM heapsize value has been changed..."
echo "Please Reboot..."
read -p "Press ENTER to continue..."
clear
changedalvik
}
dalvik48()
{
clear
cd /system
sed -i 's/dalvik.vm.heapstartsize=5m/dalvik.vm.heapstartsize=48m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=12m/dalvik.vm.heapstartsize=48m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=16m/dalvik.vm.heapstartsize=48m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=24m/dalvik.vm.heapstartsize=48m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=32m/dalvik.vm.heapstartsize=48m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=48m/dalvik.vm.heapstartsize=48m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=64m/dalvik.vm.heapstartsize=48m/g' build.prop
sed -i 's/dalvik.vm.heapsize=12m /dalvik.vm.heapsize=48m/g' build.prop
sed -i 's/dalvik.vm.heapsize=16m /dalvik.vm.heapsize=48m/g' build.prop
sed -i 's/dalvik.vm.heapsize=24m /dalvik.vm.heapsize=48m/g' build.prop
sed -i 's/dalvik.vm.heapsize=32m /dalvik.vm.heapsize=48m/g' build.prop
sed -i 's/dalvik.vm.heapsize=48m /dalvik.vm.heapsize=48m/g' build.prop
sed -i 's/dalvik.vm.heapsize=64m /dalvik.vm.heapsize=48m/g' build.prop
echo "Dalvik VM heapsize value has been changed..."
echo "Please Reboot..."
read -p "Press ENTER to continue..."
clear
changedalvik
}
dalvik32()
{
clear
cd /system
sed -i 's/dalvik.vm.heapstartsize=5m/dalvik.vm.heapstartsize=32m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=12m/dalvik.vm.heapstartsize=32m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=16m/dalvik.vm.heapstartsize=32m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=24m/dalvik.vm.heapstartsize=32m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=32m/dalvik.vm.heapstartsize=32m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=48m/dalvik.vm.heapstartsize=32m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=64m/dalvik.vm.heapstartsize=32m/g' build.prop
sed -i 's/dalvik.vm.heapsize=12m /dalvik.vm.heapsize=32m/g' build.prop
sed -i 's/dalvik.vm.heapsize=16m /dalvik.vm.heapsize=32m/g' build.prop
sed -i 's/dalvik.vm.heapsize=24m /dalvik.vm.heapsize=32m/g' build.prop
sed -i 's/dalvik.vm.heapsize=32m /dalvik.vm.heapsize=32m/g' build.prop
sed -i 's/dalvik.vm.heapsize=48m /dalvik.vm.heapsize=32m/g' build.prop
sed -i 's/dalvik.vm.heapsize=64m /dalvik.vm.heapsize=32m/g' build.prop
echo "Dalvik VM heapsize value has been changed..."
echo "Please Reboot..."
read -p "Press ENTER to continue..."
clear
changedalvik
}
dalvik24()
{
clear
cd /system
sed -i 's/dalvik.vm.heapstartsize=5m/dalvik.vm.heapstartsize=24m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=12m/dalvik.vm.heapstartsize=24m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=16m/dalvik.vm.heapstartsize=24m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=24m/dalvik.vm.heapstartsize=24m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=32m/dalvik.vm.heapstartsize=24m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=48m/dalvik.vm.heapstartsize=24m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=64m/dalvik.vm.heapstartsize=24m/g' build.prop
sed -i 's/dalvik.vm.heapsize=12m /dalvik.vm.heapsize=24m/g' build.prop
sed -i 's/dalvik.vm.heapsize=16m /dalvik.vm.heapsize=24m/g' build.prop
sed -i 's/dalvik.vm.heapsize=24m /dalvik.vm.heapsize=24m/g' build.prop
sed -i 's/dalvik.vm.heapsize=32m /dalvik.vm.heapsize=24m/g' build.prop
sed -i 's/dalvik.vm.heapsize=48m /dalvik.vm.heapsize=24m/g' build.prop
sed -i 's/dalvik.vm.heapsize=64m /dalvik.vm.heapsize=24m/g' build.prop
echo "Dalvik VM heapsize value has been changed..."
echo "Please Reboot..."
read -p "Press ENTER to continue..."
clear
changedalvik
}
dalvik16()
{
clear
cd /system
sed -i 's/dalvik.vm.heapstartsize=5m/dalvik.vm.heapstartsize=16m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=12m/dalvik.vm.heapstartsize=16m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=16m/dalvik.vm.heapstartsize=16m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=24m/dalvik.vm.heapstartsize=16m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=32m/dalvik.vm.heapstartsize=16m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=48m/dalvik.vm.heapstartsize=16m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=64m/dalvik.vm.heapstartsize=16m/g' build.prop
sed -i 's/dalvik.vm.heapsize=12m /dalvik.vm.heapsize=16m/g' build.prop
sed -i 's/dalvik.vm.heapsize=16m /dalvik.vm.heapsize=16m/g' build.prop
sed -i 's/dalvik.vm.heapsize=24m /dalvik.vm.heapsize=16m/g' build.prop
sed -i 's/dalvik.vm.heapsize=32m /dalvik.vm.heapsize=16m/g' build.prop
sed -i 's/dalvik.vm.heapsize=48m /dalvik.vm.heapsize=16m/g' build.prop
sed -i 's/dalvik.vm.heapsize=64m /dalvik.vm.heapsize=16m/g' build.prop
echo "Dalvik VM heapsize value has been changed..."
echo "Please Reboot..."
read -p "Press ENTER to continue..."
clear
changedalvik
}
dalvik12()
{
clear
cd /system
sed -i 's/dalvik.vm.heapstartsize=5m/dalvik.vm.heapstartsize=12m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=12m/dalvik.vm.heapstartsize=12m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=16m/dalvik.vm.heapstartsize=12m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=24m/dalvik.vm.heapstartsize=12m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=32m/dalvik.vm.heapstartsize=12m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=48m/dalvik.vm.heapstartsize=12m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=64m/dalvik.vm.heapstartsize=12m/g' build.prop
sed -i 's/dalvik.vm.heapsize=12m /dalvik.vm.heapsize=12m/g' build.prop
sed -i 's/dalvik.vm.heapsize=16m /dalvik.vm.heapsize=12m/g' build.prop
sed -i 's/dalvik.vm.heapsize=24m /dalvik.vm.heapsize=12m/g' build.prop
sed -i 's/dalvik.vm.heapsize=32m /dalvik.vm.heapsize=12m/g' build.prop
sed -i 's/dalvik.vm.heapsize=48m /dalvik.vm.heapsize=12m/g' build.prop
sed -i 's/dalvik.vm.heapsize=64m /dalvik.vm.heapsize=12m/g' build.prop
echo "Dalvik VM heapsize value has been changed..."
echo "Please Reboot..."
read -p "Press ENTER to continue..."
clear
changedalvik
}
restoredefault()
{
clear
cd /system
sed -i 's/dalvik.vm.heapstartsize=5m/dalvik.vm.heapstartsize=5m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=12m/dalvik.vm.heapstartsize=5m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=16m/dalvik.vm.heapstartsize=5m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=24m/dalvik.vm.heapstartsize=5m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=32m/dalvik.vm.heapstartsize=5m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=48m/dalvik.vm.heapstartsize=5m/g' build.prop
sed -i 's/dalvik.vm.heapstartsize=64m/dalvik.vm.heapstartsize=5m/g' build.prop
sed -i 's/dalvik.vm.heapsize=12m /dalvik.vm.heapsize=64m/g' build.prop
sed -i 's/dalvik.vm.heapsize=16m /dalvik.vm.heapsize=64m/g' build.prop
sed -i 's/dalvik.vm.heapsize=24m /dalvik.vm.heapsize=64m/g' build.prop
sed -i 's/dalvik.vm.heapsize=32m /dalvik.vm.heapsize=64m/g' build.prop
sed -i 's/dalvik.vm.heapsize=48m /dalvik.vm.heapsize=64m/g' build.prop
sed -i 's/dalvik.vm.heapsize=64m /dalvik.vm.heapsize=64m/g' build.prop
echo "Dalvik VM heapsize value has been changed..."
echo "Please Reboot..."
read -p "Press ENTER to continue..."
clear
changedalvik
}
changedalvik()
{
clear
echo "-----------------------------------------------------"
echo "- Dalvik VM heapsize changer -"
echo "-----------------------------------------------------"
echo "01. Set Dalvik VM heapsize to 48"
echo "02. Set Dalvik VM heapsize to 32"
echo "03. Set Dalvik VM heapsize to 24"
echo "04. Set Dalvik VM heapsize to 16"
echo "05. Set Dalvik VM heapsize to 12"
echo "06. Restore default Dalvik VM heapsize value"
echo
echo "07. Main Menu"
echo "--------------------------"
echo -n "Select an option: "
read dalvik48
case $dalvik48 in
01)
dalvik48
;;
02)
dalvik32
;;
03)
dalvik24
;;
04)
dalvik16
;;
05)
dalvik12
;;
06)
restoredefault
;;
07)
main menu
esac
}
#######################################################################
launchermemoryin()
{
clear
echo "#Force Launcher in memory" | tee -a /system/build.prop
echo "ro.home_app_adj=1" | tee -a /system/build.prop
echo "Launcher forced in memory..."
echo "Reboot to apply the new settings..."
read -p "Press ENTER to continue..."
clear
launchermemory
}
launchermemoryout()
{
clear
sed -i '/#Force Launcher in memory/d' /system/build.prop
sed -i '/ro.home_app_adj=1/d' /system/build.prop
echo "Launcher forced in memory..."
echo "Reboot to apply the new settings..."
read -p "Press ENTER to continue..."
clear
launchermemory
}
launchermemory()
{
clear
echo "-----------------------------------------------------"
echo "- Force Launcher in memory -"
echo "-----------------------------------------------------"
echo "01. Force Launcher in memory"
echo "02. Remove Launcher from memory"
echo
echo "03. Main Menu"
echo "--------------------------"
echo -n "Select an option: "
read launchermemoryin
case $launchermemoryin in
01)
launchermemoryin
;;
02)
launchermemoryout
;;
03)
main menu
esac
}
#######################################################################
nobootanimation()
{
clear
echo "#Bootanimation disabled" | tee -a /system/build.prop
echo "debug.sf.nobootanimation=1" | tee -a /system/build.prop
echo "Bootanimation disabled..."
echo "Reboot to apply the new settings..."
read -p "Press ENTER to continue..."
clear
bootanimation
}
bootanimationon()
{
clear
sed -i '/#Bootanimation disabled/d' /system/build.prop
sed -i '/debug.sf.nobootanimation=1/d' /system/build.prop
echo "Bootanimation enabled..."
echo "Reboot to apply the new settings..."
read -p "Press ENTER to continue..."
clear
bootanimation
}
bootanimation()
{
clear
echo "-----------------------------------------------------"
echo "- Enable\Disable Bootanimation -"
echo "-----------------------------------------------------"
echo "01. Disable Bootanimation"
echo "02. Enable Bootanimation"
echo
echo "03. Main Menu"
echo "--------------------------"
echo -n "Select an option: "
read nobootanimation
case $nobootanimation in
01)
nobootanimation
;;
02)
bootanimationon
;;
03)
main menu
esac
}
#######################################################################
applytweaks()
{
clear
echo "#Increase Touch\Scrolling responsiveness" | tee -a /system/build.prop
echo "windowsmgr.max_events_per_sec=150" | tee -a /system/build.prop
echo "video.accelerate.hw=1" | tee -a /system/build.prop
echo "debug.performance.tuning=1" | tee -a /system/build.prop
echo "ro.min.fling_velocity=8000" | tee -a /system/build.prop
sed -i 's/ro.max.fling_velocity=4000/ro.max.fling_velocity=12000/g' build.prop
echo "Tweaks applied..."
echo "Reboot to apply the new settings..."
read -p "Press ENTER to continue..."
clear
increaseresponsiveness
}
defaults()
{
clear
sed -i '/#Increase Touch\Scrolling responsiveness/d' /system/build.prop
sed -i '/windowsmgr.max_events_per_sec=150/d' /system/build.prop
sed -i '/video.accelerate.hw=1/d' /system/build.prop
sed -i '/debug.performance.tuning=1/d' /system/build.prop
sed -i '/ro.min.fling_velocity=8000/d' /system/build.prop
sed -i 's/ro.max.fling_velocity=12000/ro.max.fling_velocity=4000/g' build.prop
echo "default settings restored..."
echo "Reboot to apply the new settings..."
read -p "Press ENTER to continue..."
clear
increaseresponsiveness
}
increaseresponsiveness()
{
clear
echo "-----------------------------------------------------"
echo "- Touch\Scrolling responsiveness -"
echo "-----------------------------------------------------"
echo "01. Apply tweaks"
echo "02. Restore default"
echo
echo "03. Main Menu"
echo "--------------------------"
echo -n "Select an option: "
read applytweaks
case $applytweaks in
01)
applytweaks
;;
02)
defaults
;;
03)
main menu
esac
}
#######################################################################
applyothertweaks()
{
echo "#Other tweaks" | tee -a /system/build.prop
echo "wifi.supplicant_scan_interval=180" | tee -a /system/build.prop
sed -i 's/ro.config.hw_RemindWifiToPdp=true/ro.config.hw_RemindWifiToPdp=false/g' build.prop
echo "Tweaks applied..."
echo "Reboot to apply the new settings..."
read -p "Press ENTER to continue..."
clear
othertweaks
}
restoreothertweaks()
{
sed -i 's/ro.config.hw_RemindWifiToPdp=false/ro.config.hw_RemindWifiToPdp=true/g' build.prop
sed -i '/#Other tweaks/d' /system/build.prop
sed -i '/wifi.supplicant_scan_interval=180/d' /system/build.prop
echo "default settings restored..."
echo "Reboot to apply the new settings..."
read -p "Press ENTER to continue..."
clear
othertweaks
}
othertweaks()
{
clear
echo "-----------------------------------------------------"
echo "- Other Tweaks -"
echo "-----------------------------------------------------"
echo "01. Apply tweaks"
echo "02. Restore default"
echo
echo "03. Main Menu"
echo "--------------------------"
echo -n "Select an option: "
read applyothertweaks
case $applyothertweaks in
01)
applyothertweaks
;;
02)
restoreothertweaks
;;
03)
main menu
esac
}
#######################################################################
restoredefaultsettings2()
{
clear
rm /system/build.prop
cp /sdcard/build.prop.bak /system
mv /system/build.prop.bak /system/build.prop
rmdir /system/etc/init.d
echo "default settings restored..."
echo "Reboot to apply the new settings..."
read -p "Press ENTER to continue..."
clear
restoredefaultsettings
}
restoredefaultsettings()
{
clear
echo "-----------------------------------------------------"
echo "- Restore Default Settings -"
echo "-----------------------------------------------------"
echo "01. Restore default settings"
echo
echo "02. Main Menu"
echo "--------------------------"
echo -n "Select an option: "
read restoredefaultsettings2
case $restoredefaultsettings2 in
01)
restoredefaultsettings2
;;
02)
main menu
esac
}
#######################################################################
rebootxx()
{
clear
echo "Rebooting..."
reboot
}
exitxx()
{
clear
echo "Bye!"
exit
}
actually it does not work.....there are some errors.
is there someone that can help me????
No scripts - no problems
It's better to be done by editing system files by changing values to that you need.
Waiting for CWM...
Light rom - good rom!
Init.d support is dissabled in stock rom's. You should enable it first.
Sent from my ragelis
bronxitas said:
No scripts - no problems
It's better to be done by editing system files by changing values to that you need.
Waiting for CWM...
Light rom - good rom!
Init.d support is dissabled in stock rom's. You should enable it first.
Sent from my ragelis
Click to expand...
Click to collapse
you do not need init.d support to run this script. you need simply busybox and script manager.
I'm doing all mod's without script if it's possible. Scripts are early stage of mod'ing
Sent from my ragelis
Chenged?
Sent from my U8800-51 using xda premium
i have left this project....

[MOD][GUIDE]tweak collections for build.prop/init.d

1 i DIDNT made this all tweaks ... Credit goes to their Developers...
I am not responsible for your bricked phone/sd if u pointed on me i will laugh at u
Forever king Tweaks....​
Build.prop tweaks​
1 VM Heapsize; higher the RAM
Code:
dalvik.vm.heapsize=48m
2 Good JPG quality
Code:
ro.media.enc.jpeg.quality=100
3 Render UI with GPU
Code:
debug.sf.hw=1
4 Best Scrolling
Code:
windowsmgr.max_events_per_sec=150
5 Decrease dialing out delay
Code:
ro.telephony.call_ring.delay=0
6 battery Saving
Code:
wifi.supplicant_scan_interval=180
pm.sleep_mode=1
ro.ril.disable.power.collapse=0
7 Disable debugging notify icon on statusbar
Code:
persist.adb.notify=0
8 Increase touch responsiveness
Code:
debug.performance.tuning=1
video.accelerate.hw=1
9 Awesome photo and video recording quality
Code:
ro.media.dec.jpeg.memcap=8000000
ro.media.enc.hprof.vid.bps=8000000
10 Network tweaks
Code:
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
11 Internet fast tweaks
Code:
net.tcp.buffersize.default=6144,87380,1048576,6144,87380,524288
net.tcp.buffersize.wifi=524288,1048576,2097152,524288,1048576,2097152
net.tcp.buffersize.umts=6144,87380,1048576,6144,87380,524288
net.tcp.buffersize.gprs=6144,87380,1048576,6144,87380,524288
net.tcp.buffersize.edge=6144,87380,524288,6144,16384,262144
net.tcp.buffersize.hspa=6144,87380,524288,6144,16384,262144
net.tcp.buffersize.lte=524288,1048576,2097152,524288,1048576,2097152
net.tcp.buffersize.hsdpa=6144,87380,1048576,6144,87380,1048576
net.tcp.buffersize.evdo_b=6144,87380,1048576,6144,87380,1048576
12 Fix some application issues (FC)
ro.kernel.android.checkjni=0
13 Phone will not wake up from hitting the volume rocker
Code:
ro.config.hwfeature_wakeupkey=0
14 Disable boot animation for faster boot
Code:
debug.sf.nobootanimation=1
15 faster streaming
Code:
media.stagefright.enable-meta=true
media.stagefright.enable-record=false
16 Miscellaneous Tweaks for performance
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
17 Use Google DNS
Code:
net.ppp0.dns1=8.8.8.8
net.ppp0.dns2=8.8.4.4
net.dns1=8.8.8.8
net.dns2=8.8.4.4
Init.d tweaks​
(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 tweak1)
1 strict minfree handler tweak
Code:
echo "2048,3072,6144,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
2 internet speed hack 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 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;
4 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
5 battery tweaks
Code:
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
6 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
7 increases cache size and increases speed
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 SD 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
10 Ondemand governor
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 Governor Best: Minmax , SavagedZen , Smoothass , Smartass, Interactive
Code:
echo "governor-name-here" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
12 Move dalvik-cache to cache partition
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
13 Disable normalize sleeper
Code:
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
Other tweaks (not build.prop,init.d)​
1 v6 supercharger
Code:
http://forum.xda-developers.com/attachment.php?attachmentid=591730&d=1305000576
Credit- zeppelinrox
2 Use CyanogenMOD's APN list file (fully , for every operator)
Its in system>etc
3 Use uot kitchen for Theming your rom
Code:
http://uot.dakra.lt/
4 Never use Task killer............
please hit thanks and comment if you like this guide....if using in Rom proper credits to this guide!

Tizen

As tizen source is available now I wondered if anyone has taken a look at it yet.
I prepared my machine to start building it and test it.
Will publish updates in this thread.
Sent from my GT-I9300 using xda premium
Another mobile OS. Like there isnt enough already.
Subscribe
Tapatalk 2-vel küldve az én GT-I9300-ről
As far as I have read the new phone with Tizen which Samsung will release (i9500) uses the i9300 modem.
Looking at the structure, used kernel etc now.
For building a kickstart file is used, it is looking like this:
Code:
# -*-mic2-options-*- -f loop [email protected]@-rs.tar.gz -*-mic2-options-*-
#
# Do not Edit! Generated by:
# kickstarter.py
#
lang en_US.UTF-8
keyboard us
timezone --utc America/Los_Angeles
# ROOT fs partition
#part / --size=800 --ondisk mmcblk0p --fstype=ext4 --label=platform
# Use larger partition for creation, and will be shrinked at last, workaround of libzypp bug
#part / --size=2000 --ondisk mmcblk0p --fstype=ext4 --label=platform
# DATA partition
#part /opt/ --size=1800 --ondisk mmcblk0p --fstype=ext4 --label=data
# ROOT fs partition
part / --size=1700 --ondisk mmcblk0p --fstype=ext4 --label=platform
# DATA partition
part /opt/ --size=3000 --ondisk mmcblk0p --fstype=ext4 --label=data
# UMS partition
part /opt/media/ --size=300 --ondisk mmcblk0p --fstype=vfat --label=ums
rootpw tizen
bootloader --timeout=0 --append="rootdelay=5"
desktop --autologinuser=root
user --name root --groups audio,video --password ''
repo --name=Tizen-main --baseurl=https://download.tizen.org/snapshots/trunk/common/@[email protected]/repos/main/armv7l/packages/ --save --ssl_verify=no
repo --name=Tizen-base --baseurl=https://download.tizen.org/snapshots/trunk/common/@[email protected]/repos/base/armv7l/packages/ --save --ssl_verify=no
%packages
@tizen-c210
@tizen-bootstrap
-glib2-static
-gettext-tools
-eglibc-utils
-imake
-giflib-utils
-brcm-gps-daemon
-insserv
%end
%prepackages
libgcc
eglibc
sqlite
zlib
libpython
libdlog
libcap
libattr
default-files-slp
busybox
python-base
libacl
glib2
tzdata-slp
vconf
libxml2
heynoti
openssl
shared-mime-info
libudev
security-server
dbus-libs
cert-svc
libsecurity-server-client
%end
%post
echo 'kickstart post script start'
if [ -d /etc/init.d ]; then
cp /etc/init.d/* /etc/rc.d/init.d/ -rdf
fi
rm -rf /etc/init.d*
ln -sf /etc/rc.d/init.d /etc/init.d
# Without this line the rpm don't get the architecture right.
echo -n 'armv7l-meego-linux' > /etc/rpm/platform
ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
ail_initdb
/opt/apps/com.samsung.menu-screen/bin/menuscreen_initdb
cat > /usr/bin/press << EOF
#!/bin/sh
JUNK="SLP"
[ "\$1" ] && TIMEOUT="\$1" || TIMEOUT="1"
echo "Press return key to stop scripts"
read -t \$TIMEOUT JUNK
exit \$?
EOF
chmod +x /usr/bin/press
ln -s /opt/etc/X11/xkb /usr/share/X11
echo "UDEV_PERSISTENT_STORAGE=no" >> /etc/sysconfig/udev
rm -rf /usr/include
rm -rf /usr/share/man
rm -rf /usr/share/doc
MAJOR="2"
MINOR="0"
cat >/etc/info.ini <<EOF
[Version]
Major=$MAJOR;
Minor=$MINOR;
Build=TIZEN_`date +%Y%m%d`_1;
Order=;
[Build]
Date=`date +%Y.%m.%d`;
Time=`date +%H:%M:%S`;
EOF
ln -sf /etc/info.ini /opt/etc/info.ini
ln -sf /etc/info.ini /usr/etc/info.ini
mkdir -p /home/app
cp -a /etc/skel/.e /home/app/
chown -R 5000:5000 /home/app
chmod 0755 /home/app
chown -R 5000:5000 /opt/home/app
chmod 0755 /opt/home/app
cat > /usr/lib/systemd/system/usb-debug.service << EOF
[Unit]
Description=Start usb networking for debugging
ConditionPathExists=/sys/devices/platform/usb_mode/UsbMenuSel
[Service]
Type=oneshot
RemainAfterExit=yes
Environment=PATH=/bin:/sbin
ExecStart=/bin/bash -c 'echo 4 > /sys/devices/platform/usb_mode/UsbMenuSel'
ExecStart=/sbin/ifconfig usb0 192.168.129.3 netmask 255.255.255.0
ExecStop=/bin/bash -c 'echo 0 > /sys/devices/platform/usb_mode/UsbMenuSel'
#
# We now don't launch this USB mode hack by default. If you need that, run this:
# systemctl enable usb-debug.service
# or create a link manually like below:
# ln -s ../usb-debug.service /usr/lib/systemd/system/basic.target.wants/usb-debug.service
#
[Install]
WantedBy=basic.target
EOF
# required for the connman systemd service
cat > /etc/sysconfig/connman << EOF
OPTIONS="-W wext"
EOF
# required for the wpa_supplicant systemd service
cat > /etc/sysconfig/wpa_supplicant << EOF
OPTIONS="-Dwext"
EOF
ldconfig
rpm --rebuilddb
echo 'kickstart post script end'
%end
%post --nochroot
%end
News ?
It is nice Android to have competition but from what I saw on youtube Tizen is just android stuck at version 2.3. Is there anything new except that there will be no native apps?
gud to here that
now wating for ur good work

SM-T230NU - Generate .config used by a running a kernel

Is it possible to create a new kernel config file used by the running kernel for the SM-T230NU? If so, what are the steps to create one? The reason I am asking is I want to use the .config file to create a Kernel module. The module is LiME.ko and it is used to acquire the tablet's memory image which I use for forensic analysis. The challenge is that default Samsung Kernels/ROM's do not appear to come with a kernel .config file.
Your help is appreciated.
Thanks,
http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=SM-T230
-> arch/arm/config
https://github.com/GalaxyTab4/andro...h/arm/configs/pxa1088_degaswifi_eur_defconfig
-> my GitHub
checking for ikconfig
->
Code:
#!/bin/sh
# ----------------------------------------------------------------------
# extract-ikconfig - Extract the .config file from a kernel image
#
# This will only work when the kernel was compiled with CONFIG_IKCONFIG.
#
# The obscure use of the "tr" filter is to work around older versions of
# "grep" that report the byte offset of the line instead of the pattern.
#
# (c) 2009,2010 **** Streefland <****@streefland.net>
# Licensed under the terms of the GNU General Public License.
# ----------------------------------------------------------------------
cf1='IKCFG_ST\037\213\010'
cf2='0123456789'
dump_config()
{
if pos=`tr "$cf1\n$cf2" "\n$cf2=" < "$1" | grep -abo "^$cf2"`
then
pos=${pos%%:*}
tail -c+$(($pos+8)) "$1" | zcat > $tmp1 2> /dev/null
if [ $? != 1 ]
then # exit status must be 0 or 2 (trailing garbage warning)
cat $tmp1
exit 0
fi
fi
}
try_decompress()
{
for pos in `tr "$1\n$2" "\n$2=" < "$img" | grep -abo "^$2"`
do
pos=${pos%%:*}
tail -c+$pos "$img" | $3 > $tmp2 2> /dev/null
dump_config $tmp2
done
}
# Check invocation:
me=${0##*/}
img=$1
if [ $# -ne 1 -o ! -s "$img" ]
then
echo "Usage: $me <kernel-image>" >&2
exit 2
fi
# Prepare temp files:
tmp1=/tmp/ikconfig$$.1
tmp2=/tmp/ikconfig$$.2
trap "rm -f $tmp1 $tmp2" 0
# Initial attempt for uncompressed images or objects:
dump_config "$img"
# That didn't work, so retry after decompression.
try_decompress '\037\213\010' xy gunzip
try_decompress '\3757zXZ\000' abcde unxz
try_decompress 'BZh' xy bunzip2
try_decompress '\135\0\0\0' xxx unlzma
try_decompress '\211\114\132' xy 'lzop -d'
try_decompress '\002\041\114\030' xyy 'lz4 -d -l'
# Bail out:
echo "$me: Cannot find kernel config." >&2
exit 1
Thank you for getting back to me. You have been very helpful. I have a related question. How do I install the kernel I downloaded from the opensource.samsung site to my SM-T230NU?
I have created a kernel .config file from the downloaded kernel from the link you provided and subsequently generated a zImage file but I do not know how to create the ramdisk and boot.img. I tried installing the kernel using AnyKernel and Heimdall but it fails. Can you provide guidance or a tutorial on how to do this? I would rather not install a ROM. Only the kernel.
I really appreciate the help.
sub77 said:
http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=SM-T230
-> arch/arm/config
https://github.com/GalaxyTab4/andro...h/arm/configs/pxa1088_degaswifi_eur_defconfig
-> my GitHub
checking for ikconfig
->
Code:
#!/bin/sh
# ----------------------------------------------------------------------
# extract-ikconfig - Extract the .config file from a kernel image
#
# This will only work when the kernel was compiled with CONFIG_IKCONFIG.
#
# The obscure use of the "tr" filter is to work around older versions of
# "grep" that report the byte offset of the line instead of the pattern.
#
# (c) 2009,2010 **** Streefland <****@streefland.net>
# Licensed under the terms of the GNU General Public License.
# ----------------------------------------------------------------------
cf1='IKCFG_ST\037\213\010'
cf2='0123456789'
dump_config()
{
if pos=`tr "$cf1\n$cf2" "\n$cf2=" < "$1" | grep -abo "^$cf2"`
then
pos=${pos%%:*}
tail -c+$(($pos+8)) "$1" | zcat > $tmp1 2> /dev/null
if [ $? != 1 ]
then # exit status must be 0 or 2 (trailing garbage warning)
cat $tmp1
exit 0
fi
fi
}
try_decompress()
{
for pos in `tr "$1\n$2" "\n$2=" < "$img" | grep -abo "^$2"`
do
pos=${pos%%:*}
tail -c+$pos "$img" | $3 > $tmp2 2> /dev/null
dump_config $tmp2
done
}
# Check invocation:
me=${0##*/}
img=$1
if [ $# -ne 1 -o ! -s "$img" ]
then
echo "Usage: $me <kernel-image>" >&2
exit 2
fi
# Prepare temp files:
tmp1=/tmp/ikconfig$$.1
tmp2=/tmp/ikconfig$$.2
trap "rm -f $tmp1 $tmp2" 0
# Initial attempt for uncompressed images or objects:
dump_config "$img"
# That didn't work, so retry after decompression.
try_decompress '\037\213\010' xy gunzip
try_decompress '\3757zXZ\000' abcde unxz
try_decompress 'BZh' xy bunzip2
try_decompress '\135\0\0\0' xxx unlzma
try_decompress '\211\114\132' xy 'lzop -d'
try_decompress '\002\041\114\030' xyy 'lz4 -d -l'
# Bail out:
echo "$me: Cannot find kernel config." >&2
exit 1
Click to expand...
Click to collapse

Categories

Resources