Script to create swapfile - Android

I save this code as ramswap.sh.. but when I try to execute using Terminal emulator with permission of course, it gives me error
Code:
dd if=/dev/zero of=/mnt/sdcard/swapfile bs=1048576 count=300
mkswap /mnt/sdcard/swapfile
swapon /mnt/sdcard/swapfile
echo "vm.swappiness=80" >> /etc/sysctl.conf
sysctl -p
echo "#!/system/bin/sh" >> /etc/init.d/99swapon
echo "sleep 75" >> /etc/init.d/99swapon
echo "swapon /mnt/sdcard/swapfile" >> /etc/init.d/99swapon
echo "sysctl -p" >> /etc/init.d/99swapon

Related

[Q] init.d --> semicolon use?

Hi everyone,
I have just one question to ask:
In every init.d file that I've found, it's been divided-- some lines are with semicolons, others are one. Most have both, which confuses me greatly...
AND they're right next to each other; for example, in the Pimp My Rom tweaks,
The S10vm tweak has all but one semicolon-ed:
Code:
#!/system/bin/sh
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
In the S36iosched file, almost none are semicoloned:
Code:
#!/system/bin/sh
mount -o remount,rw /sys /sys;
mount -o remount,rw /system /system;
echo 2 > /sys/block/mmcblk0/queue/iosched/fifo_batch
echo 2230 > /sys/block/mmcblk0/queue/iosched/write_expire
echo 300 > /sys/block/mmcblk0/queue/iosched/read_expire
echo 2230 > /sys/block/mmcblk0/queue/iosched/async_write_expire
echo 300 > /sys/block/mmcblk0/queue/iosched/async_read_expire
echo 2 > /sys/block/mmcblk0/queue/iosched/writes_starved
echo 2230 > /sys/block/mmcblk0/queue/iosched/sync_write_expire
echo 300 > /sys/block/mmcblk0/queue/iosched/sync_read_expire
mount -o remount,ro /system /system
mount -o remount,ro /sys /sys
It's driving me nuts (I'm compiling my own init.d file) and I'm not sure whether to include the semicolon or not >__>
Thanks for your definitive response; it is very much appreciated!
The semicolon is a command separator. If command are separated by a new line, you don't need a semicolon. Inserting one won't make any difference.
Sent from my Nexus 7
BillGoss said:
The semicolon is a command separator. If command are separated by a new line, you don't need a semicolon. Inserting one won't make any difference.
Sent from my Nexus 7
Click to expand...
Click to collapse
Okay, thanks for your response! It's much clearer now.

[RECOVERY][ALL MDPI][ALL FIRMWARE VERSIONS] Unofficial TWRP 2.3.3.0 [WIP]

