Bug? Smart String Literal over multiple lines And Obfuscation

Discussion in 'Bugs & wishlist' started by cimperia, May 7, 2015.

  1. cimperia

    cimperia Active Member Licensed User

    I have a project where I have the following query stored in a Smart String Literal. The query is actually much longer, but the issue will reveal itself with this cut-down version:

    Sub Process_Globals
    Private Const SELECT_ALL As String = _
       ,         kt_mem_deck
       ,         kt_name

    End Sub
    I am not trying to obfuscate this variable at this stage, but when I compile the project with "Release (obfuscated)", at run time the app fails with the current error:

    android.database.sqlite.SQLiteException: unrecognized token: "\" (code 1): , while compiling: SELECT\n    id\n   ,  kt_mem_deck\n   ,  kt_name\n   FROM\n    v_stacktestsettings
    It looks like the new lines characters '\n' get messed up ...

    If I use this query where the text holds on one line, the apps runs OK:
    Private Const SELECT_ALL As String = _
    $"SELECT id, kt_mem_deck, kt_name FROM v_stacktestsettings"$
    If I remove the "_" from the variable name, the issue persists, as it looks that the issue is with the new line character in obfuscated mode.
  2. Erel

    Erel Administrator Staff Member Licensed User

    It is a bug and it is fixed for the next update. You can move it to Globals instead of Process_Globals to prevent it from being obfuscated.
  3. cimperia

    cimperia Active Member Licensed User

    OK thanks. I can't move "it" to Globals as the query is used in multiple activities, however I reverted to the regular string and it works fine.