Ad Blocking on ZTE Open - Firefox OS General

Until there are ad blocking apps for FFOS it needs a DIY method.
I'll assume you know how to use adb and have it set up on your machine. I'll also assume you have rooted your phone following the instructions here.
I use Linux so my commands may be a bit off in places.
1. Collect a suitable hosts file. I used the one on my Android phone but this one seems to update regularly http://winhelp2002.mvps.org/hosts.txt
2. Save the file as 'hosts' to a known location on your PC.
3. Open a shell window (command window) on your PC and check adb works.
Code:
adb devices
should return roamer2. If not, on your phone, go to settings > More Information > Developer - and check Remote Debugging.
4. In the shell window - change directory to where you have saved the hosts file. then type:-
Code:
adb push hosts /sdcard/
5. When that completes type:-
Code:
adb shell
you'll see $ prompt
Code:
su
If you are rooted correctly you'll see # prompt
Code:
mount -o remount,rw /system
Mounts the system folder for read / write permissions.
Code:
cat /system/etc/hosts
Should show just '127.0.0.1 localhost'
Save this if you want as hosts.old
Code:
busybox mv /system/etc/hosts /system/etc/hosts.old
Now replace the hosts file with the new one:-
Code:
busybox mv /sdcard/hosts /system/etc/hosts
To check your hosts file has been replaced type
Code:
cat /system/etc/hosts
And lots of domain names will whiz past.
All done.

Related

In Need of a translator CMD code to Terminal code for board sticky of Side loading ap

