Openvpn working! (ROOTED only) - Xoom General

It isn't easy, but if you have rooted your Xoom then you can get Openvpn running. If you are not familiar or comfortable working in the guts, then don't do this.
> You must have ROOTed your Xoom.
Follow these not so easy steps:
1) From the market, install the Busybox installer.
2) Run the Busybox installer and select /system/xbin for the install location.
3) Install Openvpn Installer
4) Run the installer, specify /system/xbin for the location
5) The installer will say it failed, and it surely has, no worries though, because it left the bit we need on the sdcard
6) From a terminal shell:
Code:
su
mount -w -o remount /system
mkdir /system/xbin/bb
ln -s /system/xbin/busybox /system/xbin/bb/ifconfig
ln -s /system/xbin/busybox /system/xbin/bb/route
cp /mnt/sdcard/openvpn /system/xbin/
chmod 555 /system/xbin/openvpn
mount -r -o remount /system
5) Open the attached tun.zip file and copy the tun.ko file to your /mnt/sdcard/openvpn directory along with all your other configuration files.
6) From a terminal shell:
Code:
su
insmod /mnt/sdcard/openvpn/tun.ko
That is a pain to do every time and I never had any luck getting modules to load automatically. So you can use the Openvpn settings program from the Market which is what I do.
7) Install Openvpn Settings from market
8) Run Openvpn Settings
9) Press menu button and select "Advanced"
10) Select "Load tun kernel module"
11) Select "TUN Module Settings"
Load module using = insmod
Path to tun module = /mnt/sdcard/openvpn/tun.ko
I think that should get you going, but it has been a long day and I may have missed something. There surely must be an easier way to get openvpn installed. But this is what worked for me. If you've done this before then the important bit is the Xoom tun.ko file.
UPDATE: My tun.ko doesn't work with coolbho3000's overclocked kernel. I think it is a difference in the kernel versions koush and he used. Still trying to learn how git works so I can get the exact version of the source coolbho used. I will post another tun.ko when I get it working.
UPDATE 2: Thanks to instructions from coolbho3000 I have recompiled tun.ko with the right version number for his overclocked kernel. The tun.ko for the overclocked kernel is in the file tun-overclock.zip. So use tun.zip if you are running koush's kernel and tun-overclock.zip if you are running coolbho3000's overclocked kernel.
UPDATE 3: Updated this post to reflect that a new busybox installer was released to the market that fixes it's install.

thanks for the tun.ko file

Thanks for this post! Quick question though - where do I find the openvpn installer?

The app market.

trackerk said:
That is a pain to do every time and I never had any luck getting modules to load automatically.
Click to expand...
Click to collapse
I've always put the tun.ko module in the /system/lib/modules directory and never had an issue.

Also this doesn't seem to work with VPNConnections, the program for IPSEC VPNs. Shame, I was really excited for it too.

Can you post your server .conf file and the .conf file for the Xoom? I'm having router errors that I've not had with other devices.

I'm unable to insmod the overclocked tun.ko on the overclocked kernel.
I get the following error:
# insmod tun.ko
insmod: init_module 'tun.ko' failed (Exec format error)
Click to expand...
Click to collapse

Adam B. said:
I'm unable to insmod the overclocked tun.ko on the overclocked kernel.
I get the following error:
Click to expand...
Click to collapse
Run 'dmesg' after trying insmod and tell me what the last lines are. They will probably be something to do with version magic numbers.

blulite said:
Can you post your server .conf file and the .conf file for the Xoom? I'm having router errors that I've not had with other devices.
Click to expand...
Click to collapse
The VPN is work related, I can't post any of the config. But they are the same config files I use on my Droid and Galaxy Tab. They shouldn't have to change.
Also, until busybox and openvpn installer can be updated, getting this working is kind of a mess. If openvpn can't find 'ifconfig' and 'route', then the VPN connection may get setup, but packets go nowhere. Go back over my instructions and make sure you get this bit in:
ln -s /system/xbin/busybox /system/xbin/bb/ifconfig
ln -s /system/xbin/busybox /system/xbin/bb/route

trackerk said:
Run 'dmesg' after trying insmod and tell me what the last lines are. They will probably be something to do with version magic numbers.
Click to expand...
Click to collapse
Code:
[93513.332923] tun: version magic '2.6.36.3-g1615a68 SMP preempt mod_unload ARMv7 ' should be '2.6.36.3-g53275e0 SMP preempt mod_unload ARMv7 '
Code:
# uname -a
Linux localhost 2.6.36.3-g53275e0 #36 SMP PREEMPT Mon Feb 28 13:22:20 PST 2011 armv7l GNU/Linux

coolbho released another overclock kernel after I had compiled up tun. I guess he got a different branch of the source which had a different kernel version number. They have to match exactly. I have updated the tun-overclock.zip at the top of the thread to match his. Download and install it again and it should work. I just flashed his kernel and tun.ko to my xoom and made a vpn connection with it.

Not sure if I'm missing something, but I can't seem to get this working. I'm using cool's OC kernel (second version).
I'm using the same config file that I use on my phone (D1).
As you said, busybox install reported it failed, but it *seemed* to have worked. OpenVPN Installer must of updated their app because I was able to install it without it failing. Worked just like it did on my D1.
Then I try to connect to the VPN, it seems to get past Auth and Get Config, but dies at "Connected to IP_ADDRESS_OF_OPENVPN as" and the notification keeps popping up saying its connected.
Running netcfg from the CLI shows the tun0 interface down, with no IP assigned. It's almost as ifconfig can't assign the address, but it seems like ifconfig and route are properly installed. Any ideas?

