Comments (4)
couldn't reproduce this issue but 57f976c safeguards the code that might have caused this issue. @minadaki can you please try the latest code and see if it fixes the issue?
from secured-preference-store.
Hello,
Thank you for your fast reply.
Unfortunately, even with the latest version, the app still crashes.
The library fails to initialise:
Failed to init Secured Preference Store. Exception: java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 at devliving.online.securedpreferencestore.SecuredPreferenceStore.<init>(SecuredPreferenceStore.java:76) at devliving.online.securedpreferencestore.SecuredPreferenceStore.init(SecuredPreferenceStore.java:134)
The actual crash takes place later when the app tries to use Secured Shared Preferences:
07-10 10:28:21.040 32191-32191/x.x.x E/AndroidRuntime: FATAL EXCEPTION: main Process: /x.x.x, PID: 32191 java.lang.RuntimeException: Unable to start activity ComponentInfo{/x.x.x/x.x.x.LoginActivity}: java.lang.IllegalStateException: Must call init() before using the store at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2955) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6938) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) Caused by: java.lang.IllegalStateException: Must call init() before using the store at devliving.online.securedpreferencestore.SecuredPreferenceStore.getSharedInstance(SecuredPreferenceStore.java:99)
This is how I initialise the library:
private static final String SECURE_PREFS_NAME = "secPrefs"; private static final String SECURE_KEY_PREFIX = "testvss"; private static final byte[] SECURE_PREFS_SEED = "seed".getBytes(); SecuredPreferenceStore.init(getApplicationContext(), SECURE_PREFS_NAME, SECURE_KEY_PREFIX, SECURE_PREFS_SEED, new DefaultRecoveryHandler2());
Testing device:
Samsung S8, Android Oreo (8.0.0)
from secured-preference-store.
Haven't been able to reproduce this so far. Have you tested on any other device except the Samsung? @minadaki
from secured-preference-store.
I tried on a Motorolla phone running Android Oreo and it worked fine.
After that I uninstalled my app from the Samsung S8 phone and cleared all the app's cache and data.
Upon re-installing the app, the library initialised successfully and no crashes occurred.
So where does that leave us? If I upload a new version of my app in Playstore including the changes, will the app crash after updating or not? Does update of the app clear cache and data (simulating the uninstall-install scenario) ?
from secured-preference-store.
Related Issues (20)
- Some help would be appreciated HOT 1
- Add ability to seed SecureRandom
- App Crashed in lollipop OS version with error "java.lang.IllegalStateException: Must call init() before using the store" HOT 2
- RSA Key Generation failed with "IllegalArgumentException: startDate == null" HOT 1
- Cannot connect to keystore HOT 1
- KeyStoreException Signature/MAC verification failed
- java.lang.NoClassDefFoundError: devliving.online.securedpreferencestore.Logger on Android APi 19 HOT 1
- Cipher not initialized issue sometimes(Once if i run the test case 10 times). HOT 1
- KeyStore exception in log on Android 9 device HOT 6
- llegalStateException: Must call init() before using the store HOT 4
- Should seedKey be stored securely? HOT 1
- AndroidManifest contains application label HOT 2
- [Question] - Sharing among multiple apps HOT 3
- Getting encrypted value when using OnSharedPreferenceChangeListener HOT 2
- AES only supported by Android API 23+
- anr when generateAESKey and call mStore.containsAlias(AES_KEY_ALIAS)
- Very long strings are not stored
- "Key not yet valid" on device HOT 1
- Alternative to this library? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from secured-preference-store.