Been talking to Lekky and we have all these great things grouped into one thread. One important thread is side mounting the captivate.
Things it gives you are SDK which can be downloaded for PC or Mac.
Drivers again PC or Mac.
Then Root access no biggie
Busy box no biggie.
Then it goes into the CMD language for PC on how to edit the database file using CMD prompts to enable the sideloading of APKs directly on the phone.
What we are looking for is someone to translate this into mac terminal command lines. Here is how it reads now:
Connect USB to phone with USB Debugging ON
Command prompt
cd to SDK install directory
cd tools
adb shell
su
cp /dbdata/databases/com.android.providers.settings/settings.db /sdcard/settings.db
cp /dbdata/databases/com.android.providers.settings/settings.db /sdcard/settings.db.backup
exit
exit
(This should bring you back to your windows command prompt.)
adb pull /sdcard/settings.db %userprofile%\desktop
(This should copy the settings.db to your desktop in Windows. Keep your cmd window open, you'll need it again.)
Install SQLite Manager Plugin for Firefox
Open SQLite Manager Plugin within Firefox (Tools->SQLite Manager)
Click Database
Click Connect Database
Find settings.db
Expand Tables
Click secure
Scroll down to ID 6, "install_non_market_apps". Double-click.
Change value ( TEXT ) from 0 to 1
Close SQLite Manager
(Back to that cmd window)
adb push %userprofile%\desktop\settings.db /sdcard
adb shell
su
cp /sdcard/settings.db /dbdata/databases/com.android.providers.settings
busybox chown 1000 /dbdata/databases/com.android.providers.settings/settings.db
busybox chgrp 1000 /dbdata/databases/com.android.providers.settings/settings.db
reboot
Disconnect USB from phone. Your phone should be rebooting.
Done! I tested this and was able to install siriusxm.apk from siriusxm.com/android.
Who knows Mac Terminal commands well enough to translate this so that it can be posted in this sticky thread along with the windows version for us?
put ./ before each command
./adb pull /sdcard/settings.db %userprofile%\desktop
./adb shell
then carry on like normal
su
cp /sdcard/settings.db /dbdata/databases/com.android.providers.settings
busybox chown 1000 /dbdata/databases/com.android.providers.settings/settings.db
busybox chgrp 1000 /dbdata/databases/com.android.providers.settings/settings.db
reboot
then do the ./ again
./adb push %userprofile%\desktop\settings.db /sdcard
Also, if you *read* the sticky, it provides these notes, in blue, to make it more pronounced.
yea was on androidforums not here they didnt have the mac side, found it here after u guys mentioned it, awesome ty.

Velocity Cruz Tablet Bloatware Removal (ADB Method)

How to Remove Bloatware from the Velocity Cruz Tablet
Downloads and Setup
Unfortunately, I can't post links in the forum (yet!). For the links to these sources, check out my post with the same title on the Slatedroid Forum...If someone with link posting privileges would be willing to add the links below, I would greatly appreciate it.
1] Download and install the ADB drivers on your device from the Velocity Micro support site. Detailed instructions are available on their site.
2] Download and install the Android SDK on your computer.
3] Connect your Tablet to your computer via the USB cable and mount the device
4] Open your SDK directory on your desktop computer and navigate to the tools directory
5] Write down or copy the directory path to this tools directory (you will use it again below!)
Remove the Bloat
6] For Windows users, select Run from your Start menu
7] Type cmd.exe in the text field and click ok
8] At the command line, use the following series of commands:
cd C:\xxx\android-sdk-windows\tools (where the xxx is the path to your SDK directory)
adb shell (you should see a # sign after this)
cd /system/app (this changes your directory to the app directory on the Tablet where the apk's are located)
ls (optional: will allow you to view all of the apk's that are installed so that you know what to remove)
mount -o remount,rw /system (provide yourself with write permission on the system directory to remove files)
Then for each of the apk files that you want to remove, type:
rm /system/app/filename.apk (replace filename with the actual name of the file)
You can change the system directory permission back to read only with the following command if you would like:
mount -o remount,r /system
Copy and Paste
>cd C:\xxx\android-sdk-windows\tools
>adb shell
# cd /system/app
#ls
#mount -o remount,rw /system
#rm /system/app/filename.apk
#mount -o remount,r /system

[HOWTO] Run startup scripts using Chulri's rw root

I couldn't run scripts in init.d, and it took me a while to figure this out, so I'm sharing. There is more than one way to do this.
Step 1. Install chulri's rw root.
Step 2. Create a script directory and a runall script to run all the scripts in a given directory. To do that, you can type the following in an adb shell:
Code:
su
mkdir /data/local/bootscript
chmod 755 /data/local/bootscript
cd /data/local/bootscript
cat > runall
#!/bin/sh
for x in /data/local/bootscript/*.sh ; do /bin/sh $x ; done
(You can copy and paste that into a DOS window running adb.) Now press ctrl-d, enter. Then continue:
Code:
chmod 755 runall
Step 3. Edit /init.rc. You can do that on-device with vi and ssh, or you can install an editor that preserves Linux line-endings on your desktop (I use CONTEXT). I'll assume you're doing this with adb. So on the desktop do:
Code:
adb pull /init.rc init.rc
Now, edit init.rc on the PC, and to the section listing all the services, add:
Code:
service bootscript /data/local/bootscript/runall
enabled
oneshot
Then put it back on the device:
Code:
adb push init.rc /tmp
adb shell
su
mv /tmp/init.rc /
Step 4. Now you can put whatever scripts you want to run in /data/local/bootscript. Just make sure you they have a .sh extension. All scripts will be run with /bin/sh and there is no need to specify #!/bin/sh . Also, there is no need to chmod the scripts to render them executable. You can just copy scripts in.
To disable a script, just change its .sh extension to .disabled.
There are, of course, other ways of doing this.
great tutorial!

[REF][DEV]Terminal Emulator Commands

Always wondered what the terminal emulator app does? Dont now what commands to type? Well this thread is all about that
ALERT!!! ALERT!!
BELOW ARE THE COMMANDS AND THE PROCESSES THAT WILL HAPPEN BY TYPING THE COMMANDS!!!
IF YOU DO NOT UNDERSTAND SOMETHING PLEASE SO NOT TRY IT.. IT IS RISKY AND WILL POTENTIALLY HARM YOUR DEVICE!!
DO NOT BLAME ME THEN!!
THIS IS A REFERENCE AND DEV THREAD. NOOBS SHOULD NOT LINGER AROUND HERE
The Android Shell
A "shell" is a program that listens to keyboard input from a user and performs actions as directed by the user. Android devices come with a simple shell program. This shell program is mostly undocumented. Since many people are curious about it I thought I'd write up some documentation for it.
Currently this documentation is incomplete, sorry!
Click to expand...
Click to collapse
Common problems
The built-in shell has very limited error handling. When you type a command name incorrectly it will say "permission denied", even though the real problem is that it couldn't find the command:
Click to expand...
Click to collapse
Code:
$ dir
dir: permission denied <---- this is a misleading error message, should say 'dir: not found'
$ ls
... listing of current directory
The PATH variable
The Android shell will run any program it finds in its PATH. The PATH is a list of directories. You can find out what your shell's PATH is set to by using the built-in echo command:
Code:
$ echo $PATH
/data/local/bin:/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
Depending upon your shell, you may see a different result.
Built in Commands
Every shell has a few built-in commands. Some common built-in commands are:
echo -- prints text to stdout.
set -- sets shell variables
export -- makes shell variables available to command-line programs
cd -- change the current directory.
pwd -- print name of the current directory.
Commands
To find out what commands you have available to you, use the "ls" command on each of the directories in the PATH variable.
Click to expand...
Click to collapse
Finding documentation for the Android commands.
Many of the Android commands are based on standard Linux (or bsd) commands. If you're curious about a command, you can sometimes learn how it works by using the "man" command on a desktop Linux or OSX (Apple Macintosh) computer. The Linux or OSX version of the command may be different in details, but much of the documentation will still apply to the Android version of the command.
Another source of documentation for people without a Linux or OSX machine handy is to use a web browser and use a web search engine to search for the text: "man Linux command-name".
List of commands
The following is a list of the commands that are present on a Nexus S phone running an Android 2.3.3 "user-debug" build. Many of these commands are not present on a "user" phone. (They are missing from a "user" phone because they are specific to developing or debugging the Android operating system.)
Code:
$ ls /data/local/bin
/data/local/bin: No such file or directory
Notice that by default there is no /data/local/bin directory. You can create this directory using the "mkdir" command if you like.
Code:
$ ls /sbin
opendir failed, Permission denied
The /sbin directory exists, but you don't have permission to access it. You need root access. If you have a developer phone, or otherwise have root access to your phone you can see what's in this directory.
Code:
$ su
# ls /sbin
ueventd
adbd
# exit
$
Notice that the shell prompt changes from a '$' to a '#' to indicate that you have root access.
Click to expand...
Click to collapse
Notice also that neither of the /sbin commands are useful to the shell -- the adb and ueventd files are 'daemon' programs used to implement the Android Debugger "adb" program that is used by developers.
Code:
$ ls /vendor/bin
gpsd
pvrsrvinit
Vendor/bin is where device vendors can put device-specific executables. These files are from a Nexus S.
Code:
$ ls /system/sbin
/system/sbin: No such file or directory
This directory does not exist on a Nexus S.
Code:
$ ls /system/bin
am
am is the Android Activity Manager. It's used to start and stop Android activities (e.g. applications) from the command line. Type am by itself to get a list of options.
Click to expand...
Click to collapse
Code:
amix
aplay
Command line audio file player.
Code:
app_process
applypatch
Used to apply patches to android files.
Code:
arec
Command line audio recorder.
Code:
audioloop
bluetoothd
BlueTooth daemon
Code:
bmgr
Backup manager - type command by itself to get documentation.
Code:
bootanimation
Draws the boot animation. You may have to reset your phone to get out of this.
Code:
brcm_patchram_plus
bugreport
cat
Copy the contents of a file to standard output.
Code:
chmod
Change the mode of a file (e.g. whether it can be read or written.)
Code:
chown
Change the owner of a file.
Code:
cmp
Compare two files byte-by-byte
Code:
dalvikvm
The dalvik virtual machine. (Used to run Android applications.)
Code:
date
Prints the current date and time
Code:
dbus-daemon
dd
Convert and copy a file. By default copies standard in to standard out.
Code:
debuggerd
dexopt
df
Shows how much space is free on different file systems on your device.
Code:
dhcpcd
dmesg
dnsmasq
dumpstate
dumpsys
dvz
fsck_msdos
gdbserver
getevent
getprop
gzip
hciattach
hd
id
ifconfig
iftop
ime
input
insmod
installd
ioctl
ionice
iptables
keystore
keystore_cli
kill
Send signals to processes.
Code:
linker
ln
Used to set up a file system link.
Code:
log
logcat
Prints the Android runtime log.
Code:
logwrapper
ls
Lists files.
Code:
lsmod
lsof
make_ext4fs
mediaserver
mkdir
Make a directory.
Code:
monkey
A program that sends random events, used to test applications. (Like having a monkey playing with the device.)
Code:
mount
mtpd
mv
Move a file from one directory to another. (Only on the same file system. Use "cat a > b" to copy a file between file systems.
Code:
nandread
ndc
netcfg
netd
netstat
newfs_msdos
notify
omx_tests
pand
ping
pm
pppd
printenv
ps
List active processes.
Code:
qemu-props
qemud
racoon
radiooptions
reboot
Reboot the device.
Code:
record
renice
rild
rm
Remove a file.
Code:
rmdir
Remove a directory.
Code:
rmmod
route
rtp_test
run-as
schedtest
schedtop
sdcard
sdptool
sendevent
service
servicemanager
setconsole
setprop
setup_fs
sh
showlease
sleep
smd
stagefright
start
Starts the Android runtime.
Code:
stop
Stops the Android runtime.
Code:
surfaceflinger
svc
sync
system_server
tc
testid3
toolbox
top
Shows which processes are currently using the most CPU time.
Code:
umount
uptime
Prints how long your device has been running since it was last booted.
Code:
vdc
vmstat
vold
watchprops
wipe
wpa_cli
wpa_supplicant
$ ls /system/xbin
add-property-tag
btool
check-lost+found
dexdump
dhdutil
hcidump
latencytop
librank
opcontrol
oprofiled
procmem
procrank
rawbu
scp
Secure copy program. (Used to copy files over the network.)
Code:
showmap
showslab
sqlite3
Used to administer SQLite databases.
Code:
strace
System trace command - use to see what system calls a program makes.
Code:
su
Start a shell with root privileges.
Versions of the Android Shell
Android 1.0 used a shell that had no tab completion or history editing.
Android 2.3 added history editing. You can for example use the up/down arrows to edit previous commands.
Other shells
Busybox
Busybox is a program that contains a shell and a set of command line utilities. Search Android Market for "Busybox" and you should find some versions you can install. The Busybox shell includes tab completion and history editing. Some versions of Busybox for Android do not require that you root your phone.
Debian utilities
You can install the full Debian shell and utilities. (Debian is a popular desktop Linux distribution.) I don't know the details, and it may require a "rooted" phone. Try a web search for "Debian Android install".
Custom ROMs
Some custom ROMs come with their own shells and utilities. If you are using a custom ROM, check its documentation to find out what's available.
How can I view stdout outputs in terminal emulator window?
For example with dd command, not specifying output should display it at current terminal, like in linux, but actually doesn't. Any ideas?
Hey wanna troll someone's phone
Type in terminal "stop" lololol
Sent from my E15i using xda premium
Similar to linux terminal commands I use
Nice work though, great guide, thanks dude
W!LßSO @ XDA
Great guide, but you have forgot a very useful command: grep
It allows to apply filters to the output of the commands. The syntax is:
Code:
command | grep filter
For example, to list only the apk files inside a folder:
Code:
ls /folder/to/list | grep .apk
Great guide!
IMO dmesg is also important. Maybe you should add in a description for it?
Dmesg --> prints the Linux kernel output, which is different from the Android system output, logcat. Useful for checking hardware and to see if modules started up succesfully. Also useful for debugging in conjunction with logcat.
Code:
cat /proc/kmsg > /sdcard/dmesg.txt
Copies the dmesg output to a file fled dmesg.txt on the sdcard
And
Code:
cat /dev/log/system > /sdcard/logcat.txt
Copies the logcat output to a file named logcat.txt on your sdcard.
Also, you missed out the parted and e2fsck commands, used for partitioning and checking filesystem integrity.
Also, the command free (display free ram/swap) is not included.
Sent from my E15i using Tapatalk 2
Is there a command for check disk utility as in windows.. chkdsk...
my memory card is not working hence thought of running the check disk if possible...
dspPunk said:
Is there a command for check disk utility as in windows.. chkdsk...
my memory card is not working hence thought of running the check disk if possible...
Click to expand...
Click to collapse
Code:
su
fsck_msdos /dev/block/yourdevice
For ext4 there's e2fsck
scandiun said:
Code:
su
fsck_msdos /dev/block/yourdevice
For ext4 there's e2fsck
Click to expand...
Click to collapse
Dint get it... Sorry i am a so not into commands...
Kindly tell me the step wise solution... How can i see my device [yourdevice] which you have specified...
dspPunk said:
Dint get it... Sorry i am a so not into commands...
Kindly tell me the step wise solution... How can i see my device [yourdevice] which you have specified...
Click to expand...
Click to collapse
I don't have a Xperia X8 actually, does it support mass storage mode for internal sdcard?
http://www.jayceooi.com/2012/03/14/...storage-on-android-4-0-ics-samsung-galaxy-s2/
scandiun said:
I don't have a Xperia X8 actually, does it support mass storage mode for internal sdcard?
http://www.jayceooi.com/2012/03/14/...storage-on-android-4-0-ics-samsung-galaxy-s2/
Click to expand...
Click to collapse
I am having SGS2 and yes it supports mass storage for internal sdcard...
When i connect to my computer it shows only internal sdcard and not external card which is present in the external sdcard slot...
actually the problem is that my sdcard gets detected some times and sometimes it doesnt...
i searched a lot and many of them told that it is a kernel version issue.. i updated kernel still no luck..
then i got one thread which gave me the solution of check disk so was thinking whether terminal emulator has any commands for check disk..
Hi hetunandu, great guide,
but still I don't understand few things:
1: how to run a specific action of an app?
2: how to KNOW the exact sintax of possible actions of an app?
3: is it possible to launch these commands via SSH (through an SSH server)?
eg: I want to start a audio-recording app on my phone from my computer, AND start recording from remote. Is it possible?
Thank you
(and sorry for my english..)
JFI - Never run fsck on a mounted partition.. You will corrupt your data!
CtrlAltDelIrl said:
JFI - Never run fsck on a mounted partition.. You will corrupt your data!
Click to expand...
Click to collapse
Usually fsck won't run on that case and you warn you, you will have to use the force option in that case.
reading traffic stats
I am trying to get the traffic stat getMobileRxBytes (or any other traffic stat) to output a usable result in the terminal emulator. The goal is simply to be able to copy the rx bytes total to be used in Tasker. However, I can't seem to be able to get any output. I would appreciate it if anybody knows the proper command/syntax to show this traffic data. Thanks.
I am on a stock rooted 4.1.1 Galaxy Nexus.
[Q] Is there a command to show some configuration ?
I have run this command on terminal emulator:
[email protected]:/ $ su
[email protected]:/ #setprop net.cdma.rstp.proxy.addr 0.0.0.0;
[email protected]:/ #setprop net.cdma.rstp.proxy.port 0;
[email protected]:/ #setprop net.cdma.httppd.proxy.addr 0.0.0.0;
[email protected]:/ #setprop net.cdma.httppd.proxy.port 0;
Is above command right..???
after that i ran "getprop" i don't see effect of that command.
Can you tell me the right way or command to change my rstp & httppd setting...? cause my Epic4G cannot play video streaming after flashing CM10 nightly.
thanks,
adit
permission denied
china telecom infotmic m7206 not root because no usb i want to root tablet pc
terminal is boot "permission denied" why
help me please ???
Any way to check Camera firmware version per http://forum.xda-developers.com/showthread.php?t=2006128 ?
rooted Verizon SG3 on CM10.0
Hi... Before this I have rooted my phone since yesterday when I accidentally copy su file from "/system" to "/system/bin/" andnow I can't get root access because on Superuser I check the su version was 3.1.1 but there got red words maybe it try saying that I put su file in wrong location and I can't move it back because my root explorer can't get root access and it just show Root Explorer acess denied by Superuser. Terminal emulator also access denied. One more I'm using Sony Ericsson W8 and it can't unlock bootloader. Could someone help me to remove su file from "/system/bin". Thanks You
PutraMasyers97 said:
Hi... Before this I have rooted my phone since yesterday when I accidentally copy su file from "/system" to "/system/bin/" andnow I can't get root access because on Superuser I check the su version was 3.1.1 but there got red words maybe it try saying that I put su file in wrong location and I can't move it back because my root explorer can't get root access and it just show Root Explorer acess denied by Superuser. Terminal emulator also access denied. One more I'm using Sony Ericsson W8 and it can't unlock bootloader. Could someone help me to remove su file from "/system/bin". Thanks You
Click to expand...
Click to collapse
Just root ur W8 again as u did before
see boot animation without rebooting

Adblock hosts for Firefox OS

I recently bought a ZTE Open C and was surprised there's no adblocker (shame on you mozilla!). Since I'm using AdAway (available from F-Droid store) on my Android Tablet I simply extracted those hosts file and put it on my ZTE Open C - et voila: it works, much less ads while browsing now. [tested on an modified CAF build I found somewhere else]
Following sources used:
Code:
# http://adaway.org/hosts.txt
# http://hosts-file.net/ad_servers.asp
# http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext
# http://winhelp2002.mvps.org/hosts.txt
Instructions for setup on GNU/Linux (I'm not responsible if adb kills kittens or if your fridge explodes):
1. Download hosts file here
2. Enable ADB: Settings > Developer > USB Debugging > ADB
3. Connect device to PC
4. Setup
Code:
adb root ### run adb as root
adb shell ### open shell on ZTE Open C
mount -o rw,remount / ### remount root partition read-write
mount -o rw,remount /system ### remount system partition read-write
exit ### return to PC shell
adb push /path/to/my/hosts /hosts ### copy hosts file to ZTE Open C
adb shell ### back to ZTE Open C shell
cat /hosts > /system/etc/hosts ### write AdAway hosts to system hosts
rm /hosts ### remove no longer required temporay hosts file
exit ### back to PC
adb reboot ### restart phone to make changes take effect
Suggestions welcome.
Thank you very much. I didn't think about that solution to avoid ads on FFOS.
Do you know an elegant way to update the hosts from time to time (like with adway on android)
without adding double entries?

Categories

Resources