[ROOKIE][DEV][HOWTO] Permenant BN-OTA Update Block - Nook Color Android Development

From this thread:
http://forum.xda-developers.com/showthread.php?t=874871
Attached is a working sqlite3 binary.
Copy it to /system/bin
(I transfered it to my SD, then used rootexplorer (mount R/W) to copy into /system/bin))
you will now be able to edit sqlite databases on the nook itself.
--------------------------------------------------------------------------------
Attached Files sqlite3.7z (11.9 KB, 56 views)
--------------------------------------------------------------------------------
In your terminal:
$ adb pull /data/data/com.bn.devicemanager/databases/devicemanager.db devicemanager.db
$ sqlite3 devicemanager.db
sqlite> update registry set value='manual' where name='com.bn.device.fota.mode';
sqlite> .q
$ adb push devicemanager.db /data/data/com.bn.devicemanager/databases/devicemanager.db
$ adb reboot
Congrats Your NC is now permanently blocked from any future BN OTA auto updates.
No more build.prop spoof hacks for each release (sideload only),,,,,, yada yada
sleep like a baby.........with yur wifi on.

Nook got pissed and reset itself. Good thing I have backups.

bonzer2u, thanks! Just did it on my rooted (1.0.1 version) nook and so far no issues.

That reminds me that the prereqs are you need to be rooted with SU and ADB working.....DOH

Jeeeez and of course credit where credit is due...
JoshMiers - for providing the sqlite3 binary post.
and
ixampl - for providing the clues that lead me to find the appropriate db and setting to hack.
Finally, disclaimer: Apply and/or feel free to incorporate into your projects at your own risk, if your NC self distructs, yur on yur own......NOT

Instructions don't use sqlite3 binary on device
Your instructions work fine assuming that the computer connected to the NC has the sqlite3 binary installed. The sqlite3 binary you link to could be used to make the changes inside adb shell but it's not documented as such. Just wanted to give that note to help clear up anyone's confusion if they run into issues with the given instructions. Other than that, thanks for the tip!

The sqlite3 binary I posted is for use on the Nook itself. If you want to do that instead of doing adb pull/push just do this in an adb shell:
Code:
# sqlite3 /data/data/com.bn.devicemanager/databases/devicemanager.db
sqlite> update registry set value='manual' where name='com.bn.device.fota.mode';
sqlite> .q
# reboot

JoshMiers said:
The sqlite3 binary I posted is for use on the Nook itself. If you want to do that instead of doing adb pull/push just do this in an adb shell:
Code:
# sqlite3 /data/data/com.bn.devicemanager/databases/devicemanager.db
sqlite> update registry set value='manual' where name='com.bn.device.fota.mode';
sqlite> .q
# reboot
Click to expand...
Click to collapse
Easier then I thought, thanks again Josh....

hoban_eris said:
Your instructions work fine assuming that the computer connected to the NC has the sqlite3 binary installed. The sqlite3 binary you link to could be used to make the changes inside adb shell but it's not documented as such. Just wanted to give that note to help clear up anyone's confusion if they run into issues with the given instructions. Other than that, thanks for the tip!
Click to expand...
Click to collapse
If I understand you correctly, my PC is a dell win7-32 laptop and it doesn't have any sqlite3 installed binary on it? I did however use it to download and transfer the sqlite3 binary Josh posted to my nook??
Yes Josh mentioned the adb shell version above.
I did initially forget to mention you need to be rooted and have SU and ADB functioning as a prereq, my bad, but it is pretty obvious.....

If you have adb working on your PC, the chances are that you have sqlite binary on your PC since it seems to come with the android sdk in the tools folder (for example, android-sdk_r07-windows\android-sdk-windows\tools). When I did it on mine, I used the commands from the OP, and did it on the PC with nook connected, but didn't use the linked sqlite3 binary for nook).

droidseban said:
If you have adb working on your PC, the chances are that you have sqllite binary on your PC since it comes with the android sdk in the tools folder (for example, android-sdk_r07-windows\android-sdk-windows\tools). When I did it on mine, I followed your directions, and did it on the PC with nook connected, but didn't use the linked sqllite3 binary for nook).
Click to expand...
Click to collapse
Ahh I see now and didnt know that... I understand what you guys are referring to now.
Thanks for clearing that up, like my post title suggests, still just a rookie with the nook that is.....

We are all here to learn from each other.
Looking through the rest of the entries in the registry table, there is this entry: "com.bn.device.fota.next_connect_default_interval" which is set to the value 604800000. Assuming this is in milliseconds as usual, it translates to 7 days. So, nook is set to check for updates once every week. I guess you can try upping this number also to avoid the updates.

