The compiler doesn't know anything about your Java code.
The variable was not obfuscated because it has an underscore in its name. It is good that it wasn't obfuscated as your Java code would have failed if it was obfuscated.
Dear Erel,
The problem is that I'm trying to use a variable from main Activity, in another activity.
When I compile with obfuscation, the name of the activity changes.
This code works fine without obfuscation:
public void _onCreate() {
if(this._main._terminal_mypos_presente==1) {
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
But with obfuscation, I got this error:
B4A Version: 9.30
Java Version: 8
Parsing code. (4.93s)
Building folders structure. (0.31s)
Compiling code. (4.39s)
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code. (0.02s)
Organizing libraries. (0.13s)
(AndroidX SDK)
Generating R file. (0.03s)
Compiling generated Java code. Error
javac 1.8.0_181
src\com\invoice\activity_faturar.java:11022: error: cannot find symbol
if(this._main._terminal_mypos_presente==1) {
^
symbol: variable _main
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
I also try without "this." but don't compile.
How can I obfuscate and use the main variable?