package SHARK2.keymon.com.mx;


import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.B4AClass;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.debug.*;

public class c_subs extends B4AClass.ImplB4AClass implements BA.SubDelegator{
    private static java.util.HashMap<String, java.lang.reflect.Method> htSubs;
    private void innerInitialize(BA _ba) throws Exception {
        if (ba == null) {
            ba = new anywheresoftware.b4a.ShellBA(_ba, this, htSubs, "SHARK2.keymon.com.mx.c_subs");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", SHARK2.keymon.com.mx.c_subs.class).invoke(this, new Object[] {null});
        else
            ba.raiseEvent2(null, true, "class_globals", false);
    }

 
    public void  innerInitializeHelper(anywheresoftware.b4a.BA _ba) throws Exception{
        innerInitialize(_ba);
    }
    public Object callSub(String sub, Object sender, Object[] args) throws Exception {
        return BA.SubDelegator.SubNotFound;
    }
public anywheresoftware.b4a.keywords.Common __c = null;
public SHARK2.keymon.com.mx.dbrequestmanager _reqmanager = null;
public String _eventname = "";
public Object _callback = null;
public anywheresoftware.b4a.phone.Phone _phn = null;
public String _devmodel = "";
public anywheresoftware.b4a.sql.SQL _db = null;
public anywheresoftware.b4a.sql.SQL _kmt = null;
public anywheresoftware.b4a.sql.SQL _errorlog = null;
public String _ssid = "";
public anywheresoftware.b4a.objects.collections.List _reqslist = null;
public boolean _reqerror = false;
public boolean _subslogs = false;
public b4a.example.dateutils _dateutils = null;
public SHARK2.keymon.com.mx.main _main = null;
public SHARK2.keymon.com.mx.appupdater _appupdater = null;
public SHARK2.keymon.com.mx.mapa_cliente _mapa_cliente = null;
public SHARK2.keymon.com.mx.mapa_rutas _mapa_rutas = null;
public SHARK2.keymon.com.mx.notificationservice _notificationservice = null;
public SHARK2.keymon.com.mx.pendientes _pendientes = null;
public SHARK2.keymon.com.mx.starter _starter = null;
public SHARK2.keymon.com.mx.subs _subs = null;
public SHARK2.keymon.com.mx.tracker _tracker = null;
public SHARK2.keymon.com.mx.newinst2 _newinst2 = null;
public SHARK2.keymon.com.mx.b4xpages _b4xpages = null;
public SHARK2.keymon.com.mx.b4xcollections _b4xcollections = null;
public SHARK2.keymon.com.mx.httputils2service _httputils2service = null;
public SHARK2.keymon.com.mx.xuiviewsutils _xuiviewsutils = null;
public Object  _initialize(SHARK2.keymon.com.mx.c_subs __ref,anywheresoftware.b4a.BA _ba,Object _vcallback,String _veventname) throws Exception{
__ref = this;
innerInitialize(_ba);
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "initialize", false))
	 {return ((Object) Debug.delegate(ba, "initialize", new Object[] {_ba,_vcallback,_veventname}));}
RDebugUtils.currentLine=22872064;
 //BA.debugLineNum = 22872064;BA.debugLine="Public Sub Initialize (vCallback As Object, vEvent";
RDebugUtils.currentLine=22872065;
 //BA.debugLineNum = 22872065;BA.debugLine="reqsList.Initialize";
__ref._reqslist /*anywheresoftware.b4a.objects.collections.List*/ .Initialize();
RDebugUtils.currentLine=22872066;
 //BA.debugLineNum = 22872066;BA.debugLine="EventName = vEventName";
__ref._eventname /*String*/  = _veventname;
RDebugUtils.currentLine=22872067;
 //BA.debugLineNum = 22872067;BA.debugLine="CallBack = vCallback";
__ref._callback /*Object*/  = _vcallback;
RDebugUtils.currentLine=22872068;
 //BA.debugLineNum = 22872068;BA.debugLine="db = dbInit";
__ref._db /*anywheresoftware.b4a.sql.SQL*/  = __ref._dbinit /*anywheresoftware.b4a.sql.SQL*/ (null);
RDebugUtils.currentLine=22872069;
 //BA.debugLineNum = 22872069;BA.debugLine="reqManager = reqManagerInit";
__ref._reqmanager /*SHARK2.keymon.com.mx.dbrequestmanager*/  = __ref._reqmanagerinit /*SHARK2.keymon.com.mx.dbrequestmanager*/ (null);
RDebugUtils.currentLine=22872070;
 //BA.debugLineNum = 22872070;BA.debugLine="Return Me";
if (true) return this;
RDebugUtils.currentLine=22872071;
 //BA.debugLineNum = 22872071;BA.debugLine="End Sub";
return null;
}
public String  _agregacolumna(SHARK2.keymon.com.mx.c_subs __ref,String _tabla,String _columna,String _tipo) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "agregacolumna", false))
	 {return ((String) Debug.delegate(ba, "agregacolumna", new Object[] {_tabla,_columna,_tipo}));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
RDebugUtils.currentLine=24969216;
 //BA.debugLineNum = 24969216;BA.debugLine="Sub agregaColumna(tabla As String, columna As Stri";
RDebugUtils.currentLine=24969217;
 //BA.debugLineNum = 24969217;BA.debugLine="Try 'Intentamos usar \"pragma_table_info\" para rev";
try {RDebugUtils.currentLine=24969218;
 //BA.debugLineNum = 24969218;BA.debugLine="Private c As Cursor = db.ExecQuery($\"SELECT COUN";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(__ref._db /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("SELECT COUNT(*) AS fCol FROM pragma_table_info('"+__c.SmartStringFormatter("",(Object)(_tabla))+"') WHERE name='"+__c.SmartStringFormatter("",(Object)(_columna))+"'"))));
RDebugUtils.currentLine=24969219;
 //BA.debugLineNum = 24969219;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=24969220;
 //BA.debugLineNum = 24969220;BA.debugLine="If c.GetString(\"fCol\") = 0 Then 'Si no esta la c";
if ((_c.GetString("fCol")).equals(BA.NumberToString(0))) { 
RDebugUtils.currentLine=24969221;
 //BA.debugLineNum = 24969221;BA.debugLine="db.ExecNonQuery($\"ALTER TABLE ${tabla} ADD COLU";
__ref._db /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("ALTER TABLE "+__c.SmartStringFormatter("",(Object)(_tabla))+" ADD COLUMN "+__c.SmartStringFormatter("",(Object)(_columna))+" "+__c.SmartStringFormatter("",(Object)(_tipo))+""));
RDebugUtils.currentLine=24969222;
 //BA.debugLineNum = 24969222;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
__c.LogImpl("524969222",("Columna \""+__c.SmartStringFormatter("",(Object)(_columna))+" "+__c.SmartStringFormatter("",(Object)(_tipo))+"\", agregada a \""+__c.SmartStringFormatter("",(Object)(_tabla))+"\"."),0);
 };
 } 
       catch (Exception e9) {
			ba.setLastException(e9);RDebugUtils.currentLine=24969225;
 //BA.debugLineNum = 24969225;BA.debugLine="Try";
try {RDebugUtils.currentLine=24969226;
 //BA.debugLineNum = 24969226;BA.debugLine="db.ExecNonQuery($\"ALTER TABLE ${tabla} ADD COLU";
__ref._db /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("ALTER TABLE "+__c.SmartStringFormatter("",(Object)(_tabla))+" ADD COLUMN "+__c.SmartStringFormatter("",(Object)(_columna))+" "+__c.SmartStringFormatter("",(Object)(_tipo))+""));
RDebugUtils.currentLine=24969227;
 //BA.debugLineNum = 24969227;BA.debugLine="Log($\"Columna \"${columna} ${tipo}\", agregada a";
__c.LogImpl("524969227",("Columna \""+__c.SmartStringFormatter("",(Object)(_columna))+" "+__c.SmartStringFormatter("",(Object)(_tipo))+"\", agregada a \""+__c.SmartStringFormatter("",(Object)(_tabla))+"\".."),0);
 } 
       catch (Exception e13) {
			ba.setLastException(e13);RDebugUtils.currentLine=24969229;
 //BA.debugLineNum = 24969229;BA.debugLine="Log(LastException)";
__c.LogImpl("524969229",BA.ObjectToString(__c.LastException(getActivityBA())),0);
 };
 };
RDebugUtils.currentLine=24969232;
 //BA.debugLineNum = 24969232;BA.debugLine="End Sub";
return "";
}
public String  _borralogdb(SHARK2.keymon.com.mx.c_subs __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "borralogdb", false))
	 {return ((String) Debug.delegate(ba, "borralogdb", null));}
RDebugUtils.currentLine=24051712;
 //BA.debugLineNum = 24051712;BA.debugLine="Sub borraLogDB 'ignore";
RDebugUtils.currentLine=24051713;
 //BA.debugLineNum = 24051713;BA.debugLine="LogColor(\"Borramos BD de log\", Colors.Magenta)";
__c.LogImpl("524051713","Borramos BD de log",__c.Colors.Magenta);
RDebugUtils.currentLine=24051714;
 //BA.debugLineNum = 24051714;BA.debugLine="kmt.ExecNonQuery(\"delete from bitacora\")";
__ref._kmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from bitacora");
RDebugUtils.currentLine=24051715;
 //BA.debugLineNum = 24051715;BA.debugLine="kmt.ExecNonQuery(\"vacuum;\")";
__ref._kmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("vacuum;");
RDebugUtils.currentLine=24051716;
 //BA.debugLineNum = 24051716;BA.debugLine="End Sub";
return "";
}
public String  _buscadbusuario(SHARK2.keymon.com.mx.c_subs __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "buscadbusuario", false))
	 {return ((String) Debug.delegate(ba, "buscadbusuario", null));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _usuario = "";
RDebugUtils.currentLine=24641536;
 //BA.debugLineNum = 24641536;BA.debugLine="Sub buscaDBUsuario As String 'ignore";
RDebugUtils.currentLine=24641537;
 //BA.debugLineNum = 24641537;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=24641538;
 //BA.debugLineNum = 24641538;BA.debugLine="Private usuario As String = \"SinUsuario\"";
_usuario = "SinUsuario";
RDebugUtils.currentLine=24641539;
 //BA.debugLineNum = 24641539;BA.debugLine="c=kmt.ExecQuery(\"select USUARIO from usuarioa\")";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(__ref._kmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select USUARIO from usuarioa")));
RDebugUtils.currentLine=24641540;
 //BA.debugLineNum = 24641540;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=24641541;
 //BA.debugLineNum = 24641541;BA.debugLine="If c.RowCount > 0 Then usuario = c.GetString(\"USU";
if (_c.getRowCount()>0) { 
_usuario = _c.GetString("USUARIO");};
RDebugUtils.currentLine=24641542;
 //BA.debugLineNum = 24641542;BA.debugLine="Return usuario";
if (true) return _usuario;
RDebugUtils.currentLine=24641543;
 //BA.debugLineNum = 24641543;BA.debugLine="End Sub";
return "";
}
public String  _centraetiqueta(SHARK2.keymon.com.mx.c_subs __ref,anywheresoftware.b4a.objects.LabelWrapper _elemento,int _anchoelementosuperior) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "centraetiqueta", false))
	 {return ((String) Debug.delegate(ba, "centraetiqueta", new Object[] {_elemento,_anchoelementosuperior}));}
