nativescript 8.8.3 → 8.9.0-alpha.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 (327) hide show
  1. package/lib/.d.ts +1 -0
  2. package/lib/android-tools-info.js +0 -12
  3. package/lib/base-package-manager.js +0 -7
  4. package/lib/bootstrap.js +1 -5
  5. package/lib/bun-package-manager.js +1 -17
  6. package/lib/color.js +0 -3
  7. package/lib/commands/add-platform.js +0 -1
  8. package/lib/commands/apple-login.js +0 -1
  9. package/lib/commands/appstore-list.js +0 -1
  10. package/lib/commands/appstore-upload.js +3 -10
  11. package/lib/commands/build.js +2 -3
  12. package/lib/commands/clean.js +1 -22
  13. package/lib/commands/command-base.js +0 -1
  14. package/lib/commands/config.js +0 -3
  15. package/lib/commands/create-project.js +0 -6
  16. package/lib/commands/debug.js +1 -6
  17. package/lib/commands/deploy.js +2 -3
  18. package/lib/commands/embedding/embed.js +0 -7
  19. package/lib/commands/extensibility/install-extension.js +0 -1
  20. package/lib/commands/extensibility/list-extensions.js +0 -1
  21. package/lib/commands/extensibility/uninstall-extension.js +0 -1
  22. package/lib/commands/fonts.js +0 -1
  23. package/lib/commands/generate-assets.js +0 -1
  24. package/lib/commands/generate-help.js +0 -1
  25. package/lib/commands/generate.js +2 -12
  26. package/lib/commands/info.js +0 -1
  27. package/lib/commands/install.js +0 -1
  28. package/lib/commands/list-platforms.js +0 -1
  29. package/lib/commands/migrate.js +0 -1
  30. package/lib/commands/native-add.js +0 -5
  31. package/lib/commands/platform-clean.js +0 -1
  32. package/lib/commands/plugin/add-plugin.js +0 -1
  33. package/lib/commands/plugin/build-plugin.js +0 -1
  34. package/lib/commands/plugin/create-plugin.js +0 -5
  35. package/lib/commands/plugin/list-plugins.js +0 -1
  36. package/lib/commands/plugin/remove-plugin.js +0 -2
  37. package/lib/commands/plugin/update-plugin.js +0 -1
  38. package/lib/commands/post-install.js +0 -6
  39. package/lib/commands/prepare.js +3 -4
  40. package/lib/commands/preview.js +0 -2
  41. package/lib/commands/remove-platform.js +0 -1
  42. package/lib/commands/resources/resources-update.js +0 -2
  43. package/lib/commands/run.js +0 -1
  44. package/lib/commands/setup.js +0 -1
  45. package/lib/commands/start.js +0 -1
  46. package/lib/commands/test-init.js +0 -4
  47. package/lib/commands/test.js +2 -9
  48. package/lib/commands/typings.js +1 -2
  49. package/lib/commands/update-platform.js +0 -5
  50. package/lib/commands/update.js +0 -2
  51. package/lib/common/bootstrap.js +0 -1
  52. package/lib/common/child-process.js +0 -3
  53. package/lib/common/codeGeneration/code-entity.js +0 -1
  54. package/lib/common/codeGeneration/code-printer.js +0 -1
  55. package/lib/common/command-params.js +0 -1
  56. package/lib/common/commands/analytics.js +0 -3
  57. package/lib/common/commands/autocompletion.js +0 -3
  58. package/lib/common/commands/device/device-log-stream.js +0 -1
  59. package/lib/common/commands/device/get-file.js +0 -2
  60. package/lib/common/commands/device/list-applications.js +0 -1
  61. package/lib/common/commands/device/list-devices.js +0 -3
  62. package/lib/common/commands/device/list-files.js +0 -2
  63. package/lib/common/commands/device/put-file.js +0 -2
  64. package/lib/common/commands/device/run-application.js +0 -1
  65. package/lib/common/commands/device/stop-application.js +0 -1
  66. package/lib/common/commands/device/uninstall-application.js +0 -1
  67. package/lib/common/commands/doctor.js +2 -3
  68. package/lib/common/commands/generate-messages.js +0 -1
  69. package/lib/common/commands/help.js +0 -1
  70. package/lib/common/commands/package-manager-get.js +0 -1
  71. package/lib/common/commands/package-manager-set.js +0 -1
  72. package/lib/common/commands/post-install.js +0 -1
  73. package/lib/common/commands/preuninstall.js +2 -11
  74. package/lib/common/commands/proxy/proxy-base.js +0 -4
  75. package/lib/common/commands/proxy/proxy-clear.js +0 -1
  76. package/lib/common/commands/proxy/proxy-get.js +0 -1
  77. package/lib/common/commands/proxy/proxy-set.js +0 -1
  78. package/lib/common/common-lib.js +0 -1
  79. package/lib/common/constants.js +0 -11
  80. package/lib/common/decorators.js +0 -48
  81. package/lib/common/dispatchers.js +1 -10
  82. package/lib/common/errors.js +3 -13
  83. package/lib/common/file-system.js +2 -13
  84. package/lib/common/header.js +0 -3
  85. package/lib/common/helpers.js +3 -89
  86. package/lib/common/host-info.js +0 -4
  87. package/lib/common/http-client.js +0 -20
  88. package/lib/common/logger/appenders/cli-appender.js +0 -4
  89. package/lib/common/logger/appenders/emit-appender.js +0 -4
  90. package/lib/common/logger/layouts/cli-layout.js +0 -1
  91. package/lib/common/logger/logger.js +0 -5
  92. package/lib/common/messages/messages.js +0 -6
  93. package/lib/common/mobile/android/android-application-manager.js +1 -20
  94. package/lib/common/mobile/android/android-debug-bridge-result-handler.js +0 -1
  95. package/lib/common/mobile/android/android-debug-bridge.js +0 -6
  96. package/lib/common/mobile/android/android-device-file-system.js +0 -4
  97. package/lib/common/mobile/android/android-device-hash-service.js +0 -3
  98. package/lib/common/mobile/android/android-device.js +0 -8
  99. package/lib/common/mobile/android/android-emulator-services.js +1 -2
  100. package/lib/common/mobile/android/android-ini-file-parser.js +0 -9
  101. package/lib/common/mobile/android/android-log-filter.js +0 -4
  102. package/lib/common/mobile/android/android-virtual-device-service.js +0 -26
  103. package/lib/common/mobile/android/device-android-debug-bridge.js +0 -1
  104. package/lib/common/mobile/android/genymotion/genymotion-service.js +0 -5
  105. package/lib/common/mobile/android/genymotion/virtualbox-service.js +0 -11
  106. package/lib/common/mobile/android/logcat-helper.js +1 -14
  107. package/lib/common/mobile/application-manager-base.js +0 -6
  108. package/lib/common/mobile/device-emitter.js +0 -4
  109. package/lib/common/mobile/device-log-emitter.js +0 -1
  110. package/lib/common/mobile/device-log-provider-base.js +0 -1
  111. package/lib/common/mobile/device-log-provider.js +0 -23
  112. package/lib/common/mobile/device-platforms-constants.js +0 -1
  113. package/lib/common/mobile/emulator-helper.js +0 -3
  114. package/lib/common/mobile/ios/device/ios-application-manager.js +0 -3
  115. package/lib/common/mobile/ios/device/ios-device-file-system.js +0 -1
  116. package/lib/common/mobile/ios/device/ios-device-operations.js +0 -4
  117. package/lib/common/mobile/ios/device/ios-device.js +0 -4
  118. package/lib/common/mobile/ios/ios-device-base.js +0 -1
  119. package/lib/common/mobile/ios/ios-device-product-name-mapper.js +0 -2
  120. package/lib/common/mobile/ios/ios-log-filter.js +0 -1
  121. package/lib/common/mobile/ios/simulator/ios-emulator-services.js +0 -4
  122. package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +0 -1
  123. package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +0 -6
  124. package/lib/common/mobile/ios/simulator/ios-simulator-device.js +0 -5
  125. package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +0 -1
  126. package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +0 -1
  127. package/lib/common/mobile/local-to-device-path-data-factory.js +0 -1
  128. package/lib/common/mobile/log-filter.js +0 -2
  129. package/lib/common/mobile/logging-levels.js +0 -1
  130. package/lib/common/mobile/mobile-core/android-device-discovery.js +0 -2
  131. package/lib/common/mobile/mobile-core/android-emulator-discovery.js +0 -3
  132. package/lib/common/mobile/mobile-core/android-process-service.js +0 -32
  133. package/lib/common/mobile/mobile-core/device-discovery.js +0 -1
  134. package/lib/common/mobile/mobile-core/devices-service.js +0 -69
  135. package/lib/common/mobile/mobile-core/ios-device-discovery.js +0 -2
  136. package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +0 -3
  137. package/lib/common/mobile/mobile-helper.js +0 -1
  138. package/lib/common/mobile/wp8/wp8-emulator-services.js +0 -1
  139. package/lib/common/opener.js +0 -1
  140. package/lib/common/os-info.js +0 -1
  141. package/lib/common/plist-parser.js +0 -1
  142. package/lib/common/project-helper.js +0 -1
  143. package/lib/common/prompter.js +1 -9
  144. package/lib/common/queue.js +0 -1
  145. package/lib/common/resource-loader.js +0 -1
  146. package/lib/common/services/auto-completion-service.js +1 -13
  147. package/lib/common/services/cancellation.js +1 -2
  148. package/lib/common/services/commands-service.js +6 -17
  149. package/lib/common/services/help-service.js +3 -11
  150. package/lib/common/services/hooks-service.js +0 -13
  151. package/lib/common/services/ios-notification-service.js +0 -1
  152. package/lib/common/services/json-file-settings-service.js +0 -6
  153. package/lib/common/services/lock-service.js +0 -6
  154. package/lib/common/services/message-contract-generator.js +0 -1
  155. package/lib/common/services/messages-service.js +0 -1
  156. package/lib/common/services/micro-templating-service.js +0 -6
  157. package/lib/common/services/net-service.js +0 -3
  158. package/lib/common/services/project-files-manager.js +0 -5
  159. package/lib/common/services/project-files-provider-base.js +0 -1
  160. package/lib/common/services/proxy-service.js +0 -1
  161. package/lib/common/services/qr.js +0 -1
  162. package/lib/common/services/settings-service.js +0 -1
  163. package/lib/common/services/xcode-select-service.js +0 -1
  164. package/lib/common/utils.js +0 -1
  165. package/lib/common/validators/project-name-validator.js +0 -1
  166. package/lib/common/validators/validation-result.js +0 -1
  167. package/lib/common/verify-node-version.js +1 -8
  168. package/lib/common/yok.js +11 -32
  169. package/lib/config.js +1 -22
  170. package/lib/constants-provider.js +0 -1
  171. package/lib/constants.js +0 -53
  172. package/lib/controllers/build-controller.js +3 -4
  173. package/lib/controllers/debug-controller.js +3 -8
  174. package/lib/controllers/deploy-controller.js +0 -1
  175. package/lib/controllers/migrate-controller.js +3 -91
  176. package/lib/controllers/platform-controller.js +1 -9
  177. package/lib/controllers/prepare-controller.js +9 -19
  178. package/lib/controllers/run-controller.js +1 -17
  179. package/lib/controllers/update-controller-base.js +0 -1
  180. package/lib/controllers/update-controller.js +0 -11
  181. package/lib/data/build-data.js +0 -1
  182. package/lib/data/controller-data-base.js +0 -1
  183. package/lib/data/debug-data.js +0 -1
  184. package/lib/data/platform-data.js +0 -1
  185. package/lib/data/prepare-data.js +1 -1
  186. package/lib/data/run-data.js +0 -1
  187. package/lib/declarations.d.ts +1 -1
  188. package/lib/definitions/prepare.d.ts +2 -0
  189. package/lib/detached-processes/cleanup-js-subprocess.js +2 -8
  190. package/lib/detached-processes/cleanup-process.js +14 -18
  191. package/lib/detached-processes/file-log-service.js +1 -2
  192. package/lib/device-path-provider.js +0 -1
  193. package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +0 -7
  194. package/lib/device-sockets/ios/notification.js +0 -3
  195. package/lib/device-sockets/ios/socket-request-executor.js +0 -3
  196. package/lib/helpers/android-bundle-validator-helper.js +1 -2
  197. package/lib/helpers/deploy-command-helper.js +0 -1
  198. package/lib/helpers/key-command-helper.js +2 -4
  199. package/lib/helpers/livesync-command-helper.js +1 -4
  200. package/lib/helpers/network-connectivity-validator.js +0 -1
  201. package/lib/helpers/options-track-helper.js +2 -3
  202. package/lib/helpers/package-path-helper.js +0 -1
  203. package/lib/helpers/platform-command-helper.js +2 -7
  204. package/lib/helpers/version-validator-helper.js +0 -1
  205. package/lib/key-commands/bootstrap.js +2 -3
  206. package/lib/key-commands/index.js +32 -26
  207. package/lib/nativescript-cli-lib-bootstrap.js +0 -4
  208. package/lib/nativescript-cli-lib.js +0 -1
  209. package/lib/nativescript-cli.js +1 -10
  210. package/lib/node/pbxproj-dom-xcode.js +0 -1
  211. package/lib/node/xcode.js +0 -1
  212. package/lib/node-package-manager.js +1 -11
  213. package/lib/options.js +119 -143
  214. package/lib/package-installation-manager.js +1 -8
  215. package/lib/package-manager.js +0 -2
  216. package/lib/platform-command-param.js +0 -1
  217. package/lib/pnpm-package-manager.js +1 -4
  218. package/lib/project-data.js +0 -12
  219. package/lib/providers/project-files-provider.js +0 -1
  220. package/lib/resolvers/livesync-service-resolver.js +0 -1
  221. package/lib/services/analytics/analytics-broker-process.js +6 -10
  222. package/lib/services/analytics/analytics-broker.js +1 -2
  223. package/lib/services/analytics/analytics-service.js +25 -29
  224. package/lib/services/analytics/google-analytics-provider.js +12 -13
  225. package/lib/services/analytics-settings-service.js +0 -5
  226. package/lib/services/android/android-bundle-tool-service.js +0 -1
  227. package/lib/services/android/gradle-build-args-service.js +0 -3
  228. package/lib/services/android/gradle-build-service.js +0 -1
  229. package/lib/services/android/gradle-command-service.js +0 -1
  230. package/lib/services/android-device-debug-service.js +0 -6
  231. package/lib/services/android-plugin-build-service.js +0 -29
  232. package/lib/services/android-project-service.js +4 -71
  233. package/lib/services/android-resources-migration-service.js +0 -7
  234. package/lib/services/apple-portal/apple-portal-application-service.js +1 -2
  235. package/lib/services/apple-portal/apple-portal-cookie-service.js +0 -1
  236. package/lib/services/apple-portal/apple-portal-session-service.js +42 -15
  237. package/lib/services/apple-portal/srp/srp-wrapper.js +76 -0
  238. package/lib/services/assets-generation/assets-generation-service.js +5 -16
  239. package/lib/services/build-artifacts-service.js +1 -2
  240. package/lib/services/build-data-service.js +0 -1
  241. package/lib/services/build-info-file-service.js +0 -1
  242. package/lib/services/cleanup-service.js +9 -13
  243. package/lib/services/cocoapods-platform-manager.js +0 -9
  244. package/lib/services/cocoapods-service.js +1 -21
  245. package/lib/services/debug-data-service.js +0 -1
  246. package/lib/services/debug-service-base.js +0 -7
  247. package/lib/services/device/device-install-app-service.js +1 -2
  248. package/lib/services/doctor-service.js +6 -21
  249. package/lib/services/extensibility-service.js +0 -8
  250. package/lib/services/files-hash-service.js +0 -1
  251. package/lib/services/hmr-status-service.js +0 -2
  252. package/lib/services/info-service.js +0 -1
  253. package/lib/services/initialize-service.js +1 -5
  254. package/lib/services/ios/export-options-plist-service.js +4 -6
  255. package/lib/services/ios/ios-signing-service.js +45 -27
  256. package/lib/services/ios/spm-service.js +0 -9
  257. package/lib/services/ios/xcodebuild-args-service.js +0 -9
  258. package/lib/services/ios/xcodebuild-command-service.js +0 -1
  259. package/lib/services/ios/xcodebuild-service.js +2 -1
  260. package/lib/services/ios-debugger-port-service.js +0 -1
  261. package/lib/services/ios-device-debug-service.js +0 -1
  262. package/lib/services/ios-entitlements-service.js +0 -1
  263. package/lib/services/ios-extensions-service.js +0 -1
  264. package/lib/services/ios-log-filter.js +0 -20
  265. package/lib/services/ios-native-target-service.js +4 -6
  266. package/lib/services/ios-project-service.js +2 -94
  267. package/lib/services/ios-provision-service.js +0 -3
  268. package/lib/services/ios-watch-app-service.js +0 -1
  269. package/lib/services/ip-service.js +0 -2
  270. package/lib/services/itmstransporter-service.js +0 -1
  271. package/lib/services/karma-execution.js +0 -2
  272. package/lib/services/livesync/android-device-livesync-service-base.js +0 -1
  273. package/lib/services/livesync/android-device-livesync-service.js +0 -2
  274. package/lib/services/livesync/android-device-livesync-sockets-service.js +0 -3
  275. package/lib/services/livesync/android-livesync-service.js +0 -1
  276. package/lib/services/livesync/android-livesync-tool.js +0 -4
  277. package/lib/services/livesync/device-livesync-service-base.js +0 -2
  278. package/lib/services/livesync/ios-device-livesync-service.js +0 -7
  279. package/lib/services/livesync/ios-livesync-service.js +0 -2
  280. package/lib/services/livesync/livesync-socket.js +0 -1
  281. package/lib/services/livesync/platform-livesync-service-base.js +0 -5
  282. package/lib/services/livesync-process-data-service.js +0 -1
  283. package/lib/services/log-parser-service.js +0 -1
  284. package/lib/services/log-source-map-service.js +0 -15
  285. package/lib/services/marking-mode-service.js +5 -8
  286. package/lib/services/metadata-filtering-service.js +0 -1
  287. package/lib/services/npm-config-service.js +0 -4
  288. package/lib/services/pacote-service.js +0 -7
  289. package/lib/services/performance-service.js +1 -3
  290. package/lib/services/platform/add-platform-service.js +2 -49
  291. package/lib/services/platform/platform-validation-service.js +0 -1
  292. package/lib/services/platform/prepare-native-platform-service.js +2 -5
  293. package/lib/services/platform-environment-requirements.js +3 -8
  294. package/lib/services/platform-project-service-base.js +0 -1
  295. package/lib/services/platforms-data-service.js +0 -1
  296. package/lib/services/plugins-service.js +2 -20
  297. package/lib/services/prepare-data-service.js +0 -1
  298. package/lib/services/project-backup-service.js +0 -4
  299. package/lib/services/project-changes-service.js +3 -14
  300. package/lib/services/project-cleanup-service.js +0 -2
  301. package/lib/services/project-config-service.js +2 -22
  302. package/lib/services/project-data-service.js +7 -36
  303. package/lib/services/project-name-service.js +0 -1
  304. package/lib/services/project-service.js +0 -10
  305. package/lib/services/project-templates-service.js +2 -3
  306. package/lib/services/qr-code-terminal-service.js +0 -1
  307. package/lib/services/require-service.js +0 -1
  308. package/lib/services/start-service.js +0 -1
  309. package/lib/services/temp-service.js +0 -1
  310. package/lib/services/terminal-spinner-service.js +0 -2
  311. package/lib/services/test-execution-service.js +2 -9
  312. package/lib/services/test-initialization-service.js +0 -4
  313. package/lib/services/timeline-profiler-service.js +0 -1
  314. package/lib/services/user-settings-service.js +0 -1
  315. package/lib/services/versions-service.js +4 -6
  316. package/lib/services/watch-ignore-list-service.js +0 -1
  317. package/lib/services/webpack/webpack-compiler-service.js +9 -44
  318. package/lib/services/xcconfig-service.js +0 -2
  319. package/lib/services/xcproj-service.js +0 -1
  320. package/lib/shared-event-bus.js +0 -6
  321. package/lib/sys-info.js +1 -2
  322. package/lib/tools/config-manipulation/config-transformer.js +0 -12
  323. package/lib/tools/node-modules/node-modules-builder.js +0 -1
  324. package/lib/tools/node-modules/node-modules-dependencies-builder.js +0 -6
  325. package/lib/yarn-package-manager.js +0 -1
  326. package/lib/yarn2-package-manager.js +0 -3
  327. package/package.json +3 -2
