How to : Remove ads on HTC Legend - Legend Themes and Apps

I know this tutorial is everywhere on this forum. But with HTC Legend, it's a little different.
Read the tutorial here : http://forum.xda-developers.com/showthread.php?t=695411
Now I'll make it simple, just do this :
Your Legend must be rooted!
Step 1 : Download host file from the attach at the end of the post and unzip it to get the hosts file
Step 2 : Copy hosts to ADB folder (in my case : C:/android/tools) download Android SDK here
Step 3 : reboot your Legend to recovery mode (Install Rom manager on Market, Flash recovery, than reboot into Recovery mode)
Step 4 : Open Command window (Start menu > Run > cmd (windows xp) / Start menu > cmd (windows 7))
Step 5 : point to your adb folder
In my case :
cd\
C:\cd android\tools
Click to expand...
Click to collapse
Step 6 :
C:\android\tools\adb shell mount /system (Enter)
C:\android\tools\adb push hosts /system/etc/hosts (Enter)
C:\android\tools\adb reboot (Enter)
Click to expand...
Click to collapse
Step 7 : Done.
Note : This hosts file was updated long time ago, so it might not work with new apps. But it will disable most of the apps.

Very nice!

Does this work? It did not work on my Legend. I just cant get into shell when in recovery.
Precisely, "adb shell" gives an error!

"an" error!
BTW the file hosts works for me, and not a single ad is shown on my cell

Isn't our recovery just pressing volume down + power then go to recovery and wait for the "!" ? cause if I try adb shell then, it tells me:
Code:
-exec '/system/bin/sh' failed: no such file or directory (2)-
am I in the wrong recovery?
it is saying I'm in recovery when asking for the "adb devices" command
EDIT: found what I was doing wrong, didn't know you needed to run the recovery-windows.bat file first
EDIT 2: still having adds (in astro)

Does this thing removes adds out of free aplications, that usually have them?

I updated the instruction, I hope it's easier for you to follow every steps.
Does this thing removes adds out of free aplications, that usually have them?
Click to expand...
Click to collapse
It blocks the apps from connecting to the ad server. And yes, it does remove every single ad from free applications.
@Jonas : please follow the new instruction.

If you would use this MOD, you would be able to write to system partition thus installing AdFree from market would be possible.

I get..
Code:
C:\Users\parker\Downloads\android-sdk_r06-windows\android-sdk-windows\tools>adb shell mount /system
- exec '/system/bin/sh' failed: No such file or directory (2) -
NVM read above posts; ran Windows-recovery.bat - pushes the host.txt to the phone, now rebooting to see if it removes ads.
edit II: removes ads out of Advanced Task Killer but it keeps trying to load the ads so would that mean that its still pinging a server because that could use up a lot of data couldn't it if it keeps running?

parker09 said:
...so would that mean that its still pinging a server because that could use up a lot of data couldn't it if it keeps running?
Click to expand...
Click to collapse
Nope. Did you even look what's inside of that hosts file? There are adresses of ad servers pointing to localhost (that's your phone itself)...

BlaY0 said:
Nope. Did you even look what's inside of that hosts file? There are adresses of ad servers pointing to localhost (that's your phone itself)...
Click to expand...
Click to collapse
Oh okay I see now, thanks for that.

awesome thanks

Updated a really big hosts file (blocks almost every ads)

when i press C:\android\tools\adb push hosts.txt /system/etc/hosts (Enter)
it tells me theres no hosts.txt
the file i downloaded is just host there is no .txt
so what do i do?

how would i know whether i have succeeded or not?

This is what i did:
C:\>cd\androidsdk\tools
C:\AndroidSDK\tools>adb shell mount /system
C:\AndroidSDK\tools>adb push hosts.txt /system/etc/hosts
cannot stat 'hosts.txt': No such file or directory
C:\AndroidSDK\tools>adb push hosts /system/etc/hosts
1246 KB/s (0 bytes in 1236506.000s)
C:\AndroidSDK\tools>adb reboot
"host.txt" did not work so i tried just "host"
is it correct?