Adding a command to raise the udate check interval to a year to the steps from OP (NOTE: no space in "...default_interval". Not sure why the forum software is inserting it):
$ adb pull /data/data/com.bn.devicemanager/databases/devicemanager.db devicemanager.db
$ sqlite3 devicemanager.db
sqlite> update registry set value='manual' where name='com.bn.device.fota.mode';
sqlite> update registry set value='31557600000' where name='com.bn.device.fota.next_connect_default_interval';
sqlite> .q
$ adb push devicemanager.db /data/data/com.bn.devicemanager/databases/devicemanager.db
$ adb reboot

excellent, did you notice the download URL in the table as well?????
Someone suggested another way to perma-stop OTA would be to add the url
https://csqaint.barnesandnoble.com/bncloud/serviceG 127.0.0.1
to our hosts file?
Do you think this would work as well?

I would think so, but it might crash the process that checks for the updates.

bonzer2u said:
Someone suggested another way to perma-stop OTA would be to add the url
https://csqaint.barnesandnoble.com/bncloud/serviceG 127.0.0.1
to our hosts file? Do you think this would work as well?
Click to expand...
Click to collapse
No -- the hostname csqaint does not resolve outside BN.

I don't think it is directly going to https://csqaint.barnesandnoble.com/bncloud/serviceG. My guess is Nook goes to https://bncs.barnesandnoble.com/bncloud/oauthpage/BnOAuthMgmt.jsp to authorize the connection, establishes a VPN, and then move on to https://csqaint.barnesandnoble.com/bncloud/serviceG.

bonzer2u said:
From this thread:
http://forum.xda-developers.com/showthread.php?t=874871
Attached is a working sqlite3 binary.
Copy it to /system/bin
(I transfered it to my SD, then used rootexplorer (mount R/W) to copy into /system/bin))
you will now be able to edit sqlite databases on the nook itself.
--------------------------------------------------------------------------------
Attached Files sqlite3.7z (11.9 KB, 56 views)
--------------------------------------------------------------------------------
In your terminal:
$ adb pull /data/data/com.bn.devicemanager/databases/devicemanager.db devicemanager.db
$ sqlite3 devicemanager.db
sqlite> update registry set value='manual' where name='com.bn.device.fota.mode';
sqlite> .q
$ adb push devicemanager.db /data/data/com.bn.devicemanager/databases/devicemanager.db
$ adb reboot
Congrats Your NC is now permanently blocked from any future BN OTA auto updates.
No more build.prop spoof hacks for each release (sideload only),,,,,, yada yada
sleep like a baby.........with yur wifi on.
Click to expand...
Click to collapse
I like your method better than spoofing the build.prop of 1.1.
Would it be okay with you if I make this into a Clockwork update.zip ?

thecubed said:
I like your method better than spoofing the build.prop of 1.1.
Would it be okay with you if I make this into a Clockwork update.zip ?
Click to expand...
Click to collapse
Absolutely and goes for anyone it might be useful for......

I dont get sqlite 2
Hi All,
Noob quiestion,
I go in adb shell promt "#" by typing "adb shell" in command line.
when I type sqlite3 I get "sqlite3 : not found"
Am I missing anything?

Related

ADB Push Nautilus Script?

Is there an ADB push nautilus script out there?
That'll be handy, but i'm no scripting expert. I suspect it'll be bit tricky since adb is terminal only, I'm sure someone will have to figure out a way to pipe the output from terminal to GUI pop up dialog box to display progress bar, with success or failure message.
this one seem to work but no progress bar or success/fail message tho. YMMV
Code:
#/bin/sh
adb push $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS /sdcard
save this as adb_push.sh
be sure to set this file with permission:
Code:
chmod a+x adb_push.sh
think of this as rough draft, not perfect. Above code will push straight to sdcard. Suppose you could create few scripts like this..
ADB - Push to System APP
Code:
#/bin/sh
adb remount
adb push $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS /system/app
ADB - Install APK
Code:
#/bin/sh
adb install $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
EDIT: Forgot to mention this, it'll work only if you've already set path to Android's SDK tools folder in .bashrc
awesome, thanks! I'll test it in a minute
Simple scrip to push files to your android device.
Just put it in your Nautilus script dir (HOME/.gnome2/nautilus-scripts) and make it executable (chmod +x Push\ sdcard). also set path for ADB inside script (ADB=...)
I did something similar a while back for both Konqueror and Dolphin in KDE, but I realized, I just don't use a file manager since I prefer the command line instead. I had a working ADB zsh completion script, but somehow forgot to back it up before my previous hard drive failure.
https://code.google.com/p/send-to-android/
this is interesting

