store setting, high scores, coins etc. in a non protected file

Hi, I’m trying to figure out if there is a way to store settings, high scores, coins etc. in a non editable file, or at least to make it writable only at a certain condition. For instance, if the last score is higher that the previous one, then unlock the file -> write the new score -> lock the file. Can Corona SDK handle it?

Thanks

Best regards.

Hi @estiennelorenzo,

I’m not sure what you mean by “lock” the file. You should simply create the file (text, JSON, SQlite database) when the app first runs, then use that file to keep track of your data. The user won’t be able to access this file directly and change values within it… only you (in your code) will be able to edit it, so effectively it will be “locked” to the user.

Hope this helps,

Brent

Hi Brent, thanks for your quick reply. Anyway if the device that runs my application is jailbroken, the owner could access and edit the file located inside the sandbox. That is what I want to avoid. Best regards

Well a mod might want to confirm this but i think that corona encrypts the file and no one can edit it unless they speak some alien language haha well from what i remember from old games… lets say 2 years ago … it was easy to change your coin count and high score when you get into that file in the game folder… but now they encrypt it so it looks like 4 million letters and numbers… so your good just make your game and dont worry about security cause corona will make everything secret.

No, we don’t encrypt your data files. It’s your responsibility to encrypt them if you want. Your code is converted to bytecode which obscures it somewhat.  Unless the user has jailbroken or rooted their device, they can’t see into your app’s sandbox.

We do offer encryption API’s, but you will likely have to deal with Export Compliance when submitting your app to the store, which may require you to register your app with your government.

Rob

Hi @estiennelorenzo,

I’m not sure what you mean by “lock” the file. You should simply create the file (text, JSON, SQlite database) when the app first runs, then use that file to keep track of your data. The user won’t be able to access this file directly and change values within it… only you (in your code) will be able to edit it, so effectively it will be “locked” to the user.

Hope this helps,

Brent

Hi Brent, thanks for your quick reply. Anyway if the device that runs my application is jailbroken, the owner could access and edit the file located inside the sandbox. That is what I want to avoid. Best regards

Well a mod might want to confirm this but i think that corona encrypts the file and no one can edit it unless they speak some alien language haha well from what i remember from old games… lets say 2 years ago … it was easy to change your coin count and high score when you get into that file in the game folder… but now they encrypt it so it looks like 4 million letters and numbers… so your good just make your game and dont worry about security cause corona will make everything secret.

No, we don’t encrypt your data files. It’s your responsibility to encrypt them if you want. Your code is converted to bytecode which obscures it somewhat.  Unless the user has jailbroken or rooted their device, they can’t see into your app’s sandbox.

We do offer encryption API’s, but you will likely have to deal with Export Compliance when submitting your app to the store, which may require you to register your app with your government.

Rob