Detect startup after recent crashes
This commit is contained in:
parent
02a732c511
commit
91f1b62bc7
23 changed files with 650 additions and 101 deletions
31
ts/scripts/unpack-crash-reports.ts
Normal file
31
ts/scripts/unpack-crash-reports.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import fs from 'fs/promises';
|
||||
import path from 'path';
|
||||
|
||||
import { SignalService as Proto } from '../protobuf';
|
||||
|
||||
async function main(fileName: string, outDir: string) {
|
||||
await fs.mkdir(outDir, { recursive: true });
|
||||
|
||||
const encoded = await fs.readFile(fileName);
|
||||
const { reports } = Proto.CrashReportList.decode(encoded);
|
||||
|
||||
await Promise.all(
|
||||
reports.map(async ({ filename, content }) => {
|
||||
if (!filename || !content) {
|
||||
return;
|
||||
}
|
||||
|
||||
const outFile = path.join(outDir, path.basename(filename));
|
||||
console.log(`Extracting to ${outFile}`);
|
||||
await fs.writeFile(outFile, content);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
main(process.argv[2], process.argv[3]).catch(error => {
|
||||
console.error(error.stack);
|
||||
process.exit(1);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue