Is there a chance to auto-remove all log() command lines from Code-Modules and Activity-Modules as a first step of the compiling process?
I often write log() commands in my code to observe the app during execution. They contain readable strings with sensitiv informations. I want to keep all log() lines in my code for future development. This makes the development very comfortable for me.
But now my development of the current app reaches the final, where I want to publish my app. Now I want to remove all (~1000) lines with log() for security reasons before compiling starts.
I know how to do this with a VB-Script. But this needs to make Backups of each module, then run the script on each module-file. Then start B4A again and compile the manipulated files and afterwards I have to replace the module with the backups.
now I have two questions:
Is there a compiler-option to remove certain line types automatically during the comping process?
Or is there a chance to insert an EXE as a first step in the compiling process to manipulate code files temporary and offer these files to the compiler?
Thanks for your ideas, but... No, I dont want to stop the logging... I need to remove the strings from the code. They contain a lot of information about what is happening in my subs. As long as the content of the logs()-lines keeps in the code, any obfuscating would not help anything!
Yes, it would be a pain to add a conditional flag around EVERY log statement, but why not just add a conditional flag around just the log entries that include confidential info?
Then you may use #iderun (or something like that) to call a command line grep text replace utility to put ' single quote before all log( lines.
...Anand
This sounds interesting! Will this be able start an exe that changes the code line only during the compiling process? Or are the code line afterwards also changed in the IDE? Can you show my how such a toll call looks like? And you put this line only once on top of your code?
This is my plan B of course. But I did not know, whether there is perhaps a more elegant way to force the compiler to ignore log() lines. So I asked...
This sounds interesting! Will this be able start an exe that changes the code line only during the compiling process? Or are the code line afterwards also changed in the IDE? Can you show my how such a toll call looks like? And you put this line only once on top of your code?
This tutorial explains how the new conditional compilation feature can be used to change the app icon and the assets files based on the chosen build configuration. See this tutorial for more information about build configurations: http://www.b4x.com/android/forum/threads/40746/#content We have...
www.b4x.com
Here you can call a command line text replace exe (instead of robocopy) and pass your .b4a file with the regex command to replace the text.