I am using SQLite to record user data Username, Password, ..
Password are crypted using HexCrypt module.
In Windows it is fine
If I take the the jar file to linux.
the program stop just after log("Avant")
Password are crypted using HexCrypt module.
In Windows it is fine
If I take the the jar file to linux.
Exception in runnable
java.lang.RuntimeException: java.nio.BufferUnderflowException
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:113)
at anywheresoftware.b4a.BA$2.run(BA.java:162)
at com.sun.javafx.application.PlatformImpl$4$1.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl$4$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$4.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.gtk.GtkApplication.enterNestedEventLoopImpl(Native Method)
at com.sun.glass.ui.gtk.GtkApplication._enterNestedEventLoop(Unknown Source)
at com.sun.glass.ui.Application.enterNestedEventLoop(Unknown Source)
at com.sun.glass.ui.EventLoop.enter(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(Unknown Source)
at javafx.stage.Stage.showAndWait(Unknown Source)
at anywheresoftware.b4j.objects.Form.ShowAndWait(Form.java:172)
at b4j.example.frmlogin._show(frmlogin.java:224)
at b4j.example.main._loginfirst(main.java:195)
at b4j.example.main._appstart(main.java:131)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
at b4j.example.main.start(main.java:33)
at com.sun.javafx.application.LauncherImpl$5.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl$5.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl$4$1.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl$4$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$4.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication$3$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Unknown Source)
at java.nio.DirectByteBuffer.getInt(Unknown Source)
at anywheresoftware.b4a.randomaccessfile.RandomAccessFile.ReadInt(RandomAccessFile.java:122)
at anywheresoftware.b4a.randomaccessfile.RandomAccessFile.readHelper(RandomAccessFile.java:346)
at anywheresoftware.b4a.randomaccessfile.RandomAccessFile.ReadObject(RandomAccessFile.java:335)
at b4j.example.hexcrypt._fromhexastring(hexcrypt.java:58)
at b4j.example.hexcrypt._crypt(hexcrypt.java:34)
at b4j.example.frmlogin._btnok_action(frmlogin.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
... 33 more
the program stop just after log("Avant")
B4X:
Dim m As Map
m = DBUtils.ExecuteMap(Main.BDD, "SELECT * FROM UserLogin WHERE login = ?", _
Array As String(TFName.Text))
Log(TFName.Text)
If m.IsInitialized = False Then
conx = False
Else
conx = True
frommdp = m.Get("mdp") 'keys are lower cased!
Log(PasswdF.Text)
If PasswdF.Text <> "" Then
Log("Avant")
mdp = HexCrypt.Crypt("de", frommdp, "CleStructure", TFName.Text)
Log("Apres")
Else
mdp = ""
End If
.........
Public Sub Crypt(sAction As String, sStrInput As String, sCryptKey As String, sName As String) As String
sAction = sAction.ToUpperCase
Select sAction.ToUpperCase
Case "de".ToUpperCase
Return FromHexaString(sStrInput, sCryptKey, sName)
Case "en".ToUpperCase
Return ToHexaString(sStrInput, sCryptKey, sName)
End Select
Return "Rien"
End Sub
Private Sub FromHexaString(sStr As String, sCryptKey As String, sName As String) As String
Dim sRes As String
Dim raf As RandomAccessFile
raf.Initialize(File.DirApp & "/.ndf", sName & ".dat", False)
sRes = raf.ReadObject(raf.CurrentPosition)
raf.Close
Return sRes
End Sub