Permalink
Browse files

Heimdall 1.4 RC1:

    - Massive refactoring.
    - Support for Qualcomm based devices.
    - Print PIT from file.
    - Use partition names as arguments e.g. --HIDDEN, --KERNEL, --MOVINAND etc.
    - Heimdall Frontend UI improvements.
    - And much more...
  • Loading branch information...
Benjamin-Dobell committed Oct 1, 2012
1 parent 66f1e84 commit 6cd6b35c737e0e4042a8fd79af1decc9f10ed84b
Showing with 21,766 additions and 13,637 deletions.
  1. +8 −0 .gitignore
  2. +49 −39 Linux/README
  3. +1 −1 README
  4. +0 −15 heimdall-frontend/Qt4VSPropertySheet.props
  5. +2 −0 heimdall-frontend/Source/FirmwareInfo.cpp
  6. +22 −3 heimdall-frontend/Source/Packaging.cpp
  7. +95 −0 heimdall-frontend/Source/aboutform.cpp
  8. +17 −0 heimdall-frontend/Source/aboutform.h
  9. +264 −120 heimdall-frontend/Source/mainwindow.cpp
  10. +19 −6 heimdall-frontend/Source/mainwindow.h
  11. +3 −3 heimdall-frontend/aboutform.ui
  12. +1 −1 heimdall-frontend/doc-pak/LICENSE
  13. +52 −45 heimdall-frontend/doc-pak/README
  14. +8 −8 heimdall-frontend/heimdall-frontend.pro
  15. +18 −2 heimdall-frontend/heimdall-frontend.vcxproj
  16. +9 −3 heimdall-frontend/heimdall-frontend.vcxproj.filters
  17. +114 −25 heimdall-frontend/mainwindow.ui
  18. +1 −1 heimdall/LICENSE
  19. +42 −34 heimdall/Makefile.am
  20. +74 −28 heimdall/Makefile.in
  21. +31 −50 heimdall/aclocal.m4
  22. +3,463 −2,207 heimdall/autom4te.cache/output.1
  23. +1 −1 heimdall/autom4te.cache/requests
  24. +24 −39 heimdall/autom4te.cache/traces.1
  25. +4 −5 heimdall/config.guess
  26. +0 −3 heimdall/config.h.in
  27. +0 −80 heimdall/config.h.in~
  28. +5 −14 heimdall/config.sub
  29. +3,466 −2,210 heimdall/configure
  30. +1 −1 heimdall/doc-pak/LICENSE
  31. +52 −45 heimdall/doc-pak/README
  32. +28 −2 heimdall/heimdall.vcxproj
  33. +129 −39 heimdall/heimdall.vcxproj.filters
  34. +13 −20 heimdall/ltmain.sh
  35. +14 −31 heimdall/m4/libtool.m4
  36. +212 −0 heimdall/source/Arguments.cpp
  37. +160 −0 heimdall/source/Arguments.h
  38. +39 −0 heimdall/source/BeginSessionPacket.h
  39. +505 −352 heimdall/source/BridgeManager.cpp
  40. +26 −11 heimdall/source/BridgeManager.h
  41. +94 −0 heimdall/source/ClosePcScreenAction.cpp
  42. +34 −0 heimdall/source/ClosePcScreenAction.h
  43. +4 −4 heimdall/source/ControlPacket.h
  44. +64 −0 heimdall/source/DetectAction.cpp
  45. +34 −0 heimdall/source/DetectAction.h
  46. +39 −0 heimdall/source/DeviceTypePacket.h
  47. +135 −0 heimdall/source/DownloadPitAction.cpp
  48. +34 −0 heimdall/source/DownloadPitAction.h
  49. +158 −0 heimdall/source/DumpAction.cpp
  50. +34 −0 heimdall/source/DumpAction.h
  51. +56 −0 heimdall/source/FilePartSizePacket.h
  52. +620 −0 heimdall/source/FlashAction.cpp
  53. +34 −0 heimdall/source/FlashAction.h
  54. +6 −14 heimdall/source/FlashPartFileTransferPacket.h
  55. +1 −0 heimdall/source/Heimdall.h
  56. +35 −0 heimdall/source/HelpAction.cpp
  57. +34 −0 heimdall/source/HelpAction.h
  58. +35 −0 heimdall/source/InfoAction.cpp
  59. +34 −0 heimdall/source/InfoAction.h
  60. +164 −320 heimdall/source/Interface.cpp
  61. +30 −251 heimdall/source/Interface.h
  62. +1 −1 heimdall/source/Packet.h
  63. +159 −0 heimdall/source/PrintPitAction.cpp
  64. +34 −0 heimdall/source/PrintPitAction.h
  65. +5 −5 heimdall/source/ResponsePacket.h
  66. +1 −6 heimdall/source/SendFilePartPacket.h
  67. +74 −0 heimdall/source/SessionSetupPacket.h
  68. +58 −0 heimdall/source/SessionSetupResponse.h
  69. +56 −0 heimdall/source/TotalBytesPacket.h
  70. +82 −0 heimdall/source/Utility.cpp
  71. +40 −0 heimdall/source/Utility.h
  72. +35 −0 heimdall/source/VersionAction.cpp
  73. +34 −0 heimdall/source/VersionAction.h
  74. +12 −766 heimdall/source/main.cpp
  75. +0 −1 libpit/Makefile.in
  76. +45 −40 libpit/Source/libpit.cpp
  77. +93 −56 libpit/Source/libpit.h
  78. +16 −33 libpit/aclocal.m4
  79. +3,425 −2,184 libpit/autom4te.cache/output.0
  80. +3,425 −2,184 libpit/autom4te.cache/output.1
  81. +1 −1 libpit/autom4te.cache/requests
  82. +27 −30 libpit/autom4te.cache/traces.0
  83. +25 −34 libpit/autom4te.cache/traces.1
  84. +4 −5 libpit/config.guess
  85. +0 −3 libpit/config.h.in
  86. +5 −14 libpit/config.sub
  87. +3,429 −2,188 libpit/configure
  88. +2 −2 libpit/configure.ac
  89. +13 −20 libpit/ltmain.sh
  90. +14 −31 libpit/m4/libtool.m4
