@expo/config-plugins 0.0.0-canary-20231122-1af9191

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 (249) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +34 -0
  3. package/build/Plugin.types.d.ts +169 -0
  4. package/build/Plugin.types.js +51 -0
  5. package/build/Plugin.types.js.map +1 -0
  6. package/build/android/AllowBackup.d.ts +6 -0
  7. package/build/android/AllowBackup.js +47 -0
  8. package/build/android/AllowBackup.js.map +1 -0
  9. package/build/android/BuildProperties.d.ts +28 -0
  10. package/build/android/BuildProperties.js +82 -0
  11. package/build/android/BuildProperties.js.map +1 -0
  12. package/build/android/Colors.d.ts +29 -0
  13. package/build/android/Colors.js +109 -0
  14. package/build/android/Colors.js.map +1 -0
  15. package/build/android/EasBuild.d.ts +3 -0
  16. package/build/android/EasBuild.js +67 -0
  17. package/build/android/EasBuild.js.map +1 -0
  18. package/build/android/EasBuildGradleScript.d.ts +2 -0
  19. package/build/android/EasBuildGradleScript.js +83 -0
  20. package/build/android/EasBuildGradleScript.js.map +1 -0
  21. package/build/android/GoogleMapsApiKey.d.ts +5 -0
  22. package/build/android/GoogleMapsApiKey.js +48 -0
  23. package/build/android/GoogleMapsApiKey.js.map +1 -0
  24. package/build/android/GoogleServices.d.ts +17 -0
  25. package/build/android/GoogleServices.js +139 -0
  26. package/build/android/GoogleServices.js.map +1 -0
  27. package/build/android/IntentFilters.d.ts +8 -0
  28. package/build/android/IntentFilters.js +89 -0
  29. package/build/android/IntentFilters.js.map +1 -0
  30. package/build/android/Manifest.d.ts +156 -0
  31. package/build/android/Manifest.js +230 -0
  32. package/build/android/Manifest.js.map +1 -0
  33. package/build/android/Name.d.ts +20 -0
  34. package/build/android/Name.js +93 -0
  35. package/build/android/Name.js.map +1 -0
  36. package/build/android/Orientation.d.ts +6 -0
  37. package/build/android/Orientation.js +41 -0
  38. package/build/android/Orientation.js.map +1 -0
  39. package/build/android/Package.d.ts +18 -0
  40. package/build/android/Package.js +307 -0
  41. package/build/android/Package.js.map +1 -0
  42. package/build/android/Paths.d.ts +30 -0
  43. package/build/android/Paths.js +154 -0
  44. package/build/android/Paths.js.map +1 -0
  45. package/build/android/Permissions.d.ts +20 -0
  46. package/build/android/Permissions.js +211 -0
  47. package/build/android/Permissions.js.map +1 -0
  48. package/build/android/PrimaryColor.d.ts +6 -0
  49. package/build/android/PrimaryColor.js +63 -0
  50. package/build/android/PrimaryColor.js.map +1 -0
  51. package/build/android/Properties.d.ts +12 -0
  52. package/build/android/Properties.js +55 -0
  53. package/build/android/Properties.js.map +1 -0
  54. package/build/android/Resources.d.ts +87 -0
  55. package/build/android/Resources.js +148 -0
  56. package/build/android/Resources.js.map +1 -0
  57. package/build/android/Scheme.d.ts +20 -0
  58. package/build/android/Scheme.js +240 -0
  59. package/build/android/Scheme.js.map +1 -0
  60. package/build/android/StatusBar.d.ts +16 -0
  61. package/build/android/StatusBar.js +123 -0
  62. package/build/android/StatusBar.js.map +1 -0
  63. package/build/android/Strings.d.ts +6 -0
  64. package/build/android/Strings.js +56 -0
  65. package/build/android/Strings.js.map +1 -0
  66. package/build/android/Styles.d.ts +61 -0
  67. package/build/android/Styles.js +170 -0
  68. package/build/android/Styles.js.map +1 -0
  69. package/build/android/Updates.d.ts +27 -0
  70. package/build/android/Updates.js +220 -0
  71. package/build/android/Updates.js.map +1 -0
  72. package/build/android/Version.d.ts +16 -0
  73. package/build/android/Version.js +90 -0
  74. package/build/android/Version.js.map +1 -0
  75. package/build/android/WindowSoftInputMode.d.ts +6 -0
  76. package/build/android/WindowSoftInputMode.js +49 -0
  77. package/build/android/WindowSoftInputMode.js.map +1 -0
  78. package/build/android/codeMod.d.ts +20 -0
  79. package/build/android/codeMod.js +93 -0
  80. package/build/android/codeMod.js.map +1 -0
  81. package/build/android/index.d.ts +25 -0
  82. package/build/android/index.js +308 -0
  83. package/build/android/index.js.map +1 -0
  84. package/build/index.d.ts +35 -0
  85. package/build/index.js +408 -0
  86. package/build/index.js.map +1 -0
  87. package/build/ios/Bitcode.d.ts +33 -0
  88. package/build/ios/Bitcode.js +111 -0
  89. package/build/ios/Bitcode.js.map +1 -0
  90. package/build/ios/BuildProperties.d.ts +27 -0
  91. package/build/ios/BuildProperties.js +71 -0
  92. package/build/ios/BuildProperties.js.map +1 -0
  93. package/build/ios/BuildScheme.d.ts +10 -0
  94. package/build/ios/BuildScheme.js +117 -0
  95. package/build/ios/BuildScheme.js.map +1 -0
  96. package/build/ios/BundleIdentifier.d.ts +50 -0
  97. package/build/ios/BundleIdentifier.js +243 -0
  98. package/build/ios/BundleIdentifier.js.map +1 -0
  99. package/build/ios/DeviceFamily.d.ts +19 -0
  100. package/build/ios/DeviceFamily.js +95 -0
  101. package/build/ios/DeviceFamily.js.map +1 -0
  102. package/build/ios/Entitlements.d.ts +9 -0
  103. package/build/ios/Entitlements.js +135 -0
  104. package/build/ios/Entitlements.js.map +1 -0
  105. package/build/ios/Google.d.ts +14 -0
  106. package/build/ios/Google.js +141 -0
  107. package/build/ios/Google.js.map +1 -0
  108. package/build/ios/IosConfig.types.d.ts +45 -0
  109. package/build/ios/IosConfig.types.js +2 -0
  110. package/build/ios/IosConfig.types.js.map +1 -0
  111. package/build/ios/Locales.d.ts +14 -0
  112. package/build/ios/Locales.js +133 -0
  113. package/build/ios/Locales.js.map +1 -0
  114. package/build/ios/Maps.d.ts +17 -0
  115. package/build/ios/Maps.js +230 -0
  116. package/build/ios/Maps.js.map +1 -0
  117. package/build/ios/Name.d.ts +20 -0
  118. package/build/ios/Name.js +114 -0
  119. package/build/ios/Name.js.map +1 -0
  120. package/build/ios/Orientation.d.ts +7 -0
  121. package/build/ios/Orientation.js +46 -0
  122. package/build/ios/Orientation.js.map +1 -0
  123. package/build/ios/Paths.d.ts +36 -0
  124. package/build/ios/Paths.js +287 -0
  125. package/build/ios/Paths.js.map +1 -0
  126. package/build/ios/Permissions.d.ts +9 -0
  127. package/build/ios/Permissions.js +58 -0
  128. package/build/ios/Permissions.js.map +1 -0
  129. package/build/ios/ProvisioningProfile.d.ts +8 -0
  130. package/build/ios/ProvisioningProfile.js +67 -0
  131. package/build/ios/ProvisioningProfile.js.map +1 -0
  132. package/build/ios/RequiresFullScreen.d.ts +5 -0
  133. package/build/ios/RequiresFullScreen.js +103 -0
  134. package/build/ios/RequiresFullScreen.js.map +1 -0
  135. package/build/ios/Scheme.d.ts +11 -0
  136. package/build/ios/Scheme.js +114 -0
  137. package/build/ios/Scheme.js.map +1 -0
  138. package/build/ios/Swift.d.ts +34 -0
  139. package/build/ios/Swift.js +196 -0
  140. package/build/ios/Swift.js.map +1 -0
  141. package/build/ios/Target.d.ts +27 -0
  142. package/build/ios/Target.js +137 -0
  143. package/build/ios/Target.js.map +1 -0
  144. package/build/ios/Updates.d.ts +32 -0
  145. package/build/ios/Updates.js +184 -0
  146. package/build/ios/Updates.js.map +1 -0
  147. package/build/ios/UsesNonExemptEncryption.d.ts +5 -0
  148. package/build/ios/UsesNonExemptEncryption.js +40 -0
  149. package/build/ios/UsesNonExemptEncryption.js.map +1 -0
  150. package/build/ios/Version.d.ts +8 -0
  151. package/build/ios/Version.js +47 -0
  152. package/build/ios/Version.js.map +1 -0
  153. package/build/ios/XcodeProjectFile.d.ts +31 -0
  154. package/build/ios/XcodeProjectFile.js +99 -0
  155. package/build/ios/XcodeProjectFile.js.map +1 -0
  156. package/build/ios/codeMod.d.ts +81 -0
  157. package/build/ios/codeMod.js +265 -0
  158. package/build/ios/codeMod.js.map +1 -0
  159. package/build/ios/index.d.ts +26 -0
  160. package/build/ios/index.js +329 -0
  161. package/build/ios/index.js.map +1 -0
  162. package/build/ios/utils/Xcodeproj.d.ts +93 -0
  163. package/build/ios/utils/Xcodeproj.js +490 -0
  164. package/build/ios/utils/Xcodeproj.js.map +1 -0
  165. package/build/ios/utils/getInfoPlistPath.d.ts +12 -0
  166. package/build/ios/utils/getInfoPlistPath.js +50 -0
  167. package/build/ios/utils/getInfoPlistPath.js.map +1 -0
  168. package/build/ios/utils/string.d.ts +1 -0
  169. package/build/ios/utils/string.js +10 -0
  170. package/build/ios/utils/string.js.map +1 -0
  171. package/build/plugins/android-plugins.d.ts +89 -0
  172. package/build/plugins/android-plugins.js +210 -0
  173. package/build/plugins/android-plugins.js.map +1 -0
  174. package/build/plugins/createBaseMod.d.ts +31 -0
  175. package/build/plugins/createBaseMod.js +130 -0
  176. package/build/plugins/createBaseMod.js.map +1 -0
  177. package/build/plugins/ios-plugins.d.ts +70 -0
  178. package/build/plugins/ios-plugins.js +191 -0
  179. package/build/plugins/ios-plugins.js.map +1 -0
  180. package/build/plugins/mod-compiler.d.ts +38 -0
  181. package/build/plugins/mod-compiler.js +222 -0
  182. package/build/plugins/mod-compiler.js.map +1 -0
  183. package/build/plugins/withAndroidBaseMods.d.ts +38 -0
  184. package/build/plugins/withAndroidBaseMods.js +516 -0
  185. package/build/plugins/withAndroidBaseMods.js.map +1 -0
  186. package/build/plugins/withDangerousMod.d.ts +10 -0
  187. package/build/plugins/withDangerousMod.js +30 -0
  188. package/build/plugins/withDangerousMod.js.map +1 -0
  189. package/build/plugins/withIosBaseMods.d.ts +29 -0
  190. package/build/plugins/withIosBaseMods.js +413 -0
  191. package/build/plugins/withIosBaseMods.js.map +1 -0
  192. package/build/plugins/withMod.d.ts +46 -0
  193. package/build/plugins/withMod.js +210 -0
  194. package/build/plugins/withMod.js.map +1 -0
  195. package/build/plugins/withPlugins.d.ts +8 -0
  196. package/build/plugins/withPlugins.js +35 -0
  197. package/build/plugins/withPlugins.js.map +1 -0
  198. package/build/plugins/withRunOnce.d.ts +20 -0
  199. package/build/plugins/withRunOnce.js +55 -0
  200. package/build/plugins/withRunOnce.js.map +1 -0
  201. package/build/plugins/withStaticPlugin.d.ts +17 -0
  202. package/build/plugins/withStaticPlugin.js +140 -0
  203. package/build/plugins/withStaticPlugin.js.map +1 -0
  204. package/build/utils/BuildProperties.types.d.ts +25 -0
  205. package/build/utils/BuildProperties.types.js +2 -0
  206. package/build/utils/BuildProperties.types.js.map +1 -0
  207. package/build/utils/Updates.d.ts +23 -0
  208. package/build/utils/Updates.js +214 -0
  209. package/build/utils/Updates.js.map +1 -0
  210. package/build/utils/XML.d.ts +27 -0
  211. package/build/utils/XML.js +165 -0
  212. package/build/utils/XML.js.map +1 -0
  213. package/build/utils/commonCodeMod.d.ts +32 -0
  214. package/build/utils/commonCodeMod.js +63 -0
  215. package/build/utils/commonCodeMod.js.map +1 -0
  216. package/build/utils/errors.d.ts +15 -0
  217. package/build/utils/errors.js +27 -0
  218. package/build/utils/errors.js.map +1 -0
  219. package/build/utils/fs.d.ts +4 -0
  220. package/build/utils/fs.js +45 -0
  221. package/build/utils/fs.js.map +1 -0
  222. package/build/utils/generateCode.d.ts +36 -0
  223. package/build/utils/generateCode.js +128 -0
  224. package/build/utils/generateCode.js.map +1 -0
  225. package/build/utils/history.d.ts +11 -0
  226. package/build/utils/history.js +25 -0
  227. package/build/utils/history.js.map +1 -0
  228. package/build/utils/matchBrackets.d.ts +7 -0
  229. package/build/utils/matchBrackets.js +65 -0
  230. package/build/utils/matchBrackets.js.map +1 -0
  231. package/build/utils/modules.d.ts +3 -0
  232. package/build/utils/modules.js +44 -0
  233. package/build/utils/modules.js.map +1 -0
  234. package/build/utils/obj.d.ts +2 -0
  235. package/build/utils/obj.js +20 -0
  236. package/build/utils/obj.js.map +1 -0
  237. package/build/utils/plugin-resolver.d.ts +33 -0
  238. package/build/utils/plugin-resolver.js +220 -0
  239. package/build/utils/plugin-resolver.js.map +1 -0
  240. package/build/utils/sortObject.d.ts +4 -0
  241. package/build/utils/sortObject.js +42 -0
  242. package/build/utils/sortObject.js.map +1 -0
  243. package/build/utils/versions.d.ts +3 -0
  244. package/build/utils/versions.js +42 -0
  245. package/build/utils/versions.js.map +1 -0
  246. package/build/utils/warnings.d.ts +26 -0
  247. package/build/utils/warnings.js +52 -0
  248. package/build/utils/warnings.js.map +1 -0
  249. package/package.json +63 -0
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.configureEasBuildAsync = configureEasBuildAsync;
7
+ exports.getEasBuildGradlePath = getEasBuildGradlePath;
8
+ exports.isEasBuildGradleConfiguredAsync = isEasBuildGradleConfiguredAsync;
9
+ function _fs() {
10
+ const data = _interopRequireDefault(require("fs"));
11
+ _fs = function () {
12
+ return data;
13
+ };
14
+ return data;
15
+ }
16
+ function _path() {
17
+ const data = _interopRequireDefault(require("path"));
18
+ _path = function () {
19
+ return data;
20
+ };
21
+ return data;
22
+ }
23
+ function _EasBuildGradleScript() {
24
+ const data = _interopRequireDefault(require("./EasBuildGradleScript"));
25
+ _EasBuildGradleScript = function () {
26
+ return data;
27
+ };
28
+ return data;
29
+ }
30
+ function Paths() {
31
+ const data = _interopRequireWildcard(require("./Paths"));
32
+ Paths = function () {
33
+ return data;
34
+ };
35
+ return data;
36
+ }
37
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
38
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
40
+ const APPLY_EAS_GRADLE = 'apply from: "./eas-build.gradle"';
41
+ function hasApplyLine(content, applyLine) {
42
+ return content.replace(/\r\n/g, '\n').split('\n')
43
+ // Check for both single and double quotes
44
+ .some(line => line === applyLine || line === applyLine.replace(/"/g, "'"));
45
+ }
46
+ function getEasBuildGradlePath(projectRoot) {
47
+ return _path().default.join(projectRoot, 'android', 'app', 'eas-build.gradle');
48
+ }
49
+ async function configureEasBuildAsync(projectRoot) {
50
+ const buildGradlePath = Paths().getAppBuildGradleFilePath(projectRoot);
51
+ const easGradlePath = getEasBuildGradlePath(projectRoot);
52
+ await _fs().default.promises.writeFile(easGradlePath, _EasBuildGradleScript().default);
53
+ const buildGradleContent = await _fs().default.promises.readFile(_path().default.join(buildGradlePath), 'utf8');
54
+ const hasEasGradleApply = hasApplyLine(buildGradleContent, APPLY_EAS_GRADLE);
55
+ if (!hasEasGradleApply) {
56
+ await _fs().default.promises.writeFile(buildGradlePath, `${buildGradleContent.trim()}\n${APPLY_EAS_GRADLE}\n`);
57
+ }
58
+ }
59
+ async function isEasBuildGradleConfiguredAsync(projectRoot) {
60
+ const buildGradlePath = Paths().getAppBuildGradleFilePath(projectRoot);
61
+ const easGradlePath = getEasBuildGradlePath(projectRoot);
62
+ const hasEasGradleFile = await _fs().default.existsSync(easGradlePath);
63
+ const buildGradleContent = await _fs().default.promises.readFile(_path().default.join(buildGradlePath), 'utf8');
64
+ const hasEasGradleApply = hasApplyLine(buildGradleContent, APPLY_EAS_GRADLE);
65
+ return hasEasGradleApply && hasEasGradleFile;
66
+ }
67
+ //# sourceMappingURL=EasBuild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EasBuild.js","names":["_fs","data","_interopRequireDefault","require","_path","_EasBuildGradleScript","Paths","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","APPLY_EAS_GRADLE","hasApplyLine","content","applyLine","replace","split","some","line","getEasBuildGradlePath","projectRoot","path","join","configureEasBuildAsync","buildGradlePath","getAppBuildGradleFilePath","easGradlePath","fs","promises","writeFile","gradleScript","buildGradleContent","readFile","hasEasGradleApply","trim","isEasBuildGradleConfiguredAsync","hasEasGradleFile","existsSync"],"sources":["../../src/android/EasBuild.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport gradleScript from './EasBuildGradleScript';\nimport * as Paths from './Paths';\n\nconst APPLY_EAS_GRADLE = 'apply from: \"./eas-build.gradle\"';\n\nfunction hasApplyLine(content: string, applyLine: string): boolean {\n return (\n content\n .replace(/\\r\\n/g, '\\n')\n .split('\\n')\n // Check for both single and double quotes\n .some((line) => line === applyLine || line === applyLine.replace(/\"/g, \"'\"))\n );\n}\n\nexport function getEasBuildGradlePath(projectRoot: string): string {\n return path.join(projectRoot, 'android', 'app', 'eas-build.gradle');\n}\n\nexport async function configureEasBuildAsync(projectRoot: string): Promise<void> {\n const buildGradlePath = Paths.getAppBuildGradleFilePath(projectRoot);\n const easGradlePath = getEasBuildGradlePath(projectRoot);\n\n await fs.promises.writeFile(easGradlePath, gradleScript);\n\n const buildGradleContent = await fs.promises.readFile(path.join(buildGradlePath), 'utf8');\n\n const hasEasGradleApply = hasApplyLine(buildGradleContent, APPLY_EAS_GRADLE);\n\n if (!hasEasGradleApply) {\n await fs.promises.writeFile(\n buildGradlePath,\n `${buildGradleContent.trim()}\\n${APPLY_EAS_GRADLE}\\n`\n );\n }\n}\n\nexport async function isEasBuildGradleConfiguredAsync(projectRoot: string): Promise<boolean> {\n const buildGradlePath = Paths.getAppBuildGradleFilePath(projectRoot);\n const easGradlePath = getEasBuildGradlePath(projectRoot);\n\n const hasEasGradleFile = await fs.existsSync(easGradlePath);\n\n const buildGradleContent = await fs.promises.readFile(path.join(buildGradlePath), 'utf8');\n const hasEasGradleApply = hasApplyL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AACC,WAAW,CAAC;EAExD,MAAMO,aAAE,CAACC,QAAQ,CAACC,SAAS,CAACH,aAAa,EAAEI,+BAAY,CAAC;EAExD,MAAMC,kBAAkB,GAAG,MAAMJ,aAAE,CAACC,QAAQ,CAACI,QAAQ,CAACX,eAAI,CAACC,IAAI,CAACE,eAAe,CAAC,EAAE,MAAM,CAAC;EAEzF,MAAMS,iBAAiB,GAAGrB,YAAY,CAACmB,kBAAkB,EAAEpB,gBAAgB,CAAC;EAE5E,IAAI,CAACsB,iBAAiB,EAAE;IACtB,MAAMN,aAAE,CAACC,QAAQ,CAACC,SAAS,CACzBL,eAAe,EACd,GAAEO,kBAAkB,CAACG,IAAI,EAAG,KAAIvB,gBAAiB,IAAG,CACtD;EACH;AACF;AAEO,eAAewB,+BAA+BA,CAACf,WAAmB,EAAoB;EAC3F,MAAMI,eAAe,GAAGrC,KAAK,GAACsC,yBAAyB,CAACL,WAAW,CAAC;EACpE,MAAMM,aAAa,GAAGP,qBAAqB,CAACC,WAAW,CAAC;EAExD,MAAMgB,gBAAgB,GAAG,MAAMT,aAAE,CAACU,UAAU,CAACX,aAAa,CAAC;EAE3D,MAAMK,kBAAkB,GAAG,MAAMJ,aAAE,CAACC,QAAQ,CAACI,QAAQ,CAACX,eAAI,CAACC,IAAI,CAACE,eAAe,CAAC,EAAE,MAAM,CAAC;EACzF,MAAMS,iBAAiB,GAAGrB,YAAY,CAACmB,kBAAkB,EAAEpB,gBAAgB,CAAC;EAE5E,OAAOsB,iBAAiB,IAAIG,gBAAgB;AAC9C"}
@@ -0,0 +1,2 @@
1
+ declare const _default: "// Build integration with EAS\n\nimport java.nio.file.Paths\n\nandroid {\n signingConfigs {\n release {\n // This is necessary to avoid needing the user to define a release signing config manually\n // If no release config is defined, and this is not present, build for assembleRelease will crash\n }\n }\n\n buildTypes {\n release {\n // This is necessary to avoid needing the user to define a release build type manually\n }\n }\n}\n\ndef isEasBuildConfigured = false\n\ntasks.whenTaskAdded {\n def debug = gradle.startParameter.taskNames.any { it.toLowerCase().contains('debug') }\n\n if (debug) {\n return\n }\n\n // We only need to configure EAS build once\n if (isEasBuildConfigured) {\n return\n }\n\n isEasBuildConfigured = true;\n\n android.signingConfigs.release {\n def credentialsJson = rootProject.file(\"../credentials.json\");\n\n if (credentialsJson.exists()) {\n if (storeFile && !System.getenv(\"EAS_BUILD\")) {\n println(\"Path to release keystore file is already set, ignoring 'credentials.json'\")\n } else {\n try {\n def credentials = new groovy.json.JsonSlurper().parse(credentialsJson)\n def keystorePath = Paths.get(credentials.android.keystore.keystorePath);\n def storeFilePath = keystorePath.isAbsolute()\n ? keystorePath\n : rootProject.file(\"..\").toPath().resolve(keystorePath);\n\n storeFile storeFilePath.toFile()\n storePassword credentials.android.keystore.keystorePassword\n keyAlias credentials.android.keystore.keyAlias\n if (credentials.android.keystore.containsKey(\"keyPassword\")) {\n keyPassword credentials.android.keystore.keyPassword\n } else {\n // key password is required by Gradle, but PKCS keystores don't have one\n // using the keystore password seems to satisfy the requirement\n keyPassword credentials.android.keystore.keystorePassword\n }\n } catch (Exception e) {\n println(\"An error occurred while parsing 'credentials.json': \" + e.message)\n }\n }\n } else {\n if (storeFile == null) {\n println(\"Couldn't find a 'credentials.json' file, skipping release keystore configuration\")\n }\n }\n }\n\n android.buildTypes.release {\n signingConfig android.signingConfigs.release\n }\n}\n";
2
+ export default _default;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _default = `// Build integration with EAS
8
+
9
+ import java.nio.file.Paths
10
+
11
+ android {
12
+ signingConfigs {
13
+ release {
14
+ // This is necessary to avoid needing the user to define a release signing config manually
15
+ // If no release config is defined, and this is not present, build for assembleRelease will crash
16
+ }
17
+ }
18
+
19
+ buildTypes {
20
+ release {
21
+ // This is necessary to avoid needing the user to define a release build type manually
22
+ }
23
+ }
24
+ }
25
+
26
+ def isEasBuildConfigured = false
27
+
28
+ tasks.whenTaskAdded {
29
+ def debug = gradle.startParameter.taskNames.any { it.toLowerCase().contains('debug') }
30
+
31
+ if (debug) {
32
+ return
33
+ }
34
+
35
+ // We only need to configure EAS build once
36
+ if (isEasBuildConfigured) {
37
+ return
38
+ }
39
+
40
+ isEasBuildConfigured = true;
41
+
42
+ android.signingConfigs.release {
43
+ def credentialsJson = rootProject.file("../credentials.json");
44
+
45
+ if (credentialsJson.exists()) {
46
+ if (storeFile && !System.getenv("EAS_BUILD")) {
47
+ println("Path to release keystore file is already set, ignoring 'credentials.json'")
48
+ } else {
49
+ try {
50
+ def credentials = new groovy.json.JsonSlurper().parse(credentialsJson)
51
+ def keystorePath = Paths.get(credentials.android.keystore.keystorePath);
52
+ def storeFilePath = keystorePath.isAbsolute()
53
+ ? keystorePath
54
+ : rootProject.file("..").toPath().resolve(keystorePath);
55
+
56
+ storeFile storeFilePath.toFile()
57
+ storePassword credentials.android.keystore.keystorePassword
58
+ keyAlias credentials.android.keystore.keyAlias
59
+ if (credentials.android.keystore.containsKey("keyPassword")) {
60
+ keyPassword credentials.android.keystore.keyPassword
61
+ } else {
62
+ // key password is required by Gradle, but PKCS keystores don't have one
63
+ // using the keystore password seems to satisfy the requirement
64
+ keyPassword credentials.android.keystore.keystorePassword
65
+ }
66
+ } catch (Exception e) {
67
+ println("An error occurred while parsing 'credentials.json': " + e.message)
68
+ }
69
+ }
70
+ } else {
71
+ if (storeFile == null) {
72
+ println("Couldn't find a 'credentials.json' file, skipping release keystore configuration")
73
+ }
74
+ }
75
+ }
76
+
77
+ android.buildTypes.release {
78
+ signingConfig android.signingConfigs.release
79
+ }
80
+ }
81
+ `;
82
+ exports.default = _default;
83
+ //# sourceMappingURL=EasBuildGradleScript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EasBuildGradleScript.js","names":["exports","default","_default"],"sources":["../../src/android/EasBuildGradleScript.ts"],"sourcesContent":["export default `// Build integration with EAS\n\nimport java.nio.file.Paths\n\nandroid {\n signingConfigs {\n release {\n // This is necessary to avoid needing the user to define a release signing config manually\n // If no release config is defined, and this is not present, build for assembleRelease will crash\n }\n }\n\n buildTypes {\n release {\n // This is necessary to avoid needing the user to define a release build type manually\n }\n }\n}\n\ndef isEasBuildConfigured = false\n\ntasks.whenTaskAdded {\n def debug = gradle.startParameter.taskNames.any { it.toLowerCase().contains('debug') }\n\n if (debug) {\n return\n }\n\n // We only need to configure EAS build once\n if (isEasBuildConfigured) {\n return\n }\n\n isEasBuildConfigured = true;\n\n android.signingConfigs.release {\n def credentialsJson = rootProject.file(\"../credentials.json\");\n\n if (credentialsJson.exists()) {\n if (storeFile && !System.getenv(\"EAS_BUILD\")) {\n println(\"Path to release keystore file is already set, ignoring 'credentials.json'\")\n } else {\n try {\n def credentials = new groovy.json.JsonSlurper().parse(credentialsJson)\n def keystorePath = Paths.get(credentials.android.keystore.keystorePath);\n def storeFilePath = keystorePath.isAbsolute()\n ? keystorePath\n : rootProject.file(\"..\").toPath().resolve(keystorePath);\n\n storeFile storeFilePath.toFile()\n storePassword credentials.android.keystore.keystorePassword\n keyAlias credentials.android.keystore.keyAlias\n if (credentials.android.keystore.containsKey(\"keyPassword\")) {\n keyPassword credentials.android.keystore.keyPassword\n } else {\n // key password is required by Gradle, but PKCS keystores don't have one\n // using the keystore password seems to satisfy the requirement\n keyPassword credentials.android.keystore.keystorePassword\n }\n } catch (Exception e) {\n println(\"An error occurred while parsing 'credentials.json': \" + e.message)\n }\n }\n } else {\n if (storeFile == null) {\n println(\"Couldn't find a 'credentials.json' file, skipping release keystore configuration\")\n }\n }\n }\n\n android.buildTypes.release {\n signingConfig android.signingConfigs.release\n }\n}\n`;\n"],"mappings":";;;;;;eAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAAAA,OAAA,CAAAC,OAAA,GAAAC,QAAA"}
@@ -0,0 +1,5 @@
1
+ import { ExpoConfig } from '@expo/config-types';
2
+ import { AndroidManifest } from './Manifest';
3
+ export declare const withGoogleMapsApiKey: import("..").ConfigPlugin;
4
+ export declare function getGoogleMapsApiKey(config: Pick<ExpoConfig, 'android'>): string | null;
5
+ export declare function setGoogleMapsApiKey(config: Pick<ExpoConfig, 'android'>, androidManifest: AndroidManifest): AndroidManifest;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getGoogleMapsApiKey = getGoogleMapsApiKey;
7
+ exports.setGoogleMapsApiKey = setGoogleMapsApiKey;
8
+ exports.withGoogleMapsApiKey = void 0;
9
+ function _Manifest() {
10
+ const data = require("./Manifest");
11
+ _Manifest = function () {
12
+ return data;
13
+ };
14
+ return data;
15
+ }
16
+ function _androidPlugins() {
17
+ const data = require("../plugins/android-plugins");
18
+ _androidPlugins = function () {
19
+ return data;
20
+ };
21
+ return data;
22
+ }
23
+ const META_API_KEY = 'com.google.android.geo.API_KEY';
24
+ const LIB_HTTP = 'org.apache.http.legacy';
25
+ const withGoogleMapsApiKey = (0, _androidPlugins().createAndroidManifestPlugin)(setGoogleMapsApiKey, 'withGoogleMapsApiKey');
26
+ exports.withGoogleMapsApiKey = withGoogleMapsApiKey;
27
+ function getGoogleMapsApiKey(config) {
28
+ var _config$android$confi, _config$android, _config$android$confi2, _config$android$confi3;
29
+ return (_config$android$confi = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : (_config$android$confi2 = _config$android.config) === null || _config$android$confi2 === void 0 ? void 0 : (_config$android$confi3 = _config$android$confi2.googleMaps) === null || _config$android$confi3 === void 0 ? void 0 : _config$android$confi3.apiKey) !== null && _config$android$confi !== void 0 ? _config$android$confi : null;
30
+ }
31
+ function setGoogleMapsApiKey(config, androidManifest) {
32
+ const apiKey = getGoogleMapsApiKey(config);
33
+ const mainApplication = (0, _Manifest().getMainApplicationOrThrow)(androidManifest);
34
+ if (apiKey) {
35
+ // If the item exists, add it back
36
+ (0, _Manifest().addMetaDataItemToMainApplication)(mainApplication, META_API_KEY, apiKey);
37
+ (0, _Manifest().addUsesLibraryItemToMainApplication)(mainApplication, {
38
+ name: LIB_HTTP,
39
+ required: false
40
+ });
41
+ } else {
42
+ // Remove any existing item
43
+ (0, _Manifest().removeMetaDataItemFromMainApplication)(mainApplication, META_API_KEY);
44
+ (0, _Manifest().removeUsesLibraryItemFromMainApplication)(mainApplication, LIB_HTTP);
45
+ }
46
+ return androidManifest;
47
+ }
48
+ //# sourceMappingURL=GoogleMapsApiKey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoogleMapsApiKey.js","names":["_Manifest","data","require","_androidPlugins","META_API_KEY","LIB_HTTP","withGoogleMapsApiKey","createAndroidManifestPlugin","setGoogleMapsApiKey","exports","getGoogleMapsApiKey","config","_config$android$confi","_config$android","_config$android$confi2","_config$android$confi3","android","googleMaps","apiKey","androidManifest","mainApplication","getMainApplicationOrThrow","addMetaDataItemToMainApplication","addUsesLibraryItemToMainApplication","name","required","removeMetaDataItemFromMainApplication","removeUsesLibraryItemFromMainApplication"],"sources":["../../src/android/GoogleMapsApiKey.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport {\n addMetaDataItemToMainApplication,\n addUsesLibraryItemToMainApplication,\n AndroidManifest,\n getMainApplicationOrThrow,\n removeMetaDataItemFromMainApplication,\n removeUsesLibraryItemFromMainApplication,\n} from './Manifest';\nimport { createAndroidManifestPlugin } from '../plugins/android-plugins';\n\nconst META_API_KEY = 'com.google.android.geo.API_KEY';\nconst LIB_HTTP = 'org.apache.http.legacy';\n\nexport const withGoogleMapsApiKey = createAndroidManifestPlugin(\n setGoogleMapsApiKey,\n 'withGoogleMapsApiKey'\n);\n\nexport function getGoogleMapsApiKey(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.config?.googleMaps?.apiKey ?? null;\n}\n\nexport function setGoogleMapsApiKey(\n config: Pick<ExpoConfig, 'android'>,\n androidManifest: AndroidManifest\n) {\n const apiKey = getGoogleMapsApiKey(config);\n const mainApplication = getMainApplicationOrThrow(androidManifest);\n\n if (apiKey) {\n // If the item exists, add it back\n addMetaDataItemToMainApplication(mainApplication, META_API_KEY, apiKey);\n addUsesLibraryItemToMainApplication(mainApplication, {\n name: LIB_HTTP,\n required: false,\n });\n } else {\n // Remove any existing item\n removeMetaDataItemFromMainApplication(mainApplication, META_API_KEY);\n removeUsesLibraryItemFromMainApplication(mainApplication, LIB_HTTP);\n }\n\n return androidManifest;\n}\n"],"mappings":";;;;;;;;AAEA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAMG,YAAY,GAAG,gCAAgC;AACrD,MAAMC,QAAQ,GAAG,wBAAwB;AAElC,MAAMC,oBAAoB,GAAG,IAAAC,6CAA2B,EAC7DC,mBAAmB,EACnB,sBAAsB,CACvB;AAACC,OAAA,CAAAH,oBAAA,GAAAA,oBAAA;AAEK,SAASI,mBAAmBA,CAACC,MAAmC,EAAE;EAAA,IAAAC,qBAAA,EAAAC,eAAA,EAAAC,sBAAA,EAAAC,sBAAA;EACvE,QAAAH,qBAAA,IAAAC,eAAA,GAAOF,MAAM,CAACK,OAAO,cAAAH,eAAA,wBAAAC,sBAAA,GAAdD,eAAA,CAAgBF,MAAM,cAAAG,sBAAA,wBAAAC,sBAAA,GAAtBD,sBAAA,CAAwBG,UAAU,cAAAF,sBAAA,uBAAlCA,sBAAA,CAAoCG,MAAM,cAAAN,qBAAA,cAAAA,qBAAA,GAAI,IAAI;AAC3D;AAEO,SAASJ,mBAAmBA,CACjCG,MAAmC,EACnCQ,eAAgC,EAChC;EACA,MAAMD,MAAM,GAAGR,mBAAmB,CAACC,MAAM,CAAC;EAC1C,MAAMS,eAAe,GAAG,IAAAC,qCAAyB,EAACF,eAAe,CAAC;EAElE,IAAID,MAAM,EAAE;IACV;IACA,IAAAI,4CAAgC,EAACF,eAAe,EAAEhB,YAAY,EAAEc,MAAM,CAAC;IACvE,IAAAK,+CAAmC,EAACH,eAAe,EAAE;MACnDI,IAAI,EAAEnB,QAAQ;MACdoB,QAAQ,EAAE;IACZ,CAAC,CAAC;EACJ,CAAC,MAAM;IACL;IACA,IAAAC,iDAAqC,EAACN,eAAe,EAAEhB,YAAY,CAAC;IACpE,IAAAuB,oDAAwC,EAACP,eAAe,EAAEf,QAAQ,CAAC;EACrE;EAEA,OAAOc,eAAe;AACxB"}
@@ -0,0 +1,17 @@
1
+ import { ExpoConfig } from '@expo/config-types';
2
+ import { ConfigPlugin } from '../Plugin.types';
3
+ export declare const withClassPath: ConfigPlugin;
4
+ export declare const withApplyPlugin: ConfigPlugin;
5
+ /**
6
+ * Add `google-services.json` to project
7
+ */
8
+ export declare const withGoogleServicesFile: ConfigPlugin;
9
+ export declare function getGoogleServicesFilePath(config: Pick<ExpoConfig, 'android'>): string | null;
10
+ export declare function setGoogleServicesFile(config: Pick<ExpoConfig, 'android'>, projectRoot: string, targetPath?: string): Promise<boolean>;
11
+ /**
12
+ * Adding the Google Services plugin
13
+ * NOTE(brentvatne): string replacement is a fragile approach! we need a
14
+ * better solution than this.
15
+ */
16
+ export declare function setClassPath(config: Pick<ExpoConfig, 'android'>, buildGradle: string): string;
17
+ export declare function applyPlugin(config: Pick<ExpoConfig, 'android'>, appBuildGradle: string): string;
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.applyPlugin = applyPlugin;
7
+ exports.getGoogleServicesFilePath = getGoogleServicesFilePath;
8
+ exports.setClassPath = setClassPath;
9
+ exports.setGoogleServicesFile = setGoogleServicesFile;
10
+ exports.withGoogleServicesFile = exports.withClassPath = exports.withApplyPlugin = void 0;
11
+ function _path() {
12
+ const data = _interopRequireDefault(require("path"));
13
+ _path = function () {
14
+ return data;
15
+ };
16
+ return data;
17
+ }
18
+ function _androidPlugins() {
19
+ const data = require("../plugins/android-plugins");
20
+ _androidPlugins = function () {
21
+ return data;
22
+ };
23
+ return data;
24
+ }
25
+ function _withDangerousMod() {
26
+ const data = require("../plugins/withDangerousMod");
27
+ _withDangerousMod = function () {
28
+ return data;
29
+ };
30
+ return data;
31
+ }
32
+ function _fs() {
33
+ const data = require("../utils/fs");
34
+ _fs = function () {
35
+ return data;
36
+ };
37
+ return data;
38
+ }
39
+ function _warnings() {
40
+ const data = require("../utils/warnings");
41
+ _warnings = function () {
42
+ return data;
43
+ };
44
+ return data;
45
+ }
46
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
47
+ const DEFAULT_TARGET_PATH = './android/app/google-services.json';
48
+ const googleServicesClassPath = 'com.google.gms:google-services';
49
+ const googleServicesPlugin = 'com.google.gms.google-services';
50
+
51
+ // NOTE(brentvatne): This may be annoying to keep up to date...
52
+ const googleServicesVersion = '4.3.3';
53
+ const withClassPath = config => {
54
+ return (0, _androidPlugins().withProjectBuildGradle)(config, config => {
55
+ if (config.modResults.language === 'groovy') {
56
+ config.modResults.contents = setClassPath(config, config.modResults.contents);
57
+ } else {
58
+ (0, _warnings().addWarningAndroid)('android.googleServicesFile', `Cannot automatically configure project build.gradle if it's not groovy`);
59
+ }
60
+ return config;
61
+ });
62
+ };
63
+ exports.withClassPath = withClassPath;
64
+ const withApplyPlugin = config => {
65
+ return (0, _androidPlugins().withAppBuildGradle)(config, config => {
66
+ if (config.modResults.language === 'groovy') {
67
+ config.modResults.contents = applyPlugin(config, config.modResults.contents);
68
+ } else {
69
+ (0, _warnings().addWarningAndroid)('android.googleServicesFile', `Cannot automatically configure app build.gradle if it's not groovy`);
70
+ }
71
+ return config;
72
+ });
73
+ };
74
+
75
+ /**
76
+ * Add `google-services.json` to project
77
+ */
78
+ exports.withApplyPlugin = withApplyPlugin;
79
+ const withGoogleServicesFile = config => {
80
+ return (0, _withDangerousMod().withDangerousMod)(config, ['android', async config => {
81
+ await setGoogleServicesFile(config, config.modRequest.projectRoot);
82
+ return config;
83
+ }]);
84
+ };
85
+ exports.withGoogleServicesFile = withGoogleServicesFile;
86
+ function getGoogleServicesFilePath(config) {
87
+ var _config$android$googl, _config$android;
88
+ return (_config$android$googl = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : _config$android.googleServicesFile) !== null && _config$android$googl !== void 0 ? _config$android$googl : null;
89
+ }
90
+ async function setGoogleServicesFile(config, projectRoot, targetPath = DEFAULT_TARGET_PATH) {
91
+ const partialSourcePath = getGoogleServicesFilePath(config);
92
+ if (!partialSourcePath) {
93
+ return false;
94
+ }
95
+ const completeSourcePath = _path().default.resolve(projectRoot, partialSourcePath);
96
+ const destinationPath = _path().default.resolve(projectRoot, targetPath);
97
+ try {
98
+ await (0, _fs().copyFilePathToPathAsync)(completeSourcePath, destinationPath);
99
+ } catch (e) {
100
+ console.log(e);
101
+ throw new Error(`Cannot copy google-services.json from ${completeSourcePath} to ${destinationPath}. Please make sure the source and destination paths exist.`);
102
+ }
103
+ return true;
104
+ }
105
+
106
+ /**
107
+ * Adding the Google Services plugin
108
+ * NOTE(brentvatne): string replacement is a fragile approach! we need a
109
+ * better solution than this.
110
+ */
111
+ function setClassPath(config, buildGradle) {
112
+ const googleServicesFile = getGoogleServicesFilePath(config);
113
+ if (!googleServicesFile) {
114
+ return buildGradle;
115
+ }
116
+ if (buildGradle.includes(googleServicesClassPath)) {
117
+ return buildGradle;
118
+ }
119
+
120
+ //
121
+ return buildGradle.replace(/dependencies\s?{/, `dependencies {
122
+ classpath '${googleServicesClassPath}:${googleServicesVersion}'`);
123
+ }
124
+ function applyPlugin(config, appBuildGradle) {
125
+ const googleServicesFile = getGoogleServicesFilePath(config);
126
+ if (!googleServicesFile) {
127
+ return appBuildGradle;
128
+ }
129
+
130
+ // Make sure the project does not have the plugin already
131
+ const pattern = new RegExp(`apply\\s+plugin:\\s+['"]${googleServicesPlugin}['"]`);
132
+ if (appBuildGradle.match(pattern)) {
133
+ return appBuildGradle;
134
+ }
135
+
136
+ // Add it to the end of the file
137
+ return appBuildGradle + `\napply plugin: '${googleServicesPlugin}'`;
138
+ }
139
+ //# sourceMappingURL=GoogleServices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoogleServices.js","names":["_path","data","_interopRequireDefault","require","_androidPlugins","_withDangerousMod","_fs","_warnings","obj","__esModule","default","DEFAULT_TARGET_PATH","googleServicesClassPath","googleServicesPlugin","googleServicesVersion","withClassPath","config","withProjectBuildGradle","modResults","language","contents","setClassPath","addWarningAndroid","exports","withApplyPlugin","withAppBuildGradle","applyPlugin","withGoogleServicesFile","withDangerousMod","setGoogleServicesFile","modRequest","projectRoot","getGoogleServicesFilePath","_config$android$googl","_config$android","android","googleServicesFile","targetPath","partialSourcePath","completeSourcePath","path","resolve","destinationPath","copyFilePathToPathAsync","e","console","log","Error","buildGradle","includes","replace","appBuildGradle","pattern","RegExp","match"],"sources":["../../src/android/GoogleServices.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport path from 'path';\n\nimport { ConfigPlugin } from '../Plugin.types';\nimport { withAppBuildGradle, withProjectBuildGradle } from '../plugins/android-plugins';\nimport { withDangerousMod } from '../plugins/withDangerousMod';\nimport { copyFilePathToPathAsync } from '../utils/fs';\nimport { addWarningAndroid } from '../utils/warnings';\n\nconst DEFAULT_TARGET_PATH = './android/app/google-services.json';\n\nconst googleServicesClassPath = 'com.google.gms:google-services';\nconst googleServicesPlugin = 'com.google.gms.google-services';\n\n// NOTE(brentvatne): This may be annoying to keep up to date...\nconst googleServicesVersion = '4.3.3';\n\nexport const withClassPath: ConfigPlugin = (config) => {\n return withProjectBuildGradle(config, (config) => {\n if (config.modResults.language === 'groovy') {\n config.modResults.contents = setClassPath(config, config.modResults.contents);\n } else {\n addWarningAndroid(\n 'android.googleServicesFile',\n `Cannot automatically configure project build.gradle if it's not groovy`\n );\n }\n return config;\n });\n};\n\nexport const withApplyPlugin: ConfigPlugin = (config) => {\n return withAppBuildGradle(config, (config) => {\n if (config.modResults.language === 'groovy') {\n config.modResults.contents = applyPlugin(config, config.modResults.contents);\n } else {\n addWarningAndroid(\n 'android.googleServicesFile',\n `Cannot automatically configure app build.gradle if it's not groovy`\n );\n }\n return config;\n });\n};\n\n/**\n * Add `google-services.json` to project\n */\nexport const withGoogleServicesFile: ConfigPlugin = (config) => {\n return withDangerousMod(config, [\n 'android',\n async (config) => {\n await setGoogleServicesFile(config, config.modRequest.projectRoot);\n return config;\n },\n ]);\n};\n\nexport function getGoogleServicesFilePath(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.googleServicesFile ?? null;\n}\n\nexport async function setGoogleServicesFile(\n config: Pick<ExpoConfig, 'android'>,\n projectRoot: string,\n targetPath: string = DEFAULT_TARGET_PATH\n) {\n const partialSourcePath = getGoogleServicesFilePath(config);\n if (!partialSourcePath) {\n return false;\n }\n\n const completeSourcePath = path.resolve(projectRoot, partialSourcePath);\n const destinationPath = path.resolve(projectRoot, targetPath);\n\n try {\n await copyFilePathToPathAsync(completeSourcePath, destinationPath);\n } catch (e) {\n console.log(e);\n throw new Error(\n `Cannot copy google-services.json from ${completeSourcePath} to ${destinationPath}. Please make sure the source and destination paths exist.`\n );\n }\n return true;\n}\n\n/**\n * Adding the Google Services plugin\n * NOTE(brentvatne): string replacement is a fragile approach! we need a\n * better solution than this.\n */\nexport function setClassPath(config: Pick<ExpoConfig, 'android'>, buildGradle: string) {\n const googleServicesFile = getGoogleServicesFilePath(config);\n if (!googleServicesFile) {\n return buildGradle;\n }\n\n if (buildGradle.includes(googleServicesClassPath)) {\n return buildGradle;\n }\n\n //\n return buildGradle.replace(\n /dependencies\\s?{/,\n `dependencies {\n classpath '${googleServicesClassPath}:${googleServicesVersion}'`\n );\n}\n\nexport function applyPlugin(config: Pick<ExpoConfig, 'android'>, appBuildGradle: string) {\n const googleServicesFile = getGoogleServicesFilePath(config);\n if (!googleServicesFile) {\n return appBuildGradle;\n }\n\n // Make sure the project does not have the plugin already\n const pattern = new RegExp(`apply\\\\s+plugin:\\\\s+['\"]${googleServicesPlugin}['\"]`);\n if (appBuildGradle.match(pattern)) {\n return appBuildGradle;\n }\n\n // Add it to the end of the file\n return appBuildGradle + `\\napply plugin: '${googleServicesPlugin}'`;\n}\n"],"mappings":";;;;;;;;;;AACA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,gBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,kBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,iBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,IAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,GAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,UAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;A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BAAkB,EAAE;IACvB,OAAOY,WAAW;EACpB;EAEA,IAAIA,WAAW,CAACC,QAAQ,CAACrC,uBAAuB,CAAC,EAAE;IACjD,OAAOoC,WAAW;EACpB;;EAEA;EACA,OAAOA,WAAW,CAACE,OAAO,CACxB,kBAAkB,EACjB;AACL,qBAAqBtC,uBAAwB,IAAGE,qBAAsB,GAAE,CACrE;AACH;AAEO,SAASY,WAAWA,CAACV,MAAmC,EAAEmC,cAAsB,EAAE;EACvF,MAAMf,kBAAkB,GAAGJ,yBAAyB,CAAChB,MAAM,CAAC;EAC5D,IAAI,CAACoB,kBAAkB,EAAE;IACvB,OAAOe,cAAc;EACvB;;EAEA;EACA,MAAMC,OAAO,GAAG,IAAIC,MAAM,CAAE,2BAA0BxC,oBAAqB,MAAK,CAAC;EACjF,IAAIsC,cAAc,CAACG,KAAK,CAACF,OAAO,CAAC,EAAE;IACjC,OAAOD,cAAc;EACvB;;EAEA;EACA,OAAOA,cAAc,GAAI,oBAAmBtC,oBAAqB,GAAE;AACrE"}
@@ -0,0 +1,8 @@
1
+ import { Android, ExpoConfig } from '@expo/config-types';
2
+ import { AndroidManifest, ManifestIntentFilter } from './Manifest';
3
+ type AndroidIntentFilters = NonNullable<Android['intentFilters']>;
4
+ export declare const withAndroidIntentFilters: import("..").ConfigPlugin;
5
+ export declare function getIntentFilters(config: Pick<ExpoConfig, 'android'>): AndroidIntentFilters;
6
+ export declare function setAndroidIntentFilters(config: Pick<ExpoConfig, 'android'>, androidManifest: AndroidManifest): AndroidManifest;
7
+ export default function renderIntentFilters(intentFilters: AndroidIntentFilters): ManifestIntentFilter[];
8
+ export {};
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = renderIntentFilters;
7
+ exports.getIntentFilters = getIntentFilters;
8
+ exports.setAndroidIntentFilters = setAndroidIntentFilters;
9
+ exports.withAndroidIntentFilters = void 0;
10
+ function _Manifest() {
11
+ const data = require("./Manifest");
12
+ _Manifest = function () {
13
+ return data;
14
+ };
15
+ return data;
16
+ }
17
+ function _androidPlugins() {
18
+ const data = require("../plugins/android-plugins");
19
+ _androidPlugins = function () {
20
+ return data;
21
+ };
22
+ return data;
23
+ }
24
+ const GENERATED_TAG = 'data-generated';
25
+ const withAndroidIntentFilters = (0, _androidPlugins().createAndroidManifestPlugin)(setAndroidIntentFilters, 'withAndroidIntentFilters');
26
+ exports.withAndroidIntentFilters = withAndroidIntentFilters;
27
+ function getIntentFilters(config) {
28
+ var _config$android$inten, _config$android;
29
+ return (_config$android$inten = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : _config$android.intentFilters) !== null && _config$android$inten !== void 0 ? _config$android$inten : [];
30
+ }
31
+ function setAndroidIntentFilters(config, androidManifest) {
32
+ var _mainActivity$intent, _mainActivity$intent2;
33
+ // Always ensure old tags are removed.
34
+ const mainActivity = (0, _Manifest().getMainActivityOrThrow)(androidManifest);
35
+ // Remove all generated tags from previous runs...
36
+ if ((_mainActivity$intent = mainActivity['intent-filter']) !== null && _mainActivity$intent !== void 0 && _mainActivity$intent.length) {
37
+ mainActivity['intent-filter'] = mainActivity['intent-filter'].filter(value => {
38
+ var _value$$;
39
+ return ((_value$$ = value.$) === null || _value$$ === void 0 ? void 0 : _value$$[GENERATED_TAG]) !== 'true';
40
+ });
41
+ }
42
+ const intentFilters = getIntentFilters(config);
43
+ if (!intentFilters.length) {
44
+ return androidManifest;
45
+ }
46
+ mainActivity['intent-filter'] = (_mainActivity$intent2 = mainActivity['intent-filter']) === null || _mainActivity$intent2 === void 0 ? void 0 : _mainActivity$intent2.concat(renderIntentFilters(intentFilters));
47
+ return androidManifest;
48
+ }
49
+ function renderIntentFilters(intentFilters) {
50
+ return intentFilters.map(intentFilter => {
51
+ // <intent-filter>
52
+ return {
53
+ $: {
54
+ 'android:autoVerify': intentFilter.autoVerify ? 'true' : undefined,
55
+ // Add a custom "generated" tag that we can query later to remove.
56
+ [GENERATED_TAG]: 'true'
57
+ },
58
+ action: [
59
+ // <action android:name="android.intent.action.VIEW"/>
60
+ {
61
+ $: {
62
+ 'android:name': `android.intent.action.${intentFilter.action}`
63
+ }
64
+ }],
65
+ data: renderIntentFilterData(intentFilter.data),
66
+ category: renderIntentFilterCategory(intentFilter.category)
67
+ };
68
+ });
69
+ }
70
+
71
+ /** Like `<data android:scheme="exp"/>` */
72
+ function renderIntentFilterData(data) {
73
+ return (Array.isArray(data) ? data : [data]).filter(Boolean).map(datum => ({
74
+ $: Object.entries(datum !== null && datum !== void 0 ? datum : {}).reduce((prev, [key, value]) => ({
75
+ ...prev,
76
+ [`android:${key}`]: value
77
+ }), {})
78
+ }));
79
+ }
80
+
81
+ /** Like `<category android:name="android.intent.category.DEFAULT"/>` */
82
+ function renderIntentFilterCategory(category) {
83
+ return (Array.isArray(category) ? category : [category]).filter(Boolean).map(cat => ({
84
+ $: {
85
+ 'android:name': `android.intent.category.${cat}`
86
+ }
87
+ }));
88
+ }
89
+ //# sourceMappingURL=IntentFilters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IntentFilters.js","names":["_Manifest","data","require","_androidPlugins","GENERATED_TAG","withAndroidIntentFilters","createAndroidManifestPlugin","setAndroidIntentFilters","exports","getIntentFilters","config","_config$android$inten","_config$android","android","intentFilters","androidManifest","_mainActivity$intent","_mainActivity$intent2","mainActivity","getMainActivityOrThrow","length","filter","value","_value$$","$","concat","renderIntentFilters","map","intentFilter","autoVerify","undefined","action","renderIntentFilterData","category","renderIntentFilterCategory","Array","isArray","Boolean","datum","Object","entries","reduce","prev","key","cat"],"sources":["../../src/android/IntentFilters.ts"],"sourcesContent":["import { Android, AndroidIntentFiltersData, ExpoConfig } from '@expo/config-types';\n\nimport { AndroidManifest, getMainActivityOrThrow, ManifestIntentFilter } from './Manifest';\nimport { createAndroidManifestPlugin } from '../plugins/android-plugins';\n\ntype AndroidIntentFilters = NonNullable<Android['intentFilters']>;\n\nconst GENERATED_TAG = 'data-generated';\n\nexport const withAndroidIntentFilters = createAndroidManifestPlugin(\n setAndroidIntentFilters,\n 'withAndroidIntentFilters'\n);\n\nexport function getIntentFilters(config: Pick<ExpoConfig, 'android'>): AndroidIntentFilters {\n return config.android?.intentFilters ?? [];\n}\n\nexport function setAndroidIntentFilters(\n config: Pick<ExpoConfig, 'android'>,\n androidManifest: AndroidManifest\n): AndroidManifest {\n // Always ensure old tags are removed.\n const mainActivity = getMainActivityOrThrow(androidManifest);\n // Remove all generated tags from previous runs...\n if (mainActivity['intent-filter']?.length) {\n mainActivity['intent-filter'] = mainActivity['intent-filter'].filter(\n (value) => value.$?.[GENERATED_TAG] !== 'true'\n );\n }\n\n const intentFilters = getIntentFilters(config);\n if (!intentFilters.length) {\n return androidManifest;\n }\n\n mainActivity['intent-filter'] = mainActivity['intent-filter']?.concat(\n renderIntentFilters(intentFilters)\n );\n\n return androidManifest;\n}\n\nexport default function renderIntentFilters(\n intentFilters: AndroidIntentFilters\n): ManifestIntentFilter[] {\n return intentFilters.map((intentFilter) => {\n // <intent-filter>\n return {\n $: {\n 'android:autoVerify': intentFilter.autoVerify ? 'true' : undefined,\n // Add a custom \"generated\" tag that we can query later to remove.\n [GENERATED_TAG]: 'true',\n },\n action: [\n // <action android:name=\"android.intent.action.VIEW\"/>\n {\n $: {\n 'android:name': `android.intent.action.${intentFilter.action}`,\n },\n },\n ],\n data: renderIntentFilterData(intentFilter.data),\n category: renderIntentFilterCategory(intentFilter.category),\n };\n });\n}\n\n/** Like `<data android:scheme=\"exp\"/>` */\nfunction renderIntentFilterData(data?: AndroidIntentFiltersData | AndroidIntentFiltersData[]) {\n return (Array.isArray(data) ? data : [data]).filter(Boolean).map((datum) => ({\n $: Object.entries(datum ?? {}).reduce(\n (prev, [key, value]) => ({ ...prev, [`android:${key}`]: value }),\n {}\n ),\n }));\n}\n\n/** Like `<category android:name=\"android.intent.category.DEFAULT\"/>` */\nfunction renderIntentFilterCategory(category?: string | string[]) {\n return (Array.isArray(category) ? category : [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