expo-updates 0.11.6 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/CHANGELOG.md +68 -4
  2. package/README.md +23 -6
  3. package/android/build.gradle +43 -47
  4. package/android/src/main/certificates/expo-root.pem +22 -0
  5. package/android/src/main/java/expo/modules/updates/UpdatesConfiguration.kt +122 -154
  6. package/android/src/main/java/expo/modules/updates/UpdatesController.kt +3 -5
  7. package/android/src/main/java/expo/modules/updates/UpdatesDevLauncherController.kt +23 -12
  8. package/android/src/main/java/expo/modules/updates/UpdatesInterface.kt +1 -0
  9. package/android/src/main/java/expo/modules/updates/UpdatesModule.kt +10 -5
  10. package/android/src/main/java/expo/modules/updates/UpdatesPackage.kt +3 -0
  11. package/android/src/main/java/expo/modules/updates/UpdatesService.kt +4 -0
  12. package/android/src/main/java/expo/modules/updates/UpdatesUtils.kt +9 -2
  13. package/android/src/main/java/expo/modules/updates/codesigning/CertificateChain.kt +139 -0
  14. package/android/src/main/java/expo/modules/updates/codesigning/CodeSigningAlgorithm.kt +20 -0
  15. package/android/src/main/java/expo/modules/updates/codesigning/CodeSigningConfiguration.kt +133 -0
  16. package/android/src/main/java/expo/modules/updates/codesigning/SignatureHeaderInfo.kt +32 -0
  17. package/android/src/main/java/expo/modules/updates/db/UpdatesDatabase.kt +20 -1
  18. package/android/src/main/java/expo/modules/updates/db/entity/AssetEntity.kt +9 -0
  19. package/android/src/main/java/expo/modules/updates/launcher/DatabaseLauncher.kt +1 -0
  20. package/android/src/main/java/expo/modules/updates/loader/EmbeddedLoader.kt +1 -0
  21. package/android/src/main/java/expo/modules/updates/loader/FileDownloader.kt +136 -36
  22. package/android/src/main/java/expo/modules/updates/loader/LegacySignatureUtils.kt +103 -0
  23. package/android/src/main/java/expo/modules/updates/loader/Loader.kt +2 -1
  24. package/android/src/main/java/expo/modules/updates/loader/LoaderTask.kt +1 -1
  25. package/android/src/main/java/expo/modules/updates/loader/RemoteLoader.kt +10 -6
  26. package/android/src/main/java/expo/modules/updates/manifest/LegacyUpdateManifest.kt +1 -1
  27. package/android/src/main/java/expo/modules/updates/manifest/ManifestHeaderData.kt +8 -1
  28. package/android/src/main/java/expo/modules/updates/manifest/NewUpdateManifest.kt +2 -0
  29. package/android/src/main/java/expo/modules/updates/selectionpolicy/SelectionPolicies.kt +7 -3
  30. package/bin/cli.js +3 -0
  31. package/build/ExpoUpdates.d.ts +1 -0
  32. package/build/ExpoUpdates.d.ts.map +1 -0
  33. package/build/ExpoUpdates.web.d.ts +1 -0
  34. package/build/ExpoUpdates.web.d.ts.map +1 -0
  35. package/build/Updates.d.ts +13 -0
  36. package/build/Updates.d.ts.map +1 -0
  37. package/build/Updates.js +14 -0
  38. package/build/Updates.js.map +1 -1
  39. package/build/Updates.types.d.ts +1 -0
  40. package/build/Updates.types.d.ts.map +1 -0
  41. package/build/index.d.ts +1 -0
  42. package/build/index.d.ts.map +1 -0
  43. package/build-cli/cli.d.ts +2 -0
  44. package/build-cli/cli.js +46 -0
  45. package/build-cli/configureCodeSigning.d.ts +3 -0
  46. package/build-cli/configureCodeSigning.js +40 -0
  47. package/build-cli/configureCodeSigningAsync.d.ts +6 -0
  48. package/build-cli/configureCodeSigningAsync.js +42 -0
  49. package/build-cli/generateCodeSigning.d.ts +3 -0
  50. package/build-cli/generateCodeSigning.js +48 -0
  51. package/build-cli/generateCodeSigningAsync.d.ts +8 -0
  52. package/build-cli/generateCodeSigningAsync.js +43 -0
  53. package/build-cli/utils/args.d.ts +16 -0
  54. package/build-cli/utils/args.js +52 -0
  55. package/build-cli/utils/log.d.ts +7 -0
  56. package/build-cli/utils/log.js +34 -0
  57. package/build-cli/utils/modifyConfigAsync.d.ts +3 -0
  58. package/build-cli/utils/modifyConfigAsync.js +41 -0
  59. package/cli/cli.ts +57 -0
  60. package/cli/configureCodeSigning.ts +48 -0
  61. package/cli/configureCodeSigningAsync.ts +57 -0
  62. package/cli/generateCodeSigning.ts +59 -0
  63. package/cli/generateCodeSigningAsync.ts +65 -0
  64. package/cli/utils/args.ts +50 -0
  65. package/cli/utils/log.ts +30 -0
  66. package/cli/utils/modifyConfigAsync.ts +48 -0
  67. package/e2e/jest.config.js +1 -0
  68. package/expo-module.config.json +1 -0
  69. package/ios/EXUpdates/AppLauncher/EXUpdatesAppLauncherWithDatabase.m +11 -1
  70. package/ios/EXUpdates/AppLoader/EXUpdatesAppLoader+Private.h +1 -0
  71. package/ios/EXUpdates/AppLoader/EXUpdatesAppLoader.h +1 -0
  72. package/ios/EXUpdates/AppLoader/EXUpdatesAppLoader.m +4 -2
  73. package/ios/EXUpdates/AppLoader/EXUpdatesAppLoaderTask.m +4 -2
  74. package/ios/EXUpdates/AppLoader/EXUpdatesAsset.h +2 -1
  75. package/ios/EXUpdates/AppLoader/EXUpdatesFileDownloader.h +10 -0
  76. package/ios/EXUpdates/AppLoader/EXUpdatesFileDownloader.m +154 -25
  77. package/ios/EXUpdates/AppLoader/EXUpdatesManifestHeaders.h +9 -1
  78. package/ios/EXUpdates/AppLoader/EXUpdatesManifestHeaders.m +3 -1
  79. package/ios/EXUpdates/AppLoader/EXUpdatesRemoteAppLoader.m +18 -7
  80. package/ios/EXUpdates/CodeSigning/EXUpdatesCertificateChain.swift +254 -0
  81. package/ios/EXUpdates/CodeSigning/EXUpdatesCodeSigningAlgorithm.swift +21 -0
  82. package/ios/EXUpdates/CodeSigning/EXUpdatesCodeSigningConfiguration.swift +192 -0
  83. package/ios/EXUpdates/CodeSigning/EXUpdatesCodeSigningError.swift +73 -0
  84. package/ios/EXUpdates/CodeSigning/EXUpdatesSignatureHeaderInfo.swift +42 -0
  85. package/ios/EXUpdates/Database/EXUpdatesDatabase.m +8 -4
  86. package/ios/EXUpdates/Database/EXUpdatesDatabaseInitialization.m +2 -1
  87. package/ios/EXUpdates/Database/Migrations/EXUpdatesDatabaseMigration8To9.h +11 -0
  88. package/ios/EXUpdates/Database/Migrations/EXUpdatesDatabaseMigration8To9.m +25 -0
  89. package/ios/EXUpdates/Database/Migrations/EXUpdatesDatabaseMigrationRegistry.m +3 -1
  90. package/ios/EXUpdates/EXUpdatesAppController.m +6 -1
  91. package/ios/EXUpdates/EXUpdatesConfig.h +24 -0
  92. package/ios/EXUpdates/EXUpdatesConfig.m +98 -24
  93. package/ios/EXUpdates/EXUpdatesDevLauncherController.h +1 -1
  94. package/ios/EXUpdates/EXUpdatesDevLauncherController.m +17 -3
  95. package/ios/EXUpdates/EXUpdatesModule.m +9 -7
  96. package/ios/EXUpdates/EXUpdatesService.h +1 -0
  97. package/ios/EXUpdates/EXUpdatesService.m +6 -0
  98. package/ios/EXUpdates/EXUpdatesUtils.h +2 -1
  99. package/ios/EXUpdates/EXUpdatesUtils.m +14 -1
  100. package/ios/EXUpdates/ReactDelegateHandler/ExpoUpdatesAppDelegateSubscriber.swift +13 -0
  101. package/ios/EXUpdates/ReactDelegateHandler/ExpoUpdatesReactDelegateHandler.swift +8 -8
  102. package/ios/EXUpdates/Update/EXUpdatesLegacyUpdate.m +1 -1
  103. package/ios/EXUpdates/Update/EXUpdatesNewUpdate.m +4 -0
  104. package/ios/EXUpdates.podspec +10 -0
  105. package/ios/Tests/EXUpdatesBuildDataTests.m +14 -13
  106. package/ios/Tests/EXUpdatesCertificateChainTests.swift +120 -0
  107. package/ios/Tests/EXUpdatesCodeSigningAlgorithmTests.swift +15 -0
  108. package/ios/Tests/EXUpdatesCodeSigningConfigurationTests.swift +155 -0
  109. package/ios/Tests/EXUpdatesDatabaseInitializationTests.m +90 -0
  110. package/ios/Tests/EXUpdatesDatabaseIntegrityCheckTests.m +4 -4
  111. package/ios/Tests/EXUpdatesDatabaseTests.m +17 -10
  112. package/ios/Tests/EXUpdatesFileDownloaderManifestParsingTest.m +266 -27
  113. package/ios/Tests/EXUpdatesFileDownloaderTests.m +59 -14
  114. package/ios/Tests/EXUpdatesLegacyUpdateTests.m +11 -12
  115. package/ios/Tests/EXUpdatesNewUpdateTests.m +11 -7
  116. package/ios/Tests/EXUpdatesSelectionPolicyFilterAwareTests.m +4 -3
  117. package/ios/Tests/EXUpdatesSignatureHeaderInfoTests.swift +35 -0
  118. package/ios/Tests/EXUpdatesUpdateTests.m +7 -4
  119. package/ios/Tests/Support/certificates/chainExpoProjectInformationViolationIntermediate.pem +24 -0
  120. package/ios/Tests/Support/certificates/chainExpoProjectInformationViolationLeaf.pem +23 -0
  121. package/ios/Tests/Support/certificates/chainExpoProjectInformationViolationRoot.pem +22 -0
  122. package/ios/Tests/Support/certificates/chainIntermediate.pem +22 -0
  123. package/ios/Tests/Support/certificates/chainLeaf.pem +23 -0
  124. package/ios/Tests/Support/certificates/chainNotCAIntermediate.pem +22 -0
  125. package/ios/Tests/Support/certificates/chainNotCALeaf.pem +23 -0
  126. package/ios/Tests/Support/certificates/chainNotCARoot.pem +22 -0
  127. package/ios/Tests/Support/certificates/chainPathLenViolationIntermediate.pem +22 -0
  128. package/ios/Tests/Support/certificates/chainPathLenViolationLeaf.pem +23 -0
  129. package/ios/Tests/Support/certificates/chainPathLenViolationRoot.pem +22 -0
  130. package/ios/Tests/Support/certificates/chainRoot.pem +22 -0
  131. package/ios/Tests/Support/certificates/invalidSignatureChainLeaf.pem +23 -0
  132. package/ios/Tests/Support/certificates/noCodeSigningExtendedUsage.pem +17 -0
  133. package/ios/Tests/Support/certificates/noKeyUsage.pem +17 -0
  134. package/ios/Tests/Support/certificates/privatekeys/chainExpoProjectInformationViolationIntermediate-privateKey.pem +27 -0
  135. package/ios/Tests/Support/certificates/privatekeys/chainExpoProjectInformationViolationLeaf-privateKey.pem +27 -0
  136. package/ios/Tests/Support/certificates/privatekeys/chainExpoProjectInformationViolationRoot-privateKey.pem +27 -0
  137. package/ios/Tests/Support/certificates/privatekeys/chainIntermediate-privateKey.pem +27 -0
  138. package/ios/Tests/Support/certificates/privatekeys/chainLeaf-privateKey.pem +27 -0
  139. package/ios/Tests/Support/certificates/privatekeys/chainNotCAIntermediate-privateKey.pem +27 -0
  140. package/ios/Tests/Support/certificates/privatekeys/chainNotCALeaf-privateKey.pem +27 -0
  141. package/ios/Tests/Support/certificates/privatekeys/chainNotCARoot-privateKey.pem +27 -0
  142. package/ios/Tests/Support/certificates/privatekeys/chainPathLenViolationIntermediate-privateKey.pem +27 -0
  143. package/ios/Tests/Support/certificates/privatekeys/chainPathLenViolationLeaf-privateKey.pem +27 -0
  144. package/ios/Tests/Support/certificates/privatekeys/chainPathLenViolationRoot-privateKey.pem +27 -0
  145. package/ios/Tests/Support/certificates/privatekeys/chainRoot-privateKey.pem +27 -0
  146. package/ios/Tests/Support/certificates/privatekeys/noCodeSigningExtendedUsage-privateKey.pem +27 -0
  147. package/ios/Tests/Support/certificates/privatekeys/noKeyUsage-privateKey.pem +27 -0
  148. package/ios/Tests/Support/certificates/privatekeys/test-privateKey.pem +27 -0
  149. package/ios/Tests/Support/certificates/privatekeys/validityExpired-privateKey.pem +27 -0
  150. package/ios/Tests/Support/certificates/signatureInvalid.pem +18 -0
  151. package/ios/Tests/Support/certificates/test.pem +18 -0
  152. package/ios/Tests/Support/certificates/validityExpired.pem +17 -0
  153. package/ios/Tests/TestHelper.swift +67 -0
  154. package/jest.cli.config.js +14 -0
  155. package/package.json +22 -10
  156. package/scripts/createManifest.js +1 -1
  157. package/scripts/source-login-scripts.sh +1 -1
  158. package/src/Updates.ts +15 -0
  159. package/ts-declarations/xcode/index.d.ts +480 -0
  160. package/tsconfig.cli.json +19 -0
  161. package/android/src/main/java/expo/modules/updates/loader/Crypto.kt +0 -107
  162. package/ios/Tests/dummy.swift +0 -3