RDebugUtils.currentLine=24379392;
 //BA.debugLineNum = 24379392;BA.debugLine="Sub centraEtiqueta(elemento As Label, anchoElement";
RDebugUtils.currentLine=24379393;
 //BA.debugLineNum = 24379393;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
_elemento.setLeft((int) (__c.Round(_anchoelementosuperior/(double)2)-(_elemento.getWidth()/(double)2)));
RDebugUtils.currentLine=24379394;
 //BA.debugLineNum = 24379394;BA.debugLine="End Sub";
return "";
}
public String  _centrapanel(SHARK2.keymon.com.mx.c_subs __ref,anywheresoftware.b4a.objects.PanelWrapper _elemento,int _anchoelementosuperior) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "centrapanel", false))
	 {return ((String) Debug.delegate(ba, "centrapanel", new Object[] {_elemento,_anchoelementosuperior}));}
RDebugUtils.currentLine=24444928;
 //BA.debugLineNum = 24444928;BA.debugLine="Sub centraPanel(elemento As Panel, anchoElementoSu";
RDebugUtils.currentLine=24444929;
 //BA.debugLineNum = 24444929;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
_elemento.setLeft((int) (__c.Round(_anchoelementosuperior/(double)2)-(_elemento.getWidth()/(double)2)));
RDebugUtils.currentLine=24444930;
 //BA.debugLineNum = 24444930;BA.debugLine="End Sub";
return "";
}
public String  _centrapanelv(SHARK2.keymon.com.mx.c_subs __ref,anywheresoftware.b4a.objects.PanelWrapper _elemento,int _altoelementosuperior) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "centrapanelv", false))
	 {return ((String) Debug.delegate(ba, "centrapanelv", new Object[] {_elemento,_altoelementosuperior}));}
RDebugUtils.currentLine=24510464;
 //BA.debugLineNum = 24510464;BA.debugLine="Sub centraPanelV(elemento As Panel, altoElementoSu";
RDebugUtils.currentLine=24510465;
 //BA.debugLineNum = 24510465;BA.debugLine="elemento.Top = Round(altoElementoSuperior/2)-(ele";
_elemento.setTop((int) (__c.Round(_altoelementosuperior/(double)2)-(_elemento.getHeight()/(double)2)));
RDebugUtils.currentLine=24510466;
 //BA.debugLineNum = 24510466;BA.debugLine="End Sub";
return "";
}
public String  _centraprogressbar(SHARK2.keymon.com.mx.c_subs __ref,anywheresoftware.b4a.objects.ProgressBarWrapper _elemento,int _anchoelementosuperior) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "centraprogressbar", false))
	 {return ((String) Debug.delegate(ba, "centraprogressbar", new Object[] {_elemento,_anchoelementosuperior}));}
RDebugUtils.currentLine=24576000;
 //BA.debugLineNum = 24576000;BA.debugLine="Sub centraProgressBar(elemento As ProgressBar, anc";
RDebugUtils.currentLine=24576001;
 //BA.debugLineNum = 24576001;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
_elemento.setLeft((int) (__c.Round(_anchoelementosuperior/(double)2)-(_elemento.getWidth()/(double)2)));
RDebugUtils.currentLine=24576002;
 //BA.debugLineNum = 24576002;BA.debugLine="End Sub";
return "";
}
public boolean  _checknotificationaccess(SHARK2.keymon.com.mx.c_subs __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "checknotificationaccess", false))
	 {return ((Boolean) Debug.delegate(ba, "checknotificationaccess", null));}
anywheresoftware.b4a.phone.Phone _ph = null;
String _nstr = "";
String _pstr = "";
anywheresoftware.b4a.agraham.reflection.Reflection _r = null;
RDebugUtils.currentLine=25559040;
 //BA.debugLineNum = 25559040;BA.debugLine="Sub CheckNotificationAccess As Boolean 'ignore";
RDebugUtils.currentLine=25559041;
 //BA.debugLineNum = 25559041;BA.debugLine="Dim ph As Phone";
_ph = new anywheresoftware.b4a.phone.Phone();
RDebugUtils.currentLine=25559042;
 //BA.debugLineNum = 25559042;BA.debugLine="Dim nstr, pstr As String";
_nstr = "";
_pstr = "";
RDebugUtils.currentLine=25559043;
 //BA.debugLineNum = 25559043;BA.debugLine="Dim r As Reflector";
_r = new anywheresoftware.b4a.agraham.reflection.Reflection();
RDebugUtils.currentLine=25559044;
 //BA.debugLineNum = 25559044;BA.debugLine="pstr = r.GetStaticField(\"anywheresoftware.b4a.BA\"";
_pstr = BA.ObjectToString(_r.GetStaticField("anywheresoftware.b4a.BA","packageName"));
RDebugUtils.currentLine=25559045;
 //BA.debugLineNum = 25559045;BA.debugLine="nstr = ph.GetSettings(\"enabled_notification_liste";
_nstr = _ph.GetSettings("enabled_notification_listeners");
RDebugUtils.currentLine=25559046;
 //BA.debugLineNum = 25559046;BA.debugLine="Return nstr.Contains(pstr)";
if (true) return _nstr.contains(_pstr);
RDebugUtils.currentLine=25559047;
 //BA.debugLineNum = 25559047;BA.debugLine="End Sub";
return false;
}
public String  _class_globals(SHARK2.keymon.com.mx.c_subs __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
RDebugUtils.currentLine=22806528;
 //BA.debugLineNum = 22806528;BA.debugLine="Sub Class_Globals";
RDebugUtils.currentLine=22806533;
 //BA.debugLineNum = 22806533;BA.debugLine="Dim reqManager As DBRequestManager";
_reqmanager = new SHARK2.keymon.com.mx.dbrequestmanager();
RDebugUtils.currentLine=22806534;
 //BA.debugLineNum = 22806534;BA.debugLine="Private EventName As String 'ignore";
_eventname = "";
RDebugUtils.currentLine=22806535;
 //BA.debugLineNum = 22806535;BA.debugLine="Private CallBack As Object 'ignore";
_callback = new Object();
RDebugUtils.currentLine=22806536;
 //BA.debugLineNum = 22806536;BA.debugLine="Dim phn As Phone";
_phn = new anywheresoftware.b4a.phone.Phone();
RDebugUtils.currentLine=22806537;
 //BA.debugLineNum = 22806537;BA.debugLine="Dim devModel As String";
_devmodel = "";
RDebugUtils.currentLine=22806538;
 //BA.debugLineNum = 22806538;BA.debugLine="Dim db, kmt, errorLog As SQL 'Requiere la libreri";
_db = new anywheresoftware.b4a.sql.SQL();
_kmt = new anywheresoftware.b4a.sql.SQL();
_errorlog = new anywheresoftware.b4a.sql.SQL();
RDebugUtils.currentLine=22806539;
 //BA.debugLineNum = 22806539;BA.debugLine="Dim ssid As String  'ignore";
_ssid = "";
RDebugUtils.currentLine=22806540;
 //BA.debugLineNum = 22806540;BA.debugLine="Dim reqsList As List";
_reqslist = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=22806541;
 //BA.debugLineNum = 22806541;BA.debugLine="Dim reqError As Boolean = False";
_reqerror = __c.False;
RDebugUtils.currentLine=22806542;
 //BA.debugLineNum = 22806542;BA.debugLine="Private subsLogs As Boolean = False";
_subslogs = __c.False;
RDebugUtils.currentLine=22806543;
 //BA.debugLineNum = 22806543;BA.debugLine="End Sub";
return "";
}
public String  _copiadb(SHARK2.keymon.com.mx.c_subs __ref,boolean _result) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "copiadb", false))
	 {return ((String) Debug.delegate(ba, "copiadb", new Object[] {_result}));}
String _p = "";
String _thedir = "";
RDebugUtils.currentLine=24248320;
 //BA.debugLineNum = 24248320;BA.debugLine="Sub copiaDB(result As Boolean) 'ignore";
RDebugUtils.currentLine=24248321;
 //BA.debugLineNum = 24248321;BA.debugLine="ToastMessageShow(\"copiaDB\", False)";
__c.ToastMessageShow(BA.ObjectToCharSequence("copiaDB"),__c.False);
RDebugUtils.currentLine=24248322;
 //BA.debugLineNum = 24248322;BA.debugLine="If result Then";
if (_result) { 
RDebugUtils.currentLine=24248323;
 //BA.debugLineNum = 24248323;BA.debugLine="Dim p As String";
_p = "";
RDebugUtils.currentLine=24248324;
 //BA.debugLineNum = 24248324;BA.debugLine="If File.ExternalWritable Then";
if (__c.File.getExternalWritable()) { 
RDebugUtils.currentLine=24248325;
 //BA.debugLineNum = 24248325;BA.debugLine="p = File.DirInternal";
_p = __c.File.getDirInternal();
 }else {
RDebugUtils.currentLine=24248328;
 //BA.debugLineNum = 24248328;BA.debugLine="p = File.DirInternal";
_p = __c.File.getDirInternal();
 };
RDebugUtils.currentLine=24248331;
 //BA.debugLineNum = 24248331;BA.debugLine="Dim theDir As String";
_thedir = "";
RDebugUtils.currentLine=24248332;
 //BA.debugLineNum = 24248332;BA.debugLine="Try";
try {RDebugUtils.currentLine=24248333;
 //BA.debugLineNum = 24248333;BA.debugLine="File.MakeDir(File.DirInternal,\"kmts\")";
__c.File.MakeDir(__c.File.getDirInternal(),"kmts");
RDebugUtils.currentLine=24248334;
 //BA.debugLineNum = 24248334;BA.debugLine="theDir = \"/kmts\"";
_thedir = "/kmts";
 } 
       catch (Exception e14) {
			ba.setLastException(e14);RDebugUtils.currentLine=24248336;
 //BA.debugLineNum = 24248336;BA.debugLine="theDir = \"\"";
_thedir = "";
 };
RDebugUtils.currentLine=24248338;
 //BA.debugLineNum = 24248338;BA.debugLine="Try";
try {RDebugUtils.currentLine=24248339;
 //BA.debugLineNum = 24248339;BA.debugLine="File.Copy(File.DirInternal,\"kmt.db\",File.DirInt";
__c.File.Copy(__c.File.getDirInternal(),"kmt.db",__c.File.getDirInternal()+_thedir,"cedex_kmt.db");
RDebugUtils.currentLine=24248340;
 //BA.debugLineNum = 24248340;BA.debugLine="File.Copy(File.DirInternal,\"errorLog.db\",File.D";
__c.File.Copy(__c.File.getDirInternal(),"errorLog.db",__c.File.getDirInternal()+_thedir,"cedex_errorLog.db");
RDebugUtils.currentLine=24248341;
 //BA.debugLineNum = 24248341;BA.debugLine="ToastMessageShow(\"BD copiada!\", False)";
__c.ToastMessageShow(BA.ObjectToCharSequence("BD copiada!"),__c.False);
 } 
       catch (Exception e21) {
			ba.setLastException(e21);RDebugUtils.currentLine=24248343;
 //BA.debugLineNum = 24248343;BA.debugLine="ToastMessageShow(\"No se pudo hacer la copia: \"&";
__c.ToastMessageShow(BA.ObjectToCharSequence("No se pudo hacer la copia: "+BA.ObjectToString(__c.LastException(getActivityBA()))),__c.True);
 };
RDebugUtils.currentLine=24248345;
 //BA.debugLineNum = 24248345;BA.debugLine="Log(\"rootExternal=\"&p)";
__c.LogImpl("524248345","rootExternal="+_p,0);
RDebugUtils.currentLine=24248346;
 //BA.debugLineNum = 24248346;BA.debugLine="Log(\"File.DirInternal=\"&File.DirInternal)";
__c.LogImpl("524248346","File.DirInternal="+__c.File.getDirInternal(),0);
RDebugUtils.currentLine=24248347;
 //BA.debugLineNum = 24248347;BA.debugLine="Log(\"File.DirInternal=\"&File.DirInternal)";
__c.LogImpl("524248347","File.DirInternal="+__c.File.getDirInternal(),0);
 }else {
RDebugUtils.currentLine=24248349;
 //BA.debugLineNum = 24248349;BA.debugLine="ToastMessageShow(\"Sin permisos\", False)";
__c.ToastMessageShow(BA.ObjectToCharSequence("Sin permisos"),__c.False);
 };
