[Q]Disable/Enable radio or airplane mode through shell script - G1 Android Development

All,
I am looking for a way to enable/disable airplane mode (or just the radio) from a shell script... I actually do work on the HTC Eris forum but you guys are the script masters so I thought I would cross post here. thanks for your help!
I have reviewed the output of the below code and did not see anything that worked.
Code:
adb shell getprop
I have also reviewed the /sys/ directory on the phone and not yet found anything.
I know it is there somewhere...

Related

[GUIDE] Full bash shell with nano, tab completion, and color over ssh and adb

Posting this here because I think it will be of more interest to the tinkerers/devs than general users, if not, feel free to move it. I cobbled all of this together from various places on the web, but I think the credit for the binaries goes to Paul @ MoDaCo.
Nandroid before going any further!
Files you'll need:
For WiFi and CDMA SSH access - QuickSSHD (Download this from the Market. $1.50). I'm just going to assume if you're still reading, you know what this is for and how to use it. It's braindead simple. I think dropbear can be installed and configured manually, but for the $1.50...meh.
adb for tethered access.
The rest are zipped up here: terminfo, nano, bash, profile**
Unzip bashnano.zip onto your SDCard.
adb remount
From adb shell:
Install Terminfo:
cp -r /sdcard/terminfo /system/etc
Setup Bash:
cp /sdcard/bash /system/bin/bash_new
mv /system/bin/sh /system/bin/sh.old
ln -s /system/bin/bash_new /system/bin/sh
mv /sdcard/profile /sdcard/bash_profile (Thanks to jjvcuyler for finding adb bash profile location.)
Setup Nano:
cp /sdcard/nano /system/bin
I'm not sure if this setup will have any impact on sh scripts being used in the various ROMs, so use this at your own risk. I think it would kick ass to see this type of bash functionality baked into the custom ROMs.
If anybody would like to make this a flashable.zip, please do. I don't know how to do that yet.
Anyway, hope y'all find it useful.
**profile reflects a few personal choices for aliases and colors, but you can edit to your personal taste.
So I just did this. Is there any way to get this functionality into a local terminal?
Also I was able to do everything from a local terminal without adb. Just do the following first:
su
remount rw
Click to expand...
Click to collapse
adb shell fires off bash, but it doesn't read profile from /etc. It's going to be a simple matter of figuring out where bash is looking for it. I just haven't found that out yet.
How do you like having full bash capabilities on EVO? Arrows/tab completion/color prompts, etc...
J
jmxp69 said:
adb shell fires off bash, but it doesn't read profile from /etc. It's going to be a simple matter of figuring out where bash is looking for it. I just haven't found that out yet.
How do you like having full bash capabilities on EVO? Arrows/tab completion/color prompts, etc...
J
Click to expand...
Click to collapse
Copy profile to /sdcard/bash_profile
jjvcuyler said:
Copy profile to /sdcard/bash_profile
Click to expand...
Click to collapse
WooT! There it is. I'll update the OP. Thanks jjvcuyler.
Edit: /sdcard/bash_profile works for ssh and adb. OP updated to reflect the change.
jmxp69 said:
Posting this here because I think it will be of more interest to the tinkerers/devs than general users, if not, feel free to move it. I cobbled all of this together from various places on the web, but I think the credit for the binaries goes to Paul @ MoDaCo.
Nandroid before going any further!
Files you'll need:
For WiFi and CDMA SSH access - QuickSSHD (Download this from the Market. $1.50). I'm just going to assume if you're still reading, you know what this is for and how to use it. It's braindead simple. I think dropbear can be installed and configured manually, but for the $1.50...meh.
adb for tethered access.
The rest are zipped up here[/URL]: terminfo.zip, nano, bash, profile**
Unzip bashnano.zip onto your SDCard.
Unzip terminfo.zip (from inside bashnano.zip) onto your SDCard.
adb remount
From adb shell:
Install Terminfo:
cp -r /sdcard/terminfo /system/etc
Setup Bash:
cp /sdcard/bash /system/bin/bash_new
mv /system/bin/sh /system/bin/sh.old
ln -s /system/bin/bash_new /system/bin/sh
mv /sdcard/profile /sdcard/bash_profile (Thanks to jjvcuyler for finding adb bash profile location.)
Setup Nano:
cp /sdcard/nano /system/bin
I'm not sure if this setup will have any impact on sh scripts being used in the various ROMs, so use this at your own risk. I think it would kick ass to see this type of bash functionality baked into the custom ROMs.
If anybody would like to make this a flashable.zip, please do. I don't know how to do that yet.
Anyway, hope y'all find it useful.
**profile reflects a few personal choices for aliases and colors, but you can edit to your personal taste.
Click to expand...
Click to collapse
there is no terminfo.zip and there is nothing in terminfo directory from within the original zip... help?
Sorry, I missed the recurse flag zipping the terminfo directory. It's fixed now. Go ahead and re-download.
Here's a link for just terminfo.zip
J
I modified the bash_profile to get rid of the colors since the window's cmd.exe doesnt support ansi colors. probably a better way to do this but it works for me.
also found this useful for setting PS1 to my liking http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html
jmxp69 said:
adb shell fires off bash, but it doesn't read profile from /etc. It's going to be a simple matter of figuring out where bash is looking for it. I just haven't found that out yet.
How do you like having full bash capabilities on EVO? Arrows/tab completion/color prompts, etc...
J
Click to expand...
Click to collapse
is there a way to get tab completion through adb shell?
Yes. This works with adb shell. Just follow the directions in the OP.
jmxp69 said:
Yes. This works with adb shell. Just follow the directions in the OP.
Click to expand...
Click to collapse
i have and i do have everything done as stated in the OP, when i try tab completion via adb shell (phone tethered with usb) from my pc, it just puts in a tab, it doesn't complete.
Hmm....could be a dos thing with cmd.exe. I haven't tried on a PC, I'm on a Mac. adb shell via OSX works fine with tab completion. Try ssh'ing in instead with something like putty? Once you get ssh going, you don't need a cable.
Edit: Confirmed...tab completion doesn't work over Win cmd.exe and adb shell.
jmxp69 said:
Hmm....could be a dos thing with cmd.exe. I haven't tried on a PC, I'm on a Mac. adb shell via OSX works fine with tab completion. Try ssh'ing in instead with something like putty? Once you get ssh going, you don't need a cable.
Edit: Confirmed...tab completion doesn't work over Win cmd.exe and adb shell.
Click to expand...
Click to collapse
Thanks for looking into it... I'll try getting it to work via linux instead. I guess ssh would be a solution, but i never turn wifi on.
Is anyone able to do a NAND backup/restore after doing this? With Amon Ra's recovery I was unable to NAND backup.
EDIT:
I think this is a big negatory. I was just able to do a NAND backup, so maybe the error I got was a coincidence after applying these changes.
Anyone else noticing that the time is always displayed as GMT in the prompt? The date command gives the correct time for my timezone but the bash prompt always shows GMT
Vinny75 said:
Anyone else noticing that the time is always displayed as GMT in the prompt? The date command gives the correct time for my timezone but the bash prompt always shows GMT
Click to expand...
Click to collapse
Change PS1 line: \A to `date +%H:%M`
jmxp69 said:
Posting this here because I think it will be of more interest to the tinkerers/devs than general users, if not, feel free to move it. I cobbled all of this together from various places on the web, but I think the credit for the binaries goes to Paul @ MoDaCo.
Nandroid before going any further!
Files you'll need:
For WiFi and CDMA SSH access - QuickSSHD (Download this from the Market. $1.50). I'm just going to assume if you're still reading, you know what this is for and how to use it. It's braindead simple. I think dropbear can be installed and configured manually, but for the $1.50...meh.
adb for tethered access.
The rest are zipped up here: terminfo, nano, bash, profile**
Unzip bashnano.zip onto your SDCard.
adb remount
From adb shell:
Install Terminfo:
cp -r /sdcard/terminfo /system/etc
Setup Bash:
cp /sdcard/bash /system/bin/bash_new
mv /system/bin/sh /system/bin/sh.old
ln -s /system/bin/bash_new /system/bin/sh
mv /sdcard/profile /sdcard/bash_profile (Thanks to jjvcuyler for finding adb bash profile location.)
Setup Nano:
cp /sdcard/nano /system/bin
I'm not sure if this setup will have any impact on sh scripts being used in the various ROMs, so use this at your own risk. I think it would kick ass to see this type of bash functionality baked into the custom ROMs.
If anybody would like to make this a flashable.zip, please do. I don't know how to do that yet.
Anyway, hope y'all find it useful.
**profile reflects a few personal choices for aliases and colors, but you can edit to your personal taste.
Click to expand...
Click to collapse
I followed the steps exactly, but end up with "- exec '/system/bin/sh' failed: Permission denied (13) -" while typing "adb shell" in a windows or linux terminal. I cannot recover the original sh because the root is lost, and I cant root my phone anymore probably because something wrong with the new sh. Any idea how to fix this?
EDIT: Acutally nevermind. adb shell works in recovery mode. but still, not sure why the modified sh doest work for me
The Downloadlink is dead!
So the thread is useless.
francwalter said:
The Downloadlink is dead!
So the thread is useless.
Click to expand...
Click to collapse
Yeah.....no.
A simple google search would have shown you that the files are here: http://66.197.42.222/bashnano.zip
or here http://androidforums.com/attachment...ide-installing-bash-nano-android-bashnano.zip.
EDIT: I've also attached it in case the links above ever die, there will still be one which does not.
ya this is great and all but any decent busybox installer will setup bash for you.

