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

feat(eas-cli): Ensure non-exempt encryption status #2843

Merged
merged 9 commits into from
Jan 29, 2025

Conversation

EvanBacon
Copy link
Contributor

@EvanBacon EvanBacon commented Jan 28, 2025

Why

Apple requires the non-exempt encryption status be defined on every build before it can be submitted to TestFlight or app review. We can use the Info.plist flag to only ask users one time and reuse that answer for every build. This is a better version of expo/expo#34487

Prompting in the CLI saves users six clicks in App Store Connect for every iOS build.

How

I copied the bundle identifier prompting logic to a new function for setting non-exempt encryption, made it more optional, and added it to eas build -p ios.

If the user indicates that they use non-exempt encryption then we won't write anything this will enable them to see the in-depth warnings in ASC about this option. They can still skip the prompt by manually adding the value to their app.json.

Test Plan

  • Run eas build -p ios -> prompted "app uses standard encryption?" -> enter / Y -> app builds and doesn't ask again.
  • Unit tests for all conditions.

Copy link

github-actions bot commented Jan 28, 2025

Size Change: -1.65 kB (0%)

Total Size: 53.4 MB

Filename Size Change
./packages/eas-cli/dist/eas-linux-x64.tar.gz 53.4 MB -1.65 kB (0%)

compressed-size-action

Copy link

codecov bot commented Jan 28, 2025

Codecov Report

Attention: Patch coverage is 94.73684% with 2 lines in your changes missing coverage. Please review.

Project coverage is 52.85%. Comparing base (fe37600) to head (4b9d02b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/eas-cli/src/build/ios/build.ts 50.00% 1 Missing ⚠️
...ckages/eas-cli/src/project/ios/exemptEncryption.ts 97.23% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2843      +/-   ##
==========================================
+ Coverage   52.78%   52.85%   +0.07%     
==========================================
  Files         585      586       +1     
  Lines       22765    22803      +38     
  Branches     4746     4756      +10     
==========================================
+ Hits        12014    12050      +36     
- Misses       9812     9814       +2     
  Partials      939      939              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@EvanBacon EvanBacon marked this pull request as ready for review January 28, 2025 04:01
Copy link

Subscribed to pull request

File Patterns Mentions
**/* @szdziedzic, @khamilowicz, @sjchmiela, @radoslawkrzemien

Generated by CodeMention

Copy link
Member

@szdziedzic szdziedzic left a comment

Choose a reason for hiding this comment

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

awesome! thanks for working on it 🙏

few comments:

packages/eas-cli/src/project/ios/exemptEncryption.ts Outdated Show resolved Hide resolved
packages/eas-cli/src/project/ios/exemptEncryption.ts Outdated Show resolved Hide resolved
packages/eas-cli/src/project/ios/exemptEncryption.ts Outdated Show resolved Hide resolved
packages/eas-cli/src/project/ios/exemptEncryption.ts Outdated Show resolved Hide resolved
@brentvatne
Copy link
Member

i approve of the approach, will leave the actual code review up to @szdziedzic

@EvanBacon EvanBacon requested a review from szdziedzic January 29, 2025 19:50
Copy link

✅ Thank you for adding the changelog entry!

@EvanBacon EvanBacon merged commit 0b64d1c into main Jan 29, 2025
10 checks passed
@EvanBacon EvanBacon deleted the @evanbacon/eas-cli/ensure-non-exempt-encryption branch January 29, 2025 22:04
@RRaideRR
Copy link

RRaideRR commented Feb 5, 2025

Hey @EvanBacon ,

just to let you know: I'm having a dynamic app.config.ts.

When I try to run my build, I get the following error:

eas build --platform ios --profile production
Environment variables with visibility "Plain text" and "Sensitive" loaded from the "production" environment on EAS: APP_VARIANT, EXPO_PUBLIC_API_URL, GOOGLE_LOGIN_WEB_CLIENT_ID.

✔ iOS app only uses standard/exempt encryption? Learn more … yes
Cannot read properties of undefined (reading 'ITSAppUsesNonExemptEncryption')
    Error: build command failed.

The solution is of course to add to my app.config.ts manually:

      infoPlist: {
        ITSAppUsesNonExemptEncryption: false,
      },

However: I'm not really happy that the build process just errors and does not give clear instructions to the user what to do.

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