RDebugUtils.currentLine=24248351;
 //BA.debugLineNum = 24248351;BA.debugLine="End Sub";
return "";
}
public anywheresoftware.b4a.objects.NotificationWrapper  _createnotification(SHARK2.keymon.com.mx.c_subs __ref,String _body) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "createnotification", false))
	 {return ((anywheresoftware.b4a.objects.NotificationWrapper) Debug.delegate(ba, "createnotification", new Object[] {_body}));}
anywheresoftware.b4a.objects.NotificationWrapper _notification = null;
RDebugUtils.currentLine=25231360;
 //BA.debugLineNum = 25231360;BA.debugLine="Sub CreateNotification (Body As String) As Notific";
RDebugUtils.currentLine=25231361;
 //BA.debugLineNum = 25231361;BA.debugLine="Dim notification As Notification";
_notification = new anywheresoftware.b4a.objects.NotificationWrapper();
RDebugUtils.currentLine=25231362;
 //BA.debugLineNum = 25231362;BA.debugLine="notification.Initialize2(notification.IMPORTANCE_";
_notification.Initialize2(_notification.IMPORTANCE_LOW);
RDebugUtils.currentLine=25231363;
 //BA.debugLineNum = 25231363;BA.debugLine="notification.Icon = \"icon\"";
_notification.setIcon("icon");
RDebugUtils.currentLine=25231364;
 //BA.debugLineNum = 25231364;BA.debugLine="notification.SetInfo(\"Tester\", Body, Main)";
_notification.SetInfoNew(ba,BA.ObjectToCharSequence("Tester"),BA.ObjectToCharSequence(_body),(Object)(_main.getObject()));
RDebugUtils.currentLine=25231365;
 //BA.debugLineNum = 25231365;BA.debugLine="Return notification";
if (true) return _notification;
RDebugUtils.currentLine=25231366;
 //BA.debugLineNum = 25231366;BA.debugLine="End Sub";
return null;
}
public anywheresoftware.b4a.sql.SQL  _dbinit(SHARK2.keymon.com.mx.c_subs __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "dbinit", false))
	 {return ((anywheresoftware.b4a.sql.SQL) Debug.delegate(ba, "dbinit", null));}
RDebugUtils.currentLine=22937600;
 //BA.debugLineNum = 22937600;BA.debugLine="Sub dbInit As SQL";
RDebugUtils.currentLine=22937601;
 //BA.debugLineNum = 22937601;BA.debugLine="If File.Exists(File.DirInternal, \"kmt.db\") = Fals";
if (__c.File.Exists(__c.File.getDirInternal(),"kmt.db")==__c.False) { 
__c.File.Copy(__c.File.getDirAssets(),"kmt.db",__c.File.getDirInternal(),"kmt.db");};
RDebugUtils.currentLine=22937602;
 //BA.debugLineNum = 22937602;BA.debugLine="db.Initialize(File.DirInternal,\"kmt.db\", True)";
__ref._db /*anywheresoftware.b4a.sql.SQL*/ .Initialize(__c.File.getDirInternal(),"kmt.db",__c.True);
RDebugUtils.currentLine=22937603;
 //BA.debugLineNum = 22937603;BA.debugLine="dbOk(True)";
__ref._dbok /*String*/ (null,__c.True);
RDebugUtils.currentLine=22937605;
 //BA.debugLineNum = 22937605;BA.debugLine="Return db";
if (true) return __ref._db /*anywheresoftware.b4a.sql.SQL*/ ;
RDebugUtils.currentLine=22937606;
 //BA.debugLineNum = 22937606;BA.debugLine="End Sub";
return null;
}
public String  _dbok(SHARK2.keymon.com.mx.c_subs __ref,boolean _success) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "dbok", false))
	 {return ((String) Debug.delegate(ba, "dbok", new Object[] {_success}));}
RDebugUtils.currentLine=23003136;
 //BA.debugLineNum = 23003136;BA.debugLine="Sub dbOk(Success As Boolean)";
RDebugUtils.currentLine=23003137;
 //BA.debugLineNum = 23003137;BA.debugLine="If SubExists(CallBack, EventName & \"_dbOk\") Then";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_dbOk")) { 
RDebugUtils.currentLine=23003138;
 //BA.debugLineNum = 23003138;BA.debugLine="CallSub2(CallBack, EventName & \"_dbOk\", Success)";
__c.CallSubNew2(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_dbOk",(Object)(_success));
 };
RDebugUtils.currentLine=23003140;
 //BA.debugLineNum = 23003140;BA.debugLine="End Sub";
return "";
}
public String  _deleteerrorlog_db(SHARK2.keymon.com.mx.c_subs __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "deleteerrorlog_db", false))
	 {return ((String) Debug.delegate(ba, "deleteerrorlog_db", null));}
RDebugUtils.currentLine=23724032;
 //BA.debugLineNum = 23724032;BA.debugLine="Sub deleteErrorLog_DB 'ignore";
RDebugUtils.currentLine=23724033;
 //BA.debugLineNum = 23724033;BA.debugLine="errorLog.ExecNonQuery(\"delete from errores\")";
__ref._errorlog /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from errores");
RDebugUtils.currentLine=23724034;
 //BA.debugLineNum = 23724034;BA.debugLine="errorLog.ExecNonQuery(\"vacuum;\")";
__ref._errorlog /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("vacuum;");
RDebugUtils.currentLine=23724035;
 //BA.debugLineNum = 23724035;BA.debugLine="ToastMessageShow(\"BD Errores Borrada\", False)";
__c.ToastMessageShow(BA.ObjectToCharSequence("BD Errores Borrada"),__c.False);
RDebugUtils.currentLine=23724036;
 //BA.debugLineNum = 23724036;BA.debugLine="End Sub";
return "";
}
public String  _deletegps_db(SHARK2.keymon.com.mx.c_subs __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "deletegps_db", false))
	 {return ((String) Debug.delegate(ba, "deletegps_db", null));}
RDebugUtils.currentLine=23658496;
 //BA.debugLineNum = 23658496;BA.debugLine="Sub deleteGPS_DB 'ignore";
RDebugUtils.currentLine=23658497;
 //BA.debugLineNum = 23658497;BA.debugLine="kmt.ExecNonQuery(\"delete from RUTA_GPS\")";
__ref._kmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from RUTA_GPS");
RDebugUtils.currentLine=23658498;
 //BA.debugLineNum = 23658498;BA.debugLine="kmt.ExecNonQuery(\"vacuum;\")";
__ref._kmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("vacuum;");
RDebugUtils.currentLine=23658499;
 //BA.debugLineNum = 23658499;BA.debugLine="ToastMessageShow(\"Borramos BD Coords GPS\", False)";
__c.ToastMessageShow(BA.ObjectToCharSequence("Borramos BD Coords GPS"),__c.False);
RDebugUtils.currentLine=23658500;
 //BA.debugLineNum = 23658500;BA.debugLine="End Sub";
return "";
}
public String  _enviook(SHARK2.keymon.com.mx.c_subs __ref,boolean _success) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "enviook", false))
	 {return ((String) Debug.delegate(ba, "enviook", new Object[] {_success}));}
RDebugUtils.currentLine=23265280;
 //BA.debugLineNum = 23265280;BA.debugLine="Sub envioOk(Success As Boolean)";
RDebugUtils.currentLine=23265282;
 //BA.debugLineNum = 23265282;BA.debugLine="If SubExists(CallBack, EventName & \"_envioOk\") Th";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_envioOk")) { 
RDebugUtils.currentLine=23265283;
 //BA.debugLineNum = 23265283;BA.debugLine="CallSub2(CallBack, EventName & \"_envioOk\", Succe";
__c.CallSubNew2(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_envioOk",(Object)(_success));
 };
RDebugUtils.currentLine=23265285;
 //BA.debugLineNum = 23265285;BA.debugLine="End Sub";
return "";
}
public String  _enviotest(SHARK2.keymon.com.mx.c_subs __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "enviotest", false))
	 {return ((String) Debug.delegate(ba, "enviotest", null));}
SHARK2.keymon.com.mx.dbrequestmanager._dbcommand _cmd = null;
int _i = 0;
RDebugUtils.currentLine=23199744;
 //BA.debugLineNum = 23199744;BA.debugLine="Sub envioTest";
RDebugUtils.currentLine=23199745;
 //BA.debugLineNum = 23199745;BA.debugLine="reqsList.Initialize ' Ponemos la lista de DBReque";
__ref._reqslist /*anywheresoftware.b4a.objects.collections.List*/ .Initialize();
RDebugUtils.currentLine=23199746;
 //BA.debugLineNum = 23199746;BA.debugLine="Private cmd As DBCommand";
_cmd = new SHARK2.keymon.com.mx.dbrequestmanager._dbcommand();
RDebugUtils.currentLine=23199747;
 //BA.debugLineNum = 23199747;BA.debugLine="cmd.Initialize";
_cmd.Initialize();
RDebugUtils.currentLine=23199748;
 //BA.debugLineNum = 23199748;BA.debugLine="cmd.Name = \"select_fecha\"";
