Wednesday, January 30, 2013

Rooting the Samsung Galaxy S3 and (Optionally) Installing CM10.1

Used without permission from:  http://gurushala.net/wp-content/uploads/2012/08/CyanogenMod10_BootAnimation.jpg

There is a bunch of information about doing this already.  I'm just documenting what I steps I took to do this under Linux.

First, I got the Heimdall 64 bit binary.  This would not run, not sure why:

wskellenger@marquette ~/utils $ ./heimdall
bash: ./heimdall: No such file or directory


Even as root, it refused to do anything useful:

wskellenger@marquette ~/utils $ sudo ./heimdall

Okay, so I downloaded the 32 bit version.

wskellenger@marquette ~/utils $ ./heimdall
./heimdall: error while loading shared libraries: libusb-1.0.so.0: cannot open shared object file: No such file or directory


I don't really understand this either, as I have libusb:

 wskellenger@marquette ~/utils $ sudo ldconfig -v | grep libusb
/sbin/ldconfig.real: Can't stat /lib/i686-linux-gnu: No such file or directory
/sbin/ldconfig.real: Can't stat /usr/lib/i686-linux-gnu: No such file or directory
/sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once
/sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once
    libusb-0.1.so.4 -> libusb-0.1.so.4.4.4
/sbin/ldconfig.real: Cannot stat /usr/lib/x86_64-linux-gnu/libnss_db.so    libusb-0.1.so.4 -> libusb-0.1.so.4.4.4
: No such file or directory
    libusb-1.0.so.0 -> libusb-1.0.so.0.1.0
    libusb-0.1.so.4 -> libusb.so
/sbin/ldconfig.real: Cannot stat /usr/lib32/libnss_db.so: No such file or directory
    libusbmuxd.so.1 -> libusbmuxd.so.1.0.7


After some Googling around and coming up empty, I just decided to build heimdall from source.  This was easy enough.

cd ~/Projects
git clone https://github.com/Benjamin-Dobell/Heimdall.git
cd Heimdall
git checkout v1.4.1RC2

Now you should have all of the sources you need to build.  The following instructions are from the Heimdall README.

wskellenger@marquette ~/Projects/Heimdall $ cd libpit
wskellenger@marquette ~/Projects/Heimdall/libpit $ ./configure
wskellenger@marquette ~/Projects/Heimdall/libpit $ make
wskellenger@marquette ~/Projects/Heimdall/libpit $ cd ..
wskellenger@marquette ~/Projects/Heimdall $ cd heimdall
wskellenger@marquette ~/Projects/Heimdall/heimdall $ ./configure
wskellenger@marquette ~/Projects/Heimdall/heimdall $ make

wskellenger@marquette ~/Projects/Heimdall/heimdall $ sudo make install

You'll see this message after doing the install, do what it says:

 IMPORTANT - You must reboot your machine or execute the following as root:
service udev restart


If you want the frontend, also do:

wskellenger@marquette ~/Projects/Heimdall/heimdall-frontend $ qmake-qt4 heimdall-frontend.pro
wskellenger@marquette ~/Projects/Heimdall/heimdall-frontend $ make
wskellenger@marquette ~/Projects/Heimdall/heimdall-frontend $ sudo make install


That's it.  If you type 'heimdall' at a prompt now you should see some stuff on the screen.

Now, I took a brand new SGS3, and pressed HOME (the single button), Volume DOWN, and POWER at the same time.  You will feel a small buzz of the vibrator, and then see a screen about how this is dangerous and so forth.  Press volume UP to proceed.

At this point you'll see just our little green android guy and an indication that it is "Downloading...", but we haven't done anything yet.

Let's get the recovery installed first.  First I checked to see if anything from Samsung was connected.  Indeed there was:

 wskellenger@marquette ~/Projects/Heimdall/heimdall $ sudo lsusb
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 006: ID 04e8:685d Samsung Electronics Co., Ltd
Bus 001 Device 003: ID 2635:0601 
Bus 001 Device 004: ID 0a5c:21d7 Broadcom Corp.
Bus 001 Device 005: ID 0c45:6495 Microdia 


Now I just moved the clockworkmod image that I downloaded from here over to my utils directory.

wskellenger@marquette ~/utils $ mv ~/Downloads/recovery-clockwork-6.0.2.3-d2att.img .

I also renamed it to recovery.img, probably isn't necessary but I did so anyway:

wskellenger@marquette ~/utils $ mv recovery-clockwork-6.0.2.3-d2att.img recovery.img