@@ -27,40 +27,7 @@ const constants_1 = require("../common/constants");
27
27
  const helpers_1 = require("../common/helpers");
28
28
  const decorators_1 = require(".././common/decorators");
29
29
  const yok_1 = require("../common/yok");
30
- //
31
- // we sort the native dependencies topologically to make sure they are processed in the right order
32
- // native dependenciess need to be sorted so the deepst dependencies are built before it's parents
33
- //
34
- // for example, given this dep structure (assuming these are all native dependencies that need to be built)
35
- // (note: we list all dependencies at the root level, so the leaf nodes are essentially references to the root nodes)
36
- //
37
- // |- dep1
38
- // |- dep2
39
- // |- |- dep3
40
- // |- |- dep4
41
- // |- |- |- dep5
42
- // |- dep3
43
- // |- dep4
44
- // |- |- dep5
45
- // |- dep5
46
- //
47
- // It is sorted:
48
- //
49
- // |- dep1
50
- // |- dep3
51
- // |- dep5
52
- // |- dep4 # depends on dep5, so dep5 must be built first, ie above ^
53
- // |- |- dep5
54
- // |- dep2 # depends on dep3, dep4 (and dep5 through dep4) so all of them must be built first before dep2 is built
55
- // |- |- dep3
56
- // |- |- dep4
57
- // |- |- |- dep5
58
- //
59
- // for more details see: https://wikiless.org/wiki/Topological_sorting?lang=en
60
- //
61
- function topologicalSortNativeDependencies(dependencies, start = [], depth = 0, total = 0 // do not pass in, we calculate it in the initial run!
62
- ) {
63
- // we set the total on the initial call - and never increment it, as it's used for esacaping the recursion
30
+ function topologicalSortNativeDependencies(dependencies, start = [], depth = 0, total = 0) {
64
31
  if (total === 0) {
65
32
  total = dependencies.length;
66
33
  }
@@ -74,8 +41,6 @@ function topologicalSortNativeDependencies(dependencies, start = [], depth = 0,
74
41
  return sortedDeps;
75
42
  }, start);
76
43
  const remainingDeps = dependencies.filter((nativeDep) => !sortedDeps.includes(nativeDep));
77
- // recurse if we still have remaining deps
78
- // the second condition here prevents infinite recursion
79
44
  if (remainingDeps.length && sortedDeps.length < total) {
80
45
  return topologicalSortNativeDependencies(remainingDeps, sortedDeps, depth + 1, total);
81
46
  }
@@ -129,7 +94,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
129
94
  constants.APK_DIR,
130
95
  ];
