B4J Question Export State (Code Bundle) issues

Peter Lewis

Well-Known Member
Licensed User
Longtime User
Hey all. I have been trying to do a code bundle export but I have found some really wierd issues. Some of the vales are changed . I have the following in the code bundle
B4X:
Private Sub InitializeLocalServer
    Try
        server.Initialize("server")
        server.Port = 8088
        server.SetStaticFilesOptions(CreateMap("dirAllowed": False))

        server.AddHandler("/health", "PCS001_HealthHandler", False)
        server.AddHandler("/identity", "PCS001_IdentityHandler", False)
        server.AddHandler("/diagnostics", "PCS001_DiagnosticsHandler", False)
        server.AddHandler("/api/player/heartbeat", "PCS001_PlayerHeartbeatHandler", False)

        server.Start
        Log("PCS001-MAIN Local API started port=" & server.Port)
    Catch
        Log("PCS001-MAIN InitializeLocalServer ERROR port=8088" & _
            " message=" & LastException.Message & _
            " exception=" & LastException)
    End Try
End Sub

but when I export the code bundle I am picking up this

B4X:
  server.AddHandler(\"\/diagnostics\", \"0000-0000\", False)\r\n
  server.AddHandler(\"\/api\/player\/heartbeat\", \"0000-0000\", False)\r\n\r\n

I do not know where the 0000-0000 came from , The application does run and does not report sny errors. But in the code bundle thse appear like this .

Any clues ? Thank you
 

teddybear

Well-Known Member
Licensed User
This is because the export state you performed in Release(obfuscated) mode.
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
It is not related to obfuscation.

Code bundle enforces several heuristics to try and find "secret keys" and replace them. You can see it in the logs when the bundle is created. This shouldn't cause any problem other than the AI not having access to these strings. If it bothers you then workaround it with something like: "PCS001" & "_DiagnosticsHandler"
 
Upvote 0
Top