Wish Secrets.txt

hatzisn

Expert
Licensed User
Longtime User
I just faced something that made me think of the following. Uploading a project I forgot to change some strings that are private to me resulting in uploading and reuploading.
So what I thought to avoid this in the future is a submenu that could be added in the IDEs - maybe tools menu - which would handle exactly this. There you could add a name value pair of strings which will contain what you want and this would be saved in a special folder in the project and embed them in the project's code let's say like "$SSID$" . When compiling, the code creation in B4X IDEs would replace these fields in the code with the given value. Now when we would like to share this code we could very well "export as zip" and the IDEs would create a null value for all values in this name-value pairs making a copy which you could ship with the zip not sharing the values of your secrets. The person that would receive it would be prompted to fill in their corresponding secrets. This could be done also in the meta files...
 

hatzisn

Expert
Licensed User
Longtime User
With the conditions if you share the project with "export to zip" the secrets are also shared with the code if they are hard coded...
 

walt61

Active Member
Licensed User
Longtime User
How about using @Peter Simpson 's suggestion combined with CustomBuildActions (or IDE comment links)? Haven't given it much thought, just an idea. (Could be a bad one )

Edit: I mean, CBAs or IDE comment links to copy the 'real' secrets file or a dummy one to Files. You'd still have to remember to click the appropriate link before exporting.
 
Last edited:

hatzisn

Expert
Licensed User
Longtime User

That is a great idea. It has made my mind light a bulb and that bulb is an IDE link with a b4j console app that performs all the actions. That is copy all files to a new temp folder replace secrets.txt which will be read as a map and used also as a map and create also the zip with the dummy secrets.txt which zip will be copied back to the project folder and remove all the contents of the temp folder. Great solution for B4A, B4J, B4i and we will see what we can do with B4R. Thanks.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…