Skip to content

Commit

Permalink
Implement update information parser for type 1 (closes #48)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAssassin committed Nov 17, 2017
1 parent 2720e18 commit d6834d6
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,19 @@ namespace appimage {
std::string updateInformation;

if (version == 1) {
// TODO implement type 1 update information parser
issueStatusMessage("Type 1 AppImage update information is currently not supported!");
// update information is always at the same position, and has a fixed length
static constexpr auto position = 0x8373;
static constexpr auto length = 512;

ifs.seekg(position);

auto* rawUpdateInformation = (char*) calloc(length, sizeof(char));
ifs.read(rawUpdateInformation, length);

updateInformation = rawUpdateInformation;

// cleanup
free(rawUpdateInformation);
} else if (version == 2) {
// check whether update information can be found inside the file by calling objdump
auto command = "objdump -h \"" + pathToAppImage + "\"";
Expand Down

0 comments on commit d6834d6

Please sign in to comment.