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.
- package/lib/.d.ts +1 -0
- package/lib/android-tools-info.js +0 -12
- package/lib/base-package-manager.js +0 -7
- package/lib/bootstrap.js +1 -5
- package/lib/bun-package-manager.js +1 -17
- package/lib/color.js +0 -3
- package/lib/commands/add-platform.js +0 -1
- package/lib/commands/apple-login.js +0 -1
- package/lib/commands/appstore-list.js +0 -1
- package/lib/commands/appstore-upload.js +3 -10
- package/lib/commands/build.js +2 -3
- package/lib/commands/clean.js +1 -22
- package/lib/commands/command-base.js +0 -1
- package/lib/commands/config.js +0 -3
- package/lib/commands/create-project.js +0 -6
- package/lib/commands/debug.js +1 -6
- package/lib/commands/deploy.js +2 -3
- package/lib/commands/embedding/embed.js +0 -7
- package/lib/commands/extensibility/install-extension.js +0 -1
- package/lib/commands/extensibility/list-extensions.js +0 -1
- package/lib/commands/extensibility/uninstall-extension.js +0 -1
- package/lib/commands/fonts.js +0 -1
- package/lib/commands/generate-assets.js +0 -1
- package/lib/commands/generate-help.js +0 -1
- package/lib/commands/generate.js +2 -12
- package/lib/commands/info.js +0 -1
- package/lib/commands/install.js +0 -1
- package/lib/commands/list-platforms.js +0 -1
- package/lib/commands/migrate.js +0 -1
- package/lib/commands/native-add.js +0 -5
- package/lib/commands/platform-clean.js +0 -1
- package/lib/commands/plugin/add-plugin.js +0 -1
- package/lib/commands/plugin/build-plugin.js +0 -1
- package/lib/commands/plugin/create-plugin.js +0 -5
- package/lib/commands/plugin/list-plugins.js +0 -1
- package/lib/commands/plugin/remove-plugin.js +0 -2
- package/lib/commands/plugin/update-plugin.js +0 -1
- package/lib/commands/post-install.js +0 -6
- package/lib/commands/prepare.js +3 -4
- package/lib/commands/preview.js +0 -2
- package/lib/commands/remove-platform.js +0 -1
- package/lib/commands/resources/resources-update.js +0 -2
- package/lib/commands/run.js +0 -1
- package/lib/commands/setup.js +0 -1
- package/lib/commands/start.js +0 -1
- package/lib/commands/test-init.js +0 -4
- package/lib/commands/test.js +2 -9
- package/lib/commands/typings.js +1 -2
- package/lib/commands/update-platform.js +0 -5
- package/lib/commands/update.js +0 -2
- package/lib/common/bootstrap.js +0 -1
- package/lib/common/child-process.js +0 -3
- package/lib/common/codeGeneration/code-entity.js +0 -1
- package/lib/common/codeGeneration/code-printer.js +0 -1
- package/lib/common/command-params.js +0 -1
- package/lib/common/commands/analytics.js +0 -3
- package/lib/common/commands/autocompletion.js +0 -3
- package/lib/common/commands/device/device-log-stream.js +0 -1
- package/lib/common/commands/device/get-file.js +0 -2
- package/lib/common/commands/device/list-applications.js +0 -1
- package/lib/common/commands/device/list-devices.js +0 -3
- package/lib/common/commands/device/list-files.js +0 -2
- package/lib/common/commands/device/put-file.js +0 -2
- package/lib/common/commands/device/run-application.js +0 -1
- package/lib/common/commands/device/stop-application.js +0 -1
- package/lib/common/commands/device/uninstall-application.js +0 -1
- package/lib/common/commands/doctor.js +2 -3
- package/lib/common/commands/generate-messages.js +0 -1
- package/lib/common/commands/help.js +0 -1
- package/lib/common/commands/package-manager-get.js +0 -1
- package/lib/common/commands/package-manager-set.js +0 -1
- package/lib/common/commands/post-install.js +0 -1
- package/lib/common/commands/preuninstall.js +2 -11
- package/lib/common/commands/proxy/proxy-base.js +0 -4
- package/lib/common/commands/proxy/proxy-clear.js +0 -1
- package/lib/common/commands/proxy/proxy-get.js +0 -1
- package/lib/common/commands/proxy/proxy-set.js +0 -1
- package/lib/common/common-lib.js +0 -1
- package/lib/common/constants.js +0 -11
- package/lib/common/decorators.js +0 -48
- package/lib/common/dispatchers.js +1 -10
- package/lib/common/errors.js +3 -13
- package/lib/common/file-system.js +2 -13
- package/lib/common/header.js +0 -3
- package/lib/common/helpers.js +3 -89
- package/lib/common/host-info.js +0 -4
- package/lib/common/http-client.js +0 -20
- package/lib/common/logger/appenders/cli-appender.js +0 -4
- package/lib/common/logger/appenders/emit-appender.js +0 -4
- package/lib/common/logger/layouts/cli-layout.js +0 -1
- package/lib/common/logger/logger.js +0 -5
- package/lib/common/messages/messages.js +0 -6
- package/lib/common/mobile/android/android-application-manager.js +1 -20
- package/lib/common/mobile/android/android-debug-bridge-result-handler.js +0 -1
- package/lib/common/mobile/android/android-debug-bridge.js +0 -6
- package/lib/common/mobile/android/android-device-file-system.js +0 -4
- package/lib/common/mobile/android/android-device-hash-service.js +0 -3
- package/lib/common/mobile/android/android-device.js +0 -8
- package/lib/common/mobile/android/android-emulator-services.js +1 -2
- package/lib/common/mobile/android/android-ini-file-parser.js +0 -9
- package/lib/common/mobile/android/android-log-filter.js +0 -4
- package/lib/common/mobile/android/android-virtual-device-service.js +0 -26
- package/lib/common/mobile/android/device-android-debug-bridge.js +0 -1
- package/lib/common/mobile/android/genymotion/genymotion-service.js +0 -5
- package/lib/common/mobile/android/genymotion/virtualbox-service.js +0 -11
- package/lib/common/mobile/android/logcat-helper.js +1 -14
- package/lib/common/mobile/application-manager-base.js +0 -6
- package/lib/common/mobile/device-emitter.js +0 -4
- package/lib/common/mobile/device-log-emitter.js +0 -1
- package/lib/common/mobile/device-log-provider-base.js +0 -1
- package/lib/common/mobile/device-log-provider.js +0 -23
- package/lib/common/mobile/device-platforms-constants.js +0 -1
- package/lib/common/mobile/emulator-helper.js +0 -3
- package/lib/common/mobile/ios/device/ios-application-manager.js +0 -3
- package/lib/common/mobile/ios/device/ios-device-file-system.js +0 -1
- package/lib/common/mobile/ios/device/ios-device-operations.js +0 -4
- package/lib/common/mobile/ios/device/ios-device.js +0 -4
- package/lib/common/mobile/ios/ios-device-base.js +0 -1
- package/lib/common/mobile/ios/ios-device-product-name-mapper.js +0 -2
- package/lib/common/mobile/ios/ios-log-filter.js +0 -1
- package/lib/common/mobile/ios/simulator/ios-emulator-services.js +0 -4
- package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +0 -1
- package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +0 -6
- package/lib/common/mobile/ios/simulator/ios-simulator-device.js +0 -5
- package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +0 -1
- package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +0 -1
- package/lib/common/mobile/local-to-device-path-data-factory.js +0 -1
- package/lib/common/mobile/log-filter.js +0 -2
- package/lib/common/mobile/logging-levels.js +0 -1
- package/lib/common/mobile/mobile-core/android-device-discovery.js +0 -2
- package/lib/common/mobile/mobile-core/android-emulator-discovery.js +0 -3
- package/lib/common/mobile/mobile-core/android-process-service.js +0 -32
- package/lib/common/mobile/mobile-core/device-discovery.js +0 -1
- package/lib/common/mobile/mobile-core/devices-service.js +0 -69
- package/lib/common/mobile/mobile-core/ios-device-discovery.js +0 -2
- package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +0 -3
- package/lib/common/mobile/mobile-helper.js +0 -1
- package/lib/common/mobile/wp8/wp8-emulator-services.js +0 -1
- package/lib/common/opener.js +0 -1
- package/lib/common/os-info.js +0 -1
- package/lib/common/plist-parser.js +0 -1
- package/lib/common/project-helper.js +0 -1
- package/lib/common/prompter.js +1 -9
- package/lib/common/queue.js +0 -1
- package/lib/common/resource-loader.js +0 -1
- package/lib/common/services/auto-completion-service.js +1 -13
- package/lib/common/services/cancellation.js +1 -2
- package/lib/common/services/commands-service.js +6 -17
- package/lib/common/services/help-service.js +3 -11
- package/lib/common/services/hooks-service.js +0 -13
- package/lib/common/services/ios-notification-service.js +0 -1
- package/lib/common/services/json-file-settings-service.js +0 -6
- package/lib/common/services/lock-service.js +0 -6
- package/lib/common/services/message-contract-generator.js +0 -1
- package/lib/common/services/messages-service.js +0 -1
- package/lib/common/services/micro-templating-service.js +0 -6
- package/lib/common/services/net-service.js +0 -3
- package/lib/common/services/project-files-manager.js +0 -5
- package/lib/common/services/project-files-provider-base.js +0 -1
- package/lib/common/services/proxy-service.js +0 -1
- package/lib/common/services/qr.js +0 -1
- package/lib/common/services/settings-service.js +0 -1
- package/lib/common/services/xcode-select-service.js +0 -1
- package/lib/common/utils.js +0 -1
- package/lib/common/validators/project-name-validator.js +0 -1
- package/lib/common/validators/validation-result.js +0 -1
- package/lib/common/verify-node-version.js +1 -8
- package/lib/common/yok.js +11 -32
- package/lib/config.js +1 -22
- package/lib/constants-provider.js +0 -1
- package/lib/constants.js +0 -53
- package/lib/controllers/build-controller.js +3 -4
- package/lib/controllers/debug-controller.js +3 -8
- package/lib/controllers/deploy-controller.js +0 -1
- package/lib/controllers/migrate-controller.js +3 -91
- package/lib/controllers/platform-controller.js +1 -9
- package/lib/controllers/prepare-controller.js +9 -19
- package/lib/controllers/run-controller.js +1 -17
- package/lib/controllers/update-controller-base.js +0 -1
- package/lib/controllers/update-controller.js +0 -11
- package/lib/data/build-data.js +0 -1
- package/lib/data/controller-data-base.js +0 -1
- package/lib/data/debug-data.js +0 -1
- package/lib/data/platform-data.js +0 -1
- package/lib/data/prepare-data.js +1 -1
- package/lib/data/run-data.js +0 -1
- package/lib/declarations.d.ts +1 -1
- package/lib/definitions/prepare.d.ts +2 -0
- package/lib/detached-processes/cleanup-js-subprocess.js +2 -8
- package/lib/detached-processes/cleanup-process.js +14 -18
- package/lib/detached-processes/file-log-service.js +1 -2
- package/lib/device-path-provider.js +0 -1
- package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +0 -7
- package/lib/device-sockets/ios/notification.js +0 -3
- package/lib/device-sockets/ios/socket-request-executor.js +0 -3
- package/lib/helpers/android-bundle-validator-helper.js +1 -2
- package/lib/helpers/deploy-command-helper.js +0 -1
- package/lib/helpers/key-command-helper.js +2 -4
- package/lib/helpers/livesync-command-helper.js +1 -4
- package/lib/helpers/network-connectivity-validator.js +0 -1
- package/lib/helpers/options-track-helper.js +2 -3
- package/lib/helpers/package-path-helper.js +0 -1
- package/lib/helpers/platform-command-helper.js +2 -7
- package/lib/helpers/version-validator-helper.js +0 -1
- package/lib/key-commands/bootstrap.js +2 -3
- package/lib/key-commands/index.js +32 -26
- package/lib/nativescript-cli-lib-bootstrap.js +0 -4
- package/lib/nativescript-cli-lib.js +0 -1
- package/lib/nativescript-cli.js +1 -10
- package/lib/node/pbxproj-dom-xcode.js +0 -1
- package/lib/node/xcode.js +0 -1
- package/lib/node-package-manager.js +1 -11
- package/lib/options.js +119 -143
- package/lib/package-installation-manager.js +1 -8
- package/lib/package-manager.js +0 -2
- package/lib/platform-command-param.js +0 -1
- package/lib/pnpm-package-manager.js +1 -4
- package/lib/project-data.js +0 -12
- package/lib/providers/project-files-provider.js +0 -1
- package/lib/resolvers/livesync-service-resolver.js +0 -1
- package/lib/services/analytics/analytics-broker-process.js +6 -10
- package/lib/services/analytics/analytics-broker.js +1 -2
- package/lib/services/analytics/analytics-service.js +25 -29
- package/lib/services/analytics/google-analytics-provider.js +12 -13
- package/lib/services/analytics-settings-service.js +0 -5
- package/lib/services/android/android-bundle-tool-service.js +0 -1
- package/lib/services/android/gradle-build-args-service.js +0 -3
- package/lib/services/android/gradle-build-service.js +0 -1
- package/lib/services/android/gradle-command-service.js +0 -1
- package/lib/services/android-device-debug-service.js +0 -6
- package/lib/services/android-plugin-build-service.js +0 -29
- package/lib/services/android-project-service.js +4 -71
- package/lib/services/android-resources-migration-service.js +0 -7
- package/lib/services/apple-portal/apple-portal-application-service.js +1 -2
- package/lib/services/apple-portal/apple-portal-cookie-service.js +0 -1
- package/lib/services/apple-portal/apple-portal-session-service.js +42 -15
- package/lib/services/apple-portal/srp/srp-wrapper.js +76 -0
- package/lib/services/assets-generation/assets-generation-service.js +5 -16
- package/lib/services/build-artifacts-service.js +1 -2
- package/lib/services/build-data-service.js +0 -1
- package/lib/services/build-info-file-service.js +0 -1
- package/lib/services/cleanup-service.js +9 -13
- package/lib/services/cocoapods-platform-manager.js +0 -9
- package/lib/services/cocoapods-service.js +1 -21
- package/lib/services/debug-data-service.js +0 -1
- package/lib/services/debug-service-base.js +0 -7
- package/lib/services/device/device-install-app-service.js +1 -2
- package/lib/services/doctor-service.js +6 -21
- package/lib/services/extensibility-service.js +0 -8
- package/lib/services/files-hash-service.js +0 -1
- package/lib/services/hmr-status-service.js +0 -2
- package/lib/services/info-service.js +0 -1
- package/lib/services/initialize-service.js +1 -5
- package/lib/services/ios/export-options-plist-service.js +4 -6
- package/lib/services/ios/ios-signing-service.js +45 -27
- package/lib/services/ios/spm-service.js +0 -9
- package/lib/services/ios/xcodebuild-args-service.js +0 -9
- package/lib/services/ios/xcodebuild-command-service.js +0 -1
- package/lib/services/ios/xcodebuild-service.js +2 -1
- package/lib/services/ios-debugger-port-service.js +0 -1
- package/lib/services/ios-device-debug-service.js +0 -1
- package/lib/services/ios-entitlements-service.js +0 -1
- package/lib/services/ios-extensions-service.js +0 -1
- package/lib/services/ios-log-filter.js +0 -20
- package/lib/services/ios-native-target-service.js +4 -6
- package/lib/services/ios-project-service.js +2 -94
- package/lib/services/ios-provision-service.js +0 -3
- package/lib/services/ios-watch-app-service.js +0 -1
- package/lib/services/ip-service.js +0 -2
- package/lib/services/itmstransporter-service.js +0 -1
- package/lib/services/karma-execution.js +0 -2
- package/lib/services/livesync/android-device-livesync-service-base.js +0 -1
- package/lib/services/livesync/android-device-livesync-service.js +0 -2
- package/lib/services/livesync/android-device-livesync-sockets-service.js +0 -3
- package/lib/services/livesync/android-livesync-service.js +0 -1
- package/lib/services/livesync/android-livesync-tool.js +0 -4
- package/lib/services/livesync/device-livesync-service-base.js +0 -2
- package/lib/services/livesync/ios-device-livesync-service.js +0 -7
- package/lib/services/livesync/ios-livesync-service.js +0 -2
- package/lib/services/livesync/livesync-socket.js +0 -1
- package/lib/services/livesync/platform-livesync-service-base.js +0 -5
- package/lib/services/livesync-process-data-service.js +0 -1
- package/lib/services/log-parser-service.js +0 -1
- package/lib/services/log-source-map-service.js +0 -15
- package/lib/services/marking-mode-service.js +5 -8
- package/lib/services/metadata-filtering-service.js +0 -1
- package/lib/services/npm-config-service.js +0 -4
- package/lib/services/pacote-service.js +0 -7
- package/lib/services/performance-service.js +1 -3
- package/lib/services/platform/add-platform-service.js +2 -49
- package/lib/services/platform/platform-validation-service.js +0 -1
- package/lib/services/platform/prepare-native-platform-service.js +2 -5
- package/lib/services/platform-environment-requirements.js +3 -8
- package/lib/services/platform-project-service-base.js +0 -1
- package/lib/services/platforms-data-service.js +0 -1
- package/lib/services/plugins-service.js +2 -20
- package/lib/services/prepare-data-service.js +0 -1
- package/lib/services/project-backup-service.js +0 -4
- package/lib/services/project-changes-service.js +3 -14
- package/lib/services/project-cleanup-service.js +0 -2
- package/lib/services/project-config-service.js +2 -22
- package/lib/services/project-data-service.js +7 -36
- package/lib/services/project-name-service.js +0 -1
- package/lib/services/project-service.js +0 -10
- package/lib/services/project-templates-service.js +2 -3
- package/lib/services/qr-code-terminal-service.js +0 -1
- package/lib/services/require-service.js +0 -1
- package/lib/services/start-service.js +0 -1
- package/lib/services/temp-service.js +0 -1
- package/lib/services/terminal-spinner-service.js +0 -2
- package/lib/services/test-execution-service.js +2 -9
- package/lib/services/test-initialization-service.js +0 -4
- package/lib/services/timeline-profiler-service.js +0 -1
- package/lib/services/user-settings-service.js +0 -1
- package/lib/services/versions-service.js +4 -6
- package/lib/services/watch-ignore-list-service.js +0 -1
- package/lib/services/webpack/webpack-compiler-service.js +9 -44
- package/lib/services/xcconfig-service.js +0 -2
- package/lib/services/xcproj-service.js +0 -1
- package/lib/shared-event-bus.js +0 -6
- package/lib/sys-info.js +1 -2
- package/lib/tools/config-manipulation/config-transformer.js +0 -12
- package/lib/tools/node-modules/node-modules-builder.js +0 -1
- package/lib/tools/node-modules/node-modules-dependencies-builder.js +0 -6
- package/lib/yarn-package-manager.js +0 -1
- package/lib/yarn2-package-manager.js +0 -3
- 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"
|
|
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"],
|
|
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"
|
|
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
|
|
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
|
|
@@ -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
|
|
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
|
-
|
|
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;
|
|
222
|
+
data.noTrustedDevices;
|
|
194
223
|
const multiSMS = data.trustedPhoneNumbers &&
|
|
195
224
|
data.trustedPhoneNumbers.length !== 1 &&
|
|
196
|
-
data.noTrustedDevices;
|
|
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;
|
|
275
|
-
const byteIndex = position >> 3;
|
|
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"
|
|
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"
|
|
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"
|
|
131
|
+
case "blank":
|
|
132
132
|
image = this.generateImage(background, width, height, outputPath);
|
|
133
133
|
break;
|
|
134
|
-
case "resize"
|
|
134
|
+
case "resize":
|
|
135
135
|
image = yield this.resize(generationData.imagePath, width, height);
|
|
136
136
|
break;
|
|
137
|
-
case "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();
|
|
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
|
|
@@ -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"
|
|
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"
|
|
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"
|
|
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"
|
|
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"
|
|
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"
|
|
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"
|
|
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"
|
|
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"
|
|
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
|