Related
To all of the ROM makers here, please stop using those bonsai data-backup/data-restore scripts, as they don't work. I'm assuming they used to work since everyone here seems to be using them, but something has changed (maybe something in CWM 5.x?) and now all those data-backup and data-restore scripts do is make phones not work.
I've taking those scripts and rewritten them using the tar command. busybox's tar doesn't have many options, but it does preserve file permissions and ownership, so it makes for an adequate backup tool. HUGE thanks to SenseiSimple for the ideas and improvements. See SenseiSimple's post, here.
EDIT: Here is the final version!
updater-script BACKUP EXAMPLE
Code:
ui_print("************************************************");
ui_print(" TAR BACK UP / RESTORE EXAMPLE");
ui_print("************************************************");
show_progress(1.000, 0);
set_progress (0.100);
#EXTRACT BACKUP SCRIPT
ui_print("Preparing tools...");
package_extract_file("tools/busybox", "/tmp/busybox");
package_extract_file("tools/tar-backup", "/tmp/tar-backup");
set_perm(0, 0, 0755, "/tmp/tar-backup");
set_perm(0, 0, 0755, "/tmp/busybox");
#CREATE BACKUP
set_progress (0.350);
ui_print("Backing up - this may take a while...");
run_program("/sbin/mount","/sdcard");
run_program("/sbin/mount","/data");
run_program("/tmp/tar-backup","backup");
unmount("/data");
#RECOVER BACKUP
set_progress (0.600);
ui_print("Recovering backed up data...");
run_program("/sbin/mount","/data");
run_program("/tmp/tar-backup","recover");
# run_program("/tmp/tar-backup","recover","delete");
# run_program("/tmp/tar-backup","recover","archive");
unmount("/data");
set_progress(1.000);
show_progress(1.000, 0);
tar-backup script
edit the value of ROMName=YourROMName (you should only have to edit this file once for all your ROM versions, it's not version-dependent), that's it.
Code:
#!/tmp/busybox sh
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# License GPLv2+: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>
#
# toadlife, SenseiSimple, XDA Community, Bonsai
# invoke with
# run_program("/tmp/tar-backup","backup");
# run_program("/tmp/tar-backup","recover" [,"delete"|"archive"]);
# - "delete" option deletes the backup file
# - "archive" option renames the backup file for archiving (otherwise, it is left alone and replaced on next backup/flash)
ROMName=MyAwesomeROM
platbuild=EI22
PATH=/tmp:/sbin:$PATH
datadir=/data
backdir=/sdcard/ROMBackup-$platbuild
backfile=$backdir/$ROMName.tgz
TEST="busybox test"; TAR="busybox tar"; MKDIR="busybox mkdir"
if [ "$1" = "backup" ]; then
rm /data/dalvik-cache/*
rm /data/lost+found/*
rm $backfile
if $TEST -d $datadir ; then
$TEST ! -d $backdir && $MKDIR $backdir
$TAR pczf $backfile $datadir
if $TEST $? -ne 0 ; then
echo "Backup failed!"; exit 1
else
echo "Backup completed"; exit 0
fi
fi
elif [ "$1" = "recover" ]; then
if $TEST -f $backfile; then
$TAR pxzf $backfile
if [ "$2" = "delete" ]; then
rm $backfile;
elif [ "$2" = "archive" ]; then
archdate=`date +%Y%m%d-%I%M`
archfile=$backdir/$ROMName-$archdate.tgz
mv $backfile $archfile
fi
echo "Restore Completed!"; exit 0
else
echo "Restore failed!"; exit 1
fi
else
echo "Backup - Invalid argument"; exit 1
fi
Example CWM package (unsigned) that uses the script.
BTW, I have tested this script several times with test builds of my ROM and also tested it going from SleeperROM 1.x to my ROM. In sleeper ROM I started with blank slate, installed a few apps, configured my email and set a wallpaper. I then installed a test build of my ROM CleanGB with this backup restore script and I had no problems after flashing; all of my data and settings, including the apps in /data from sleeper ROM came over.
Thank you for this. I proposed this to ERA for Legendary and also to the Bonsai crew.
Sent from my SPH-D700 using XDA App
UNIFIED BACKUP SCRIPT - INSTRUCTIONS/DIFFERENCES
SUMMARY The motivation is threefold, as Toadlife initiated with the purpose of modernizing the backup scripts to better protect the data file attributes in backup by using Tar rather than streaming to Cpio, it's possible with adding this improvement to add new functionality and prevent cluttering up users' sdcards with various ROM folders/editions. They will now all be located by ROM name (i.e. SleeperROM, CleanGB, StarskyROM, RandomROM, LegendaryROM *.tgz) in the /sdcard/ROMBackup-EI22/*.tgz directory.
In your ROM package
1. REPLACE /tools/data-backup and /tools/data-restore
2. WITH /tools/tar-backup (script below)
3. UPDATE ROMName=CleanGB with your rom name
in your updater-script, replace
Code:
package_extract_file("tools/data-backup", "/tmp/data-backup");
package_extract_file("tools/data-restore", "/tmp/data-restore");
set_perm(0, 0, 0755, "/tmp/data-backup");
set_perm(0, 0, 0755, "/tmp/data-restore");
with
Code:
package_extract_file("tools/tar-backup", "/tmp/tar-backup");
set_perm(0, 0, 0755, "/tmp/tar-backup");
updater-script USAGE:
1. REPLACE: run_program("/tmp/data-backup");
2. WITH run_program("/tmp/tar-backup", "backup");
3. REPLACE: run_program("/tmp/data-restore");
4a. WITH run_program("/tmp/tar-backup", "recover"); - Leave the backup in place, will be overwritten in the future
4b. OR run_program("/tmp/tar-backup", "recover","delete"); To delete the backup file when complete
4c. OR run_program("/tmp/tar-backup", "recover","archive"); To archive (with date) the backup file when complete
MINIMAL updater-script BACKUP EXAMPLE
Code:
ui_print("************************************************");
ui_print(" TAR BACK UP / RESTORE EXAMPLE");
ui_print("************************************************");
show_progress(1.000, 0);
set_progress (0.100);
#EXTRACT BACKUP SCRIPT
ui_print("Preparing tools...");
package_extract_file("tools/busybox", "/tmp/busybox");
[B]package_extract_file("tools/tar-backup", "/tmp/tar-backup");[/B]
[B]set_perm(0, 0, 0755, "/tmp/tar-backup");[/B]
set_perm(0, 0, 0755, "/tmp/busybox");
#CREATE BACKUP
set_progress (0.350);
ui_print("Backing up - this may take a while...");
run_program("/sbin/mount","/sdcard");
run_program("/sbin/mount","/data");
[B]run_program("/tmp/tar-backup","backup");[/B]
unmount("/data");
#RECOVER BACKUP
set_progress (0.600);
ui_print("Recovering backed up data...");
run_program("/sbin/mount","/data");
[B]run_program("/tmp/tar-backup","recover");
# run_program("/tmp/tar-backup","recover","delete");
# run_program("/tmp/tar-backup","recover","archive");[/B]
unmount("/data");
set_progress(1.000);
show_progress(1.000, 0);
FILE: /tools/tar-backup
edit the value of ROMName=YOURROMNAME (you should only have to edit this file once for all your ROM versions, it's not version-dependent), that's it.
Code:
#!/tmp/busybox sh
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# License GPLv2+: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>
#
# toadlife, SenseiSimple, XDA Community, Bonsai
# invoke with
# run_program("/tmp/tar-backup","backup");
# run_program("/tmp/tar-backup","recover" [,"delete"|"archive"]);
# - "delete" option deletes the backup file
# - "archive" option renames the backup file for archiving (otherwise, it is left alone and replaced on next backup/flash)
[B]ROMName=CleanGB[/B]
platbuild=EI22
PATH=/tmp:/sbin:$PATH
datadir=/data
backdir=/sdcard/ROMBackup-$platbuild
backfile=$backdir/$ROMName.tgz
TEST="busybox test"; TAR="busybox tar"; MKDIR="busybox mkdir"
if [ "$1" = "backup" ]; then
rm /data/dalvik-cache/*
rm /data/lost+found/*
rm $backfile
if $TEST -d $datadir ; then
$TEST ! -d $backdir && $MKDIR $backdir
$TAR pczf $backfile $datadir
if $TEST $? -ne 0 ; then
echo "Backup failed!"; exit 1
else
echo "Backup completed"; exit 0
fi
fi
elif [ "$1" = "recover" ]; then
if $TEST -f $backfile; then
$TAR pxzf $backfile
if [ "$2" = "delete" ]; then
rm $backfile;
elif [ "$2" = "archive" ]; then
archdate=`date +%Y%m%d-%I%M`
archfile=$backdir/$ROMName-$archdate.tgz
mv $backfile $archfile
fi
echo "Restore Completed!"; exit 0
else
echo "Restore failed!"; exit 1
fi
else
echo "Backup - Invalid argument"; exit 1
fi
Example CWM package (unsigned) to augment these instructions - pay attention to your version of Busybox vs the one included.
SenseiSimple said:
Thanks, i'll be giving it a spin for the next release!
I'm wondering, should we perhaps standardize the directory the backups go into and name the actual backup file accordingly?
I for one hate my sd card filling up with a bunch of random folders, backups included. (i know this is trivial, but since you've provided a good change to the backup method...)
will put the backup into /sdcard/EI22_ROM_Backup/CleanGB.tgz
since we don't automatically delete the backup, i assume for precautionary reasons, best for them to pile up in one place, no?
Click to expand...
Click to collapse
Couldn't agree more. Seems like I'm constantly cleaning backup files off my sdcard.
Why not delete the backup file after the restore? Otherwise a flashaholic will have a whole bunch of these files on their card as well as their nandroids, titanium backups, ROMs, pics etc. Just add a delete to the script.
kennyglass123 said:
Why not delete the backup file after the restore? Otherwise a flashaholic will have a whole bunch of these files on their card as well as their nandroids, titanium backups, ROMs, pics etc. Just add a delete to the script.
Click to expand...
Click to collapse
That's my mentality on it. But in case something goes wrong with the restore, maybe, you have the whole backup file to dissect? that was the only reason i could think of to keep all the cruft in which case, at least have them all consolidated.
I will definitely include this in my rom. Thanks
Sent from my SPH-D700 using XDA App
SenseiSimple said:
That's my mentality on it. But in case something goes wrong with the restore, maybe, you have the whole backup file to dissect? that was the only reason i could think of to keep all the cruft in which case, at least have them all consolidated.
Click to expand...
Click to collapse
Everyone should already be making a nandroid before flashing anything and then can always use advanced restore data. My issue is until you start looking at your sd card, you don't know ROMs have left backups behind. Nuke em...lol.
SenseiSimple said:
Thanks, i'll be giving it a spin for the next release!
I'm wondering, should we perhaps standardize the directory the backups go into and name the actual backup file accordingly?
I for one hate my sd card filling up with a bunch of random folders, backups included. (i know this is trivial, but since you've provided a good change to the backup method...)
(my edits in bold)
Click to expand...
Click to collapse
Sounds good to me. Putting them both in one script would be easier too. I'll use the second revision. You could allways pass another varible to the script to tell it weather or not to delete the backup.
SenseiSimple said:
That's my mentality on it. But in case something goes wrong with the restore, maybe, you have the whole backup file to dissect? that was the only reason i could think of to keep all the cruft in which case, at least have them all consolidated.
Click to expand...
Click to collapse
Ten years sysadminning had led me to be extremely wary of deleting data, so I'm always inclined to keep backups.
Ten years sysadminning had led me to be extremely wary of deleting data, so I'm always inclined to keep backups.
Click to expand...
Click to collapse
I know that personally if something messed up with the re-install phase of the flashing, i'd want the backup file to still be available... it would be nice to have a unified backup dir, and maybe even an option in CWM to delete backups left by roms - it becomes somewhat of a redundancy of CWM's backup at that point, but it's not as if we can invoke the CWM backup routine from script anyway...
toadlife said:
Sounds good to me. Putting them both in one script would be easier too. I'll use the second revision. You could allways pass another varible to the script to tell it weather or not to delete the backup.
Click to expand...
Click to collapse
i deleted my script from the post, on testing, i just can't get it to run - in theory it's a great idea - the single script file is sound but running it from the updater_script with run_program("/tmp/data_save","backup"); for example, just doesn't run it... i've tried variations using
run_program("/sbin/sh","/tmp/data_save","backup");
run_program("/tmp/busybox","sh","/tmp/data_save","backup");
each are no-go...
individually, the scripts work... is there a limitation that the only way run_program can pass arguments is to a binary and not a shell script? that's all i can think of
EDIT:
I GOT IT, will post up the revision in a moment
SenseiSimple said:
EDIT:
I GOT IT, will post up the revision in a moment
Click to expand...
Click to collapse
Crud. I just posted updated version at the top that contains a variable to control deletion of the backup file.
Can you update the script to take a variable that controls whether or not the backup file gets deleted?
It may be worthwhile to add the current date to the filename - it keeps the current backup and restore for a flash fresh, but allows archival copies to be trivially stored ala Nandroid.
k0nane said:
It may be worthwhile to add the current date to the filename - it keeps the current backup and restore for a flash fresh, but allows archival copies to be trivially stored ala Nandroid.
Click to expand...
Click to collapse
This could be done right after the restore finishes...if the file is not set to be deleted...
Code:
date=`date +.%m.%d.%Y.%I:%M`;
newromname={$romname}{$date}
newbackfile=/sdcard/${build}_ROM_Backup/$newromname.tgz
mv $backfile $newbackfile
SenseiSimple said:
EDIT:
I GOT IT, will post up the revision in a moment
Click to expand...
Click to collapse
Sorry, I got impatient and rolled them into one script myself. It tags the files with the date if the delete option is not set. The script is in the first post.
toadlife said:
To all of the ROM makers here, please stop using those bonsai data-backup/data-restore scripts, as they don't work. I'm assuming they used to work since everyone here seems to be using them, but something has changed (maybe something in CWM 5.x?) and now all those data-backup and data-restore scripts do is make phones not work.
I've taking those scripts and rewritten them using the tar command. busybox's tar doesn't have many options, but it does preserve file permissions and ownership, so it makes for an adequate backup tool.
EDIT: I've rewritten the scripts so that both backup and restore functionality are in one script. Thanks SenseiSimple for the idea!
tar-backup
Code:
#!/tmp/busybox sh
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# License GPLv2+: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>
#
#
# tar data backup and restore
# based on bonsai data backup/restore scripts
# by toadlife , SenseiSimple and the Epic 4G XDA community
#
# Call from your updater script like so...
#
# Backup: run_program("/tmp/tar-backup", "backup");
# Restore: run_program("/tmp/tar-backup", "restore"[, "delete"]);
#
# optional "delete" switch will cause the backup file to be deleted after
# restore
#
#
romname=CleanGB
build=EI22
datadir=/data
PATH=/tmp:/sbin:$PATH
BB=/tmp/busybox
backfile=/sdcard/${build}_ROM_Backup/$romname.tgz
if [ "$1" = "backup" ]; then
$BB rm /data/dalvik-cache/*
$BB rm /data/lost+found/*
$BB rm $backfile
if $BB test -d $datadir; then
$BB test ! -d /sdcard/${build}_ROM_Backup && $BB mkdir /sdcard/${build}_ROM_Backup
$BB tar pczf $backfile $datadir
if $BB test $? -ne 0; then
echo "Backup failed!"
exit 1
else
echo "Backup completed"
exit 0
fi
fi
fi
if [ "$1" = "restore" ]; then
if $BB test -f $backfile; then
$BB tar pxzf $backfile
echo Restore Completed!
if [ "$2" = "delete" ]; then
rm $backfile
else
DATE=`date +%Y.%m.%d.%I%M`;
newromname=$romname.$DATE
newbackfile=/sdcard/${build}_ROM_Backup/$newromname.tgz
mv $backfile $newbackfile
fi
exit 0
else
echo Restore failed!
exit 1
fi
fi
Here is an example package that uses the script.
Click to expand...
Click to collapse
From looking at it, it doesn't look like there should be issues... Nice work!
and with the improved handling of tarballs through CWM, this thing should be nice and fast! =)
Your version still didn't work for me, same issue i was facing with mine.
I updated post #4 with an updated version based on a combination of yours and the one i was late providing, i've tested it several times with the three options.
What are you thoughts? Try it out and if it works update your code detail with it, my mini-tutorial can be linked complementary to it
EDIT I just remembered/experienced that CWM (5.0.2.7 afaik) has a bug in which it doesn't provide the right datetime. So the archive feature may be broken until that is fixed. http://forum.xda-developers.com/showthread.php?p=19689193#post19689193 - mine shows several years off "jan 01, 2005 01:00" and the archives overwrite themselves... perhaps we need to serialize/number rather than date
SenseiSimple said:
Your version still didn't work for me, same issue i was facing with mine.
Click to expand...
Click to collapse
What issue? It worked great for me.
SenseiSimple said:
EDIT I just remembered/experienced that CWM (5.0.2.7 afaik) has a bug in which it doesn't provide the right datetime. So the archive feature may be broken until that is fixed. http://forum.xda-developers.com/showthread.php?p=19689193#post19689193 - mine shows several years off "jan 01, 2005 01:00" and the archives overwrite themselves... perhaps we need to serialize/number rather than date
Click to expand...
Click to collapse
IIRC, Jan 1 2005 is the date you get when you pull the battery. Apparently it resets the internal clock on the device. When doing a normal reboot or power down the current date is retained.
Anyhow, yours looks fine. I'll test it out later today and will edit my top post with your revision.
toadlife said:
What issue? It worked great for me.
IIRC, Jan 1 2005 is the date you get when you pull the battery. Apparently it resets the internal clock on the device. When doing a normal reboot or power down the current date is retained.
Anyhow, yours looks fine. I'll test it out later today and will edit my top post with your revision.
Click to expand...
Click to collapse
Cool thanks, sorry for the delay. about the time, i had indeed recently pulled the battery without booting in between.
The issue i had with my original script and yours was something to do with busybox applets/builtins between /tmp/busybox and /sbin/busybox... i'm not sure what version of busybox i had included with my rom, but i substituted mine with yours (mine was 1.9MB which i've noticed in a few different roms, yours and the one in ICS releases are 2MB), and for good measure combined our two scripts, everything magically came together, oddly enough with the combined script, both busybox versions work.
Here are the collection of various apps, guides, mods, scripts, tweaks etc.
Warning: All of the scripts & other tweaks are collected from various sources. So please please be careful before experimenting with them.
The purpose of this thread is to put all of them in one place for easy access.
build.prop tweaks
First copy the build.prop and rename it to build.prop.bak for backup
Open build.prop in notepad.
at the end of the line write a line of code into build.prop and that line tells the android system what to do.
Code:
[B][U]Experimental / Not Tested[/U][/B]
##Date format
ro.com.android.dateformat=MM-dd-yyyy
ro.com.google.locationfeatures=1
ro.setupwizard.mode=DISABLED
keyguard.no_require_sim=true
ro.com.android.dataroaming=true
# Default network type.
ro.telephony.default_network=8
##8 => CDMA/EVDO/LTE auto mode preferred. (I don't know what should be the value for our Galaxy 3)
#proximit sensor disable touch distance
mot.proximity.distance=60
[B][U]Working[/U][/B]
##Makes phone boot rapidly fast
persist.sys.shutdown.mode=hibernate
##Force launcher into memory
ro.HOME_APP_ADJ=1
## Raise JPG quality to 100%
ro.media.enc.jpeg.quality=100
##VM Heapsize; 178MB RAM = 32 is better
dalvik.vm.heapsize=48m
##Render UI with GPU
debug.sf.hw=1
##Decrease dialing out delay
ro.telephony.call_ring.delay=0
##Helps scrolling responsiveness
windowsmgr.max_events_per_sec=150
##Save battery
wifi.supplicant_scan_interval=180
pm.sleep_mode=1
ro.ril.disable.power.collapse=0
##Disable debugging notify icon on statusbar
persist.adb.notify=0
##Increase overall touch responsiveness
debug.performance.tuning=1
video.accelerate.hw=1
##Raise photo and video recording quality (2.3 ROM only)
ro.media.dec.jpeg.memcap=8000000
ro.media.enc.hprof.vid.bps=8000000
# Photo and video recording quality tweak (2.2 Rom only)
ro.media.dec.jpeg.memcap=10000000
ro.media.enc.hprof.vid.bps=1000000
##Signal (3G) tweaks
ro.ril.hsxpa=2
ro.ril.gprsclass=12
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=6
ro.ril.def.agps.feature=1
ro.ril.enable.sdr=1
ro.ril.enable.gea3=1
ro.ril.enable.fd.plmn.prefix=23402,23410,23411
ro.ril.enable.a52=1
ro.ril.enable.a53=1
ro.ril.enable.dtm=1
##Net speed tweaks
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
##Disable blackscreen issue after a call
ro.lge.proximity.delay=25
mot.proximity.delay=25
##Fix some application issues
ro.kernel.android.checkjni=0
##Phone will not wake up from hitting the volume rocker
ro.config.hwfeature_wakeupkey=0
##Force button lights on when screen is on
ro.mot.buttonlight.timeout=0
##Disable boot animation for faster boot
debug.sf.nobootanimation=1
# Enable Stagefright helps stream Video and Music Faster
media.stagefright.enable-player=true
media.stagefright.enable-meta=true
media.stagefright.enable-scan=true
media.stagefright.enable-http=true
# Enable display Dithering
persist.sys.use_dithering=1
# Enable purgeable assets
persist.sys.purgeable_assets=1
# For SD storage insert notification sound
persist.service.mount.playsnd=0
##Miscellaneous flags
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
init.d scripts
(needs ROM with init.d access and busybox, open empty file, insert header #!/system/bin/sh and put these there, save in /system/etc/init.d and name it something like 77tweaks)
=> app2sd script v.1
=>app2sd script v.2
=> app2sd script v.3
Code:
##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 "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
##misc 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;
##battery tweaks
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
##EXT4 tweaks (greatly increase I/O)
(needs /system, /cache, /data partitions formatted to EXT4)
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
##perfect mount options
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /system
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /data
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /cache
##Flags blocks as non-rotational and increases cache size
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
##microSD card speed tweak
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
##Defrags database files
for i in \
`find /data -iname "*.db"`
do \
sqlite3 $i 'VACUUM;';
done
##Remove logger
rm /dev/log/main
##Ondemand governor tweaks
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
##Auto change governor and I/O Scheduler
a) I/O Scheduler (Best: MTD devices - VR; EMMC devices - SIO) - needs kernel with these
echo "vr" > /sys/block/mmcblk0/queue/scheduler
or
echo "sio" > /sys/block/mmcblk0/queue/scheduler
b) Governor (Best: Minmax > SavagedZen > Smoothass > Smartass > Interactive) - needs kernel with these
echo "governor-name-here" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
##[B]Block Ads with Hosts[/B] regularly updated in Sekhy ROM
Patch your hosts file for blocking Ads
(please think before doing this; many developers are supported through this way)
You can use AdFree application for this or changing manually your hosts file.
Here are some databases:
http://www.mvps.org/winhelp2002/hosts.txt
http://pgl.yoyo.org/adservers/serverlist.php?showintro=0;hostformat=hosts
##Use Google's dns servers
Create an empty file, name it resolv.conf and put there these 2 lines:
nameserver 8.8.8.8
nameserver 8.8.4.4
Save to /system/etc/.
Update Superuser and su binary to latest version
http://goo-inside.me/superuser/
Terminal Emulator Tips
#Find top CPU/memory using apps. value after -m is how many apps to show, value after -n is how many times to update (be sure to set this value or it will run endlessly until terminal is closed)
top -m 10 -n 1
#Loading a module for apps2sdext (link2sd style apps2sd)
Run this in terminal emulator with superuser permission, substituting ext3 for whatever extension you want loaded (keep the .ko though)
insmod /system/lib/modules/ext3.ko
*Listing loaded modules
Run this in terminal emulator with superuser permissions
lsmod
*Forcing a hot reboot to clear caches
Run this in terminal emulator with superuser permissions
pkill zygote
*terminal tips-
Find list of many possible scripts to run
busybox
List sysctl commands
sysct -h
List first or last 10 lines of another scripts output (note | is not lower case L, its a separate character)
First 10-
(script) | head
Last 10
(script) | tail
Example (list first 10 sysctl values)
sysctl -a | head
Finding lines with certain letters/word in another scripts output
(script) | grep (letters/word)
Example (show only sysctl lines with vm in them) (note | is not lower case L, its a separate character)
sysctl -a | grep vm
improve peformance?
Add this to the build.prop
#disable the zygote loader
ro.wmt.blcr.enable=0
Increse overall touch resposivness?
Add these to build.prop
debug.performance.tuning=1
video.accelerate.hw=1
ro.min_pointer_dur=8
Misc:
Tweaking Virtual Memory For Battery Power
Open a Terminal and Execute these conmmds as root Tweak virtual memory to conserve power when running on battery:
Code:
echo 0 > /proc/sys/vm/swappiness #can be ignored if you don't use swap
echo 0 > /proc/sys/vm/dirty expire centisecs #can be ignored if you don't use swap
echo 0 > /proc/sys/vm/dirty=writeback_centisecs #can be ignored if you don't use swap
echo 60 > /proc/sys/vrn/dirty_background_ratio
echo 95 > /proc/svs/vrn/dirty ratio
Experimental only
Code:
[B][U]XLoud Engine[/U][/B]
Xloud is making Sound enhancement,Volume enhancement,Equalizer enhancement credits goes to su.angga
Download [URL="http://hotfile.com/dl/142227330/6333c65/XLOUD.zip.html"]Here[/URL]
Add this line at bottom of your build.prop
ro.semc.xloud.supported=true
persist.service.xloud.enable=1
Set all permission to rw-r-r
[V][V][0]
[V][0][0]
[V][0][0]
Reboot,Enjoy
[B][U]Bravia Engine[/U][/B]
With Bravia Engine Without Bravia Engine
[IMG]http://img855.imageshack.us/img855/6278/photobravia.png[/IMG][IMG]http://img841.imageshack.us/img841/2163/photonobravia.png[/IMG]
Download [URL="http://hotfile.com/dl/142227731/d0e7cda/Braviaengine.rar.html"]Here[/URL]
Add this line at bottom of your build.prop
[B]# BRAVIA HACK[/B]
ro.service.swiqi.supported=true
persist.service.swiqi.enable=1
Copy be_photo and be_movie to system/etc
Set permissions in terminal emulator like this:
su
busybox chmod 0755 /system/etc/be_photo
busybox chmod 0755 /system/etc/be_movie
busybox chown 0.0 /system/etc/be_photo
busybox chown 0.0 /system/etc/be_movie
Reboot,Enjoy
:: Modding & Mods ::
ICS Transition Animations
A simple tutorial to get ICS transition animations on any ROM
Full credits to Capez only
Download APK Multi Tool (previously known as APK manager) from here
2) Extract with WinRAR, from the ROM you want to modify, the file framework-res.apk, that you can find in the directory \System\framework\.
3) Go to the apk manager folder and place the framework-res.apk file in the folder "place-apk-here-for-modding".
4) In the apk manager folder, double click on the file "Script". A cmd window will open.
5) Where it says "Please make your decision", write "22" (Set current project) and enter. Then enter "1" (to choose the first apk) and enter. Then enter "9" (Decompile apk) and enter.
The script will decompile the framework-res.apk.
6) Now go to your apk manager folder, go to Projects\framework-res.apk\res\anim\.
In this folder there are the animations of your rom. They consist in some .xml files decompiled.
7) Download this:
http://www.mediafire.com/?1qjwtotg1r8umm1
8) Copy the files from the folder "anims" of the zip downloaded into the anim folder and you are asked to replace the files; choose yes. Then copy also the files from the folder "other_files" to the anim folder.
9) Now go to your apk manager folder, go to Projects\framework-res.apk\res\values\. Edit the file integers.xml and put these two lines under the line of "shortAnimTime":
<integer name="config_activityShortDur">150</integer>
<integer name="config_activityDefaultDur">220</integer>
Save.
10) Return to Script. Enter "11" (Compile apk) and enter.
The script will rebuild the framework-res.apk.
11) You are asked if this is a system application. Enter "y" and enter. Then a second question appears. Enter newly "y".
12) Then after it processes, Don't press anything & DON'T CLOSE THIS WINDOW!!! A new folder "keep" is created in the apk manager folder. Go inside it and delete the file "resources.arsc". Now go inside keep\res\anim\ and delete every file with the same name as every file of the "anims" folder of the zip downloaded.
Then return to Script and press enter. It processes, then if everything went ok, in the folder "place-apk-here-for-modding" a file "unsignedframework-res.apk" is created. Copy it outside and rename it "framework_res.apk".
13) Now you can create a flashable zip or you can simply push it to your system (but you have to sign the apk).
CONGRATRULATIONS!!! YOU ARE DONE!!!
Video of this mod working:
http://www.youtube.com/watch?v=vf1U_30Ngfk
Enable / Disable media scanning on boot
To enable media scanning on boot:
Code:
su
pm enable com.android.providers.media/com.android.providers.media.MediaScannerReceiver
To disable media scanning on boot:
Code:
su
pm disable com.android.providers.media/com.android.providers.media.MediaScannerReceiver
Caution: I personnaly tried it on our Galaxy 3. But it is looped in Bootanimation.
Please test and confirm anybody, if possible.
Swapping out PNG's in .apk
Full credits to itiskonrad
***Swapping out PNG's***
Okay, so say you have an icon or an image in your phone that you just don't like and would like to swap out with something (or swap out with nothing, so you can't see it at all). Here is what you'll need:
7zip for your computer
Root explorer for your phone
Some kind of image editor. I'm partial towards Paint.net. =) (Only if you're actually going to edit an image. If you're just going to swap it out for something else, you obviously won't need this.)
Here is a good example of something where I really felt like I needed to change some images we can use that I just discovered last night while calling to activate my credit card over the phone. Here is the dialer when you start the phone:
Notice those handy letters next to the numbers =)
Once I started the call to the credit card company, it asked me to verify myself by inputting, using the keypad, the letters of my mother's maiden name. So I opened the dialer, and what did I see?
For whatever STUPID STUPID REASON, they REMOVE the letters next to the numbers on the keypad that opens DURING the call, making it extremely difficult for me to type my mother's maiden name in the time permitted, given that no, I don't off the top of my head know where the letters sit on the dialer. So I felt this needed fixing =)
1.) Copy the apk you want to modify from your phone (using root explorer) and transfer to your computer
In this case, I wanted my Phone.apk, which is in /system/app. The vast majority of system apps are in this folder with the major exception of framework-res.apk, which is the phone’s BIG cajone in /system/framework, and as such, should be handled with utmost care. Messing with framework-res.apk incorrectly is an EASY way to brick your phone in a heartbeat.
2.) Unzip the apk using 7zip and look for your PNG's!
Keep the original, untouched, zipped apk somewhere safe on your computer. You’re going to need one to modify and another copy for safekeeping in case you want to revert back to the stock apk, or something goes wrong. Unzipping the apk just makes searching for the PNG you’re looking for much easier, since you can change the folder view in windows to give you a thumbnail of each of the items. And lookee, lookee, here they are in phone/res/drawable-hdpi, right next to other dial buttons with those handy letters!!
3.) Edit your PNG's however you want.
In this case, the work is pretty much done for us! I just swapped out the PNG's without the letters for copies of the ones with the letters, and just changed the names of the files to the original versions, like so:
4.) Using 7zip, right click on the original, untouched apk, choose 7zip, and open archive. DO NOT EXTRACT.
Open archive will let you explore the apk without having to extract it and lose the proper packaging of the apk.
5.) Select all your newly modified PNG’s and drag and drop them into the correct location in the open archive of the original apk, letting them overwrite the old PNG’s.
6.) Put this newly modified apk back onto your phone. Using root explorer, copy the new apk into the /system folder of your phone.
7.) CHANGE THE PERMISSIONS of the apk to match those of the original apk in /system/app.
In this case, long press on the phone.apk, select permissions, and select the check boxes as follows- Owner: Read, Write; Group: Read; Others: Read. This matches the permissions of phone.apk in /system/app
8.) Move the new apk into /system/app, and let it overwrite the original!
9.) Restart your phone!
Voila! Now when I call my credit card company and have to type in names, I can!
Regional Fonts (Indian)
Download Desifonts.zip
Copy to sdcard. Go to CWM Recovery.
Install it.
Reboot.
::Credits::
capez (ICS transition animations)
Great.Apo
itiskonrad
knzo
Kyrillos
Super.Angga
No offense but we do have individual threads for these already . What's the need for another one?
Rapier07 said:
No offense but we do have individual threads for these already . What's the need for another one?
Click to expand...
Click to collapse
+1 to that
Sent from Galaxy
Kyrillos' ROM GWK74 Alpha4
powered by
CM7-kernel 1.2--800Mhz
rkkoby said:
+1 to that
Sent from Galaxy
Kyrillos' ROM GWK74 Alpha4
powered by
CM7-kernel 1.2--800Mhz
Click to expand...
Click to collapse
I thought it is useful to kept all of them in one place.
But based on your response if you feel it is not necessary and the Mod also feeling the same, Please delete this thread.
I don't mind.
I think this thread is very useful and i will surely subscribe and use this thread in the future
Smonic said:
I think this thread is very useful and i will surely subscribe and use this thread in the future
Click to expand...
Click to collapse
Thank you very much for your support. But lets wait for the MOD's reply.
Just to help your argument, there's a collection of ROM's so why not a collection of tweaks
yup... make a master index of tweaks
and we can apply only those we want separately ..great idea !
satishynd said:
yup... make a master index of tweaks
and we can apply only those we want separately ..great idea !
Click to expand...
Click to collapse
Thanks for your support.
Regarding your battery problem (seen in your signature)
Me too faced battery problem. But at first I thought it is an issue with firmware or problem with out G3 itself. But after getting it replaced by Samsung Service Centre it gives huge battery backup, of course with Custom ROMs only.
+1 for this topic. Great job!
Good work! But Jazux shouldn't be given any credits for these, it was knzo who repo'ed it ... Jazux did nothing!
@Rapier07 - See, I have joined forces with you officially in totally elimination of the Sux effect
Orr.Penn.18 said:
Good work! But Jazux shouldn't be given any credits for these, it was knzo who repo'ed it ... Jazux did nothing!
@Rapier07 - See, I have joined forces with you officially in totally elimination of the Sux effect
Click to expand...
Click to collapse
Yeah i can see that lol
Just used some of these tweaks on stock XXJPS (only the ones i found useful for me). I will see the result
plz delete jazux from credits, because he had opened similar thread long back which he had copied from other thread and didnt even care to give that guy credits..so i think jazux doesnt deserve those credits
deadwood01 said:
plz delete jazux from credits, because he had opened similar thread long back which he had copied from other thread and didnt even care to give that guy credits..so i think jazux doesnt deserve those credits
Click to expand...
Click to collapse
Jazux removed.
CM10.1 Mega BOOST
{
"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"
}
* Better Battery
- Deep Sleep Mode
- Scans Wifi Less Frequently (Saves Battery)
* Image Quality Increased
* Streams Video Faster
* Better Touch Response
* Faster Reboot
* Instant Call
- No Delay In Receiving/Making Calls
* Faster Launcher
- No/Very Little Lag
- Forces Launcher Into Memory
* Fixes FC Issues With Some App’s
* Fixes “Black Screen” Issue After Call
- Screen Appears Almost Instantly After Pulling Phone Away From Face
* Audio & Video Quality Increased
* Signal Tweaks
* Download & Upload Speed Increased
* Dalvik VM Tweaks
* Loads App Faster
* Frees More RAM
* Overall Performance Increased
And Many More ...
Experimental Tweaks
To use experimental tweaks, simply remove "#" from the tweak you wish to use.
touch.pressure.scale=0.001
Improves Touch (Recommended)
ro.min_pointer_dur=8
Better Scrolling
ro.media.enc.hprof.vid.fps=65
Improves Media Quality
persist.sys.purgeable_assets=1
Frees up more RAM (Recommended)
persist.sys.use.dithering=1
Improves Screen Quality At The Cost Of Performance
debug.gr.swapinterval=0
Removes FPS Cap
debug.sf.nobootanimation=0
Disables Bootanimation
Version 1.4
Added More Experimental Tweaks
Modified Existing Tweaks
Added Performance Tweaks
Version 1.3
Added More Tweaks
Added Experimental Tweaks
Version 1.2
Proximity Tweaks
Dalvik VM Tweaks
Version 1.1
Swap SDCards
More Responsiveness
Image Quality Ehnanced
Made some changes for better results
Version 1.0
Initial Release
1. Download The Latest Version
2. Go Into Recovery Mode
3. Flash the zip file
4. Clear Dalvik Cache
5. Reboot
Version 1.4
Version 1.3
Version 1.2
Version 1.1
Version 1.0
testing/flashing
Good job, but Android Tweaker make the same things ...
- Scans Wifi Less Frequently (Saves Battery) wifi.supplicant_scan_interval=180
Less can not? Value 300 or 600 is not effective?
Will this continue to work with Dhiru's Alpha 7
Just wanted to know if this will work with [ALPHA][ROM][4.2.2] CyanogenMod 10.1 for Samsung Galaxy SL - Alpha 7.
yogesh.p.mahajan said:
Just wanted to know if this will work with [ALPHA][ROM][4.2.2] CyanogenMod 10.1 for Samsung Galaxy SL - Alpha 7.
Click to expand...
Click to collapse
Yes!
TopDroid said:
Yes!
Click to expand...
Click to collapse
And with the brand new a8? Thank you!
Yes
Hi TopDroid.can you write specific rom can work with your build?thanks alot!
ndttung8487 said:
Hi TopDroid.can you write specific rom can work with your build?thanks alot!
Click to expand...
Click to collapse
I have tried it only on CM10.1 and will work on it only.
hi TopDroid. After flash v1.3 on A8 i saw that my phone doesn't goes too smooth as V1.2 on A7. it lags and i have to wipe dalvik cache so usual, ram memory usable is less than v1.2 on a7 too. Moreover, can you make transparent status bar or hidden status bar by cwm flash file? much appreciate and thank you.
P/S: apps and settings i use the same on A7, I did clean ddfl2 by odin, wipe and flash fresh A8 (original of Dhiru1602). Thank you.
Edit: I install fresh all apps, i do not back up and restore.
Use v1.2 if you find it better. Totally up to you!
For Hidden Status Bar - View Thread
Hi there. After i flash hidden on A8. My phone stuck at boot logo! Thanks alot for your work
NEW script for you bro
Hi @TopDroid to make your life easier
Here is a script to update the build.prob only !!!
to retain the information for each rom !!!
it works for all Roms and devices
benefit
Code:
show_progress(0.1, 0);
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print("#*************************#");
ui_print("# #");
ui_print("# Mega Boost #");
ui_print("# Version 1.3 #");
ui_print("# ------------------ #");
ui_print("# #");
ui_print("# By TopDroid #");
ui_print("**************************#");
show_progress(0.100000, 0);
run_program("/sbin/busybox", "mount", "/system");
show_progress(0.100000, 40);
package_extract_file("topdroid.sh", "/tmp/topdroid.sh");
set_perm(0, 0, 0777, "/tmp/topdroid.sh");
run_program("/tmp/topdroid.sh");
delete("/tmp/topdroid.sh");
show_progress(0.100000, 70);
#set_perm_recursive(0, 2000, 0755, 0755, "/system/bin/***");
show_progress(0.100000, 90);
#set_perm_recursive(0, 2000, 0755, 0755, "/system/bin/***");
unmount("/system");
show_progress(0.100000, 100);
ui_print("Installation Completed *");
ui_print("Clear Dalvik cache");
ui_print("Reboot");
ui_print("");
Code:
#!/sbin/sh
busybox echo "" >> /system/build.prop
busybox echo "# TopDroid" >> /system/build.prop
busybox echo "" >> /system/build.prop
busybox echo "# Faster Streaming" >> /system/build.prop
busybox echo "media.stagefright.enable-player=true" >> /system/build.prop
busybox echo "media.stagefright.enable-meta=true" >> /system/build.prop
busybox echo "media.stagefright.enable-scan=true" >> /system/build.prop
busybox echo "media.stagefright.enable-http=true" >> /system/build.prop
busybox echo "media.stagefright.enable-record=false" >> /system/build.prop
busybox echo "" >> /system/build.prop
busybox echo "# Better Image & Audio Quality" >> /system/build.prop
busybox echo "ro.media.dec.jpeg.memcap=8000000" >> /system/build.prop
busybox echo "ro.media.enc.hprof.vid.bps=8000000" >> /system/build.prop
busybox echo "ro.media.enc.jpeg.quality=100" >> /system/build.prop
busybox echo "" >> /system/build.prop
busybox echo "# Net Speed Tweaks" >> /system/build.prop
busybox echo "net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960" >> /system/build.prop
busybox echo "net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960" >> /system/build.prop
busybox echo "net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960" >> /system/build.prop
busybox echo "net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960" >> /system/build.prop
busybox echo "net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960" >> /system/build.prop
busybox echo "net.tcp.buffersize.hspa=4096,87380,256960,4096,163 84,256960" >> /system/build.prop
busybox echo "net.tcp.buffersize.lte=524288,1048576,2097152,524288,1048576,2097152" >> /system/build.prop
busybox echo "net.tcp.buffersize.hspda=4096,87380,256960,4096,16 384,256960" >> /system/build.prop
busybox echo "net.tcp.buffersize.evdo_b=6144,87380,1048576,6144,87380,1048576" >> /system/build.prop
busybox echo "" >> /system/build.prop
busybox echo "# Google DNS" >> /system/build.prop
busybox echo "net.ppp0.dns1=8.8.8.8" >> /system/build.prop
busybox echo "net.ppp0.dns2=8.8.4.4" >> /system/build.prop
busybox echo "net.dns1=8.8.8.8" >> /system/build.prop
busybox echo "net.dns2=8.8.4.4" >> /system/build.prop
busybox echo "" >> /system/build.prop
busybox echo "# No Delay In Making Call" >> /system/build.prop
busybox echo "ro.telephony.call_ring.delay=100" >> /system/build.prop
busybox echo "ring.delay=0" >> /system/build.prop
busybox echo "" >> /system/build.prop
busybox echo "# Battery Tweaks" >> /system/build.prop
busybox echo "pm.sleep_mode=1" >> /system/build.prop
busybox echo "ro.ril.disable.power.collapse=0" >> /system/build.prop
busybox echo "ro.ril.fast.dormancy.rule=0" >> /system/build.prop
busybox echo "" >> /system/build.prop
busybox echo "# Proximity Tweaks" >> /system/build.prop
busybox echo "ro.lge.proximity.delay=25" >> /system/build.prop
busybox echo "mot.proximity.delay=25" >> /system/build.prop
busybox echo "" >> /system/build.prop
busybox echo "# TopDroid" >> /system/build.prop
busybox echo "" >> /system/build.prop
busybox echo "# Signal Tweaks" >> /system/build.prop
busybox echo "ro.ril.enable.amr.wideband=1" >> /system/build.prop
busybox echo "persist.cust.tel.eons=1" >> /system/build.prop
busybox echo "ro.config.hw_fast_dormancy=1" >> /system/build.prop
busybox echo "ro.ril.hsxpa=2" >> /system/build.prop
busybox echo "ro.ril.gprsclass=12" >> /system/build.prop
busybox echo "ro.ril.enable.dtm=1" >> /system/build.prop
busybox echo "ro.ril.hsdpa.category=8" >> /system/build.prop
busybox echo "ro.ril.enable.a53=1" >> /system/build.prop
busybox echo "ro.ril.enable.3g.prefix=1" >> /system/build.prop
busybox echo "ro.ril.htcmaskw1.bitmask=4294967295" >> /system/build.prop
busybox echo "ro.ril.htcmaskw1=14449" >> /system/build.prop
busybox echo "ro.ril.hsupa.category=6" >> /system/build.prop
busybox echo "" >> /system/build.prop
busybox echo "# Better Responsiveness & Speed" >> /system/build.prop
busybox echo "windowsmgr.max_events_per_sec=260" >> /system/build.prop
busybox echo "ro.max.fling_velocity=12000" >> /system/build.prop
busybox echo "ro.min.fling_velocity=8000" >> /system/build.prop
busybox echo "" >> /system/build.prop
busybox echo "# Dalvik VM Tweaks" >> /system/build.prop
busybox echo "dalvik.vm.dexopt-flags=v=n,o=v" >> /system/build.prop
busybox echo "dalvik.vm.execution-mode=int:jit" >> /system/build.prop
busybox echo "dalvik.vm.verify-bytecode=false" >> /system/build.prop
busybox echo "dalvik.vm.checkjni=false" >> /system/build.prop
busybox echo "" >> /system/build.prop
busybox echo "# Fast Reboot" >> /system/build.prop
busybox echo "persist.sys.shutdown.mode=hibernate" >> /system/build.prop
busybox echo "ro.config.hw_quickpoweron=true" >> /system/build.prop
busybox echo "" >> /system/build.prop
busybox echo "# Other Tweaks" >> /system/build.prop
busybox echo "ro.media.dec.aud.wma.enabled=1" >> /system/build.prop
busybox echo "ro.media.dec.vid.wmv.enabled=1" >> /system/build.prop
busybox echo "ro.mot.eri.losalert.delay=1000" >> /system/build.prop
busybox echo "ro.config.hwfeature_wakeupkey=0" >> /system/build.prop
busybox echo "ro.kernel.android.checkjni=0" >> /system/build.prop
busybox echo "ro.kernel.checkjni=0" >> /system/build.prop
busybox echo "persist.adb.notify=0" >> /system/build.prop
busybox echo "vm.stat_interval=1" >> /system/build.prop
busybox echo "persist.android.strictmode=0" >> /system/build.prop
busybox echo "profiler.force_disable_err_rpt=1" >> /system/build.prop
busybox echo "profiler.force_disable_ulog=1" >> /system/build.prop
busybox echo "ro.config.nocheckin=1" >> /system/build.prop
busybox echo "" >> /system/build.prop
busybox echo "#" >> /system/build.prop
busybox echo "# Experimental Tweaks" >> /system/build.prop
busybox echo "#" >> /system/build.prop
busybox echo "" >> /system/build.prop
busybox echo "#touch.presure.scale=0.001" >> /system/build.prop
busybox echo "#ro.min_pointer_dur=8" >> /system/build.prop
busybox echo "#ro.media.enc.hprof.vid.fps=65" >> /system/build.prop
what is the diferrent between Lolation's file and v1.3 of TopDroid?
ndttung8487 said:
what is the diferrent between Lolation's file and v1.3 of TopDroid?
Click to expand...
Click to collapse
lola file is just update the build.prop so it's work on All rom with 4.2.2 JB , And Topdroid file it's just replace Stock Alpha8 build.prop to new one so it's work only on A8 ..
LoLaTiOn said:
Hi @TopDroid to make your life easier
Here is a script to update the build.prob only !!!
to retain the information for each rom !!!
it works for all Roms and devices
Click to expand...
Click to collapse
Really nice script. But the reason I'm not using it is that your script will add the build.prop tweaks to the existing build.prop and mine will completely replace it. The problem with your script is that if the existing build.prop already has been tweaked, there may be a possibility of duplication and that can create problems.
I'm not being disrespectful but expressing my view.
With this tweak i face the same problem as turbo charge. Blacklist still vibrate and play ringtone even number was blocked.
10.2?
Hey guys,
So, I am using CM currently, and use CyanDelta to update every couple of days (it works so well!). It works great because I can have it flash Franco Kernel and SuperSU after updating, so those are maintained at least. Annoying part is, every time I update, my build.prop is being overwritten. I scale my DPI down to 405 in order for everything to be ungigantic, and when it gets changed back, it essentially erases my home screens. So, every update, I have to re-apply my settings, and re-do my homescreens. I'm just wondering if you guys have come up with a way to maintain build.prop changes between ROM updates? I feel like there may be a script or something out there, but with some cursory searching around, I can't find jack.
Thanks!
Just copy your current build.prop to your sd when u flash a new build copy and paste over the new one change permissions reboot
Sent from my SM-N910C using XDA Free mobile app
duvalbmarley said:
Just copy your current build.prop to your sd when u flash a new build copy and paste over the new one change permissions reboot
Sent from my SM-N910C using XDA Free mobile app
Click to expand...
Click to collapse
What happens if there are important build.prop changes in an update though?
Transmitted via Bacon
timmaaa said:
What happens if there are important build.prop changes in an update though?
Transmitted via Bacon
Click to expand...
Click to collapse
Most changes are not build.prop related and if it is it would be easier to just copy and paste those changes to the build.prop u copied on your sd card.. and if it's the same rom then it should be no problem or even if it's 2 different roms with the same Base just make sure to copy your original before replacing incase anything goes wrong.... I'm just throwing out a solution what do you suggest the op do??? Don't bash the helper give a helping hand or don't comment
Sent from my SM-N910C using XDA Free mobile app
duvalbmarley said:
Most changes are not build.prop related and if it is it would be easier to just copy and paste those changes to the build.prop u copied on your sd card.. and if it's the same rom then it should be no problem or even if it's 2 different roms with the same Base just make sure to copy your original before replacing incase anything goes wrong.... I'm just throwing out a solution what do you suggest the op do??? Don't bash the helper give a helping hand or don't comment
Sent from my SM-N910C using XDA Free mobile app
Click to expand...
Click to collapse
Whoa, calm down. I'm not bashing you, just asking a question, in order to work with you to come up with the best solution. I agree, most changes aren't contained in the build.prop, but every now and again there could be one or two and it'd take more time checking the two build.props against other than it would just changing the DPI and setting up screens after a flash. I just don't think this solution, while it may work, is a very elegant or practical one, considering that you'd need to waste time to check the build.prop anyway.
@kmakiki, what launcher do you use? I use the app Texdroider to adjust my DPI to 370 after each nightly flash too, but my home screens are never affected. I use Nova Launcher.
Transmitted via Bacon
timmaaa said:
Whoa, calm down. I'm not bashing you, just asking a question, in order to work with you to come up with the best solution. I agree, most changes aren't contained in the build.prop, but every now and again there could be one or two and it'd take more time checking the two build.props against other than it would just changing the DPI and setting up screens after a flash. I just don't think this solution, while it may work, is a very elegant or practical one, considering that you'd need to waste time to check the build.prop anyway.
@kmakiki, what launcher do you use? I use the app Texdroider to adjust my DPI to 370 after each nightly flash too, but my home screens are never affected. I use Nova Launcher.
Transmitted via Bacon
Click to expand...
Click to collapse
Well in my situation I have speed tweaks Internet tweaks dpi changes and a bunch of other tweaks I add to build.prop and i would rather just copy one or two lines then to add every tweak and change after every update
Sent from my SM-N910C using XDA Free mobile app
duvalbmarley said:
Well in my situation I have speed tweaks Internet tweaks dpi changes and a bunch of other tweaks I add to build.prop and i would rather just copy one or two lines then to add every tweak and change after every update
Sent from my SM-N910C using XDA Free mobile app
Click to expand...
Click to collapse
Yeah, but what I'm saying is that it would be time consuming to actually go through each build.prop line by line to discover if there are any that are different or added/removed. It isn't the adding of lines that's the problem, it's having to find out if you need to.
Transmitted via Bacon
timmaaa said:
Yeah, but what I'm saying is that it would be time consuming to actually go through each build.prop line by line to discover if there are any that are different or added/removed. It isn't the adding of lines that's the problem, it's having to find out if you need to.
Transmitted via Bacon
Click to expand...
Click to collapse
Most developer's have change logs to show what was updated and if it's build.prop changes which most likely it won't be u could just ask or it should be posted in change log let's not argue about the changes let's find another solution besides copy and paste since no one has came up with another option
Sent from my SM-N910C using XDA Free mobile app
duvalbmarley said:
Most developer's have change logs to show what was updated and if it's build.prop changes which most likely it won't be u could just ask or it should be posted in change log let's not argue about the changes let's find another solution besides copy and paste since no one has came up with another option
Sent from my SM-N910C using XDA Free mobile app
Click to expand...
Click to collapse
I think the best solution for him is to just change the launcher he's using, that's where the problem lies.
Transmitted via Bacon
flash this zip (attachement)
it will add a file called 99-DPI.sh to
/system/addons.d/ and, by that, it will be executed after every rom flash that uses the backupscripts (cm,... )
the script will replace the default ro.sf.lcd_density to a value you specify (the new default value is 360, this is what i use)
you can add a file called .dpi to your sdcard (/sdcard/.dpi) which contains a number (e.g. 405), then this value will be used after each rom flash.
if you have some questions then feel free to ask :>
[edit]
i just read the whole thread (i was missing some posts)
the 99-DPI.sh can be used to edit any build.prop change, you just have to add some lines, it should be self explaining.
@aHcVolle can u explain more on how to dd new lines to be added into build. Prop
Thnx in advance
@kmakiki i just think of it what if u edit the build. Prop in the cyandelta zip file b4 flashing it?
Ma7mu7 said:
@aHcVolle can u explain more on how to dd new lines to be added into build. Prop
Thnx in advance
Click to expand...
Click to collapse
Can you give more info in what you are trying to do?
aHcVolle said:
Can you give more info in what you are trying to do?
Click to expand...
Click to collapse
Thanks for the fast reply i want to add some lines to build.prop other than changing the dpi i.e disabling bootanimation 3g tweaks etc..
Ma7mu7 said:
Thanks for the fast reply i want to add some lines to build.prop other than changing the dpi i.e disabling bootanimation 3g tweaks etc..
Click to expand...
Click to collapse
OK, edit the file script/99-DPI.sh
remove everything between restore) and ;;
and add your stuff between those 2.
example:
Code:
restore)
echo "dummy_var=1" >> /system/build.prop
ui_print "added line to build.prop"
;;
that should be everything you need.
aHcVolle said:
OK, edit the file script/99-DPI.sh
remove everything between restore) and ;;
and add your stuff between those 2.
example:
Code:
restore)
echo "dummy_var=1" >> /system/build.prop
ui_print "added line to build.prop"
;;
that should be everything you need.
Click to expand...
Click to collapse
Sooo it should be
Code:
restore)
echo "dummy_var=1" >> /system/build.prop
ui_print "added line to build.prop"
debug.sf.nobootanimation=1
ro.config.hw_quickpoweron=true
persist.sys.shutdown.mode=hibernate
dev.bootcomplete=0 ;;
Instead of
Code:
restore)
# We only have work when restoring....
if [ -f $FILE ]; then
# The DPI file is existing, lets check its content
FILEDPI=$(cat $FILE)
# Convert to int (maybe not needed)
(( FILEDPI=$FILEDPI+0 ))
Right?
No
Code:
restore)
echo "debug.sf.nobootanimation=1" >> /system/build.prop
echo "ro.config.hw_quickpoweron=true" >> /system/build.prop
echo "persist.sys.shutdown.mode=hibernate" >> /system/build.prop
echo "dev.bootcomplete=0" >> /system/build.prop
ui_print "added 4 lines to build.prop"
;;
aHcVolle said:
No
Code:
restore)
echo "debug.sf.nobootanimation=1" >> /system/build.prop
echo "ro.config.hw_quickpoweron=true" >> /system/build.prop
echo "persist.sys.shutdown.mode=hibernate" >> /system/build.prop
echo "dev.bootcomplete=0" >> /system/build.prop
ui_print "added 4 lines to build.prop"
;;
Click to expand...
Click to collapse
Thank you very very much just last question
What abt the rest
Code:
# We only have work when restoring....
if [ -f $FILE ]; then
# The DPI file is existing, lets check its content
FILEDPI=$(cat $FILE)
# Convert to int (maybe not needed)
(( FILEDPI=$FILEDPI+0 ))
Shall i just delete them or keep the,m?
Ma7mu7 said:
Thank you very very much just last question
What abt the rest
Code:
# We only have work when restoring....
if [ -f $FILE ]; then
# The DPI file is existing, lets check its content
FILEDPI=$(cat $FILE)
# Convert to int (maybe not needed)
(( FILEDPI=$FILEDPI+0 ))
Shall i just delete them or keep the,m?
Click to expand...
Click to collapse
you can delete them.
make the file look like this:
Code:
#!/sbin/sh
# persistant dpi by volle
# credits: nuclearmistake for ui_print cmd
# Print function
export OUTFD=$(ps | grep -v "grep" | grep -o -E "update_binary(.*)" | cut -d " " -f 3); #BIG props to Chainfire
[ ! $OUTFD ] && export OUTFD=$(ps | grep -v "grep" | grep -o -E "/tmp/updater(.*)" | cut -d " " -f 3); #BIG props nuclearmistake for TWRP-izing
ui_print() { if [ $OUTFD ]; then echo "ui_print $*" 1>&$OUTFD; fi; return 0; }
case "$1" in
pre-backup)
;;
backup)
;;
post-backup)
;;
pre-restore)
;;
restore)
echo "debug.sf.nobootanimation=1" >> /system/build.prop
echo "ro.config.hw_quickpoweron=true" >> /system/build.prop
echo "persist.sys.shutdown.mode=hibernate" >> /system/build.prop
echo "dev.bootcomplete=0" >> /system/build.prop
ui_print "added 4 lines to build.prop"
;;
post-restore)
;;
*)
ui_print " Unkown command $1"
;;
esac
@aHcVolle thanx for the script.
i was also searching how to add lines to build.prop in recovery and it works perfect :good:
aHcVolle said:
you can delete them.
make the file look like this:
[/code]
Click to expand...
Click to collapse
I have a question about combining scripts.
I managed to combine 2 scripts.
First one i created with Android Flashable Zip Creator to install to flash apps in recovery.
Second one is the Fermion Blackhole script to remove bloatware and unwanted apps, also in recovery.
I just copied part of the blackhole into the 1st scipt. I tested it and it works.
Code:
ui_print("@Starting the install process");
ui_print("Setting up required tools...");
ui_print("Mounting Partitions...");
ui_print(" ");
run_program("/sbin/busybox","mount", "/system");
run_program("/sbin/busybox","mount", "/data");
set_progress(0.1);
ui_print("@Installing System Apps");
package_extract_dir("customize/APKs-System/APKs-System_appz", "/system/app");
set_progress(0.2);
set_progress(0.25);
set_progress(0.3);
set_progress(0.4);
set_progress(0.5);
set_progress(0.6);
set_progress(0.7);
set_progress(0.8);
set_progress(0.9);
ui_print("-Sending bloatware to a blackhole.");
delete_recursive(
"/system/app/BasicDreams",
"/system/app/Browser",
"/system/app/Camera2",
"/system/app/CMFileManager",
"/system/app/CMWallpapers",
"/system/app/Eleven",
"/system/app/Email",
"/system/app/Exchange2",
"/system/app/Galaxy4",
"/system/app/Gallery2",
"/system/app/HoloSpiralWallpaper",
"/system/app/LatinIME",
"/system/app/LiveWallpapers",
"/system/app/LiveWallpapersPicker",
"/system/app/Microbes",
"/system/app/NoiseField",
"/system/app/PhaseBeam",
"/system/app/PhotoPhase",
"/system/app/PhotoTable",
"/system/app/PicoTts",
"/system/app/VisualizationWallpapers",
"/system/app/WhisperPush"
);
delete_recursive(
"/system/priv-app/AudioFX",
"/system/priv-app/CellBroadcastReceiver",
"/system/priv-app/Mms",
"/system/priv-app/MmsService",
"/system/priv-app/OmniSwitch",
"/system/priv-app/Trebuchet",
"/system/priv-app/Wallet"
);
set_progress(0.9);
set_metadata_recursive("/system/addon.d", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/app", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/etc/permissions", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/etc/preferred-apps", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/framework", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/priv-app", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
ui_print("-Unmounting system partition.");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/data");
ui_print("");
ui_print("Done debloating your device!");
ui_print("@Finished Install");
set_progress(1);
Is it possible to add your script to the updater.script ? What part should i copy ? And also can i just add the /script folder into my zip flash file ?
These are the 2 files i use to edit build.prop :
Code:
ui_print("Persistant DPI mod by volle");
ui_print(" Mounting /system");
ifelse(is_mounted("/system"), unmount("/system"));
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
ui_print(" Extracting backupscript");
package_extract_file("script/99-DPI.sh", "/system/addon.d/99-DPI.sh");
set_perm(0, 0, 0777, "/system/addon.d/99-DPI.sh");
ui_print(" Running backupscript");
assert(run_program("/system/addon.d/99-DPI.sh","restore"));
ui_print(" Unmounting /system");
unmount("/system");
ui_print("Everything done");
Code:
#!/sbin/sh
# persistant dpi by volle
# credits: nuclearmistake for ui_print cmd
# Print function
export OUTFD=$(ps | grep -v "grep" | grep -o -E "update_binary(.*)" | cut -d " " -f 3); #BIG props to Chainfire
[ ! $OUTFD ] && export OUTFD=$(ps | grep -v "grep" | grep -o -E "/tmp/updater(.*)" | cut -d " " -f 3); #BIG props nuclearmistake for TWRP-izing
ui_print() { if [ $OUTFD ]; then echo "ui_print $*" 1>&$OUTFD; fi; return 0; }
case "$1" in
pre-backup)
;;
backup)
;;
post-backup)
;;
pre-restore)
;;
restore)
echo "qemu.hw.mainkeys=0" >> /system/build.prop
ui_print " HW Mainkeys set"
;;
post-restore)
;;
*)
ui_print " Unkown command $1"
;;
esac
I'm trying to understand why using echo command in sh file doesn't work in recovery.
I've made a flashable zip with 7-zip, it contains a shell script.
The updater-script is
Code:
ui_print("");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("test", "/tmp");
set_perm(0, 0, 0777, "/tmp/test.sh");
run_program("/tmp/test.sh");
delete_recursive("/tmp");
unmount("/system");
unmount("/data");
and my test.sh is like this :
Code:
#!/sbin/sh
rm -rf /system/app/YouTube
echo "Delete Youtube"
test.sh deletes Youtube folder but echo command doesn't work.
I use TWRP 3.2.3.0 recovery
Echo is a command for windows command line. In recovery you use: ui_print("<message goes here");
In recovery the language used is called Edify.
Read a bit about it here:
https://forum.xda-developers.com/wiki/Edify_script_language
joluke said:
Echo is a command for windows command line. In recovery you use: ui_print("<message goes here");
In recovery the language used is called Edify.
Read a bit about it here:
https://forum.xda-developers.com/wiki/Edify_script_language
Click to expand...
Click to collapse
you use ui_print in updater-script ?
but in sh file how to print on screen if echo doesn't work in recovery ?
kramer04 said:
you use ui_print in updater-script ?
but in sh file how to print on screen if echo doesn't work in recovery ?
Click to expand...
Click to collapse
Sh use the commands you use in linux
And yes ui_print is for updater-script
joluke said:
Sh use the commands you use in linux
And yes ui_print is for updater-script
Click to expand...
Click to collapse
Ok trying to use echo in sh file doesn't work for me.
So I don't understand how to do .
Any suggestions?
kramer04 said:
Ok trying to use echo in sh file doesn't work for me.
So I don't understand how to do .
Any suggestions?
Click to expand...
Click to collapse
Use Linux commands only. Echo is for Windows command line.
I don't have the skills to help you but googling "Linux commands for console" should help
joluke said:
Use Linux commands only. Echo is for Windows command line.
I don't have the skills to help you but googling "Linux commands for console" should help
Click to expand...
Click to collapse
So googling linus commands but I don't find how to use echo in a sh file in recovery.
If you have time try yourself echo command .
I've no idea why it doesn't work.
ECHO is a command for windows command line dude! Why do you insist on using echo? Echo is for windows command line? Got it now?
You need to use other commands according to the system you are using. and in android you use bash language on .sh files!
joluke said:
ECHO is a command for windows command line dude! Why do you insist on using echo? Echo is for windows command line? Got it now?
You need to use other commands according to the system you are using. and in android you use bash language on .sh files!
Click to expand...
Click to collapse
but i don't understand why it doesn't work
else i don't know how to replace echo by an other command
Thanks for help
kramer04 said:
but i don't understand why it doesn't work
else i don't know how to replace echo by an other command
Thanks for help
Click to expand...
Click to collapse
Every programming language uses its own commands...
Maybe because of that?
After some research
i change a little my script to see if command echo works
code in updater-script
Code:
ui_print("*************************");
ui_print("sh10");
ui_print("*************************");
unmount("/system");
unmount("/data");
#ui_print("-- Montage partitions...");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("test", "/tmp");
set_perm(0, 0, 0777, "/tmp/test.sh");
run_program("/tmp/test.sh");
#ui_print("Extracting files ...");
#package_extract_dir("system", "/tmp/update");
#set_perm(0, 0, 0755, "/tmp/update/myscript.sh");
#run_program("/tmp/update/myscript.sh");
#delete_recursive("/tmp*");
ui_print("END OF PROCESS");
ui_print("*************************");
unmount("/data");
unmount("/system");
code in test.sh file
Code:
#!/sbin/sh
#echo on
#function to display commands
exe() { echo "\$ [email protected]" ; "[email protected]" ; }
OUTFD=$2
ui_print() {
if [ $OUTFD != "" ]; then
echo "ui_print ${1} " 1>&$OUTFD;
echo "ui_print " 1>&$OUTFD;
else
echo "${1}";
fi;
}
#rm -rf /system/app/YouTube
echo "hello world !, using echo" >tong.txt
exe echo "Delete YouTube, using exe echo"
echo "Delete YouTube, using echo" >>tong.txt
printf "hello world, using printf" >>tong.txt
cat tong.txt
ui_print "hello world! using ui_print"
echo command doesn't print on screen but it creates tong.txt and pass in results.
We can see it works in recovery.log
I:Set page: 'install'
I:Set page: 'flash_confirm'
I:Set page: 'flash_zip'
Iperation_start: 'Flashing'
Installing zip file '/external_sd/Custom Rom/test.zip'
Checking for Digest file...
Skipping Digest check: no Digest file found
I:Update binary zip
Verifying package compatibility...
Package doesn't contain compatibility.zip entry
I:Zip does not contain SELinux file_contexts file in its root.
I:has_legacy_properties: Found legacy property match!
I:Legacy property environment initialized.
*************************
sh10
*************************
unmount of /system failed; no such volume
about to run program [/sbin/busybox] with 3 args
about to run program [/sbin/busybox] with 3 args
minzip: Extracted file "/tmp/test.sh"
about to run program [/tmp/test.sh] with 1 args
$ echo Delete YouTube, using exe echo
Delete YouTube, using exe echo
hello world !, using echo
Delete YouTube, using echo
hello world, using printfsh: : unknown operand
hello world! using ui_print
END OF PROCESS
*************************
script result was [/system]
I:Updater process ended with RC=0
I:Legacy property environment disabled.
I:Install took 0 second(s).
Updating partition details...
I:mount -o bind '/data/media/0' '/sdcard' process ended with RC=0
Someone has an idea why echo doesn't print on screen in TWRP recovery; else it works...
weird for me
kramer04 said:
After some research
i change a little my script to see if command echo works
code in updater-script
Code:
ui_print("*************************");
ui_print("sh10");
ui_print("*************************");
unmount("/system");
unmount("/data");
#ui_print("-- Montage partitions...");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("test", "/tmp");
set_perm(0, 0, 0777, "/tmp/test.sh");
run_program("/tmp/test.sh");
#ui_print("Extracting files ...");
#package_extract_dir("system", "/tmp/update");
#set_perm(0, 0, 0755, "/tmp/update/myscript.sh");
#run_program("/tmp/update/myscript.sh");
#delete_recursive("/tmp*");
ui_print("END OF PROCESS");
ui_print("*************************");
unmount("/data");
unmount("/system");
code in test.sh file
Code:
#!/sbin/sh
#echo on
#function to display commands
exe() { echo "\$ [email protected]" ; "[email protected]" ; }
OUTFD=$2
ui_print() {
if [ $OUTFD != "" ]; then
echo "ui_print ${1} " 1>&$OUTFD;
echo "ui_print " 1>&$OUTFD;
else
echo "${1}";
fi;
}
#rm -rf /system/app/YouTube
echo "hello world !, using echo" >tong.txt
exe echo "Delete YouTube, using exe echo"
echo "Delete YouTube, using echo" >>tong.txt
printf "hello world, using printf" >>tong.txt
cat tong.txt
ui_print "hello world! using ui_print"
echo command doesn't print on screen but it creates tong.txt and pass in results.
We can see it works in recovery.log
I:Set page: 'install'
I:Set page: 'flash_confirm'
I:Set page: 'flash_zip'
Iperation_start: 'Flashing'
Installing zip file '/external_sd/Custom Rom/test.zip'
Checking for Digest file...
Skipping Digest check: no Digest file found
I:Update binary zip
Verifying package compatibility...
Package doesn't contain compatibility.zip entry
I:Zip does not contain SELinux file_contexts file in its root.
I:has_legacy_properties: Found legacy property match!
I:Legacy property environment initialized.
*************************
sh10
*************************
unmount of /system failed; no such volume
about to run program [/sbin/busybox] with 3 args
about to run program [/sbin/busybox] with 3 args
minzip: Extracted file "/tmp/test.sh"
about to run program [/tmp/test.sh] with 1 args
$ echo Delete YouTube, using exe echo
Delete YouTube, using exe echo
hello world !, using echo
Delete YouTube, using echo
hello world, using printfsh: : unknown operand
hello world! using ui_print
END OF PROCESS
*************************
script result was [/system]
I:Updater process ended with RC=0
I:Legacy property environment disabled.
I:Install took 0 second(s).
Updating partition details...
I:mount -o bind '/data/media/0' '/sdcard' process ended with RC=0
Someone has an idea why echo doesn't print on screen in TWRP recovery; else it works...
weird for me
Click to expand...
Click to collapse
You are probably going to have to go in a little different direction. See this thread where update-binary is used in place of update-script.
Tulsadiver said:
You are probably going to have to go in a little different direction. See this thread where update-binary is used in place of update-script.
Click to expand...
Click to collapse
Thanks for your answer but could you add the link
kramer04 said:
Thanks for your answer but could you add the link
Click to expand...
Click to collapse
Sorry, lol!
https://forum.xda-developers.com/an...-complete-shell-script-flashable-zip-t2934449
Tulsadiver said:
Sorry, lol!
https://forum.xda-developers.com/an...-complete-shell-script-flashable-zip-t2934449
Click to expand...
Click to collapse
Thanks, but this isn't exactly what i'm looking for even if it's very interesting.
I would like to know how to display on recovery screen
I tryed with echo command but it doesn't work
For example running this script in sh file on recovery TWRP
Code:
#!/sbin/sh
csc_id=`cat /efs/imei/mps_code.dat`
echo "==== Your active csc is $csc_id ====="
echo do displays this
==== Your active csc is BTU ====
on recovery screen
but not displays anything.
Is there a way to activate it ?
kramer04 said:
Thanks, but this isn't exactly what i'm looking for even if it's very interesting.
I would like to know how to display on recovery screen
I tryed with echo command but it doesn't work
For example running this script in sh file on recovery TWRP
Code:
#!/sbin/sh
csc_id=`cat /efs/imei/mps_code.dat`
echo "==== Your active csc is $csc_id ====="
echo do displays this
==== Your active csc is BTU ====
on recovery screen
but not displays anything.
Is there a way to activate it ?
Click to expand...
Click to collapse
Echo has never worked on my phones. ui_print works on my pixel and pixel 2. It stopped working on my pixel 3 XL but that is because I haven't found a way to mount system using toybox. Pixel 3 XL won't mount using BusyBox.
Tulsadiver said:
Echo has never worked on my phones. ui_print works on my pixel and pixel 2. It stopped working on my pixel 3 XL but that is because I haven't found a way to mount system using toybox. Pixel 3 XL won't mount using BusyBox.
Click to expand...
Click to collapse
I know echo works because i see it in recovery log but it doesn't display anything on recovery screen
And i don't understand why;
Maybe it's because of recovery ?
I use TWRP
kramer04 said:
I know echo works because i see it in recovery log but it doesn't display anything on recovery screen
And i don't understand why;
Maybe it's because of recovery ?
I use TWRP
Click to expand...
Click to collapse
Most everyone uses TWRP. I believe for recovery screen, echo must be passed on to ui_print. Try this for an explanation:
https://forum.xda-developers.com/showthread.php?t=1023150&page=1
Tulsadiver said:
Most everyone uses TWRP. I believe for recovery screen, echo must be passed on to ui_print. Try this for an explanation:
https://forum.xda-developers.com/showthread.php?t=1023150&page=1
Click to expand...
Click to collapse
yes. totaly true
finaly i resolved my problem using code from Chainfire
Code:
#!/sbin/sh
OUTFD=1
readlink /proc/$$/fd/$OUTFD 2>/dev/null | grep /tmp >/dev/null
if [ "$?" -eq "0" ]; then
# rerouted to log file, we don't want our ui_print commands going there
OUTFD=0
# we are probably running in embedded mode, see if we can find the right fd
# we know the fd is a pipe and that the parent updater may have been started as
# 'update-binary 3 fd zipfile'
for FD in `ls /proc/$$/fd`; do
readlink /proc/$$/fd/$FD 2>/dev/null | grep pipe >/dev/null
if [ "$?" -eq "0" ]; then
ps | grep " 3 $FD " | grep -v grep >/dev/null
if [ "$?" -eq "0" ]; then
OUTFD=$FD
break
fi
fi
done
fi
ui_print() {
echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD
}
Thanks to all
https://forum.xda-developers.com/android/software-hacking/dev-complete-shell-script-flashable-zip-t2934449/page37
kramer04 said:
yes. totaly true
finaly i resolved my problem using code from Chainfire
Code:
#!/sbin/sh
OUTFD=1
readlink /proc/$$/fd/$OUTFD 2>/dev/null | grep /tmp >/dev/null
if [ "$?" -eq "0" ]; then
# rerouted to log file, we don't want our ui_print commands going there
OUTFD=0
# we are probably running in embedded mode, see if we can find the right fd
# we know the fd is a pipe and that the parent updater may have been started as
# 'update-binary 3 fd zipfile'
for FD in `ls /proc/$$/fd`; do
readlink /proc/$$/fd/$FD 2>/dev/null | grep pipe >/dev/null
if [ "$?" -eq "0" ]; then
ps | grep " 3 $FD " | grep -v grep >/dev/null
if [ "$?" -eq "0" ]; then
OUTFD=$FD
break
fi
fi
done
fi
ui_print() {
echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD
}
Thanks to all
https://forum.xda-developers.com/android/software-hacking/dev-complete-shell-script-flashable-zip-t2934449/page37
Click to expand...
Click to collapse
That works on my pixel and pixel 2 but not my pixel 3 XL. But on my pixel 3 XL I also have to use toybox to mount instead of BusyBox
run_program("/sbin/toybox", "mount", "/system");