[NO ROOT] Amazon Fire TV Setup Tool [ Kills Amazon Launcher + XFINITY STREAM 2017 ] - Fire TV General

Hello everyone!
I have had to set up quite a few of these sticks, so I wanted to start a little development tool to automate the process.
This is just a stupid bash script but it will make your TV usable without ads by installing Launcher Hijack 3 and configuring it for you and X43Stream. If anyone has requests I will work on this further. Leanback will not work, someone needs to mod it.
Source
PHP:
echo "Please ensure you are already connected and adb is installed correctly."
sleep 1
echo "Installing Launcher Hijack 3 (LH3).."
adb install "LauncherHijack3.apk"
echo "Installing TV Launcher.."
adb install "TVLauncher.apk"
echo "Installing XFinity Stream latest July 2017.."
adb install "X43Stream.apk"
echo "Opening LH3.."
adb shell am start -n com.baronkiko.launcherhijack/.MainActivity
sleep 3
echo "Selecting new launcher.."
adb shell input keyevent 23
sleep 1
adb shell input keyevent 23
sleep 1
adb shell am start -n com.awe.dev.pro.tv/.Launcher
echo "Enjoy, try out the home button!"
echo "It may not work every time, press again, work in progress :)"
or download it:
https://www.sendspace.com/file/epob8z

Thank you so much, I can't root my fire TV and I'm sick and tired of the Amazon launcher. I will be setting it up tomorrow. Will post back with results

Nvmd, finally got it.

This can be ran as a straight native Windows batch without having to install Bash support. Replace "sleep 1" with "timeout -t 1"
(or you can just paste ^^ into a properly connected ADB console with apks in the right places, will fail on "sleep 1" but it worked for me)
EDIT: Also works fine with Tvlauncher 2 rename the apk to tvlauncher like in the package and thanks OP! Home button seems to work fine for me!

installation help
Please help me install this fire tv setup tool i have a newer fire tv and dont know what to do with the download. i am not a pro but can follow directions and i hate the fire tv launcher.
Please help
Thank You

1. open a command prompt to the directory that contains ADB and put everything from the download in the same folder.
2. in the console window "adb connect xxx.xxx.xxx.xxx" where the x's are your IP of your FireTV\Stick (no quotes)
3. cut\paste the script from above into the console (cmd) window and run it...
4. it will error on "sleep 1" but continue and finish fine. If you want to correct the script for Windows batch scripting, replace "sleep 1" with "timeout -t 1" and save it as a .bat file.
I don't understand why this was only posted as a bash script (it is the best non-root hack there is). Windows doesn't support bash out of the box, and 99 percent of the people who download the script wont know what to do with it. BTW this works, and even works with other launchers. I use Tv launcher 2 which supports (its own special) widgets. No root. Never see the amazon launcher. Block updates, and do it asap.
EDIT: Fire Stick 2 fyi

So do we need to use the tvlauncher apk for the xfinity app to work?
What is the tv launcher? Same UI as the newer aftv ui (-ads?)
Only reason I don't just jump in and test it is Im not 100%sure how to undo it. Just uninstall the apks?
Thanks
UPDATE-I just went for it and it works....sort of.
It immediately launches the new UI but after setting it up, when I hit the home button it just returns to the normal AFTV launcher.
***This is actually preferable to me since all I really wanted was the Xfinity stream app to work. I tried just extracting the apk and installing it on my other Fire TV but it said incompatible.

First I would like to say thank you for a great tool to use on non rooted devices, I love it.
One thing i noticed is, that most people still won't know what to do with this tool so i will try and help explain better
-download adb and install it, if you haven't already
-download the file OP has at top of post
-extract the zip file
-copy and paste the code at top of OP into NOTEPAD
-change every spot that says "Sleep 1", erase that and copy and paste this there instead "timeout -t 1
-click file at the top left in notepad and click save as name it FireTV.bat
-goto your adb folder of install, usually C:\Program Files (x86)
-erase the "sh file" in the file you downloaded and extracted from the OP earlier
-put the new FireTV.bat you just made in that folder you just erased the "sh file" from
-now put all of those files into the adb folder you just opened and found,"launcher hijack apk, TVLauncher apk, x43Stream apk and your FireTV.bat files."
-hold on shift and right click with your mouse to open and command promnt here, if that doesn't show powershell works as well, it depends on your windows version.
-type "adb connect 192.168.1.8 or whatever you ip is for your FIreTV, this is found by going to settings, device, about and scroll down to network and it will list your IP
-if right it will say connected to device
-now simply left click hold and drag the FireTV.bat file you just created into the command promt and press enter
-that is it should work just fine.
I usually don't do this so I hope I helped a little bit.