View
@@ -1,2 +1,10 @@
.DS_Store
._*
+Debug/
+Release/
+GeneratedFiles/
+*.vcxproj.user
+*.suo
+*.sdf
+heimdall-frontend/Qt4VSPropertySheet.props
+*.opensdf
View
@@ -1,4 +1,4 @@
-Heimdall (c) 2010-2011 Benjamin Dobell, Glass Echidna
+Heimdall (c) 2010-2012 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/products/heimdall/
DISCLAIMER:
@@ -84,11 +84,12 @@ Performing a Custom Flash with Heimdall Frontend:
This is the advanced means of flashing firmware to your device.
If you're not an advanced user or a developer, in the event that a Heimdall
- Firmware Package doesn't exist for the particular firmware (or files) that
- you wish to flash, then I strongly recommend you get in touch with developer
- of the firmware (or files) and politely ask them to create a Heimdall
- Firmware Package for you. In doing so then you don't have to worry about
- making mistakes due to inexperience.
+ Firmware Package doesn't exist for the particular firmware (or files) that
+ you wish to flash, then I strongly recommend you get in touch with the
+ developer of the firmware (or files) and politely ask them to create a
+ Heimdall Firmware Package for you. In doing so, you avoid the risk of
+ making mistakes due to inexperience.
+
If you're looking to customise an existing Heimdall Firmware Package then
follow steps 1-8 of "Flashing Heimdall Firmware Package with Heimdall
@@ -104,7 +105,8 @@ Performing a Custom Flash with Heimdall Frontend:
as multiple archives (nested or otherwise), extract them all to the same
location.
- NOTE: If you want to use the CSC then extract it last.
+ NOTE: If you want to use the CSC then extract it last. If you're asked
+ to overwrite files then do so.
3. Open the a terminal and run Heimdall Frontend by typing:
@@ -116,14 +118,14 @@ Performing a Custom Flash with Heimdall Frontend:
5. Before you can chose which partitions you want to flash with particular
files you MUST first select a PIT file. To do this click the "Browse"
button in the "PIT" section. This will open a dialogue allowing you to
- navigate to and select a valid PIT (.pit) file.
+ navigate to and select a valid PIT (.pit) file.
- If you do not already have a valid PIT file stored on your computer you
- can download your device's PIT file from the "Utilities" tab.
-
- 6. If a valid PIT file has been selected then "Add" button below the
- "Partitions (Files)" list-box will become enabled. Press this button to
- add a partition to your flash.
+ If you do not already have a valid PIT file stored on your computer you
+ can download your device's PIT file from the "Utilities" tab.
+
+ 6. If a valid PIT file has been selected then the "Add" button below the
+ "Partitions (Files)" list-box will be enabled. Press this button to add
+ a partition to your flash.
7. When you first add a partition you will see the "Partition Name" and
"Partition ID" be populated with information. Use the "Partition Name"
@@ -229,8 +231,7 @@ How to Create a Heimdall Firmware Package:
create a package from scratch, or you can load an existing package, apply
modifications and then save the package. Creating a package from scratch
is the preferred approach, by taking this approach you're far less likely
- to run into file name length limitations. These are not Heimdall's own
- limitation but rather a limitation of the TAR archive format.
+ to run into file name length limitations.
Before you can access Heimdall Frontend's firmware creation functionality
(available from the "Create Package" tab) you must first specify which
@@ -254,14 +255,14 @@ How to Create a Heimdall Firmware Package:
Firmware Name - This is the name of your particular firmware. An
example would be "Cyanogenmod".
- Firmware Version - This is the version identifier for your package. Any
- valid string will be accepted although a the inclusion of decimal
- point version number is preferred i.e. "7.1". If it makes sense
- then feel free to append a text string like "RC1" or "Beta 1" to
- the decimal point version.
+ Firmware Version - This is the version identifier for your package. Any
+ valid string will be accepted, although the inclusion of decimal
+ point version number is preferred i.e. "7.1". If it makes sense
+ then feel free to append a text string like "RC1" or "Beta 1" to
+ the decimal point version.
- Platform Name - This is the name of the platform (or operating system)
- that your firmware is based on. In most cases this will simply be
+ Platform Name - This is the name of platform (or operating system) that
+ your firmware is based on. In most cases this will simply be
"Android".
Platform Version - This is the operating system version that your
@@ -295,8 +296,8 @@ How to Create a Heimdall Firmware Package:
team name. Click "Add" and the developer will be added to the list
on the right. If you make a mistake you can select a developer from
the list and click "Remove". You can list as many developers as you
- like however visual constraints of the "Load Package" tab means
- only a few names will be visible. Where possible you may want to
+ like, however visual constraints of the "Load Package" tab means
+ only a few names will be visible. Where possible you may want to
opt for team names over listing individual team members.
@@ -359,8 +360,9 @@ for the format in their own software.
All Heimdall Firmware Packages must contain a file called firmware.xml. This
-file stores flash information and meta-data for the package as well as
-information about other files contained within the package.
+file stores flash information and meta-data for the package as well as
+information about other files contained within the package.
+
The format is fairly straight-forward so it won't be explained in great detail.
Nonetheless the following is an example of a valid firmware.xml file.
@@ -458,20 +460,28 @@ be included.
-
Appendix B - Installing Heimdall from Source:
- 1. First make sure you have installed build-tools, pkgconfig, zlib-dev and
- libusb-1.0-dev (v1.0.8 or newer).
-
+ 1. First make sure you have installed build-tools, pkgconfig, zlib-dev and
+ libusb-1.0-dev (v1.0.8 or newer).
+
NOTE: Package names may not be absolutely identical to those above.
2. Open a terminal and navigate to the directory you downloaded,
or extracted, Heimdall to.
- 3. Enter the following commands to compile libpit.
+ 3. Enter the following commands to compile libpit:
cd libpit
+ ./configure
+ make
+ cd ..
+
+ If you have problems please consult http://www.libusb.org/
+
+ 4. Enter the following commands to compile libpit.
+
+ cd libusb-1.0
./configure
make
cd ..
@@ -486,11 +496,11 @@ Appendix B - Installing Heimdall from Source:
sudo make install
cd ..
- NOTE: As an alternative to "sudo make install" you may chose to generate
- a package by typing the following:
-
- sudo checkinstall --pkgversion <version>
-
+ NOTE: As an alternative to "sudo make install" you may chose to generate
+ a package by typing the following:
+
+ sudo checkinstall --pkgversion <version>
+
Where <version> is the current Heimdall release e.g. 1.3.0
5. Done
@@ -510,9 +520,9 @@ Appendix C - Installing Heimdall Frontend from Source:
4. Enter the following commands to compile and install Heimdall Frontend:
cd heimdall-frontend
- qmake heimdall-frontend.pro
+ qmake-qt4 heimdall-frontend.pro
make
- sudo make install
+ sudo make install
NOTE: As an alternative to "sudo make install" you may chose to generate
a package by typing the following:
View
2 README
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------------
-Heimdall (c) 2010-2011 Benjamin Dobell, Glass Echidna
+Heimdall (c) 2010-2012 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/products/heimdall/
DISCLAIMER:
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ImportGroup Label="PropertySheets" />
- <PropertyGroup Label="UserMacros">
- <QTDIR>D:\development\cpp\libraries\Qt\2010.05\qt</QTDIR>
- </PropertyGroup>
- <PropertyGroup />
- <ItemDefinitionGroup />
- <ItemGroup>
- <BuildMacro Include="QTDIR">
- <Value>$(QTDIR)</Value>
- <EnvironmentVariable>true</EnvironmentVariable>
- </BuildMacro>
- </ItemGroup>
-</Project>
@@ -772,7 +772,9 @@ void FirmwareInfo::WriteXml(QXmlStreamWriter& xml) const
xml.writeStartElement("files");
for (int i = 0; i < fileInfos.length(); i++)
+ {
fileInfos[i].WriteXml(xml, Packaging::ClashlessFilename(fileInfos, i));
+ }
xml.writeEndElement();
@@ -301,7 +301,7 @@ bool Packaging::WriteTarEntry(const QString& filePath, QTemporaryFile *tarFile,
// Note: We don't support base-256 encoding. Support could be added later.
sprintf(tarHeader.fields.size, "%011llo", file.size());
- sprintf(tarHeader.fields.modifiedTime, "%011llo", qtFileInfo.lastModified().toMSecsSinceEpoch() / 1000);
+ sprintf(tarHeader.fields.modifiedTime, "%011llo", qtFileInfo.lastModified().toTime_t());
// Regular File
tarHeader.fields.typeFlag = '0';
@@ -381,6 +381,24 @@ bool Packaging::CreateTar(const FirmwareInfo& firmwareInfo, QTemporaryFile *tarF
for (int i = 0; i < fileInfos.length(); i++)
{
+ // If the file was already compressed we don't compress it again.
+ bool skip = false;
+
+ for (int j = 0; j < i; j++)
+ {
+ if (fileInfos[i].GetFilename() == fileInfos[j].GetFilename())
+ {
+ skip = true;
+ break;
+ }
+ }
+
+ if (skip)
+ {
+ progressDialog.setValue(i);
+ continue;
+ }
+
QString filename = ClashlessFilename(fileInfos, i);
if (filename == "firmware.xml")
@@ -389,7 +407,7 @@ bool Packaging::CreateTar(const FirmwareInfo& firmwareInfo, QTemporaryFile *tarF
return (false);
}
- if (!WriteTarEntry(fileInfos[i].GetFilename(), tarFile, ClashlessFilename(fileInfos, i)))
+ if (!WriteTarEntry(fileInfos[i].GetFilename(), tarFile, filename))
{
tarFile->resize(0);
tarFile->close();
@@ -666,7 +684,8 @@ QString Packaging::ClashlessFilename(const QList<FileInfo>& fileInfos, int fileI
QString otherFilename = fileInfos[i].GetFilename().mid(lastSlash + 1);
- if (filename == otherFilename)
+ // If the filenames are the same, but the files themselves aren't the same (i.e. not the same path), then rename.
+ if (filename == otherFilename && fileInfos[i].GetFilename() != fileInfos[fileInfoIndex].GetFilename())
renameIndex++;
}
@@ -18,12 +18,107 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.*/
+// Qt
+#include <QDir>
+#include <QProcess>
+
// Heimdall Frontend
#include "aboutform.h"
+#define UNUSED(x) (void)(x)
+
using namespace HeimdallFrontend;
AboutForm::AboutForm(QWidget *parent) : QWidget(parent)
{
setupUi(this);
+
+ // Heimdall Command Line
+ QObject::connect(&heimdallProcess, SIGNAL(readyRead()), this, SLOT(HandleHeimdallStdout()));
+ QObject::connect(&heimdallProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(HandleHeimdallReturned(int, QProcess::ExitStatus)));
+ QObject::connect(&heimdallProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(HandleHeimdallError(QProcess::ProcessError)));
+
+ heimdallFailed = false;
+
+ RetrieveHeimdallVersion();
+}
+
+void AboutForm::RetrieveHeimdallVersion(void)
+{
+ heimdallProcess.setReadChannel(QProcess::StandardOutput);
+
+ heimdallProcess.start("heimdall", QStringList("version"));
+ heimdallProcess.waitForFinished(350);
+
+ // OS X was playing up and not finding heimdall, so we're manually checking the PATH.
+ if (heimdallFailed)
+ {
+ QStringList environment = QProcess::systemEnvironment();
+
+ QStringList paths;
+
+ // Ensure /usr/bin is in PATH
+ for (int i = 0; i < environment.length(); i++)
+ {
+ if (environment[i].left(5) == "PATH=")
+ {
+ paths = environment[i].mid(5).split(':');
+ paths.prepend("/usr/bin");
+ break;
+ }
+ }
+
+ int pathIndex = -1;
+
+ while (heimdallFailed && ++pathIndex < paths.length())
+ {
+ QString heimdallPath = paths[pathIndex];
+
+ if (heimdallPath.length() > 0)
+ {
+ heimdallFailed = false;
+
+ if (heimdallPath[heimdallPath.length() - 1] != QDir::separator())
+ heimdallPath += QDir::separator();
+
+ heimdallPath += "heimdall";
+
+ heimdallProcess.start(heimdallPath, QStringList("version"));
+ heimdallProcess.waitForFinished(350);
+ }
+ }
+
+ if (heimdallFailed)
+ versionCopyrightLabel->setText(versionCopyrightLabel->text().replace("%HEIMDALL-VERSION%", ""));
+ }
+}
+
+void AboutForm::HandleHeimdallStdout(void)
+{
+ QString version = heimdallProcess.readAll();
+
+ if (version.length() > 0)
+ {
+ if (version.at(0) == QChar('v'))
+ version = version.mid(1);
+
+ versionCopyrightLabel->setText(versionCopyrightLabel->text().replace("%HEIMDALL-VERSION%", "Version " + version + "<br />"));
+ }
+}
+
+void AboutForm::HandleHeimdallReturned(int exitCode, QProcess::ExitStatus exitStatus)
+{
+ UNUSED(exitCode);
+ UNUSED(exitStatus);
+
+ // If for some reason %HEIMDALL-VERSION% hasn't been replaced yet, we'll replace it with an empty string.
+ versionCopyrightLabel->setText(versionCopyrightLabel->text().replace("%HEIMDALL-VERSION%", ""));
}
+
+void AboutForm::HandleHeimdallError(QProcess::ProcessError error)
+{
+ UNUSED(error);
+
+ heimdallFailed = true;
+}
+
Oops, something went wrong.

0 comments on commit 6cd6b35

Please sign in to comment.