boolean migrateConversationData ( ) throws SerializerException { long start = System . currentTimeMillis ( ) ; File legacyConversationDataFile = Util . getUnencryptedFilename ( conversationDataFile ) ; if ( legacyConversationDataFile . exists ( ) ) { try { ApptentiveLog . d ( CONVERSATION , "Migrating %sconversation data..." , hasState ( LOGGED_IN ) ? "encrypted " : "" ) ; FileSerializer serializer = isAuthenticated ( ) ? new EncryptedFileSerializer ( legacyConversationDataFile , getEncryptionKey ( ) ) : new FileSerializer ( legacyConversationDataFile ) ; conversationData = ( ConversationData ) serializer . deserialize ( ) ; ApptentiveLog . d ( CONVERSATION , "Conversation data migrated (took %d ms)" , System . currentTimeMillis ( ) - start ) ; return true ; } finally { boolean deleted = legacyConversationDataFile . delete ( ) ; ApptentiveLog . d ( CONVERSATION , "Legacy conversation file deleted: %b" , deleted ) ; } } return false ; }
Attempts to migrate from the legacy clear text format .