HELP

I am trying to put fm radio on the droid 2 but when i try to adb remount under adb shell i get adb not found. But before i do adb shell i can see my device. HELP!!!!!
Resolved
Hello!
First off, please make sure that your topics actually state what your issue is. Typing "HELP!" for a topic won't get you the response that you want, because many people skip these threads.
Okay, do you mean that you are not able to adb remount while you are IN the shell? This makes sense, because adb is an application that allows you to access your device in a Linux terminal style. If you need to use adb to remount the device, you must first exit your shell..
$exit
C:\android-sdk\adb remount
As an example. I hope this helps!
- Andy
i try but i get permission denied
[APP] FM Radio for the Droid 2!! - Page 2 - xda-developers
These are the complete start to finish exact instructions.
i got it. i just had to put the bootstrap on it so would recognize i had root.
You should edit your topis to issue resolved

[Q] Turning on Bluetooth in flight mode

Hi guys,
hope this is the right forum.
I switched from iPhone4 now to the new Samsung Galaxy S II with 2.3.3 and brought my bluetooth Sennheiser MM450 which I would like to use in flight.
Anyway when I turn on the flight mode I can't turn on Bluetooth anymore!?
On my iPhone this was possible.
Is there any way to get Bluetooth in flight mode working as I dont wanna have my phone searching for networks during flight.
Any other App/hint etc. for this?
My Samsung is rooted by the way...
Like this?
Otherwise, on a more serious note: http://code.google.com/p/android/issues/detail?id=3289, see comment 42 there.
doktornotor said:
Otherwise, on a more serious note: ... see comment 42 there.
Click to expand...
Click to collapse
Thanks.... maybe I am too rookie for that... I installed QuickSSHd and logged in from my Putty but can't issue these commands:
# id
uid=0(root) gid=0(root) groups=0(root)
# adb remount /data
adb: not found
# sqlite3 /data/data/com.android.providers.settings/databases/settings.db
sqlite3: not found
So I searched but following issue:
# find / -iname adb
/sys/devices/virtual/usb_composite/adb
/sys/class/usb_composite/adb
# /sys/class/usb_composite/adb
/sys/class/usb_composite/adb: permission denied
adb is supposed to be used from your PC, need to install Android SDK there, not try to run it from phone shell.
Thanks, will try that out now and just installing JDK and Android SDK R11...
Ok. If you get permissions denied stuff, I would suggest loosely following this one:
http://dylanmtaylor.com/2010/10/19/closer-to-a-proper-froyo-limit-removal-fix/
For the remount /system thing, you need to check the actual device being mounted by running something like:
Code:
$ mount | grep /system
as it differs from device to device.
(Other way would involve getting ro.secure=0 which might be more complex than needed here. You can check what you have by getprop | grep ro.secure)