From the command line run:
insmod /path/to/tun.ko
(with whatever path you saved tun.ko to)
to make sure it is being loaded. It probably is since you see it in netcfg. But that is the most common reason for openvpn not working.
If that works, then look to see if openvpn is finding the ifconfig and route commands. The only way I could get it to work with the Openvpn Settings program was to put them in /system/xbin/bb.

I could of swore there was a built in log with OpenVPN Settings, but I can't find it. How can I find out if its finding ifconfig and route?
I'm pretty sure thats the issue. I know its loading the module correctly, and I know I have ifconfig installed properly because I could do "# ifconfig tun0 5.5.0.254 netmask 255.255.255.0 up" and it will assign the address to the tun0 interface, and I could ping it. For some reason it seems OpenVPN can't use ifconfig.
FYI - i confirmed the following with a file manager
both ifconfig and route are inside /system/xbin/bb (as well as /system/bin/ and /system/xbin for good measure)
OpenVPN binary is inside /system/xbin/
I'm not sure what else I could be missing.

Just try running openvpn from the command line. Like this:
Code:
su
cd /path/to/openvpn_stuff
openvpn my.conf
If it can't find 'route' or 'ifconfig' you'll see it there.

Yea, something doesn't look right. Take a look
http://dl.dropbox.com/u/14573841/log.txt

Thats your version of openvpn complaining. I don't think the version in the market supports push options like that. My server config doesn't have them so it didn't matter to me. The guy who compiled up tun.ko for the Galaxy Tab also had instructions on getting a different openvpn that supported push. You'll have to look around a bit to find it.

I'll try http://code.google.com/p/android-openvpn-settings/issues/detail?id=26 when I get out of work. Weird thing is though it works on my phone no problem.
edit// that seems to have done it. I'm now connected and can pass traffic. Now I just need to figure out why "connected" keeps popping up in my notifications.
Anyone coming across this, that is having a similair issue. Here is the part of the log that pointed trackerk to the push issue (just in case I remove the log from my dropbox)
Code:
Tue Mar 8 15:36:18 2011 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:4: dhcp-pre-release (2.1.1)
Tue Mar 8 15:36:18 2011 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:5: dhcp-renew (2.1.1)
Tue Mar 8 15:36:18 2011 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:6: dhcp-release (2.1.1)
Tue Mar 8 15:36:18 2011 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:13: route (2.1.1)
Tue Mar 8 15:36:18 2011 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:14: route (2.1.1)
Tue Mar 8 15:36:18 2011 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:15: route (2.1.1)
Tue Mar 8 15:36:18 2011 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:18: register-dns (2.1.1)
Tue Mar 8 15:36:18 2011 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:20: ifconfig (2.1.1)

I'm using the "static" openvpn 2.1.1 from github, so all is working. With the exception of DNS redirection. Anyone got that working? I'm setting the default route to my ovpn, and all the traffic is going that way. But I cannot get DNS to redirect.
Code:
push "dhcp-option DNS 192.168.1.1"
push "redirect-gateway"
edit: I found the following commands to change DNS, now I need a script called from openvpn. Anyone got one, or am I writing from scratch?
Code:
setprop net.dns1 192.168.1.1
setprop net.dns2 8.8.8.8
Ideas?
Jeff

Related

[Q] Anyone got a working tun.ko?

Has anyone found or created a working tun.ko for the A500? I realize it's early to be asking this, but it's something I ultimately need.
Dmesg says the version number should be:
2.6.36.3-00001-g9b3ce2b SMP preempt mod_unload ARMv7
+1 looking for the same. Xoom tun.ko won't install on the A500.
FYI, thor2002ro posted one on the dev forum:
http://forum.xda-developers.com/showthread.php?t=1058713
Just download the one that matches your specific Kernel (look in Settings - About tablet to see what you have running.)
On another note, I found that the default BusyBox and OpenVPN Installer's on the Market wouldn't quite work. Busybox installs at /system/xbin/ and I told OpenVPN to look for it there, but it REALLY looks for it at /system/xbin/bb/ so I created that directory, created symlinks for "route" and "ifconfig" in that directory pointing back to the /system/xbin/busybox executable.
For those not in the Linux know, at the adb shell you'd do:
su
mkdir /system/xbin/bb
ln -s /system/xbin/busybox /system/xbin/bb/route
ln -s /system/xbin/busybox /system/xbin/bb/ifconfig
exit
exit

[How to] Linux (Backtrack5) and OpenOffice3

Backtrack5 and OpenOffice3.0
xMemphisx said:
Backtrack (http://www.backtrack-linux.org)
Backtrack-Linux.org, home of the highest rated and acclaimed Linux security distribution to date. BackTrack is a Linux-based penetration testing arsenal that aids security professionals in the ability to perform assessments in a purely native environment dedicated to hacking. Regardless if you’re making BackTrack you Install BackTrack, boot it from a Live DVD or thumbdrive, the penetration distribution has been customized down to every package, kernel configuration, script and patch solely for the purpose of the penetration tester.
Here is a guide to getting ARM Backtrack Running on the Iconia A500 (tested on Wifi Only Version, running 3.0.1)
After much frustration I have gotten the GUI part of the backtrack 5 arm release working with the Motorola Xoom.
This has only been tested to work on the Iconia A500 . But it should work just fine with any other device that supports linux, and should work especially well on anything with a dual-core processor (G2X, Atrix, etc.)
Pre-requisites:
- Rooted Iconia A500
- Busybox installed (Find on market Busybox installer)
- androidVNC from the Android Market
- Terminal Emulator from the Android Market (which you should already have)
- Backtrack 5 for ARM with Gnome downloaded and setup (check the README file, and follow the instructions.)
Link: Backtrack 5 http://www.backtrack-linux.org/downloads/. This tutorial will assume you put Backtrack 5 in the folder /sdcard/BT5 like the README says.
Code:
Extract the zip file to your internal SDCARD folder (/SDCARD/BT5)
Open Terminal emulator and type
su
cd /sdcard/BT5
gunzip bt5.img.gz (take about 7-10mins)
sh bootbt
Code:
cd /sdcard/BT5
su
sh bootbt
BackTrack will start up in shell. You will get a red line that says "[email protected]:". To verify if you type:
Code:
ls pentest
It should echo back the folders in pentest, stuff like 'backdoors','database',etc.
At this point enter the following commands:
Code:
export USER=root
vncpasswd
When you type in 'vncpasswd' this is to the the password for the tightvncserver. Since I only connect locally I just use 'qwerty' for my password, and then confirm the password. [Edit] Apparently you can skip this step, as the default password for vnc is simply, 'toortoor' (root backwards, twice).
When it asks if you want to create a view only password just type 'n' and hit enter. After you have your password setup for vnc start the server up.
Code:
[COLOR="Red"]startvnc 1280x800[/COLOR]
When this happens you will get a message confirming that "New 'X' Desktop is localhost:1" and a bunch of other random stuff below it (it isn't important unless there are errors listed).
At this point, press the "HOME" button and then open the application "androidVNC".
-In the "Nickname" box, you can name it whatever you like.
-In the "password" entry, use your password (mine is 'qwerty').
-In the "Address" box you can type in localhost (or leave it blank).
****Change the port from 5900 to 5901.
I also recommend setting the color-depth to 24-bit. After that press the "connect" button, and bam! You're rocking Backtrack 5 on your Iconia A500!!
Code:
In order to exit:
- Go back to Terminal
- Type [B]stopvnc[/B]
- Type [B]exit[/B]
you are back to android terminal environment and ur androidvncviewer will get disconnected.
Click to expand...
Click to collapse
p-ille said:
I tested openoffice 3 and it works like a charm. It is not present in the original backtrack repository, so I had to add another source. I used the Debian repository. From the backtrack terminal I typed:
Code:
add-apt-repository deb *repository address* stable main contrib non-free
apt-get update
apt-get install openoffice.org
You can find the debian mirror for your country at
Code:
debian.org/mirror/list
Click to expand...
Click to collapse
For those who want to access SDCard/USBDrive from within BB5, please follow this:
p-ille said:
I did it!
To mount sdcard, external sd and usb storage in backtrack, you have to modify the bootbt script like this (changes in red):
Code:
perm=$(id|cut -b 5)
if [ "$perm" != "0" ];then echo "This Script Needs Root! Type : su";exit;fi
mount -o remount,rw /dev/block/mmcblk0p5 /system
export kit=/sdcard/BT5
export bin=/system/bin
export mnt=/data/local/mnt
[B][COLOR="Red"]export stor=$mnt/root/storage
export sdcard=$stor/sdcard
export extsd=$stor/external_sd
export usb=$stor/usb_storage[/COLOR][/B]
mkdir -p $mnt
export PATH=$bin:/usr/bin:/usr/local/bin:/usr/sbin:/bin:/usr/local/sbin:/usr/games:$PATH
export TERM=linux
export HOME=/root[I]
[COLOR="Blue"]export USER=root[/COLOR][/I]
if [ -b /dev/loop2 ]; then
echo "Loop device exists"
else
busybox mknod /dev/loop2 b 7 0
fi
mount -o loop,rw,noatime -t ext2 $kit/bt5.img $mnt[B][COLOR="Red"]
echo "mounting storage devices in $stor..."
mkdir -p $sdcard
mkdir -p $extsd
mkdir -p $usb
busybox mount --bind /mnt/sdcard $sdcard
busybox mount --bind /mnt/external_sd $extsd
busybox mount --bind /mnt/usb_storage $usb[/COLOR][/B]
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
busybox sysctl -w net.ipv4.ip_forward=1
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "127.0.0.1 localhost bt5" > $mnt/etc/hosts
busybox chroot $mnt /bin/bash
echo "Shutting down BackTrack ARM for Iconia A500"
[B][COLOR="Red"]umount $sdcard
umount $extsd
umount $usb[/COLOR][/B]
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
Click to expand...
Click to collapse
Very nice indeed, will try it out very soon.............
Awesome, just what I have been looking for. I will try this when I get home tonight!
Thanks
lpachuong said:
Here is a guide to getting ARM Backtrack Running on the Iconia A500 (tested on Wifi Only Version, running 3.1)
Click to expand...
Click to collapse
3.1? maybe you means 3.0.1?
After
export USER=root
Click to expand...
Click to collapse
You/can type
startvnc
Click to expand...
Click to collapse
without the need to -geometry 1280x800, and afterward after your session type
stopvnc
Click to expand...
Click to collapse
for a clean disconnect.
Just a faster easier way.
I got I/O errors while mounting devpts and sysfs (bootbt script)
peyotll said:
I got I/O errors while mounting devpts and sysfs (bootbt script)
Click to expand...
Click to collapse
I had the same errors when i had ubuntu installed/and was trying to do this along side.. what I had to do was factory reset (I did so to get rid of ubuntu, there's probably an easier way) then tried backtrack again with no problem
Agosh13 said:
3.1? maybe you means 3.0.1?
Click to expand...
Click to collapse
Hahahaha...I wish =)
Btw, please let me know if you have any special script/suggestion about this topic. I will update the original one so that everyone can get updated.
I'm trying to get OpenOffice running...sadly the ARM version is not that stable. Anyone has any resource on it?
Works perfectly! Thanks for this!
Thanks very much for this guide!
I'm having a strange issue though, hopefully someone can help. When I press the "m" key, rather than type the letter "m", it opens up the mail icon in the tool bar. Every other letter works fine, and I can't seem to find a way to edit this keyboard shortcut.
Anyone else have this issue, or now how to correct this?
thanks a lot - it will work for me without any error or something else
i use the latest update from acer (A500_1.141.01_EMEA_CUS7)
hmm, is there any trick to log off an turn off the system ? when i exit everthing an try to start again i will only see the backtrack wallpaper...
also i got an error in term-emu when i type in "exit".
I added the OP for how to exit.
Thanks for the guide, I have been waiting for something like this!
koprofile said:
Thanks very much for this guide!
I'm having a strange issue though, hopefully someone can help. When I press the "m" key, rather than type the letter "m", it opens up the mail icon in the tool bar. Every other letter works fine, and I can't seem to find a way to edit this keyboard shortcut.
Anyone else have this issue, or now how to correct this?
Click to expand...
Click to collapse
doble-tap (right click) the mail icon in the tool bar and choose to remove it from panel. It should remove the keyboard shortcut also.
lpachuong said:
Hahahaha...I wish =)
I'm trying to get OpenOffice running...sadly the ARM version is not that stable. Anyone has any resource on it?
Click to expand...
Click to collapse
I tested openoffice 3 and it works like a charm. It is not present in the original backtrack repository, so I had to add another source. I used the Debian repository. From the backtrack terminal I typed:
Code:
add-apt-repository deb *repository address* stable main contrib non-free
apt-get update
apt-get install openoffice.org
You can find the debian mirror for your country at
Code:
debian.org/mirror/list
Thank you very much for this guide.
It works like a charm.
Just one question.
I suppose you use a bluetooth keyboard, because the virtual one doesn't seem to work with Backtrack. But is it possible to use a mouse ? Because my big fingers don't match the tiny icons and menu choices !!!
Thanks again.
p-ille said:
Code:
add-apt-repository deb *repository address* stable main contrib non-free
apt-get update
apt-get install openoffice.org
You can find the debian mirror for your country at
Code:
debian.org/mirror/list
Click to expand...
Click to collapse
Thank you for ur script. I haven't had time to play with it due to exams.Anyway, I added them to the original post so that everyone can find it easier.
Regarding to the keyboard...i tried with usb keyboard and it worked fine. I have a BT keyboard but haven't tried it yet. I don't think the mouse will work bcz it is restricted by the VNCViewer
Hi
Tanks for tour tutorial, but i'm having some issue running backtrack:
Code:
# sh bootbt
Loop device exists
ioctl LOOP_SET_FD failed: Bad file number
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
net.ipv4.ip_forward = 1
bootbt: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
bootbt: cannot create /data/local/mnt/etc/hosts: directory nonexistent
chroot: can't execute '/bin/bash': No such file or directory
Shutting down BackTrack ARM For Xoom
failed.
failed.
failed.
failed.
#
I did check the md5sum of the archive,ok. Busybox ok.
Tanks for your help.
When it asks if you want to create a view only password just type 'n' and hit enter. After you have your password setup for vnc start the server up.
Code:
Code:
startvnc 1280x800
When this happens you will get a message confirming that "New 'X' Desktop is localhost:1" and a bunch of other random stuff below it (it isn't important unless there are errors listed).
Click to expand...
Click to collapse
is it possible to use a different resolution? I tried to use 1280x768 (WXGA read on Wikipedia) but it didn't work.
Hi, Alberto
edit:
Now it works fine! thank you!
Sorry for my first post.
I just realize that I had confused the downloaded archive (.7 z, wich contain all stuff) and the compressed image (. gz), so I did not unpack image before running bootbt.
Unfortunately, the extraction of master archive did not work due to the soft used to extract .7z.
As i mentionned before I've checked the whole archive md5sum but did not check the extracted files.
bt5.img.gz was only 12.59 MB, extracted with androzip. (don't use it, at least for .7z!!)
interesting....
is the wifi adapter working in monitor mode???

[Guide] Mac Spoofing / Changing

After reading several posts on mac spoofing and having failed to find a working thread.I decided to fill in the gaps with my linux knowledge (however little of that I may have).
So this method seems to solve some issues I've seen (MAC not changing because device wasn't downed) in these threads:
http://forum.xda-developers.com/showthread.php?t=1385577
http://forum.xda-developers.com/showthread.php?t=902354
without editing the nvram.txt
I've tested the ip link method on my recently rooted Samsung Tab 2 7.0"
Changing your mac address:
Prerequisites:
*A rooted device
*Busybox
*Terminal emulator
*Turn wifi on from your device's menu, do not connect to any network.
*Open your terminal emulator, now type:
$su
#ip link
*This should list all networking interfaces, identify your wifi device, take note of the name. now:
#ip link set NAME down
#ip link set NAME address 00:11:22:33:44:55
#ip link set NAME up
I believe that when using ifconfig the procedure is as follows:
$su
#ifconfig
*Take note of the device name
#ifconfig NAME down
#ifconfig NAME hw ether 00:11:22:33:44:55
#ifconfig NAME up
After doing the above you can connect to the desired network normally, using the default / other user interfaces.
NOTE: The mac address will be reset when WIFI is switched off.
I have confirmed the ip link method to be working. i.e. transmitted mac address is the new / changed one!
Actually in my case (SGS) i had to restart wifi first and then (while it's starting) quickly change the MAC using:
Code:
busybox ifconfig wlan0 hw ether 00:11:22:33:44:55
Important: It must be done about 500ms after enabling wifi, otherwise it won't work.
If I change MAC when wifi is off it simply returns to the original during next start.
Worked on i9000 with CM9 / 10
pawci0 said:
Actually in my case (SGS) i had to restart wifi first and then (while it's starting) quickly change the MAC using:
Code:
busybox ifconfig wlan0 hw ether 00:11:22:33:44:55
Important: It must be done about 500ms after enabling wifi, otherwise it won't work.
If I change MAC when wifi is off it simply returns to the original during next start.
Worked on i9000 with CM9 / 10
Click to expand...
Click to collapse
So downing the interface before changing and uping afterwards doesn't work?
i want to learn well the mac spoofing
setoPul Wilcox
this is actually incredibly useful, I got MACblocked off a network near college. thanks!
Doesn't work for me
Code:
# su
# ifconfig tiwlan0 down
# ip link set tiwlan0 address 00:11:22:33:44:55
ip: SIOCSIFHWADDR: Operation not supported on transport endpoint
# ifconfig tiwlan0 hw ether 00:11:22:33:44:55
error: SIOCSIFADDR (Invalid argument)
I guess its a kernel/driver problem... at least I know it works on normal Linux systems.
Itcouldbeyou said:
Doesn't work for me
Code:
# su
# ifconfig tiwlan0 down
# ip link set tiwlan0 address 00:11:22:33:44:55
ip: SIOCSIFHWADDR: Operation not supported on transport endpoint
# ifconfig tiwlan0 hw ether 00:11:22:33:44:55
error: SIOCSIFADDR (Invalid argument)
I guess its a kernel/driver problem... at least I know it works on normal Linux systems.
Click to expand...
Click to collapse
Funny that only some manufacturers disable such features. You could always try editing the nvram file? I haven't tried it though.
Isnt it dangerous ?
Script to apply random mac
I've made a script to create a random ghost mac every time I run it on the terminal emulator with su.
Code:
macaddr="52:54:$(dd if=/dev/urandom count=1 2>/dev/null | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4/')"
ip link set wlan0 down
ip link set wlan0 address $macaddr
ip link set wlan0 up
I've named it as gmac.sh and saved it on /sdcard/, thus by running:
Code:
$ su
# sh /sdcard/gmac.sh
the mac is changed.
Regards :cyclops:
Works differently on HTC Desire
Hello,
This is just to "set in stone" somewhere in the Internet that on some devices, you need *not* to down and up the network interface. Otherwise, the network driver will restore its MAC address from hardware/driver settings.
On a HTC Desire, MAC spoofing works this way:
* turn on the wifi interface using the standard Android interface
* run this script :
Code:
macaddr="52:54:$(dd if=/dev/urandom count=1 2>/dev/null | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4/')"
ip link set wlan0 address $macaddr
Best regards,
On some devices (e.g. HTC Desire among others), the wifi GUI still resets the mac address even with the method described in this thread.
worstenbrood has modified the wifi driver so that the mac address can be configured from a text file. It is described here:
http://forum.xda-developers.com/showthread.php?t=1525230
This is compatible with the wifi GUI and solves the problem of the wifi interface reloading its original mac address.
Anyone interested, I have backported his modifications to the latest state of the kernel developement in CM7.
thanks!
I get a 'operation not supported on transport endpoint' error when running the 'ip link set wlan0 address 00:11:22:33:44:55' and a about the same error with busy box.
Thanks for this! Gonna try this later.
damien.courousse said:
Hello,
This is just to "set in stone" somewhere in the Internet that on some devices, you need *not* to down and up the network interface. Otherwise, the network driver will restore its MAC address from hardware/driver settings.
On a HTC Desire, MAC spoofing works this way:
* turn on the wifi interface using the standard Android interface
* run this script :
Code:
macaddr="52:54:$(dd if=/dev/urandom count=1 2>/dev/null | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4/')"
ip link set wlan0 address $macaddr
Best regards,
Click to expand...
Click to collapse
anyone help me mine Hcl me 2G 2.0 i can't change mac please help me....

[Q] Flashing HD2 without touch screen

Hy.
I have a HTC HD2 with a dead touch screen (I can read, but touch is not reactive). I could reset it to factory settings via buttons. So I have a Windows Welcome screen.
I can also enter HSPL.
Is it possible to flash the device, and install Android without working screen ?
Once I have Android, I can do stuff with the device, and use it as VNC client, and manage remotly via ssh. My problem is to install Android on it. Most tutos say at one step or an other to activate ActiveSync in Windows, what is not possible for me.
I am used to HTC Sensation, and to all classic Android tools (adb, fastboot). I have Windows and Linux hosts.
Classic tutos are not usable for me.
Otherwise, the device will go for sale, for peaces. 10€.
Thanks.
voldown + power --> bootloader,
fhlash hspl
flash radio 2.15.50
flash magldr
use toolkit to apply partition size and cwm
into cwm
flash rom from zip
no touchscreen necessary
the instruction about activesync is a red herring, , it doesn't refer to the app on the PC, and it doesn't require winmo to be running on the phone either, it just means get a usb connection.
however if you have trouble flashing hspl, then manually updating windowsmobiledevicecenter (find it on microsoft website) will help fix driver errors, and later, when you get into magldr and start using 'usb flasher' you may wanna install 'myphoneexplorer' for the android drivers it comes with.
^That's true, but you might have a problem with Aroma installer. I think it may work with the volume keys too, but if it doesn't then you'll have to find a ROM which doesn't use Aroma (most relatively old ROMs don't) and flash that instead.
Nigeldg said:
^That's true, but you might have a problem with Aroma installer. I think it may work with the volume keys too, but if it doesn't then you'll have to find a ROM which doesn't use Aroma (most relatively old ROMs don't) and flash that instead.
Click to expand...
Click to collapse
Aroma does work without touchscreen, buttons can be used to select the default choices, (can't recall if volume buttons can used to change selected option, so may need to edit ROM zip so the defaults are what you want). The issue I'd see is how you go about issuing commands and starting apps; it's possible of course - there are commands to simulate screen presses (monkeyrunner) and command to start apps/processes but those commands can get complicated.
If you get a VNC system set up without touchscreen then could you add your procedure?
I am stuck at almost last step: pushing CWM: I have downloaded Recovery-400 from http://www.filecrop.com/Clockworkmod-Recovery-hd2.html , but I get the RSPL error message. I have Windows XP SP3 with .NET3 SP1, so i am admin, i have EnterBootloader.exe and rapidtool.exe, and I have unticked the USB stuff in ActiveSync ... but i am still stuck at the RSPL error :/
About going further: if I have ADB access from CWM, I will just install Armel by copying from my Sensation (Debian Armel have been installed using LinuxInstaller by Galoula). If i don't have adb, I will have to pre-install it in the zip, and reflash. In short, I push a chrootable env, and find an init script that will run sshd after boot. Once I have ssh, i'm done.
I had to install RAPI.dll, and CEUTIL.dll (found in google), re-install ActiveSync, and use a very specific ROM. HD2toolkit did not work at all for me. I forgot how I installed MAGDLR, but it was PITA to install it. And once installed, I spent 2 days on trying to use it. Putting ROMs on uSD does not allow to install the from SD.
After viewing http://cdn.youtubeavi.com/view-video/0TpYHpfHW-8 (confirmed by reading http://resetguide.com/2012/05/how-to-install-android-on-hd2-nand/ ), I saw that amongst my 1GB of data downloaded in the last days, I did not have the file ANDR_install.exe; I downloaded all possible ROMs until I find one having this magic file: http://forum.xda-developers.com/showthread.php?t=893637 . Only this ROM has andr_install.exe . And when I ran it, it worked on the first time (while of course having HD with MAGLDR on option 5: USB flash).
Now, my HD2 started Android. I still can not use it at all for now, but at least, I have made a step.
adb works, so it will probably be very easy for me. From ADB, I can do almost anything: install APKs(pm install), getprop, remount /system rw, install Debian manually ... the hardest part may be to click on buttons, but I can find a WA for this: create minimal apps on my other Android phone, using Tasker with AppFactory, apps which will be able to send keystrokes, and start them as required. Long way, but should work (if I don't have CPU uncompat issues). Anyway, without touch pad, it's not gonna stay a "phone"; it will mostly be a VNC-viewer for other devices (like my RaspberryPi).
Hell I am lucky: both HTD HD2 and HTC Sensation use the exact same CPU: "ARMv7 Processor rev 2 (v7l)" . Gonna be trivial to have fun around An example to install a VNC-client:
Code:
[email protected] /tmp $ adb -s SH169V80XXXX pull /data/app/android.androidVNC-1.apk
1703 KB/s (245795 bytes in 0.140s)
[email protected] /tmp $
[email protected] /tmp $ adb -s 0123456789ABCDEF install android.androidVNC-1.apk
2015 KB/s (245795 bytes in 0.119s)
pkg: /data/local/tmp/android.androidVNC-1.apk
Success
[email protected] /tmp $
Same for server.
Like in my Sensation (definitly, I am lucky), I have a free folder in the default PATH :
Code:
localhost / # echo $PATH
/sbin:/system/sbin:/system/xbin:/system/bin
localhost / # ls /system/
app dmesg.txt framework lost+found lost+found xbin
bin etc lib lost+found media
build.prop fonts lost+found lost+found usr
localhost / #
so, let's populate it
Code:
localhost / # df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 205.9M 0 205.9M 0% /dev
tmpfs 205.9M 0 205.9M 0% /mnt/asec
/dev/block/mtdblock1 127.3M 118.8M 8.5M 93% /system
/dev/block/mtdblock3 248.8M 65.2M 183.5M 26% /data
/dev/block/mtdblock2 40.0M 1.1M 38.9M 3% /cache
/dev/block/vold/179:1
3.7G 2.3G 1.4G 63% /mnt/sdcard
/dev/block/vold/179:1
3.7G 2.3G 1.4G 63% /mnt/secure/asec
localhost / # mount -o remount,rw /dev/block/mtdblock1 /system
localhost / # cd /system/
localhost system # ln -s /data/local/bin/ sbin
localhost system #
Now add my personal boot script:
Code:
localhost system # cd /etc/init.d/
localhost init.d # ls -l
-rwxrwxrwx 1 root root 365 Feb 29 2008 00banner
-rwxrwxrwx 1 root root 27 Oct 9 2010 01sysctl
-rwxrwxrwx 1 root root 229 Feb 29 2008 03firstboot
-rwxrwxrwx 1 root root 105 Feb 29 2008 04modules
-rwxrwxrwx 1 root root 1593 Feb 29 2008 05mountsd
-rwxrwxrwx 1 root root 794 Feb 29 2008 20userinit
localhost init.d # ln -s /data/local/bin/rc.local 99doublehp
localhost init.d #
and populate /data as required:
Code:
bash-3.2# tar -czf bin.tgz /data/local/bin/
tar: removing leading '/' from member names
bash-3.2#
[email protected] /tmp $ adb -s SH169V80XXXX pull /data/app/bin.tgz
3660 KB/s (411734 bytes in 0.109s)
[email protected] /tmp $
[email protected] /tmp $ adb -s 0123456789ABCDEF push bin.tgz /data/local/tmp/
1972 KB/s (411734 bytes in 0.203s)
[email protected] /tmp $
localhost / # tar -xvzf /data/local/tmp/bin.tgz
data/local/bin/
data/local/bin/cpu
data/local/bin/rc.local
data/local/bin/psa
[...]
ah ... at last, ONE difference:
Code:
localhost / # head -n1 /system/sbin/psa
#!/system/bin/bash
localhost / # which bash
/system/xbin/bash
localhost / #
localhost / # cd /system/bin/
localhost bin # ln -s ../xbin/bash .
localhost bin #
No way to edit each and every script ^^
Most important one for debugging:
Code:
localhost ~ # vibrate 100
Voltage not provided. Using default 3100 mV.
/system/sbin/vibrate: line 37: /sys/devices/virtual/timed_output/vibrator/voltage_level: No such file or directory
localhost ~ # vibrate 500
Voltage not provided. Using default 3100 mV.
/system/sbin/vibrate: line 37: /sys/devices/virtual/timed_output/vibrator/voltage_level: No such file or directory
localhost ~ #
Let's prepare the SDcard for Debian use; since CM6 does not have mkfs.ext3, I did that on my workstation.
Code:
localhost / # mkdir -p /data/local/mnt/sdcard_ext
localhost / # mount /dev/block/mmcblk0p1 /data/local/mnt/sdcard_ext/
localhost / #
I should have started by this (to help understand these logs), but it's never too late:
on HD: vi /etc/bash/bashrc
PS1='\[\033[01;31m\][email protected]\[\033[01;34m\]:\w\[\033[00m\] '
on Sensation: vi $HOME/.bashrc
PS1='\[\033[01;31m\][email protected]\[\033[01;34m\]:\w\[\033[00m\] '
This prompt is handy so that I can do copy-paste of the prompt itself for use with scp and rsync: if I am at one place in ssh, I can copy the prompt to scp a file there from an other machine.
So ... I was about to copy my Debian: I put both SDcards in the workstation.
Code:
[email protected]:~ cp -a /media/uSD_ext3/Linux /media/Hmmm/
Remove sshd keys to force regen ( /etc/ssh/ssh_host_*). Update hostname (it never properly worked in Armel).
... I'll continue overnight.
doublehp said:
I
After viewing http://cdn.youtubeavi.com/view-video/0TpYHpfHW-8 (confirmed by reading http://resetguide.com/2012/05/how-to-install-android-on-hd2-nand/ ), I saw that amongst my 1GB of data downloaded in the last days, I did not have the file ANDR_install.exe; I downloaded all possible ROMs until I find one having this magic file: http://forum.xda-developers.com/showthread.php?t=893637 . Only this ROM has andr_install.exe . And when I ran it, it worked on the first time (while of course having HD with MAGLDR on option 5: USB flash).
Click to expand...
Click to collapse
...because thats the old, outdated way of installing android,, pre-nand recovery, , and those are old, outdated android roms which is why only they have the 'magic' (now obsolete) file.
samsamuel they may be outdated, but I love CM6 (after 1h of use, I find it very good), and no other method worked (4 or 5 other different methods all ended up in the RSPL.cpp issue).
To take control of my new Android, a friend told me to try AndroidScreenCast. It's some kind of VNC, specially written for Android.
Once Android is installed, you can have fun with it, without touchpad, by using http://code.google.com/p/androidscreencast/ . I am lucky that on CM6, adb was enabled by default. Download http://androidscreencast.googlecode.com/svn/trunk/AndroidScreencast/dist/androidscreencast.jnlp and run it with
Code:
javaws androidscreencast.jnlp
I will try to not use it at all. I tried it, just so that I can tell "it works", and discard all welcome menus. Did not even configure Wifi.

[PORT] DHCPv6 Client for Android

Hi everyone,
This thread is obsolete because I found a solution check out my app here: http://forum.xda-developers.com/android/apps-games/app-dhcpv6-client-t3176443
This is port of Roy Marples dhcpcd client for Android.
Background:
The fact that Android doesn't support DHCPv6 is for many system administrators an eyesore.
The guys from google don't plan to implement this feature very soon or not at all. See https code.google.com/p/android/issues/detail?id=32621
Because of this I decided to cross compile the dhcpcd client from Roy Marples for android.
source: http roy.marples.name/projects/dhcpcd/home
This client was tested on my Nexus 5 with:
Chroma ROM (build from 05-06-2015 with Android 5.1.1)
3.4.107 UBER-L Kernel
Working
Execution of dhcpcd
Optaining AND setting IPv4 address
Optaining IPv6 address (but not assigning the address to an interface)
NOT Working
Assigning IPv6 address to an interface
running as dhcp user (will give you permission denied on the interfaces)
as replacement for the stock client (see below)
Installation
Connect your phone to your PC
Open an adb shell (adb shell)
ON PHONE:
Make a folder for the dhcp client
cd /sdcard && mkdir dhcpcd
ON COMPUTER:
Copy files to phone
adb push roy-marples-dhcpcd-android.tar.gz /sdcard/dhcpcd
ON PHONE:
cd /sdcard/dhcpcd
extract roy-marples-dhcpcd-android.tar.gz
tar -xf roy-marples-dhcpcd-android.tar.gz
aquire root
su
remount /system rw
mount -o remount,rw /system
copy dhcpcd client
cp out/system/bin/dhcpcd /system/bin/dhcpcd6
DO NOT OVERWRITE THE STOCK DHCP CLIENT!!!!!
Copy all other files and create folders
mkdir /data/misc/dhcp6 && mkdir /system/etc/dhcpcd6
cp out/system/etc/dhcpcd6/* /system/etc/dhcpcd6/.
copy required libs
cp libs/* /system/lib
setting permissions
chmod 755 /system/bin/dhcpcd6
chown root:shell /system/bin/dhcpcd6
chmod 644 /system/lib/ld-linux-armhf.so.3
chmod 644 /system/lib/libc.so.6
chmod 755 /system/etc/dhcpcd6
chmod 550 /system/etc/dhcpcd6/dhcpcd-run-hooks
chmod 644 /system/etc/dhcpcd6/dhcpcd.conf
chmod 770 /data/misc/dhcp6
chown dhcp:dhcp /data/misc/dhcp6
Behavior
dhcpcd - stock dhcp client
dhcpcd6 - my cross compiled dhcp client
This client will not work without the stock dhcpcd client for some reason.
When killing dhcpcd and connecting to a w-lan network dhcpcd will be started, you can then call dhcpcd6 and you will get a secondary IPv4 address, however you can get but not set an IPv6 address, see Issues to fix.
If you replace dhcpcd with dhcpcd6, android will not invoke a dhcpcd process, when connecting to a network, also manually over command line by calling dhpcd will not get an IP address.
If dhcpcd6 is invoked by the dhcp user (su dhcp -c "/system/bin/dhcpcd6") will give a permission denied at the interfaces for some reason.
Issues to Fix
You can obtain an IPv6 address but you can not assign it to an interface for some reason:
Code:
wlan0: soliciting a DHCPv6 lease
wlan0: ADV xxxx:67c:xxxx:52cc:xxxx::1419/128 from xxxx:67c:xxxx:52cc:xxxx::1
wlan0: REPLY6 received from xxxx:67c:xxxx:52cc:xxxx::1
wlan0: adding address xxxx:67c:xxxx:52cc:xxxx::1419/128
if_addaddress6: Invalid argument
I went through the source code and found out that the problem might come from the sendmsg function which basically sends data through a socket: if-linux.c line 865
Any advice would be appreciated
Troubleshooting
If you get something like this:
Code:
wlan0: Router Advertisement from 1234::1234:xxxx:xxxx:xxxx
wlan0: ignoring RA from 1234::1234:xxxx:xxxx:xxxx (no public prefix, no managed address)
Add ipv6ra_accept_nopublic to the /system/etc/dhcpcd6/dhcpcd.conf file
Help needed!
Basically just how to get it fully working
Any advise would be appreciated
Compiled with:
Compiled on: x86_64 GNU/Linux (Debian Jessie)
arm-linux-gnueabihf-
package: binutils-arm-linux-gnueabihf
preconfigure.sh
Code:
export CROSS_TARGET=arm-linux-gnueabihf
export CC="${CROSS_TARGET}-gcc-5"
## export CXX="${CROSS_TARGET}-g++"
export AR="${CROSS_TARGET}-ar"
export AS="${CROSS_TARGET}-as"
export LD="${CROSS_TARGET}-ld"
export RANLIB="${CROSS_TARGET}-ranlib"
export READELF="${CROSS_TARGET}-readelf"
export STRIP="${CROSS_TARGET}-strip"
Compile:
Code:
./configure --host=arm-linux-gnueabihf --enable-static --enable-ipv4 --enable-ipv6 --enable-embedded --sysconfdir=/system/etc/dhcpcd6 --bindir=/system/bin --libexecdir=/system/etc/dhcpcd6 --statedir=/data/misc/dhcp6 --dbdir=/data/misc/dhcp6 --rundir=/data/misc/dhcp6 --libdir=/system/lib
make -j2 ARCH=arm
mkdir out
make install DESTDIR=out
Thanks To:
Roy Maprles - for the source of his dhcp client
-realm_01
Edit 1 10:20 17-06-2015
I rebuilded the dhcpcd client with some changes in the directories, also I figured out what why I can't assign a IPv6 address
This thread is obsolete because I found a solution check out my app here: http://forum.xda-developers.com/android/apps-games/app-dhcpv6-client-t3176443

Categories

Resources