The regular version of Heimdall (1.3.2 as of this writing) doesn't work with the T-Mobile SGSII (also known by the model number SGH-T989), but there is a bug report on the main Heimdall project's GitHub site which points at a forked version that will work if you massage it properly.
Within the forked version is a piece of code that checks a numeric device type ID. A few IDs are already allowed, but the program will bail on you if the device isn't in the list. Well, the SGH-T989 comes up as a number "30", which wasn't on the list. Here's a patch to fix it (assuming Blogger doesn't mangle things):
diff --git a/heimdall/source/BridgeManager.cpp b/heimdall/source/BridgeManager.cpp
index 1faa626..7359a0d 100644
--- a/heimdall/source/BridgeManager.cpp
+++ b/heimdall/source/BridgeManager.cpp
@@ -1621,10 +1621,15 @@ bool BridgeManager::BeginSession(void)
int deviceType = setupSessionResponse.GetUnknown();
- // TODO: Work out what this value is... it has been either 180 or 0 for Galaxy S phones, 3 on the Galaxy Tab, 190 for SHW-M110S.
- if (deviceType != 180 && deviceType != 0 && deviceType != 3 && deviceType != 190)
+ /* TODO: Work out what this value is...
+ * it has been either 180 or 0 for Galaxy S phones,
+ * 3 on the Galaxy Tab,
+ * 30 on T-Mobile Galaxy S II (SGH-T989),
+ * 190 for SHW-M110S. */
+
+ if (deviceType != 180 && deviceType != 0 && deviceType != 3 && deviceType != 30 && deviceType != 190)
{
- Interface::PrintError("Unexpected device info response!\nExpected: 180, 0 or 3\nReceived:%d\n", deviceType);
+ Interface::PrintError("Unexpected device info response!\nExpected: 180, 0, 3, 30, or 190\nReceived:%d\n", deviceType);
return (false);
}
else
You really only need to add "&& deviceType != 30" into the right spot.
So, the basic basics:
- Download the forked version of Heimdall with "git clone git://github.com/marshray/Heimdall.git"
- Compile and install Heimdall:
- Enter the new "Heimdall" directory with "cd Heimdall"
- Read through the various README files, including the "Linux/README" one.
- Change into the "libpit" directory and run "./configure && make", then exit the directory upon success.
- Change into the "heimdall" directory and run "./configure && make". Upon a successful compile, run "sudo make install", then exit the directory.
- Change into the "heimdall-frontend" directory and run "qmake && make". Upon a successful compile, run "sudo make install", then exit the directory.
- Download a ClockWorkMod Touch Recovery image by visiting the ClockWorkMod ROM Manager site and finding the "Samsung T-Mobile Galaxy S2". Click on the download link in the second column ("6.0.1.2" as of this writing). For me, this saved as "recovery-clockwork-touch-6.0.1.2-hercules.img"
- Reboot your phone into Download Mode with the following procedure:
- Plug the USB cable into your phone if it isn't already connected.
- Press and hold down both volume keys, followed by holding down the power button. Keep holding down the power button until the phone reboots (a brief vibration happens)
- Release the power button but keep holding down the volume buttons (it's okay if you accidentally release the volume buttons momentarily)
- The phone will come up, and you can release the buttons.
- There will be a prompt saying you're about to enter Download Mode. Press the Volume Up button once to continue.
- At this point, you should be in "Odin Mode". (Note that there's a big warning not to reboot the phone when it's in this mode -- as far as I know, it's okay to reboot here unless you're actually transferring data. But, the phone will restart itself after a few minutes if it isn't told to do anything.)
- Now, go back to the command line on your Linux box, and run the command "heimdall detect" just to see if the phone is communicating with the computer.
- Note: Ideally, there would be a step here where we would dump the recovery image from the phone to make a backup, but apparently that isn't working. The phone is structured in a way that even a screwed up recovery image shouldn't cause insurmountable problems (it shouldn't affect the Download Mode, for instance), but if you're wary, don't proceed.
- Upload the recovery image by running "heimdall flash --recovery recovery-clockwork-touch-6.0.1.2-hercules.img". It should only take a few seconds, and the phone should reboot.
- To test the recovery image, you can either follow the same steps as outlined in step 4, but with the USB cable removed, or run the command "adb reboot recovery" from the Android SDK with the USB cable plugged in.