knnhzx said:
This is what i did:
C:\>cd\androidsdk\tools
C:\AndroidSDK\tools>adb shell mount /system
C:\AndroidSDK\tools>adb push hosts.txt /system/etc/hosts
cannot stat 'hosts.txt': No such file or directory
C:\AndroidSDK\tools>adb push hosts /system/etc/hosts
1246 KB/s (0 bytes in 1236506.000s)
C:\AndroidSDK\tools>adb reboot
"host.txt" did not work so i tried just "host"
is it correct?
Click to expand...
Click to collapse
Yes, change hosts.txt to hosts. When I wrote this tutorial, the file was hosts.txt but then I changed a better one (block more ads) : hosts
how would i know whether i have succeeded or not?
Click to expand...
Click to collapse
Open the app with ads and see the difference...like Angry Birds or Advanced Task Manager,.etc...

The only working method is in my signature link. Replace mtdblock4 with mtdblock3.

chinmoykanjilal said:
The only working method is in my signature link. Replace mtdblock4 with mtdblock3.
Click to expand...
Click to collapse
This tutorial was being something about changing "mtdblock4" to "mtdblock3". But then I figured out we don't need that complicated command.
Just do
Code:
adb shell mount /system
is enough for our legend.

What's the benefit in having ads removed besides them not showing up and less net traffic (even if the traffic is not so high due to this)? The apps still have that space for ads even if they're not showing up, plus I got frequent restarts of the application. After one day trying this, I've deleted the hosts file, at least now the apps ARE working. And finally if one doesn't like ads there's allways the option for buying/donate...that is also supporting development

Related

[Tutorial] Root Without Unlocking (Alternative way for all ROMs Vodafone,Korean,US)