Hey guys,
This is a development project I'm working on, so please read everything carefully! I would really appreciate if you keep this thread clean, because this thread should be for developers (even if I'm not a dev ). So please don't post the same questions again and again and read the FAQ, too. If you like this or you want to tell me too keep this up, please just hit thanks and don't comment "Thank you"
Unofficial TWRP 2.3.3.0
First of all, what is TWRP?
Team Win Recovery Project 2.3, or twrp2 for short, is a custom recovery built with ease of use and customization in mind. We started from the ground up by taking AOSP recovery and loading it with the standard recovery options, then added a lot of our own features. It’s a fully touch driven user interface – no more volume rocker or power buttons to mash. The GUI is also fully XML driven and completely theme-able. You can change just about every aspect of the look and feel.
Click to expand...
Click to collapse
{
"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"
}
I built a recovery.img for testing on the xperia 2011 mdpi devices. If you want to test if, flash any kernel and after this flash the recovery.img. Flash it with flashtool or with
Code:
fastboot flash boot recovery.img
Once you have done this unplug phone and just start it, it will automatically start in TeamWinRecovery. And THIS is the biggest bug, it's unable to boot the rom (/system). I'm waiting for advice how to fix this
So if you want to try it, what's and what's not working?
Working:
Touch
Flashing Files
ADB Sideload - New!
Backup
Restore
Wiping Cache/Dalvik Cache
File Manager
Times
Settings
Mount USB - Script Rebased! NEW!
Terminal Command
Onscreen Keyboard
Locking Phone in Recovery
Reboot into Recovery
Reboot into Bootloader
Recognized as adb device
Click to expand...
Click to collapse
What's not working:
Booting in the rom
Click to expand...
Click to collapse
If you find any bugs, please tell me that I can update the list
2.3.3.0:
To download the recovery.img for mango please go here
To download the recovery.img for coconut please go here
To download the recovery.img for smultron please go "here
To download the recovery.img for satsuma please go here
For a detailed Changelog see this!
2.2.2.1:
To download the recovery.img for mango please go here
To download the recovery.img for coconut please go here
To download the recovery.img for smultron please gohere
To download the recovery.img for satsuma please gohere
Please read the FAQ in the 2nd post, too!
FAQ
Will you make this for my device, too?
- This for the xperia 2011 mdpi line, I published it for all devices
The rom is not booting after flashing this!
- Please read the OP, it will directly boot in TeamWinRecovery
Thank you!
- I would be happy if you could just hit thanks instead of commenting
On which kernel can I use this?
- On all kernels with all the android versions (gingerbread, ics, jellybean 4.1, jellybean 4.2) it worked :good:
May I integrated this in my kernel?
- Yes you may of course, but it would be great if you could link to this thread and give credits to me. But remember that you can't use this for your kernel atm because it won't boot!
Credits to:
singh_dd93
an0nym0use_
mericon
M66B
boot into recovery automatically
the key mapped the recovery is the cause of automatic login to recovery . You need to figure out which key the recovery is using.
I have ported recovery into another devices(Neo L) faced the same issue I remapped the key and it will work.
Good luck
I think your current keymap is happening to screen so whenever screen get activated(default when boots) it redirect to Recovery)
b00tbu9 said:
the key mapped the recovery is the cause of automatic login to recovery . You need to figure out which key the recovery is using.
I have ported recovery into another devices(Neo L) faced the same issue I remapped the key and it will work.
Good luck
Click to expand...
Click to collapse
So could you explaine this please. It should go to recovery with the volume down key. How/Where should I edit this?
mihahn said:
So could you explaine this please. It should go to recovery with the volume down key. How/Where should I edit this?
Click to expand...
Click to collapse
Edit must be done at RamDisk level. In ramDisk sbin/bootrec file you have to modify for Ramdisk to work
Sample boot-rec file
Code:
#!/sbin/sh
setprop service.adb.root 1
[B]if [ -e /sbin/bootrec-device ][/B]
then
[B] /sbin/bootrec-device[/B]
fi
[B]if [ -s /dev/keycheck -o -e /cache/recovery/boot ][/B]
then
echo 0 > /sys/class/android_usb/android0/enable
echo 0fce > /sys/class/android_usb/android0/idVendor
echo 614f > /sys/class/android_usb/android0/idProduct
echo "mass_storage,adb" > /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable
stop adbd
rm /cache/recovery/boot
mount -o remount,rw rootfs /
umount -l /system
umount -l /data
umount -l /cache
umount -l /mnt/sdcard
rm -r /sdcard
rm -r /not/sdcard
mkdir /sdcard
mkdir /tmp
rm /etc
mkdir /etc
cp /recovery.fstab /etc/recovery.fstab
mount /dev/block/mmcblk0p1 /sdcard
/sbin/recovery&
fi
/system/bin/chargemon
#continue booting
sample bootrec-device code
Code:
#!/sbin/sh
# fixing CPU clocks to avoid issues in recovery
echo 1024000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 122000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 0 > /sys/class/android_usb/android0/enable
echo 0FCE > /sys/class/android_usb/android0/idVendor
echo 615D > /sys/class/android_usb/android0/idProduct
echo mass_storage,adb > /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable
stop adbd
# trigger amber LED
echo '255' > /sys/class/leds/blue/brightness
echo '255' > /sys/class/leds/red/brightness
echo '0' > /sys/class/leds/green/brightness
# trigger button-backlight
echo '255' > /sys/class/leds/button-backlight/brightness
cat /dev/input/event1 > /dev/keycheck&
sleep 3
# trigger amber LED
echo '0' > /sys/class/leds/blue/brightness
echo '0' > /sys/class/leds/red/brightness
echo '0' > /sys/class/leds/green/brightness
# trigger button-backlight
[B][U]echo '0' > /sys/class/leds/button-backlight/brightness[/U][/B]
kill -9 $!
this is what worked with me when I integrated CWM in Neo L... just give it a try..
b00tbu9 said:
Edit must be done at RamDisk level. In ramDisk sbin/bootrec file you have to modify for Ramdisk to work
Click to expand...
Click to collapse
Thanks, I tried (as you told me in the PM) the ramdisk of another kernel but couldn't flash it and boot in the rom. I will try it with your files and report. Many thanks
mihahn said:
Thanks, I tried (as you told me in the PM) the ramdisk of another kernel but couldn't flash it and boot in the rom. I will try it with your files and report. Many thanks
Click to expand...
Click to collapse
I was working on ramdisk the whole night so I can help you
search for line like this
Code:
cat /dev/input/event2 > /dev/keycheck&
for volume down key you have to change the event# to event2 as shown
singh_dd93 said:
I was working on ramdisk the whole night so I can help you
search for line like this
Code:
cat /dev/input/event2 > /dev/keycheck&
for volume down key you have to change the event# to event2 as shown
Click to expand...
Click to collapse
I don't know why it's not working!
My bootrec-device (in out/target/product/mango/recovery/root/sbin):
Code:
#!/sbin/sh
# fixing CPU clocks to avoid issues in recovery
echo 1024000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 122000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 0 > /sys/class/android_usb/android0/enable
echo 0FCE > /sys/class/android_usb/android0/idVendor
echo 6166 > /sys/class/android_usb/android0/idProduct
echo mass_storage,adb > /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable
stop adbd
# trigger amber LED
echo '255' > /sys/class/leds/blue/brightness
echo '255' > /sys/class/leds/red/brightness
echo '0' > /sys/class/leds/green/brightness
# trigger button-backlight
echo '255' > /sys/class/leds/button-backlight/brightness
cat /dev/input/event2 > /dev/keycheck&
sleep 3
# trigger amber LED
echo '0' > /sys/class/leds/blue/brightness
echo '0' > /sys/class/leds/red/brightness
echo '0' > /sys/class/leds/green/brightness
# trigger button-backlight
echo '0' > /sys/class/leds/button-backlight/brightness
kill -9 $!
And my bootrec (in the same directory)
Code:
#!/sbin/sh
setprop service.adb.root 1
if [ -e /sbin/bootrec-device ]
then
/sbin/bootrec-device
fi
if [ -s /dev/keycheck -o -e /cache/recovery/boot ]
then
echo 0 > /sys/class/android_usb/android0/enable
echo 0fce > /sys/class/android_usb/android0/idVendor
echo 614f > /sys/class/android_usb/android0/idProduct
echo "mass_storage,adb" > /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable
stop adbd
rm /cache/recovery/boot
mount -o remount,rw rootfs /
umount -l /system
umount -l /data
umount -l /cache
umount -l /mnt/sdcard
rm -r /sdcard
rm -r /not/sdcard
mkdir /sdcard
mkdir /tmp
rm /etc
mkdir /etc
cp /recovery.fstab /etc/recovery.fstab
mount /dev/block/mmcblk0p1 /sdcard
/sbin/recovery&
fi
/system/bin/chargemon
#continue booting
So after flashing the recovery.img it just shows the FreeXperia logo and goes into recovery
Remove this from bootrec and add to bootrec-device
Code:
if [ -s /dev/keycheck -o -e /cache/recovery/boot ]
then
echo 0 > /sys/class/android_usb/android0/enable
echo 0fce > /sys/class/android_usb/android0/idVendor
echo 614f > /sys/class/android_usb/android0/idProduct
echo "mass_storage,adb" > /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable
stop adbd
rm /cache/recovery/boot
mount -o remount,rw rootfs /
umount -l /system
umount -l /data
umount -l /cache
umount -l /mnt/sdcard
rm -r /sdcard
rm -r /not/sdcard
mkdir /sdcard
mkdir /tmp
rm /etc
mkdir /etc
cp /recovery.fstab /etc/recovery.fstab
mount /dev/block/mmcblk0p1 /sdcard
/sbin/recovery&
fi
add these lines at the end after kill -9 line
singh_dd93 said:
Remove this from bootrec and add to bootrec-device
Code:
if [ -s /dev/keycheck -o -e /cache/recovery/boot ]
then
echo 0 > /sys/class/android_usb/android0/enable
echo 0fce > /sys/class/android_usb/android0/idVendor
echo 614f > /sys/class/android_usb/android0/idProduct
echo "mass_storage,adb" > /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable
stop adbd
rm /cache/recovery/boot
mount -o remount,rw rootfs /
umount -l /system
umount -l /data
umount -l /cache
umount -l /mnt/sdcard
rm -r /sdcard
rm -r /not/sdcard
mkdir /sdcard
mkdir /tmp
rm /etc
mkdir /etc
cp /recovery.fstab /etc/recovery.fstab
mount /dev/block/mmcblk0p1 /sdcard
/sbin/recovery&
fi
add these lines at the end after kill -9 line
Click to expand...
Click to collapse
Thanks, but the problem is when I edit this and compile again without doing
Code:
make clean
it will use the other files again. It won't just pack it, it will create these two files again. And I don't know how to pack the recoveryimage with another tool
Okay I unpacked, changed and repacked the recovery image using this tool, but it still goes straight into recovery when I flash it over cm9 kernel. Btw I didn't pack the cm9 kernel by myself, I took an older one from FXP. If I pack it the boot.img usin
Code:
make -j1 bootimage
the boot.img won't start in any recovery or else
Any other suggestions guys? We are very near! :good:
all the best
I did compile it once but was stuck at same place.. i have to restore grub..upgraded win8 .. will try to help.
mihahn said:
Thanks, but the problem is when I edit this and compile again without doing
Code:
make clean
it will use the other files again. It won't just pack it, it will create these two files again. And I don't know how to pack the recoveryimage with another tool
Click to expand...
Click to collapse
did not understand you
Do you mean that it automatically add those lines in bootrec??
if yes then add this line to bootrec
Code:
cat /dev/input/event2 > /dev/keycheck&
your final bootrec will look like this
Code:
#!/sbin/sh
setprop service.adb.root 1
if [ -e /sbin/bootrec-device ]
then
/sbin/bootrec-device
fi
cat /dev/input/event2 > /dev/keycheck&
if [ -s /dev/keycheck -o -e /cache/recovery/boot ]
then
echo 0 > /sys/class/android_usb/android0/enable
echo 0fce > /sys/class/android_usb/android0/idVendor
echo 614f > /sys/class/android_usb/android0/idProduct
echo "mass_storage,adb" > /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable
stop adbd
rm /cache/recovery/boot
mount -o remount,rw rootfs /
umount -l /system
umount -l /data
umount -l /cache
umount -l /mnt/sdcard
rm -r /sdcard
rm -r /not/sdcard
mkdir /sdcard
mkdir /tmp
rm /etc
mkdir /etc
cp /recovery.fstab /etc/recovery.fstab
mount /dev/block/mmcblk0p1 /sdcard
/sbin/recovery&
fi
/system/bin/chargemon
#continue booting
Yes the line will automaticly be added to the recovery.img if I build it with
Code:
make -j1 recoveryimage
If I flash this image now over the boot.img from cm9 with
Code:
fastboot flash boot recovery.img
it starts in the recovery automatically.
If I run
Code:
make -j1 bootimage
It builds a boot.img but if I flash it, it does nothing. FXP logo appears and it won't go on
Thanks for the new bootrec script, what about the bootrec-device, can you post this, too?
That's my bootrec-device:
Code:
#!/sbin/sh
# fixing CPU clocks to avoid issues in recovery
echo 1024000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 122000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 0 > /sys/class/android_usb/android0/enable
echo 0FCE > /sys/class/android_usb/android0/idVendor
echo 6166 > /sys/class/android_usb/android0/idProduct
echo mass_storage,adb > /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable
stop adbd
# trigger amber LED
echo '255' > /sys/class/leds/blue/brightness
echo '255' > /sys/class/leds/red/brightness
echo '0' > /sys/class/leds/green/brightness
# trigger button-backlight
echo '255' > /sys/class/leds/button-backlight/brightness
cat /dev/input/event2 > /dev/keycheck&
sleep 3
# trigger amber LED
echo '0' > /sys/class/leds/blue/brightness
echo '0' > /sys/class/leds/red/brightness
echo '0' > /sys/class/leds/green/brightness
# trigger button-backlight
echo '0' > /sys/class/leds/button-backlight/brightness
kill -9 $!
if [ -s /dev/keycheck -o -e /cache/recovery/boot ]
then
echo 0 > /sys/class/android_usb/android0/enable
echo 0fce > /sys/class/android_usb/android0/idVendor
echo 614f > /sys/class/android_usb/android0/idProduct
echo "mass_storage,adb" > /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable
stop adbd
rm /cache/recovery/boot
mount -o remount,rw rootfs /
umount -l /system
umount -l /data
umount -l /cache
umount -l /mnt/sdcard
rm -r /sdcard
rm -r /not/sdcard
mkdir /sdcard
mkdir /tmp
rm /etc
mkdir /etc
cp /recovery.fstab /etc/recovery.fstab
mount /dev/block/mmcblk0p1 /sdcard
/sbin/recovery&
fi
let it remain same
and try
singh_dd93 said:
let it remain same
and try
Click to expand...
Click to collapse
Here's my ramdisk folder of the recovery.img
With this configuration it's not booting after flashing over cm9 kernel...
Sorry if you sometimes can't understand what I mean, because English is not my native language
I will check when I get back home now. Am out for some work
Sent from my SK17i using xda app-developers app
singh_dd93 said:
I will check when I get back home now. Am out for some work
Sent from my SK17i using xda app-developers app
Click to expand...
Click to collapse
Thanks, you are great! Only 8 thanks for one day
Okay I uploaded the other MDPI devices, but remember, that you can't boot in your rom!
Someone who has a mini, active or lww could report here if he can boot in the recovery
Rebased the whole Recovery on 2.3.3.0
Rom still not booting, hope you can help me. My current ramdisk folder can be found here!

