@ledgerhq/live-cli 24.10.3-nightly.4 → 24.11.0-next.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/cli.js +63 -33
- package/lib/cli.js.map +1 -1
- package/lib/commands/blockchain/bot.js +7 -7
- package/lib/commands/blockchain/bot.js.map +1 -1
- package/lib/commands/blockchain/botPortfolio.js +26 -22
- package/lib/commands/blockchain/botPortfolio.js.map +1 -1
- package/lib/commands/blockchain/botTransfer.js +392 -219
- package/lib/commands/blockchain/botTransfer.js.map +1 -1
- package/lib/commands/blockchain/broadcast.js +42 -11
- package/lib/commands/blockchain/broadcast.js.map +1 -1
- package/lib/commands/blockchain/confirmOp.js +52 -12
- package/lib/commands/blockchain/confirmOp.js.map +1 -1
- package/lib/commands/blockchain/derivation.js +33 -31
- package/lib/commands/blockchain/derivation.js.map +1 -1
- package/lib/commands/blockchain/estimateMaxSpendable.js +56 -27
- package/lib/commands/blockchain/estimateMaxSpendable.js.map +1 -1
- package/lib/commands/blockchain/generateTestScanAccounts.js +37 -29
- package/lib/commands/blockchain/generateTestScanAccounts.js.map +1 -1
- package/lib/commands/blockchain/generateTestTransaction.js +96 -70
- package/lib/commands/blockchain/generateTestTransaction.js.map +1 -1
- package/lib/commands/blockchain/getAddress.js +24 -20
- package/lib/commands/blockchain/getAddress.js.map +1 -1
- package/lib/commands/blockchain/getTransactionStatus.js +69 -31
- package/lib/commands/blockchain/getTransactionStatus.js.map +1 -1
- package/lib/commands/blockchain/receive.js +42 -14
- package/lib/commands/blockchain/receive.js.map +1 -1
- package/lib/commands/blockchain/satstack.js +33 -30
- package/lib/commands/blockchain/satstack.js.map +1 -1
- package/lib/commands/blockchain/satstackStatus.js +5 -4
- package/lib/commands/blockchain/satstackStatus.js.map +1 -1
- package/lib/commands/blockchain/scanDescriptors.js +14 -8
- package/lib/commands/blockchain/scanDescriptors.js.map +1 -1
- package/lib/commands/blockchain/send.js +90 -61
- package/lib/commands/blockchain/send.js.map +1 -1
- package/lib/commands/blockchain/signMessage.d.ts +1 -1
- package/lib/commands/blockchain/signMessage.js +40 -15
- package/lib/commands/blockchain/signMessage.js.map +1 -1
- package/lib/commands/blockchain/sync.js +120 -27
- package/lib/commands/blockchain/sync.js.map +1 -1
- package/lib/commands/blockchain/testDetectOpCollision.js +48 -15
- package/lib/commands/blockchain/testDetectOpCollision.js.map +1 -1
- package/lib/commands/blockchain/testGetTrustedInputFromTxHash.js +86 -37
- package/lib/commands/blockchain/testGetTrustedInputFromTxHash.js.map +1 -1
- package/lib/commands/device/app.js +76 -42
- package/lib/commands/device/app.js.map +1 -1
- package/lib/commands/device/appUninstallAll.d.ts +1 -1
- package/lib/commands/device/appUninstallAll.js +29 -22
- package/lib/commands/device/appUninstallAll.js.map +1 -1
- package/lib/commands/device/appsCheckAllAppVersions.js +361 -208
- package/lib/commands/device/appsCheckAllAppVersions.js.map +1 -1
- package/lib/commands/device/appsInstallAll.js +24 -15
- package/lib/commands/device/appsInstallAll.js.map +1 -1
- package/lib/commands/device/appsUpdateTestAll.js +80 -69
- package/lib/commands/device/appsUpdateTestAll.js.map +1 -1
- package/lib/commands/device/cleanSpeculos.js +4 -4
- package/lib/commands/device/cleanSpeculos.js.map +1 -1
- package/lib/commands/device/customLockScreenFetch.js +84 -37
- package/lib/commands/device/customLockScreenFetch.js.map +1 -1
- package/lib/commands/device/customLockScreenFetchAndRestore.js +110 -46
- package/lib/commands/device/customLockScreenFetchAndRestore.js.map +1 -1
- package/lib/commands/device/customLockScreenFetchHash.js +7 -5
- package/lib/commands/device/customLockScreenFetchHash.js.map +1 -1
- package/lib/commands/device/customLockScreenLoad.js +72 -25
- package/lib/commands/device/customLockScreenLoad.js.map +1 -1
- package/lib/commands/device/customLockScreenRemove.js +7 -5
- package/lib/commands/device/customLockScreenRemove.js.map +1 -1
- package/lib/commands/device/devDeviceAppsScenario.js +65 -33
- package/lib/commands/device/devDeviceAppsScenario.js.map +1 -1
- package/lib/commands/device/deviceAppVersion.js +8 -5
- package/lib/commands/device/deviceAppVersion.js.map +1 -1
- package/lib/commands/device/deviceInfo.js +8 -5
- package/lib/commands/device/deviceInfo.js.map +1 -1
- package/lib/commands/device/deviceSDKFirmwareUpdate.js +68 -22
- package/lib/commands/device/deviceSDKFirmwareUpdate.js.map +1 -1
- package/lib/commands/device/deviceSDKGetBatteryStatuses.js +8 -7
- package/lib/commands/device/deviceSDKGetBatteryStatuses.js.map +1 -1
- package/lib/commands/device/deviceSDKGetDeviceInfo.js +7 -6
- package/lib/commands/device/deviceSDKGetDeviceInfo.js.map +1 -1
- package/lib/commands/device/deviceSDKToggleOnboardingEarlyCheck.js +9 -8
- package/lib/commands/device/deviceSDKToggleOnboardingEarlyCheck.js.map +1 -1
- package/lib/commands/device/deviceVersion.js +8 -5
- package/lib/commands/device/deviceVersion.js.map +1 -1
- package/lib/commands/device/discoverDevices.js +50 -15
- package/lib/commands/device/discoverDevices.js.map +1 -1
- package/lib/commands/device/firmwareRepair.js +6 -3
- package/lib/commands/device/firmwareRepair.js.map +1 -1
- package/lib/commands/device/firmwareUpdate.js +123 -63
- package/lib/commands/device/firmwareUpdate.js.map +1 -1
- package/lib/commands/device/genuineCheck.js +12 -7
- package/lib/commands/device/genuineCheck.js.map +1 -1
- package/lib/commands/device/getBatteryStatus.js +9 -5
- package/lib/commands/device/getBatteryStatus.js.map +1 -1
- package/lib/commands/device/getDeviceRunningMode.js +10 -7
- package/lib/commands/device/getDeviceRunningMode.js.map +1 -1
- package/lib/commands/device/i18n.js +79 -27
- package/lib/commands/device/i18n.js.map +1 -1
- package/lib/commands/device/listApps.d.ts +1 -1
- package/lib/commands/device/listApps.js +12 -7
- package/lib/commands/device/listApps.js.map +1 -1
- package/lib/commands/device/managerListApps.js +28 -21
- package/lib/commands/device/managerListApps.js.map +1 -1
- package/lib/commands/device/proxy.js +350 -242
- package/lib/commands/device/proxy.js.map +1 -1
- package/lib/commands/device/reinstallConfigurationConsent.js +126 -36
- package/lib/commands/device/reinstallConfigurationConsent.js.map +1 -1
- package/lib/commands/device/repl.js +10 -5
- package/lib/commands/device/repl.js.map +1 -1
- package/lib/commands/device/speculosList.js +58 -12
- package/lib/commands/device/speculosList.js.map +1 -1
- package/lib/commands/live/balanceHistory.js +79 -44
- package/lib/commands/live/balanceHistory.js.map +1 -1
- package/lib/commands/live/countervalues.js +207 -111
- package/lib/commands/live/countervalues.js.map +1 -1
- package/lib/commands/live/envs.js +6 -4
- package/lib/commands/live/envs.js.map +1 -1
- package/lib/commands/live/exportAccounts.js +56 -30
- package/lib/commands/live/exportAccounts.js.map +1 -1
- package/lib/commands/live/ledgerKeyRingProtocol.d.ts +1 -1
- package/lib/commands/live/ledgerKeyRingProtocol.js +103 -63
- package/lib/commands/live/ledgerKeyRingProtocol.js.map +1 -1
- package/lib/commands/live/ledgerSync.js +60 -20
- package/lib/commands/live/ledgerSync.js.map +1 -1
- package/lib/commands/live/liveData.js +60 -34
- package/lib/commands/live/liveData.js.map +1 -1
- package/lib/commands/live/portfolio.js +98 -68
- package/lib/commands/live/portfolio.js.map +1 -1
- package/lib/commands/live/synchronousOnboarding.js +9 -6
- package/lib/commands/live/synchronousOnboarding.js.map +1 -1
- package/lib/commands/live/user.js +4 -4
- package/lib/commands/live/user.js.map +1 -1
- package/lib/commands/live/version.js +4 -2
- package/lib/commands/live/version.js.map +1 -1
- package/lib/commands/ptx/swap.js +282 -194
- package/lib/commands/ptx/swap.js.map +1 -1
- package/lib/commands-index.d.ts +9 -9
- package/lib/commands-index.js +64 -64
- package/lib/commands-index.js.map +1 -1
- package/lib/live-common-setup-base.js +48 -26
- package/lib/live-common-setup-base.js.map +1 -1
- package/lib/live-common-setup.js +123 -66
- package/lib/live-common-setup.js.map +1 -1
- package/lib/qr.js +10 -6
- package/lib/qr.js.map +1 -1
- package/lib/scan.js +92 -84
- package/lib/scan.js.map +1 -1
- package/lib/signedOperation.js +6 -6
- package/lib/signedOperation.js.map +1 -1
- package/lib/stream.js +68 -57
- package/lib/stream.js.map +1 -1
- package/lib/transaction.js +142 -60
- package/lib/transaction.js.map +1 -1
- package/package.json +9 -9
|
@@ -22,58 +22,122 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
+
function step(op) {
|
|
39
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
+
switch (op[0]) {
|
|
44
|
+
case 0: case 1: t = op; break;
|
|
45
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
+
default:
|
|
49
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
+
if (t[2]) _.ops.pop();
|
|
54
|
+
_.trys.pop(); continue;
|
|
55
|
+
}
|
|
56
|
+
op = body.call(thisArg, _);
|
|
57
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
+
}
|
|
60
|
+
};
|
|
25
61
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
62
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
63
|
};
|
|
28
64
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
65
|
/* eslint-disable no-console */
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
66
|
+
var rxjs_1 = require("rxjs");
|
|
67
|
+
var fs_1 = __importDefault(require("fs"));
|
|
68
|
+
var scan_1 = require("../../scan");
|
|
69
|
+
var customLockScreenFetchHash_1 = __importDefault(require("@ledgerhq/live-common/hw/customLockScreenFetchHash"));
|
|
70
|
+
var customLockScreenLoad_1 = __importStar(require("@ledgerhq/live-common/hw/customLockScreenLoad"));
|
|
71
|
+
var deviceAccess_1 = require("@ledgerhq/live-common/hw/deviceAccess");
|
|
72
|
+
var crypto_1 = __importDefault(require("crypto"));
|
|
73
|
+
var isCustomLockScreenSupported_1 = require("@ledgerhq/live-common/device/use-cases/isCustomLockScreenSupported");
|
|
74
|
+
var screenSpecs_1 = require("@ledgerhq/live-common/device/use-cases/screenSpecs");
|
|
75
|
+
var exec = function (opts) { return __awaiter(void 0, void 0, void 0, function () {
|
|
76
|
+
var fileInput, _a, deviceId, deviceModelId, clsSupportedDeviceModelId, hexImageWithoutHeader, hexImage;
|
|
77
|
+
return __generator(this, function (_b) {
|
|
78
|
+
switch (_b.label) {
|
|
79
|
+
case 0:
|
|
80
|
+
fileInput = opts.fileInput, _a = opts.device, deviceId = _a === void 0 ? "" : _a, deviceModelId = opts.deviceModelId;
|
|
81
|
+
if (!(0, isCustomLockScreenSupported_1.isCustomLockScreenSupported)(deviceModelId)) {
|
|
82
|
+
console.error("This device model does not support custom lock screen");
|
|
83
|
+
return [2 /*return*/];
|
|
84
|
+
}
|
|
85
|
+
clsSupportedDeviceModelId = deviceModelId;
|
|
86
|
+
hexImageWithoutHeader = fs_1.default.readFileSync(fileInput, "utf-8");
|
|
87
|
+
return [4 /*yield*/, (0, customLockScreenLoad_1.generateCustomLockScreenImageFormat)(hexImageWithoutHeader, true, true, (0, screenSpecs_1.getScreenSpecs)(clsSupportedDeviceModelId))];
|
|
88
|
+
case 1:
|
|
89
|
+
hexImage = _b.sent();
|
|
90
|
+
// TODO: rework without double resolving promise
|
|
91
|
+
// eslint-disable-next-line
|
|
92
|
+
return [4 /*yield*/, new Promise(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
93
|
+
var hash, currentHash;
|
|
94
|
+
return __generator(this, function (_a) {
|
|
95
|
+
switch (_a.label) {
|
|
96
|
+
case 0:
|
|
97
|
+
hash = crypto_1.default.createHash("sha256").update(hexImage).digest("hex");
|
|
98
|
+
console.log("Computing hash for input file");
|
|
99
|
+
console.log(hash);
|
|
100
|
+
console.log("Extracting hash from device");
|
|
101
|
+
return [4 /*yield*/, (0, rxjs_1.firstValueFrom)((0, deviceAccess_1.withDevice)(deviceId)(function (t) { return (0, rxjs_1.from)((0, customLockScreenFetchHash_1.default)(t)); }))];
|
|
102
|
+
case 1:
|
|
103
|
+
currentHash = _a.sent();
|
|
104
|
+
if (currentHash === hash) {
|
|
105
|
+
console.log("Hashes match, skip backup step because we can use the one we have");
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
console.log("Hashes don't match, fetch image before updating");
|
|
109
|
+
}
|
|
110
|
+
console.log("Delete the current image (simulate the wipe from fw update)");
|
|
111
|
+
return [4 /*yield*/, (0, rxjs_1.firstValueFrom)((0, deviceAccess_1.withDevice)(deviceId)(function (t) { return (0, rxjs_1.from)(t.exchange(Buffer.from("e063000000", "hex"))); }))];
|
|
112
|
+
case 2:
|
|
113
|
+
_a.sent();
|
|
114
|
+
console.log("Restoring the image we backedup");
|
|
115
|
+
return [4 /*yield*/, new Promise(function (resolve) {
|
|
116
|
+
return (0, customLockScreenLoad_1.default)({
|
|
117
|
+
deviceId: deviceId,
|
|
118
|
+
request: { hexImage: hexImageWithoutHeader, deviceModelId: clsSupportedDeviceModelId },
|
|
119
|
+
}).subscribe(function (x) { return console.log(x); }, function (e) {
|
|
120
|
+
console.error(e);
|
|
121
|
+
resolve();
|
|
122
|
+
}, function () {
|
|
123
|
+
console.log("Image loaded.");
|
|
124
|
+
resolve();
|
|
125
|
+
});
|
|
126
|
+
})];
|
|
127
|
+
case 3:
|
|
128
|
+
_a.sent();
|
|
129
|
+
return [2 /*return*/];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}); })];
|
|
133
|
+
case 2:
|
|
134
|
+
// TODO: rework without double resolving promise
|
|
135
|
+
// eslint-disable-next-line
|
|
136
|
+
_b.sent();
|
|
137
|
+
return [2 /*return*/];
|
|
61
138
|
}
|
|
62
|
-
console.log("Delete the current image (simulate the wipe from fw update)");
|
|
63
|
-
await (0, rxjs_1.firstValueFrom)((0, deviceAccess_1.withDevice)(deviceId)(t => (0, rxjs_1.from)(t.exchange(Buffer.from("e063000000", "hex")))));
|
|
64
|
-
console.log("Restoring the image we backedup");
|
|
65
|
-
await new Promise(resolve => (0, customLockScreenLoad_1.default)({
|
|
66
|
-
deviceId,
|
|
67
|
-
request: { hexImage: hexImageWithoutHeader, deviceModelId: clsSupportedDeviceModelId },
|
|
68
|
-
}).subscribe(x => console.log(x), e => {
|
|
69
|
-
console.error(e);
|
|
70
|
-
resolve();
|
|
71
|
-
}, () => {
|
|
72
|
-
console.log(`Image loaded.`);
|
|
73
|
-
resolve();
|
|
74
|
-
}));
|
|
75
139
|
});
|
|
76
|
-
};
|
|
140
|
+
}); };
|
|
77
141
|
exports.default = {
|
|
78
142
|
description: "Conditionally backup, delete, and restore a custom lock screen picture",
|
|
79
143
|
args: [
|
|
@@ -90,6 +154,6 @@ exports.default = {
|
|
|
90
154
|
desc: "The device model id to use",
|
|
91
155
|
},
|
|
92
156
|
],
|
|
93
|
-
job: (opts)
|
|
157
|
+
job: function (opts) { return (0, rxjs_1.from)(exec(opts)); },
|
|
94
158
|
};
|
|
95
159
|
//# sourceMappingURL=customLockScreenFetchAndRestore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customLockScreenFetchAndRestore.js","sourceRoot":"","sources":["../../../src/commands/device/customLockScreenFetchAndRestore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"customLockScreenFetchAndRestore.js","sourceRoot":"","sources":["../../../src/commands/device/customLockScreenFetchAndRestore.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;KACJ,CAAC;AAEF,kBAAe;IACb,WAAW,EAAE,wEAAwE;IACrF,IAAI,EAAE;QACJ,gBAAS;QACT;YACE,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,8FAA8F;SACrG;QACD;YACE,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,4BAA4B;SACnC;KACF;IACD,GAAG,EAAE,UAAC,IAA4C,IAAU,OAAA,IAAA,WAAI,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAhB,CAAgB;CAC7E,CAAC"}
|
|
@@ -4,13 +4,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
/* eslint-disable no-console */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
var rxjs_1 = require("rxjs");
|
|
8
|
+
var scan_1 = require("../../scan");
|
|
9
|
+
var customLockScreenFetchHash_1 = __importDefault(require("@ledgerhq/live-common/hw/customLockScreenFetchHash"));
|
|
10
|
+
var deviceAccess_1 = require("@ledgerhq/live-common/hw/deviceAccess");
|
|
11
11
|
exports.default = {
|
|
12
12
|
description: "Fetch the hash of the custom lock screen",
|
|
13
13
|
args: [scan_1.deviceOpt],
|
|
14
|
-
job:
|
|
14
|
+
job: function (arg) {
|
|
15
|
+
return (0, deviceAccess_1.withDevice)(arg.device || "")(function (t) { return (0, rxjs_1.from)((0, customLockScreenFetchHash_1.default)(t)); });
|
|
16
|
+
},
|
|
15
17
|
};
|
|
16
18
|
//# sourceMappingURL=customLockScreenFetchHash.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customLockScreenFetchHash.js","sourceRoot":"","sources":["../../../src/commands/device/customLockScreenFetchHash.ts"],"names":[],"mappings":";;;;;AAAA,+BAA+B;AAC/B
|
|
1
|
+
{"version":3,"file":"customLockScreenFetchHash.js","sourceRoot":"","sources":["../../../src/commands/device/customLockScreenFetchHash.ts"],"names":[],"mappings":";;;;;AAAA,+BAA+B;AAC/B,6BAA4B;AAE5B,mCAAuC;AACvC,iHAA2F;AAC3F,sEAAmE;AAInE,kBAAe;IACb,WAAW,EAAE,0CAA0C;IACvD,IAAI,EAAE,CAAC,gBAAS,CAAC;IACjB,GAAG,EAAE,UAAC,GAAqC;QACzC,OAAA,IAAA,yBAAU,EAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,UAAA,CAAC,IAAI,OAAA,IAAA,WAAI,EAAC,IAAA,mCAAyB,EAAC,CAAC,CAAC,CAAC,EAAlC,CAAkC,CAAC;IAArE,CAAqE;CACxE,CAAC"}
|
|
@@ -1,32 +1,79 @@
|
|
|
1
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
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
2
38
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
40
|
};
|
|
5
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
42
|
+
var rxjs_1 = require("rxjs");
|
|
43
|
+
var fs_1 = __importDefault(require("fs"));
|
|
44
|
+
var customLockScreenLoad_1 = __importDefault(require("@ledgerhq/live-common/hw/customLockScreenLoad"));
|
|
45
|
+
var scan_1 = require("../../scan");
|
|
46
|
+
var isCustomLockScreenSupported_1 = require("@ledgerhq/live-common/device/use-cases/isCustomLockScreenSupported");
|
|
47
|
+
var exec = function (opts) { return __awaiter(void 0, void 0, void 0, function () {
|
|
48
|
+
var fileInput, _a, deviceId, deviceModelId, clsSupportedDeviceModelId, hexImage;
|
|
49
|
+
return __generator(this, function (_b) {
|
|
50
|
+
switch (_b.label) {
|
|
51
|
+
case 0:
|
|
52
|
+
fileInput = opts.fileInput, _a = opts.device, deviceId = _a === void 0 ? "" : _a, deviceModelId = opts.deviceModelId;
|
|
53
|
+
if (!(0, isCustomLockScreenSupported_1.isCustomLockScreenSupported)(deviceModelId)) {
|
|
54
|
+
console.error("This device model does not support custom lock screen");
|
|
55
|
+
return [2 /*return*/];
|
|
56
|
+
}
|
|
57
|
+
clsSupportedDeviceModelId = deviceModelId;
|
|
58
|
+
hexImage = fs_1.default.readFileSync(fileInput, "utf-8");
|
|
59
|
+
return [4 /*yield*/, new Promise(function (resolve) {
|
|
60
|
+
return (0, customLockScreenLoad_1.default)({
|
|
61
|
+
deviceId: deviceId,
|
|
62
|
+
request: { hexImage: hexImage, deviceModelId: clsSupportedDeviceModelId },
|
|
63
|
+
}).subscribe(function (x) { return console.log(x); }, function (e) {
|
|
64
|
+
console.error(e);
|
|
65
|
+
resolve();
|
|
66
|
+
}, function () {
|
|
67
|
+
console.log("Image loaded.");
|
|
68
|
+
resolve();
|
|
69
|
+
});
|
|
70
|
+
})];
|
|
71
|
+
case 1:
|
|
72
|
+
_b.sent();
|
|
73
|
+
return [2 /*return*/];
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}); };
|
|
30
77
|
exports.default = {
|
|
31
78
|
description: "Test lock screen customization by loading an image",
|
|
32
79
|
args: [
|
|
@@ -43,6 +90,6 @@ exports.default = {
|
|
|
43
90
|
desc: "The device model id to use",
|
|
44
91
|
},
|
|
45
92
|
],
|
|
46
|
-
job: (opts)
|
|
93
|
+
job: function (opts) { return (0, rxjs_1.from)(exec(opts)); },
|
|
47
94
|
};
|
|
48
95
|
//# sourceMappingURL=customLockScreenLoad.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customLockScreenLoad.js","sourceRoot":"","sources":["../../../src/commands/device/customLockScreenLoad.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"customLockScreenLoad.js","sourceRoot":"","sources":["../../../src/commands/device/customLockScreenLoad.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA4B;AAC5B,0CAAoB;AAEpB,uGAAiF;AACjF,mCAAuC;AACvC,kHAG4E;AAQ5E,IAAM,IAAI,GAAG,UAAO,IAAiC;;;;;gBAC3C,SAAS,GAA2C,IAAI,UAA/C,EAAE,KAAyC,IAAI,OAAxB,EAAb,QAAQ,mBAAG,EAAE,KAAA,EAAE,aAAa,GAAK,IAAI,cAAT,CAAU;gBACjE,IAAI,CAAC,IAAA,yDAA2B,EAAC,aAA8B,CAAC,EAAE,CAAC;oBACjE,OAAO,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAC;oBACvE,sBAAO;gBACT,CAAC;gBACK,yBAAyB,GAAG,aAA0C,CAAC;gBACvE,QAAQ,GAAG,YAAE,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;gBAErD,qBAAM,IAAI,OAAO,CAAO,UAAA,OAAO;wBAC7B,OAAA,IAAA,8BAAoB,EAAC;4BACnB,QAAQ,UAAA;4BACR,OAAO,EAAE,EAAE,QAAQ,UAAA,EAAE,aAAa,EAAE,yBAAyB,EAAE;yBAChE,CAAC,CAAC,SAAS,CACV,UAAA,CAAC,IAAI,OAAA,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAd,CAAc,EACnB,UAAA,CAAC;4BACC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;4BACjB,OAAO,EAAE,CAAC;wBACZ,CAAC,EACD;4BACE,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;4BAC7B,OAAO,EAAE,CAAC;wBACZ,CAAC,CACF;oBAbD,CAaC,CACF,EAAA;;gBAfD,SAeC,CAAC;;;;KACH,CAAC;AAEF,kBAAe;IACb,WAAW,EAAE,oDAAoD;IACjE,IAAI,EAAE;QACJ,gBAAS;QACT;YACE,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,0FAA0F;SACjG;QACD;YACE,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,4BAA4B;SACnC;KACF;IACD,GAAG,EAAE,UAAC,IAAiC,IAAU,OAAA,IAAA,WAAI,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAhB,CAAgB;CAClE,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
var rxjs_1 = require("rxjs");
|
|
4
|
+
var customLockScreenRemove_1 = require("@ledgerhq/live-common/hw/customLockScreenRemove");
|
|
5
|
+
var scan_1 = require("../../scan");
|
|
6
|
+
var deviceAccess_1 = require("@ledgerhq/live-common/hw/deviceAccess");
|
|
7
7
|
exports.default = {
|
|
8
8
|
description: "Remove custom lock screen",
|
|
9
9
|
args: [scan_1.deviceOpt],
|
|
10
|
-
job:
|
|
10
|
+
job: function (arg) {
|
|
11
|
+
return (0, deviceAccess_1.withDevice)((arg === null || arg === void 0 ? void 0 : arg.device) || "")(function (t) { return (0, rxjs_1.from)((0, customLockScreenRemove_1.command)(t)); });
|
|
12
|
+
},
|
|
11
13
|
};
|
|
12
14
|
//# sourceMappingURL=customLockScreenRemove.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customLockScreenRemove.js","sourceRoot":"","sources":["../../../src/commands/device/customLockScreenRemove.ts"],"names":[],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"customLockScreenRemove.js","sourceRoot":"","sources":["../../../src/commands/device/customLockScreenRemove.ts"],"names":[],"mappings":";;AAAA,6BAA4B;AAE5B,0FAAoG;AACpG,mCAAuC;AACvC,sEAAmE;AAInE,kBAAe;IACb,WAAW,EAAE,2BAA2B;IACxC,IAAI,EAAE,CAAC,gBAAS,CAAC;IACjB,GAAG,EAAE,UAAC,GAAkC;QACtC,OAAA,IAAA,yBAAU,EAAC,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,KAAI,EAAE,CAAC,CAAC,UAAA,CAAC,IAAI,OAAA,IAAA,WAAI,EAAC,IAAA,gCAAsB,EAAC,CAAC,CAAC,CAAC,EAA/B,CAA+B,CAAC;IAAnE,CAAmE;CACtE,CAAC"}
|
|
@@ -1,40 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
18
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
19
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
20
|
+
if (ar || !(i in from)) {
|
|
21
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
22
|
+
ar[i] = from[i];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
26
|
+
};
|
|
2
27
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
28
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
29
|
};
|
|
5
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
31
|
+
var rxjs_1 = require("rxjs");
|
|
32
|
+
var operators_1 = require("rxjs/operators");
|
|
33
|
+
var deviceAccess_1 = require("@ledgerhq/live-common/hw/deviceAccess");
|
|
34
|
+
var getDeviceInfo_1 = __importDefault(require("@ledgerhq/live-common/hw/getDeviceInfo"));
|
|
35
|
+
var index_1 = require("@ledgerhq/live-common/apps/index");
|
|
36
|
+
var api_1 = __importDefault(require("@ledgerhq/live-common/manager/api"));
|
|
37
|
+
var listAppsUseCase_1 = require("@ledgerhq/live-common/device/use-cases/listAppsUseCase");
|
|
38
|
+
var execWithTransport_1 = require("@ledgerhq/live-common/device/use-cases/execWithTransport");
|
|
39
|
+
var installApp_1 = __importDefault(require("@ledgerhq/live-common/hw/installApp"));
|
|
40
|
+
var scan_1 = require("../../scan");
|
|
16
41
|
// how to add a scenario:
|
|
17
42
|
// wget https://manager.api.live.ledger.com/api/applications
|
|
18
43
|
// then find in that json the apps you are looking for (with a provider 1)
|
|
19
44
|
// with JS: obj.flatMap(a => a.application_versions).filter(a => a.version==="1.3.16" && a.providers.includes(1))
|
|
20
45
|
// array of applicationversion ids
|
|
21
|
-
|
|
46
|
+
var scenarios = {
|
|
22
47
|
"nanos160-outdated-apps": [1679, 222, 2783, 3295, 3305],
|
|
23
48
|
"nanos160-outdated-bitcoin-apps": [
|
|
24
49
|
3295, 3305, 3319, 3325, 3302, 3324, 3298, 3297, 3318, 3309, 3322, 3304, 3296, 3308, 3299, 3300,
|
|
25
50
|
3312, 3303, 3301, 3315, 3314, 3323,
|
|
26
51
|
],
|
|
27
52
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
apps.forEach(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
53
|
+
var scenariosValues = Object.keys(scenarios).join(" | ");
|
|
54
|
+
var installScenario = function (apps, transport, deviceInfo, scene) {
|
|
55
|
+
var appVersionsPerId = {};
|
|
56
|
+
apps.forEach(function (a) {
|
|
57
|
+
return a.application_versions.forEach(function (av) {
|
|
58
|
+
appVersionsPerId[av.id] = av;
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
return rxjs_1.concat.apply(void 0, __spreadArray([], __read(scene
|
|
62
|
+
.map(function (id) { return appVersionsPerId[id]; })
|
|
36
63
|
.filter(Boolean)
|
|
37
|
-
.map(app
|
|
64
|
+
.map(function (app) { return (0, rxjs_1.defer)(function () { return (0, installApp_1.default)(transport, deviceInfo.targetId, app); }); })), false));
|
|
38
65
|
};
|
|
39
66
|
exports.default = {
|
|
40
67
|
description: "dev feature to enter into a specific device apps scenario",
|
|
@@ -47,18 +74,23 @@ exports.default = {
|
|
|
47
74
|
desc: scenariosValues,
|
|
48
75
|
},
|
|
49
76
|
],
|
|
50
|
-
job:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
77
|
+
job: function (_a) {
|
|
78
|
+
var device = _a.device, scenario = _a.scenario;
|
|
79
|
+
return (0, deviceAccess_1.withDevice)(device || "")(function (t) {
|
|
80
|
+
var scene = scenarios[scenario || ""];
|
|
81
|
+
if (!scene)
|
|
82
|
+
throw new Error("scenario is not found. available --scenario are: " + scenariosValues);
|
|
83
|
+
var exec = (0, execWithTransport_1.execWithTransport)(t);
|
|
84
|
+
// $FlowFixMe
|
|
85
|
+
return (0, rxjs_1.from)((0, getDeviceInfo_1.default)(t)).pipe((0, operators_1.mergeMap)(function (deviceInfo) {
|
|
86
|
+
return (0, listAppsUseCase_1.listAppsUseCase)(t, deviceInfo).pipe((0, operators_1.filter)(function (e) { return e.type === "result"; }), (0, operators_1.map)(function (e) { return e.result; }), (0, operators_1.mergeMap)(function (listAppsResult) {
|
|
87
|
+
var s = (0, index_1.reducer)((0, index_1.initState)(listAppsResult), {
|
|
88
|
+
type: "wipe",
|
|
89
|
+
});
|
|
90
|
+
return (0, rxjs_1.concat)((0, index_1.runAll)(s, exec).pipe((0, operators_1.ignoreElements)()), (0, rxjs_1.from)(api_1.default.listApps()));
|
|
91
|
+
}), (0, operators_1.mergeMap)(function (apps) { return installScenario(apps, t, deviceInfo, scene); }));
|
|
92
|
+
}));
|
|
93
|
+
});
|
|
94
|
+
},
|
|
63
95
|
};
|
|
64
96
|
//# sourceMappingURL=devDeviceAppsScenario.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devDeviceAppsScenario.js","sourceRoot":"","sources":["../../../src/commands/device/devDeviceAppsScenario.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"devDeviceAppsScenario.js","sourceRoot":"","sources":["../../../src/commands/device/devDeviceAppsScenario.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAAuD;AACvD,4CAAuE;AACvE,sEAAmE;AACn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OAAO,IAAA,aAAM,EAAC,IAAA,cAAM,EAAC,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,IAAA,0BAAc,GAAE,CAAC,EAAE,IAAA,WAAI,EAAC,aAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;gBACrF,CAAC,CAAC,EACF,IAAA,oBAAQ,EAAC,UAAA,IAAI,IAAI,OAAA,eAAe,CAAC,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,EAA3C,CAA2C,CAAC,CAC9D;YAVD,CAUC,CACF,CACF,CAAC;QACJ,CAAC,CAAC;IArBF,CAqBE;CACL,CAAC"}
|
|
@@ -3,12 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
var rxjs_1 = require("rxjs");
|
|
7
|
+
var deviceAccess_1 = require("@ledgerhq/live-common/hw/deviceAccess");
|
|
8
|
+
var getAppAndVersion_1 = __importDefault(require("@ledgerhq/live-common/hw/getAppAndVersion"));
|
|
9
|
+
var scan_1 = require("../../scan");
|
|
10
10
|
exports.default = {
|
|
11
11
|
args: [scan_1.deviceOpt],
|
|
12
|
-
job:
|
|
12
|
+
job: function (_a) {
|
|
13
|
+
var device = _a.device;
|
|
14
|
+
return (0, deviceAccess_1.withDevice)(device || "")(function (t) { return (0, rxjs_1.from)((0, getAppAndVersion_1.default)(t)); });
|
|
15
|
+
},
|
|
13
16
|
};
|
|
14
17
|
//# sourceMappingURL=deviceAppVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceAppVersion.js","sourceRoot":"","sources":["../../../src/commands/device/deviceAppVersion.ts"],"names":[],"mappings":";;;;;AAAA
|
|
1
|
+
{"version":3,"file":"deviceAppVersion.js","sourceRoot":"","sources":["../../../src/commands/device/deviceAppVersion.ts"],"names":[],"mappings":";;;;;AAAA,6BAA4B;AAC5B,sEAAmE;AACnE,+FAAyE;AACzE,mCAAyD;AAIzD,kBAAe;IACb,IAAI,EAAE,CAAC,gBAAS,CAAC;IACjB,GAAG,EAAE,UAAC,EAAmC;YAAjC,MAAM,YAAA;QACZ,OAAA,IAAA,yBAAU,EAAC,MAAM,IAAI,EAAE,CAAC,CAAC,UAAA,CAAC,IAAI,OAAA,IAAA,WAAI,EAAC,IAAA,0BAAgB,EAAC,CAAC,CAAC,CAAC,EAAzB,CAAyB,CAAC;IAAxD,CAAwD;CAC3D,CAAC"}
|
|
@@ -3,12 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
var rxjs_1 = require("rxjs");
|
|
7
|
+
var deviceAccess_1 = require("@ledgerhq/live-common/hw/deviceAccess");
|
|
8
|
+
var getDeviceInfo_1 = __importDefault(require("@ledgerhq/live-common/hw/getDeviceInfo"));
|
|
9
|
+
var scan_1 = require("../../scan");
|
|
10
10
|
exports.default = {
|
|
11
11
|
args: [scan_1.deviceOpt],
|
|
12
|
-
job:
|
|
12
|
+
job: function (_a) {
|
|
13
|
+
var device = _a.device;
|
|
14
|
+
return (0, deviceAccess_1.withDevice)(device || "")(function (t) { return (0, rxjs_1.from)((0, getDeviceInfo_1.default)(t)); });
|
|
15
|
+
},
|
|
13
16
|
};
|
|
14
17
|
//# sourceMappingURL=deviceInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceInfo.js","sourceRoot":"","sources":["../../../src/commands/device/deviceInfo.ts"],"names":[],"mappings":";;;;;AAAA
|
|
1
|
+
{"version":3,"file":"deviceInfo.js","sourceRoot":"","sources":["../../../src/commands/device/deviceInfo.ts"],"names":[],"mappings":";;;;;AAAA,6BAA4B;AAC5B,sEAAmE;AACnE,yFAAmE;AACnE,mCAAyD;AAIzD,kBAAe;IACb,IAAI,EAAE,CAAC,gBAAS,CAAC;IACjB,GAAG,EAAE,UAAC,EAA6B;YAA3B,MAAM,YAAA;QAA0B,OAAA,IAAA,yBAAU,EAAC,MAAM,IAAI,EAAE,CAAC,CAAC,UAAA,CAAC,IAAI,OAAA,IAAA,WAAI,EAAC,IAAA,uBAAa,EAAC,CAAC,CAAC,CAAC,EAAtB,CAAsB,CAAC;IAArD,CAAqD;CAC9F,CAAC"}
|