-
-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OOM on Import Vault when encrypted vault file is large #1298
Comments
This is a known issue that really only occurs if you selected high resolution JPG or PNG images as icons for your entries. Is that the case here as well? We don't currently scale down selected icons, so they retain their original resolution and thus the size of the vault file quickly increases if you have a couple of those. We probably should scale them down to something like 512x512. Either way, I'd suggest using SVG icons instead. My vault contains ~80 entries, most of which have SVG icons, and is under 250KB in size. Take a look at the available icons packs: https://github.com/beemdevelopment/Aegis?tab=readme-ov-file#icon-packs |
I think it is a good idea to notify the user when this happens for high resolution icons. Scaling down would also prevent users from accidentally soft-locking themselves out of the app, should they choose not to use SVG icons. |
🤦 I can't believe I didn't think of that. The images are exactly the cause. I've added a couple of images that I took with my phone camera, so that should add a couple of tens of MBs. Thanks! I'm keeping the issue open if the developers decide to address with a workaround. Please close if that's not the case. |
I could also try adding the feature to crop and scale down images. I'm not familiar with Android development, and it's a bad time in terms of work, but with some time and effort I could get a PR up. Will pick this up if no one else has started. |
I'm not sure, but it looks like the data is loaded from the image file here:
And there may also be some reason to put checks in the serialization code:
This article may be relevant: https://developer.android.com/topic/performance/graphics/load-bitmap.html |
Version
v2.2.2
Source
F-Droid
Vault encryption
Yes
Device
OnePlus6
Android version
11
ROM
OxygenOS (stock OnePlus6) v 11.1.2.2
Steps to reproduce
Following the contribution guide and a few comments on the past issues, I did the following to fix this.
apktool
and addedandroid:largeHeap="true"
toAndroidManifest.xml
.adb
This solves my problem for the moment, but my issue is keeping up with the updates and general security. Is there anyway this could be addressed by the released packages? I'm guessing this happens because
db
entry becomes too large during decryption/encryption. Maybe (somehow) encrypt entries separately (or group up to a certain number)? That could limit the memory occupied by an encrypt/decrypt operation.I'm unfamiliar with Android development, but can't
largeHeap
attribute be enabled by default somehow? Guessing that would just prolong the time it takes for this to reproduce again.Let me know if you need me to generate more detailed logs. I didn't include the entire file because I collected system logs too.
What do you expect to happen?
Import the tokens without crashing
What happens instead?
Application crashes
Log
The text was updated successfully, but these errors were encountered: