Compare commits
No commits in common. "8c92239aa404487e37e6faa053b35b0d60755807" and "21c7646c715318972878e6d0178e400c4944c465" have entirely different histories.
8c92239aa4
...
21c7646c71
2
app.json
2
app.json
@ -6,7 +6,7 @@
|
|||||||
"appType": "app",
|
"appType": "app",
|
||||||
"version": {
|
"version": {
|
||||||
"code": 1,
|
"code": 1,
|
||||||
"name": "1.2.2"
|
"name": "1.1.3"
|
||||||
},
|
},
|
||||||
"icon": "icon.png",
|
"icon": "icon.png",
|
||||||
"vender": "zepp",
|
"vender": "zepp",
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 12 KiB |
Binary file not shown.
Before Width: | Height: | Size: 22 KiB |
Binary file not shown.
Before Width: | Height: | Size: 43 KiB |
Binary file not shown.
Before Width: | Height: | Size: 74 KiB |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "totpfit",
|
"name": "totpfit",
|
||||||
"version": "1.2.2",
|
"version": "1.1.3",
|
||||||
"description": "Another 2FAuthenticator based on TOTP for Zepp Amazfit GTS 4",
|
"description": "Another 2FAuthenticator based on TOTP for Zepp Amazfit GTS 4",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"author": "Lisoveliy",
|
"author": "Lisoveliy",
|
||||||
|
@ -23,15 +23,10 @@ Page(
|
|||||||
})
|
})
|
||||||
.catch((x) => {
|
.catch((x) => {
|
||||||
console.log(`Init failed: ${x}`);
|
console.log(`Init failed: ${x}`);
|
||||||
try{
|
|
||||||
let localStorage = new LocalStorage();
|
let localStorage = new LocalStorage();
|
||||||
app._options.globalData.TOTPS = JSON.parse(
|
app._options.globalData.TOTPS = JSON.parse(
|
||||||
localStorage.getItem("TOTPs", [])
|
localStorage.getItem("TOTPs", null) ?? []
|
||||||
);
|
);
|
||||||
}
|
|
||||||
catch{
|
|
||||||
app._options.globalData.TOTPS = [];
|
|
||||||
}
|
|
||||||
this.initPage();
|
this.initPage();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -33,7 +33,6 @@ function getByOtpauthScheme(link) {
|
|||||||
let period = args[3].split("period=")[1]?.split("&")[0]; //Returns period
|
let period = args[3].split("period=")[1]?.split("&")[0]; //Returns period
|
||||||
let digits = args[3].split("digits=")[1]?.split("&")[0]; //Returns digits
|
let digits = args[3].split("digits=")[1]?.split("&")[0]; //Returns digits
|
||||||
let algorithm = args[3].split("algorithm=")[1]?.split("&")[0]; //Returns algorithm
|
let algorithm = args[3].split("algorithm=")[1]?.split("&")[0]; //Returns algorithm
|
||||||
let offset = args[3].split("offset=")[1]?.split("&")[0] ?? 0; //Returns offset
|
|
||||||
|
|
||||||
if (type.toLowerCase() != "totp")
|
if (type.toLowerCase() != "totp")
|
||||||
throw new Error("Type is not valid, requires 'TOTP'");
|
throw new Error("Type is not valid, requires 'TOTP'");
|
||||||
@ -53,7 +52,7 @@ function getByOtpauthScheme(link) {
|
|||||||
client,
|
client,
|
||||||
digits,
|
digits,
|
||||||
period,
|
period,
|
||||||
Number(offset),
|
0,
|
||||||
getHashType(algorithm)
|
getHashType(algorithm)
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@ -69,28 +68,6 @@ function getByGoogleMigrationScheme(link) {
|
|||||||
let decode = base64decode(data);
|
let decode = base64decode(data);
|
||||||
let proto = decodeProto(decode);
|
let proto = decodeProto(decode);
|
||||||
|
|
||||||
let totps = [];
|
|
||||||
|
|
||||||
totps.push(new TOTP(
|
|
||||||
"",
|
|
||||||
data,
|
|
||||||
decode,
|
|
||||||
6,
|
|
||||||
30,
|
|
||||||
0,
|
|
||||||
"SHA-1"
|
|
||||||
));
|
|
||||||
|
|
||||||
totps.push(new TOTP(
|
|
||||||
"",
|
|
||||||
proto.leftOver,
|
|
||||||
proto.parts.length,
|
|
||||||
6,
|
|
||||||
30,
|
|
||||||
0,
|
|
||||||
"SHA-1"
|
|
||||||
));
|
|
||||||
|
|
||||||
let protoTotps = [];
|
let protoTotps = [];
|
||||||
|
|
||||||
proto.parts.forEach(part => {
|
proto.parts.forEach(part => {
|
||||||
@ -99,6 +76,7 @@ function getByGoogleMigrationScheme(link) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let totps = [];
|
||||||
protoTotps.forEach(x => {
|
protoTotps.forEach(x => {
|
||||||
let type = x.parts.filter(x => x.index == 6)[0]; //find type of OTP
|
let type = x.parts.filter(x => x.index == 6)[0]; //find type of OTP
|
||||||
if(type.value !== '2'){
|
if(type.value !== '2'){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user