Aegis icon indicating copy to clipboard operation
Aegis copied to clipboard

andOTP import: Usage count & icons

Open ThiefMaster opened this issue 3 years ago • 4 comments

The andOTP JSON export contains information related to the usage count and icon used. Maybe it could be used to populate the usage count in the Aegis vault, and also search in the enabled icon pack for a matching icon?

Having to do this manually for 50 entries would be a pain in the ass - and while I'll probably write a script to transform the JSON formats while preserving this info anyway, I think it'd be nice to have this as a built-in feature.


$ gpg --decrypt /tmp/adrian/otp_accounts.json.gpg 2>/dev/null | jq 'sort_by(.used_frequency) | map({issuer,label,used_frequency,last_used,period,thumbnail})[-5:]'
[
  {
    "issuer": "",
    "label": "GitHub - XXX",
    "used_frequency": 7,
    "last_used": 1651559963768,
    "period": 30,
    "thumbnail": "GitHub"
  },
  {
    "issuer": "Instagram",
    "label": "XXX",
    "used_frequency": 7,
    "last_used": 1656849111140,
    "period": 30,
    "thumbnail": "Instagram"
  },
  {
    "issuer": "",
    "label": "Amazon - XXX",
    "used_frequency": 8,
    "last_used": 1651040713229,
    "period": 30,
    "thumbnail": "Amazon"
  },
  {
    "issuer": "CERN",
    "label": "XXX",
    "used_frequency": 8,
    "last_used": 1648636180437,
    "period": 30,
    "thumbnail": "Default"
  },
  {
    "issuer": "CERN",
    "label": "XXX",
    "used_frequency": 59,
    "last_used": 1661435816507,
    "period": 30,
    "thumbnail": "Default"
  }
]

ThiefMaster avatar Sep 05 '22 10:09 ThiefMaster

The usage count is actually not kept in the Aegis vault file, but in the shared preference file. This is because we wanted to avoid the overhead of saving the vault after every tap of an entry. Some changes to the current import system would be required to support importing usage counts.

Automatic icon assignment to entries is part of another issue: #773. Once that's implemented, we can make use of it when importing from other authenticators.

alexbakker avatar Sep 13 '22 19:09 alexbakker

So currently there's no way to get the data besides tapping an entry over and over again (or using manual sorting) to manually bump its usage count if I want to get it near the top?

ThiefMaster avatar Sep 13 '22 19:09 ThiefMaster

Correct.

alexbakker avatar Sep 13 '22 20:09 alexbakker

Partially fixed this in #1172.

michaelschattgen avatar Sep 03 '23 10:09 michaelschattgen