[Q] scripts for change build.prop

hi
i need a script for edit build.prop
i want a script that change lines and add them if they don't exist
http://forum.xda-developers.com/showpost.php?p=19093919&postcount=20
http://forum.xda-developers.com/showpost.php?p=25977898&postcount=15
but i can't understand why they don't work
i find this way and this works good with gscript but not work from cwm
simple sed method:
Code:
#!/bin/bash
sed -i '/linetobereplaced/c\replacedline.' /system/build.prop
EAGLEBOOY said:
hi
i need a script for edit build.prop
i want a script that change lines and add them if they don't exist
http://forum.xda-developers.com/showpost.php?p=19093919&postcount=20
http://forum.xda-developers.com/showpost.php?p=25977898&postcount=15
but i can't understand why they don't work
i find this way and this works good with gscript but not work from cwm
simple sed method:
Code:
#!/bin/bash
sed -i '/linetobereplaced/c\replacedline.' /system/build.prop
Click to expand...
Click to collapse
Yes I have been struggling with this one for a while and just had another look at the issues we face today
.... the answer is so simple you will kick yourself
The UnCoRuPtEd script needs a simple file replacing
Its the update-binary that is the issue, make sure you use the correct file for your mobile and put it into the META-INF\com\google\android
Mine now works a treat
This will help you
http://www.mediafire.com/download/bq910l5ww1zs2di/5.zip
Note the two parts
META-INF\com\google\android\updater-script
Code:
package_extract_file("MoHaMaD_tweaks.sh", "/tmp/MoHaMaD_tweaks.sh");
set_perm(0, 0, 0777, "/tmp/MoHaMaD_tweaks.sh");
run_program("/tmp/MoHaMaD_tweaks.sh", "");
and MoHaMaD_tweaks.sh
Code:
#!/sbin/sh
mkdir /sdcard/MoHaMaD
mkdir /sdcard/MoHaMaD/init.d_backup
cp /system/etc/init.d/* /sdcard/MoHaMaD/init.d_backup
cp /system/build.prop /sdcard/MoHaMaD/build.prop
echo "###################################" >> /system/build.prop
echo "##Build.prop tweaks edit MoHaMaD ##" >> /system/build.prop
echo "###################################" >> /system/build.prop
echo "persist.adb.notify=0" >> /system/build.prop
echo "persist.sys.usb.config=mass_storage,adb" >> /system/build.prop
echo "persist.sys.purgeable_assets=1" >> /system/build.prop
echo "wifi.supplicant_scan_interval=180" >> /system/build.prop
echo "windowsmgr.max_events_per_sec=200" >> /system/build.prop
echo "pm.sleep_mode=1" >> /system/build.prop
echo "ro.ril.disable.power.collapse=0" >> /system/build.prop
echo "ro.media.enc.jpeg.quality=100" >> /system/build.prop
echo "video.accelerate.hw=1" >> /system/build.prop
echo "debug.performance.tuning=1" >> /system/build.prop
echo "ro.kernel.android.checkjni=0" >> /system/build.prop
echo "ro.kernel.checkjni=0" >> /system/build.prop
echo "logcat.live=disable" >> /system/build.prop
echo "ro.config.nocheckin=1" >> /system/build.prop
echo "profiler.force_disable_err_rpt=1" >> /system/build.prop
echo "profiler.force_disable_ulog=1" >> /system/build.prop
echo "ro.HOME_APP_ADJ=1" >> /system/build.prop
echo "ro.mot.eri.losalert.delay=1000" >> /system/build.prop
sed -i 's/ro.product.locale.excluded=ar_EG ar_IL fa_IR iw_IL/ro.product.locale.excluded=ar_EG ar_IL iw_IL/g' /system/build.prop
rm -r /data/dalvik-cache/*
.MoHaMaD said:
This will help you
http://www.mediafire.com/download/bq910l5ww1zs2di/5.zip
Note the two parts
META-INF\com\google\android\updater-script
Code:
package_extract_file("MoHaMaD_tweaks.sh", "/tmp/MoHaMaD_tweaks.sh");
set_perm(0, 0, 0777, "/tmp/MoHaMaD_tweaks.sh");
run_program("/tmp/MoHaMaD_tweaks.sh", "");
and MoHaMaD_tweaks.sh
Code:
#!/sbin/sh
mkdir /sdcard/MoHaMaD
mkdir /sdcard/MoHaMaD/init.d_backup
cp /system/etc/init.d/* /sdcard/MoHaMaD/init.d_backup
cp /system/build.prop /sdcard/MoHaMaD/build.prop
echo "###################################" >> /system/build.prop
echo "##Build.prop tweaks edit MoHaMaD ##" >> /system/build.prop
echo "###################################" >> /system/build.prop
echo "persist.adb.notify=0" >> /system/build.prop
echo "persist.sys.usb.config=mass_storage,adb" >> /system/build.prop
echo "persist.sys.purgeable_assets=1" >> /system/build.prop
echo "wifi.supplicant_scan_interval=180" >> /system/build.prop
echo "windowsmgr.max_events_per_sec=200" >> /system/build.prop
echo "pm.sleep_mode=1" >> /system/build.prop
echo "ro.ril.disable.power.collapse=0" >> /system/build.prop
echo "ro.media.enc.jpeg.quality=100" >> /system/build.prop
echo "video.accelerate.hw=1" >> /system/build.prop
echo "debug.performance.tuning=1" >> /system/build.prop
echo "ro.kernel.android.checkjni=0" >> /system/build.prop
echo "ro.kernel.checkjni=0" >> /system/build.prop
echo "logcat.live=disable" >> /system/build.prop
echo "ro.config.nocheckin=1" >> /system/build.prop
echo "profiler.force_disable_err_rpt=1" >> /system/build.prop
echo "profiler.force_disable_ulog=1" >> /system/build.prop
echo "ro.HOME_APP_ADJ=1" >> /system/build.prop
echo "ro.mot.eri.losalert.delay=1000" >> /system/build.prop
sed -i 's/ro.product.locale.excluded=ar_EG ar_IL fa_IR iw_IL/ro.product.locale.excluded=ar_EG ar_IL iw_IL/g' /system/build.prop
rm -r /data/dalvik-cache/*
Click to expand...
Click to collapse
aaaahhhh but does the above script check for any entries already there to avoid duplicate entries in the build.prop
the script from UnCoRupTeD here http://forum.xda-developers.com/showpost.php?p=19093919&postcount=20
will make a backup of the build.prop and replace any entries found with the new ones
In my opinion UnCorUpTeD's script is better for the non-experts among us

[SCRIPTS][INIT.D] KangBang Kernel [DEVELOPMENT]

KangBang Kernel Scripts Development
This thread is dedicated to the development of bash scripts to control several aspects of KangBang Kernel.
The scripts below, are there for that. most of the work have been done already (but more additions to be made), but be are with problems on the logs files... the output indicates that the scripts are giving errors...
these are scripts so far​
S91voltctrl​
Spoiler
Code:
#!/system/bin/sh
##############################################################
## CPU/GPU Voltage and Frequency Control script by infected_ #
##############################################################
LOG_FILE=/data/log/cpu_gpu_control.log
rm -Rf $LOG_FILE
exec &> $LOG_FILE
# ************************************
# CPU Clock Control
# ************************************
echo "Starting Voltage and Frequency Control $( date +"%m-%d-%Y %H:%M:%S" )"
echo "Sleeping for 20 seconds to workaround oc not setting properly on stock derivatve roms..."
sleep 20
echo "Ok lets start working"
echo "Set MIN Scaling Frequency"
echo "200000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo ""
echo "---------------"
echo "Set MAX Scaling Frequency"
echo "1000000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo ""
echo "---------------"
# ************************************
# CPU Governor and I/O Scheduler
# ************************************
echo "Set Scheduler for stl, bml and mmc"
for i in `ls /sys/block/stl*` /sys/block/bml* /sys/block/mmcblk* /sys/block/mtdblock* ; do
echo "zen" > $i/queue/scheduler;
echo "$i/queue/scheduler";
done;
echo "---------------";
echo "Set governor"
echo "zzmoove" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ""
echo "---------------"
#
echo "Set zzmove extra options"
# *************************************
# "zzmove" cpu governor extra settings
# *************************************
echo "85" > /sys/devices/system/cpu/cpufreq/zzmoove/up_threshold;
echo "85" > /sys/devices/system/cpu/cpufreq/zzmoove/up_threshold_hotplug1;
echo "80" > /sys/devices/system/cpu/cpufreq/zzmoove/down_threshold;
echo "75" > /sys/devices/system/cpu/cpufreq/zzmoove/down_threshold_hotplug1;
echo "85" > /sys/devices/system/cpu/cpufreq/zzmoove/down_threshold_sleep;
echo "5" > /sys/devices/system/cpu/cpufreq/zzmoove/freq_step;
echo "1" > /sys/devices/system/cpu/cpufreq/zzmoove/hotplug_sleep;
echo "4" > /sys/devices/system/cpu/cpufreq/zzmoove/sampling_down_factor;
echo "100000" > /sys/devices/system/cpu/cpufreq/zzmoove/sampling_rate;
echo "500000" > /sys/devices/system/cpu/cpufreq/zzmoove/freq_limit_sleep;
echo "75" > /sys/devices/system/cpu/cpufreq/zzmoove/smooth_up;
echo "95" > /sys/devices/system/cpu/cpufreq/zzmoove/up_threshold_sleep;
# ************************************
# CPU Voltage Control
# ************************************
echo "Set UV" | tee -a $LOG_FILE;
echo "1275 1250 1200 1175 1150 1100 1050 1000 950 900 875 925 850 850 825 825 800 775" > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table #change voltages according to your device !!!
echo ""
echo "---------------"
# ************************************
# Screen Off CPU Policy
# ************************************
# Disable second CPU core when screen is off (default 0=second core enabled)
echo "Disable second CPU core when screen is off"
echo "1" /sys/devices/system/cpu/cpufreq/zzmoove/hotplug_sleep;
echo ""
echo "---------------"
# ************************************
# GPU Clock, Voltages & Thresholds
# ************************************
# Set GPU clocks (Valid values are: 100 160 200 267)
echo "Set GPU frequencies"
echo "100 160 267" > /sys/class/misc/gpu_clock_control/gpu_control;
echo ""
echo "---------------"
# Set GPU Up and Down thresholds
echo "Set GPU thresholds"
echo "80% 50% 85% 60%" > /sys/class/misc/gpu_clock_control/gpu_control;
echo ""
echo "---------------"
# Set GPU voltages (Changes possible at +/-50mV ie at 50000 steps)
echo "Set GPU UV"
echo "850000 900000 950000" > /sys/class/misc/gpu_voltage_control/gpu_control;
echo ""
echo "---------------"
#
echo "Voltage and Frequency Control finished at $( date +"%m-%d-%Y %H:%M:%S" )"
S92zipalign (credits goes to darky for original)​
Spoiler
Code:
#!/system/bin/sh
##############################################################
## Automatic ZipAlign script by infected_ #
##############################################################
su
LOG_FILE=/data/log/zipalign.log
rm -Rf $LOG_FILE
exec &> $LOG_FILE
#
if [ -n $zipalign ] && [ $zipalign = "true" ];
then
busybox mount -o remount,rw /;
busybox mount -o remount,rw -t auto /system;
busybox mount -o remount,rw -t auto /data;
fi;
busybox mount -t tmpfs -o size=70m none /mnt/tmp;
echo "Starting Automatic ZipAlign " `date`
echo "Starting Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )"
for apk in /data/app/*.apk ; do
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
echo ZipAligning $(basename $apk)
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed
fi;
else
echo ZipAlign already completed on $apk
fi;
done;
for apk in /system/app/*.apk ; do
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
echo ZipAligning $(basename $apk)
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed
fi;
else
echo ZipAlign already completed on $apk
fi;
done;
for apk in /system/framework/*.apk ; do
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
echo ZipAligning $(basename $apk)
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed
fi;
else
echo ZipAlign already completed on $apk
fi;
done;
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )"
S93sqlite​
Spoiler
Code:
#!/system/bin/sh
##############################################################
## SQLite database VACUUM and REINDEX script by infected_ #
##############################################################
LOG_FILE=/data/log/sqlite.log
rm -Rf $LOG_FILE
exec &> $LOG_FILE
# echo "";
echo "*********************************************";
echo "Optimizing and defragging your database files (*.db)";
echo "Ignore the 'database disk image is malformed' error";
echo "Ignore the 'no such collation sequence' error";
echo "*********************************************";
echo "";
#
#
echo "SQLite database VACUUM and REINDEX started at $( date +"%m-%d-%Y %H:%M:%S" )"
for i in \
`busybox find /data -iname "*.db"`;
do \
/system/xbin/sqlite3 $i 'VACUUM;';
/system/xbin/sqlite3 $i 'REINDEX;';
done;
if [ -d "/dbdata" ]; then
for i in \
`busybox find /dbdata -iname "*.db"`;
do \
/system/xbin/sqlite3 $i 'VACUUM;';
/system/xbin/sqlite3 $i 'REINDEX;';
done;
fi;
if [ -d "/datadata" ]; then
for i in \
`busybox find /datadata -iname "*.db"`;
do \
/system/xbin/sqlite3 $i 'VACUUM;';
/system/xbin/sqlite3 $i 'REINDEX;';
done;
fi;
for i in \
`busybox find /sdcard -iname "*.db"`;
do \
/system/xbin/sqlite3 $i 'VACUUM;';
/system/xbin/sqlite3 $i 'REINDEX;';
done;
echo "SQLite database VACUUM and REINDEX finished at $( date +"%m-%d-%Y %H:%M:%S" )"
S94tweaks​
Code:
#!/system/bin/sh
##############################################################
## Miscellaneous Tweaks script by infected_ #
##############################################################
#
LOG_FILE=/data/log/tweaks.log
rm -Rf $LOG_FILE
exec &> $LOG_FILE
#
echo "Applying Tweaks $( date +"%m-%d-%Y %H:%M:%S" )"
#
# ***************************************
# Turn logging off
# ***************************************
#
echo "Turning off logging"
su
mount -o remount,rw /
rm -rf /dev/log
echo "0" > /sys/module/ump/parameters/ump_debug_level
echo "0" > /sys/module/mali/parameters/mali_debug_level
echo "0" > /sys/module/kernel/parameters/initcall_debug
echo "0" > /sys//module/lowmemorykiller/parameters/debug_level
echo "0" > /sys/module/earlysuspend/parameters/debug_mask
echo "0" > /sys/module/alarm/parameters/debug_mask
echo "0" > /sys/module/alarm_dev/parameters/debug_mask
echo "0" > /sys/module/binder/parameters/debug_mask
echo "0" > /sys/module/xt_qtaguid/parameters/debug_mask
echo ""
echo "---------------"
# ************************************************
# VM Tweaks
# ************************************************
echo "Enabling VM Tweaks"
sysctl -w vm.swappiness=0
sysctl -w vm.vfs_cache_pressure=10
sysctl -w vm.dirty_background_ratio=45
sysctl -w vm.dirty_ratio=50
sysctl -w vm.dirty_writeback_centisecs=2000
sysctl -w vm.dirty_expire_centisecs=1000
sysctl -w vm.min_free_kbytes=4096
sysctl -w kernel.sched_min_granularity_ns=200000 > /dev/null
sysctl -w kernel.sched_latency_ns=400000 > /dev/null
sysctl -w kernel.sched_wakeup_granularity_ns=100000 > /dev/null
echo ""
echo "---------------"
# ********************************************************
# Enable JIT Packet Filter Compiler (needs kernel support)
# ********************************************************
echo "Enabling JIT Packet Filter Compiler"
echo "1" > /proc/sys/net/core/bpf_jit_enable
echo ""
echo "---------------"
# ********************************************************
# microSD card speed tweak
# ********************************************************
echo "Enabling microSD card speed tweak"
echo "4096" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo ""
echo "---------------"
# ********************************************************
# Flags blocks as non-rotational and increases cache size
# ********************************************************
echo "Flagging blocks as non-rotational and increasig 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 "4096" > $j/queue/read_ahead_kb;
done
echo ""
echo "---------------"
# ********************************************************
# Battery tweaks
# ********************************************************
echo "Enabling battery tweaks"
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
echo ""
echo "---------------"
# ********************************************************
# EXT4 tweaks
# ********************************************************
echo "Enabling EXT4 tweaks"
# a) remove journals
echo "Removing journals"
tune2fs -f -o journal_data_writeback /dev/block/mmcblk0p9
tune2fs -f -O ^has_journal /dev/block/mmcblk0p9
tune2fs -f -o journal_data_writeback /dev/block/mmcblk0p7
tune2fs -f -O ^has_journal /dev/block/mmcblk0p7
tune2fs -f -o journal_data_writeback /dev/block/mmcblk0p10
tune2fs -f -O ^has_journal /dev/block/mmcblk0p10
echo ""
echo "---------------"
# b) better mount options
echo "Applying better mount options"
busybox mount -o remount,noatime,noauto_da_alloc,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
echo ""
echo "---------------"
#
echo "Tweaks applying finished at $( date +"%m-%d-%Y %H:%M:%S" )"
S95bln​
Spoiler
Code:
#!/system/bin/sh
#######################################
# ************************************
# BLN and leds timeout
# ************************************
#
LOG_FILE=/data/log/bln.log
rm -Rf $LOG_FILE
exec &> $LOG_FILE
#
# ***************************************
# Enable Button Light Notification (BLN)
# ***************************************
#
echo "Enabling BLN $( date +"%m-%d-%Y %H:%M:%S" )"
echo 1 > /sys/class/misc/backlightnotification/enabled
echo ""
echo "---------------"
#
echo "Enabling BLN finished at $( date +"%m-%d-%Y %H:%M:%S" )"
# **************************************
# Enable Button Light Timeout
# **************************************
#
echo "Enabling leds timeout $( date +"%m-%d-%Y %H:%M:%S" )"
echo 3 > /sys/class/misc/notification/bl_timeout
echo ""
echo "---------------"
#
echo "Enabling leds timeout finished at $( date +"%m-%d-%Y %H:%M:%S" )"
#
# **************************************
# leds voltage setting
# **************************************
echo "setting leds voltage $( date +"%m-%d-%Y %H:%M:%S" )"
#
echo "---------------"
echo 2500 > /sys/devices/virtual/sec/sec_touchkey/touchkey_brightness
echo ""
echo "setting leds voltage finished at $( date +"%m-%d-%Y %H:%M:%S" )"
S91 is partially working, it sets the correct governor, speed, voltage and i/o scheduler, but gives other errors...
S92 no sure. zipalign binary seems to be doing its job, but strange output on log...
S93 seem to be working, sometimes it gives an error about *db being locked" or "permission denied" ...
S94 not working. lots of errors on log...
S95 is working properly.
Click to expand...
Click to collapse
We appreciate ALL the help we can't get from the XDA community..
This is a fantastic kernel compilded and mantained by @sakindia123, but there aren't lots of options to control it, besides the init.d scripts...
So please, if you have suggestions, corrections and additions to be made, please do so ! ​
reserved ..
Thank you for the topic. As i'm very new to kernel scripting would you mind explain what exacly each script is designed for?
Thank you in advance
Envoyé depuis mon GT-I9100 avec Tapatalk
@infected_
Nice idea mate!
A small tip/request: can you put the scripts inside spoilers?
Could be much easier to search for what we need
Reserved...
Thanks mate:beer::beer::beer:
Inviato dal mio GT-I9100 con Tapatalk 2
ive attached the scripts that i use in my roms to be placed in the init.d folder. the zipalign file needs to go in the system\bin folder and sqlite3 goes in the system\xbin folder
dead0 said:
ive attached the scripts that i use in my roms to be placed in the init.d folder. the zipalign file needs to go in the system\bin folder and sqlite3 goes in the system\xbin folder
Click to expand...
Click to collapse
many thank for your contribution !!
just a quick (and maybe silly question) .. normally on all zipalign scripts the binary goes to pah /system/xbin .. is it the same thing, or in the future i may have problems, using same some scripts that use zipalign or something for ex..?
infected_ said:
many thank for your contribution !!
just a quick (and maybe silly question) .. normally on all zipalign scripts the binary goes to pah /system/xbin .. is it the same thing, or in the future i may have problems, using same some scripts that use zipalign or something for ex..?
Click to expand...
Click to collapse
ive had no problem with the zipalign binary being in the system\bin folder. the log shows everything completes successfully without any errors. i dont think it matters too much tho
Just we wondering if there is a script for turning off the menu and back button lights after 3 seconds or so and for then to turn on when you touch the screen.
I set it using the settings in advanced/display but they are either always on or always off?
Thanks for any help :thumbup:
Sent From My Galaxy S2
Running SentinelROM 4.75
Powered By KangBang Kernel v1.3
{
"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"
}
Nos_20 said:
Just we wondering if there is a script for turning off the menu and back button lights after 3 seconds or so and for then to turn on when you touch the screen.
I set it using the settings in advanced/display but they are either always on or always off?
Thanks for any help :thumbup:
Sent From My Galaxy S2
Running SentinelROM 4.75
Powered By KangBang Kernel v1.3
Click to expand...
Click to collapse
S95bln ..
Enviado do meu GT-I9100
infected_ said:
S95bln ..
Enviado do meu GT-I9100
Click to expand...
Click to collapse
I copied the script into notepad++, I save as an .xml? Like S95bln.xml?
Then copy the script to system/etc/init.d and reboot and voila???
Thanks for helping! I really do not understand all this scripting !
Nos_20 said:
I copied the script into notepad++, I save as an .xml? Like S95bln.xml?
Then copy the script to system/etc/init.d and reboot and voila???
Thanks for helping! I really do not understand all this scripting !
Click to expand...
Click to collapse
You dont need to change anything on the script. Just place it on init.d folder and set permissions to 0755. NO extension to the file!
Enviado do meu GT-I9100
infected_ said:
You dont need to change anything on the script. Just place it on init.d folder and set permissions to 0755. NO extension to the file!
Enviado do meu GT-I9100
Click to expand...
Click to collapse
OK thanks.
Is this looking correct?
Sent From My Galaxy S2
Running SentinelROM 4.75
Powered By KangBang Kernel v1.3
Nos_20 said:
OK thanks.
Is this looking correct?
Sent From My Galaxy S2
Running SentinelROM 4.75
Powered By KangBang Kernel v1.3
Click to expand...
Click to collapse
Yes.
Restart your phone and check the log in /data/log
axpira said:
Yes.
Restart your phone and check the log in /data/log
Click to expand...
Click to collapse
The directory of /data/log is empty?
Does this mean the script has not run? Any idea how I get it going as the behaviour of the leds is still the same!
Nos_20 said:
The directory of /data/log is empty?
Does this mean the script has not run? Any idea how I get it going as the behaviour of the leds is still the same!
Click to expand...
Click to collapse
If don't have this file: /data/log/bln.log , then the script not run.
Do you restart your phone?
axpira said:
If don't have this file: /data/log/bln.log , then the script not run.
Do you restart your phone?
Click to expand...
Click to collapse
Yes I just restarted my phone and checked the directory, empty!
What should I do to get it working?
Edit. Got the script to run at boot, but it still doesn't work.
Here is the log from /data/log
Enabling BLN 06-28-2013 13:56:30
/system/etc/init.d/S95Bln[16]: can't create /sys/class/misc/backlightnotification/enabled
: No such file or directory
---------------
Enabling BLN finished at 06-28-2013 13:56:30
Enabling leds timeout 06-28-2013 13:56:30
/system/etc/init.d/S95Bln[26]: can't create /sys/class/misc/notification/bl_timeout
: No such file or directory
---------------
Enabling leds timeout finished at 06-28-2013 13:56:30
setting leds voltage 06-28-2013 13:56:30
---------------
/system/etc/init.d/S95Bln[38]: can't create /sys/devices/virtual/sec/sec_touchkey/touchkey_brightness
: No such file or directory
setting leds voltage finished at 06-28-2013 13:56:30
Edit
I was looking at the directory /sys/class/misc/backlightnotification/enabled.
On my Rom - SentinelROM it looks like this directory is symlinked to /sys/devices/virtual/misc/backlightnotification
Just wondering if this would impact on the script and why it says "No such file or directory" as the error??
Sent From My Galaxy S2
Running SentinelROM 4.75
Powered By KangBang Kernel v1.3
the original (base) zip algin script is from darky one of my co devs please give credits
pxrave said:
the original (base) zip algin script is from darky one of my co devs please give credits
Click to expand...
Click to collapse
Done
Could you ask to him to give a jump to this thread, and have a look to see whats causing all the errors in log file?
Thanks!
Thanks a lot for this thread
Posté via Vanilla Rootbox

[CLI]Frequent app changer Aug-8-2013

After hacking around the unity8 folder, I figured out how to add, omit, change, rearrange the frequent app folder, and also creating simple web-based apps(leads to mobile view of sites)
I will release both and also merge all my apps into one post.
Have fun with Ubuntu Touch, I know I am.
Sent from my LG-LS970 using xda app-developers app
Code:
#!/bin/bash
echo "Frequent App Changer ---- Ubuntu Touch 13.10"
echo "**This App Requires Super User Permission**"
echo ""
sleep 2
sudo echo ""
echo ""
echo ""
echo "What do you want your first app to be?"
read APP1
echo "What do you want your second app to be?"
read APP2
echo "What do you want your third app to be?"
read APP3
echo "What do you want your fourth app to be?"
read APP4
echo "What do you want your fifth app to be?"
read APP5
echo "What do you want your sixth app to be?"
read APP6
sudo echo "*//Mod" >> /tmp/fapps.qml
sudo echo "" >> /tmp/fapps.qml
sudo echo "import QtQuick 2.0" >> /tmp/fapps.qml
sudo echo "ListModel {" >> /tmp/fapps.qml
sudo echo " ListElement { desktopFile: "/usr/share/applications/$READ1-app.desktop"; }" >> /tmp/fapps.qml
sudo echo " ListElement { desktopFile: "/usr/share/applications/$READ2-app.desktop"; }" >> /tmp/fapps.qml
sudo echo " ListElement { desktopFile: "/usr/share/applications/$READ3-app.desktop"; }" >> /tmp/fapps.qml
sudo echo " ListElement { desktopFile: "/usr/share/applications/$READ4-app.desktop"; }" >> /tmp/fapps.qml
sudo echo " ListElement { desktopFile: "/usr/share/applications/$READ5-app.desktop"; }" >> /tmp/fapps.qml
sudo echo " ListElement { desktopFile: "/usr/share/applications/$READ6-app.desktop"; }" >> /tmp/fapps.qml
sudo cp /usr/share/unity8/Dash/Apps/FrequentlyUsedAppsModel.qml /home/phablet/faBackup/fapps.qml.bak
sudo rm -f /usr/share/unity8/Dash/Apps/FrequentlyUsedAppsModel.qml
sudo cp /tmp/fapps.qml /usr/share/unity8/Dash/Apps/FrequentlyUsedAppsModel.qml
sleep 2
sudo rm -f /tmp/fapps.qml
clear
echo "Thank You for Trying this app"
echo ""
echo ""
echo "Your device will reboot in 3 seconds"
echo ""
sleep 1
clear
echo "."
sleep 1
clear
echo ".."
sleep 1
clear "..."
echo "Rebooting Now..."
sudo reboot -p
**INSTRUCTIONS**
push this file with adb.
On Computer
sudo adb push /location/of/app/freqapp /usr/bin/freqapp
sudo adb shell
sudo chmod 755 /usr/bin/freqapp
On Device
open terminal and type
freqapp
it'll ask for root permission so it can replace the app model in unity8 and delete it's own tmp file.
To use this app you just need to know the name of which app you wanna use. the app list can be found on your Ubuntu Touch device in /usr/share/applications/
so when asked which app for which postion it could look like this
camera
ubuntu-filemanager
ubuntu-rssreader
webbrowser
friends
ubuntu-terminal
or any other grouping, aslong as you know the name of the app.
if there are any issues with icons not showing up please tell me and i'll patch the script.
Update
Backups the original model to /home/phablet/faBackup/fapps.qml.bak
Sent from my TouchPad using xda app-developers app
Good Job
Sent from my LG-LS970 using xda app-developers app
This app will only affect Home Scope and will soon not be usable once the real frequent app model is written and implemented.
Sent from my LG-LS970 using xda app-developers app

Categories

Resources