_cmd.Name /*String*/  = "select_fecha";
RDebugUtils.currentLine=23199749;
 //BA.debugLineNum = 23199749;BA.debugLine="For i = 0 To 50";
{
final int step5 = 1;
final int limit5 = (int) (50);
_i = (int) (0) ;
for (;_i <= limit5 ;_i = _i + step5 ) {
RDebugUtils.currentLine=23199751;
 //BA.debugLineNum = 23199751;BA.debugLine="reqManager.ExecuteQuery(cmd, 0, $\"select_fecha_$";
__ref._reqmanager /*SHARK2.keymon.com.mx.dbrequestmanager*/ ._executequery /*String*/ (null,_cmd,(int) (0),(Object)(("select_fecha_"+__c.SmartStringFormatter("",(Object)(_i))+"")));
RDebugUtils.currentLine=23199752;
 //BA.debugLineNum = 23199752;BA.debugLine="reqsList.Add($\"select_fecha_${i}\"$)";
__ref._reqslist /*anywheresoftware.b4a.objects.collections.List*/ .Add((Object)(("select_fecha_"+__c.SmartStringFormatter("",(Object)(_i))+"")));
 }
};
RDebugUtils.currentLine=23199754;
 //BA.debugLineNum = 23199754;BA.debugLine="End Sub";
return "";
}
public String  _fechainiciohoy(SHARK2.keymon.com.mx.c_subs __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "fechainiciohoy", false))
	 {return ((String) Debug.delegate(ba, "fechainiciohoy", null));}
String _origformat = "";
String _h = "";
RDebugUtils.currentLine=23789568;
 //BA.debugLineNum = 23789568;BA.debugLine="Sub fechaInicioHoy As String 'ignore";
RDebugUtils.currentLine=23789569;
 //BA.debugLineNum = 23789569;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat  '";
_origformat = __c.DateTime.getDateFormat();
RDebugUtils.currentLine=23789570;
 //BA.debugLineNum = 23789570;BA.debugLine="DateTime.DateFormat=\"yyMMdd\"";
__c.DateTime.setDateFormat("yyMMdd");
RDebugUtils.currentLine=23789571;
 //BA.debugLineNum = 23789571;BA.debugLine="Private h As String = DateTime.Date(DateTime.Now)";
_h = __c.DateTime.Date(__c.DateTime.getNow())+"000000";
RDebugUtils.currentLine=23789572;
 //BA.debugLineNum = 23789572;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig d";
__c.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=23789573;
 //BA.debugLineNum = 23789573;BA.debugLine="Log(\"Hoy=\"&h)";
__c.LogImpl("523789573","Hoy="+_h,0);
RDebugUtils.currentLine=23789574;
 //BA.debugLineNum = 23789574;BA.debugLine="Return h";
if (true) return _h;
RDebugUtils.currentLine=23789575;
 //BA.debugLineNum = 23789575;BA.debugLine="End Sub";
return "";
}
public String  _fechakmt(SHARK2.keymon.com.mx.c_subs __ref,String _fecha) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "fechakmt", false))
	 {return ((String) Debug.delegate(ba, "fechakmt", new Object[] {_fecha}));}
String _origformat = "";
String _nuevafecha = "";
RDebugUtils.currentLine=23461888;
 //BA.debugLineNum = 23461888;BA.debugLine="Sub fechaKMT(fecha As String) As String 'ignore";
RDebugUtils.currentLine=23461890;
 //BA.debugLineNum = 23461890;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat  '";
_origformat = __c.DateTime.getDateFormat();
RDebugUtils.currentLine=23461891;
 //BA.debugLineNum = 23461891;BA.debugLine="DateTime.DateFormat=\"yyMMddHHmmss\"";
__c.DateTime.setDateFormat("yyMMddHHmmss");
RDebugUtils.currentLine=23461892;
 //BA.debugLineNum = 23461892;BA.debugLine="Dim nuevaFecha As String=DateTime.Date(fecha)";
_nuevafecha = __c.DateTime.Date((long)(Double.parseDouble(_fecha)));
RDebugUtils.currentLine=23461893;
 //BA.debugLineNum = 23461893;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig d";
__c.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=23461895;
 //BA.debugLineNum = 23461895;BA.debugLine="Return nuevaFecha";
if (true) return _nuevafecha;
RDebugUtils.currentLine=23461896;
 //BA.debugLineNum = 23461896;BA.debugLine="End Sub";
return "";
}
public long  _fechakmt2ticks(SHARK2.keymon.com.mx.c_subs __ref,String _fkmt) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "fechakmt2ticks", false))
	 {return ((Long) Debug.delegate(ba, "fechakmt2ticks", new Object[] {_fkmt}));}
String _partefecha = "";
String _partehora = "";
String _origformat = "";
long _ticks = 0L;
RDebugUtils.currentLine=24117248;
 //BA.debugLineNum = 24117248;BA.debugLine="Sub fechaKMT2Ticks(fKMT As String) As Long 'ignore";
RDebugUtils.currentLine=24117249;
 //BA.debugLineNum = 24117249;BA.debugLine="Try";
try {RDebugUtils.currentLine=24117250;
 //BA.debugLineNum = 24117250;BA.debugLine="If fKMT.Length = 12 Then";
if (_fkmt.length()==12) { 
RDebugUtils.currentLine=24117251;
 //BA.debugLineNum = 24117251;BA.debugLine="Private parteFecha As String = fKMT.SubString2(";
_partefecha = _fkmt.substring((int) (0),(int) (6));
RDebugUtils.currentLine=24117252;
 //BA.debugLineNum = 24117252;BA.debugLine="Private parteHora As String = fKMT.SubString(6)";
_partehora = _fkmt.substring((int) (6));
RDebugUtils.currentLine=24117253;
 //BA.debugLineNum = 24117253;BA.debugLine="Private OrigFormat As String = DateTime.DateFor";
_origformat = __c.DateTime.getDateFormat();
RDebugUtils.currentLine=24117254;
 //BA.debugLineNum = 24117254;BA.debugLine="DateTime.DateFormat=\"yymmdd\"";
__c.DateTime.setDateFormat("yymmdd");
RDebugUtils.currentLine=24117255;
 //BA.debugLineNum = 24117255;BA.debugLine="DateTime.TimeFormat=\"HHmmss\"";
__c.DateTime.setTimeFormat("HHmmss");
RDebugUtils.currentLine=24117256;
 //BA.debugLineNum = 24117256;BA.debugLine="Private ticks As Long = DateTime.DateTimeParse(";
_ticks = __c.DateTime.DateTimeParse(_partefecha,_partehora);
RDebugUtils.currentLine=24117257;
 //BA.debugLineNum = 24117257;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig";
__c.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=24117258;
 //BA.debugLineNum = 24117258;BA.debugLine="Return ticks";
if (true) return _ticks;
 }else {
RDebugUtils.currentLine=24117260;
 //BA.debugLineNum = 24117260;BA.debugLine="Log(\"Formato de fecha incorrecto, debe de ser '";
__c.LogImpl("524117260","Formato de fecha incorrecto, debe de ser 'YYMMDDHHMMSS', no '"+_fkmt+"' largo="+BA.NumberToString(_fkmt.length()),0);
RDebugUtils.currentLine=24117261;
 //BA.debugLineNum = 24117261;BA.debugLine="Return 0";
if (true) return (long) (0);
 };
 } 
       catch (Exception e16) {
			ba.setLastException(e16);RDebugUtils.currentLine=24117264;
 //BA.debugLineNum = 24117264;BA.debugLine="Log(LastException)";
__c.LogImpl("524117264",BA.ObjectToString(__c.LastException(getActivityBA())),0);
RDebugUtils.currentLine=24117265;
 //BA.debugLineNum = 24117265;BA.debugLine="LogColor($\"Fecha dada: ${fKMT}, Parte Fecha: ${p";
__c.LogImpl("524117265",("Fecha dada: "+__c.SmartStringFormatter("",(Object)(_fkmt))+", Parte Fecha: "+__c.SmartStringFormatter("",(Object)(_partefecha))+", Parte Hora: "+__c.SmartStringFormatter("",(Object)(_partehora))+""),__c.Colors.Red);
RDebugUtils.currentLine=24117266;
 //BA.debugLineNum = 24117266;BA.debugLine="Return 0";
if (true) return (long) (0);
 };
RDebugUtils.currentLine=24117268;
 //BA.debugLineNum = 24117268;BA.debugLine="End Sub";
return 0L;
}
public String  _getphnid(SHARK2.keymon.com.mx.c_subs __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "getphnid", false))
	 {return ((String) Debug.delegate(ba, "getphnid", null));}
String _t = "";
String _s = "";
RDebugUtils.currentLine=23396352;
 //BA.debugLineNum = 23396352;BA.debugLine="Sub getPhnId As String 'ignore";
RDebugUtils.currentLine=23396354;
 //BA.debugLineNum = 23396354;BA.debugLine="devModel = phn.Model";
__ref._devmodel /*String*/  = __ref._phn /*anywheresoftware.b4a.phone.Phone*/ .getModel();
RDebugUtils.currentLine=23396355;
 //BA.debugLineNum = 23396355;BA.debugLine="If devModel.Length <= 3 Then 'Si phn.Model esta e";
if (__ref._devmodel /*String*/ .length()<=3) { 
RDebugUtils.currentLine=23396356;
 //BA.debugLineNum = 23396356;BA.debugLine="Dim t As String = phn.GetSettings(\"android_id\")";
_t = __ref._phn /*anywheresoftware.b4a.phone.Phone*/ .GetSettings("android_id");
RDebugUtils.currentLine=23396357;
 //BA.debugLineNum = 23396357;BA.debugLine="devModel = t";
__ref._devmodel /*String*/  = _t;
 };
RDebugUtils.currentLine=23396359;
 //BA.debugLineNum = 23396359;BA.debugLine="If devModel.Length >= 3 Then 'Si tenemos valor pa";
if (__ref._devmodel /*String*/ .length()>=3) { 
RDebugUtils.currentLine=23396360;
 //BA.debugLineNum = 23396360;BA.debugLine="File.WriteString(File.DirInternal, \"phnId.txt\",";
__c.File.WriteString(__c.File.getDirInternal(),"phnId.txt",__ref._devmodel /*String*/ );
 }else 
{RDebugUtils.currentLine=23396362;
 //BA.debugLineNum = 23396362;BA.debugLine="Else If devModel.Length < 3 Then ' Si no tenemos";
if (__ref._devmodel /*String*/ .length()<3) { 
RDebugUtils.currentLine=23396363;
 //BA.debugLineNum = 23396363;BA.debugLine="Dim s As String = File.ReadString(File.DirIntern";
_s = __c.File.ReadString(__c.File.getDirInternal(),"phnId.txt");
RDebugUtils.currentLine=23396364;
 //BA.debugLineNum = 23396364;BA.debugLine="devModel = s";
__ref._devmodel /*String*/  = _s;
 }}
;
RDebugUtils.currentLine=23396368;
 //BA.debugLineNum = 23396368;BA.debugLine="Return devModel";
if (true) return __ref._devmodel /*String*/ ;
RDebugUtils.currentLine=23396369;
 //BA.debugLineNum = 23396369;BA.debugLine="End Sub";
return "";
}
public String  _guardaappinfo(SHARK2.keymon.com.mx.c_subs __ref,anywheresoftware.b4a.sql.SQL _skmt) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "guardaappinfo", false))
	 {return ((String) Debug.delegate(ba, "guardaappinfo", new Object[] {_skmt}));}
RDebugUtils.currentLine=24772608;
 //BA.debugLineNum = 24772608;BA.debugLine="Sub guardaAppInfo(skmt As SQL) 'ignore";
RDebugUtils.currentLine=24772609;
 //BA.debugLineNum = 24772609;BA.debugLine="skmt.ExecNonQuery(\"delete from CAT_VARIABLES wher";
_skmt.ExecNonQuery("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'EMPRESA' or CAT_VA_DESCRIPCION = 'APP_NAME' or CAT_VA_DESCRIPCION = 'APP_VERSION'");
RDebugUtils.currentLine=24772610;
 //BA.debugLineNum = 24772610;BA.debugLine="skmt.ExecNonQuery($\"insert into CAT_VARIABLES (CA";
_skmt.ExecNonQuery(("insert into CAT_VARIABLES (CAT_VA_DESCRIPCION, CAT_VA_VALOR) values ('APP_NAME', '"+__c.SmartStringFormatter("",(Object)(__c.Application.getLabelName()))+"')"));
RDebugUtils.currentLine=24772611;
 //BA.debugLineNum = 24772611;BA.debugLine="skmt.ExecNonQuery($\"insert into CAT_VARIABLES (CA";
_skmt.ExecNonQuery(("insert into CAT_VARIABLES (CAT_VA_DESCRIPCION, CAT_VA_VALOR) values ('APP_VERSION', '"+__c.SmartStringFormatter("",(Object)(__c.Application.getVersionName()))+"')"));
RDebugUtils.currentLine=24772612;
 //BA.debugLineNum = 24772612;BA.debugLine="End Sub";
return "";
}
public String  _guardainfoenarchivo(SHARK2.keymon.com.mx.c_subs __ref,String _coords) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "guardainfoenarchivo", false))
	 {return ((String) Debug.delegate(ba, "guardainfoenarchivo", new Object[] {_coords}));}
String _origformat = "";
String _lastupdate = "";
String _ubic = "";
anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper _out = null;
String _s = "";
byte[] _t = null;
RDebugUtils.currentLine=23527424;
 //BA.debugLineNum = 23527424;BA.debugLine="Sub guardaInfoEnArchivo(coords As String) 'ignore";
RDebugUtils.currentLine=23527426;
 //BA.debugLineNum = 23527426;BA.debugLine="Dim OrigFormat As String=DateTime.DateFormat  'sa";
_origformat = __c.DateTime.getDateFormat();
RDebugUtils.currentLine=23527427;
 //BA.debugLineNum = 23527427;BA.debugLine="DateTime.DateFormat=\"MMM-dd HH:mm:ss\"";
__c.DateTime.setDateFormat("MMM-dd HH:mm:ss");
RDebugUtils.currentLine=23527428;
 //BA.debugLineNum = 23527428;BA.debugLine="Dim lastUpdate As String=DateTime.Date(DateTime.N";
_lastupdate = __c.DateTime.Date(__c.DateTime.getNow());
RDebugUtils.currentLine=23527429;
 //BA.debugLineNum = 23527429;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig d";
__c.DateTime.setDateFormat(_origformat);
RDebugUtils.currentLine=23527431;
 //BA.debugLineNum = 23527431;BA.debugLine="Dim ubic As String = coords&\",\"&lastUpdate";
_ubic = _coords+","+_lastupdate;
RDebugUtils.currentLine=23527432;
 //BA.debugLineNum = 23527432;BA.debugLine="Dim out As OutputStream = File.OpenOutput(File.Di";
_out = new anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper();
_out = __c.File.OpenOutput(__c.File.getDirInternal(),"gps.txt",__c.True);
RDebugUtils.currentLine=23527433;
 //BA.debugLineNum = 23527433;BA.debugLine="Dim s As String = ubic & CRLF";
_s = _ubic+__c.CRLF;
RDebugUtils.currentLine=23527434;
 //BA.debugLineNum = 23527434;BA.debugLine="Dim t() As Byte = s.GetBytes(\"UTF-8\")";
_t = _s.getBytes("UTF-8");
RDebugUtils.currentLine=23527435;
 //BA.debugLineNum = 23527435;BA.debugLine="out.WriteBytes(t, 0, t.Length)";
_out.WriteBytes(_t,(int) (0),_t.length);
RDebugUtils.currentLine=23527436;
 //BA.debugLineNum = 23527436;BA.debugLine="out.Close";
_out.Close();
RDebugUtils.currentLine=23527437;
 //BA.debugLineNum = 23527437;BA.debugLine="End Sub";
return "";
}
public String  _guardainfoenbd(SHARK2.keymon.com.mx.c_subs __ref,String _coords) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "guardainfoenbd", false))
	 {return ((String) Debug.delegate(ba, "guardainfoenbd", new Object[] {_coords}));}
String[] _latlon = null;
RDebugUtils.currentLine=23592960;
 //BA.debugLineNum = 23592960;BA.debugLine="Sub guardaInfoEnBD(coords As String) 'ignore";
RDebugUtils.currentLine=23592961;
 //BA.debugLineNum = 23592961;BA.debugLine="Log(\"Guardamos ubicacion en BD - \"&coords)";
__c.LogImpl("523592961","Guardamos ubicacion en BD - "+_coords,0);
RDebugUtils.currentLine=23592962;
 //BA.debugLineNum = 23592962;BA.debugLine="Try";
try {RDebugUtils.currentLine=23592963;
 //BA.debugLineNum = 23592963;BA.debugLine="Dim latlon() As String = Regex.Split(\"\\|\", coord";
_latlon = __c.Regex.Split("\\|",_coords);
RDebugUtils.currentLine=23592964;
 //BA.debugLineNum = 23592964;BA.debugLine="If latlon.Length < 2 Then latlon = Regex.Split(\"";
if (_latlon.length<2) { 
_latlon = __c.Regex.Split(",",_coords);};
RDebugUtils.currentLine=23592965;
 //BA.debugLineNum = 23592965;BA.debugLine="If subsLogs Then Log(\"LatLon=\"&latlon)";
if (__ref._subslogs /*boolean*/ ) { 
__c.LogImpl("523592965","LatLon="+BA.ObjectToString(_latlon),0);};
RDebugUtils.currentLine=23592966;
 //BA.debugLineNum = 23592966;BA.debugLine="kmt.ExecNonQuery2(\"INSERT INTO RUTA_GPS(FECHA, L";
__ref._kmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO RUTA_GPS(FECHA, LAT, LON) VALUES (?,?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(_latlon[(int) (2)]),(Object)(_latlon[(int) (0)]),(Object)(_latlon[(int) (1)])}));
 } 
       catch (Exception e8) {
			ba.setLastException(e8);RDebugUtils.currentLine=23592968;
 //BA.debugLineNum = 23592968;BA.debugLine="LogColor(LastException, Colors.red)";
__c.LogImpl("523592968",BA.ObjectToString(__c.LastException(getActivityBA())),__c.Colors.Red);
 };
RDebugUtils.currentLine=23592970;
 //BA.debugLineNum = 23592970;BA.debugLine="End Sub";
return "";
}
public anywheresoftware.b4a.sql.SQL  _inicializabd(SHARK2.keymon.com.mx.c_subs __ref,String _ruta,String _bdname) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "inicializabd", false))
	 {return ((anywheresoftware.b4a.sql.SQL) Debug.delegate(ba, "inicializabd", new Object[] {_ruta,_bdname}));}
anywheresoftware.b4a.sql.SQL _skmt = null;
RDebugUtils.currentLine=24903680;
 //BA.debugLineNum = 24903680;BA.debugLine="Sub inicializaBD(ruta As String, BDName As String)";
RDebugUtils.currentLine=24903681;
 //BA.debugLineNum = 24903681;BA.debugLine="Dim skmt As SQL";
_skmt = new anywheresoftware.b4a.sql.SQL();
RDebugUtils.currentLine=24903682;
 //BA.debugLineNum = 24903682;BA.debugLine="If File.Exists(ruta, BDName) = False Then";
if (__c.File.Exists(_ruta,_bdname)==__c.False) { 
RDebugUtils.currentLine=24903683;
 //BA.debugLineNum = 24903683;BA.debugLine="File.Copy(File.DirAssets, BDName, ruta, BDName)";
__c.File.Copy(__c.File.getDirAssets(),_bdname,_ruta,_bdname);
RDebugUtils.currentLine=24903684;
 //BA.debugLineNum = 24903684;BA.debugLine="LogColor($\"Copiamos ${BDName} de ${File.DirAsset";
__c.LogImpl("524903684",("Copiamos "+__c.SmartStringFormatter("",(Object)(_bdname))+" de "+__c.SmartStringFormatter("",(Object)(__c.File.getDirAssets()))+" a "+__c.SmartStringFormatter("",(Object)(_ruta))+""),__c.Colors.Green);
 };
RDebugUtils.currentLine=24903686;
 //BA.debugLineNum = 24903686;BA.debugLine="skmt.Initialize(ruta, BDName, True)";
_skmt.Initialize(_ruta,_bdname,__c.True);
RDebugUtils.currentLine=24903687;
 //BA.debugLineNum = 24903687;BA.debugLine="Return skmt";
if (true) return _skmt;
RDebugUtils.currentLine=24903688;
 //BA.debugLineNum = 24903688;BA.debugLine="End Sub";
return null;
}
public SHARK2.keymon.com.mx.dbrequestmanager  _reqmanagerinit(SHARK2.keymon.com.mx.c_subs __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "reqmanagerinit", false))
	 {return ((SHARK2.keymon.com.mx.dbrequestmanager) Debug.delegate(ba, "reqmanagerinit", null));}
SHARK2.keymon.com.mx.dbrequestmanager _rm = null;
RDebugUtils.currentLine=23068672;
 //BA.debugLineNum = 23068672;BA.debugLine="Sub reqManagerInit As DBRequestManager";
RDebugUtils.currentLine=23068673;
 //BA.debugLineNum = 23068673;BA.debugLine="Private rm As DBRequestManager";
_rm = new SHARK2.keymon.com.mx.dbrequestmanager();
RDebugUtils.currentLine=23068674;
 //BA.debugLineNum = 23068674;BA.debugLine="rm.Initialize(Me, traeDBReqServerDeBD(db))";
_rm._initialize /*String*/ (null,ba,this,__ref._traedbreqserverdebd /*String*/ (null,__ref._db /*anywheresoftware.b4a.sql.SQL*/ ));
RDebugUtils.currentLine=23068675;
 //BA.debugLineNum = 23068675;BA.debugLine="Log($\"Inicializamos reqManager con ${traeDBReqSer";
__c.LogImpl("523068675",("Inicializamos reqManager con "+__c.SmartStringFormatter("",(Object)(__ref._traedbreqserverdebd /*String*/ (null,__ref._db /*anywheresoftware.b4a.sql.SQL*/ )))+""),0);
RDebugUtils.currentLine=23068676;
 //BA.debugLineNum = 23068676;BA.debugLine="Return rm";
if (true) return _rm;
RDebugUtils.currentLine=23068677;
 //BA.debugLineNum = 23068677;BA.debugLine="End Sub";
return null;
}
public String  _installapk(SHARK2.keymon.com.mx.c_subs __ref,String _dir,String _apk) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "installapk", false))
	 {return ((String) Debug.delegate(ba, "installapk", new Object[] {_dir,_apk}));}
anywheresoftware.b4a.objects.IntentWrapper _i = null;
RDebugUtils.currentLine=24182784;
 //BA.debugLineNum = 24182784;BA.debugLine="Sub InstallAPK(dir As String, apk As String) 'igno";
RDebugUtils.currentLine=24182785;
 //BA.debugLineNum = 24182785;BA.debugLine="If File.Exists(dir, apk) Then";
if (__c.File.Exists(_dir,_apk)) { 
RDebugUtils.currentLine=24182786;
 //BA.debugLineNum = 24182786;BA.debugLine="Dim i As Intent";
_i = new anywheresoftware.b4a.objects.IntentWrapper();
RDebugUtils.currentLine=24182787;
 //BA.debugLineNum = 24182787;BA.debugLine="i.Initialize(i.ACTION_VIEW, \"file://\" & File.Com";
_i.Initialize(_i.ACTION_VIEW,"file://"+__c.File.Combine(_dir,_apk));
RDebugUtils.currentLine=24182788;
 //BA.debugLineNum = 24182788;BA.debugLine="i.SetType(\"application/vnd.android.package-archi";
_i.SetType("application/vnd.android.package-archive");
RDebugUtils.currentLine=24182789;
 //BA.debugLineNum = 24182789;BA.debugLine="StartActivity(i)";
__c.StartActivity(ba,(Object)(_i.getObject()));
 };
RDebugUtils.currentLine=24182791;
 //BA.debugLineNum = 24182791;BA.debugLine="End Sub";
return "";
}
public String  _jobdone(SHARK2.keymon.com.mx.c_subs __ref,SHARK2.keymon.com.mx.httpjob _job) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "jobdone", false))
	 {return ((String) Debug.delegate(ba, "jobdone", new Object[] {_job}));}
SHARK2.keymon.com.mx.dbrequestmanager._dbresult _resultado = null;
Object[] _records = null;
String _k = "";
RDebugUtils.currentLine=23330816;
 //BA.debugLineNum = 23330816;BA.debugLine="Sub JobDone(Job As HttpJob)";
RDebugUtils.currentLine=23330817;
 //BA.debugLineNum = 23330817;BA.debugLine="LogColor(\"C_SUBS JOBDONE - \" & Job.Success, Color";
__c.LogImpl("523330817","C_SUBS JOBDONE - "+BA.ObjectToString(_job._success /*boolean*/ ),__c.Colors.Red);
RDebugUtils.currentLine=23330818;
 //BA.debugLineNum = 23330818;BA.debugLine="If Job.Success = False Then";
if (_job._success /*boolean*/ ==__c.False) { 
RDebugUtils.currentLine=23330819;
 //BA.debugLineNum = 23330819;BA.debugLine="Log($\"Error en el request ${Job.Tag}\"$)";
__c.LogImpl("523330819",("Error en el request "+__c.SmartStringFormatter("",_job._tag /*Object*/ )+""),0);
RDebugUtils.currentLine=23330820;
 //BA.debugLineNum = 23330820;BA.debugLine="LogColor(\"** \" & Job.Tag & \" Error: \" & Job.Erro";
__c.LogImpl("523330820","** "+BA.ObjectToString(_job._tag /*Object*/ )+" Error: "+_job._errormessage /*String*/ ,__c.Colors.Red);
RDebugUtils.currentLine=23330821;
 //BA.debugLineNum = 23330821;BA.debugLine="If reqsList.IndexOf(Job.Tag) > -1 Then reqsList.";
if (__ref._reqslist /*anywheresoftware.b4a.objects.collections.List*/ .IndexOf(_job._tag /*Object*/ )>-1) { 
__ref._reqslist /*anywheresoftware.b4a.objects.collections.List*/ .RemoveAt(__ref._reqslist /*anywheresoftware.b4a.objects.collections.List*/ .IndexOf(_job._tag /*Object*/ ));};
RDebugUtils.currentLine=23330822;
 //BA.debugLineNum = 23330822;BA.debugLine="reqError = True";
__ref._reqerror /*boolean*/  = __c.True;
 }else {
RDebugUtils.currentLine=23330824;
 //BA.debugLineNum = 23330824;BA.debugLine="If Job.JobName = \"DBRequest\" Then";
if ((_job._jobname /*String*/ ).equals("DBRequest")) { 
RDebugUtils.currentLine=23330825;
 //BA.debugLineNum = 23330825;BA.debugLine="Dim resultado As DBResult = reqManager.HandleJo";
_resultado = __ref._reqmanager /*SHARK2.keymon.com.mx.dbrequestmanager*/ ._handlejob /*SHARK2.keymon.com.mx.dbrequestmanager._dbresult*/ (null,_job);
RDebugUtils.currentLine=23330826;
 //BA.debugLineNum = 23330826;BA.debugLine="If reqsList.IndexOf(resultado.Tag) > -1 Then re";
if (__ref._reqslist /*anywheresoftware.b4a.objects.collections.List*/ .IndexOf(_resultado.Tag /*Object*/ )>-1) { 
__ref._reqslist /*anywheresoftware.b4a.objects.collections.List*/ .RemoveAt(__ref._reqslist /*anywheresoftware.b4a.objects.collections.List*/ .IndexOf(_resultado.Tag /*Object*/ ));};
RDebugUtils.currentLine=23330827;
 //BA.debugLineNum = 23330827;BA.debugLine="If resultado.Tag = \"select_fecha\" Then";
if ((_resultado.Tag /*Object*/ ).equals((Object)("select_fecha"))) { 
RDebugUtils.currentLine=23330828;
 //BA.debugLineNum = 23330828;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group12 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen12 = group12.getSize()
;int index12 = 0;
;
for (; index12 < groupLen12;index12++){
_records = (Object[])(group12.Get(index12));
RDebugUtils.currentLine=23330829;
 //BA.debugLineNum = 23330829;BA.debugLine="For Each k As String In resultado.Columns.Key";
{
final anywheresoftware.b4a.BA.IterableList group13 = _resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Keys();
final int groupLen13 = group13.getSize()
;int index13 = 0;
;
for (; index13 < groupLen13;index13++){
_k = BA.ObjectToString(group13.Get(index13));
RDebugUtils.currentLine=23330830;
 //BA.debugLineNum = 23330830;BA.debugLine="Log(resultado.Tag & \": \" & k & \": \" & record";
__c.LogImpl("523330830",BA.ObjectToString(_resultado.Tag /*Object*/ )+": "+_k+": "+BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)(_k))))]),0);
 }
};
 }
};
 };
 };
 };
RDebugUtils.currentLine=23330836;
 //BA.debugLineNum = 23330836;BA.debugLine="Log(reqsList.Size)";
__c.LogImpl("523330836",BA.NumberToString(__ref._reqslist /*anywheresoftware.b4a.objects.collections.List*/ .getSize()),0);
RDebugUtils.currentLine=23330837;
 //BA.debugLineNum = 23330837;BA.debugLine="If reqsList.Size = 0 Then 'Ya no hay DBReqs pendi";
if (__ref._reqslist /*anywheresoftware.b4a.objects.collections.List*/ .getSize()==0) { 
RDebugUtils.currentLine=23330838;
 //BA.debugLineNum = 23330838;BA.debugLine="Log(reqError)";
__c.LogImpl("523330838",BA.ObjectToString(__ref._reqerror /*boolean*/ ),0);
RDebugUtils.currentLine=23330839;
 //BA.debugLineNum = 23330839;BA.debugLine="If Not(reqError) Then";
if (__c.Not(__ref._reqerror /*boolean*/ )) { 
RDebugUtils.currentLine=23330840;
 //BA.debugLineNum = 23330840;BA.debugLine="envioOk(True)";
__ref._enviook /*String*/ (null,__c.True);
 }else {
RDebugUtils.currentLine=23330842;
 //BA.debugLineNum = 23330842;BA.debugLine="envioOk(False)";
__ref._enviook /*String*/ (null,__c.False);
 };
RDebugUtils.currentLine=23330844;
 //BA.debugLineNum = 23330844;BA.debugLine="reqError = False";
__ref._reqerror /*boolean*/  = __c.False;
RDebugUtils.currentLine=23330845;
 //BA.debugLineNum = 23330845;BA.debugLine="Log(\"-= FIN =-\")";
__c.LogImpl("523330845","-= FIN =-",0);
 };
RDebugUtils.currentLine=23330847;
 //BA.debugLineNum = 23330847;BA.debugLine="Job.Release";
_job._release /*String*/ (null);
RDebugUtils.currentLine=23330848;
 //BA.debugLineNum = 23330848;BA.debugLine="End Sub";
return "";
}
public String  _log2db(SHARK2.keymon.com.mx.c_subs __ref,String _texto) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "log2db", false))
	 {return ((String) Debug.delegate(ba, "log2db", new Object[] {_texto}));}
RDebugUtils.currentLine=23855104;
 //BA.debugLineNum = 23855104;BA.debugLine="Sub log2DB(texto As String) 'ignore";
RDebugUtils.currentLine=23855105;
 //BA.debugLineNum = 23855105;BA.debugLine="LogColor(fechaKMT(DateTime.Now)&\" - log2BD: '\"&te";
__c.LogImpl("523855105",__ref._fechakmt /*String*/ (null,BA.NumberToString(__c.DateTime.getNow()))+" - log2BD: '"+_texto+"'",__c.Colors.LightGray);
RDebugUtils.currentLine=23855106;
 //BA.debugLineNum = 23855106;BA.debugLine="kmt.ExecNonQuery2(\"INSERT INTO bitacora(fecha, te";
__ref._kmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO bitacora(fecha, texto) VALUES (?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{(Object)(__ref._fechakmt /*String*/ (null,BA.NumberToString(__c.DateTime.getNow()))),(Object)(_texto)}));
RDebugUtils.currentLine=23855107;
 //BA.debugLineNum = 23855107;BA.debugLine="End Sub";
return "";
}
public String  _logjobdoneresultados(SHARK2.keymon.com.mx.c_subs __ref,SHARK2.keymon.com.mx.dbrequestmanager._dbresult _resultado) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "logjobdoneresultados", false))
	 {return ((String) Debug.delegate(ba, "logjobdoneresultados", new Object[] {_resultado}));}
Object[] _records = null;
String _k = "";
RDebugUtils.currentLine=24838144;
 //BA.debugLineNum = 24838144;BA.debugLine="Sub logJobDoneResultados(resultado As DBResult) 'i";
RDebugUtils.currentLine=24838145;
 //BA.debugLineNum = 24838145;BA.debugLine="For Each records() As Object In resultado.Rows";
{
final anywheresoftware.b4a.BA.IterableList group1 = _resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ ;
final int groupLen1 = group1.getSize()
;int index1 = 0;
;
for (; index1 < groupLen1;index1++){
_records = (Object[])(group1.Get(index1));
RDebugUtils.currentLine=24838146;
 //BA.debugLineNum = 24838146;BA.debugLine="LogColor($\"====== ${resultado.Tag} - REGISTROS =";
__c.LogImpl("524838146",("====== "+__c.SmartStringFormatter("",_resultado.Tag /*Object*/ )+" - REGISTROS = "+__c.SmartStringFormatter("",(Object)(_resultado.Rows /*anywheresoftware.b4a.objects.collections.List*/ .getSize()))+""),__c.Colors.RGB((int) (215),(int) (37),(int) (0)));
RDebugUtils.currentLine=24838147;
 //BA.debugLineNum = 24838147;BA.debugLine="For Each k As String In resultado.Columns.Keys";
{
final anywheresoftware.b4a.BA.IterableList group3 = _resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Keys();
final int groupLen3 = group3.getSize()
;int index3 = 0;
;
for (; index3 < groupLen3;index3++){
_k = BA.ObjectToString(group3.Get(index3));
RDebugUtils.currentLine=24838148;
 //BA.debugLineNum = 24838148;BA.debugLine="LogColor(k & \" = \" & records(resultado.Columns.";
__c.LogImpl("524838148",_k+" = "+BA.ObjectToString(_records[(int)(BA.ObjectToNumber(_resultado.Columns /*anywheresoftware.b4a.objects.collections.Map*/ .Get((Object)(_k))))]),__c.Colors.RGB((int) (215),(int) (37),(int) (0)));
 }
};
 }
};
RDebugUtils.currentLine=24838151;
 //BA.debugLineNum = 24838151;BA.debugLine="End Sub";
return "";
}
public boolean  _masdexxmins(SHARK2.keymon.com.mx.c_subs __ref,int _hora,int _mins) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "masdexxmins", false))
	 {return ((Boolean) Debug.delegate(ba, "masdexxmins", new Object[] {_hora,_mins}));}
RDebugUtils.currentLine=23920640;
 //BA.debugLineNum = 23920640;BA.debugLine="Sub masDeXXMins(hora As Int, mins As Int) As Boole";
RDebugUtils.currentLine=23920641;
 //BA.debugLineNum = 23920641;BA.debugLine="If (hora + mins * DateTime.TicksPerMinute) < Date";
if ((_hora+_mins*__c.DateTime.TicksPerMinute)<__c.DateTime.getNow()) { 
RDebugUtils.currentLine=23920642;
 //BA.debugLineNum = 23920642;BA.debugLine="Return True";
if (true) return __c.True;
 }else {
RDebugUtils.currentLine=23920644;
 //BA.debugLineNum = 23920644;BA.debugLine="Return False";
if (true) return __c.False;
 };
RDebugUtils.currentLine=23920646;
 //BA.debugLineNum = 23920646;BA.debugLine="End Sub";
return false;
}
public boolean  _masdexxminskmt(SHARK2.keymon.com.mx.c_subs __ref,String _hora,int _mins) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "masdexxminskmt", false))
	 {return ((Boolean) Debug.delegate(ba, "masdexxminskmt", new Object[] {_hora,_mins}));}
RDebugUtils.currentLine=23986176;
 //BA.debugLineNum = 23986176;BA.debugLine="Sub masDeXXMinsKMT(hora As String, mins As Int) As";
RDebugUtils.currentLine=23986177;
 //BA.debugLineNum = 23986177;BA.debugLine="Try";
try {RDebugUtils.currentLine=23986179;
 //BA.debugLineNum = 23986179;BA.debugLine="If fechaKMT2Ticks(hora) + mins * DateTime.TicksP";
if (__ref._fechakmt2ticks /*long*/ (null,_hora)+_mins*__c.DateTime.TicksPerMinute<__c.DateTime.getNow()) { 
RDebugUtils.currentLine=23986181;
 //BA.debugLineNum = 23986181;BA.debugLine="Return True";
if (true) return __c.True;
 }else {
RDebugUtils.currentLine=23986184;
 //BA.debugLineNum = 23986184;BA.debugLine="Return False";
if (true) return __c.False;
 };
 } 
       catch (Exception e8) {
			ba.setLastException(e8);RDebugUtils.currentLine=23986187;
 //BA.debugLineNum = 23986187;BA.debugLine="Log(LastException)";
__c.LogImpl("523986187",BA.ObjectToString(__c.LastException(getActivityBA())),0);
 };
RDebugUtils.currentLine=23986189;
 //BA.debugLineNum = 23986189;BA.debugLine="End Sub";
return false;
}
public String  _notihigh(SHARK2.keymon.com.mx.c_subs __ref,String _title,String _body,String _id,Object _activity) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "notihigh", false))
	 {return ((String) Debug.delegate(ba, "notihigh", new Object[] {_title,_body,_id,_activity}));}
anywheresoftware.b4a.objects.NotificationWrapper _notif = null;
RDebugUtils.currentLine=25296896;
 //BA.debugLineNum = 25296896;BA.debugLine="Sub notiHigh(title As String, body As String, id A";
RDebugUtils.currentLine=25296897;
 //BA.debugLineNum = 25296897;BA.debugLine="activity = Main";
_activity = (Object)(_main.getObject());
RDebugUtils.currentLine=25296898;
 //BA.debugLineNum = 25296898;BA.debugLine="Private notif As Notification";
_notif = new anywheresoftware.b4a.objects.NotificationWrapper();
RDebugUtils.currentLine=25296899;
 //BA.debugLineNum = 25296899;BA.debugLine="notif.Initialize2(notif.IMPORTANCE_HIGH)";
_notif.Initialize2(_notif.IMPORTANCE_HIGH);
RDebugUtils.currentLine=25296900;
 //BA.debugLineNum = 25296900;BA.debugLine="notif.Icon = \"icon\"";
_notif.setIcon("icon");
RDebugUtils.currentLine=25296901;
 //BA.debugLineNum = 25296901;BA.debugLine="notif.Vibrate = False";
_notif.setVibrate(__c.False);
RDebugUtils.currentLine=25296902;
 //BA.debugLineNum = 25296902;BA.debugLine="notif.Sound = False";
_notif.setSound(__c.False);
RDebugUtils.currentLine=25296903;
 //BA.debugLineNum = 25296903;BA.debugLine="notif.AutoCancel = True";
_notif.setAutoCancel(__c.True);
RDebugUtils.currentLine=25296905;
 //BA.debugLineNum = 25296905;BA.debugLine="notif.SetInfo(title, body, activity)";
_notif.SetInfoNew(ba,BA.ObjectToCharSequence(_title),BA.ObjectToCharSequence(_body),_activity);
RDebugUtils.currentLine=25296907;
 //BA.debugLineNum = 25296907;BA.debugLine="notif.Notify(id)";
_notif.Notify((int)(Double.parseDouble(_id)));
RDebugUtils.currentLine=25296908;
 //BA.debugLineNum = 25296908;BA.debugLine="End Sub";
return "";
}
public anywheresoftware.b4a.objects.NotificationWrapper  _notilowreturn(SHARK2.keymon.com.mx.c_subs __ref,String _title,String _body,int _id) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "notilowreturn", false))
	 {return ((anywheresoftware.b4a.objects.NotificationWrapper) Debug.delegate(ba, "notilowreturn", new Object[] {_title,_body,_id}));}
anywheresoftware.b4a.objects.NotificationWrapper _notification = null;
RDebugUtils.currentLine=25362432;
 //BA.debugLineNum = 25362432;BA.debugLine="Sub notiLowReturn(title As String, Body As String,";
RDebugUtils.currentLine=25362433;
 //BA.debugLineNum = 25362433;BA.debugLine="Private notification As Notification";
_notification = new anywheresoftware.b4a.objects.NotificationWrapper();
RDebugUtils.currentLine=25362434;
 //BA.debugLineNum = 25362434;BA.debugLine="notification.Initialize2(notification.IMPORTANCE_";
_notification.Initialize2(_notification.IMPORTANCE_LOW);
RDebugUtils.currentLine=25362436;
 //BA.debugLineNum = 25362436;BA.debugLine="notification.Icon = \"icon\"";
_notification.setIcon("icon");
RDebugUtils.currentLine=25362437;
 //BA.debugLineNum = 25362437;BA.debugLine="notification.Sound = False";
_notification.setSound(__c.False);
RDebugUtils.currentLine=25362438;
 //BA.debugLineNum = 25362438;BA.debugLine="notification.Vibrate = False";
_notification.setVibrate(__c.False);
RDebugUtils.currentLine=25362439;
 //BA.debugLineNum = 25362439;BA.debugLine="notification.SetInfo(title, Body, Main)";
_notification.SetInfoNew(ba,BA.ObjectToCharSequence(_title),BA.ObjectToCharSequence(_body),(Object)(_main.getObject()));
RDebugUtils.currentLine=25362440;
 //BA.debugLineNum = 25362440;BA.debugLine="notification.Notify(id)";
_notification.Notify(_id);
RDebugUtils.currentLine=25362442;
 //BA.debugLineNum = 25362442;BA.debugLine="Return notification";
if (true) return _notification;
RDebugUtils.currentLine=25362443;
 //BA.debugLineNum = 25362443;BA.debugLine="End Sub";
return null;
}
public String  _panelvisible(SHARK2.keymon.com.mx.c_subs __ref,anywheresoftware.b4a.objects.PanelWrapper _panel,int _top,int _left) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "panelvisible", false))
	 {return ((String) Debug.delegate(ba, "panelvisible", new Object[] {_panel,_top,_left}));}
RDebugUtils.currentLine=24313856;
 //BA.debugLineNum = 24313856;BA.debugLine="Sub panelVisible(panel As Panel, top As Int, left";
RDebugUtils.currentLine=24313857;
 //BA.debugLineNum = 24313857;BA.debugLine="panel.BringToFront";
_panel.BringToFront();
RDebugUtils.currentLine=24313858;
 //BA.debugLineNum = 24313858;BA.debugLine="panel.Visible = True";
_panel.setVisible(__c.True);
RDebugUtils.currentLine=24313859;
 //BA.debugLineNum = 24313859;BA.debugLine="panel.Top = top";
_panel.setTop(_top);
RDebugUtils.currentLine=24313860;
 //BA.debugLineNum = 24313860;BA.debugLine="panel.Left = left";
_panel.setLeft(_left);
RDebugUtils.currentLine=24313861;
 //BA.debugLineNum = 24313861;BA.debugLine="End Sub";
return "";
}
public String  _traedbreqserverdebd(SHARK2.keymon.com.mx.c_subs __ref,anywheresoftware.b4a.sql.SQL _dbx) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "traedbreqserverdebd", false))
	 {return ((String) Debug.delegate(ba, "traedbreqserverdebd", new Object[] {_dbx}));}
String _srvr = "";
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _rs = null;
RDebugUtils.currentLine=25034752;
 //BA.debugLineNum = 25034752;BA.debugLine="Sub traeDBReqServerDeBD(dbx As SQL) As String 'ign";
RDebugUtils.currentLine=25034753;
 //BA.debugLineNum = 25034753;BA.debugLine="Dim srvr As String = \"N/A\"";
_srvr = "N/A";
RDebugUtils.currentLine=25034754;
 //BA.debugLineNum = 25034754;BA.debugLine="Dim rs As ResultSet = dbx.ExecQuery(\"select CAT_V";
_rs = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
_rs = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(_dbx.ExecQuery("select CAT_VA_VALOR from cat_variables where CAT_VA_DESCRIPCION = 'SERVER'")));
RDebugUtils.currentLine=25034755;
 //BA.debugLineNum = 25034755;BA.debugLine="If rs.RowCount > 0 Then";
if (_rs.getRowCount()>0) { 
RDebugUtils.currentLine=25034756;
 //BA.debugLineNum = 25034756;BA.debugLine="rs.NextRow";
_rs.NextRow();
RDebugUtils.currentLine=25034757;
 //BA.debugLineNum = 25034757;BA.debugLine="srvr = rs.GetString(\"CAT_VA_VALOR\")";
_srvr = _rs.GetString("CAT_VA_VALOR");
 };
RDebugUtils.currentLine=25034759;
 //BA.debugLineNum = 25034759;BA.debugLine="Return srvr";
if (true) return _srvr;
RDebugUtils.currentLine=25034760;
 //BA.debugLineNum = 25034760;BA.debugLine="End Sub";
return "";
}
public String  _reqmanagerreinit(SHARK2.keymon.com.mx.c_subs __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "reqmanagerreinit", false))
	 {return ((String) Debug.delegate(ba, "reqmanagerreinit", null));}
RDebugUtils.currentLine=23134208;
 //BA.debugLineNum = 23134208;BA.debugLine="Sub reqManagerReInit";
RDebugUtils.currentLine=23134209;
 //BA.debugLineNum = 23134209;BA.debugLine="Log(\"reqManager ReInit\")";
__c.LogImpl("523134209","reqManager ReInit",0);
RDebugUtils.currentLine=23134210;
 //BA.debugLineNum = 23134210;BA.debugLine="reqManager = reqManagerInit";
__ref._reqmanager /*SHARK2.keymon.com.mx.dbrequestmanager*/  = __ref._reqmanagerinit /*SHARK2.keymon.com.mx.dbrequestmanager*/ (null);
RDebugUtils.currentLine=23134211;
 //BA.debugLineNum = 23134211;BA.debugLine="End Sub";
return "";
}
public String  _traealmacen(SHARK2.keymon.com.mx.c_subs __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "traealmacen", false))
	 {return ((String) Debug.delegate(ba, "traealmacen", null));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _a = "";
RDebugUtils.currentLine=25427968;
 //BA.debugLineNum = 25427968;BA.debugLine="Sub traeAlmacen As String 'ignore";
RDebugUtils.currentLine=25427969;
 //BA.debugLineNum = 25427969;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=25427970;
 //BA.debugLineNum = 25427970;BA.debugLine="Private a As String";
_a = "";
RDebugUtils.currentLine=25427971;
 //BA.debugLineNum = 25427971;BA.debugLine="c = db.ExecQuery(\"select  ID_ALMACEN from CAT_ALM";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(__ref._db /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select  ID_ALMACEN from CAT_ALMACEN")));
RDebugUtils.currentLine=25427972;
 //BA.debugLineNum = 25427972;BA.debugLine="c.Position = 0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=25427973;
 //BA.debugLineNum = 25427973;BA.debugLine="a = C.GetString(\"ID_ALMACEN\")";
_a = _c.GetString("ID_ALMACEN");
RDebugUtils.currentLine=25427974;
 //BA.debugLineNum = 25427974;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=25427975;
 //BA.debugLineNum = 25427975;BA.debugLine="Return a";
if (true) return _a;
RDebugUtils.currentLine=25427976;
 //BA.debugLineNum = 25427976;BA.debugLine="End Sub";
return "";
}
public String  _traefecha(SHARK2.keymon.com.mx.c_subs __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "traefecha", false))
	 {return ((String) Debug.delegate(ba, "traefecha", null));}
String _sdate = "";
String _stime = "";
RDebugUtils.currentLine=24707072;
 //BA.debugLineNum = 24707072;BA.debugLine="Sub traeFecha As String 'ignore";
RDebugUtils.currentLine=24707073;
 //BA.debugLineNum = 24707073;BA.debugLine="DateTime.DateFormat = \"MM/dd/yyyy\"";
__c.DateTime.setDateFormat("MM/dd/yyyy");
RDebugUtils.currentLine=24707074;
 //BA.debugLineNum = 24707074;BA.debugLine="Private sDate As String = DateTime.Date(DateTime.";
_sdate = __c.DateTime.Date(__c.DateTime.getNow());
RDebugUtils.currentLine=24707075;
 //BA.debugLineNum = 24707075;BA.debugLine="Private sTime As String = DateTime.Time(DateTime.";
_stime = __c.DateTime.Time(__c.DateTime.getNow());
RDebugUtils.currentLine=24707076;
 //BA.debugLineNum = 24707076;BA.debugLine="Return sDate & sTime";
if (true) return _sdate+_stime;
RDebugUtils.currentLine=24707077;
 //BA.debugLineNum = 24707077;BA.debugLine="End Sub";
return "";
}
public String  _traeintervalodebd(SHARK2.keymon.com.mx.c_subs __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "traeintervalodebd", false))
	 {return ((String) Debug.delegate(ba, "traeintervalodebd", null));}
String _intrvl = "";
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _rs = null;
RDebugUtils.currentLine=25100288;
 //BA.debugLineNum = 25100288;BA.debugLine="Sub traeIntervaloDeBD As String 'ignore";
RDebugUtils.currentLine=25100289;
 //BA.debugLineNum = 25100289;BA.debugLine="Dim intrvl As String = \"30\"";
_intrvl = "30";
RDebugUtils.currentLine=25100290;
 //BA.debugLineNum = 25100290;BA.debugLine="Dim rs As ResultSet = db.ExecQuery(\"select valor";
_rs = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
_rs = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(__ref._db /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select valor from cat_variables where nombre = 'intervalo'")));
RDebugUtils.currentLine=25100291;
 //BA.debugLineNum = 25100291;BA.debugLine="If rs.RowCount > 0 Then";
if (_rs.getRowCount()>0) { 
RDebugUtils.currentLine=25100292;
 //BA.debugLineNum = 25100292;BA.debugLine="rs.NextRow";
_rs.NextRow();
RDebugUtils.currentLine=25100293;
 //BA.debugLineNum = 25100293;BA.debugLine="intrvl = rs.GetString(\"valor\")";
_intrvl = _rs.GetString("valor");
 };
RDebugUtils.currentLine=25100295;
 //BA.debugLineNum = 25100295;BA.debugLine="Return intrvl";
if (true) return _intrvl;
RDebugUtils.currentLine=25100296;
 //BA.debugLineNum = 25100296;BA.debugLine="End Sub";
return "";
}
public String  _traeruta(SHARK2.keymon.com.mx.c_subs __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "traeruta", false))
	 {return ((String) Debug.delegate(ba, "traeruta", null));}
anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
String _r = "";
RDebugUtils.currentLine=25493504;
 //BA.debugLineNum = 25493504;BA.debugLine="Sub traeRuta As String 'ignore";
RDebugUtils.currentLine=25493505;
 //BA.debugLineNum = 25493505;BA.debugLine="Private c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=25493506;
 //BA.debugLineNum = 25493506;BA.debugLine="Private r As String";
_r = "";
RDebugUtils.currentLine=25493507;
 //BA.debugLineNum = 25493507;BA.debugLine="c = db.ExecQuery(\"select CAT_CL_RUTA from kmt_inf";
_c = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(__ref._db /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)")));
RDebugUtils.currentLine=25493508;
 //BA.debugLineNum = 25493508;BA.debugLine="r = \"0\"";
_r = "0";
RDebugUtils.currentLine=25493509;
 //BA.debugLineNum = 25493509;BA.debugLine="If c.RowCount > 0 Then";
if (_c.getRowCount()>0) { 
RDebugUtils.currentLine=25493510;
 //BA.debugLineNum = 25493510;BA.debugLine="c.Position=0";
_c.setPosition((int) (0));
RDebugUtils.currentLine=25493511;
 //BA.debugLineNum = 25493511;BA.debugLine="r = c.GetString(\"CAT_CL_RUTA\")";
_r = _c.GetString("CAT_CL_RUTA");
 };
RDebugUtils.currentLine=25493513;
 //BA.debugLineNum = 25493513;BA.debugLine="c.Close";
_c.Close();
RDebugUtils.currentLine=25493514;
 //BA.debugLineNum = 25493514;BA.debugLine="Return r";
if (true) return _r;
RDebugUtils.currentLine=25493515;
 //BA.debugLineNum = 25493515;BA.debugLine="End Sub";
return "";
}
public String  _traetimeoutdebd(SHARK2.keymon.com.mx.c_subs __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_subs";
if (Debug.shouldDelegate(ba, "traetimeoutdebd", false))
	 {return ((String) Debug.delegate(ba, "traetimeoutdebd", null));}
String _tmout = "";
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _rs = null;
RDebugUtils.currentLine=25165824;
 //BA.debugLineNum = 25165824;BA.debugLine="Sub traeTimeoutDeBD As String 'ignore";
RDebugUtils.currentLine=25165825;
 //BA.debugLineNum = 25165825;BA.debugLine="Dim tmout As String = \"9000\"";
_tmout = "9000";
RDebugUtils.currentLine=25165826;
 //BA.debugLineNum = 25165826;BA.debugLine="Dim rs As ResultSet = db.ExecQuery(\"select valor";
_rs = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
_rs = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(__ref._db /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select valor from cat_variables where nombre = 'timeout'")));
RDebugUtils.currentLine=25165827;
 //BA.debugLineNum = 25165827;BA.debugLine="If rs.RowCount > 0 Then";
if (_rs.getRowCount()>0) { 
RDebugUtils.currentLine=25165828;
 //BA.debugLineNum = 25165828;BA.debugLine="rs.NextRow";
_rs.NextRow();
RDebugUtils.currentLine=25165829;
 //BA.debugLineNum = 25165829;BA.debugLine="tmout = rs.GetString(\"valor\")";
_tmout = _rs.GetString("valor");
 };
RDebugUtils.currentLine=25165831;
 //BA.debugLineNum = 25165831;BA.debugLine="Return tmout";
if (true) return _tmout;
RDebugUtils.currentLine=25165832;
 //BA.debugLineNum = 25165832;BA.debugLine="End Sub";
return "";
}
}