Some users are losing their progress after updating

Hi,

I’m having a problem with about 10% of my customers losing their progress after performing an update.  I can’t duplicate the problem but they swear they are pressing the update button in google play, and after the update installs, they lose all progress.  Which makes for angry customers and bad reviews :frowning:

Does anyone have any ideas about how this could be happening? 

All my saves are with JSON, and I use: local path = system.pathForFile( filename, system.DocumentsDirectory )

I also encrypt before save with:

local openssl = require “plugin.openssl”
local cipher =  openssl.get_cipher (“RC2-40-CBC”)
local mime = require ( “mime” )

local deviceID = “XXXXXXX”

 local contents = json.encode( table )
 local encryptedData = mime.b64 ( cipher:encrypt ( contents, deviceID ) )
 if _G.encryptedSaveData then
     file:write( encryptedData )      
 else
     file:write( contents )
 end

I decrypt at load with:

   local decryptedData = cipher:decrypt ( mime.unb64 ( contents ), deviceID )
   local table = {}
   if _G.encryptedSaveData then
         table = json.decode( decryptedData );
   else
         table = json.decode( contents );
   end

Any help greatly appreciated!, Greg

Hi,

You have to verify if the parameter when you build are the same. (ex playstore/amazon store)

You are saying that if I built my game for Amazon, and uploaded it to Google by accident, that everything would get over-written when a customer updated?

Thanks, Greg

If either your release keystore changes of your AppID changes it will be treated as a new app, but the Google Play interface should loudly warn you about it, so I doubt either of those are your cause.

Picking Amazon or Google from the build menu should not affect this, unless you have code that tests for what store you’re building for and you have conditional code that changes it.

Now if you’ve changed your settings file somewhere along the way, or your encryption key changes its possible your code can’t read the file and it’s triggering you to create a new file as if they were a new customer.

Without seeing the logic of your code (you don’t have enough above. We have no idea what _G.encryptedSaveData is, how it’s set. 

Rob

For information I don’t know why but one time I made a mistake, I upload a amazon version on play store and there is 23 persons who send me an email who insult me or only ask to correct the erase save game

Hi,

You have to verify if the parameter when you build are the same. (ex playstore/amazon store)

You are saying that if I built my game for Amazon, and uploaded it to Google by accident, that everything would get over-written when a customer updated?

Thanks, Greg

If either your release keystore changes of your AppID changes it will be treated as a new app, but the Google Play interface should loudly warn you about it, so I doubt either of those are your cause.

Picking Amazon or Google from the build menu should not affect this, unless you have code that tests for what store you’re building for and you have conditional code that changes it.

Now if you’ve changed your settings file somewhere along the way, or your encryption key changes its possible your code can’t read the file and it’s triggering you to create a new file as if they were a new customer.

Without seeing the logic of your code (you don’t have enough above. We have no idea what _G.encryptedSaveData is, how it’s set. 

Rob

For information I don’t know why but one time I made a mistake, I upload a amazon version on play store and there is 23 persons who send me an email who insult me or only ask to correct the erase save game