Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
8000 @orta => Move to pre-install hook by ashfurrow · Pull Request #31 · orta/cocoapods-keys · GitHub
Nothing Special   »   [go: up one dir, main page]

Skip to content

Conversation

ashfurrow
Copy link
Collaborator

So obviously this is pretty bare right now, but it's kind of a proof-of-concept. Was excited to dig into this after a day of walking about Newcastle yesterday, but someone nerd-sniped me with TV Tropes. I'll be submitting little chunks of work as I get them.

I've looked through the CocoaPods codebase (Rainforest is awesome) and am pretty sure that I want to inject my new, faked podspec in the Installer class' install! method, which I've monkey patched here (including a call to the original). This makes sense as a place for pre-install hooks.

I'm still experiencing intermittent installation failures when I call through to the original method. This cafe's wifi is not great, so I'm unable to troubleshoot further (and momentarily getting on a ferry sans Internet). I think it's wise for me to figure out what that's all about before moving on with further monkeys' patches.

Shooting into the Sun is a dirty dirty habit but I just can't help myself.

@ashfurrow
Copy link
Collaborator Author

OK, so after talking with @alloy about this, I've got a plan of attack:

  • successfully inject any pod into the installation process
  • generate that pod programmatically, and make it refer to the .m/.h files (generated in next step)
  • use the pod's prepare_command to invoke a ruby script or (hidden?) CocoaPods-keys command that simply generates the .m and .h files in the current working directory (the root of the pod directory)

CocoaPods should then install the keys as a normal pod.

The other great idea (from @mrackwitz) was to force the use of static libraries instead of frameworks (to make the keys more obfuscated, in the main binary). I'm going to go with just what's above first, since we need to get Eidolon in a shipping state. Later, we can worry about improving on that process.

@orta Make sense to you?

@anyone Any gotchas I should be aware of?

@orta
Copy link
Owner
orta commented Feb 2, 2015

looks legit

@ashfurrow
Copy link
Collaborator Author

OK, so this obviously needs cleanup, but as a proof-of-concept, I think it's ready to be reviewed. Here's how it works:

  1. Inject a pod called "Keys" (located here) into the installation process.
  2. Override the pod_state in the analyzer to always re-install this pod (in case keys have been changed).
  3. In the from_string method used to parse the podspec from step one, replace %%SOURCE_FILES%% with the names of the source files (generated in step five).
  4. Replace the %%PROJECT_NAME%% with the actual project name (used in the prepare_command to generate the .h/.m files.
  5. The prepare_command is executed, creating the actual .h/.m files the podspec is already referring to.
  6. Installation proceeds as usual.

I have one concern over this strategy: the podspec and the pod name need to be the same, but I'm downloaded the podspec remotely so I can't rename it at runtime (at least, I haven't tried that hard yet). That means that the module containing the keys will always been called Keys. That seems acceptable to me (there is no existing pod called Keys, anyway). However, I'll yield to @orta if he has feels on this.

@ashfurrow ashfurrow changed the title [WIP] @orta => Move to pre-install hook @orta => Move to pre-install hook Feb 3, 2015
lib/plugin.rb Outdated
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do I even need this (now empty) module?

Copy link

Choose a reason for hiding this comment

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

Nope, can remove it

@ashfurrow
Copy link
Collaborator Author

Just verified that this runs OK on a device (once you remove Hockey's reference to _mh_execute_header, as we were doing before).

Copy link

Choose a reason for hiding this comment

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

This can be done a bit simpler:

File.write(interface_file, key_master.interface)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Cool – I had copied over some (more complex) code from another of this plugin's files and modified it. Makes sense there'd be an easier way.

@ashfurrow
Copy link
Collaborator Author

Addressed feedback and cleans up some concerns I noted earlier.

lib/plugin.rb Outdated
Copy link
Owner

Choose a reason for hiding this comment

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

Lets get that on this repo 👍

Copy link
Owner

Choose a reason for hiding this comment

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

what was the motivation for the command?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is used by the prepare_command in the podspec to generate the .h/.m files in the pod's directory.

Copy link
Owner

Choose a reason for hiding this comment

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

👍

@ashfurrow
Copy link
Collaborator Author

@orta this is ready for final review/merging. @alloy has some improvements to move code out of the monkey patching back into the plugin, but says he'll submit his own PR.

@orta
Copy link
Owner
orta commented Feb 3, 2015

This looks and feels great. And to triple clarify, this work fine with static lib only pods?

orta added a commit that referenced this pull request Feb 3, 2015
@orta orta merged commit 2cfffb7 into orta:master Feb 3, 2015
@ashfurrow
Copy link
Collaborator Author

Can you clarify what you mean? The generated pod doesn't specify to use frameworks or not, so it should work with non-frameworks pods. I'll verify.

@ashfurrow ashfurrow deleted the deplooooooooy branch February 3, 2015 18:15
@orta
Copy link
Owner
orta commented Feb 3, 2015

Coo

alloy added a commit to alloy/cocoapods-keys that referenced this pull request Feb 3, 2015
@ashfurrow
Copy link
Collaborator Author

Verified that this works on installations without frameworks: https://github.com/ashfurrow/static-keys-test (checked in Pods folder).

@orta to quadruple clarify, these changes have not implemented Marius' suggestion to force the pod to be a framework (and thus integrated into the app's binary, further obfuscating the key values). I thought this solution was a reasonable for now (mostly to ship Eidolon) and I could come back and improve it later.

alloy added a commit to alloy/cocoapods-keys that referenced this pull request Feb 4, 2015
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.

4 participants

0