Ok, just tried this, works pretty flawless. Sometimes you have to press home a couple times to get it to work(but that's no big deal). One thing i did notice though, if you have appstarter/firestarter (forget its name) it launches it instead, simple fix is to uninstall it then run the .bat again.
Does this work on firestick as well? Would hate to mess something up lol.
Edit.
For anyone wondering, no this does not work on firestick, it will install the apps but thats it.

TimmyP said:
This can be ran as a straight native Windows batch without having to install Bash support. Replace "sleep 1" with "timeout -t 1"
(or you can just paste ^^ into a properly connected ADB console with apks in the right places, will fail on "sleep 1" but it worked for me)
EDIT: Also works fine with Tvlauncher 2 rename the apk to tvlauncher like in the package and thanks OP! Home button seems to work fine for me!
Click to expand...
Click to collapse
Do you have a safe download link for the Tvlauncher 2 apk? Also so all I do is change Tvlauncher in the script to Tvlauncher2 and replace the apk in the download file?

Would it be possible to add a app killer similar to firestarter when you press the menu key, even if just to launch system default app manager? If it had that i think it'd be perfect.

Can anyone add screenshots or video of what this looks like when completed?

enigma7820 said:
First I would like to say thank you for a great tool to use on non rooted devices, I love it.
One thing i noticed is, that most people still won't know what to do with this tool so i will try and help explain better
-download adb and install it, if you haven't already
-download the file OP has at top of post
-extract the zip file
-copy and paste the code at top of OP into NOTEPAD
-change every spot that says "Sleep 1", erase that and copy and paste this there instead "timeout -t 1
-click file at the top left in notepad and click save as name it FireTV.bat
-goto your adb folder of install, usually C:\Program Files (x86)
-erase the "sh file" in the file you downloaded and extracted from the OP earlier
-put the new FireTV.bat you just made in that folder you just erased the "sh file" from
-now put all of those files into the adb folder you just opened and found,"launcher hijack apk, TVLauncher apk, x43Stream apk and your FireTV.bat files."
-hold on shift and right click with your mouse to open and command promnt here, if that doesn't show powershell works as well, it depends on your windows version.
-type "adb connect 192.168.1.8 or whatever you ip is for your FIreTV, this is found by going to settings, device, about and scroll down to network and it will list your IP
-if right it will say connected to device
-now simply left click hold and drag the FireTV.bat file you just created into the command promt and press enter
-that is it should work just fine.
I usually don't do this so I hope I helped a little bit.
Click to expand...
Click to collapse
Very helpful but I had to correct a few lines:
-There was a "Sleep 3" I had to change to "timeout -t 3"
-In powershell I had to type ".\adb connect 192.168.xx.xxx" to get it to work.
-The left click hold and drag the FireTV.bat file didn't do anything so I just typed "FireTV.bat" on the command prompt and it ran.
Thanks for your help.

nyln said:
Hello everyone!
I have had to set up quite a few of these sticks, so I wanted to start a little development tool to automate the process.
This is just a stupid bash script but it will make your TV usable without ads by installing Launcher Hijack 3 and configuring it for you and X43Stream. If anyone has requests I will work on this further. Leanback will not work, someone needs to mod it.
Source
PHP:
echo "Please ensure you are already connected and adb is installed correctly."
sleep 1
echo "Installing Launcher Hijack 3 (LH3).."
adb install "LauncherHijack3.apk"
echo "Installing TV Launcher.."
adb install "TVLauncher.apk"
echo "Installing XFinity Stream latest July 2017.."
adb install "X43Stream.apk"
echo "Opening LH3.."
adb shell am start -n com.baronkiko.launcherhijack/.MainActivity
sleep 3
echo "Selecting new launcher.."
adb shell input keyevent 23
sleep 1
adb shell input keyevent 23
sleep 1
adb shell am start -n com.awe.dev.pro.tv/.Launcher
echo "Enjoy, try out the home button!"
echo "It may not work every time, press again, work in progress :)"
or download it:
https://www.sendspace.com/file/epob8z
Click to expand...
Click to collapse
The sendspace link is very slow,
Here is a direct download link: https://ipfs.works/ipfs/QmXnYYH5iSnsa4DQdQED8RapgM4pA7v6EV3bzfGdoR9sMp/Amazon_Fire_TV_Setup_Tool.zip
md5sum: 8847a2b99afee549e2f5f973d86bfa51

Thread cleaned. XDA-Developers is a site for all, including those whose main languages and experience levels may vary.
If you're unwilling or unable to treat people with the civility we all deserve, kindly consider a break away from the keyboard.
Thank you all for your cooperation.

Sorry Somehow my post posted twice! not sure how to delete it so i'm editing this one

nyln said:
Hello everyone!
I have had to set up quite a few of these sticks, so I wanted to start a little development tool to automate the process.
This is just a stupid bash script but it will make your TV usable without ads by installing Launcher Hijack 3 and configuring it for you and X43Stream. If anyone has requests I will work on this further. Leanback will not work, someone needs to mod it.
Source
PHP:
echo "Please ensure you are already connected and adb is installed correctly."
sleep 1
echo "Installing Launcher Hijack 3 (LH3).."
adb install "LauncherHijack3.apk"
echo "Installing TV Launcher.."
adb install "TVLauncher.apk"
echo "Installing XFinity Stream latest July 2017.."
adb install "X43Stream.apk"
echo "Opening LH3.."
adb shell am start -n com.baronkiko.launcherhijack/.MainActivity
sleep 3
echo "Selecting new launcher.."
adb shell input keyevent 23
sleep 1
adb shell input keyevent 23
sleep 1
adb shell am start -n com.awe.dev.pro.tv/.Launcher
echo "Enjoy, try out the home button!"
echo "It may not work every time, press again, work in progress :)"
or download it:
https://www.sendspace.com/file/epob8z
Click to expand...
Click to collapse
I'm assuming this is using adb tcpip? I have a very Epic setup of bash scripts for setting up Fire Devices. I made it for my brother.
Anyways here is the chunk of code will grab your current connected networks and provide a list to choose from. Example if you have to it would show: 192.168.0.1 & 10.0.0.1 . When you choose one it will scan your network for Fire Devices with port 5555 open and present you with a list of found devices. You can choose to connect to a specific one or connect to them all.
There is a lot of extra code in this that needs to be removed. Right now i dont have the time to clean it up so hopefully you can! Also this chunk of code requires nmap to be installed. FYI This runs on Kali Linux but should work on other distro's but you may have to account for sudo usage.
Code:
function NetworkScan() {
function GetNetworks() {
echo -e "\n\n"
cd $(grep 'MainPath=' $HOME/.][NT3L][ST][CKS/main.conf | cut -d'=' -f2 | sed -e "s:/$::g") &>/dev/null
TotalConnectedDevices="$(adb devices 2>/dev/null | grep -v "List" | grep -v "^$" | grep -iv "daemon" | sort | uniq | wc -l)"
ConnectedDevices="$(adb devices 2>/dev/null | grep -v "List" | grep -v "^$" | grep -iv "daemon" | grep -iv "offline" | sort | uniq | wc -l)"
ConnectedOffline="$(adb devices 2>/dev/null | grep -v "List" | grep -v "^$" | grep -iv "daemon" | grep -i "offline" | sort | uniq | wc -l)"
prompt="$(echo -e "\e[96m][NT3L][G3NC][ NetworkPicker Menu:\e[0m")"
IP=$(for file in $(ifconfig | egrep -o "wlan.:|eth.:" | cut -d" " -f1 | sed -e "s/://g"); do ip addr show $file | grep -w inet | cut -d"/" -f1 |sed -e 's/\<inet\>//g' -e 's/^[ \t]*//' | grep "[1-9][0-9]" | cut -d'.' -f1,2,3; done | sort | uniq)
options=( $(for file in $(echo "$IP"); do echo "$file.1/24"; done | sort | uniq | xargs -0) )
echo -e " $prompt $TotalConnectedDevices "
echo -e " [\e[96m$ConnectedOffline\e[0m]----------------------------------[\e[96m$ConnectedDevices\e[0m]"
echo -e " $RemoteKodi "
echo -e ""
select opt in "${options[@]}" "All" ; do
if [[ $REPLY = 'QUIT' || $REPLY = 'quit' ]] ; then
exit 1
elif (( REPLY == 1 + ${#options[@]} )) ; then
clear
NetworkScan $(for file in $(echo ${options[@]}); do echo -n "$file " ; done)
elif (( REPLY > 0 && REPLY <= ${#options[@]} )) ; then
clear
NetworkScan "$opt"
else
echo -e "Invalid option. Try another one."
sleep 2 &>/dev/null
clear
StartMenu
fi
done
}
Args=( $(for file in $(echo "[email protected]"); do echo "$file" ; done | xargs -0) )
ArgsCount=${#Args[@]}
if [ "$ArgsCount" = '0' ]
then
GetNetworks
else
echo "${Args[@]}" | grep "\.1/24" &>/dev/null
if [ "$?" = '0' ]
then
options=( $(for file in $(echo ${Args[@]}); do nmap -p 5555 $file -oG - | grep "open" | cut -d" " -f2 ; done | xargs -0) )
else
options=( $(for file in $(echo ${Args[@]}); do echo $file ; done | xargs -0) )
fi
echo -e "\n\n"
cd $(grep 'MainPath=' $HOME/.][NT3L][ST][CKS/main.conf | cut -d'=' -f2 | sed -e "s:/$::g") &>/dev/null
TotalConnectedDevices="$(adb devices 2>/dev/null | grep -v "List" | grep -v "^$" | grep -iv "daemon" | sort | uniq | wc -l)"
ConnectedDevices="$(adb devices 2>/dev/null | grep -v "List" | grep -v "^$" | grep -iv "daemon" | grep -iv "offline" | sort | uniq | wc -l)"
ConnectedOffline="$(adb devices 2>/dev/null | grep -v "List" | grep -v "^$" | grep -iv "daemon" | grep -i "offline" | sort | uniq | wc -l)"
prompt="$(echo -e "\e[96m][NT3L][G3NC][ NetworkScan Menu:\e[0m")"
echo -e " $prompt $TotalConnectedDevices "
echo -e " [\e[96m$ConnectedOffline\e[0m]----------------------------------[\e[96m$ConnectedDevices\e[0m]"
echo -e " $RemoteKodi "
echo -e ""
select opt in "${options[@]}" "All" "Pick Network" ; do
if [[ $REPLY = 'QUIT' || $REPLY = 'quit' ]] ; then
exit 1
elif [[ $REPLY = 'KILL' || $REPLY = 'kill' ]] ; then
clear
killall adb gnome-terminal xterm terminator &>/dev/null
exit 1
elif [[ $REPLY = 'LIST' || $REPLY = 'list' ]] ; then
clear
$(declare -f ListDevicesConnected)
NetworkScan $(for file in $(echo ${options[@]}); do echo -n "$file " ; done)
elif [[ $REPLY = 'REFRESH' || $REPLY = 'refresh' || $REPLY = 'RELOAD' || $REPLY = 'reload' ]] ; then
clear
NetworkScan $(for file in $(echo ${options[@]}); do echo -n "$file " ; done)
elif [[ $REPLY = 'FireStarter' || $REPLY = 'fIREsTARTER' ]] ; then
clear
xterm -e $(grep 'MainPath=' $HOME/.][NT3L][ST][CKS/main.conf | cut -d'=' -f2 | sed -e "s:/$::g")/Scriptz/FireStarterUP.sh &
NetworkScan $(for file in $(echo ${options[@]}); do echo -n "$file " ; done)
elif [[ $REPLY = 'APK' || $REPLY = 'apk' ]] ; then
clear
for apk in $(find $(grep 'MainPath=' $HOME/.][NT3L][ST][CKS/main.conf | cut -d'=' -f2 | sed -e "s:/$::g")/AApushApk/SendAPK -type f -iname "*.apk"); do adb install "$apk" ; done
NetworkScan $(for file in $(echo ${options[@]}); do echo -n "$file " ; done)
elif [[ $REPLY = 'REBOOT' || $REPLY = 'reboot' ]] ; then
clear
$(grep 'MainPath=' $HOME/.][NT3L][ST][CKS/main.conf | cut -d'=' -f2 | sed -e "s:/$::g")/Scriptz/RebootDevices.sh
NetworkScan $(for file in $(echo ${options[@]}); do echo -n "$file " ; done)
elif [[ $REPLY = 'stop' || $REPLY = 'STOP' ]] ; then
clear
adb kill-server
adb start-server
NetworkScan $(for file in $(echo ${options[@]}); do echo -n "$file " ; done)
elif [[ $REPLY = 'HELP' || $REPLY = 'help' ]] ; then
clear
echo -e "$(HelpMe)"
NetworkScan $(for file in $(echo ${options[@]}); do echo -n "$file " ; done)
elif [[ $REPLY = 'USBCHECK' || $REPLY = 'usbcheck' || $REPLY = 'usb' || $REPLY = 'USB' ]] ; then
terminator -e dmesg -wH &
clear
NetworkScan $(for file in $(echo ${options[@]}); do echo -n "$file " ; done)
elif [[ $REPLY = 'html' || $REPLY = 'HTML' ]] ; then
clear
xterm -e $(grep 'MainPath=' $HOME/.][NT3L][ST][CKS/main.conf | cut -d'=' -f2 | sed -e "s:/$::g")/Scriptz/GenerateHTML.sh
iceweasel $(grep 'MainPath=' $HOME/.][NT3L][ST][CKS/main.conf | cut -d'=' -f2 | sed -e "s:/$::g")/ScreenShots/index.html &
NetworkScan $(for file in $(echo ${options[@]}); do echo -n "$file " ; done)
elif [[ $REPLY = 'BACK' || $REPLY = 'back' || $REPLY = 'Menu' || $REPLY = 'menu' || $REPLY = 'MENU' ]] ; then
clear
StartMenu
elif [[ $REPLY = 'UpdateKodi' || $REPLY = 'uPDATEkODI' ]] ; then
clear
KodiAPKMenu
elif (( REPLY == 1 + ${#options[@]} )) ; then
clear
for file in $(echo ${options[@]}); do adb connect "$file" ; done
NetworkScan $(for file in $(echo ${options[@]}); do echo -n "$file " ; done)
elif (( REPLY == 2 + ${#options[@]} )) ; then
clear
GetNetworks
elif (( REPLY > 0 && REPLY <= ${#options[@]} )) ; then
clear
adb connect "$opt"
clear
NetworkScan $(for file in $(echo ${options[@]}); do echo -n "$file " ; done)
else
echo -e "Invalid option. Try another one."
sleep 2 &>/dev/null
clear
NetworkScan $(for file in $(echo ${options[@]}); do echo -n "$file " ; done)
fi
done
fi
}
The chunk of code above is setup to be a Menu in the terminal. NetworkScan is just one of the Menu options. If you make a base Menu setup with options: "Network Scan" , "Install APKs", "Change Launcher" etc. you could have "Change Launcher" launch a script that would have something like this in it.
Code:
for DroidID in $(adb devices 2>/dev/null | grep -v "List" | grep -v "daemon" | grep -v "^$" | cut -f1)
do
xterm -e $(grep 'MainPath=' $HOME/.][NT3L][ST][CKS/main.conf | cut -d'=' -f2)/Scriptz/Clean.sh "$DroidID" &
done
The above script gets all connected devices and then loops through their serial starting another script while passing the serial as a parameter. You would need to make sure the script that gets ran applies the parameter as the serial. Example below is used to remove all 3rd party apps installed, data and then uninstall it
Code:
#!/bin/bash
SerialNum="$1"
IsDeviceOffline="$(adb -s "$1" devices | grep "$1" | cut -f2)"
function AutoClean() {
echo -e ""
echo -e "Clearing App Data And Removing APKs"
for file in $(adb -s "$1" shell pm list packages -3 | cut -d':' -f2)
do
adb -s "$1" shell pm clear "$(echo "$file" | tr -d '\r')"
adb -s "$1" uninstall "$(echo "$file" | tr -d '\r' )"
done
echo -e ""
read -p "Finished Auto Cleaning"
}
echo -e "$IsDeviceOffline" | grep -i "offline" &>/dev/null
if [ "$?" != '0' ]
then
AutoClean "$SerialNum"
else
echo -e "Device:"$SerialNum" Is Offline!"
read -p "Exiting Script"
fi

nyln said:
Hello everyone!
I have had to set up quite a few of these sticks, so I wanted to start a little development tool to automate the process.
This is just a stupid bash script but it will make your TV usable without ads by installing Launcher Hijack 3 and configuring it for you and X43Stream. If anyone has requests I will work on this further. Leanback will not work, someone needs to mod it.
Source
PHP:
echo "Please ensure you are already connected and adb is installed correctly."
sleep 1
echo "Installing Launcher Hijack 3 (LH3).."
adb install "LauncherHijack3.apk"
echo "Installing TV Launcher.."
adb install "TVLauncher.apk"
echo "Installing XFinity Stream latest July 2017.."
adb install "X43Stream.apk"
echo "Opening LH3.."
adb shell am start -n com.baronkiko.launcherhijack/.MainActivity
sleep 3
echo "Selecting new launcher.."
adb shell input keyevent 23
sleep 1
adb shell input keyevent 23
sleep 1
adb shell am start -n com.awe.dev.pro.tv/.Launcher
echo "Enjoy, try out the home button!"
echo "It may not work every time, press again, work in progress :)"
Thanks for this. I use a slightly edited version of this on all of my firesticks now.
Click to expand...
Click to collapse

Anyone knows if is there a new update for the xfinity app for the firetv?

zeroth said:
Anyone knows if is there a new update for the xfinity app for the firetv?
Click to expand...
Click to collapse
Bump

Related

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

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

connect KF via Telnet

sorry for my poor English,,,
rooted, busybox needed,
adb shell
vi /data/opentel.sh
Code:
# cat /data/opentel.sh
busybox telnetd -l /system/bin/sh
echo " "
echo "Telnetd Service Running..."
busybox ifconfig | grep 'inet addr' | grep -v '127.0.0.1' | awk '{print $2}'
sleep 1
#echo " "
#echo "PID:"
var1=`busybox ps | grep telnetd | grep '/system/bin/sh' | awk '{print $1}'`
echo TELNET_PID=${var1}
echo " end"
sava, and exit vi editor,
chmod 755 /data/opentel.sh
Open Root Explorer, Then add this Shell Script to BookMark,
Everytime When need to telnet your KF, just Open R.E and run this BookMark ,
and run cmd "telnet KF_IP_ADDR" on PC,
I exec shell script with Tasker. That's works fine. and the script can run on booting.

[DEV\HELP] ICS Optimization Script

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

[TIP] Shell script output to AROMA UI

Thanks to Chainfire for the original idea here, here comes the version for AROMA installers.
Purpose: Do "live" output from a shell script to the AROMA user interface in installation step.
How it works: The update-binary uses a pipe for accessing the UI of the recovery like writing a line of text or updating the progress-bar. AROMA does basically the same thing -- the main AROMA installer opens another pipe and forks itself for the actual installation, the child running the installation writes to the pipe of the parent AROMA. If you try Chainfire's script from above, it will obtain the pipe of the recovery UI and write to that instead of the AROMA UI, only causing some nasty screen flicker. Because AROMA forks only directly before starting the installation, it is a little trickier to get it right -- we have to wait for the child to show up in 'ps'.
Code:
OUTFD=$(ps | grep -v grep | grep -oE "aroma/update-binary(.*)" | cut -d " " -f 3)
if [ $OUTFD == "" ]; then
count=4
while [ $count -ge 0 ]; do
sleep 1
OUTFD=$(ps | grep -v grep | grep -oE "aroma/update-binary(.*)" | cut -d " " -f 3)
if [$OUTFD != ""]; then break; fi
count=$((count-1))
done
fi
progress() {
if [ $OUTFD != "" ]; then
echo "progress ${1} ${2} " 1>&$OUTFD
fi
}
set_progress() {
if [ $OUTFD != "" ]; then
echo "set_progress ${1} " 1>&$OUTFD
fi
}
ui_print() {
if [ $OUTFD != "" ]; then
echo "ui_print ${1} " 1>&$OUTFD
echo "ui_print " 1>&$OUTFD
else
echo "${1}"
fi
}
The script above provides the functions progress, set_progress and ui_print. Instead of putting it in every script, I suggest you place it alongside your installer shellscripts, name it ui_functions.sh and source it like this:
Code:
. ./ui_functions.sh

[SCRIPT] Log CPU Usage with interval (Linux)

Hey guys, I've just decided to get inside of the Android development world. Anyways, I'm mostly a fan of Linux, so I've made my first Linux script, I know it's simple, but I've never interacted with the user before, or picked an output. When I knew that Android made use of Linux in its core, my interest on working inside it grew up faster than ever.
In my script, firstly, you type the filename. For compatibility reasons, it'll everytime save to /sdcard/filename. Then, it will ask you how many times you want the script to log everything, and lately, every how many seconds should it save everything to the file.
The script will save, before every entry at the log, the screen status (if it's on or off), that can help to, for example, if your device has been lagging as a result of a bad screen driver or UI error.
Last thnig: it also works on recovery (maybe it give some error, and if no dumpsys is present on your recovery's ramdisk, it'll save everything as OFF).
Remember to send it anywhere excepting from /storage and any sbudir, it won't work as the Android permissions system blocks script execution on those dirs.
Code:
clear
# Wipe $logfile content in /sdcard (if any existing)
echo "Please type the filename where you want to save the log: "
read -r logfile
echo "" > /sdcard/$logfile
echo "Deleted previous log."
echo "SCREEN | CPU" >> /sdcard/$logfile
#cont=60
cont=1
#SHOWLOG=X
echo "Please type how many times the cycle must repeat: "
read -r maxcont
echo "Please type how many seconds will the interval take: "
read -r maxmin
clear
# Here it counts how many times the logging script has been ran
while [ $cont -lt $((maxcont + 1)) ];
do
# That nested while takes control of how many seconds have passed in the current cycle
while [ "$contmin" -lt "$maxmin" ];
do
contmin=$((contmin + 1))
sleep 1
clear
echo "C: $cont/$maxcont - T: $contmin/$maxmin"
done
# echo "$maxmin seconds passed."
# Logs the fist line of "busybox top" to a var
LOGVAR=$(busybox top -d 1 -n 1 | grep "idle")
# Logs the screen state (on or off) to another var
SCREENSTATE=$(dumpsys input_method | grep mScreenOn | tr -dc '[:alnum:]\n\r' | tr '[:upper:]' '[:lower:]')
# Saves a string that tells what it should expect if the screen is on
SCREENSTATEON="msystemreadytruemscreenontrue"
if [ "$SCREENSTATE" == "$SCREENSTATEON" ]
then
echo "ON: $LOGVAR" >> /sdcard/$logfile
else
echo "OFF: $LOGVAR" >> /sdcard/$logfile
fi
cont=$((cont + 1))
contmin=0
done
echo "Show logged values? [Y/N]"
read -r SHOWLOG
case $SHOWLOG in
[yY] | [yY][Ee][Ss] )
cat /sdcard/$logfile
;;
[nN] | [n|N][O|o] )
echo "Ok, goodbye. You'll see a what you've asked me to log in /sdcard/$logfile";
exit 1
;;
*) echo "You must write Y or N to continue."
;;
esac
exit 0
For example, save it as script.sh (remember to save it using Unix codifcation, if you're running Windows, else, it'll tell you that it's unable to find many binaries, as long as Linux isn't ok with CR+LF and requires LF as newline). Then, send it to the sdcard (over USB or adb push script.sh /sdcard/) , now, run ADB shell. Type the following commands:
Code:
su -c "cp -f /sdcard/script.sh /data/local/;chmod 777 /data/local/script.sh"
Then, if you want to run it:
Code:
su
sh /data/local/script.sh
That's all, I hope you enjoy it and not so many people kills me for explaining and feeling so grateful for that simple script.

Categories

Resources