package/CHANGELOG.md CHANGED
@@ -10,7 +10,70 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
- ## 0.11.6 — 2022-02-01
13
+ ## 0.13.0 — 2022-04-21
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Fix asset hash validation. ([#17152](https://github.com/expo/expo/pull/17152) by [@wschurman](https://github.com/wschurman))
18
+
19
+ ### 💡 Others
20
+
21
+ - Add current and embedded update headers to manifest requests. ([#17033](https://github.com/expo/expo/pull/17033) by [@esamelson](https://github.com/esamelson))
22
+ - Fix return value in AppDelegateSubscriber (used with expo-dev-client). ([#17111](https://github.com/expo/expo/pull/17111) by [@esamelson](https://github.com/esamelson))
23
+
24
+ ## 0.12.0 — 2022-04-18
25
+
26
+ ### 🛠 Breaking changes
27
+
28
+ - Remove okhttp and okio backward compatible workaround and drop react-native 0.64 support. ([#16446](https://github.com/expo/expo/pull/16446) by [@kudo](https://github.com/kudo))
29
+
30
+ ### 🎉 New features
31
+
32
+ - Add iOS support for code signing. ([#15682](https://github.com/expo/expo/pull/15682) by [@wschurman](https://github.com/wschurman))
33
+ - Add CLI. ([#16216](https://github.com/expo/expo/pull/16216) by [@wschurman](https://github.com/wschurman))
34
+ - Add support for dev client auto-setup with updates integration on iOS. ([#16230](https://github.com/expo/expo/pull/16230) by [@esamelson](https://github.com/esamelson))
35
+ - Fix codesigning header name. ([#16480](https://github.com/expo/expo/pull/16480) by [@wschurman](https://github.com/wschurman))
36
+ - Support certificate chains (Android). ([#16375](https://github.com/expo/expo/pull/16375) by [@wschurman](https://github.com/wschurman))
37
+ - Support certificate chains (iOS). ([#16634](https://github.com/expo/expo/pull/16634) by [@wschurman](https://github.com/wschurman))
38
+ - Add support for expo project information certificate extension (Android). ([#16607](https://github.com/expo/expo/pull/16607) by [@wschurman](https://github.com/wschurman))
39
+ - Add support for expo project information certificate extension (iOS). ([#16726](https://github.com/expo/expo/pull/16726) by [@wschurman](https://github.com/wschurman))
40
+ - Pass EAS-Client-ID in header for asset and manifest requests. ([#16729](https://github.com/expo/expo/pull/16729) by [@wschurman](https://github.com/wschurman))
41
+ - Validate expo project information up the certificate chain. ([#16800](https://github.com/expo/expo/pull/16800) by [@wschurman](https://github.com/wschurman))
42
+ - Update CLI to separate private keys from code signing certificate. ([#16979](https://github.com/expo/expo/pull/16979) by [@wschurman](https://github.com/wschurman))
43
+
44
+ ### 🐛 Bug fixes
45
+
46
+ - Update `fbemitter` to v3. ([#16245](https://github.com/expo/expo/pull/16245) by [@SimenB](https://github.com/SimenB))
47
+ - Allow non-codesigned manifests for Expo Go (Android). ([#16649](https://github.com/expo/expo/pull/16649) by [@wschurman](https://github.com/wschurman))
48
+ - Allow non-codesigned manifests for Expo Go (iOS). ([#16682](https://github.com/expo/expo/pull/16682) by [@wschurman](https://github.com/wschurman))
49
+ - Fix issue where default values for primitive-typed configuration values were not correctly set. ([#16644](https://github.com/expo/expo/pull/16644) by [@esamelson](https://github.com/esamelson))
50
+ - Fixed iOS script phase build error when `extendedglob` is enabled in zsh config. ([#17024](https://github.com/expo/expo/pull/17024) by [@kudo](https://github.com/kudo))
51
+
52
+ ### 💡 Others
53
+
54
+ - Updated `@expo/config-plugins` from `4.0.2` to `4.0.14`, `@expo/config` from `^6.0.6` to `^6.0.14` and `@expo/metro-config` from `~0.2.6` to `~0.3.7` ([#15621](https://github.com/expo/expo/pull/15621) by [@EvanBacon](https://github.com/EvanBacon))
55
+ - Swap out Cloudfront CDN for `classic-assets.eascdn.net`. ([#15781](https://github.com/expo/expo/pull/15781)) by [@quinlanj](https://github.com/quinlanj)
56
+ - Add ability for expo-dev-launcher to launch a specific update through UpdatesDevLauncherController. ([#16865](https://github.com/expo/expo/pull/16865) by [@esamelson](https://github.com/esamelson))
57
+
58
+ ### ⚠️ Notices
59
+
60
+ - On Android bump `compileSdkVersion` to `31`, `targetSdkVersion` to `31` and `Java` version to `11`. ([#16941](https://github.com/expo/expo/pull/16941) by [@bbarthec](https://github.com/bbarthec))
61
+
62
+ ### 📚 3rd party library updates
63
+
64
+ - Upgrade Android `Room` library version to 2.4.2. ([#16970](https://github.com/expo/expo/pull/16970) by [@kudo](https://github.com/kudo))
65
+
66
+ ## 0.11.7 — 2022-03-07
67
+
68
+ ### 🐛 Bug fixes
69
+
70
+ - Fix iOS issue where splash screen wouldn't show when using expo-updates and expo-splash-screen ([#16163](https://github.com/expo/expo/pull/16163)) by [@hannojg](https://github.com/hannojg)
71
+
72
+ ### 💡 Others
73
+
74
+ - Added `Updates.createdAt` constant export. ([#16344](https://github.com/expo/expo/pull/16344)) by [@hannojg](https://github.com/hannojg)
75
+
76
+ ## 0.11.6 - 2022-02-01
14
77
 
15
78
  ### 🐛 Bug fixes
16
79
 
@@ -77,6 +140,7 @@
77
140
  - Enhance node binary resolution for Xcode build phases scripts by the vendoring source-login-scripts.sh. ([#15336](https://github.com/expo/expo/pull/15336) by [@kudo](https://github.com/kudo))
78
141
  - Add android support for multipart manifest responses. ([#15401](https://github.com/expo/expo/pull/15401) by [@wschurman](https://github.com/wschurman))
79
142
  - Add iOS support for multipart manifest responses. ([#15426](https://github.com/expo/expo/pull/15426) by [@wschurman](https://github.com/wschurman))
143
+ - Add android support for code signing. ([#15514](https://github.com/expo/expo/pull/15514) by [@wschurman](https://github.com/wschurman))
80
144
 
81
145
  ### 🐛 Bug fixes
82
146
 
@@ -178,7 +242,7 @@ _This version does not introduce any user-facing changes._
178
242
 
179
243
  ### 🎉 New features
180
244
 
181
- - Updated `config-plugins` from `3.1.0` to `4.0.2` ([#14788](https://github.com/expo/expo/pull/14788) by [@jkhales](https://github.com/jkhales))
245
+ - Updated `@expo/config-plugins` from `3.1.0` to `4.0.2` ([#14788](https://github.com/expo/expo/pull/14788) by [@jkhales](https://github.com/jkhales))
182
246
  - Version expo-updates plugin by importing from @expo/config-plugins@3.0.7. This allows the update url to be defined in app.confg ([#13981](https://github.com/expo/expo/pull/13981) by [@jkhales](https://github.com/jkhales))
183
247
  - Store assets with filename = key.fileExtension. ([#13801](https://github.com/expo/expo/pull/13801) by [@jkhales](https://github.com/jkhales))
184
248
  - Use stable manifest ID where applicable. ([#12964](https://github.com/expo/expo/pull/12964) by [@wschurman](https://github.com/wschurman))
@@ -440,7 +504,7 @@ _This version does not introduce any user-facing changes._
440
504
 
441
505
  ### 🐛 Bug fixes
442
506
 
443
- - Fixed an issue where the publish workflow was broken on Android. Note that the publish workflow will not be supported in a future version of expo-updates, so we recommend [switching to the no-publish workflow](https://blog.expo.io/over-the-air-updates-from-expo-are-now-even-easier-to-use-376e2213fabf).
507
+ - Fixed an issue where the publish workflow was broken on Android. Note that the publish workflow will not be supported in a future version of expo-updates, so we recommend [switching to the no-publish workflow](https://blog.expo.dev/over-the-air-updates-from-expo-are-now-even-easier-to-use-376e2213fabf).
444
508
 
445
509
  ## 0.2.10 — 2020-06-23
446
510
 
@@ -510,7 +574,7 @@ _This version does not introduce any user-facing changes._
510
574
 
511
575
  ### 🎉 New features
512
576
 
513
- - Added support for the **no-publish workflow**. In this workflow, release builds of both iOS and Android apps will create and embed a new update at build-time from the JS code currently on disk, rather than embedding a copy of the most recently published update. For more information, along with upgrade instructions if you're upgrading from 0.1.x and would like to use the no-publish workflow, read [this blog post](https://blog.expo.io/over-the-air-updates-from-expo-are-now-even-easier-to-use-376e2213fabf).
577
+ - Added support for the **no-publish workflow**. In this workflow, release builds of both iOS and Android apps will create and embed a new update at build-time from the JS code currently on disk, rather than embedding a copy of the most recently published update. For more information, along with upgrade instructions if you're upgrading from 0.1.x and would like to use the no-publish workflow, read [this blog post](https://blog.expo.dev/over-the-air-updates-from-expo-are-now-even-easier-to-use-376e2213fabf).
514
578
  - Added `Updates.updateId` and `Updates.releaseChannel` constant exports
515
579
 
516
580
  ### 🐛 Bug fixes
package/README.md CHANGED
@@ -4,8 +4,8 @@
4
4
 
5
5
  ## API documentation
6
6
 
7
- - [Documentation for the master branch](https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/sdk/updates.md)
8
- - [Documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/updates/)
7
+ - [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/updates.md)
8
+ - [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/updates/)
9
9
 
10
10
  Additionally, for an introduction to this module and tooling around OTA updates, you can watch [this talk](https://www.youtube.com/watch?v=Si909la3rLk) by [@esamelson](https://github.com/esamelson) from ReactEurope 2020.
11
11
 
@@ -19,15 +19,15 @@ Finally, this module is not compatible with ExpoKit. Make sure you do not have `
19
19
 
20
20
  ## Upgrading
21
21
 
22
- If you're upgrading from `expo-updates@0.1.x`, you can opt into the **no-publish workflow**. In this workflow, release builds of both iOS and Android apps will create and embed a new update at build-time from the JS code currently on disk, rather than embedding a copy of the most recently published update. For instructions and more information, see the [CHANGELOG](https://github.com/expo/expo/blob/master/packages/expo-updates/CHANGELOG.md). (For new projects, the no-publish workflow is enabled by default.)
22
+ If you're upgrading from `expo-updates@0.1.x`, you can opt into the **no-publish workflow**. In this workflow, release builds of both iOS and Android apps will create and embed a new update at build-time from the JS code currently on disk, rather than embedding a copy of the most recently published update. For instructions and more information, see the [CHANGELOG](https://github.com/expo/expo/blob/main/packages/expo-updates/CHANGELOG.md). (For new projects, the no-publish workflow is enabled by default.)
23
23
 
24
24
  # Installation in managed Expo projects
25
25
 
26
- For [managed](https://docs.expo.io/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/updates/).
26
+ For [managed](https://docs.expo.dev/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/updates/).
27
27
 
28
28
  # Installation in bare React Native projects
29
29
 
30
- Learn how to install expo-updates in your project in the [Installing expo-updates documentation page](https://docs.expo.io/bare/installing-updates/).
30
+ Learn how to install expo-updates in your project in the [Installing expo-updates documentation page](https://docs.expo.dev/bare/installing-updates/).
31
31
 
32
32
  ## Embedded Assets
33
33
 
@@ -79,7 +79,9 @@ The release channel string to send under the `Expo-Release-Channel` header in th
79
79
  | ------------------------ | --------------- | --------------------------------------------------- | -------- | --------- |
80
80
  | `EXUpdatesCheckOnLaunch` | `checkOnLaunch` | `expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH` | `ALWAYS` | ❌ |
81
81
 
82
- The condition under which `expo-updates` should automatically check for (and download, if one exists) an update upon app launch. Possible values are `ALWAYS`, `NEVER` (if you want to exclusively control updates via this module's JS API), or `WIFI_ONLY` (if you want the app to automatically download updates only if the device is on an unmetered Wi-Fi connection when it launches).
82
+ The condition under which `expo-updates` should automatically check for (and download, if one exists) an update upon app launch. Possible values are `ALWAYS`, `NEVER` (if you want to exclusively control updates via this module's JS API), `WIFI_ONLY` (if you want the app to automatically download updates only if the device is on an unmetered Wi-Fi connection when it launches), or `ERROR_RECOVERY_ONLY` (if you want the app to automatically download updates only if it encounters a fatal error when launching).
83
+
84
+ Regardless of the value of this setting, as long as updates are enabled, your app can always use the JS API to manually check for and download updates in the background while your app is running.
83
85
 
84
86
  | iOS plist/dictionary key | Android Map key | Android meta-data name | Default | Required? |
85
87
  | ------------------------ | --------------- | -------------------------------------------------- | ------- | --------- |
@@ -87,6 +89,21 @@ The condition under which `expo-updates` should automatically check for (and dow
87
89
 
88
90
  The number of milliseconds `expo-updates` should delay the app launch and stay on the splash screen while trying to download an update, before falling back to a previously downloaded version. Setting this to `0` will cause the app to always launch with a previously downloaded update and will result in the fastest app launch possible.
89
91
 
92
+ | iOS plist/dictionary key | Android Map key | Android meta-data name | Default | Required? |
93
+ | --------------------------------- | ------------------------ | -------------------------------------------------- | ------- | --------- |
94
+ | `EXUpdatesCodeSigningCertificate` | `codeSigningCertificate` | `expo.modules.updates.CODE_SIGNING_CERTIFICATE` | (none) | ❌ |
95
+ | `EXUpdatesCodeSigningMetadata` | `codeSigningMetadata` | `expo.modules.updates.CODE_SIGNING_METADATA` | (none) | ❌ |
96
+ | `EXUpdatesCodeSigningIncludeManifestResponseCertificateChain` | `codeSigningIncludeManifestResponseCertificateChain` | `expo.modules.updates.CODE_SIGNING_INCLUDE_MANIFEST_RESPONSE_CERTIFICATE_CHAIN` | false | ❌ |
97
+ | `EXUpdatesConfigCodeSigningAllowUnsignedManifests` | `codeSigningAllowUnsignedManifests` | `expo.modules.updates.CODE_SIGNING_ALLOW_UNSIGNED_MANIFESTS` | false | ❌ |
98
+
99
+ If `codeSigningCertificate` is present, `expo-updates` will enforce manifest code signing using the certificate and any metadata associated with it.
100
+ - `codeSigningCertificate` must be a valid PEM formatted X.509 certificate with code signing extended key usage.
101
+ - `codeSigningMetadata` (optional) must be a JSON object containing:
102
+ - `alg` - Algorithm used to generate manifest signature. Only `rsa-v1_5-sha256` is currently supported.
103
+ - `keyid` - Identifier for the key in `codeSigningCertificate`. Used to instruct signing mechanisms when signing or verifying signatures.
104
+ - `codeSigningIncludeManifestResponseCertificateChain` (optional) instructs `expo-updates` to evaluate certificates included in a multipart manifest response (under the `certificate_chain` multipart part) as part of the code signing certificate chain with the embedded `codeSigningCertificate` as the implicitly trusted root certificate of the chain. The leaf certificate in the chain must be valid for code signing.
105
+ - `codeSigningAllowUnsignedManifests` (optional) instructs `expo-updates` to treat a missing signature in the response as if code signing weren't enabled rather than as invalid as it normally would.
106
+
90
107
  ## Customizing automatic setup
91
108
 
92
109
  In `expo-updates@0.9.0` and above, we support automatic installation of the module in the iOS AppDelegate.m and Android MainApplication.java classes. If you want to customize the installation, e.g. to enable updates only in some build variants, you can add custom logic in AppDelegate/MainApplication and set the following keys to `false` in order to disable the automatic setup.
@@ -4,22 +4,37 @@ apply plugin: 'kotlin-kapt'
4
4
  apply plugin: 'maven-publish'
5
5
 
6
6
  group = 'host.exp.exponent'
7
- version = '0.11.6'
7
+ version = '0.13.0'
8
8
 
9
9
  apply from: "../scripts/create-manifest-android.gradle"
10
10
 
11
11
  buildscript {
12
+ def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
13
+ if (expoModulesCorePlugin.exists()) {
14
+ apply from: expoModulesCorePlugin
15
+ applyKotlinExpoModulesCorePlugin()
16
+ }
17
+
12
18
  // Simple helper that allows the root project to override versions declared by this library.
13
19
  ext.safeExtGet = { prop, fallback ->
14
20
  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
15
21
  }
16
22
 
23
+ // Ensures backward compatibility
24
+ ext.getKotlinVersion = {
25
+ if (ext.has("kotlinVersion")) {
26
+ ext.kotlinVersion()
27
+ } else {
28
+ ext.safeExtGet("kotlinVersion", "1.6.10")
29
+ }
30
+ }
31
+
17
32
  repositories {
18
33
  mavenCentral()
19
34
  }
20
35
 
21
36
  dependencies {
22
- classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.4.21')}")
37
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
23
38
  }
24
39
  }
25
40
 
@@ -47,22 +62,22 @@ afterEvaluate {
47
62
  }
48
63
 
49
64
  android {
50
- compileSdkVersion safeExtGet("compileSdkVersion", 30)
65
+ compileSdkVersion safeExtGet("compileSdkVersion", 31)
51
66
 
52
67
  compileOptions {
53
- sourceCompatibility JavaVersion.VERSION_1_8
54
- targetCompatibility JavaVersion.VERSION_1_8
68
+ sourceCompatibility JavaVersion.VERSION_11
69
+ targetCompatibility JavaVersion.VERSION_11
55
70
  }
56
71
 
57
72
  kotlinOptions {
58
- jvmTarget = JavaVersion.VERSION_1_8
73
+ jvmTarget = JavaVersion.VERSION_11.majorVersion
59
74
  }
60
75
 
61
76
  defaultConfig {
62
77
  minSdkVersion safeExtGet("minSdkVersion", 21)
63
- targetSdkVersion safeExtGet("targetSdkVersion", 30)
78
+ targetSdkVersion safeExtGet("targetSdkVersion", 31)
64
79
  versionCode 31
65
- versionName '0.11.6'
80
+ versionName '0.13.0'
66
81
  consumerProguardFiles("proguard-rules.pro")
67
82
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
68
83
  // uncomment below to export the database schema when making changes
@@ -80,7 +95,9 @@ android {
80
95
  unitTests.includeAndroidResources = true
81
96
  }
82
97
  sourceSets {
98
+ main.assets.srcDirs += files("$projectDir/src/main/certificates".toString())
83
99
  androidTest.assets.srcDirs += files("$projectDir/src/androidTest/schemas".toString())
100
+ androidTest.assets.srcDirs += files("$projectDir/src/androidTest/certificates".toString())
84
101
  }
85
102
  }
86
103
 
@@ -90,60 +107,39 @@ dependencies {
90
107
  implementation project(':expo-updates-interface')
91
108
  implementation project(':expo-manifests')
92
109
  implementation project(':expo-json-utils')
110
+ implementation project(':expo-eas-client')
93
111
  //noinspection GradleDynamicVersion
94
112
  implementation "com.facebook.react:react-native:+"
95
113
 
96
- def room_version = "2.3.0"
114
+ def room_version = "2.4.2"
97
115
 
98
116
  implementation "androidx.room:room-runtime:$room_version"
99
117
  kapt "androidx.room:room-compiler:$room_version"
100
118
 
101
- // force upgrade sqlite-jdbc to support building on aarch64 jdk of macos m1.
102
- // https://issuetracker.google.com/issues/174695268
103
- kapt "org.xerial:sqlite-jdbc:3.36.0"
104
-
105
- implementation("com.squareup.okhttp3:okhttp:3.12.1")
106
- implementation("com.squareup.okhttp3:okhttp-urlconnection:3.12.1")
107
- implementation("com.squareup.okio:okio:1.15.0")
119
+ implementation("com.squareup.okhttp3:okhttp:4.9.2")
120
+ implementation("com.squareup.okhttp3:okhttp-urlconnection:4.9.2")
121
+ implementation("com.squareup.okio:okio:2.9.0")
122
+ implementation("commons-codec:commons-codec:1.10")
108
123
  implementation("commons-io:commons-io:2.6")
109
124
  implementation("commons-fileupload:commons-fileupload:1.4")
110
125
  implementation("org.apache.commons:commons-lang3:3.9")
126
+ implementation("org.bouncycastle:bcutil-jdk15to18:1.70")
111
127
 
112
- testImplementation 'junit:junit:4.12'
113
- testImplementation 'androidx.test:core:1.0.0'
114
- testImplementation 'org.mockito:mockito-core:1.10.19'
115
- testImplementation 'io.mockk:mockk:1.12.0'
128
+ testImplementation 'junit:junit:4.13.1'
129
+ testImplementation 'androidx.test:core:1.4.0'
130
+ testImplementation 'io.mockk:mockk:1.12.3'
131
+ testImplementation "org.jetbrains.kotlin:kotlin-test-junit:${getKotlinVersion()}"
116
132
 
117
- androidTestImplementation 'androidx.test:runner:1.1.0'
118
- androidTestImplementation 'androidx.test:core:1.0.0'
119
- androidTestImplementation 'androidx.test:rules:1.1.0'
120
- androidTestImplementation 'org.mockito:mockito-android:3.7.7'
121
- androidTestImplementation 'io.mockk:mockk-android:1.12.0'
133
+ androidTestImplementation 'androidx.test:runner:1.4.0'
134
+ androidTestImplementation 'androidx.test:core:1.4.0'
135
+ androidTestImplementation 'androidx.test:rules:1.4.0'
136
+ androidTestImplementation 'io.mockk:mockk-android:1.12.3'
122
137
  androidTestImplementation "androidx.room:room-testing:$room_version"
138
+ androidTestImplementation "org.jetbrains.kotlin:kotlin-test-junit:${getKotlinVersion()}"
123
139
 
124
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.4.21')}"
125
- implementation "org.jetbrains.kotlin:kotlin-reflect:${safeExtGet('kotlinVersion', '1.4.21')}"
140
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
141
+ implementation "org.jetbrains.kotlin:kotlin-reflect:${getKotlinVersion()}"
126
142
  }
127
143
  repositories {
128
144
  mavenCentral()
129
145
  }
130
-
131
- // [BEGIN] Workaround okhttp/okio compatibility issue
132
- // Remove when we drop support for SDK 44
133
- def okhttpPinnedArtifacts = []
134
- configurations.implementation.getDependencies().removeIf { it ->
135
- if (['com.squareup.okhttp3', 'com.squareup.okio'].contains(it.group)) {
136
- okhttpPinnedArtifacts.add("${it.group}:${it.name}:${it.version}")
137
- return true
138
- }
139
- return false
140
- }
141
- okhttpPinnedArtifacts.each { artifact ->
142
- dependencies.add('compileOnly', artifact)
143
- dependencies.add('testImplementation', artifact)
144
- dependencies.add('androidTestImplementation', artifact)
145
- configurations.all {
146
- resolutionStrategy.force(artifact)
147
- }
148
- }
149
- // [END] Workaround okhttp/okio compatibility issue
@@ -0,0 +1,22 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDmTCCAoGgAwIBAgIJHWx235MgyLC8MA0GCSqGSIb3DQEBCwUAMHsxHjAcBgNV
3
+ BAMTFUV4cG8gUm9vdCBDZXJ0aWZpY2F0ZTELMAkGA1UEBhMCVVMxEzARBgNVBAgT
4
+ CkNhbGlmb3JuaWExEjAQBgNVBAcTCVBhbG8gQWx0bzENMAsGA1UEChMERXhwbzEU
5
+ MBIGA1UECxMLRW5naW5lZXJpbmcwHhcNMjIwMzAxMDEzODU5WhcNNDIwMzAxMDEz
6
+ ODU5WjB7MR4wHAYDVQQDExVFeHBvIFJvb3QgQ2VydGlmaWNhdGUxCzAJBgNVBAYT
7
+ AlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRIwEAYDVQQHEwlQYWxvIEFsdG8xDTAL
8
+ BgNVBAoTBEV4cG8xFDASBgNVBAsTC0VuZ2luZWVyaW5nMIIBIjANBgkqhkiG9w0B
9
+ AQEFAAOCAQ8AMIIBCgKCAQEAvqB9ve0b8EVnwSMKlwrkI+DAJiI5eNFYzV+ho8vl
10
+ 3JAtSDJGlOatFq7HE0MRev7JO/u/wsECNwQb6NvtE5qmkb1wXwHszlfID0jn2lZT
11
+ KfMOgMTD20VWJ5v4EQeMy5ei8A2+giCrDrOGzpiRQ5+Abg6HrYtMoJhehOpeKB83
12
+ GsK9QhzHI3U45Bl9+JDAyqQ+Clgm+wdVkoEobq45quR5RnbtffGhAVIOPfXf0O1t
13
+ +GqNI4gFFHTHiIIBHqSVNu2QycE1mvssQdHfqSkWS+8CpvgelxYdXX4CKby4+BTB
14
+ 2kTVR9014okIUvnccRvbYJ8oUMojJ1mEyAG3UKs1NDvy0wIDAQABoyAwHjAMBgNV
15
+ HRMEBTADAQH/MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAQEAbpvM
16
+ 5M6lMdkoaDMamOIRU7SMWFRRYspGIgNmyHNl7kgiIvKQwuOCpMnIYowIb1F+PDdO
17
+ Z3kM93c5Aj/gHGPuVe6Nt1K/o/+8D8AQkN2KOfkTaksG9ElNNIUU/7fQ9FzW0xrn
18
+ 9v6+s5RYThJGQYRU2HrEmPE3uUCfXYwSa7d2FousmxznNsMrU7YPVkL+aCMjtku2
19
+ Zs77nzsMNS99uPmy6418yjx4YnoZy4mSMpdI1/2WYMT+6EomLKCiDs/hRLO9cBTr
20
+ KCvMkzreu82yIEzqFMPwtzV/cVzw015zDZsB/PecOFLtYxIVW4+X69hVLKrYMoeQ
21
+ VSNm7MGC1VmveZSjuw==
22
+ -----END CERTIFICATE-----