[email protected]@holic help thread - ONE General

This is a thirteen step program for flashaholics.
{
"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"
}
Since there is no cure for flashaholism, we may as well give those afflicted more to flash..
**ALWAYS FLASH AT YOUR OWN RISK ANYTHING THAT GETS POSTED HERE**​
Just follow these simple steps:
1. Rate this thread 5 stars
2. Subscribe to this thread
3. Tell other flashaholics to join this thread
4. Treat all flashaholics with respect
5. Be on the constant lookout for anything new and noteworthy
6. Be helpful to those afflicted by posting these new found links
7. Always use protection when flashing (have a backup)
8. Don't be discrete about your flashing adventures, share your steamy details
9. Be helpful to outsiders that aren't as flash savvy as you and answer their posts nicely
10. If you feel a member is on the wagon, help them fall off by bragging about how cool your phone is
11. Remember to follow XDA rules
12. Happy flashing!!
13. Always thank your developers, and donate if you can..
BECOME PART OF AN ADDICTIVE COMMUNITY
I'm on telegram
HELP THE COMMUNITY AND JOIN THE ROM "WIKI"
You can add your knowledge to this growing chart of roms
-JOIN HERE-​
When not flashing I will update the thread with notable links of what, where, and how to flash..
Contributors
@#sychrome#
XDA community
Get your support banners -HERE-

WE'RE HERE FOR YOUR TUNING NEEDS
KA MOD (Kernel aduitor)
http://forum.xda-developers.com/android/apps-games/kernel-adiutor-mod-singularity-kernel-t3333549
How to apply profiles
http://forum.xda-developers.com/oneplus-one/development/rom-cm-12-builds-t3045053/post68636831
Lightning Kernel profiles
http://forum.xda-developers.com/oneplus-one/general/flshholic-help-thread-t2869514/post69351130
New Kernel profiles (jgcaap rom)
http://forum.xda-developers.com/oneplus-one/general/flshholic-help-thread-t2869514/post69271814
Moriarty Kernel profiles (S.O.S. rom)
http://forum.xda-developers.com/showpost.php?p=70181339&postcount=175
Battery Savings tips
1. Keep unneeded services off (location, BT, NFC, ect..)
2. Lower the screen brightness
3. Manage your apps with greenify (many apps will abuse services if you let them)
4. Don't discharge the battery to zero, and try to keep it cool (hot batteries discharge faster)

