motorola droid autostart fixing test thread

Atari

New member
Ok whiterabbitorg.. hm, can u tell me like where did u learn about does commands. Like where did u find out does command and the way they can be used, that way I can create a new script that allows Metro PCS users to use voice search since w our 1x connection and current autostart.sh file.. it always says it cant connect to the server. Thanks alot for ur info...
 
These are linux commands. If you want to learn about them, you will need to read the man (manual) pages for them which can be found with google. It would probably be easiest to learn by installing linux in vmware and then testing things out there. I know token is working on the script, just wondering where he is. I thought he wanted to take the lead on autostart, but maybe he is only talking to people about it over PM? Maybe send him a PM and see what he has right now.
 
Hello all,
I have been working with whiterabbit on optimizing these scripts, to use in a universal flash that works across devices.

I have a post on XDA where i house my flashes here:
http://forum.xda-developers.com/showthread.php?p=7261108#post7261108

I will try to continue to work in this thread and show what i have done to the autostart.sh files as well.

I have gone through circkets network to find out which servers are where in terms of the proxy and think i have a good balance of when to send data through the proxy and not to.

Im currently working on an update for MetroPCS as well, but since i dont have them as a carrier its a little more difficult to gather the info. I do have some people willing ot help so once i gather the info ill get it updated as well.

I am going to incorporate the above fixes Whiterabbit just posted into my current script, test them, and then i will post it here once i have verified all is well.

Awesome work yet again Whiterabbit, and to anyone else please feel free to contribute as well :)

again, ill post up my scripts later after i incorporate whiterabbits newest optimizations :)

When reporting issues, please state your:
1. Carrier (Cricket / MetroPCS)
2. Phone Model (i.e. Eris/Hero/Incredible/EVO/Motorolla Droid/Motorolla Droid X etc.)
3. Rom (i.e. Stock/Damagecontrol/Fresh/Evil Eris/Toast etc.)

This should help us nail down trends or potentially known bad roms etc.
 
Sorry i thought i had posted this earlier,
My updated autostart.sh file is this
Code:
#!/system/bin/sh
export PROXYHOST=wap.mycricket.com
export PROXYPORT=8080

#you shouldn't have to edit anything below this line

export PATH="$PATH:/system/bin"
until netcfg|grep -v DOWN|awk '{print $1}'|grep -v wlan|grep -v lo >/dev/null 2>&1 ; do sleep 1 ; done
export INTERFACE=`netcfg|grep -v DOWN|awk '{print $1}'|grep -v wlan|grep -v lo`
export PROXYIP=`ping -c 1 $PROXYHOST|grep PING|cut -d\) -f1|cut -d\( -f2`
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -F
iptables -t nat -F
iptables -X
iptables -t nat -A OUTPUT -o $INTERFACE -p tcp -d 10/8 -j ACCEPT
iptables -t nat -A OUTPUT -o $INTERFACE -p tcp -d 172.16/12 -j ACCEPT
iptables -t nat -A OUTPUT -o $INTERFACE -p tcp -d 192.168/16 -j ACCEPT
iptables -t nat -A OUTPUT -o $INTERFACE -p tcp -j REDIRECT --to-port 1025
u2nl $PROXYIP $PROXYPORT 127.0.0.1 1025 >/dev/null 2>&1 &
sh -c "sleep 5;kill `ps|grep nk.bla.android.autostart|grep -v grep|awk '{print $2}'`" >/dev/null 2>&1 &
exit 0

Everyone using non sprint roms seems to work fine, for some reason with sprint roms the MMS is failing, im looking into it currently.
 
I just subscribed to your XDA thread, forgot about that one. You might end up getting issues with iptables support in the kernel not having everything you need. For example on the stock droid 2.2 kernel, I can't do many fun things I wanted to do. It supports what it needs to for usb tethering and little more.

Here is one thing that might work out with kernels that support it. Identify MMS not by IP address or port number, but user id with "-m owner --uid-owner app_xx" and after uid-owner comes the uid that the sms/mms app runs under. Check /data/data and do ls -l. Look for app_xx for com.android.mms.

Then you can easily exclude MMS from u2nl without knowing anything about the network in use. The uid can be looked up by the script, but I'll wait to see if the iptables rule will even work in the first place on enough roms. It might not work everywhere since it all depends on the kernels. We need to push for all kernels to support all types of iptables rules in addition to a non-broken busybox in all roms. Everything would be so much easier.

Also I got a PM saying -p tcp is giving real errors and not warnings. If this is true, it might be best to go back to -p 6. Might be best to wait until we know what rom it is so we can get a bug report in and to also be sure that is the issue.
 
I had uninstalled autostart to see if that may have had any impact on battery life, so I had to jumpstart the script on my own. I was able to drop down into a terminal, switch to superuser and run /data/opt/autostart.sh.
I tried putting it into the /system/etc/ directory as install-recovery.sh & as installrecovery.sh, chmod'd as 0755 to no avail (I'm on 'Sapphire 1.0 with its stock kernel).
I'm wondering if there's a way to get this to automatically start at boot via init scripts or something. Perhaps an "app" that is nothing more than a trigger for this script running as root, sort of an "on" button for the Internet. In the meantime it takes maybe 11 seconds to run those two commands, so it's not all that bad.
 
You don't want to move this to /system/etc/install-recovery.sh. Keep it as /data/opt/autostart.sh and then make /system/etc/install-recovery.sh start it backgrounded (that's what the & does). Otherwise you might screw things up and need to flash a new rom, since it might wait for this script to finish before it finishes booting, while this script waits for the network connection. Not a good combination.

install-recovery.sh is part of the stock rom, and is probably removed from most custom roms. Cyanogenmod auto-starts /sd-ext/userinit.sh (again, keep autostart.sh in /data/opt and make userinit.sh launch it in the background), and on top of this convenience is an all around great rom. They have instructions for using userinit.sh on their web page.
 
My mistake. What I meant to say was I had tried the method described in a previous post, and it didn't work. It could very well be that Sapphire has removed or does not automatically run /system/etc/install-recovery.sh (which calls on '/data/opt/autostart.sh' with a '&' at the end of the line) at boot.

I'm actually back to Sapphire after trying Cyanogenmod, and don't think I'd want to go back for the sake of autorunning a script at boot when I can run it by hand. Cyanogenmod is a fine ROM and all, but I found it to be a bit to too sluggish for my taste. Could've just been my particular hardware, but Sapphire's UI response is a bit snappier on my phone.
 
Back
Top