131
96
  const packageName = this.getProjectNameFromId(projectData);
132
- const runtimePackage = this.$projectDataService.getRuntimePackage(projectData.projectDir, "android" /* constants.PlatformTypes.android */);
97
+ const runtimePackage = this.$projectDataService.getRuntimePackage(projectData.projectDir, "android");
133
98
  this._platformData = {
134
99
  frameworkPackageName: runtimePackage.name,
135
100
  normalizedPlatformName: "Android",
@@ -170,7 +135,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
170
135
  configurationFileName: constants.MANIFEST_FILE_NAME,
171
136
  configurationFilePath: path.join(...configurationsDirectoryArr),
172
137
  relativeToFrameworkConfigurationFilePath: path.join(constants.SRC_DIR, constants.MAIN_DIR, constants.MANIFEST_FILE_NAME),
173
- fastLivesyncFileExtensions: [".jpg", ".gif", ".png", ".bmp", ".webp"], // http://developer.android.com/guide/appendix/media-formats.html
138
+ fastLivesyncFileExtensions: [".jpg", ".gif", ".png", ".bmp", ".webp"],
174
139
  };
175
140
  }
176
141
  return this._platformData;
@@ -225,7 +190,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
225
190
  const targetSdkVersion = androidToolsInfo && androidToolsInfo.targetSdkVersion;
