[ROOT] G2x Easy Root for Mac and Linux

Search This thread

v8dreaming

Senior Member
Aug 15, 2010
539
240
N. Las Vegas
Can't seem to unroot. I keep getting device not found. I downloaded the VirtualBox deal to flash CWM and root and it worked fine. Also worked fine flashing the stock recovery.
I get this when running the command op said to use in terminal:
Jul 27 09:00:32 jason-MacBook kernel[0]: USBF: 8562.709 AppleUSBOHCI[0x71cc000]::SuspendUSBBus Processing WDH before suspending
Jul 27 09:00:33 jason-MacBook kernel[0]: USBF: 8562.714 AppleUSBOHCI[0x71cc000]::SuspendUSBBus Processing WDH before suspending
Jul 27 09:00:34 jason-MacBook kernel[0]: USBMSC Identifier (non-unique): 037c714741a012d7 0x1004 0x618e 0x9999
Jul 27 09:00:34 jason-MacBook kernel[0]: AppleUSBCDCACMData: Version number - 4.0.1, Input buffers 8, Output buffers 16
Jul 27 09:00:34 jason-MacBook kernel[0]: USBF: 8564.795 AppleUSBOHCI[0x71cc000]::SuspendUSBBus Processing WDH before suspending

Don't know what any of this stuff means. haha
 

jnichols959

Senior Member
Mar 1, 2011
156
98
Can't seem to unroot. I keep getting device not found. I downloaded the VirtualBox deal to flash CWM and root and it worked fine. Also worked fine flashing the stock recovery.
I get this when running the command op said to use in terminal:
Jul 27 09:00:32 jason-MacBook kernel[0]: USBF: 8562.709 AppleUSBOHCI[0x71cc000]::SuspendUSBBus Processing WDH before suspending
Jul 27 09:00:33 jason-MacBook kernel[0]: USBF: 8562.714 AppleUSBOHCI[0x71cc000]::SuspendUSBBus Processing WDH before suspending
Jul 27 09:00:34 jason-MacBook kernel[0]: USBMSC Identifier (non-unique): 037c714741a012d7 0x1004 0x618e 0x9999
Jul 27 09:00:34 jason-MacBook kernel[0]: AppleUSBCDCACMData: Version number - 4.0.1, Input buffers 8, Output buffers 16
Jul 27 09:00:34 jason-MacBook kernel[0]: USBF: 8564.795 AppleUSBOHCI[0x71cc000]::SuspendUSBBus Processing WDH before suspending

Don't know what any of this stuff means. haha

I'm not sure what the "Processing WDH before suspending" line is about. I don't see that. The line that contains "USBMSC Identifier (non-unique): 02884207426144d7 0x1004 0x618e 0x9999" is good as it shows that the mac sees the phone in some sense.

Can you give more details on your setup and what you're doing? You're on a mac, your phone is 2.2.x with root and stock recovery? You said you had used the virtualbox vm to flash cwm but that isn't running when you're trying to run the mac unroot script is it? If you have the virtualbox vm working, you could try running the unroot from there.
 

v8dreaming

Senior Member
Aug 15, 2010
539
240
N. Las Vegas
I'm not sure what the "Processing WDH before suspending" line is about. I don't see that. The line that contains "USBMSC Identifier (non-unique): 02884207426144d7 0x1004 0x618e 0x9999" is good as it shows that the mac sees the phone in some sense.

Can you give more details on your setup and what you're doing? You're on a mac, your phone is 2.2.x with root and stock recovery? You said you had used the virtualbox vm to flash cwm but that isn't running when you're trying to run the mac unroot script is it? If you have the virtualbox vm working, you could try running the unroot from there.

I'm trying to unroot with the virtualbox vm setup. I tried running the command in vb but it doesn't work. I get some kind of error that I can't remember off the top of my head. I'll try unrooting on the mac side.
 

RueTheDay

Senior Member
Apr 11, 2009
209
19
So it looks like I figured out how to manually root my G2x that is running Gingerbread using the files included in thread, CWM via nvflash, and ADB.

Here are the steps I took from my Mac to root my G2X running the OTA Gingerbread update:

