Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use serialization with obfuscation?

I wonder if it will work... In my app I have an object that I'm serializing to file, and then I obfuscate the code with the ProGuard and application goes to Market. Then I want to release new version of app. I do the same. The users run through the application update.

The question is - does the object, that was serialized with the first version of app, deserialize properly in the second one? And if yes - why?

like image 632
Michal Chudy Avatar asked Oct 05 '11 23:10

Michal Chudy


1 Answers

I could find several mechanisms (serialPersistentFields, ObjectInputStream#readFields) that make it possible for customised serialisation to be dependent on field names - assuming the default mechanism isn't already. The ProGuard documentation has some example configuration that shows how to make ProGuard ignore field names and all special methods and fields used by serialisation.

like image 91
millimoose Avatar answered Oct 26 '22 09:10

millimoose