Skip to content

Conversation

An-GG
Copy link

@An-GG An-GG commented Jun 28, 2022

This adds support for using the built executable from the command line. If valid command line arguments are detected, the file is extracted and the program exits without launching graphical windows.

Additionally, some improvements / organized some stuff:

  • The extraction logic has been refactored to be reusable and moved to the Extraction class.
  • Adjusted build settings to fix code-signing, everyone should be able to build with a one-liner
  • rewrote readme with install and build instructions

@robrohan
Copy link
Owner

robrohan commented Sep 4, 2023

Thank you for the submission @An-GG! I'll have a look at this in the next few days.

On first pass, the printf bits in the logging with the ansii escape chars were initially a red flag for me - maybe remove those if they were just there for debugging.

Looking further, it looks like some interesting stuff will have a deeper look soon :)

@robrohan robrohan self-assigned this Sep 4, 2023
Copy link
Owner

@robrohan robrohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to do this @An-GG! If you just did this as a one off, and don't feel like / are too busy to follow up on this, just let me know.

Cheers


- (void)logError:(NSString*) message
{
printf("\x1b[1;91m%s\x1b[0m\n", message.UTF8String);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove these printfs. I believe these are here to show output when running from the command line version - they might be better to just be in the logMessage function and not do the colours as we're assuming the colour scheme of the terminal.

INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
MACOSX_DEPLOYMENT_TARGET = 10.13;
OTHER_CODE_SIGN_FLAGS = "--deep";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what that does - I did a quick google search and it's not super clear, can you let me know?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

honestly i dunno, all I remember is that the project would not build in Xcode, there was some recommendation given by Xcode to fix the issue and I hit apply, and then it built (and then these edits showed up in the git diff)

  • are you able to build with this change reverted?
  • are you able to build with xcodebuild from the command line? (its possible I made this change to fix command line only builds)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's a problem, I was just curious about it. Once it's merged and runs though the github action, if its an issue I'll have a deeper look.

}
}
return nil;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool, and looks like good fun :) but did you try getopt? https://pubs.opengroup.org/onlinepubs/000095399/functions/getopt.html has a few safety bits that might be nice.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah that's neat.

looks powerful but gonna be honest personally I didnt find the interface of getopt all that intuitive

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it isn't intuitive at all :) it just covers some edge cases, and saves you from having to reimplement a few things. It does fall short in some areas too, but it is a useful tool to have at your disposal 🛠️

@An-GG
Copy link
Author

An-GG commented Sep 5, 2023

Hi Rob, happy to help you merge this PR. Should be able to get back to you on these concerns tonight.

@An-GG
Copy link
Author

An-GG commented Sep 6, 2023

honestly i dunno, all I remember is that the project would not build in Xcode, there was some recommendation given by Xcode to fix the issue and I hit apply, and then it built (and then these edits showed up in the git diff)

  • are you able to build with this change reverted?
  • are you able to build with xcodebuild from the command line? (its possible I made this change to fix command line only builds)

xcodebuild -project WebArchiveExtractor.xcodeproj works fine but i'd double check if it reproduces in CI

@An-GG
Copy link
Author

An-GG commented Sep 6, 2023

probably not the right place for this but great article. i learned something new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants