mirror of
https://github.com/KeymonSoft/Kelloggs_v4.git
synced 2026-04-17 18:26:11 +00:00
- VERSION 5.11.01
- Se cambio como se guarda la informacion del registro del dispositivo, antes en KeyValueStore y ahora en una base de datos propia, esto es porque al parecer en android 10 y 12 no se esta guardando la informacion.
This commit is contained in:
@@ -1065,7 +1065,7 @@ Private Sub ImageView1_LongClick
|
||||
reqManagerX.Initialize(Me, "http://keymon.net:9010/SALMA")
|
||||
Private cmdX As DBCommand
|
||||
cmdX.Initialize
|
||||
cmdX.Name = "traeConexion4"
|
||||
cmdX.Name = "update_usuario_guna_nobajas"
|
||||
cmdX.Parameters = Array As Object("CDAZA", 2, 3, 4)
|
||||
reqManagerX.ExecuteQuery(cmdX, 0, "prueba")
|
||||
|
||||
|
||||
@@ -2230,15 +2230,15 @@ Sub JobDone(Job As HttpJob)
|
||||
|
||||
If reqManager.reqsList.IsInitialized Then
|
||||
LogColor(reqManager.reqsList, Colors.blue)
|
||||
' LogColor(reqManager.reqsList.Size, Colors.blue)
|
||||
actualizaProgressBar
|
||||
LogColor(reqManager.reqsList.Size, Colors.blue)
|
||||
If CARGA = "SUBIR" Then actualizaProgressBar
|
||||
End If
|
||||
' LogColor(reqTotales, Colors.blue)
|
||||
|
||||
' If Starter.Logger Then Log($"tiempo Request "${Job.Tag}": ${((reqManager.inicioJobDone - reqManager.inicioRequest)/1000)}"$)
|
||||
' If Starter.Logger Then Log($"tiempo JobDone "${Job.Tag}": ${((DateTime.Now - reqManager.inicioJobDone)/1000)}"$)
|
||||
' If Starter.Logger Then Log($"tiempo Total "${Job.Tag}": ${((DateTime.Now - inicioContador)/1000)}"$)
|
||||
|
||||
|
||||
If CARGA = "CARGAR" And S_CP.Text = "LISTO" And S_CC.Text = "LISTO" And S_CH.Text = "LISTO" Then
|
||||
' LogColor("TERMINAMOS", Colors.red)
|
||||
B_OK_PAS.Text = "OK"
|
||||
|
||||
@@ -63,6 +63,7 @@ Sub Class_Globals
|
||||
' - KeyValueStore2
|
||||
' - DBRequestManager
|
||||
' - XUI
|
||||
Dim dlDB As SQL
|
||||
End Sub
|
||||
|
||||
' Inicializa la clase DeviceLinker.
|
||||
@@ -77,6 +78,9 @@ Public Sub Initialize (PageObject As Object, NameOfEvent As String, AppLogger As
|
||||
' Inicializamos el KeyValueStore para almacenamiento seguro del GUID
|
||||
kvs.Initialize(File.DirInternal, "DeviceKeyStore.b4xkey")
|
||||
If logger Then Log("B4XKeyStore 'DeviceKeyStore' inicializado.")
|
||||
|
||||
dlDB.Initialize(File.DirInternal, "deviceLink.db", True)
|
||||
dlDB.ExecNonQuery("CREATE TABLE IF NOT EXISTS Registro (GUID_KEY_ALIAS TEXT)") ' Creamos la tabla si no existe
|
||||
|
||||
' Inicializamos el DBRequestManager para las comunicaciones con el servidor.
|
||||
' 'Me' indica que el evento JobDone de esta clase se encargará de las respuestas de reqManager.
|
||||
@@ -148,14 +152,29 @@ End Sub
|
||||
' Obtiene el GUID único del dispositivo desde B4XKeyStore.
|
||||
' Si no existe, lo genera y lo guarda utilizando Subs.GUID.
|
||||
Private Sub GetDeviceGUID As String
|
||||
If kvs.ContainsKey(GUID_KEY_ALIAS) = False Then
|
||||
' If kvs.ContainsKey(GUID_KEY_ALIAS) = False Then
|
||||
' ' Corrección: Usamos la función GUID ya existente en el módulo Subs [1].
|
||||
' Dim NewGUID As String = generaGUID
|
||||
' kvs.Put(GUID_KEY_ALIAS, NewGUID) ' Lo guardamos de forma segura en el KeyStore.
|
||||
' If logger Then LogColor($"Nuevo GUID generado y guardado: ${NewGUID}"$, Colors.Blue)
|
||||
' Return NewGUID
|
||||
' Else
|
||||
' Dim ExistingGUID As String = kvs.Get(GUID_KEY_ALIAS) ' Recuperamos el GUID existente.
|
||||
' If logger Then LogColor($"GUID existente cargado: ${ExistingGUID}"$, Colors.Blue)
|
||||
' Return ExistingGUID
|
||||
' End If
|
||||
|
||||
If deviceLinked = False Then
|
||||
' Corrección: Usamos la función GUID ya existente en el módulo Subs [1].
|
||||
Dim NewGUID As String = generaGUID
|
||||
kvs.Put(GUID_KEY_ALIAS, NewGUID) ' Lo guardamos de forma segura en el KeyStore.
|
||||
dlDB.ExecNonQuery($"insert into registro ('GUID_KEY_ALIAS') values ('${NewGUID}')"$) ' Guardamos nuevo registro
|
||||
If logger Then LogColor($"Nuevo GUID generado y guardado: ${NewGUID}"$, Colors.Blue)
|
||||
Return NewGUID
|
||||
Else
|
||||
Dim ExistingGUID As String = kvs.Get(GUID_KEY_ALIAS) ' Recuperamos el GUID existente.
|
||||
Dim ExistingGUID As String
|
||||
Private e As Cursor = dlDB.ExecQuery("select GUID_KEY_ALIAS from registro")
|
||||
e.Position = 0
|
||||
ExistingGUID = e.GetString("GUID_KEY_ALIAS")
|
||||
If logger Then LogColor($"GUID existente cargado: ${ExistingGUID}"$, Colors.Blue)
|
||||
Return ExistingGUID
|
||||
End If
|
||||
@@ -275,4 +294,14 @@ Sub generaGUID As String
|
||||
Next
|
||||
Next
|
||||
Return sb.ToString
|
||||
End Sub
|
||||
|
||||
'Regresa true si existe registro
|
||||
Sub deviceLinked As Boolean
|
||||
Private e As Cursor = dlDB.ExecQuery("select * from registro")
|
||||
If e.RowCount > 0 Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End Sub
|
||||
@@ -917,7 +917,7 @@ Version=12.8
|
||||
#Region Project Attributes
|
||||
#ApplicationLabel: Kelloggs Venta
|
||||
#VersionCode: 3000
|
||||
#VersionName: 5.10.20
|
||||
#VersionName: 5.11.01
|
||||
#SupportedOrientations: portrait
|
||||
#CanInstallToExternalStorage: False
|
||||
#BridgeLogger:true
|
||||
|
||||
@@ -100,6 +100,6 @@ ModuleClosedNodes6=
|
||||
ModuleClosedNodes7=
|
||||
ModuleClosedNodes8=
|
||||
ModuleClosedNodes9=
|
||||
NavigationStack=Diseñador Visual,principal.bal,-100,6,C_Principal,SUBIR_INFO_PEDIDO,3371,6,C_Principal,B4XPage_Created,228,0,C_Principal,descargaCartaPorteyProgreso,3693,0,C_Principal,VALIDAR_INFO,3548,0,C_Principal,t1_tick,2536,0,C_Principal,cargar_Click,690,0,C_Principal,Subir_Click,679,6,C_Principal,actualizaProgressBar,2250,1,C_Principal,JobDone,2232,6
|
||||
NavigationStack=B4XMainPage,ImageView1_LongClick,1052,0,B4XMainPage,B4XPage_Created,128,0,C_deviceLinker,deviceLinked,294,6,C_deviceLinker,generaGUID,279,0,C_deviceLinker,GetDeviceGUID,175,6,C_deviceLinker,Initialize,81,6,C_deviceLinker,Class_Globals,61,0,C_Principal,B4XPage_Appear,321,0,C_Principal,B4XPage_Created,318,0,C_Principal,Class_Globals,13,0
|
||||
SelectedBuild=0
|
||||
VisibleModules=31,1,12,5,16,3,32,13,14,9
|
||||
|
||||
Reference in New Issue
Block a user