[ROOT] LG Optimus Logic (LGL35G)

Update: Friday November 2nd 2012
Fixed a bad upload of the su file, must of become corrupt sorry.
Silly permission bug again, but w/e. LG should know better, from what I am told this is a recently released device. This is a long standing known issue. Lg get your sh*t together.
Directions:
unzip su.zip into the current path (directory) you are in.
adb shell
(while in adb shell)
rm /data/local/tmp/profile_calib_m
ln -s /data/local.prop /data/local/tmp/profile_calib_m
exit
adb reboot
adb wait-for-device shell
(once in the adb shell again)
echo 'ro.kernel.qemu=1' > /data/local.prop
rm /data/local/tmp/profile_calib_m
exit
adb reboot
adb wait-for-device remount
adb push su /system/xbin/su
adb shell chown 0.0 /system/xbin/su
adb shell chmod 6755 /system/xbin/su
adb shell rm /data/local.prop
adb reboot
Once rebooted install superuser from the market:
https://play.google.com/store/apps/details?id=com.noshufou.android.su
As usual thanks for all your work for this GREAT community!!! :good:
Thanks for letting me watch you work & getting root for my wife's phone.
Edit: DroidHost of Androidarea51.com has made a OneClick for this phone using Jcase's root. it also installs a recovery & Superuser all at the same time.
androidarea51.com/***-all-things-
root-***-174/
Help Me Please
what do you do when it says permission denied or not permitted when waiting for device, remounting, or pushing su?
lol now all we need is someone to write different roms :>
cyanogen would be nice :> lol
thank you for rooting this phone :>
jcase, i pmd you i need help please
TechManPro said:
what do you do when it says permission denied or not permitted when waiting for device, remounting, or pushing su?
Click to expand...
Click to collapse
run adb shell
make sure your prompt is a # not a $. If it is a $ start over, if it is a # make sure you run adb remount.
jbach44 said:
lol now all we need is someone to write different roms :>
cyanogen would be nice :> lol
thank you for rooting this phone :>
Click to expand...
Click to collapse
No problem.
You actually left out a step. In order to push su to the phone you have to adb remount -o rw. Otherwise it is a read-only filesystem and it cannot be pushed to the phone. Most people would probably get this, but the novices who end up with bricked phones will be angry.
Great work!
iliekandroid said:
You actually left out a step. In order to push su to the phone you have to adb remount -o rw. Otherwise it is a read-only filesystem and it cannot be pushed to the phone. Most people would probably get this, but the novices who end up with bricked phones will be angry.
Great work!
Click to expand...
Click to collapse
Actually no, you are incorrect.
adb remount without the additional parameters is correct, and not possible of bricking a phone with adb remount. No novice would be angry, because there is not possible brick from this guide, as long as it is followed.
I got the LG for my daughter (13 going on 30), and now it works fine. Thanks jcase.
Did not unlock my lgl35g
Yes I am a Noob... nobody likes me
I have exhausted every resource that I could find on this phone. I thought that this post was the answer to my problem, however it did not seem to help at all. Everything seemed as if it was working fine as I went step by step through the process. However, I rebooted my phone and there is no difference then when I started. The "su.zip" file enclosed in this post was not able to extract into the directory of my ADB client. It kept saying root already existed, but I was unable to see it in windows explorer? Is this "su.zip" a modified version of a pre-existing file in the SDK kit? I really need to unlock this phone so that I can clean up the junk. Any help would be greatly appreciated.
jcase said:
Update: Friday November 2nd 2012
Fixed a bad upload of the su file, must of become corrupt sorry.
Silly permission bug again, but w/e. LG should know better, from what I am told this is a recently released device. This is a long standing known issue. Lg get your sh*t together.
Directions:
unzip su.zip into the current path (directory) you are in.
adb shell
(while in adb shell)
rm /data/local/tmp/profile_calib_m
ln -s /data/local.prop /data/local/tmp/profile_calib_m
exit
adb reboot
adb wait-for-device shell
(once in the adb shell again)
echo 'ro.kernel.qemu=1' > /data/local.prop
rm /data/local/tmp/profile_calib_m
exit
adb reboot
adb wait-for-device remount
adb push su /system/xbin/su
adb shell chown 0.0 /system/xbin/su
adb shell chmod 6755 /system/xbin/su
adb shell rm /data/local.prop
adb reboot
Once rebooted install superuser from the market:
Click to expand...
Click to collapse
anyone know of a way to SIM unlock this device? I have AT&T and would like to use it om there, i bought it for $30 on clist thinking net 10 would work with an AT&T SIM but was wrong, any help would be appreciated...
anyone know of a way to SIM unlock this device? I have AT&T and would like to use it om there, i bought it for $30 on clist thinking net 10 would work with an AT&T SIM but was wrong, any help would be appreciated...
Click to expand...
Click to collapse
What is weird about that is i put the sim in a iphone and it worked just fine!!! Best bet would be ebay for unlock...
I have the Net10 one that I put a Straight Talk SIM in with no problems if I can get my hands on a AT&T SIM today I'll check it out.
---------- Post added at 07:39 AM ---------- Previous post was at 07:34 AM ----------
NateDoggTN said:
Yes I am a Noob... nobody likes me
I have exhausted every resource that I could find on this phone. I thought that this post was the answer to my problem, however it did not seem to help at all. Everything seemed as if it was working fine as I went step by step through the process. However, I rebooted my phone and there is no difference then when I started. The "su.zip" file enclosed in this post was not able to extract into the directory of my ADB client. It kept saying root already existed, but I was unable to see it in windows explorer? Is this "su.zip" a modified version of a pre-existing file in the SDK kit? I really need to unlock this phone so that I can clean up the junk. Any help would be greatly appreciated.
:
Click to expand...
Click to collapse
Did you push the su binary file or the whole folder? If you pushed the whole folder you will have to remove the directory & start over.
how to run root
Sorry for sounding like a noob, but I am...when it comes to LG. im trying to root my homies LG optimus logic but im not sure where to run the command from. if some one could help me out on to where the zip should actullay be placed and unziped to that would be a big help, thanks. and if there is a thread already for this please hook up a link.
thanks
thanks mate for this
i appreciate your time.
Anyone know of a rooted ROM
I have looked all over, but it doesn't look like a dev has created a ROM for this device. Has anyone come across one? If I knew programming I would give it a shot, but it's a mystery to me. I know that CyanogenMod 9 for the L3 (e400) works, but there is a problem with the radios, hence no cellular, wifi, or bluetooth.
Source code......
http://www.lg.com/global/support/opensource/opensource-detail.jsp
http://forum.xda-developers.com/showthread.php?p=34104009
This guy had some success with CM9, but no radio. Anyone know how to extract the radio? I've never built a rom, but this is tempting.

[Q] MMS Fix for KitKatDS 1.3. Help a Noob Plz

Hi. As title says I need a fix for KitKatDS rom. I tried to post in that thread but it won't let me. I saw this fix in the thread but I don't know where you do this or if it works:
FYI - found a fix. If anyone is having issues sending/receiving MMS, do this:
(load up adb shell)
su
mount -o rw,remount /system
rm /system/bin/ip
ln -s /system/xbin/ip /system/bin/ip
IP on /bin errors out so the device is unable to route a connection to the MMS servers. the IP in /xbin works just fine
Can someone give a noob a walkthrough of how to do this? Thanks
Set up adb on PC and turn debugging on on phone, if you aren't sure how to do this a quick Google search will give you many guides.
Once this is working open a terminal/cmd and type
adb devices
If you a see a serial number than you are good, if not see the guide on setting up adb or ask question here if still stuck
Once all is working type
adb shell
Then type the exact commands you linked from above
Now for safe measure type
exit
adb reboot
You should be good (granted I'm not using this ROM currently and have not needed to attempt this fix, but looking at it, it makes sense and could work. Having said that always make a backup of current ROM in recovery before trying new things you don't fully understand)
Best of luck
Sent from my Nexus 7 using XDA Premium 4 mobile app
As I mentioned in the KK thread itself, I was able to run the fix without having to PC attach and adb shell. Just used the included terminal program with SU permissions, and the fix has held since day 1. I've sent & received plenty of MMS messages.

Categories

Resources