Rooted

All credit goes to the orig guy who made the d2 exploit
If you feel the need to donate money then he deserves it [email protected]
I made an easier to follow tutorial over here with pics. Sorry but I am tired of going back and forth so just go there if you are having problems. If you can follow simple adb commands just follow the directions below
Download and Install Samsung Drivers
64bit:
http://www.wikifilez.com/root files/epic4g/usb_drivers_GalaxyS_x64.zip
32bit:
http://www.wikifilez.com/root files/epic4g/SAMSUNG_USB_Driver_for_Mobile_Phones_x86.exe
1 Click Root Method
http://forum.androidcentral.com/fascinate-roms-hacks/33899-how-root.html
Manual Method
cd C:\android-sdk\tools
adb push C:\fascinate\su /sdcard/su
adb push C:\fascinate\rage.bin /data/local/tmp/rage.bin
adb push C:\fascinate\busybox /sdcard/busybox
adb shell
cd /data/local/tmp
chmod 0755 rage.bin
./rage.bin
wait....
when it brings you back to your original shell in windows then follow these commands
adb shell (you should see # this time instead of $ this is exactly what we want)
mount -t rfs -o remount,rw /dev/block/stl9 /system
cd /system/xbin
cat /sdcard/su > su
cat /sdcard/busybox > busybox
chmod 4755 su
chmod 4755 busybox
exit
adb install C:\fascinate\Superuser.apk
This is permanent.
I just updated the files here with the latest su / superuser.apk / busybox
Also check out my tutorial to fix the memory/lag issues for this phone
http://forum.xda-developers.com/showthread.php?p=8086738#post8086738
Dirrk said:
All credit goes to the orig guy who made the d2 exploit
I feel naked without my droid lol this phone is so light
adb push su /sdcard/su
adb push rage.bin /data/local/tmp/rage.bin
adb push busybox /sdcard/busybox
adb shell
cd /data/local/tmp
chmod 0755 rage.bin
./rage.bin
wait....
when it brings you back to your original shell or windows cmd promt
adb shell
mount -t rfs -o remount,rw /dev/block/stl9 /system
cd /system/xbin
cat /sdcard/su > .
cat /scard/busybox > .
chmod 4755 su
chmod 4755 busybox
exit
adb install Superuser.apk
Please let me know if I posted something wrong.
Click to expand...
Click to collapse
does it stick after reboot?
Its supposed to be a temporary root so i doubt it will.
This works on any android phone up to 2.2. I have confirmed this works on my epic, so th same sould work here.
Sent from my SPH-D700 using XDA App
see below.
confirmed root.
Had to use Superuser.apk 2.3.6.1 and the su binary in the package, but the rest worked.. except for that cat command? Why would you cat binary files instead of copying them? (not complaining, just curious). I just adb pushed them to /system/xbin, and adb shell chmod'd them.
You also have a typo near the end "scard" instead of "sdcard".
You can also use mv or cp. I just happen to use cat because I used it the other day rooting my friends stock 2.2 droid. Which required me to use cat.
And yes this is permanent
Cool, i tried using rm -rf to get rid of a directory I created accidentally, and was getting some syntax errors, so I wasn't sure how compatibile the command line on android was to linux.
Glad it's pretty close. Being very familiar with linux makes this pretty easy to understand. Day 1 with an android device was pretty darn fun. I think I'm glad I went this direction.
I just followed this and used the same files I had from my Droid 2 (just updated the Superuser.apk from this sites thread for it) and works perfectly. Rebooted phone did "adb shell" and "su" and still have root, so it is permanent
side note: steps say "/system/xbin" and assume you meant "/system/bin" like Droid 2 was. That's where I put them and it worked.
cliffr39 said:
I just followed this and used the same files I had from my Droid 2 (just updated the Superuser.apk from this sites thread for it) and works perfectly. Rebooted phone did "adb shell" and "su" and still have root, so it is permanent
side note: steps say "/system/xbin" and assume you meant "/system/bin" like Droid 2 was. That's where I put them and it worked.
Click to expand...
Click to collapse
It works either way, both are executable system folders. Glad you it worked for you, hopefully we can get some roms cooking soon and play catch up to the other galaxy s phones
doesnt work for me, i get an error device not found
ive type adb devices - device not found. usb debugging on, usb conneced on port 5037
xirnibor said:
doesnt work for me, i get an error device not found
ive type adb devices - device not found. usb debugging on, usb conneced on port 5037
Click to expand...
Click to collapse
Your USB mode might be set wrong. Flip it to whatever it's not at, and try again.
i forgot this laptop didnt have the updated usb drivers from android sdk, downloading then will try again. i have tried so far with the sdcard mounted and unmounted, while in usb debugging mode. will post after updates
How long do you actually have to wait after the execting the rage.bin file?
itznfb said:
How long do you actually have to wait after the execting the rage.bin file?
Click to expand...
Click to collapse
I dunno, ~20-30 seconds? Assuming sound is enabled you should hear the same USB device connected/disconnected sounds.
If you want to be 100% sure just wait like 90 seconds. I'm pretty sure it killed my shell though, so if it does that, you're good to go.
ok, adb recognizes the device *see below, however when i type adb push su /sdcard/su i get cannot stat 'su': no such file or directory. ?
C:\downloads\android\android\tools>adb devices
List of devices attached
I500a2d0087a device
namebrandon said:
I dunno, ~20-30 seconds? Assuming sound is enabled you should hear the same USB device connected/disconnected sounds.
If you want to be 100% sure just wait like 90 seconds. I'm pretty sure it killed my shell though, so if it does that, you're good to go.
Click to expand...
Click to collapse
ok... running the rage.bin locked up my device twice but on the third try it worked. another fascinate rooted
xirnibor said:
ok, adb recognizes the device *see below, however when i type adb push su /sdcard/su i get cannot stat 'su': no such file or directory. ?
C:\downloads\android\android\tools>adb devices
List of devices attached
I500a2d0087a device
Click to expand...
Click to collapse
su is a file (for our purposes right here, anyway). Unless you explicity specify its path, it needs to be in the same directory you're running the adb command from.
If you installed the Android SDK per guidelines, adb should be in your PATH environment variable, and you should be able to execute it from any directory. If you didn't do that, then for the sake of simplicity, copy all the files referenced in the original steps to your working directory. From your post above, it appears that is c:\downloads\android\android\tools\
I got stuck at cat /sdcard/su > . Is that supposed to be > .? It won't let me enter that...There's not something else that's supposed to be there?
EDIT: I get the same error faspalma
I'm stuck at that point too. cat /sdcard/su > . returns "cannot create .: is a directory"

[IMPROVED FIX] ADHOC Mode with scripts to switch between ADHOC and Infrastructure

This -> View attachment adhoc-switcher.zip <- archive includes the modified wpa_supplicant file that supports ADHOC mode, along with scripts to switch back and forth between the ADHOC mode wpa_supplicant and the stock (Infrastructure only) wpa_supplicant on your NC.
The included file adhoc-switcher.sh is will do all of the work for you.
From the included README file:
Unzip the archive View attachment adhoc-switcher.zip into the same directory as your adb binary.
Execute ./adhoc-switcher.sh in your adb binary directory.
# md5sum adhoc-switcher.zip
e682e1578df1a253f1e4c42fd89f37d5 adhoc-switcher.zip
When you run adhoc-switcher.sh, you will see the following output telling you what it is doing:
Code:
$ ./adhoc-switcher.sh
(1) Remounting /system as read-write...
(2) Making backup of original wpa_supplicant at:
/system/bin/wpa_supplicant.original...
(3) Making local backup of /system/bin/wpa_supplicant.original...
2070 KB/s (226036 bytes in 0.106s)
(4) Pushing up new files to /system/bin/...
wpa_supplicant.adhoc: 1662 KB/s (226028 bytes in 0.132s)
wpa_supplicant.infrastructure: 1711 KB/s (226036 bytes in 0.128s)
ap: 6 KB/s (271 bytes in 0.042s)
adhoc: 6 KB/s (253 bytes in 0.040s)
(5) Setting permissions on new files in /system/bin/...
(6) Setting Wifi mode to Infrastructure (ap)...
(7) Remounting /system as read-only...
All done!
To switch between Access Point (AP) [Infrastructure] mode and ADHOC mode,
execute the following commands on your NC:
# su
# ap
To switch to Access Point [Infrastructure] mode, execute the following
commands on your NC:
# su
# adhoc
You should turn off wifi before executing these commands.
Hope you find this useful.
John - your friendly neighborhood e-thug.
Thank you. Will give this a try.
Any chance of anyone creating a toggle widget that can toggle between both with a simple tap.
Sent from my SGH-T959 using XDA App
Very nice John. Good quick fix for the adhoc switching. Appreciate the effort.
Sent from the totally awesome Rooted Nook Color
rxr said:
Thank you. Will give this a try.
Any chance of anyone creating a toggle widget that can toggle between both with a simple tap.
Sent from my SGH-T959 using XDA App
Click to expand...
Click to collapse
I'd love to do that but, my netbook just isn't up to the task of running a full-on android dev environment. Over Christmas, I'll try to remember to bring the "big" laptop back with me.
If someone else beats me to it, that would be great too.
Maybe we could get the SoftKeys app to allow a new button to appear to toggle the wifi setting?
johnopsec said:
This -> View attachment 464007 <- archive includes the modified wpa_supplicant file that supports ADHOC mode, along with scripts to switch back and forth between the ADHOC mode wpa_supplicant and the stock (Infrastructure only) wpa_supplicant on your NC.
Click to expand...
Click to collapse
Hey there, Mr. eThug. Thanks for the update. But I didn't it was necessary. After installing the original fixed wpa_supplicant, I can connect to adhoc and infrastructure networks. Or is there something else I'm missing?
edison said:
Hey there, Mr. eThug. Thanks for the update. But I didn't it was necessary. After installing the original fixed wpa_supplicant, I can connect to adhoc and infrastructure networks. Or is there something else I'm missing?
Click to expand...
Click to collapse
The ADHOC capable wpa_supplicant has a bug that requires you restart wifi any time the NC sleeps. The original does not. Since my personal use is with standard Infrastructure (AP) connections primarily and ADHOC only on occasion, I decided that it would be handy to be able to switch between them easily.
You have a typo in the script, line 28 I think, should be "adb shell" and you have "db" shell.
Messes with permissions.
KitF said:
You have a typo in the script, line 28 I think, should be "adb shell" and you have "db" shell.
Messes with permissions.
Click to expand...
Click to collapse
I just verified from my local copy and also downloaded the archive I uploaded to the site. They're identical and in every instance, it is "./adb shell" just as it should be.
Any possibility you opened adhoc-switcher.sh in an editor and accidently deleted a character? Other than that, the MD5SUM of the original archive is:
# md5sum adhoc-switcher.zip
e682e1578df1a253f1e4c42fd89f37d5 adhoc-switcher.zip
Make sure that the MD5SUM matches for what you downloaded.
Oh that's right, I must have messed it up somehow converting it into a windows Batch file.
Any way we can get some sort of GUI app or a widget toggle for this? Seems like it would be handy for when I need to tether to my phone when there's no wifi around.
KitF said:
Oh that's right, I must have messed it up somehow converting it into a windows Batch file.
Any way we can get some sort of GUI app or a widget toggle for this? Seems like it would be handy for when I need to tether to my phone when there's no wifi around.
Click to expand...
Click to collapse
Cool. Glad we tracked that down!
I'd love a widget or app to switch between them. Two things though... This is a temporary "fix" for an issue. Once they get the bugs worked out of wpa_supplicant so it can support Infrastructure and ADHOC and not have the sleep issue, we won't need to switch back and forth between them. Second: I don't have a full-blown android dev platform to do an app or widget myself so, someone else would need to do it.
Maybe using gscript lite as was done here : http://www.chinadigitalcomm.com/android-a81/a81e-connect-to-ad-hoc-wifi-t1413-10.html
I suppose running sh scripts doesn't work on Windows?
nikescar said:
I suppose running sh scripts doesn't work on Windows?
Click to expand...
Click to collapse
Nope. But if you're up to the task, it should be easy for you to convert the script to winblowz .bat format for the most part.
I tried to modify the scripts to run through gscript and I thought it worked initially. Then when I went to switch it waste my wifi. Had to restore from the backup.
Gscripts would be nice I'm just not smart enough to do it.
Did you switch Wifi off before switching?
Also here's my converted .bat that I used:
Code:
echo
echo "(1) Remounting /system as read-write..."
adb shell "mount -o remount rw /system"
echo
echo "(2) Making backup of original wpa_supplicant at:"
echo "/system/bin/wpa_supplicant.original..."
adb shell "mv /system/bin/wpa_supplicant /system/bin/wpa_supplicant.original"
echo
echo "(3) Making local backup of /system/bin/wpa_supplicant.original..."
echo
adb pull /system/bin/wpa_supplicant.original
echo
echo "(4) Pushing up new files to /system/bin/..."
echo
echo -n "wpa_supplicant.adhoc: "
adb push wpa_supplicant.adhoc /system/bin/
echo -n "wpa_supplicant.infrastructure: "
adb push wpa_supplicant.infrastructure /system/bin/
echo -n "ap: "
adb push ap /system/bin/
echo -n "adhoc: "
adb push adhoc /system/bin/
echo
echo "(5) Setting permissions on new files in /system/bin/..."
adb shell "chmod 755 /system/bin/wpa_supplicant.*"
adb shell "chmod 755 /system/bin/ap"
adb shell "chmod 755 /system/bin/adhoc"
echo
echo "(6) Setting Wifi mode to Infrastructure (ap)..."
adb shell "ln -s /system/bin/wpa_supplicant.infrastructure /system/bin/wpa_supplicant"
echo
echo "(7) Remounting /system as read-only..."
adb shell "mount -o remount,ro /dev/block/mmcblk0p5 /system"
echo
echo "All done!"
echo
A bit messy but it works.
KitF said:
Did you switch Wifi off before switching?
Click to expand...
Click to collapse
Thanks for the bat.
What I was trying to do is modify the scripts to run through the gscripts app for Android. That way we could switch on the go a bit easier. Sure I could use a console emulator but one click (actually two) is what I was looking for.
I might give it a try later, the .sh files available here http://www.chinadigitalcomm.com/android-a81/a81e-connect-to-ad-hoc-wifi-t1413-10.html can be opened with a text editor and it looks like the command just "crushes" the file.
I can see the ad-hoc network created by my phone and I connect. But none of the web-based apps are working. Says I am connected but no data comes through. Any ideas?
The .bat file is a good idea.
I factory reset my Nook again (tried to return it for one that flickers less). I had to go through this again. I was distracted when going through the commands and had mucked something up - Wifi wouldn't start back up at all after I tried to switch back and forth. But I knew it worked because I had it working yesterday.
Poked my head in and checked security (ls -l /system/bin) , I could tell the security of the files didn't match. Looks like I missed one or two of the chmod commands (kids were probably distracting me). Fixed 'em up and it's working fine now.
At least with a .bat file or the like, there's less chance for a typo.

[GUIDE] Basic Unix/Linux command to use with ADB SHELL

So I have been reading quite a few threads here on XDA, and the one thing I noticed for noobs to linux/unix world is that they are struggling with some basic command once adb shell is gained. I decided to whip out this quick tutorial to help those noobs out to become more of an expert...like me...lol j/k
Here we go:
Prerequisites:
You must know how to invoke a adb shell command already to drop into your phone.
ALL commands in Unix/Linux are case sensitive
For more details, go to this ADB tutorial (very good one): http://forum.xda-developers.com/showthread.php?t=517874
Let's get going:
Once a shell is gained via adb, let's look at some of the basic commands you can do to navigate around the filesystem. Note: you must remove the double-quotes (") for the actual command.
Code:
"cd" = is change directory
to change to any directory, you type: cd dir_name (where dir_name is a full path)
Example: I want to go to /data/local/tmp in my phone, I would do
cd /data/local/tmp <hit ENTER>
You can also use the ".." to go UP one directory.
Example: I'm in /data/local/tmp and I want to go up to /data folder, a command would be: cd ../.. alternatively, if I do cd .. then i'll drop into /data/local folder instead.
Code:
"ls" = list files/directories
to list files/directories within a folder, the command should be:
ls <hit enter> => this will list all NON-HIDDEN file/directories within your CURRENT directory.
ls /data/local/tmp => this will list all NON-HIDDEN file/directories within /data/local/tmp directory.
ls -l => this will list all NON-HIDDEN file/directories within your CURRENT directory, plus additional details. Consider this is like a "Details" view in Windows Explorer.
ls -a => this will list all files/directories (including hidden files) within your CURRENT directory.
ls -la => this will list all files/directories (including hidden files) within your CURRENT directory, plus details.
Code:
"chmod" = change mode
Goes to wikipedia for more details: https://secure.wikimedia.org/wikipedia/en/wiki/Chmod
Most commonly used modes on android phones are:
"755" or "777".
So if you have a root.sh shell script that you downloaded from XDA, and uploaded to your phone and try to execute it with ./root.sh and it said "Permission denied". That means your script does not have the execute permission. You need to do:
chmod 755 root.sh <hit enter>
[B]IMPORTANT: There is *NO* negative sign (-) in front of the mode bit. So it is NOT chmod -755 root.sh[/B]
If you get a "File or directory not found" error, which means you are chmod-ing a file that doesn't exist in your current directory. To execute a chmod on root.sh in /data/local/tmp you do:
chmod 755 /data/local/tmp/root.sh
If you want to chmod an ENTIRE DIRECTORY and ALL files underneath it you do:
chmod -R 755 /data/local/tmp => this will set /data/local/tmp and ALL files/folders underneath it to be 755.
Code:
"chown" = change ownership
Go to wikipedia for details: https://secure.wikimedia.org/wikipedia/en/wiki/Chown
Most common used chown for android is: "root:root" or "root:shell"
Example: if you want to change ownership of root.sh to root:shell then you do:
chown root:shell root.sh
NOTE: the -R (recursive) option is also available for chown.
chown -R root:shell /data/local/tmp
Code:
"pwd" = print working directory
so when you are within a directory and you want to know which directory you are in, then you issue the command:
pwd <hit enter>
The system will reply back with the currently directory you are in.
I'll try to add more if I think of anything else useful, or if you have suggestions, please feel free to add.
so what does it mean to add adb to your path? thats holding me back from temp rooting on my mac. Im a total adb noob clearly.
hockey4life0099 said:
so what does it mean to add adb to your path? thats holding me back from temp rooting on my mac. Im a total adb noob clearly.
Click to expand...
Click to collapse
The easiest way to explain it is that you can run ADB from anywhere...do a search and you can find a more detailed (and more proper) explanation and directions on how to set it up.
hockey4life0099 said:
so what does it mean to add adb to your path? thats holding me back from temp rooting on my mac. Im a total adb noob clearly.
Click to expand...
Click to collapse
What OS are you using?
vboyz103 said:
What OS are you using?
Click to expand...
Click to collapse
mac
______________
hockey4life0099 said:
mac
______________
Click to expand...
Click to collapse
Like I said, do a search on XDA...there's a great guide on how to set up ADB properly. I'll link to it tomorrow when I get on the computer.
-- Sent from my 3VO Shooter --
hockey4life0099 said:
mac
______________
Click to expand...
Click to collapse
If you use mac, open a Terminal, and you should be at your home directory and type:
nano ~/.profile
if the .profile doesn't exist yet, then you'll see an empty.
Put this into the file
PATH=$PATH:/path/to/your/android/platform-tools
export PATH
save and exit out of Nano, and type:
source ~/.profile
then after this type adb and if adb is in your PATH then you see adb help.
Overview Of Permissions via ADB SHELL
Example = drwxrwxrwx
To Check Permission at anytime in ADB just Type:
ls -l
The First character defines the Directory, Link, Binary.
Below are some examples
Example = d---------
d = Directory
l = Link
b = Binary
The next 9 characters define the file permissions. These permissions are
given in groups of 3 each.
The first 3 characters are the permissions for the owner of the file or directory.
Example = -rwx------
The next 3 are permissions for the group that the file is owned by.
Example = ----rwx---
The final 3 characters define the access permissions for everyone not part of the group.
Example = -------rwx
There are 3 possible attributes that make up file access permissions.
r - Read permission. Whether the file may be read. In the case of a
directory, this would mean the ability to list the contents of the
directory.
w - Write permission. Whether the file may be written to or modified. For
a directory, this defines whether you can make any changes to the contents
of the directory. If write permission is not set then you will not be able
to delete, rename or create a file.
x - Execute permission. Whether the file may be executed. In the case of a
directory, this attribute decides whether you have permission to enter,
run a search through that directory or execute some program from that
directory
In addition to the file permission, you can also modify the owner and
group of the file. The chown program is used here and its syntax is very
simple. You need to be the owner of a file or root to do this.
Understanding Owner Permissions:
The first command is for owner ID, the Second Command is for Group ID.
exp. root.root ( First Root is owner, Second Root is Group ).
Chmod 644 some file, Like Build.prop For testing & then Veiw the Resulted Changes!
Refer to the table below as a quick reference.
Command Line for Both would look like this
chmod 644 build.prop = -rw-r--r--
\/
Chmod Guide
0 - ---
1 - --x
2 - -w-
3 - -wx
4 - r--
5 - r-x
6 - rw-
7 - rwx
SH Chown Guide
\/
chown root.root build.prop
root.root = Root
root.shell = Shell
Busybox SH Chown Guide
\/
chown 0.0 build.prop
0.0 = Root
0.2000 = Shell
I'll update the chmod with more with More Complex Commands Later
Side Note:Always set owner ( chown ) before Setting Permissions ( Chmod )!
Hope this Clears up things & is Helpful to everyone
~Eugene373​
Add adb to your path in Windows.
As has been explained above all it does is allowing your adb to be called out from any location.
To set it in windows you will need to add path to your adb.exe file to your PATH in widows XP or CLASSPATH in windows7.
You can find it in start->contro panel->system->advanced.
There is a tab called "Inviromental Variables".
Click on that tab and new window will pop up. New window has 2 field in it. We are interested in bottom field called "System variables".
Windows XP user should look for line with variable "Path".
Click that line and choose edit below. New pop up will apear and you can edit path line in there. You should add path to your adb.exe to that line.
Example.
I did install windows sdk in c:\android\android-sdx-windows so my adb.exe file is in that folder. I did add path to that folder in "Paht" line of system variables. Add path to your adb.exe after semicolon.
;c:\Location\of folder\where you have\adb exe file\
Save changes, apply them. Now you can use call for adb commands from any location.
Widows 7 users.
Same changed need to be appied as for Windows XP.
There is only one difference that that path in Inviromental variables in windows7 is called "CLASSPATH".
Rest is same. Just add the path to folder containing your adb.exe file to CLASSPATH line and you would be able to use adb in any location.
Hope this make sense and will help.
My mac keeps sayin no device but I can access adb from anywhere basically its in my path but won't pick up my phone
Sent from my PG86100 using XDA Premium App
snoopy1e11 said:
My mac keeps sayin no device but I can access adb from anywhere basically its in my path but won't pick up my phone
Sent from my PG86100 using XDA Premium App
Click to expand...
Click to collapse
Make sure your phone is in debugging mode.
ADB won't see phone if debugging is not enabled.
It is on
Sent from my PG86100 using XDA Premium App
I'm a windows user.
Can't think of anything else.
Sorry.
agat63 said:
Make sure your phone is in debugging mode.
ADB won't see phone if debugging is not enabled.
Click to expand...
Click to collapse
If you have USB debugging turned on, you should see a triangle with exclamation mark on task bar. Secondly, try to do this:
adb kill-server => kill off current server first
then
sudo adb devices => u need to enter password
Basically, you are running adb with escalated privilege, sometimes it needs root access.
This is Wat I got
Sent from my PG86100 using XDA Premium App
snoopy1e11 said:
This is Wat I got
Sent from my PG86100 using XDA Premium App
Click to expand...
Click to collapse
hmmm interesting...just wondering if you have your device turned on to be disk usage instead of just Charge Only?
Check on your desktop to see if you SD card had mounted, not sure if it makes a difference but worth a try. Another thought is that maybe your USB port doesn't work?? Did you check your phone to see if you have a triangle with exclamation mark in it on the task bar? (to the left)
Also, try it on a different computer if u can, and if it still doesn't work, afraid urs is defective.
I really appreciate ur help I re did the sudo command and hit "adb devices connect" and my device popped up
Sent from my PG86100 using XDA Premium App
snoopy1e11 said:
I really appreciate ur help I re did the sudo command and hit "adb devices connect" and my device popped up
Sent from my PG86100 using XDA Premium App
Click to expand...
Click to collapse
Ha, interesting cuz I never have to issue that command. Good to know you got it to work.

Hosts file

I am trying to update my hosts file and have done so on CM7.1RC1 (the best Rom so far), its proporly formatted as I do this all the time on my linux boxes but for some reason on my gtab it does not work. With oenvpn enabled and working I cannot reach items by name as stated in my hosts file.
Question .. does the /etc/hosts file work the same on the gtab as it does on all other operating systems? If so then ideas of what to look for to resolve this?
brwatters said:
With oenvpn enabled and working I cannot reach items by name as stated in my hosts file.
Click to expand...
Click to collapse
Try both pings (the android one in /system/bin and the busybox one in /system/xbin--you may only have one on some firmwares) to check.
Question .. does the /etc/hosts file work the same on the gtab as it does on all other operating systems? If so then ideas of what to look for to resolve this?
Click to expand...
Click to collapse
Yes--but programs have to use it. The busybox utilities all use it and the stock browser also; don't know about openvpn.
Are the permissions set correctly on /etc/hosts (actually, /system/etc/hosts)? It should be readable for all users.
The issue is that the hosts file (/etc/hosts) in GTab is readonly and the device has to be rooted to edit the file. Now I have not been able to root my GTab running Gingerbread. This makes it impossible to effectively use VPN to access the corporate network. I tried to create another hosts file in /system/bin folder but it would not let me save anything in that folder. Without being able to edit the /etc/hosts file VPN seems to be of limited value in GTab.
Any ideas?
There is no need to "root" a gTab running a custom ROM. If an "adb shell" command works, then you have root permissions. Same thing if you download and install the Superuser app from Market.
To edit /system/etc/hosts, install Root Explorer from the Market. This will let you remount /system read-write easily. Once remounted, just edit the hosts file.
To edit the hosts file on the command line:
Code:
C:\> [B]adb pull /system/etc/hosts .[/B] [I]Get the hosts file[/I]
[I]Edit the file on the PC[/I]
C:\> [B]adb remount[/B] [I]Remount /system read-write[/I]
C:\> [B]adb push hosts /system/etc/hosts[/B] [I]Put the file back[/I]
C:\> [B]adb shell chmod 644 /system/etc/hosts[/B] [I]Set the correct permissions[/I]
Reboot the tablet after this.

Categories

Resources