Now let's try to flash it with Heimdall:

wskellenger@marquette ~/utils $ heimdall flash --recovery recovery.img --no-reboot
Heimdall v1.4 RC2

Copyright (c) 2010-2012, Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

Initialising connection...
Detecting device...
Claiming interface...
Attempt failed. Detaching driver...
Claiming interface again...
Setting up interface...

Checking if protocol is initialised...
Protocol is not initialised.

Initialising protocol...
Protocol initialisation successful.

Beginning session...

This device may take up to 2 minutes to respond.
Please be patient!

Session begun.

Downloading device's PIT file...
PIT file download successful.

Uploading RECOVERY
100%
RECOVERY upload successful

Ending session...
Releasing device interface...
Re-attaching kernel driver...


At this point I just tried to reboot the device into recovery to see if I had CWM installed or not.  I popped the battery out to get out of the previous download mode.  Maybe there is a better way to do this, not sure.  Now reboot into recovery.  Hold Volume UP, HOME, and POWER.  When you feel the small vibration, keep holding for a little while longer.  You will see the SGS3 logo and then hopefully boot into CWM recovery.

Once inside CWM, the first thing I'm going to do is a Nandroid backup of this baby.  Go to backup and recovery and select backup.  This will take a little while so be patient.  In the meantime I'll download CM10.

Edit 6-May-2013:  If you just want to root your device, and keep the stock Samsung ROM, at this point you can sideload the UPDATE-SuperSU-v1.xx.zip file available here.  After this, reboot, check to see if the SuperSU app is installed, and you're done.

Okay, back to installing CM 10.  I went with one of the 10.1 monthly release snapshots, available at http://get.cm.

Now that you've got the CM package and you've made a backup, we can sideload the CM10 .zip file onto the device.  First let's see if we can see the device or not:

wskellenger@marquette ~/utils $ adb devices
List of devices attached
3c1b4cf7    recovery


Pretty sweet.  Let's go to 'install zip  from sideload' in the Clockworkmod menu.  The screen should show:

Sideload started ...
Now send the package you want to apply
to the device with "adb sideload <filename>" ...

So, let's do that:

wskellenger@marquette ~/Downloads $ adb sideload cm-10.1-20130121-EXPERIMENTAL-d2att-M1.zip
sending: 'sideload'  100% 


After this you'll see the phone open and install the update automatically.  This is pretty sick.  We also need gapps so let's download and install that the same way.  I got gapps from goo.im.

Again, select "install zip from sideload", and adb sideload the gapps package:

wskellenger@marquette ~/Downloads $ adb sideload gapps-jb-20121212-signed.zip sending: 'sideload'  100% 

That's pretty much it folks.  I actually did a wipe data, wipe cache, wipe dalvik.  After that I feared that I perhaps undid the gapps installation so I installed gapps again after this.  Then I did "reboot system now" and unplugged the USB cable.

Booyah, I'm seeing the familiar CyanogenMod bootscreen.




Sunday, January 13, 2013

Ericsson T39 "Increasing" Ringtone (retro)

Buying my first cellphone was an ugly experience.  The year was about 2000 or maybe 2001 (I was pretty late to the party) and I *had* to have this baby -- the Ericsson T39.

Still today, I am still stunned by the design of this little Swedish beauty, with it's stubby little antenna and dot matrix LCD.

I purchased the phone on eBay for somewhere around $400, because it was no longer available at the cell carriers around here.  When I received the phone, I ran down to T-Mobile and activated my phone and got my first (and still current) cell number.

Things were great for about a month or so, and then one day the LCD simply displayed "NO NETWORK".  I tried everything to get the phone back into working order, including sending it to a company in California that flashed the latest and greatest firmware onto the phone for me, but to no avail.  From what I read on the interwebs at the time, the "NO NETWORK" bug was pretty common and it could be handled under warranty.  The problem was that, having purchased the phone on eBay, I could not prove that I was the original purchaser and thus I was not entitled to any warranty.

Well, that was that.  I ended up getting a crappy little Motorola candy-bar phone on eBay to replace this one, it worked fine enough for me though.

In the meantime, my favorite ringtone from the T39 was one called "Increasing".  Before I auctioned the phone on eBay as 'broken' for about $50, I recorded the ringtone as .wav and I still use it to this day on my Android smartphone.

Here it is.  Enjoy it.  It definitely would be considered 'retro' by today's standards, but you can hear this ringtone even when your phone is in your pocket.