Post Reply

[Root & Bootloader Unlock] Docomo Optimus G

11th January 2013, 09:14 PM   |  #1  
jcase's Avatar
OP Forum Moderator / Senior Recognized Developer - Taco Vendor
Flag Sequim WA
Thanks Meter: 7,867
 
3,822 posts
Join Date:Joined: Feb 2010
Donate to Me
More
Original source: http://www.androidpolice.com/2013/01...-lg-optimus-g/

Credits:
adb backdoor: giantpune
Duct tape guru: jcase
bootloader: Team Codefire http://forum.xda-developers.com/show....php?t=2001655
Testers: Shados and germes81m

Donations:
For giantpune : Paypal to giantpune@gmail.com
For jcase : http://forum.xda-developers.com/dona....php?u=2376614

Download: http://d-h.st/d6p

Files: (Verify the MD5s before proceeding)
MD5 (boot.img) = 175c1bdaabbbbcbd7a4b69a315057e5b
MD5 (hotplug) = 9fbef20822281a2dd546b3e43d8c30dd
MD5 (lk.img) = bc54a6a730658550713a0779b30bf6b7
MD5 (unlock.sh) = 3871c2dde3d6b1d99d27ffa4021c81d3


Fastboot Drivers (needed for windows):
http://forum.xda-developers.com/show....php?t=1996051

Notice:
This is an at your own risk kind of thing, if your phone becomes damaged or data lost, your
fault not mine. This does install a unsecured (ro.secure=0) boot image in the process, this
does potentially open your device to security risks (as do most customized firmwares.)


Story:
The Docomo Optimus G ships with a mandatory access control system, that prevents
remounting system, reading boot, executing some things as root, etc general pain in the butt.

We are using a backdoor found by giantpune (and later by Juggie). The backdoor is partially
broken on this device due to the MAC, so it does not yield a root shell for us. However we
can still use it with a couple extra steps to unlock the bootloader\s. We are also going to
install a modified boot img, that removes some of the phone's security features, and allows
us to actually have root access.

Notes:
Graphic glitches will occur while in the bootloader, you will have to use the bootloader 'blind'


Follow directions exactly.

Directions:


Code:
adb push lk.img /data/local/tmp/lk.img

adb push unlock.sh /data/local/tmp/unlock.sh

adb shell chmod 755 /data/local/tmp/unlock.sh

adb shell touch /sdcard/g_security
Disable USB Debugging, then enable usb debugging

Code:
adb shell id
Should recieve an error about not executing /system/bin/sh, this is what we want. If you
don't have the error, start over.

Code:
adb push hotplug /proc/sys/kernel/hotplug
Now toggle bluetooth once, and wait for your phone to display a garbaled screen (the bootloader).
If it displays a blank screen instead of a garbled screen, pull battery, reboot and run 'adb reboot bootloader'

Code:
fastboot devices
If you see your device listed, continue. If not then find the proper drivers, and then
continue.

Code:
fastboot flash boot boot.img
fastboot reboot
adb shell /sbin/rootme.sh
If your phone does not reconnect to your mobile network, try rebooting it serveral times.
If it does not still, then reflash stock firmware.

We are using supersu, and the app https://play.google.com/store/apps/d...infire.supersu
is needed.
Last edited by jcase; 22nd January 2013 at 03:56 AM. Reason: Posting guide
The Following 14 Users Say Thank You to jcase For This Useful Post: [ View ]
14th January 2013, 12:38 PM   |  #2  
Member
Thanks Meter: 6
 
64 posts
Join Date:Joined: Jan 2013
could you please make a tool to root 4.1.2?thanks!until now i can't find a way to root it.
15th January 2013, 05:03 AM   |  #3  
jcase's Avatar
OP Forum Moderator / Senior Recognized Developer - Taco Vendor
Flag Sequim WA
Thanks Meter: 7,867
 
3,822 posts
Join Date:Joined: Feb 2010
Donate to Me
More
Quote:
Originally Posted by wangzhiqiang

could you please make a tool to root 4.1.2?thanks!until now i can't find a way to root it.

Wrong place to ask
16th January 2013, 12:41 PM   |  #4  
Senior Member
Flag Between here and there
Thanks Meter: 617
 
808 posts
Join Date:Joined: Jun 2012
More
Quote:
Originally Posted by jcase





I ran out of time, and without the device it is a PITA. I believe something in the kernel is protecting system, possible SEAndroid or something with similar protections.

Will be going back at this later this week, any ideas?

I don't have a Optimus G or a varient therof. I'm just helping a guy extracting the *.tot file and I came accross this.

and looking at the ls output

Quote:

-rwsr-s-r-x root root su

Its wrong. Setuid bit is not set for other and it won't allow for increasing permissions when run.
17th January 2013, 10:45 AM   |  #5  
Member
Flag Phnom Penh
Thanks Meter: 0
 
33 posts
Join Date:Joined: Feb 2005
More
Quote:
Originally Posted by xonar_

I don't have a Optimus G or a varient therof. I'm just helping a guy extracting the *.tot file and I came accross this.

and looking at the ls output



Its wrong. Setuid bit is not set for other and it won't allow for increasing permissions when run.

There are too many seperate partitions in tot file, any idea to combine ?
17th January 2013, 07:37 PM   |  #6  
Senior Member
Flag Between here and there
Thanks Meter: 617
 
808 posts
Join Date:Joined: Jun 2012
More
Quote:
Originally Posted by khengvantha

There are too many seperate partitions in tot file, any idea to combine ?

Yes. I'll be able to work on it more on Sunday. I'm going to be busy till then. (Or maybe I can sneak in an hour somewhere before then)

And it's a bit OT here. Not much to do with rooting Docomo Optimus G .
18th January 2013, 05:52 PM   |  #7  
jcase's Avatar
OP Forum Moderator / Senior Recognized Developer - Taco Vendor
Flag Sequim WA
Thanks Meter: 7,867
 
3,822 posts
Join Date:Joined: Feb 2010
Donate to Me
More
Re: [Root] Docomo Optimus G
Good catch, will fix and try again when I get a chance. This still doesn't fix sh refusing to run as root.

The ccs-init is preventing it, and remounting.

Quote:
Originally Posted by xonar_

I don't have a Optimus G or a varient therof. I'm just helping a guy extracting the *.tot file and I came accross this.

and looking at the ls output



Its wrong. Setuid bit is not set for other and it won't allow for increasing permissions when run.

Last edited by jcase; 18th January 2013 at 05:58 PM.
19th January 2013, 08:03 PM   |  #8  
jcase's Avatar
OP Forum Moderator / Senior Recognized Developer - Taco Vendor
Flag Sequim WA
Thanks Meter: 7,867
 
3,822 posts
Join Date:Joined: Feb 2010
Donate to Me
More
Yes this wasn't the issue.

Quote:
Originally Posted by xonar_

I don't have a Optimus G or a varient therof. I'm just helping a guy extracting the *.tot file and I came accross this.

and looking at the ls output



Its wrong. Setuid bit is not set for other and it won't allow for increasing permissions when run.

19th January 2013, 08:24 PM   |  #9  
Senior Member
Flag Between here and there
Thanks Meter: 617
 
808 posts
Join Date:Joined: Jun 2012
More
Quote:
Originally Posted by jcase

Yes this wasn't the issue.

What does logcat say?

Try creating a minimalistic binary

Code:
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>

int main()
{
  if(setuid(0)==-1)
  {
    printf("Failed Setting Root UID : %s",strerror(errno));
  }
  else
  {
    printf("Success!\nCurrent UID : %d",getuid());
  }

  return 0;
}
Last edited by xonar_; 19th January 2013 at 08:28 PM. Reason: fix typo
20th January 2013, 09:10 PM   |  #10  
jcase's Avatar
OP Forum Moderator / Senior Recognized Developer - Taco Vendor
Flag Sequim WA
Thanks Meter: 7,867
 
3,822 posts
Join Date:Joined: Feb 2010
Donate to Me
More
It failed, Docomo used a MAC (ccs-init/ccs-audit). We got the bootloader unlocked yesterday, so we can removed the access control. I'll post details in the morning.

Quote:
Originally Posted by xonar_

What does logcat say?

Try creating a minimalistic binary

Code:
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>

int main()
{
  if(setuid(0)==-1)
  {
    printf("Failed Setting Root UID : %s",strerror(errno));
  }
  else
  {
    printf("Success!\nCurrent UID : %d",getuid());
  }

  return 0;
}


The Following 3 Users Say Thank You to jcase For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Optimus G Original Android Development by ThreadRank