1. Boot into CWM
2. adb shell into the phone
3. mount /system (it should mount rw, if it doesn't you will need to remount it rw)
4. Use adb push to push the su and busybox files from the download here to /system/bin on your phone.
5. Use adb shell and cd /system/bin and change the permissions (chmod) to 4755 on su and busybox.
6. Use adb push to push Superuser.apk to /system/app
7. Not sure if it's necessary but I then used adb shell and cd /system/app and made the permissions of Superuser.apk the same as the others, 644.
8. Reboot.

After booting up I was able to run various apps that required superuser and I am currently running a full backup via Titanium Backup Pro.

Basically what I did was look at the root.command script included here and ran the part that installs the su, busybox, and Superuser.apk:

echo "Pushing su to /system/bin/su..."
$ADB push files/su /system/bin/su
$ADB shell 'chmod 4755 /system/bin/su'

echo "Pushing busybox to /system/bin/busybox..."
$ADB push files/busybox /system/bin/busybox
$ADB shell 'chmod 4755 /system/bin/busybox'

echo "Installing Superuser.apk android application..."
$ADB push files/Superuser.apk /system/app/Superuser.apk

Hopefully this sticks, if not at least I'm getting a good backup from Titanium.

Anyone else have any luck with this?

I cant get ADB to recognize the phone when its in CWM recovery (recognizes it fine when booted normally).
 

oreamnos

New member
Aug 6, 2011
1
0
Brooklyn, NY
Result of a run on 2.3.3

As noted in the original post, this does not work on Gingerbread. For others who might be searching, and interested to know, I thought I'd share exactly what happens if you try anyway.

I ran the "G2xRootMacLinux_v0.5" root.command script on a newly purchased (purchased from T-Mobile in early August 2011) T-Mobile LG G2x that was running 2.3.3 out of the box. Here's how that went:

Code:
Checking for connected device...
Pushing temporary root exploint (psneuter) to device...
1167 KB/s (585731 bytes in 0.489s)
Running psneuter on device...
Failed to set prot mask (Inappropriate ioctl for device)
Waiting for device...
Remounting /system read/write...
remount failed: Operation not permitted
Pushing su to /system/bin/su...
failed to copy 'files/su' to '/system/bin/su': Read-only file system
Unable to chmod /system/bin/su: No such file or directory
Pushing busybox to /system/bin/busybox...
failed to copy 'files/busybox' to '/system/bin/busybox': Read-only file system
Unable to chmod /system/bin/busybox: No such file or directory
Installing Superuser.apk android application...
failed to copy 'files/Superuser.apk' to '/system/app/Superuser.apk': Read-only file system
Removing psneuter from device...

Rebooting device...

Once device has rebooted you should be rooted.
Press Enter when you're ready to quit: 
logout

[Process completed]

It doesn't appear to have caused any issues, phone rebooted after and is functioning normally. But as mentioned, it does not root the phone. It appears as though nothing succeeded and the files copied were removed, but if anyone has thoughts as to whether one should run the unroot.command script anyway just to be clean about it, I'd be interested to hear them.

I haven't yet tried the manual method suggested by gohawks1 in this post. But if I do, I'll post the results.
 

gohawks1

Senior Member
Oct 28, 2010
150
10
Anyone else have any luck with this?

I cant get ADB to recognize the phone when its in CWM recovery (recognizes it fine when booted normally).

I've never had a problem using ADB in CWM mode, same goes when I used CWM on my Vibrant.

I just boot into CWM, plug the USB cable into my Mac and my G2x and run adb commands.
 

ericalanMICHAEL

Senior Member
Sep 21, 2011
807
14
How do you flash CWM on mac? Trying to root 2.3.3 but can't find an alternative to NVFlash. I've made a thread and had no help. I've ran countless searches and to no avail. Can someone please point me in the right direction?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 34
    NOTE: does not work with gingerbread 2.3.x. The exploit used by this (and SuperOneClick) does not work on gingerbread. It won't hurt anything if you try to run it (at least not in my experience) but it does not root the phone.

    I put together a couple shell scripts that are meant to make rooting and unrooting a G2x on Mac or Linux dead simple (folks claim it works on the Optimus 2X as well). I only tested the linux version on Ubuntu 10.10 (32 and 64-bit) so let me know if you run into any issues. Some folks have had success using the gingerbreak app to root the G2x so that may be an option too - though I haven't tried it myself.

    I was motived to do so after reading mhaedo's excellent thread that uses SuperOneClick (http://xdaforums.com/showthread.php?t=1039985). Head over there if you want to root from Windows or want to use SuperOneClick via mono on Linux/Mac.

    The scripts use the same files as SuperOneClick 1.8 so mad props to CLShortFuse. Note that they won't work on PowerPC macs.

    If you like the scripts please click the Thanks button. To root, download the attached G2xRootMacLinux zip file, expand it and:

    1. enable USB debugging on your phone (Settings -> Applications -> Development)
    2. connect your phone via USB. no drivers or android sdk needed.
    3. double-click root.command (Mac) or run it as you would any shell script (Linux)
    4. wait for the script to finish and your phone to reboot

    Unroot is similar but run unroot.command instead of root.command. It's only designed to unroot devices rooted with the root.command script.

    I also created a thread for flashing clockworkmod (or stock) recovery from the mac though it's not as simple. If you want clockworkmod for a safety net when installing ROMs (highly recommended) check it out and click Thanks if it helps: http://xdaforums.com/showthread.php?t=1099281

    Problems/Issues

    If you get something like "No connected device found" when running the script make sure usb debugging is enabled, the phone is powered on and plugged in to the computer via USB.

    On Mac OS X EasyTether is known to cause adb to break, which is what the scripts use to talk to the phone. I'll look into a fix in the scripts to disable/enable the kernel module automatically but if you have EasyTether installed you can try the steps at http://www.mobile-stream.com/easytether/android_faq.html#adbmacosx before running root/unroot.

    If you're still getting "No connected device found" and you're on a mac, try the following and post the results:

    1. open Terminal (Applications -> Utilities)
    2. type the following: sudo tail -Fn 0 /var/log/kernel.log (that's a zero)
    3. plug the phone into the computer
    4. copy the lines that show up in Terminal and post them here

    If you want to learn more about how the G2x is rooted I put a small Readme.txt file in the tar that explains what the scripts do. You could always read the shell scripts too :)

    Edit: hypmatize helped me find a bug when the path to the script had a space in it. fixed in 0.4
    Edit: Kdogg71 and artismyrevolt helped me find and fix some permissions problems on some stock linux distros. fixed in 0.5
    1
    Very nice, thanks!
    1
    I keep getting command not found... do I need to run this with su privileges? if so, how? This is what I see in the Terminal window:


    Checking for connected device...
    /Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 10: ensureDevice: command not found
    /Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 12: isRooted: command not found
    /Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 21: checkForExitEarly: command not found
    /Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 23: pushAndRunPsneuter: command not found
    Waiting for device...
    /Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 28: ensureDevice: command not found
    Remounting /system read/write...
    /Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 35: remount: command not found
    Pushing su to /system/bin/su...
    /Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 38: push: command not found
    /Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 39: shell: command not found
    Pushing busybox to /system/bin/busybox...
    /Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 42: push: command not found
    /Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 43: shell: command not found
    Installing Superuser.apk android application...
    /Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 46: push: command not found
    Removing psneuter from device...
    /Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 49: removePsneuter: command not found

    Rebooting device...
    reboot: Operation not permitted


    I'm running 10.6 (snow leopard) btw

    followed everything in the instructions
    1
    I keep getting command not found... do I need to run this with su privileges? if so, how? This is what I see in the Terminal window:


    Checking for connected device...
    /Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 10: ensureDevice: command not found
    ...

    Rebooting device...
    reboot: Operation not permitted


    I'm running 10.6 (snow leopard) btw

    followed everything in the instructions

    Are you running this by double clicking the root.command file or are you running it via terminal? I'll PM you with some more info not fit for public consumption ;)
    1
    Thank you so much it worked like a charm... quick fast and easy... Much better experience than with my returned Atrix (Mac 10.4)