v1.4 rel #10
@ -32,11 +32,10 @@ Then press OK, all selected records from Google Authenticator will appear on pag
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
### If you use Proton Authenticator
|
### If you use Proton Authenticator
|
||||||
|
|
||||||
To add 2FA TOTP records from Proton Authenticator you must go to settings and press "Export":
|
To add 2FA TOTP records from Proton Authenticator you must go to settings and press "Export":
|
||||||

|

|
||||||
|
|
||||||
After this save file and open it on text editor:
|
After this save file and open it on text editor:
|
||||||
|
|
||||||
@ -52,4 +51,4 @@ Copy all stuff from file at clipboard and import in application:
|
|||||||
|
|
||||||
Then press OK, records will appear on page:
|
Then press OK, records will appear on page:
|
||||||
|
|
||||||

|

|
||||||
|
@ -11,7 +11,7 @@ export const colors = {
|
|||||||
export const content = {
|
export const content = {
|
||||||
addTotpsHint:
|
addTotpsHint:
|
||||||
"For add a 2FA TOTP record you must have otpauth:// link otpauth-migration://" +
|
"For add a 2FA TOTP record you must have otpauth:// link otpauth-migration://" +
|
||||||
"link from Google Authenticator Migration QR-Code or Proton authenticator Export JSON string." +
|
"link from Google Authenticator Migration QR-Code or Proton authenticator Export JSON string." +
|
||||||
"If you have a questions - check instruction below!",
|
"If you have a questions - check instruction below!",
|
||||||
totpRecordsHint: "TOTP records:",
|
totpRecordsHint: "TOTP records:",
|
||||||
createButton: {
|
createButton: {
|
||||||
@ -29,10 +29,10 @@ export const content = {
|
|||||||
renameButtons: {
|
renameButtons: {
|
||||||
rename: "Rename",
|
rename: "Rename",
|
||||||
renameIssuer: "Rename Issuer",
|
renameIssuer: "Rename Issuer",
|
||||||
renameClient: "Rename Client"
|
renameClient: "Rename Client",
|
||||||
},
|
},
|
||||||
saveButton: {
|
saveButton: {
|
||||||
label: "Save"
|
label: "Save",
|
||||||
},
|
},
|
||||||
deleteButton: {
|
deleteButton: {
|
||||||
label: "Delete",
|
label: "Delete",
|
||||||
|
@ -14,7 +14,7 @@ export function createTOTPCard({
|
|||||||
onMoveDown,
|
onMoveDown,
|
||||||
onIssuerChange,
|
onIssuerChange,
|
||||||
onClientChange,
|
onClientChange,
|
||||||
isEditInProgress
|
isEditInProgress,
|
||||||
}) {
|
}) {
|
||||||
const infoView = View(
|
const infoView = View(
|
||||||
{
|
{
|
||||||
@ -40,7 +40,7 @@ export function createTOTPCard({
|
|||||||
color: colors.text,
|
color: colors.text,
|
||||||
borderRadius: "5px",
|
borderRadius: "5px",
|
||||||
height: "40px",
|
height: "40px",
|
||||||
width: "200px"
|
width: "200px",
|
||||||
},
|
},
|
||||||
subStyle: {
|
subStyle: {
|
||||||
display: "none",
|
display: "none",
|
||||||
@ -60,7 +60,7 @@ export function createTOTPCard({
|
|||||||
color: colors.text,
|
color: colors.text,
|
||||||
borderRadius: "5px",
|
borderRadius: "5px",
|
||||||
height: "40px",
|
height: "40px",
|
||||||
width: "200px"
|
width: "200px",
|
||||||
},
|
},
|
||||||
subStyle: {
|
subStyle: {
|
||||||
display: "none",
|
display: "none",
|
||||||
@ -109,16 +109,17 @@ export function createTOTPCard({
|
|||||||
},
|
},
|
||||||
onClick: onRename,
|
onClick: onRename,
|
||||||
}),
|
}),
|
||||||
!isEditInProgress ?
|
!isEditInProgress
|
||||||
Button({
|
? Button({
|
||||||
label: content.deleteButton.label,
|
label: content.deleteButton.label,
|
||||||
style: {
|
style: {
|
||||||
margin: "5px",
|
margin: "5px",
|
||||||
backgroundColor: colors.alert,
|
backgroundColor: colors.alert,
|
||||||
color: colors.text,
|
color: colors.text,
|
||||||
},
|
},
|
||||||
onClick: onDelete,
|
onClick: onDelete,
|
||||||
}): null,
|
})
|
||||||
|
: null,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -7,5 +7,5 @@ export class ProtonTotpRecord {
|
|||||||
content = {
|
content = {
|
||||||
uri,
|
uri,
|
||||||
entry_type,
|
entry_type,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
@ -6,23 +6,26 @@ import { ProtonBackupExport } from "./protonBackupExport";
|
|||||||
const otpauthScheme = "otpauth://";
|
const otpauthScheme = "otpauth://";
|
||||||
const googleMigrationScheme = "otpauth-migration://";
|
const googleMigrationScheme = "otpauth-migration://";
|
||||||
export function getTOTPByLink(link) {
|
export function getTOTPByLink(link) {
|
||||||
try { //proton export
|
try {
|
||||||
|
//proton export
|
||||||
const json = JSON.parse(link);
|
const json = JSON.parse(link);
|
||||||
console.log(json)
|
console.log(json);
|
||||||
return getByProtonBackup(json);
|
return getByProtonBackup(json);
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (link.startsWith(googleMigrationScheme)) { //google migration export
|
if (link.startsWith(googleMigrationScheme)) {
|
||||||
|
//google migration export
|
||||||
return getByGoogleMigrationScheme(link);
|
return getByGoogleMigrationScheme(link);
|
||||||
}
|
}
|
||||||
if (link.startsWith(otpauthScheme)) {//otpauth export
|
if (link.startsWith(otpauthScheme)) {
|
||||||
|
//otpauth export
|
||||||
return getByOtpauthScheme(link);
|
return getByOtpauthScheme(link);
|
||||||
}
|
}
|
||||||
throw new Error(`Unsupported link type. Please use an otpauth:// or otpauth-migration:// link\n ERR: ${e}`);
|
throw new Error(
|
||||||
|
`Unsupported link type. Please use an otpauth:// or otpauth-migration:// link\n ERR: ${e}`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getHashType(algorithm) {
|
function getHashType(algorithm) {
|
||||||
if (algorithm == "SHA1") return "SHA-1";
|
if (algorithm == "SHA1") return "SHA-1";
|
||||||
if (algorithm == "SHA256") return "SHA-256";
|
if (algorithm == "SHA256") return "SHA-256";
|
||||||
@ -32,17 +35,21 @@ function getHashType(algorithm) {
|
|||||||
|
|
||||||
function getByProtonBackup(protonjson) {
|
function getByProtonBackup(protonjson) {
|
||||||
try {
|
try {
|
||||||
if ("entries" in protonjson && protonjson.version == 1) { //Is proton export?
|
if ("entries" in protonjson && protonjson.version == 1) {
|
||||||
console.log(1)
|
//Is proton export?
|
||||||
const protonBE = Object.assign(new ProtonBackupExport(), protonjson)
|
console.log(1);
|
||||||
const res = protonBE.entries.map(x => {
|
const protonBE = Object.assign(
|
||||||
|
new ProtonBackupExport(),
|
||||||
|
protonjson,
|
||||||
|
);
|
||||||
|
const res = protonBE.entries.map((x) => {
|
||||||
return getByOtpauthScheme(x.content.uri);
|
return getByOtpauthScheme(x.content.uri);
|
||||||
});
|
});
|
||||||
console.log(res)
|
console.log(res);
|
||||||
return res;
|
return res;
|
||||||
} else throw new Error("use proton export backup with version: 1");
|
} else throw new Error("use proton export backup with version: 1");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e);
|
||||||
throw new Error(`Unsupported JSON type: ${e}`);
|
throw new Error(`Unsupported JSON type: ${e}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user