Restoring from backup inserts "garbage" into the servers list
louis-ad opened this issue · 0 comments
Describe the bug
Restoring from backup inserts "garbage" into the servers list, instead of a server description like "ShadowSocks" under the title, I see part of the contents of the backup file, specifically strings that look like the OpenVPN configuration. I can't delete the server from the app either, the only option is to do a full reset.
To Reproduce
Steps to reproduce the behavior:
- With a valid configuration that has OpenVPN settings, go to Settings and Backup, Make a Backup file.
- Reset the application.
- Open the application, "I have the data to connect", "Open config file, key, or QR code".
- Select "File with connection settings or backup", and choose the backup file created in step 1.
- If you select "Show content", you can see that instead of showing the backup file as a JSON structure, the app has created a new structure, and the contents of the backup file has been inserted as a JSON node inside
containers[0].openvpn.last_config.config
. - If you go back to the main screen, instead of a server description like "ShadowSocks" under the title, you see part of the contents of the configuration.
- Going to Settings Icon (which is only available only after I've setup the app) -> Backup -> Restore from Backup also doesn't bring the expected results.
Expected behavior
Restoring from backup will give me the expected list of servers, and a functioning application.
Smartphone (please complete the following information):
- Device: Google Pixel 7
- OS: Android 13
- Version 4.1.1.0
Server (please complete the following information):
- OS: Ubuntu 22.04
Additional context
The problem is in ConfigTypes.checkConfigFormat()
: if I give it an Amnezia backup file that has an openvpn configuration embedded, it will return ConfigTypes::OpenVpn
instead of ConfigTypes::Amnezia
.