Page 2 of 2
Re: Data Storage and Persistence
Posted: Fri Aug 07, 2015 9:19 pm
by jacque
physicsclassroom wrote:Does Android OS have any type of backup/syncing that would put sensitive data at risk?
Android has a similar backup system. In addition, it is fairly common to root an Android device and many Android users do so. A rooted Android device has read/write access to all files on the entire drive. You could consider storing the user data on a server, and read it in from there on startup if you're concerned.
Re: Data Storage and Persistence
Posted: Fri Aug 07, 2015 10:25 pm
by Simon
I say Encrypt!
It's very easy with liveCode.
Simon
Re: Data Storage and Persistence
Posted: Fri Aug 07, 2015 10:38 pm
by jacque
Simon wrote:I say Encrypt!
It's very easy with liveCode.
Simon
Good idea. Easier, too.
Re: Data Storage and Persistence
Posted: Fri Aug 07, 2015 11:31 pm
by physicsclassroom
If I use a stack to store some data, would the stack and its data be secure as well? This is part of my plan since the program operates by storing and retrieving data from a stack.
Re: Data Storage and Persistence
Posted: Mon Aug 10, 2015 11:12 pm
by jacque
physicsclassroom wrote:If I use a stack to store some data, would the stack and its data be secure as well? This is part of my plan since the program operates by storing and retrieving data from a stack.
Anyone with root access and a copy of LiveCode could still open the stack and see the values, though using a stack does reduce the likelihood a bit. You can still use the stack as a storage file (I do that all the time) but it would be safer to use the encrypt command on the data before putting it into the stack, and the decrypt command if you need to retrieve and work with it later.
Re: Data Storage and Persistence
Posted: Tue Aug 11, 2015 1:10 am
by golive
jacque wrote:You can still use the stack as a storage file (I do that all the time).
How do you do that?
(Pardon me if that is a dumb question - I am a beginner trying to get up to speed quickly).
Re: Data Storage and Persistence
Posted: Tue Aug 11, 2015 3:22 am
by physicsclassroom
Hi Jacque,
You mentioned that ...
jacque wrote:Anyone with root access and a copy of LiveCode could still open the stack and see the values, though using a stack does reduce the likelihood a bit.
To help me determine what types of information would need to go where (stack, .txt file, encrypted in .txt file), I'd like to know if a user with a rooted Android phone could open a stack, change some of the data, and save the stack such that the changed data is incorporated into the app?
Also, is any of this possible on an iOS device ... even one that has been jailbroken?
Thanks for your insight.
Tom
Re: Data Storage and Persistence
Posted: Tue Aug 11, 2015 8:50 am
by jacque
Anyone with root permissions can access the file, export it to their computer and open it in LiveCode, providing they recognize what app created it. Then they can alter it and move the file back to the device. This is also true for iOS if the device is jailbroken.
So it's more secure to encrypt the data before storing it, whether that's in a text file, a stack, or anywhere else. Encrypted data is almost impossible to decipher without the cypher keys, and it doesn't matter what type of file contains it.
Re: Data Storage and Persistence
Posted: Tue Aug 11, 2015 8:59 am
by jacque
golive wrote:jacque wrote:You can still use the stack as a storage file (I do that all the time).
How do you do that?
(Pardon me if that is a dumb question - I am a beginner trying to get up to speed quickly).
You just use the stack as a storage file. There are more ways to store data in a stack than in a text file because you have access to custom properties, fields, and can even copy images or other objects to it. The stack can be very plain with no scripts, and opened invisibly. It's just used as a container.
I usually store most things as custom properties since those can hold virtually all kinds of data, including arrays and raw image data.
Re: Data Storage and Persistence
Posted: Tue Aug 11, 2015 6:33 pm
by physicsclassroom
A have a line of questions regarding saving of files in the specialFolderPath("documents") that I can't seem to find the answers to:
1) Does a .txt file automatically save? In the IDE and in the simulator, it definitely seems to. Can I expect auto-save for .txt files on iOS, Android and the like or do I need to issue a save command. If a save command is needed, is it
Code: Select all
save URL ("file:specialFolderPath("documents") & "fileName.txt")
2) What about a data stack placed in documents. It seems it needs to be saved? For a small stack, is there a time delay for saving or does the saving take place asynchronously with the rest of the script that issues the command?
Thanks.
Re: Data Storage and Persistence
Posted: Tue Aug 11, 2015 8:15 pm
by Simon
Hi physicsclassroom,
In the dictionary "save" is only for stacks
save URL ("file:specialFolderPath("documents") & "fileName.txt")
should be
Code: Select all
put tMyVar into URL ("file:" & specialFolderPath("documents") & slash & "fileName.txt")
note the added slash (could be ..."/fileName.txt") and "file:"
Your #1
No, to auto save, not sure how you are seeing this, but it must be coded as above.
#2
I won't comment on "...asynchronously..." but it takes just as much time as the size of the stack you are saving. A stack with a bizillion images in it takes longer then a stack with a 1000 lines of text.
OK that line doesn't sound convincing. It normally takes pretty much un-noticeable time to save a stack.
Simon