From ff2b99cd896e7aa7757abc7a131bf27ecd86807f Mon Sep 17 00:00:00 2001 From: lishutong Date: Wed, 28 Jul 2021 20:01:19 +0000 Subject: [PATCH] Fix a compatibility issue: getBigUint64. The method getBigUint64 is not supported by safari until version 15: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getBigUint64 This CL mannual reload this method. Test: Mannual tested. Change-Id: I1d967eda93f9f628fb7f0f5d9f90efb92429ed5e --- tools/ota_analysis/src/services/payload.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/ota_analysis/src/services/payload.js b/tools/ota_analysis/src/services/payload.js index 489f2bca1..62c5283a3 100644 --- a/tools/ota_analysis/src/services/payload.js +++ b/tools/ota_analysis/src/services/payload.js @@ -78,6 +78,15 @@ export class Payload { readInt(size) { let /** DataView */ view = new DataView( this.buffer.slice(this.cursor, this.cursor + size)) + if (typeof view.getBigUint64 !== "function") { + view.getBigUint64 = + function(offset) { + const a = BigInt(view.getUint32(offset)) + const b = BigInt(view.getUint32(offset + 4)) + const bigNumber = a * 4294967296n + b + return bigNumber + } + } this.cursor += size switch (size) { case 2: