beemdevelopment/Aegis · error · FileNotFoundException

Accounts.txt

Error message

Accounts.txt

What it means

The Authenticator Plus importer expects a zip archive containing a file named "Accounts.txt" holding the encrypted entries. When no zip entry with that name is found, it throws FileNotFoundException with that constant name (wrapped flow), signaling the archive is not a valid Authenticator Plus export.

Solutions

  1. Re-export a full backup from Authenticator Plus (must include Accounts.txt) and import that zip
  2. Unzip the archive and confirm Accounts.txt exists at the top level; re-zip preserving the name if needed
  3. Do not rename or convert Accounts.txt (e.g. to CSV-only exports)
  4. Verify you selected the correct zip, not another app's backup

Example fix

// before
throw new FileNotFoundException(FILENAME);
// after
throw new DatabaseImporterException(
    String.format("%s not found in archive; this does not look like an Authenticator Plus backup", FILENAME));
Defensive patterns

Strategy: validation

Validate before calling

try (ZipFile zip = new ZipFile(backupPath)) {
    if (zip.getEntry("Accounts.txt") == null) {
        throw new IllegalArgumentException("Zip is missing Accounts.txt — not an Authenticator Plus backup");
    }
}

Try / catch

try {
    importer.read(stream);
} catch (DatabaseImporterException | FileNotFoundException e) {
    showUserError("Backup zip must contain Accounts.txt");
}

Prevention

When it happens

Trigger: User selects an Authenticator Plus backup zip that lacks Accounts.txt — e.g. an incomplete export, a different app's zip, or an archive where the file was renamed/relocated.

Common situations: Partial backup (data exported as CSV instead); re-zipped archive that renamed the file; picking the wrong zip from a device backup.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of beemdevelopment/Aegis@d6f4e5925a (2026-09-08). Data as JSON: /api/errors/bf4356bfa4d3ee63. Report an issue: GitHub.

Appendix: source

Thrown at app/src/main/java/com/beemdevelopment/aegis/importers/AuthenticatorPlusImporter.java:59

        private EncryptedState(byte[] data) {
            super(true);
            _data = data;
        }

        protected State decrypt(char[] password) throws DatabaseImporterException {
            try (ByteArrayInputStream inStream = new ByteArrayInputStream(_data);
                 ZipInputStream zipStream = new ZipInputStream(inStream, password)) {
                LocalFileHeader header;
                while ((header = zipStream.getNextEntry()) != null) {
                    File file = new File(header.getFileName());
                    if (file.getName().equals(FILENAME)) {
                        GoogleAuthUriImporter importer = new GoogleAuthUriImporter(null);
                        return importer.read(zipStream);
                    }
                }

                throw new FileNotFoundException(FILENAME);
            } catch (IOException e) {
                throw new DatabaseImporterException(e);
            }
        }

        @Override
        public void decrypt(Context context, DecryptListener listener) {
            Dialogs.showPasswordInputDialog(context, password -> {
                try {
                    DatabaseImporter.State state = decrypt(password);
                    listener.onStateDecrypted(state);
                } catch (DatabaseImporterException e) {
                    listener.onError(e);
                }
            }, dialog1 -> listener.onCanceled());
        }
    }
}

View on GitHub (pinned to d6f4e5925a)