Mod Edit: Unstickied, placed link in wiki:http://forum.xda-developers.com/wiki/index.php?title=Nexus_One Thanks ​
This is an alternative approach of rooting the Nexus without touching the bootloader.
-no downgrade neccessary
-no battery modification neccessary
-no messing around with SD card slot
-you don't even have to open your phone...
Working and confirmed for ALL ROMs, including European Vodafone EPF30/FRF91, Korean FRF91, AT&T/T-Mo Stock including FRF91
-------
Credits:
-------
- The Android Exploid Crew:
http://c-skills.blogspot.com/2010/07/android-trickery.html
- Amon_RA
- cyanogen
-------
Notes:
-------
- The exploit wasn't found by me (see credits), I just implemented it as a proof of concept for the Nexus One
- Basically this method should work on all currently known ROM versions.
- I tested it on EPF30, Korean FRF91, Vodafone FRF91, US Stock FRF91.
- As usual when doing this kind of stuff: DO THIS AT YOUR OWN RISK.
- It could even work on other Android devices as long as their system partition is at
/dev/block/mtdblock3/ with yaffs2 file system and there is still some space left on the system partition (without any changes).
-------
Prerequisites:
-------
- Locked Nexus One
- Latest Android SDK incl. USB drivers
- Working ADB
- The file "freenexus.zip"
edit:
get it here:
http://multiupload.com/MVT98F5HBY
or
http://dl.dropbox.com/u/1327667/freenexus.zip
MD5: 947C20222056D7C070733E7FCF85CF15
-------
Step-by-step guide:
-------
1. install android sdk & USB drivers
2. extract the content of the zip file into the tools directory of SDK (i.e. \android-sdk-windows\tools)
-> For all Newbies: Take care that you extract the files directly to the tools folder and don't create a new subdirectory freenexus within tools!!! If you did, delete the folder and extract again!!! Check twice that there is no FOLDER freenexus in your tools directory before you continue!!!
3. open a command prompt (Windows: Start, Run, "cmd", OK; Linux: Terminal)
4. change to SDK tools directory (i.e. cd \android-sdk-windows\tools)
5. connect Nexus to USB and check if debugging mode is activated
(Settings/Application/Development/USB Debugging)
6. run "adb devices" in shell and see if there is a device listed. if not back to step 5 or reinstall USB-drivers
7a. for Windows: run "freenexus.bat" in command shell (this copies the neccessary files to /data/local/tmp)
7b. for Linux or manual installation: run the following commands
Code:
adb push freenexus /data/local/tmp/freenexus
adb push Superuser.apk /data/local/tmp/Superuser.apk
adb push su /data/local/tmp/su
adb push busybox /data/local/tmp/busybox
adb shell chmod 755 /data/local/tmp/freenexus
adb shell chmod 755 /data/local/tmp/busybox
8. run the following commands:
Code:
adb shell
(you should see a "$" prompt now)
cd /data/local/tmp
9. on your phone go to a screen where you can easily toggle wifi (widget or settings/wireless)
10. be prepared to toggle wifi immediately after you execute the next step
11. run
Code:
./freenexus
12. toggle wifi on
13. you should see something like that:
[*] Android local root exploid (C) The Android Exploid Crew
[*] Modified by ak for HTC Nexus One
[+] Using basedir=/sqlite_stmt_journals, path=/data/local/tmp/freenexus
[+] opening NETLINK_KOBJECT_UEVENT socket
[+] sending add message ...
[*] Try to invoke hotplug now, clicking at the wireless
[*] settings, plugin USB key etc.
[*] You succeeded if you find /system/bin/rootshell.
[*] GUI might hang/restart meanwhile so be patient.
13b) if you get "permission denied" error, you have most likely not followed the big red newbie hint after point 2. check this by entering "ls -l", if you see a "drwxr-xr-x" and not "-rwxr-xr-x" in front of the line where freenexus is listed you did not follow properly. Search the posts in the thread on how to correct this.
14. run
Code:
rootshell
15. if you succeeded you will be asked for a password, if not try again from step 10
16. enter the password "freenexus"
17. now you should see a "#" as a prompt -> you are root now
18. run the following commands:
Code:
./busybox cp busybox /system/bin
chmod 4755 /system/bin/busybox
busybox cp Superuser.apk /system/app
busybox cp su /system/bin
chmod 4755 /system/bin/su
rm /system/bin/rootshell
exit
exit
19. Check if you keep root rights:
Code:
adb shell
su
20. after you executed the su command the Superuser app on your device should ask you for allowance
21. you should see the "#" prompt again, if you didn't get that try su again
22. done
-------
Comments:
-------
- General
If you are not planning to wipe your data partition (what you probably will do when installing CM6 first time) you should think about deleting all the temp files still lying in /data/local/tmp (for safety reasons and to have more space on /data):
Code:
adb shell
cd /data/local/tmp
rm busybox
rm su
rm Superuser.apk
rm freenexus
rm flash_image (will only exist if you executed the steps below in recovery section)
- Installation of Custom Recovery
If you only want root rights you are done here. If you want to install custom ROMs you have to install
a custom recovery first. Easiest way would be to download "ROM Manager" from the market. There are plenty of tutorials on how to install custom recovery/ROM at xda.
Edit: It is safer to install the recovery manually. In this case or for those of you running into problems with installing custom recovery with ROM Manager (doesn't stick) you can continue with
these steps (without remount of system partition, now tested successfully):
1) Download recovery-RA-nexus-v1.7.0.1.img to the root directory of your SD-Card
- Note: UnMount your SD-Card after copying these files, but keep your phone plugged in
- or don't mount SD-Card at all and push the file via adb to /sdcard
2) Save file "flash_image" to sdk tools directory:
3) In your terminal run
Code:
adb push flash_image /data/local/tmp/flash_image
adb shell
su
- At this point, it will hang until you choose "Allow" on your phone with the SuperUser app pop-up
- $ should now be replaced with #
5) run the following commands:
Code:
[COLOR="Red"]mount -o rw,remount /dev/block/mtdblock3 /system[/COLOR]
cd /data/local/tmp
chmod 755 flash_image
[COLOR="Red"]./flash_image recovery /sdcard/recovery-RA-nexus-v1.7.0.1.img[/COLOR]
rm /system/etc/install-recovery.sh
rm /system/recovery-from-boot.p
(and if everything worked fine:)
rm flash_image
Alternatively you can continue with step 9 and then steps 16-24 from the old rooting method tutorial
to manually install Amon_RA's recovery. You will also need the file flash_image for that (link taken from HBOOT thread).
- HBOOT
If you rooted from a Korean Rom or have installed the latest Vodafone Rom via PASSIMG you probably have
HBOOT 0.35 which makes it currently difficult to install Cyanogenmod (there is an assertion failure in the install script, at least with CM6 RC1/2. Maybe future versions of CM6 will include HBOOT 0.35 in the script) or other custom ROMs. (You are still on 0.33 if you just installed the Vodafone OTA Update)
There is a tutorial to revert HBOOT here:
http://forum.xda-developers.com/showthread.php?t=726258
Instead of using the EPF30 image you can also use any other PASSIMG file (at least if it has HBOOT 0.33,
otherwise this step wouldn't make sense...)
Note that when flashing a PASSIMG with a different HBOOT version there is a reboot after the HBOOT has been flashed, then after reboot the PASSIMG will be loaded again and the rest of the image will be flashed.
To check HBOOT and Radio version: press and hold trackball while turning on the phone. To exit select Reboot with Vol+/- and press Power button.
Caution:
After you have reverted your HBOOT, you have lost your root rights and you are back on stock recovery.
But you can (or have to) repeat the above procedure to get root rights back.
Edit:
The downgrading also downgrades your radio!!! Before installing CM6 you have to flash a Froyo Radio!
Latest one can be found here:
http://forum.xda-developers.com/showthread.php?t=723839
-------
Troubleshooting:
-------
After trying to flash a custom ROM with ROM Manager one user wasn't able to boot the phone normally and also no longer able to boot to recovery. In this rare case try to download a compatible PASSIMG file:
For example EPF30 (Europe Vodafone 2.1)
http://shipped-roms.com/shipped/Pas...ogle_WWE_1.14.1700.1_EPF30_release_signed.zip
or FRF91 (Europe Vodafone 2.2):
http://shipped-roms.com/shipped/Pas...on_VF_2.15.151.5_R_FRF91_MFG_Shipment_ROM.zip (<-this one is currently a zip in zip. You have to extract it once to get the working PASSIMG.zip)
(Appropriate US-PASSIMGs can also be found on shipped-roms.com, most likely EPE76)
Rename the file to PASSIMG.zip (case sensitive, Windows users take care that the file isn't called PASSIMG.zip.zip hidden extension)
Copy it to main folder of SD card.
Boot phone into Bootloader mode (press and hold trackball when turning on the phone, until fastboot mode starts)
Select Bootloader mode by pressing power button.
The bootloader should then start to analyse the PASSIMG.zip and ask you afterwards to install it.
You're phone (not your SD) will be completely wiped after the procedure but should work again (and can be rooted again...)
sweet!! been waiting for this! will try it tomorrow as soon as i wake up! will report back then!
edit: i cant download freenexus.zip maybe use another hoster?
file section edited.
Great tutorial ! Waiting for some feedbacks
(file link doesn't work)
dolomiti7 said:
file section edited.
Click to expand...
Click to collapse
On the left I can see just an empty folder named "SmartDrive"
link doesn't work
dolomiti7 said:
-> after clicking on "Smartdrive Gastzugang starten" you might get an error message, but after klicking ok on the error message
you should be able to access the folder "nexus" on the left side of the window anyway
Click to expand...
Click to collapse
No way! Can't do anything even after i press ok on the error message
if you click on that there should be a subfolder "nexus" that should be clickable too. at least it works here... anyway. someone wants to upload the file to a hoster? rapidshare... contact me
for the early adaptors (will only work 10 times):
rapidshare.com/files/409266634/freenexus.zip
MD5: 947C20222056D7C070733E7FCF85CF15
multiple download sites!:
http://www.multiupload.com/MVT98F5HBY
or here:
http://dl.dropbox.com/u/1327667/freenexus.zip
thank you. added the link.
This worked flawlessly.
Massive thanks.
Hi, I have a Italian Vodafone Nexus One with FRF91, i have followed all the steps and now in my apps there is Superuser Permission with green light. It means that i have root rights? Can I install Cyanogen Mod now? Thanks, excuse my English.
Worked perfectly on a stock AT&T N1 with FRF91. Thanks!
Excellent tutorial step by step...great work!
Can i change the password at the end?
So once gaining root, I can flash a custom recovery with rom manager without braking/unlocking the boot loader?
@fc_themaster:
if the superuser app popped up at step 19/20 then you have root rights. you can try to install ROM Manager from the market and install a custom recovery with that porgram. it also needs root rights so superuser should pop up again at that point.
@PSeeCO: you don't need to change a password. the password was only used for the temporary rootshell which you (hopefully) deletetd with the command "rm /system/bin/rootshell" in step 18. From that point on root rights are controlled via the Superuser app. If you install an already rooted custom ROM it is obsolete anyway.
@jivemaster: yes, we can! just use ROM Manager from the market to install custom recovery.
dolomiti7 said:
@PSeeCO: you don't need to change a password. the password was only used for the temporary rootshell which you (hopefully) deletetd with the command "rm /system/bin/rootshell" in step 18. From that point on root rights are controlled via the Superuser app. If you install an already rooted custom ROM it is obsolete anyway.
Click to expand...
Click to collapse
Perfect, thank you so much!

Java on Weptop Firefox

I finally managed to get java to work with firefox. I test out runescape and it works great on minimum graphics setting may be able set higher.
Im on 4.1.8.3 with full ubuntu mod. HAS NOT BEEN VERIFIED WITH AN UNMODDED WEBTOP
Here a little guide that I wrote. It should work
Basically
Google Java arm and click Java Embedded
Download ARMv7 Linux - Headful from there
Extract the ejre1.6.0_25 folder and move to phone
Copy the ejre1.6.0_25 folder to
/usr/lib/
Ingore this code if you are running from lxterminal
Code:
su
/usr/bin/sudo -u adas bash
In lxterminal or whatever terminal
Code:
sudo ln -s /usr/lib/ejre1.6.0_25/lib/arm/libnpjp2.so /usr/lib/firefox-addons/plugins/libnpjp2.so
sudo chmod 755 /usr/lib/ejre1.6.0_25/bin/java
sudo chmod 755 /usr/lib/ejre1.6.0_25/bin/java_vm
sudo chmod 755 /usr/lib/ejre1.6.0_25/bin/javaws
sudo chmod 755 /usr/lib/ejre1.6.0_25/bin/keytool
If you get "link failed File exists" run this. then run the ln command
Code:
sudo rm /usr/lib/firefox-addons/plugins/libnpjp2.so
You can also use root explorer to set permission for the files
Set to this:
read write execute
X --- X----- X
X ---------- X
X ---------- X
Then it should work
I attach a screenshot of runescape running
I'd like more information if you would regarding the installation of java as I am a diehard runescape fan myself. I've downloaded the Java embed but it was version _25 and not _21, not sure if it matters. And also, do I have to be rooted or not?
If you come pm me or reply here, that would be great.
I tried this and was able to get the plugin to load, but all I get is black boxes where the applets are. Any ideas? The java plugin shows under plugins. I'm using 1.6.0_25.
I'd like to know how you exactly got it to work? I cant get the lxterminal to run on my webtop, I'm really new and found out basically everything else but how to install the plugin. Thanks for the info.
And according to a thread on xda, cant remember which - the lxterminal was removed from the phone on the most recent update... so how would I get around that?
I did all the commands using Android Terminal Emulator from the Market.
Are you fully updated on your phone? as in 4.1.8.3
because ive tried more than once to get it to work. and no avail.
exactly what commands did you do anyway? because that could quite possibly solve my problems.
I'm on 4.1.83. I used the commands that are in the OP, changing out ejre-1.6.0_21 with ejre1.6.0_25 (which is the folder name for the version I downloaded). Make sure you do not have a folder in a folder. I never got it fully working, just black boxes on the web pages. The plugin does show to be installed though.
OHHHHHHHHHHHHHHHHH, thats why.
actually, nvm ... my files are in the exact location his are. >_<
Should I type the lines 1 at a time? I've been copy and pasting them all at once.
I did one at a time.
?.?
Ok this is my situation as of yet, I currently have rooted atrix, running newest version. I open terminal emulator from market, type in the first line "ln -s /usr/lib/ejre-1.6.0_25/lib/arm/libnpjp2.so /usr/lib/firefox-addons/plugins/libnpjp2.so" and it returns "link failed File exists, so im guessing i've already placed it into the plugins folder.
So far so good, now onto second line -
"chmod 755 /usr/lib/ejre-1.6.0_25/bin/java"
and my return being
-unable to chmod /usr/lib/ejre-1.6.0_25/bin/java: No such file or directory
I would type the rest but i'm sure they would return the same
My files are in the correct location /usr/lib/ejre-1.6.0_25/
any suggestions?
Well I have the full ubuntu mod on my phone. I have not test it doing it though anything other than lxterminal
If you see the plugin in firefox that is good. Im betting the permission are not set properly
you can use root explorer to set the permission on the files that are chmod. Make sure all check boxs under execute are selected.
Check what you copied to the phone and make sure you don't have two ejre-1.6.0_25 folders (one within the other) from when you extracted it.
I extracted it to my sd card then moved the folder, so my locations are exactly what he lists. nothing different aside from the _25 instead of _21 which i change in what I type. I just tried to allow permissions, lets see if this changes anything...*crosses fingers*
Edit: When I type the first line, I get
link failed Permission denied
Stephen Who said:
I extracted it to my sd card then moved the folder, so my locations are exactly what he lists. nothing different aside from the _25 instead of _21 which i change in what I type. I just tried to allow permissions, lets see if this changes anything...*crosses fingers*
Edit: When I type the first line, I get
link failed Permission denied
Click to expand...
Click to collapse
Do you have root?
I have root, plugin shows in firefox, permissions are correct, but all applets just show as a black box. I'm running stock. Do you think it only works with the ubunto mod?
Ok I edited the OP so the commands can be run from android terminal or adb.
Im not sure why it doesnt work for you must be the full ubuntu mod.
I might try downloading a new version of java see if it works
Update
I tried the the 25 version and it worked. I updated the commands. I was able to get it to work using adb.
password for adas:?
edit: and yes, I'm rooted. It's asking for a password when I type the second command line. :|

[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.

Eclipse Android - add superuser permission

Hi, i'm trying to access /system/app/ so i can put apps in there, since i couldt figure out how to install apk files form Eclipse. I'm running Eclipse with the SDK installed, any help or example would be awesome. Thanks
/system is typically read-only (is on every android I know of). On many (most?) devices, the partition containing /system is also write-locked in the eMMC firmware. User apps should be installed into the /data partition.
What do you mean by installing from eclipse? Eclipse uses adb to push the package to the device and launch the package installer.
Please use the Q&A Forum for questions Thanks
Moving to Q&A
There are two ways that may be of help that I know of.
ADB Install:
1. In your Android SDK manager you should have a tool called ADB (Google how to add it to your system path to make life easier)
2. Navigate to your apk file you are trying to install and shift right click in the windows explorer windo and select Open Command line here.
3. then using command line (Console) type in:
Code:
adb install nameofapphere.apk
Note: If the app has spaces in the installer name either take out the spaces or add quotes to the command line as shown below.
Code:
adb install "name of app here.apk"
Second choice is gaining command line root and remounting the system directory with rw permissions.
1. Gain console root access.
2. in console type in:
Code:
adb shell
Note if you see $ you are not in root and # if you are in root.
3. (Please double check)
Code:
mount -o remount,rw /dev/null /system
This will remount your system drive so you have read/write access to it.
4. Push the file to /system/app
5. Set the permissions you want for the application
JavaChips said:
There are two ways that may be of help that I know of.
ADB Install:
1. In your Android SDK manager you should have a tool called ADB (Google how to add it to your system path to make life easier)
2. Navigate to your apk file you are trying to install and shift right click in the windows explorer windo and select Open Command line here.
3. then using command line (Console) type in:
Code:
adb install nameofapphere.apk
Note: If the app has spaces in the installer name either take out the spaces or add quotes to the command line as shown below.
Code:
adb install "name of app here.apk"
Second choice is gaining command line root and remounting the system directory with rw permissions.
1. Gain console root access.
2. in console type in:
Code:
adb shell
Note if you see $ you are not in root and # if you are in root.
3. (Please double check)
Code:
mount -o remount,rw /dev/null /system
This will remount your system drive so you have read/write access to it.
4. Push the file to /system/app
5. Set the permissions you want for the application
Click to expand...
Click to collapse
What i mean i'm writing an app in eclipse. And i have a listview with the apk's, i want when the user clicks on the items, it gets installed. Any ideas?
spxc said:
What i mean i'm writing an app in eclipse. And i have a listview with the apk's, i want when the user clicks on the items, it gets installed. Any ideas?
Click to expand...
Click to collapse
Why did this thread get moved. Took me forever to find it.
Anyway, it seems you want to programmatically install an APK from within an android app, is that correct? Just launch an intent with the package installer as a target:
Code:
Intent installIntent = new Intent(Intent.ACTION_VIEW);
installIntent.setDataAndType("/path/to/my/apk","application/vnd.android.package-archive");
startActivity(installIntent);
Moderator: this is definitely development related. Why was it moved to Q&A?
Gene Poole said:
Code:
Intent installIntent = new Intent(Intent.ACTION_VIEW);
installIntent.setDataAndType("/path/to/my/apk","application/vnd.android.package-archive");
startActivity(installIntent);
Moderator: this is definitely development related. Why was it moved to Q&A?
Click to expand...
Click to collapse
I'll agree, and secondly I think it was moved to Q&A because the original question was asked in a way that was not clear to it's intents.
So yeah, just pointing the apks to be run by the package installer via intent will launch the installer and install the app selected.

Categories

Resources