226
191
  this.$logger.trace(`Using Android SDK '${targetSdkVersion}'.`);
227
192
  this.copy(this.getPlatformData(projectData).projectRoot, frameworkDir, "*", "-R");
228
- // TODO: Check if we actually need this and if it should be targetSdk or compileSdk
229
193
  this.cleanResValues(targetSdkVersion, projectData);
230
194
  });
231
195
  }
@@ -259,7 +223,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
259
223
  }
260
224
  interpolateData(projectData) {
261
225
  return __awaiter(this, void 0, void 0, function* () {
262
- // Interpolate the apilevel and package
263
226
  this.interpolateConfigurationFile(projectData);
264
227
  const appResourcesDirectoryPath = projectData.getAppResourcesDirectoryPath();
265
228
  let stringsFilePath;
@@ -275,10 +238,8 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
275
238
  const gradleSettingsFilePath = path.join(this.getPlatformData(projectData).projectRoot, "settings.gradle");
276
239
  shell.sed("-i", /__PROJECT_NAME__/, this.getProjectNameFromId(projectData), gradleSettingsFilePath);
277
240
  try {
278
- // will replace applicationId in app/App_Resources/Android/app.gradle if it has not been edited by the user
279
241
  const appGradleContent = this.$fs.readText(projectData.appGradlePath);
280
242
  if (appGradleContent.indexOf(constants.PACKAGE_PLACEHOLDER_NAME) !== -1) {
281
- //TODO: For compatibility with old templates. Once all templates are updated should delete.
282
243
  shell.sed("-i", new RegExp(constants.PACKAGE_PLACEHOLDER_NAME), projectData.projectIdentifiers.android, projectData.appGradlePath);
283
244
  }
284
245
  }
@@ -337,7 +298,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
337
298
  }
338
299
  prepareProject() {
339
300
  return __awaiter(this, void 0, void 0, function* () {
340
- // Intentionally left empty.
341
301
  });
342
302
  }
343
303
  ensureConfigurationFileInAppResources(projectData) {
@@ -355,7 +315,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
355
315
  this.$logger.warn("No manifest found in " + originalAndroidManifestFilePath);
356
316
  return;
357
317
  }
358
- // Overwrite the AndroidManifest from runtime.
359
318
  if (!appResourcesDirStructureHasMigrated) {
360
319
  this.$fs.copyFile(originalAndroidManifestFilePath, this.getPlatformData(projectData).configurationFilePath);
361
320
  }
@@ -372,8 +331,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
372
331
  }
373
332
  else {
374
333
  this.$fs.copyFile(path.join(projectAppResourcesPath, platformData.normalizedPlatformName, "*"), platformsAppResourcesPath);
375
- // https://github.com/NativeScript/android-runtime/issues/899
376
- // App_Resources/Android/libs is reserved to user's aars and jars, but they should not be copied as resources
377
334
  this.$fs.deleteDirectory(path.join(platformsAppResourcesPath, "libs"));
378
335
  }
379
336
  const androidToolsInfo = this.$androidToolsInfo.getToolsInfo({
@@ -384,7 +341,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
384
341
  }
385
342
  preparePluginNativeCode(pluginData, projectData) {
386
343
  return __awaiter(this, void 0, void 0, function* () {
387
- // build Android plugins which contain AndroidManifest.xml and/or resources
388
344
  const pluginPlatformsFolderPath = this.getPluginPlatformsFolderPath(pluginData, AndroidProjectService.ANDROID_PLATFORM_NAME);
389
345
  if (this.$fs.exists(pluginPlatformsFolderPath)) {
390
346
  const options = {
@@ -410,7 +366,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
410
366
  }
411
367
  removePluginNativeCode(pluginData, projectData) {
412
368
  return __awaiter(this, void 0, void 0, function* () {
413
- // not implemented
414
369
  });
415
370
  }
416
371
  beforePrepareAllPlugins(projectData, dependencies) {
@@ -429,7 +384,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
429
384
  filterUniqueDependencies(dependencies) {
430
385
  const depsDictionary = dependencies.reduce((dict, dep) => {
431
386
  const collision = dict[dep.name];
432
- // in case there are multiple dependencies to the same module, the one declared in the package.json takes precedence
433
387
  if (!collision || collision.depth > dep.depth) {
434
388
  dict[dep.name] = dep;
435
389
  }
@@ -448,7 +402,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
448
402
  name,
449
403
  directory: path.relative(platformDir, directory),
450
404
  dependencies: dependencies.filter((dep) => {
451
- // filter out transient dependencies that don't have native dependencies
452
405
  return (nativeDependencyData.findIndex((nativeDep) => nativeDep.name === dep) !== -1);
453
406
  }),
454
407
  };
@@ -456,7 +409,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
456
409
  nativeDependencies = topologicalSortNativeDependencies(nativeDependencies);
457
410
  const jsonContent = JSON.stringify(nativeDependencies, null, 4);
458
411
  this.$fs.writeFile(dependenciesJsonPath, jsonContent);
459
- // we sort all the dependencies to respect the topological sorting of the native dependencies
460
412
  return dependencies.sort(function (a, b) {
461
413
  return (nativeDependencies.findIndex((n) => n.name === a.name) -
462
414
  nativeDependencies.findIndex((n) => n.name === b.name));
@@ -495,7 +447,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
495
447
  }
496
448
  checkForChanges() {
497
449
  return __awaiter(this, void 0, void 0, function* () {
498
- // Nothing android specific to check yet.
499
450
  });
500
451
  }
501
452
  getDeploymentTarget(projectData) {
@@ -506,12 +457,9 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
506
457
  shell.cp(cpArg, paths, projectRoot);
507
458
  }
508
459
  validatePackageName(packageName) {
509
- //Make the package conform to Java package types
510
- //Enforce underscore limitation
511
460
  if (!/^[a-zA-Z]+(\.[a-zA-Z0-9][a-zA-Z0-9_]*)+$/.test(packageName)) {
512
461
  this.$errors.fail(`Package name must look like: com.company.Name. Got: ${packageName}`);
513
462
  }
514
- //Class is a reserved word
515
463
  if (/\b[Cc]lass\b/.test(packageName)) {
516
464
  this.$errors.fail("class is a reserved word");
517
465
  }
@@ -520,7 +468,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
520
468
  if (projectName === "") {
521
469
  this.$errors.fail("Project name cannot be empty");
522
470
  }
523
- //Classes in Java don't begin with numbers
524
471
  if (/^[0-9]/.test(projectName)) {
525
472
  this.$errors.fail("Project name must not begin with a number");
526
473
  }
@@ -541,19 +488,6 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
541
488
  ];
542
489
  return path.join(this.getPlatformData(projectData).projectRoot, ...resourcePath);
543
490
  }
544
- /**
545
- * The purpose of this method is to delete the previously prepared user resources.
546
- * The content of the `<platforms>/android/.../res` directory is based on user's resources and gradle project template from android-runtime.
547
- * During preparation of the `<path to user's App_Resources>/Android` we want to clean all the users files from previous preparation,
548
- * but keep the ones that were introduced during `platform add` of the android-runtime.
549
- * Currently the Gradle project template contains resources only in values and values-v21 directories.
550
- * So the current logic of the method is cleaning al resources from `<platforms>/android/.../res` that are not in `values.*` directories
551
- * and that exist in the `<path to user's App_Resources>/Android/.../res` directory
552
- * This means that if user has a resource file in values-v29 for example, builds the project and then deletes this resource,
553
- * it will be kept in platforms directory. Reference issue: `https://github.com/NativeScript/nativescript-cli/issues/5083`
554
- * Same is valid for files in `drawable-<resolution>` directories - in case in user's resources there's drawable-hdpi directory,
555
- * which is deleted after the first build of app, it will remain in platforms directory.
556
- */
557
491
  cleanUpPreparedResources(projectData) {
558
492
  let resourcesDirPath = path.join(projectData.appResourcesDirectoryPath, this.getPlatformData(projectData).normalizedPlatformName);
559
493
  if (this.$androidResourcesMigrationService.hasMigrated(projectData.appResourcesDirectoryPath)) {
@@ -579,7 +513,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
579
513
  const hasUseKotlinPropertyInAppData = `hasUseKotlinPropertyInApp${analyticsDelimiter}${buildStatistics.kotlinUsage.hasUseKotlinPropertyInApp}`;
580
514
  const hasKotlinRuntimeClassesData = `hasKotlinRuntimeClasses${analyticsDelimiter}${buildStatistics.kotlinUsage.hasKotlinRuntimeClasses}`;
581
515
  yield this.$analyticsService.trackEventActionInGoogleAnalytics({
582
- action: "Using Kotlin" /* constants.TrackActionNames.UsingKotlin */,
516
+ action: "Using Kotlin",
583
517
  additionalData: `${hasUseKotlinPropertyInAppData}${analyticsDelimiter}${hasKotlinRuntimeClassesData}`,
584
518
  });
585
519
  }
@@ -613,4 +547,3 @@ __decorate([
613
547
  ], AndroidProjectService.prototype, "buildProject", null);
614
548
  exports.AndroidProjectService = AndroidProjectService;
615
549
  yok_1.injector.register("androidProjectService", AndroidProjectService);
616
- //# sourceMappingURL=android-project-service.js.map
@@ -58,7 +58,6 @@ class AndroidResourcesMigrationService {
58
58
  const appResourcesMainSourceSetResourcesDestination = path.join(appMainSourceSet, constants.RESOURCES_DIR);
59
59
  this.$fs.ensureDirectoryExists(appResourcesDestination);
60
60
  this.$fs.ensureDirectoryExists(appMainSourceSet);
61
- // create /java, /res and /assets in the App_Resources/Android/src/main directory
62
61
  this.$fs.ensureDirectoryExists(appResourcesMainSourceSetResourcesDestination);
63
62
  this.$fs.ensureDirectoryExists(path.join(appMainSourceSet, "java"));
64
63
  this.$fs.ensureDirectoryExists(path.join(appMainSourceSet, constants.ASSETS_DIR));
@@ -72,25 +71,20 @@ class AndroidResourcesMigrationService {
72
71
  const resourceFiles = getFiles(appResourcesFiles);
73
72
  resourceDirectories.forEach((dir) => {
74
73
  if (path.basename(dir) !== "libs") {
75
- // don't copy /App_Resources/Android/libs into the src/main/res/libs directory
76
74
  this.$fs.copyFile(dir, appResourcesMainSourceSetResourcesDestination);
77
75
  }
78
76
  else {
79
- // copy App_Resources/Android/libs to App_ResourcesNew/Android/libs
80
77
  this.$fs.copyFile(dir, path.join(appResourcesDestination));
81
78
  }
82
79
  });
83
80
  resourceFiles.forEach((file) => {
84
81
  const fileName = path.basename(file);
85
82
  if (fileName !== constants.MANIFEST_FILE_NAME) {
86
- // don't copy AndroidManifest into /App_Resources/Android as it needs to be inside src/main/
87
83
  this.$fs.copyFile(file, path.join(appResourcesDestination, fileName));
88
84
  }
89
85
  });
90
86
  this.$fs.copyFile(path.join(originalAppResources, constants.MANIFEST_FILE_NAME), path.join(appMainSourceSet, constants.MANIFEST_FILE_NAME));
91
- // rename the legacy app_resources to ANDROID_DIR_OLD
92
87
  this.$fs.rename(originalAppResources, appResourcesBackup);
93
- // move the new, updated app_resources to App_Resources/Android, as the de facto resources
94
88
  this.$fs.rename(appResourcesDestination, originalAppResources);
95
89
  });
96
90
  }
@@ -108,4 +102,3 @@ AndroidResourcesMigrationService.ANDROID_DIR_TEMP = "Android-Updated";
108
102
  AndroidResourcesMigrationService.ANDROID_DIR_OLD = "Android-Pre-v4";
109
103
  exports.AndroidResourcesMigrationService = AndroidResourcesMigrationService;
110
104
  yok_1.injector.register("androidResourcesMigrationService", AndroidResourcesMigrationService);
111
- //# sourceMappingURL=android-resources-migration-service.js.map
@@ -33,7 +33,7 @@ class ApplePortalApplicationService {
33
33
  return __awaiter(this, void 0, void 0, function* () {
34
34
  const webSessionCookie = yield this.$applePortalSessionService.createWebSession(contentProviderId);
35
35
  const summaries = [];
36
- yield this.getApplicationsByUrl(webSessionCookie, "https://appstoreconnect.apple.com/iris/v1/apps?include=appStoreVersions,prices", summaries);
36
+ yield this.getApplicationsByUrl(webSessionCookie, "https://appstoreconnect.apple.com/iris/v1/apps?include=appStoreVersions", summaries);
37
37
  return { summaries: summaries };
38
38
  });
39
39
  }
@@ -80,4 +80,3 @@ class ApplePortalApplicationService {
80
80
  }
81
81
  exports.ApplePortalApplicationService = ApplePortalApplicationService;
82
82
  yok_1.injector.register("applePortalApplicationService", ApplePortalApplicationService);
83
- //# sourceMappingURL=apple-portal-application-service.js.map
@@ -51,4 +51,3 @@ class ApplePortalCookieService {
51
51
  }
52
52
  exports.ApplePortalCookieService = ApplePortalCookieService;
53
53
  yok_1.injector.register("applePortalCookieService", ApplePortalCookieService);
54
- //# sourceMappingURL=apple-portal-cookie-service.js.map
@@ -13,6 +13,7 @@ exports.ApplePortalSessionService = void 0;
13
13
  const helpers_1 = require("../../common/helpers");
14
14
  const yok_1 = require("../../common/yok");
15
15
  const crypto = require("crypto");
16
+ const srp_wrapper_1 = require("./srp/srp-wrapper");
16
17
  class ApplePortalSessionService {
17
18
  constructor($applePortalCookieService, $errors, $httpClient, $logger, $prompter) {
18
19
  this.$applePortalCookieService = $applePortalCookieService;
@@ -135,26 +136,41 @@ For more details how to set up your environment, please execute "ns publish ios
135
136
  }
136
137
  loginCore(credentials) {
137
138
  return __awaiter(this, void 0, void 0, function* () {
139
+ const wrapper = new srp_wrapper_1.GSASRPAuthenticator(credentials.username);
140
+ const initData = yield wrapper.getInit();
138
141
  const loginConfig = yield this.getLoginConfig();
139
- const loginUrl = `${loginConfig.authServiceUrl}/auth/signin`;
142
+ const loginUrl = `${loginConfig.authServiceUrl}/auth/signin/init`;
140
143
  const headers = {
141
144
  "Content-Type": "application/json",
142
145
  "X-Requested-With": "XMLHttpRequest",
143
146
  "X-Apple-Widget-Key": loginConfig.authServiceKey,
144
147
  Accept: "application/json, text/javascript",
145
148
  };
146
- const body = {
147
- accountName: credentials.username,
148
- password: credentials.password,
149
- rememberMe: true,
150
- };
151
- const loginResponse = yield this.$httpClient.httpRequest({
149
+ const initResponse = yield this.$httpClient.httpRequest({
152
150
  url: loginUrl,
153
151
  method: "POST",
154
- body,
152
+ body: initData,
155
153
  headers,
156
154
  });
157
- this.$applePortalCookieService.updateUserSessionCookie(loginResponse.headers["set-cookie"]);
155
+ const body = JSON.parse(initResponse.response.body);
156
+ const completeData = yield wrapper.getComplete(credentials.password, body);
157
+ const hashcash = yield this.fetchHashcash(loginConfig.authServiceUrl, loginConfig.authServiceKey);
158
+ const completeUrl = `${loginConfig.authServiceUrl}/auth/signin/complete?isRememberMeEnabled=false`;
159
+ const completeHeaders = {
160
+ "Content-Type": "application/json",
161
+ "X-Requested-With": "XMLHttpRequest",
162
+ "X-Apple-Widget-Key": loginConfig.authServiceKey,
163
+ Accept: "application/json, text/javascript",
164
+ "X-Apple-HC": hashcash || "",
165
+ };
166
+ const completeResponse = yield this.$httpClient.httpRequest({
167
+ url: completeUrl,
168
+ method: "POST",
169
+ completeHeaders,
170
+ body: completeData,
171
+ headers: completeHeaders,
172
+ });
173
+ this.$applePortalCookieService.updateUserSessionCookie(completeResponse.headers["set-cookie"]);
158
174
  });
159
175
  }
160
176
  getLoginConfig() {
@@ -173,6 +189,19 @@ For more details how to set up your environment, please execute "ns publish ios
173
189
  return config || this.defaultLoginConfig;
174
190
  });
175
191
  }
192
+ fetchHashcash(authServiceUrl, authServiceKey) {
193
+ return __awaiter(this, void 0, void 0, function* () {
194
+ const loginUrl = `${authServiceUrl}/auth/signin?widgetKey=${authServiceKey}`;
195
+ const response = yield this.$httpClient.httpRequest({
196
+ url: loginUrl,
197
+ method: "GET",
198
+ });
199
+ const headers = response.headers;
200
+ const bits = headers["X-Apple-HC-Bits"];
201
+ const challenge = headers["X-Apple-HC-Challenge"];
202
+ return makeHashCash(bits, challenge);
203
+ });
204
+ }
176
205
  handleTwoFactorAuthentication(scnt, xAppleIdSessionId, authServiceKey, hashcash) {
177
206
  return __awaiter(this, void 0, void 0, function* () {
178
207
  const headers = {
@@ -190,10 +219,10 @@ For more details how to set up your environment, please execute "ns publish ios
190
219
  const data = JSON.parse(authResponse.body);
191
220
  const isSMS = data.trustedPhoneNumbers &&
192
221
  data.trustedPhoneNumbers.length === 1 &&
193
- data.noTrustedDevices; // 1 device and no trusted devices means sms was automatically sent.
222
+ data.noTrustedDevices;
194
223
  const multiSMS = data.trustedPhoneNumbers &&
195
224
  data.trustedPhoneNumbers.length !== 1 &&
196
- data.noTrustedDevices; // Not handling more than 1 sms device and no trusted devices.
225
+ data.noTrustedDevices;
197
226
  let token;
198
227
  if (data.trustedPhoneNumbers &&
199
228
  data.trustedPhoneNumbers.length &&
@@ -207,7 +236,6 @@ For more details how to set up your environment, please execute "ns publish ios
207
236
  };
208
237
  let url = `https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode`;
209
238
  if (isSMS) {
210
- // No trusted devices means it must be sms.
211
239
  body.mode = "sms";
212
240
  body.phoneNumber = {
213
241
  id: data.trustedPhoneNumbers[0].id,
@@ -271,9 +299,8 @@ function checkBits(bits, digest) {
271
299
  return result;
272
300
  }
273
301
  function checkBit(position, buffer) {
274
- const bitOffset = position & 7; // in byte
275
- const byteIndex = position >> 3; // in buffer
302
+ const bitOffset = position & 7;
303
+ const byteIndex = position >> 3;
276
304
  const bit = (buffer[byteIndex] >> bitOffset) & 1;
277
305
  return bit === 0;
278
306
  }
279
- //# sourceMappingURL=apple-portal-session-service.js.map
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.GSASRPAuthenticator = void 0;
13
+ const js_srp_1 = require("@foxt/js-srp");
14
+ const crypto = require("crypto");
15
+ let srp = new js_srp_1.Srp(js_srp_1.Mode.GSA, js_srp_1.Hash.SHA256, 2048);
16
+ const stringToU8Array = (str) => new TextEncoder().encode(str);
17
+ const base64ToU8Array = (str) => Uint8Array.from(Buffer.from(str, "base64"));
18
+ class GSASRPAuthenticator {
19
+ constructor(username) {
20
+ this.username = username;
21
+ this.srpClient = undefined;
22
+ }
23
+ derivePassword(protocol, password, salt, iterations) {
24
+ return __awaiter(this, void 0, void 0, function* () {
25
+ let passHash = new Uint8Array(yield js_srp_1.util.hash(srp.h, stringToU8Array(password)));
26
+ if (protocol == "s2k_fo") {
27
+ passHash = stringToU8Array(js_srp_1.util.toHex(passHash));
28
+ }
29
+ let imported = yield crypto.subtle.importKey("raw", passHash, { name: "PBKDF2" }, false, ["deriveBits"]);
30
+ let derived = yield crypto.subtle.deriveBits({
31
+ name: "PBKDF2",
32
+ hash: { name: "SHA-256" },
33
+ iterations,
34
+ salt,
35
+ }, imported, 256);
36
+ return new Uint8Array(derived);
37
+ });
38
+ }
39
+ getInit() {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ if (this.srpClient)
42
+ throw new Error("Already initialized");
43
+ this.srpClient = yield srp.newClient(stringToU8Array(this.username), new Uint8Array());
44
+ let a = Buffer.from(js_srp_1.util.bytesFromBigint(this.srpClient.A)).toString("base64");
45
+ return {
46
+ a,
47
+ protocols: ["s2k", "s2k_fo"],
48
+ accountName: this.username,
49
+ };
50
+ });
51
+ }
52
+ getComplete(password, serverData) {
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ if (!this.srpClient)
55
+ throw new Error("Not initialized");
56
+ if (serverData.protocol != "s2k" && serverData.protocol != "s2k_fo")
57
+ throw new Error("Unsupported protocol " + serverData.protocol);
58
+ let salt = base64ToU8Array(serverData.salt);
59
+ let serverPub = base64ToU8Array(serverData.b);
60
+ let iterations = serverData.iteration;
61
+ let derived = yield this.derivePassword(serverData.protocol, password, salt, iterations);
62
+ this.srpClient.p = derived;
63
+ yield this.srpClient.generate(salt, serverPub);
64
+ let m1 = Buffer.from(this.srpClient._M).toString("base64");
65
+ let M2 = yield this.srpClient.generateM2();
66
+ let m2 = Buffer.from(M2).toString("base64");
67
+ return {
68
+ accountName: this.username,
69
+ m1,
70
+ m2,
71
+ c: serverData.c,
72
+ };
73
+ });
74
+ }
75
+ }
76
+ exports.GSASRPAuthenticator = GSASRPAuthenticator;
@@ -96,7 +96,7 @@ class AssetsGenerationService {
96
96
  }
97
97
  continue;
98
98
  }
99
- const operation = assetItem.resizeOperation || "resize" /* Operations.Resize */;
99
+ const operation = assetItem.resizeOperation || "resize";
100
100
  let tempScale = null;
101
101
  if (assetItem.scale) {
102
102
  if (_.isNumber(assetItem.scale)) {
@@ -121,36 +121,27 @@ class AssetsGenerationService {
121
121
  }
122
122
  let image;
123
123
  switch (operation) {
124
- case "overlayWith" /* Operations.OverlayWith */:
124
+ case "overlayWith":
125
125
  const overlayImageScale = assetItem.overlayImageScale ||
126
126
  constants_1.AssetConstants.defaultOverlayImageScale;
127
127
  const imageResize = Math.round(Math.min(width, height) * overlayImageScale);
128
128
  image = yield this.resize(generationData.imagePath, imageResize, imageResize);
129
129
  image = this.generateImage(background, width, height, outputPath, image);
130
130
  break;
131
- case "blank" /* Operations.Blank */:
131
+ case "blank":
132
132
  image = this.generateImage(background, width, height, outputPath);
133
133
  break;
134
- case "resize" /* Operations.Resize */:
134
+ case "resize":
135
135
  image = yield this.resize(generationData.imagePath, width, height);
136
136
  break;
137
- case "outerScale" /* Operations.OuterScale */:
138
- // Resize image without applying scale
137
+ case "outerScale":
139
138
  image = yield this.resize(generationData.imagePath, assetItem.width, assetItem.height);
140
- // The scale will apply to the underlying layer of the generated image
141
139
  image = this.generateImage("#00000000", width, height, outputPath, image);
142
140
  break;
143
141
  default:
144
142
  throw new Error(`Invalid image generation operation: ${operation}`);
145
143
  }
146
- // This code disables the alpha chanel, as some images for the Apple App Store must not have transparency.
147
144
  if (assetItem.rgba === false) {
148
- //
149
- // The original code here became broken at some time and there is an issue posted here..
150
- // https://github.com/oliver-moran/jimp/issues/954
151
- // But NathanaelA recommended the below change and it works so maybe that's just what we go with.
152
- //
153
- // image = image.rgba(false);
154
145
  image = image.colorType(2);
155
146
  }
156
147
  image.write(outputPath);
@@ -164,7 +155,6 @@ class AssetsGenerationService {
164
155
  });
165
156
  }
166
157
  generateImage(background, width, height, outputPath, overlayImage) {
167
- // Typescript declarations for Jimp are not updated to define the constructor with backgroundColor so we workaround it by casting it to <any> for this case only.
168
158
  const J = Jimp;
169
159
  const backgroundColor = this.getRgbaNumber(background);
170
160
  let image = new J(width, height, backgroundColor);
@@ -190,4 +180,3 @@ __decorate([
190
180
  ], AssetsGenerationService.prototype, "generateSplashScreens", null);
191
181
  exports.AssetsGenerationService = AssetsGenerationService;
192
182
  yok_1.injector.register("assetsGenerationService", AssetsGenerationService);
193
- //# sourceMappingURL=assets-generation-service.js.map
@@ -75,7 +75,7 @@ class BuildArtifactsService {
75
75
  if (packages.length > 1) {
76
76
  this.$logger.warn(`More than one ${packageExtName} found in ${buildOutputPath} directory. Using the last one produced from build.`);
77
77
  }
78
- packages = _.sortBy(packages, (pkg) => pkg.time).reverse(); // We need to reverse because sortBy always sorts in ascending order
78
+ packages = _.sortBy(packages, (pkg) => pkg.time).reverse();
79
79
  return packages[0];
80
80
  }
81
81
  getApplicationPackagesCore(candidates, validPackageNames) {
@@ -96,4 +96,3 @@ class BuildArtifactsService {
96
96
  }
97
97
  exports.BuildArtifactsService = BuildArtifactsService;
98
98
  yok_1.injector.register("buildArtifactsService", BuildArtifactsService);
99
- //# sourceMappingURL=build-artifacts-service.js.map
@@ -18,4 +18,3 @@ class BuildDataService {
18
18
  }
19
19
  exports.BuildDataService = BuildDataService;
20
20
  yok_1.injector.register("buildDataService", BuildDataService);
21
- //# sourceMappingURL=build-data-service.js.map
@@ -77,4 +77,3 @@ class BuildInfoFileService {
77
77
  }
78
78
  exports.BuildInfoFileService = BuildInfoFileService;
79
79
  yok_1.injector.register("buildInfoFileService", BuildInfoFileService);
80
- //# sourceMappingURL=build-info-file-service.js.map
@@ -30,7 +30,7 @@ class CleanupService {
30
30
  return __awaiter(this, void 0, void 0, function* () {
31
31
  const cleanupProcess = yield this.getCleanupProcess();
32
32
  cleanupProcess.send({
33
- messageType: "AddCleanCommand" /* CleanupProcessMessage.AddCleanCommand */,
33
+ messageType: "AddCleanCommand",
34
34
  commandInfo,
35
35
  });
36
36
  });
@@ -39,7 +39,7 @@ class CleanupService {
39
39
  return __awaiter(this, void 0, void 0, function* () {
40
40
  const cleanupProcess = yield this.getCleanupProcess();
41
41
  cleanupProcess.send({
42
- messageType: "RemoveCleanCommand" /* CleanupProcessMessage.RemoveCleanCommand */,
42
+ messageType: "RemoveCleanCommand",
43
43
  commandInfo,
44
44
  });
45
45
  });
@@ -48,7 +48,7 @@ class CleanupService {
48
48
  return __awaiter(this, void 0, void 0, function* () {
49
49
  const cleanupProcess = yield this.getCleanupProcess();
50
50
  cleanupProcess.send({
51
- messageType: "AddRequest" /* CleanupProcessMessage.AddRequest */,
51
+ messageType: "AddRequest",
52
52
  requestInfo,
53
53
  });
54
54
  });
@@ -57,7 +57,7 @@ class CleanupService {
57
57
  return __awaiter(this, void 0, void 0, function* () {
58
58
  const cleanupProcess = yield this.getCleanupProcess();
59
59
  cleanupProcess.send({
60
- messageType: "RemoveRequest" /* CleanupProcessMessage.RemoveRequest */,
60
+ messageType: "RemoveRequest",
61
61
  requestInfo,
62
62
  });
63
63
  });
@@ -66,7 +66,7 @@ class CleanupService {
66
66
  return __awaiter(this, void 0, void 0, function* () {
67
67
  const cleanupProcess = yield this.getCleanupProcess();
68
68
  cleanupProcess.send({
69
- messageType: "AddDeleteFileAction" /* CleanupProcessMessage.AddDeleteFileAction */,
69
+ messageType: "AddDeleteFileAction",
70
70
  filePath,
71
71
  });
72
72
  });
@@ -75,7 +75,7 @@ class CleanupService {
75
75
  return __awaiter(this, void 0, void 0, function* () {
76
76
  const cleanupProcess = yield this.getCleanupProcess();
77
77
  cleanupProcess.send({
78
- messageType: "RemoveDeleteFileAction" /* CleanupProcessMessage.RemoveDeleteFileAction */,
78
+ messageType: "RemoveDeleteFileAction",
79
79
  filePath,
80
80
  });
81
81
  });
@@ -84,7 +84,7 @@ class CleanupService {
84
84
  return __awaiter(this, void 0, void 0, function* () {
85
85
  const cleanupProcess = yield this.getCleanupProcess();
86
86
  cleanupProcess.send({
87
- messageType: "AddJSFileToRequire" /* CleanupProcessMessage.AddJSFileToRequire */,
87
+ messageType: "AddJSFileToRequire",
88
88
  jsCommand,
89
89
  });
90
90
  });
@@ -93,7 +93,7 @@ class CleanupService {
93
93
  return __awaiter(this, void 0, void 0, function* () {
94
94
  const cleanupProcess = yield this.getCleanupProcess();
95
95
  cleanupProcess.send({
96
- messageType: "RemoveJSFileToRequire" /* CleanupProcessMessage.RemoveJSFileToRequire */,
96
+ messageType: "RemoveJSFileToRequire",
97
97
  jsCommand,
98
98
  });
99
99
  });
@@ -121,8 +121,6 @@ class CleanupService {
121
121
  setShouldDispose(shouldDispose) {
122
122
  this.shouldDispose = shouldDispose;
123
123
  }
124
- // TODO: Consider extracting this method to a separate service
125
- // as it has the same logic as the one used in analytics-service
126
124
  getCleanupProcess() {
127
125
  return new Promise((resolve, reject) => {
128
126
  const cleanupProcessArgs = this.getCleanupProcessArgs();
@@ -141,12 +139,11 @@ class CleanupService {
141
139
  clearTimeout(timeoutId);
142
140
  if (!isSettled) {
143
141
  isSettled = true;
144
- // In case we throw error here, CLI will break its execution.
145
142
  reject(err);
146
143
  }
147
144
  });
148
145
  cleanupProcess.on("message", (data) => {
149
- if (data === "ProcessReadyToReceive" /* DetachedProcessMessages.ProcessReadyToReceive */) {
146
+ if (data === "ProcessReadyToReceive") {
150
147
  clearTimeout(timeoutId);
151
148
  if (!isSettled) {
152
149
  isSettled = true;
@@ -195,4 +192,3 @@ __decorate([
195
192
  ], CleanupService.prototype, "getCleanupProcess", null);
196
193
  exports.CleanupService = CleanupService;
197
194
  yok_1.injector.register("cleanupService", CleanupService);
198
- //# sourceMappingURL=cleanup-service.js.map