aboutsummaryrefslogtreecommitdiffstats
path: root/heimdall/source/main.cpp
diff options
context:
space:
mode:
authorBenjamin Dobell <benjamin.dobell@glassechidna.com.au>2011-09-11 22:47:31 +1000
committerBenjamin Dobell <benjamin.dobell@glassechidna.com.au>2011-09-11 23:02:55 +1000
commit0de82e08b6546200b266adfb34af458a85ffaf05 (patch)
tree166bc79a390469c963bbe3ae2a1e5039e963b7ec /heimdall/source/main.cpp
parented9b08e5d9e3db60d52bccf6cb6919fb4bd47602 (diff)
downloadexternal_heimdall-0de82e08b6546200b266adfb34af458a85ffaf05.zip
external_heimdall-0de82e08b6546200b266adfb34af458a85ffaf05.tar.gz
external_heimdall-0de82e08b6546200b266adfb34af458a85ffaf05.tar.bz2
Heimdall 1.3.1
- Improved the no-reboot functionality, you no longer have to reboot to flash more files. - Fixed repartitioning functionality (thanks XDA user psych0phobia for finding the problem!)
Diffstat (limited to 'heimdall/source/main.cpp')
-rw-r--r--heimdall/source/main.cpp49
1 files changed, 9 insertions, 40 deletions
diff --git a/heimdall/source/main.cpp b/heimdall/source/main.cpp
index a3ae962..2d05e33 100644
--- a/heimdall/source/main.cpp
+++ b/heimdall/source/main.cpp
@@ -29,8 +29,8 @@
// Heimdall
#include "BridgeManager.h"
-#include "DeviceInfoPacket.h"
-#include "DeviceInfoResponse.h"
+#include "SetupSessionPacket.h"
+#include "SetupSessionResponse.h"
#include "EndModemFileTransferPacket.h"
#include "EndPhoneFileTransferPacket.h"
#include "Interface.h"
@@ -244,37 +244,6 @@ void closeFiles(map<string, FILE *> argumentfileMap)
argumentfileMap.clear();
}
-bool retrieveDeviceInfo(BridgeManager *bridgeManager)
-{
- // ---------- GET DEVICE INFORMATION ----------
-
- int deviceInfoResult;
-
- if (!bridgeManager->RequestDeviceInfo(DeviceInfoPacket::kUnknown1, &deviceInfoResult))
- return (false);
-
- // 131072 for Galaxy S II, 0 for other devices.
- if (deviceInfoResult != 0 && deviceInfoResult != 131072)
- {
- Interface::PrintError("Unexpected device info response!\nExpected: 0\nReceived:%d\n", deviceInfoResult);
- return (false);
- }
-
- // -------------------- KIES DOESN'T DO THIS --------------------
-
- if (!bridgeManager->RequestDeviceInfo(DeviceInfoPacket::kUnknown2, &deviceInfoResult))
- return (false);
-
- // 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 (deviceInfoResult != 180 && deviceInfoResult != 0 && deviceInfoResult != 3 && deviceInfoResult != 190)
- {
- Interface::PrintError("Unexpected device info response!\nExpected: 180, 0 or 3\nReceived:%d\n", deviceInfoResult);
- return (false);
- }
-
- return (true);
-}
-
int downloadPitFile(BridgeManager *bridgeManager, unsigned char **pitBuffer)
{
Interface::Print("Downloading device's PIT file...\n");
@@ -390,7 +359,7 @@ bool attemptFlash(BridgeManager *bridgeManager, map<string, FILE *> argumentFile
}
}
- DeviceInfoPacket *deviceInfoPacket = new DeviceInfoPacket(DeviceInfoPacket::kTotalBytes, totalBytes);
+ SetupSessionPacket *deviceInfoPacket = new SetupSessionPacket(SetupSessionPacket::kTotalBytes, totalBytes);
success = bridgeManager->SendPacket(deviceInfoPacket);
delete deviceInfoPacket;
@@ -400,7 +369,7 @@ bool attemptFlash(BridgeManager *bridgeManager, map<string, FILE *> argumentFile
return (false);
}
- DeviceInfoResponse *deviceInfoResponse = new DeviceInfoResponse();
+ SetupSessionResponse *deviceInfoResponse = new SetupSessionResponse();
success = bridgeManager->ReceivePacket(deviceInfoResponse);
int deviceInfoResult = deviceInfoResponse->GetUnknown();
delete deviceInfoResponse;
@@ -670,7 +639,7 @@ int main(int argc, char **argv)
return (0);
}
- if (!bridgeManager->BeginSession() || !retrieveDeviceInfo(bridgeManager))
+ if (!bridgeManager->BeginSession())
{
closeFiles(argumentFileMap);
delete bridgeManager;
@@ -690,7 +659,7 @@ int main(int argc, char **argv)
case Interface::kActionClosePcScreen:
{
- if (!bridgeManager->BeginSession() || !retrieveDeviceInfo(bridgeManager))
+ if (!bridgeManager->BeginSession())
{
delete bridgeManager;
return (-1);
@@ -717,7 +686,7 @@ int main(int argc, char **argv)
return (0);
}
- if (!bridgeManager->BeginSession() || !retrieveDeviceInfo(bridgeManager))
+ if (!bridgeManager->BeginSession())
{
delete bridgeManager;
fclose(outputPitFile);
@@ -768,7 +737,7 @@ int main(int argc, char **argv)
int chipId = atoi(argumentMap.find(Interface::actions[Interface::kActionDump].valueArguments[Interface::kDumpValueArgChipId])->second.c_str());
- if (!bridgeManager->BeginSession() || !retrieveDeviceInfo(bridgeManager))
+ if (!bridgeManager->BeginSession())
{
fclose(dumpFile);
@@ -787,7 +756,7 @@ int main(int argc, char **argv)
case Interface::kActionPrintPit:
{
- if (!bridgeManager->BeginSession() || !retrieveDeviceInfo(bridgeManager))
+ if (!bridgeManager->BeginSession())
{
delete bridgeManager;
return (-1);