Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with bitcode_enabled NO flag #201

Closed
muddsar opened this issue Mar 25, 2020 · 9 comments · Fixed by #202
Closed

Not working with bitcode_enabled NO flag #201

muddsar opened this issue Mar 25, 2020 · 9 comments · Fixed by #202

Comments

@muddsar
Copy link

muddsar commented Mar 25, 2020

i am currently playing with Cocoapods-keys & observed that it doesn't work if bitcode_enabled is NO. values are embeded as plain text in Keys.Framework/Keys file. Can you please confirm if this is the expected behaviour?

@orta
Copy link
Owner

orta commented Mar 25, 2020

They should be accessible at runtime as plain keys, but I'd be surprised that they show up as raw values in the binaries though, the code in your app looks like this:

https://github.com/orta/cocoapods-keys/blob/master/templates/Keys.m.erb#L36-L48

And never writes the raw values anywhere

@muddsar
Copy link
Author

muddsar commented Mar 25, 2020

Here is the steps i am taking.

    • Go to XCode->Build Settings->Enable Bitcode, Set to NO
    • Archive the app & export for AppStore
    • Go to the exported folder, Unarchive the .ipa
    • Go to Payload folder
    • Select .app -> Right click->Show Package Contents->Frameworks->Keys.Frameworks->Keys
    • Open the Keys using any editor.
    • Search for the value of the Key. In my cases two values are "testClient", "testSecret"

image

In screenshot attached you can see you can see the values in plain text. Altough last part has been chopped in sample project, In real project few of the keys are exposed without chopping. Let me know if you needs further information.
Thanks

@orta
Copy link
Owner

orta commented Mar 25, 2020

Interesting, yeah, apple must have improved their compiler since I built this 6 years back, maybe it is inlining the string accessors in C now.

I'm open to an alternative templates which don't have this issue 👍 - that could be as simple as ussing the NSString API instead of a c array or other alternatives

@orta
Copy link
Owner

orta commented Mar 26, 2020

OK, that's updated and shipped as 2.2.0 - great find @muddsar

@muddsar
Copy link
Author

muddsar commented Mar 26, 2020

Great, Thanks again for the awesome fix guys :)

@ashfurrow
Copy link
Collaborator

@muddsar thank you for including such clear steps to reproduce! It made testing the fix really straightforward 👍

@muddsar
Copy link
Author

muddsar commented Mar 27, 2020

@ashfurrow you are welcome. Looks like your PR was merged in but release commit failed the pipeline :( i hope it will be resolved soon.
Keep up the good work :)

@ashfurrow
Copy link
Collaborator

@muddsar It looks like it's published here? I've been able to bundle update cocoapods-keys successfully, and re-running bundle exec pod install got me the fixed version: https://rubygems.org/gems/cocoapods-keys/versions/2.2.0

@muddsar
Copy link
Author

muddsar commented Mar 27, 2020

@ashfurrow Thanks for the correction, i was looking at the releases & tags in the repository. i tried the instructions you provided & it works like a charm.

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 a pull request may close this issue.

3 participants