Reputation: 2182
My app uses http://prevayler.org/ for persistence, piggybacking Java Object serialization. After upgrade to Android 7.0 (Nougat) users cannot open their data, since the deserialization does not work any more:
java.io.StreamCorruptedException: invalid type code: 71
at java.io.ObjectInputStream.readString(ObjectInputStream.java:1647)
at java.io.ObjectInputStream.readEnum(ObjectInputStream.java:1737)
...
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373)
at org.prevayler.foundation.serialization.JavaSerializer.readObject(JavaSerializer.java:34)
...
at org.prevayler.PrevaylerFactory.snapshotManager(PrevaylerFactory.java:368)
at org.prevayler.PrevaylerFactory.create(PrevaylerFactory.java:316)
at com.tennismath.prevayler.PrevaylerServiceImpl.getSystemPrevayler(PrevaylerServiceImpl.java:51)
While deserializing an enum, the OpenJDK routine reads the unexpected byte value of "71" and throws the exception, as it can be seen from the source code: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8u40-b25/java/io/ObjectInputStream.java#ObjectInputStream.readString%28boolean%29
I have the following ideas:
All these choices seem to be either an overkill or unsatisfying. Before I start hacking the binaries, maybe anybody has a better idea of what can be done to deserialize the old data with the new runtime? Thank you.
Upvotes: 3
Views: 261