Tuesday 14 August 2012

Hauwei Ascend G300 ADB rules.d files for linux (Ubuntu 11.04)

Just in case anyone needs the rules.d files for the linux adb here are my android rules files.

They reside in /etc/udev/rules.d

I'm not sure which one actually activated recognition of the G300 but it doesn't seem to upset anything having both these in.

In the rules.d folder create a file called 99-android.rules (note the character after the 99 is the minus sign)

If you're in a terminal and in the folder /etc/udev/rules.d just type

sudo gedit 99-android.rules

Paste this into it

SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", SYMLINK+="android_adb", MODE="0666" GROUP="plugdev"
#Google
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
#Acer
SUBSYSTEM=="usb", SYSFS{idVendor}=="0502", MODE="0666"
#Dell
SUBSYSTEM=="usb", SYSFS{idVendor}=="413c", MODE="0666"
#Foxconn
SUBSYSTEM=="usb", SYSFS{idVendor}=="0489", MODE="0666"
#Garmin-Asus
SUBSYSTEM=="usb", SYSFS{idVendor}=="091E", MODE="0666"
#HTC
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
#Huawei
SUBSYSTEM=="usb", SYSFS{idVendor}=="12d1", MODE="0666"
#Kyocera
SUBSYSTEM=="usb", SYSFS{idVendor}=="0482", MODE="0666"
#LG
SUBSYSTEM=="usb", SYSFS{idVendor}=="1004", MODE="0666"
#Motorola
SUBSYSTEM=="usb", SYSFS{idVendor}=="22b8", MODE="0666"
#Nvidia
SUBSYSTEM=="usb", SYSFS{idVendor}=="0955", MODE="0666"
#Pantech
SUBSYSTEM=="usb", SYSFS{idVendor}=="10a9", MODE="0666"
#Samsung
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"
#Sharp
SUBSYSTEM=="usb", SYSFS{idVendor}=="04dd", MODE="0666"
#Sony Ericsson
SUBSYSTEM=="usb", SYSFS{idVendor}=="0fce", MODE="0666"
#ZTE
SUBSYSTEM=="usb", SYSFS{idVendor}=="19d2", MODE="0666"

Save the file and if you ls-al you will see the file 99-android.rules there.

chmod the file so it's executable

sudo chmod +x 99-android.rules

ls -al will show the file and permissions as (in my example)

-rwxr-xr-x 1 root root 1106 2012-08-12 15:49 99-android.rules


The file name in green is to highlight the fact it's executable.

At this point you could try rebooting and see if the phone is seen by adb devices, if not then try adding the next file.

in the same directory I also have 51-android.rules so make a file with that name and edit it as before, paste these lines in....

## SUBSYSTEM=="usb", ATTR{idVendor}=="12d1",ATTRS{idProduct}==”1030”, MODE="0666"
## BUS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="d00d", GROUP="plugdev", MODE="0660"

SUBSYSTEM=="usb", SYSFS{idVendor}=="618e", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="d00d", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", SYMLINK+="android_adb", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="d00d", SYMLINK+="android_adb", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="1004", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="22b8", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="0502", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="413c", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="0489", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="091E", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="12d1", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="0482", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="1004", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="0955", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="10A9", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="04dd", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="0fce", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="19D2", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="0451", MODE="0666"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device",
ENV{PRODUCT}=="e79/*", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="e79", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="0e79", MODE="0666"


Save the file, again make it executable by

sudo chmod +x 51-android.rules

 ls -al should show the 2 files as...

-rwxr-xr-x 1 root root 1576 2012-08-12 15:14 51-android.rules
-rwxr-xr-x 1 root root 1106 2012-08-12 15:49 99-android.rules

The G300 identified itself to adb and that allowed me to run the bootloader unlock and the root file.

Hope this helps anyone searching for the adb files.

As I say I'm not 100% sure which file was needed (or both), one file was put in to recognize my pulse mini, different Ubuntu versions need these files differently i.e one might only use the 51-android.rules while another might need the 99-android.rules one.

But my system doesn't mind they are both there and for the 3 minutes it takes to make the files and paste the contents in it's hardly hard work.

You can restart the services for udev and adb but to ensure the files are read fully etc I just rebooted my server, I try not to reboot it too often and almost went a whole year without a reboot (although in linux terms a year without a reboot is hardly worth speaking about, I spoke to one customer who has genuinely not rebooted fully [power cycle boot] in 15 years and still runs the exact same system configuration, it's never been updated and he runs fine).

For info my brother got an unlock code for £2.99 and his G300 is now unlocked from Vodaphone and working perfect on Giff Gaff, he had to enter the service numbers manually for SMS etc but they only took a couple of minutes, the phone appears very nimble, has an excellent display and ICS looks great on it.

Don't forget by the way you need your phone in debug mode (in the android settings) so that it does not mount as a USB storage device but stays active as a phone - the G300 notifies you it is connecting as a debug device.

Then when you type "adb devices" you should get a response from whatever phone is connected and you can continue.


No comments:

Post a Comment