Settings Script
WELCOME TO SETTINGS SCRIPT
This is a set scripts I started collecting and working on since my days of old using a Nexus S. It has been updated and tested 100's of times and is ready for use on the OnePlus. I am not going to claim 1000's of points gained in benchmarks, or days of battery life, but it should help balance performance and battery..
Basically it's a collection of init.d scripts to gently modify some services, system, battery and various functions. This is active at boot (assuming you have init.d support and busybox). Please don't use this with other scripts (seeder is okay). Don't operate while intoxicated or holding an iPhone..
Code:
#!/system/bin/sh
# test
if [ -f /data/Test.log ] ; then
rm /data/Test.log
fi
echo "Script is working !!!" >> /data/Test.log
echo "excecuted on $(date +"%d-%m-%Y %r" )" >> /data/Test.log
# Expand Kernel Permission
if [ -e /dev/cpuctl/apps/cpu.notify_on_migrate ]; then
chown system.system /dev/cpuctl/apps/cpu.notify_on_migrate
chmod 0666 /dev/cpuctl/apps/cpu.notify_on_migrate
fi
# Cleaner
#Interval between runs, in seconds, 172800=48 hours
RUN_EVERY=172800
busybox rm -f /data/anr/*.*
busybox rm -f /data/cache/*.*
busybox rm -f /data/log/*.*
busybox rm -f /data/local/tmp/*.*
busybox rm -f /data/mlog/*
busybox rm -f /data/tombstones/*
busybox rm -f /data/backup/pending/*
busybox rm -f /data/system/dropbox/*
busybox rm -f /cache/recovery/*
busybox rm -f /dev/log/main/*
chmod 700 /data/system/dropbox
busybox chmod 700 /data/system/usagestats
# Zipalign
# 86400=24 hours
RUN_EVERY=86400
LOG_FILE=/data/zipalign.log
ZIPALIGNDB=/data/zipalign.db
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
if [ ! -f $ZIPALIGNDB ]; then
touch $ZIPALIGNDB;
fi;
echo "Starting FV Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | 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
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
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
# Renice
B=/system/xbin/busybox
( while true
do
sf=$( service list | $B grep -c "SurfaceFlinger" )
if [ $sf -eq 1 ]
then
service call SurfaceFlinger 1008 i32 1
break
else
sleep 2
fi
done
) &
# Kernel Tweaks
if [ -e /proc/sys/kernel/softlockup_panic ]
then
echo 0 > /proc/sys/kernel/softlockup_panic
fi
if [ -e /proc/sys/kernel/hung_task_timeout_secs ]
then
echo 0 > /proc/sys/kernel/hung_task_timeout_secs
fi
if [ -e /proc/sys/kernel/panic_on_oops ]
then
echo 0 > /proc/sys/kernel/panic_on_oops
fi
if [ -e /proc/sys/kernel/panic ]
then
echo 0 > /proc/sys/kernel/panic
fi
if [ -e /proc/sys/kernel/msgmni ]
then
echo 2048 > /proc/sys/kernel/msgmni
fi
if [ -e /proc/sys/kernel/msgmax ]
then
echo 64000 > /proc/sys/kernel/msgmax
fi
if [ -e /proc/sys/kernel/shmmax ]
then
echo 268435500 > /proc/sys/kernel/shmmax
fi
if [ -e /proc/sys/kernel/threads-max ]
then
echo 525810 > /proc/sys/kernel/threads-max
fi
if [ -e /proc/sys/kernel/nmi_watchdog ]; then
echo "0" > /proc/sys/kernel/nmi_watchdog;
sysctl -e -w kernel.nmi_watchdog=0;
fi;
if [ -e /proc/sys/vm/drop_caches ]; then
echo "3" > /proc/sys/vm/drop_caches;
sysctl -e -w vm.drop_caches=3;
fi;
#fsync
if [ -e /sys/devices/virtual/misc/fsynccontrol/fsync_enabled ]; then
echo "0" > /sys/devices/virtual/misc/fsynccontrol/fsync_enabled;
fi;
if [ -e /sys/class/misc/fsynccontrol/fsync_enabled ]; then
echo "0" > /sys/class/misc/fsynccontrol/fsync_enabled;
fi;
if [ -e /sys/module/sync/parameters/fsync ]; then
echo "0" > /sys/module/sync/parameters/fsync;
fi;
if [ -e /sys/module/sync/parameters/fsync_enabled ]; then
echo "0" > /sys/module/sync/parameters/fsync_enabled;
echo "N" > /sys/module/sync/parameters/fsync_enabled;
fi;
# Disable Sleepers
echo "NO_NEW_FAIR_SLEEPERS" > /sys/kernel/debug/sched_features;
echo "NO_NORMALIZED_SLEEPER" > /sys/kernel/debug/sched_features;
# Kill Media Tweak
LOG=/data/mediaserver_log.txt;
supolicy --live "allow mediaserver mediaserver_tmpfs:file { read write execute };";
if [ "$SDK" -le "18" ]; then
if [ "$SDK" -gt "10" ]; then
echo "Mediaserver kill" >> $LOG;
busybox killall -9 android.process.media;
busybox killall -9 mediaserver;
fi;
fi;
# Vsync tweak
if [ -e /sys/kernel/debug/msm_fb/0/vsync_enable ]; then
echo 0 > /sys/kernel/debug/msm_fb/0/vsync_enable
fi;
#Sqlite
# Log file location
LOG_FILE=/data/sqlite.log
#Interval between SQLite3 runs, in seconds, 604800=1 week
RUN_EVERY=604800
# Get the last modify date of the Log file, if the file does not exist, set value to 0
if [ -e $LOG_FILE ]; then
LASTRUN=`stat -t $LOG_FILE | awk '{print $14}'`
else
LASTRUN=0
fi;
# Get current date in epoch format
CURRDATE=`date +%s`
# Check the interval
INTERVAL=$(expr $CURRDATE - $LASTRUN)
# If interval is more than the set one, then run the main script
if [ $INTERVAL -gt $RUN_EVERY ]; then
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
echo "SQLite database VACUUM and REINDEX started at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
for i in `busybox find /d* -iname "*.db"`;
do /system/xbin/sqlite3 $i 'VACUUM;';
resVac=$?
if [ $resVac == 0 ]; then
resVac="SUCCESS";
else
resVac="ERRCODE-$resVac";
fi;
/system/xbin/sqlite3 $i 'REINDEX;';
resIndex=$?
if [ $resIndex == 0 ]; then
resIndex="SUCCESS";
else
resIndex="ERRCODE-$resIndex";
fi;
echo "Database $i: VACUUM=$resVac REINDEX=$resIndex" | tee -a $LOG_FILE;
done
echo "SQLite database VACUUM and REINDEX finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
fi;
#Lcd power
if [ -e /sys/class/lcd/panel/power_reduce ]; then
echo "LCD power reduce detected. Activating..";
echo "1" > /sys/class/lcd/panel/power_reduce;
fi;
# Properties tweak
setprop ro.kernel.android.checkjni 0
setprop debug.kill_allocating_task 0
setprop dev.pm.dyn_samplingrate 1
setprop pm.sleep_mode 1
setprop persist.sys.purgeable_assets 1
setprop persist.cust.tel.eons 1
setprop ro.ril.enable.amr.wideband 1
setprop ro.ril.transmitpower true
setprop ro.ril.sensor.sleep.control 1
setprop ro.config.combined_signal true
setprop ro.ril.hep 1
setprop wifi.supplicant_scan_interval 300
setprop cm.filesystem.ready 1
setprop persist.service.pcsync.enable 0
setprop persist.service.lgospd.enable 0
setprop ro.min_pointer_dur 1
setprop ro.sys.fw.bg_apps_limit 6
setprop ro.lcd_min_brightness 1
setprop persist.sys.use_dithering 0
setprop persist.sys.use_16bpp_alpha 1
setprop ro.max.fling_velocity 20000
setprop ro.min.fling_velocity 10000
#Ext4 mount
# Log file location
LOG_FILE=/data/fsck.log
if ( mount | grep -w ext4 ) then
echo "EXT4 Partition Found!"
echo "Remounting..."
mount -o noatime,remount,rw,discard,barrier=0,commit=60,noauto_da_alloc,delalloc /cache /cache;
mount -o noatime,remount,rw,discard,barrier=0,commit=60,noauto_da_alloc,delalloc /data /data;
mount >> /data/fsck.log;
else
echo "EXT4 Partition Not Found!"
fi;
echo "Script finished"
FLASH AT YOUR OWN RISK
INSTALLATION:
**Requires BusyBox and init.d support**
(For some Nougat roms emulation of init.d may be nessesary, use KA mod, or another app for init.d emulation..)
Just flash in recovery, no extra steps required to enjoy..
It removes the old version, so flash and forget, it also survives a dirty flash (v5.5+)..
This has been tested, but no guarantees for protection from aliens or ninjas..
SPECIAL THANKS TO: @h-cspu @7u5h4r @Stone_88@ashutoshmn @Purerawenergy and @maxed4901 for helping me improve it..
Unless there's a bug fix or something I like, this won't get updated further.. NO ETAS
DOWNLOAD(s)
https://www.androidfilehost.com/?w=files&flid=123565
SCRIPTS & UNINSTALLER
LATEST UPDATE
VERSION: 6.1 SS Beta 08/04/2017
VERSION: 3.1 SS Stable 08/04/2017
Enjoy

Mine

CARBON
DOWNLOAD
Normal ext4 Debloated, with Android L keyboard and MiXplorer
Converted F2FS Converted, debloated, with Android L keyboard and MiXplorer.. THIS DOES NOT NEED A KERNEL FLASHED OVER THIS it is an "all in one" convert and is complete..
Original from Moonlight Original with extra Chinese apps

Not mine

yeeeaaaaaa
Sent from my 1+1

Thank you so much for bringing us carbon!

For the spreadsheet, it requires access. Don't forget to change the permissions
You need permission
Want in? Ask the owner for access, or switch to an account with permission. Learn more
Click to expand...
Click to collapse

zephiK said:
For the spreadsheet, it requires access. Don't forget to change the permissions
Click to expand...
Click to collapse
I'll get that fixed, its a work in progress..
Sent from my One using XDA Premium 4 mobile app

My name is ninjanurse, and I am a [email protected]@holic
Sent from my One A0001 using Tapatalk

welcome, ninjanurse
Sent from my 1+1

ninjanurse said:
My name is ninjanurse, and I am a [email protected]@holic
Sent from my One A0001 using Tapatalk
Click to expand...
Click to collapse
I think you need to tell the group about your latest flashing exploits, and don't forget to brag..
Sent from my One using XDA Premium 4 mobile app

Hello i am primo14z
and i can't stand to have one ROM to much time :/
so ya they say that first step is to face yourself with the problem , so I am a [email protected]@holic
i tryed Carbon ROM and i must say works great, but doesn't have that special something why would i make it my daily

I'm a [email protected]@holic as well, dansou901 is my name. My method of getting along is having multirom installed, it helps alot with all the flashing...

dansou901 said:
I'm a [email protected]@holic as well, dansou901 is my name. My method of getting along is having multirom installed, it helps alot with all the flashing...
Click to expand...
Click to collapse
I wonder if multirom works on f2fs?..
**using that search thingy, it turns out that multirom does indeed support f2fs..
Sent from my One using XDA Premium 4 mobile app

Setting.Out said:
I wonder if multirom works on f2fs?..
**using that search thingy, it turns out that multirom does indeed support f2fs..
MultiROM really helps me to stay a real [email protected]@holic, why choose a rom of choice.. I can have them all...
Click to expand...
Click to collapse

ninjanurse said:
Setting.Out said:
I wonder if multirom works on f2fs?..
**using that search thingy, it turns out that multirom does indeed support f2fs..
MultiROM really helps me to stay a real [email protected]@holic, why choose a rom of choice.. I can have them all...
Click to expand...
Click to collapse
As long as you don't run out of storage space...
Click to expand...
Click to collapse

ninjanurse said:
As long as you don't run out of storage space...
Click to expand...
Click to collapse
Binge and purge!!..
Sent from my A0001 using XDA Premium 4 mobile app

I just moved back to ext4 from f2fs.. For a Flashaholic that was a long time to be limited in how and when you can flash.. I was going through withdrawls, so I flashed 4 roms 3 recoveries and 1 kernel along with gapps and the lot as well.. AHHHH... Much better.. And honestly, I know that f2fs is supposed to be faster, but even if it is, I want a bit more freedom to flash.. I'm not saying I won't try it again, but not for a while..
I will have some updated links to websites/roms this week as well as more than just a shell of a chart.. I think the chart(s) will really help others see what a rom has to offer..

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/TOOL] Automated(ish) T-Mobile Theme Generator

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

Universal Script for Android Phone

Create 00tweaks and put all the codes inside 00tweaks then put the file to system/etc/init.d
This universal script boost RAM performance.
This universal script mounts all partition as NOATIME
This universal script lessen lags on selected applications (MMS / Handcent / DialerOne)
This universal script enhances deadline scheduler
This universal script performs background process to check screen state
Click to expand...
Click to collapse
Code:
#!/system/bin/sh
#remounting the file systems with noatime and nodiratime flags to save battery and CPU cycles
for k in $(busybox mount | grep relatime | cut -d " " -f3)
do
sync
busybox mount -o remount,noatime,nodiratime $k
done
#if mounting is not successful then manual mounting will do the thing for you
mount -o remount,noatime,nodiratime auto /
mount -o remount,noatime,nodiratime auto /dev
mount -o remount,noatime,nodiratime auto /proc
mount -o remount,noatime,nodiratime auto /sys
mount -o remount,noatime,nodiratime auto /mnt/asec
mount -o remount,noatime,nodiratime auto /system
mount -o remount,noatime,nodiratime auto /data
mount -o remount,noatime,nodiratime auto /cache
mount -o remount,noatime,nodiratime auto /mnt/sdcard
mount -o remount,noatime,nodiratime auto /mnt/secure/asec
mount -o remount,noatime,nodiratime auto /mnt/sdcard/.android_secure
#flags every mounted partition as non rotational and increases it's cache size for more read speed
MTD=`ls -d /sys/block/mtd*`;
LOOP=`ls -d /sys/block/loop*`;
RAM=`ls -d /sys/block/ram*`;
MMC=`ls -d /sys/block/mmc*`;
for j in $MTD $LOOP $RAM
do
echo "0" > $j/queue/rotational;
echo "4096" > $j/queue/read_ahead_kb;
done
echo "4096" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
for a in $MTD $MMC
do
echo "512" > $a/queue/nr_requests;
done
#internet speed tweaks
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;
#vm management tweaks
echo "0" > /proc/sys/vm/swappiness;
echo "95" > /proc/sys/vm/dirty_ratio;
echo "10" > /proc/sys/vm/vfs_cache_pressure;
echo "20480" > /proc/sys/vm/min_free_kbytes;
echo "1" > /proc/sys/vm/oom_kill_allocating_task;
echo "0" > /proc/sys/vm/laptop_mode;
echo "60000" > /proc/sys/vm/dirty_expire_centisecs;
echo "60" > /proc/sys/vm/dirty_background_ratio;
echo "6000" > /proc/sys/vm/dirty_writeback_centisecs;
echo "3" > /proc/sys/vm/drop_caches;
#kernel tweaks
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;
# use deadline scheduler
echo deadline > /sys/class/block/mmcblk0/queue/scheduler;
echo deadline > /sys/class/block/stl14/queue/scheduler;
echo deadline > /sys/class/block/stl13/queue/scheduler;
echo deadline > /sys/class/block/stl12/queue/scheduler;
echo 8 > /sys/class/block/mmcblk0/queue/iosched/fifo_batch;
echo 8 > /sys/class/block/stl14/queue/iosched/fifo_batch;
echo 8 > /sys/class/block/stl13/queue/iosched/fifo_batch;
echo 8 > /sys/class/block/stl12/queue/iosched/fifo_batch;
echo 400 > /sys/class/block/mmcblk0/queue/iosched/read_expire;
echo 400 > /sys/class/block/stl14/queue/iosched/read_expire;
echo 400 > /sys/class/block/stl13/queue/iosched/read_expire;
echo 400 > /sys/class/block/stl12/queue/iosched/read_expire;
echo 4 > /sys/class/block/mmcblk0/queue/iosched/writes_starved;
echo 4 > /sys/class/block/stl14/queue/iosched/writes_starved;
echo 4 > /sys/class/block/stl13/queue/iosched/writes_starved;
echo 4 > /sys/class/block/stl12/queue/iosched/writes_starved;
#setprop
setprop wifi.supplicant_scan_interval 600;
setprop windowsmgr.max_events_per_sec 260;
setprop ro.lge.proximity.delay 25;
setprop mot.proximity.delay 75;
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 ro.HOME_APP_ADJ 1;
setprop ro.mot.eri.losalert.delay 1000;
setprop video.accelerate.hw 1;
setprop ro.ril.disable.power.collapse 0;
setprop pm.sleep_mode 1;
setprop media.stagefright.enable-player true;
#lowmemory
FOREGROUND_APP_MEM="2560";
VISIBLE_APP_MEM="4096";
SECONDARY_SERVER_MEM="6144";
HIDDEN_APP_MEM="17408";
CONTENT_PROVIDER_MEM="19456";
EMPTY_APP_MEM="23552";
#governor scaling awake
GOVERNOR_SCALE="ondemand";
GOVERNOR_FREQENCY_MAX="800000";
GOVERNOR_FREQENCY_MIN="245760";
SAMPLING_RATE="50000";
FREQ_STEP="40";
UP_THRESHOLD="90";
DOWN_THRESHOLD="20";
#governor scaling sleep
SLEEP_SCALE="ondemand";
SLEEP_FREQENCY_MAX="480000";
SLEEP_FREQENCY_MIN="245760";
XSAMPLING_RATE="100000";
XFREQ_STEP="15";
XUP_THRESHOLD="90";
XDOWN_THRESHOLD="20";
#locking app
LOCK_APP_IN_MEMORY_ENABLED="0"
LOCK_APP_SU="1"
LOCK_APP_DIALER="0"
LOCK_APP_MMS="0"
LOCK_APP_HANDCENT="0"
# =========
# remove lag when answering phone calls
# =========
MAX_PHONE()
{
pidphone=`pidof com.android.phone`;
if [ $pidphone ];
then
/system/xbin/echo "-17" > /proc/$pidphone/oom_adj;
renice -20 $pidphone;
if [ $MAX_APP -eq "1" ];
then
exit;
else
MAX_APP_STARTER;
MAX_APP=1;
exit;
fi;
else
sleep 3;
MAX_PHONE;
fi;
}
# =========
# remove lag from su (root)
# =========
MAX_SU()
{
pidsu=`pidof com.noshufou.android.su`;
if [ $pidsu ];
then
/system/xbin/echo "-17" > /proc/$pidsu/oom_adj;
renice -20 $pidsu;
exit;
else
sleep 3;
MAX_SU;
fi;
}
# =========
# remove lag from Clock
# =========
MAX_DIALER()
{
piddialer=`pidof kz.mek.DialerOne`;
if [ $piddialer ];
then
/system/xbin/echo "-17" > /proc/$piddialer/oom_adj;
renice -10 $piddialer;
exit;
else
sleep 3;
MAX_DIALER;
fi;
}
# =========
# remove lag from MMS
# =========
MAX_MMS()
{
pidmms=`pidof com.android.mms`;
if [ $pidmms ];
then
/system/xbin/echo "-17" > /proc/$pidmms/oom_adj;
renice -10 $pidmms;
exit;
else
sleep 3;
MAX_MMS;
fi;
}
# =========
# remove lag from HANDCENT
# =========
MAX_HANDCENT()
{
pidhandcent=`pidof com.handcent.nextsms`;
if [ $pidhandcent ];
then
/system/xbin/echo "-17" > /proc/$pidhandcent/oom_adj;
renice -10 $pidhandcent;
exit;
else
sleep 3;
MAX_HANDCENT;
fi;
}
# =========
# Background process to optimize process
# =========
MAX_APP_STARTER()
{
if [ $LOCK_APP_IN_MEMORY_ENABLED -eq "1" ];
then
if [ $LOCK_APP_SU -eq "1" ];
then
(while [ 1 ];
do
sleep 5;
MAX_SU;
done &);
fi;
if [ $LOCK_APP_MMS -eq "1" ];
then
(while [ 1 ];
do
sleep 3;
MAX_MMS;
done &);
fi;
if [ $LOCK_APP_HANDCENT -eq "1" ];
then
(while [ 1 ];
do
sleep 3;
MAX_HANDCENT;
done &);
fi;
if [ $LOCK_APP_DIALER -eq "1" ];
then
(while [ 1 ];
do
sleep 3;
MAX_DIALER;
done &);
fi;
exit;
else
(while [ 1 ];
do
sleep 3;
MAX_APP_STARTER;
done &);
fi;
}
if [ $LOCK_APP_IN_MEMORY_ENABLED -eq "1" ];
then
(while [ 1 ];
do
sleep 3;
MAX_PHONE;
done &);
fi;
GOV_MODE()
{
echo "1" >/proc/sys/vm/overcommit_memory;
echo "4" > /proc/sys/vm/min_free_order_shift;
echo $FOREGROUND_APP_MEM,$VISIBLE_APP_MEM,$SECONDARY_SERVER_MEM,$HIDDEN_APP_MEM,$CONTENT_PROVIDER_MEM,$EMPTY_APP_MEM > /sys/module/lowmemorykiller/parameters/minfree;
echo $GOVERNOR_SCALE > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor;
echo $GOVERNOR_FREQENCY_MAX > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
echo $GOVERNOR_FREQENCY_MIN > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;
echo $SAMPLING_RATE > /sys/devices/system/cpu/cpu0/cpufreq/$GOVERNOR_SCALE/sampling_rate;
echo $FREQ_STEP > /sys/devices/system/cpu/cpu0/cpufreq/$GOVERNOR_SCALE/freq_step;
echo $UP_THRESHOLD > /sys/devices/system/cpu/cpu0/cpufreq/$GOVERNOR_SCALE/up_threshold;
echo $DOWN_THRESHOLD > /sys/devices/system/cpu/cpu0/cpufreq/$GOVERNOR_SCALE/down_threshold;
}
SLEEP_MODE()
{
echo "1" >/proc/sys/vm/overcommit_memory;
echo "4" > /proc/sys/vm/min_free_order_shift;
echo $FOREGROUND_APP_MEM,$VISIBLE_APP_MEM,$SECONDARY_SERVER_MEM,$HIDDEN_APP_MEM,$CONTENT_PROVIDER_MEM,$EMPTY_APP_MEM > /sys/module/lowmemorykiller/parameters/minfree;
echo $SLEEP_SCALE > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor;
echo $SLEEP_FREQENCY_MAX > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
echo $SLEEP_FREQENCY_MIN > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;
echo $XSAMPLING_RATE > /sys/devices/system/cpu/cpu0/cpufreq/$SLEEP_SCALE/sampling_rate;
echo $XFREQ_STEP > /sys/devices/system/cpu/cpu0/cpufreq/$SLEEP_SCALE/freq_step;
echo $XUP_THRESHOLD > /sys/devices/system/cpu/cpu0/cpufreq/$SLEEP_SCALE/up_threshold;
echo $XDOWN_THRESHOLD > /sys/devices/system/cpu/cpu0/cpufreq/$SLEEP_SCALE/down_threshold;
}
# =========
# Background process to check screen state
# =========
(while [ 1 ];
do
STATE=`cat /sys/power/wait_for_fb_wake`;
GOV_MODE;
sleep 3;
STATE=`cat /sys/power/wait_for_fb_sleep`;
SLEEP_MODE;
sleep 3;
done &);
Some brief explanation for the contents of the script
1. /proc/sys/vm/laptop_mode
How many seconds after a read should a writeout of changed files start (this is based on the assumption that a read will cause an otherwise spun down disk to spin up again).
2. /proc/sys/vm/dirty_writeba​ck_centisecs
How often the kernel should check if there is "dirty" (changed) data to write out to disk (in centiseconds).
3./proc/sys/vm/dirty_expir​e_centisecs
How old "dirty" data should be before the kernel considers it old enough to be written to disk. It is in general a good idea to set this to the same value as dirty_writeback_centisecs above.
4./proc/sys/vm/dirty_ratio​
The maximum amount of memory (in percent) to be used to store dirty data before the process that generates the data will be forced to write it out. Setting this to a high value should not be a problem as writeouts will also occur if the system is low on memory.
5./proc/sys/vm/dirty_backg​round_ratio
The lower amount of memory (in percent) where a writeout of dirty data to disk is allowed to stop. This should be quite a bit lower than the above dirty_ratio to allow the kernel to write out chunks of dirty data in one go.
I thought I should return the Tweak Manager's 00tweaks script back to initramfs
let me give it a try
what if i already have 00tweaks? should i had this script to the current file or substitute?
Hey, the values are similar to CF-Root Great then, gonna try it out
What should I do if I want to try your script, but I have already used CF-Root With Tweak Manager that also using another script in 00tweaks file
Wow I just ran this on GSB 3.8 workshed for the eris. And WOW the phone rings on 1 1/2 rings with a ringtone and the screen lights up. Very nice work. I hope you don't mind but i posted a link from the eris fourms to this file. I been looking for for so long on how to get rid of the rintone LAG and WOW i think you got it! Thank you
How to create the script?
Thnx
A lil question, this wont collide with the V6 Supercharger?
Hey guys,
can somebody please tell me how to make a script of this? I really want to know, but i'm new to this.
I can't find anything on the "search".
Cheers
QNBT said:
A lil question, this wont collide with the V6 Supercharger?
Click to expand...
Click to collapse
I think something does because I am getting complete homescreen redraws since I started using this a couple days ago. The phone seems to boot way faster and seems to run a little better but I think there is a conflict somewhere.
Sgace said:
Hey guys,
can somebody please tell me how to make a script of this? I really want to know, but i'm new to this.
I can't find anything on the "search".
Cheers
Click to expand...
Click to collapse
You don't have to make a script just copy it all to a text document on your desktop and after you save it delete the .txt at the end. Then put it on your SD card and use Root Explorer, or similar, to move it the proper location. I set the ownership and permissions the same as other files in the same location and rebooted. Just be sure to tap the "R/W" button at the top of the screen if you are using Root Explorer so you have read/write permission to work in the folder.
PieceKeepr said:
You don't have to make a script just copy it all to a text document on your desktop and after you save it delete the .txt at the end. Then put it on your SD card and use Root Explorer, or similar, to move it the proper location. I set the ownership and permissions the same as other files in the same location and rebooted. Just be sure to tap the "R/W" button at the top of the screen if you are using Root Explorer so you have read/write permission to work in the folder.
Click to expand...
Click to collapse
Hey,
thnx man. Found notepad++ and made a text file with that.
Tried the script for a couple of ours and for my personal feeling it made my phone slower at multiple points. Also Quadrant standard gave me a lower score (11-13) then when i'm using 00tweaks/v4 tt.
So this goes out the door.
Cheers
I hate bringing things back from the dead, so I apologize in advance.
If I want just the atime section of this script, do I just keep the first part? Where does it stop?
AUTO
what does the auto do in the mounting script?

Touch REcovery ?

Is there anyone working on it? Its really worth a shot. Even for the Aroma installer.
Özgürce said:
Is there anyone working on it? Its really worth a shot. Even for the Aroma installer.
Click to expand...
Click to collapse
Blefish is porting touch recovery, he tweeted that he will be releasing it with CM9 0.03 in mid July.
Yea, its working well, but its missing the atmel support again (...). I will tweet as soon as I get it properly working on both touch panels.
Sent from my U8800 using Tapatalk 2
Can you release it? At atmel will work with hardware buttons until you fix this..
Sent from my U8800
Why release it since the touch wont work for Atmel users, so no TOUCH recovery.
AceDroidX said:
Why release it since the touch wont work for Atmel users, so no TOUCH recovery.
Click to expand...
Click to collapse
Yes, but Blefish could release a version for those with synaptics... I think it wouldn't hurt
Sent from my U8800
It will be only for U8800 (not for pro) I think??
fjsferreira said:
Yes, but Blefish could release a version for those with synaptics... I think it wouldn't hurt
Sent from my U8800
Click to expand...
Click to collapse
Yes, and we could act as beta testers, so if there is some bug it could be fixed on next, atmel support version.
Blefish said:
Yea, its working well, but its missing the atmel support again (...). I will tweet as soon as I get it properly working on both touch panels.
Sent from my U8800 using Tapatalk 2
Click to expand...
Click to collapse
Thats great! Glad to hear someone working on it. I'm using 4EXT Touch recovery on my Incredible S. Its awesome.
Blefish said:
Yea, its working well, but its missing the atmel support again (...). I will tweet as soon as I get it properly working on both touch panels.
Sent from my U8800 using Tapatalk 2
Click to expand...
Click to collapse
Will it support Universal Flasher Tool for theming?
With your CyanogemMOD ROM that will be a must have!!!
For the moment it is only supported by 5.0.2.7 CWM...
sr21 said:
Will it support Universal Flasher Tool for theming?
With your CyanogemMOD ROM that will be a must have!!!
For the moment it is only supported by 5.0.2.7 CWM...
Click to expand...
Click to collapse
Can you get me the log? Try to flash it and after that go to advanced options, you should find it there.
About recovery - I'll cook it up, it will not have "offmode" charging as it's not handled by recovery nowadays. And of course, no Atmel support just yet.
Blefish said:
Can you get me the log? Try to flash it and after that go to advanced options, you should find it there.
About recovery - I'll cook it up, it will not have "offmode" charging as it's not handled by recovery nowadays. And of course, no Atmel support just yet.
Click to expand...
Click to collapse
LOG:
Code:
failed to open /sys/class/android_usb_/android0/state: No such file or directory
Universal Flasher Tool 3.6
sr21 said:
LOG:
Code:
failed to open /sys/class/android_usb_/android0/state: No such file or directory
Universal Flasher Tool 3.6
Click to expand...
Click to collapse
That error is common in 2.6.35 kernel with CWM 5.5.0.4. I'd need the whole log to help you. Or, you can send me the updater-script that should be located at zip-file/META-INF/com/google/android.
Blefish said:
That error is common in 2.6.35 kernel with CWM 5.5.0.4. I'd need the whole log to help you. Or, you can send me the updater-script that should be located at zip-file/META-INF/com/google/android.
Click to expand...
Click to collapse
You can see the script in the Universal Flasher Tool link that I provided before. The zip is a template.
It uses a script to do the modding in the recovery.
You can also check one of my flashable zips that I use in my TouchWiz MOD/ADDON PACK: Touchwiz_for_u8800_u8800pro_v4.1.0.1u1_signed.zip
You need to check the /META-INF/com/google/android/, the /tools/, /MORPH/ (themed apps goes here) and the MOD.config file.
I think the script fails here (/tools/run.sh):
Code:
################### MORPHING ##################
UI_PRINT " "; LOG="MORPHING >>"; LOGS "$LOG"; UI_PRINT "$LOG"
CHECK2=0
x=1
until [ $x = 0 ]; do
if [ -d $PATHDATA ];then
WORK=$PATHDATA
SYSTEM="/data/app"
elif [ ! -d $PATHDATA ] && [ -d $PATHFRAM ];then
WORK=$PATHFRAM
SYSTEM="/system/framework"
elif [ ! -d $PATHDATA ] && [ ! -d $PATHFRAM ] && [ -d $PATHAPP ]; then
WORK=$PATHAPP
SYSTEM="/system/app"
elif [ ! -d $PATHDATA ] && [ ! -d $PATHFRAM ] && [ ! -d $PATHAPP ]; then
x=0
fi
if [ $x = 1 ]; then
for f in $(ls $WORK); do
if [ -e $SYSTEM/$f ];then
if [ `/cache/tools/tar -tPf $RESTORE/backup.tar $SYSTEM/$f | wc -l` = 0 ]; then
/cache/tools/tar -prPf $RESTORE/backup.tar $SYSTEM/$f
fi
mkdir -p /$APPLY
f2="`echo $f | cut -d "." -f 1`.zip"
mv $SYSTEM/$f /$APPLY/$f2
#FIX -V4 SUFFIXES IN FOLDERS
if [ $V4MORPHING = "yes" ] && [ -d $WORK/$f/res ];then
FILES=`/system/xbin/7z l $APPLY/$f2 | awk '{print $6}'`
cd $WORK/$f/res
find * -type d | while read i;do
if [ `echo $FILES | grep $i-v4 | wc -l` != 0 ]; then
mv $WORK/$f/res/$i $WORK/$f/res/$i-v4
fi
done
fi
#CYANOGENMOD vs STOCK BASED ROM
if [ $MULTIPLATTFORM = "yes" ];then
cd $WORK/$f
find * -type f | while read i;do
if [ $CYANO = "yes" ] && [ `basename $i | cut -d "#" -f 1` = "CMOD" ];then
mv $WORK/$f/$i $WORK/$f/`dirname $i`/`basename $i | cut -d "#" -f 2`
elif [ $CYANO = "no" ] && [ `basename $i | cut -d "#" -f 1` = "CMOD" ];then
rm $i
fi
done
fi
#MORPH, ZIP & ZIPALIGN
if [ $CLEANMORPHING = "yes" ];then
MORPH=`/system/xbin/7z a -ur0x2y2z2w2 $APPLY/$f2 $WORK/$f/* | grep -o -E "Everything is Ok" | wc -l`
else
MORPH=`/system/xbin/7z a $APPLY/$f2 $WORK/$f/* | grep -o -E "Everything is Ok" | wc -l`
fi
/cache/tools/zipalign -f 4 $APPLY/$f2 $SYSTEM/$f
rm -Rf $APPLY $WORK/$f
chown 0.0 $SYSTEM/$f && chmod 644 $SYSTEM/$f
if [ ! -e $SYSTEM/$f ] || [ $MORPH = 0 ]; then
/cache/tools/tar -pxPf $RESTORE/backup.tar $SYSTEM/$f
LOG="[X] Error with $f!"; LOGS "$LOG"; UI_PRINT "$LOG"
LOG="[<] Restored original $f"; LOGS "$LOG"; UI_PRINT "$LOG"
let CHECK2=$CHECK2-1
else
LOGS "[v] $SYSTEM/$f morphed"; UI_PRINT "[v] $f morphed"
let CHECK2=$CHECK2+2
fi
else
LOG="[!] $f not found, ignoring"; LOGS "$LOG"; UI_PRINT "$LOG"
fi
done
rm -R $WORK
fi
done
if [ $CHECK2 -le 0 ];then
LOG="[!] Nothing to morph"; LOGS "$LOG"; UI_PRINT "$LOG"
fi

Franco dev tweaks, very old but very good

Hello I found this flashable tweak from franco dev team, 2013 , but they are working good just sharing then. Credits to the awesome franco and his dev team.
Just flash it in recovery, to remove them just dirty flash your current ROM, enjoy.
875mntsettings
Code:
#!/system/bin/sh
# chmod -R 755 /system/etc/init.d
# 12-May-2013 by Franco's Dev Team
# malaroth, osm0sis, joaquinf, The Gingerbread Man, pkgnex, Khrushy, shreddintyres
# sysfs+sdcard tweaks
busybox mount -o remount,nosuid,nodev,noatime,nodiratime -t auto /;
busybox mount -o remount,nosuid,nodev,noatime,nodiratime -t auto /proc;
busybox mount -o remount,nosuid,nodev,noatime,nodiratime -t auto /sys;
busybox mount -o remount,nosuid,nodev,noatime,nodiratime -t auto /sys/kernel/debug;
busybox mount -o remount,nosuid,nodev,noatime,nodiratime -t auto /mnt/shell/emulated;
for i in /storage/emulated/*; do
busybox mount -o remount,nosuid,nodev,noatime,nodiratime -t auto $i;
busybox mount -o remount,nosuid,nodev,noatime,nodiratime -t auto $i/Android/obb;
done;
# partition tweaks
busybox mount -o remount,nosuid,nodev,noatime,nodiratime,barrier=0,noauto_da_alloc,discard -t auto /data;
busybox mount -o remount,nosuid,nodev,noatime,nodiratime,barrier=0,noauto_da_alloc,discard -t auto /cache;
busybox mount -o remount,nodev,noatime,nodiratime,barrier=0,noauto_da_alloc,discard -t auto /system;
925vmsettings
Code:
#!/system/bin/sh
# chmod -R 755 /system/etc/init.d
# 26-Jun-2013 by Franco's Dev Team
# malaroth, osm0sis, joaquinf, The Gingerbread Man, pkgnex, Khrushy, shreddintyres
# disable sysctl.conf to prevent ROM interference
if [ -e /system/etc/sysctl.conf ]; then
mount -o remount,rw /system;
mv /system/etc/sysctl.conf /system/etc/sysctl.conf.fkbak;
mount -o remount,ro /system;
fi;
# vm tweaks
echo 5 > /proc/sys/vm/dirty_background_ratio;
echo 200 > /proc/sys/vm/dirty_expire_centisecs;
echo 20 > /proc/sys/vm/dirty_ratio;
echo 500 > /proc/sys/vm/dirty_writeback_centisecs;
echo 2884 > /proc/sys/vm/min_free_kbytes;
echo 4 > /proc/sys/vm/min_free_order_shift;
echo 3 > /proc/sys/vm/page-cluster;
echo 0 > /proc/sys/vm/swappiness;
echo 100 > /proc/sys/vm/vfs_cache_pressure;
# lmk tweaks
minfree=6144,8192,12288,16384,24576,40960;
lmk=/sys/module/lowmemorykiller/parameters/minfree;
minboot=`cat $lmk`;
while sleep 1; do
if [ `cat $lmk` != $minboot ]; then
[ `cat $lmk` != $minfree ] && echo $minfree > $lmk || exit;
fi;
done&
# fs tweaks
echo 10 > /proc/sys/fs/lease-break-time;
# entropy tweaks
echo 128 > /proc/sys/kernel/random/read_wakeup_threshold;
echo 256 > /proc/sys/kernel/random/write_wakeup_threshold;
# tcp tweaks
echo "westwood" > /proc/sys/net/ipv4/tcp_congestion_control;
950iosettings
Code:
#!/system/bin/sh
# chmod -R 755 /system/etc/init.d
# 11-Jun-2013 by Franco's Dev Team
# malaroth, osm0sis, joaquinf, The Gingerbread Man, pkgnex, Khrushy, shreddintyres
# disable sysctl.conf to prevent ROM interference
if [ -e /system/etc/sysctl.conf ]; then
mount -o remount,rw /system;
mv /system/etc/sysctl.conf /system/etc/sysctl.conf.fkbak;
mount -o remount,ro /system;
fi;
# general queue tweaks
for i in /sys/block/*/queue; do
echo 512 > $i/nr_requests;
echo 512 > $i/read_ahead_kb;
echo 2 > $i/rq_affinity;
echo 0 > $i/nomerges;
echo 0 > $i/add_random;
echo 0 > $i/rotational;
done;
# override scheduler defaults with tweaked values
scheduler=reset;
while sleep 1; do
current=`cut -d\[ -f2 /sys/block/mmcblk0/queue/scheduler | cut -d\] -f1`;
if [ $scheduler != $current ]; then
scheduler=$current;
if [ $scheduler == "deadline" ]; then
# deadline tweaks
echo 250 > /sys/block/mmcblk0/queue/iosched/read_expire;
echo 2500 > /sys/block/mmcblk0/queue/iosched/write_expire;
echo 1 > /sys/block/mmcblk0/queue/iosched/writes_starved;
echo 1 > /sys/block/mmcblk0/queue/iosched/front_merges;
echo 8 > /sys/block/mmcblk0/queue/iosched/fifo_batch;
elif [ $scheduler == "row" ]; then
# row tweaks
echo 100 > /sys/block/mmcblk0/queue/iosched/hp_read_quantum;
echo 75 > /sys/block/mmcblk0/queue/iosched/rp_read_quantum;
echo 5 > /sys/block/mmcblk0/queue/iosched/hp_swrite_quantum;
echo 4 > /sys/block/mmcblk0/queue/iosched/rp_swrite_quantum;
echo 4 > /sys/block/mmcblk0/queue/iosched/rp_write_quantum;
echo 3 > /sys/block/mmcblk0/queue/iosched/lp_read_quantum;
echo 12 > /sys/block/mmcblk0/queue/iosched/lp_swrite_quantum;
echo 10 > /sys/block/mmcblk0/queue/iosched/read_idle;
echo 25 > /sys/block/mmcblk0/queue/iosched/read_idle_freq;
## N4 and N10 row adds lsl and rsl, which were hardcoded previously
echo 10000 > /sys/block/mmcblk0/queue/iosched/low_starv_limit;
echo 5000 > /sys/block/mmcblk0/queue/iosched/reg_starv_limit;
## N4 and N10 have a new version of row with corrected entry for lsq and renamed ri and rif
[ `cat /sys/block/mmcblk0/queue/iosched/lp_swrite_quantum` != "2" ] && echo 2 > /sys/block/mmcblk0/queue/iosched/lp_swrite_quantum;
echo 10 > /sys/block/mmcblk0/queue/iosched/rd_idle_data;
echo 25 > /sys/block/mmcblk0/queue/iosched/rd_idle_data_freq;
elif [ $scheduler == "cfq" ]; then
# cfq tweaks
echo 4 > /sys/block/mmcblk0/queue/iosched/quantum;
echo 80 > /sys/block/mmcblk0/queue/iosched/fifo_expire_sync;
echo 330 > /sys/block/mmcblk0/queue/iosched/fifo_expire_async;
echo 12582912 > /sys/block/mmcblk0/queue/iosched/back_seek_max;
echo 1 > /sys/block/mmcblk0/queue/iosched/back_seek_penalty;
echo 60 > /sys/block/mmcblk0/queue/iosched/slice_sync;
echo 50 > /sys/block/mmcblk0/queue/iosched/slice_async;
echo 2 > /sys/block/mmcblk0/queue/iosched/slice_async_rq;
echo 0 > /sys/block/mmcblk0/queue/iosched/slice_idle;
echo 0 > /sys/block/mmcblk0/queue/iosched/group_idle;
echo 1 > /sys/block/mmcblk0/queue/iosched/low_latency;
## N4 and N10 cfq adds tl, which was hardcoded previously
echo 300 > /sys/block/mmcblk0/queue/iosched/target_latency;
fi;
fi;
# loop forever independently
done&
Flash an unidentified 3-year-old zip? Thank you, but I'll pass...
fedef12evo said:
Hello I found this flashable tweak from franco dev team, 2013 , but they are working good just sharing then. Credits to the awesome franco and his dev team.
Just flash it in recovery, to remove them just dirty flash your current ROM, enjoy.
Click to expand...
Click to collapse
Why should anyone flash this?
Can you also post a Ice Cream Sandwich rom to go with it
fedef12evo said:
Hello I found this flashable tweak from franco dev team, 2013 , but they are working good just sharing then. Credits to the awesome franco and his dev team.
Just flash it in recovery, to remove them just dirty flash your current ROM, enjoy.
Click to expand...
Click to collapse
Don't you think you should at least explain exactly what these tweaks do?!
download the zip with pc, then open it and read every of 3 tweak what do, im gonna post it for you
first off, what do these "tweaks" do do you know? as nd Franco isnt a dev team, its an individual person.
simms22 said:
first off, what do these "tweaks" do do you know? as nd Franco isnt a dev team, its an individual person.
Click to expand...
Click to collapse
Read them tweak, back in thr day franco had a team
fedef12evo said:
Read them tweak, back in thr day franco had a team
Click to expand...
Click to collapse
no, he doesnt. he has people test out his kernels, but he IS alone. i know, im friends with him. i dont need to read the tweaks, you posted them here and you have to post what they do. if not, your thread will kust get closed down.
Thread closed. No-one with any sense would try this considering absolutely no info on resultant effects has been given, and the sheer age of the "tweaks".
Anyone wishing to try does so bearing the above caveat in mind.

Categories

Resources