Skip to content

Commit 1dad1f5

Browse files
authored
fix: regex to extract vault with keyringsMetadata (#82)
* fix: regex to extract keyringsMetadata * test: add fixture * update bundle * rename fixture
1 parent d805c67 commit 1dad1f5

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

app/lib.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function extractVaultFromFile (data) {
9191
{
9292
// attempt 5: chromium 0000056.log on MacOS
9393
// This variant is very similar to attempt 4 but there is the addition of a new metadata field, keyringsMetadata, in the vault.
94-
const matches = data.match(/"KeyringController":\{.*?"vault":"({.*})"},/);
94+
const matches = data.match(/"KeyringController":(\{.*?"vault":".*?=\\"\}"\})/);
9595
if (matches && matches.length) {
9696
try {
9797
const keyringControllerStateFragment = matches[1];

app/lib.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ const FIXTURES = [
4444
'slight escape bracket joy globe bring teach exact mango mansion injury category',
4545
passphrase: 'password',
4646
},
47+
{
48+
path: 'chromium-134-ubuntu/000003.log',
49+
mnemonic:
50+
'live pupil slab senior boy release lyrics shaft lazy renew potato simple',
51+
passphrase: 'correct horse battery staple',
52+
},
4753
]
4854

4955
const VAULTS = [

bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function extractVaultFromFile(data) {
9898
{
9999
// attempt 5: chromium 0000056.log on MacOS
100100
// This variant is very similar to attempt 4 but there is the addition of a new metadata field, keyringsMetadata, in the vault.
101-
var _matches3 = data.match(/"KeyringController":\{.*?"vault":"({.*})"},/);
101+
var _matches3 = data.match(/"KeyringController":(\{.*?"vault":".*?=\\"\}"\})/);
102102
if (_matches3 && _matches3.length) {
103103
try {
104104
var _keyringControllerStateFragment = _matches3[1];
1.89 MB
Binary file not shown.

0 commit comments

Comments
 (0)