Archive for the 'Hacking' Category

Jan 29 2011

Quick root on Nexus S

Capturing some data here so that its not lost when I go looking for it again.

I discovered quite by accident that the Clockwork recovery image allows adb to connect to it while sitting at the recovery menu. The adb shell is a root shell. You can use clockwork to mount whatever filesystems you may need to work on. This means that you can take any of the su binaries floating around the net, or even hack a bit and then build the su thats in the Android tree,  and dump it in /system/bin/su while in the recovery menu and then chmod it 4755 to suid it root.

So basically:

  • boot nexus S into fastboot with vol up and  power
  • pick recovery off the menu
  • from the recovery menu:
    • mount /system partition
  • from adb:
    • adb push /path/to/your/su/binary  /system/bin/su
    • adb shell
      • chmod 4755 /system/bin/su
  • from the recovery menu:
    • reboot device

When the handset comes back up, adb in as normal, and then issue an su command and you should be root.

>>>Karl

No responses yet

Jan 11 2011

ADB on VMWare Fusion || CentOS

A note to myself really, I was trying to get ADB to run on both my CentOS 5.5 machine and a VMWare Fusion Virtual Machine running Ubunto. Both flavors of linux protested my using adb with something along the lines of:

majer@ubuntu:~/android$ sudo ~/bin/adb devices
List of devices attached ????????????    no permissions
 

After a considerable amount of digging I found the one line change that needed to be made on both OSes. Add the following to /etc/udev/rules.d/51-android.rules:

SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"

And then restart the adb services with a:

[majer@ubuntu:~/android/] sudo ~/bin/adb kill-server
[majer@ubuntu:~/android/] sudo ~/bin/adb start-server

The adb command will work as expected now.

>>> Karl

No responses yet

Jul 22 2010

Google Chrome Incognito default startup on OSX

Published by Karl Majer under Hacking,Play

I’ve recently started using Google Chrome, and while my browsing habits of keeping 30+ tabs open doesn’t mesh well with how Chrome uses memory, the Incognito mode is fantastic for going to friendly sites like FaceBook that share your login cookies/credentials with an ever growing number of sites on the internet.

The following hack will start Chrome up in Incognito mode by default. If you want a “normal” browser, just open a new browser window. Note, this is a ‘I’m not afraid of the shell prompt, I like voiding warranties, and if my computer explodes I’m fine with it’ sort of modification.

In windows land you can do this by right clicking on the desktop icon and editing the properties to add a ‘-incognito’ at the end of the line. Things don’t quite work the same way in OSX.

Without further delay:

bash-3.2$ cd /Applications/Google\ Chrome.app/Contents/MacOS/
bash-3.2$ mv Google\ Chrome Google\ Chrome.real
bash-3.2$ echo '#!/bin/sh' > Google\ Chrome
bash-3.2$ echo 'exec "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome.real" -incognito' >> Google\ Chrome
bash-3.2$ chmod 775 Google\ Chrome

Click on the normal icon, if the app starts up it should be in Incognito mode. If it doesn’t start, fire up the console app and look at the last couple of entries, you may have a typo. If all else fails you can fall back with this:


bash-3.2$ mv Google\ Chrome.real Google\ Chrome

So what does this do? OSX .app bundles contain all the resources for the application. The binary is usually hidden in the MacOS directory. We’ve just created a shell wrapper for that which calls the real binary and passes it the -incognito switch, just like they do on Windows.

Like I said earlier, you have been warned. I’ve been using this for a while now without any problems but my setup is likely different than yours, and this definitely would not fall under “normal” usage for Chrome. Also, note that you will need to do this anytime you update your Chrome installation.

Good luck,

>>> Karl

No responses yet