There is a launcher Splash stack and the Main stack (the real thing). This last is inside a folder on resources, with other stuff that gets updated from the cloud when I need to.
On first launch, the folder inside the app gets copied to the mobile document folder: in this way, since I can read and write there, I can manage version auto updates from the web. (it's a long story but, mainly, the devices are not easily reached by the users and store auto update cannot be set).
This is how I set the all thing and it works great.
But I need then to protect the Main stack (I cannot do it, because of my choices, in the standalone setting of the Splash stack), in such a way that the stack gets password protected only when building the standalone and I can easily work with it when in development.
I tried to put the following code in the Splash Stack:
Code: Select all
on savingMobileStandalone pTargetType, pAppBundle
put specialfolderpath("resources") & "/MyFolder/Mainstack.livecode" into tPath
if there is a stack tPath then --
ProtectMyStacks tPath--this password protect the Main stack
save stack tPath
end if
end savingMobileStandalone
private command ProtectMyStacks pStackPath
if there is a stack pStack then
repeat for each line tSubStack in the substacks of stack pStackPath
set the password of stack tSubStack of stack pStackPath to "xxx"
end repeat
set the password of stack pStackPath to "xxx"
end if
end ProtectMyStacks
It probably will, using the parameter pAppBundle of savingMobileStandalone, for iOS (which has a bundle) but not for the Android .aab file, where I think is not possible to explore or do changes.
I guess that I could password protect the Main stack before savingMobileStandalone if I only new how to intercept the "build standalone" command of LC. Then, once finished, I could remove the password on mobileStandaloneSaved.
Any help?
Thanks