package reparto_mazapa.keymon.lat;


import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.objects.ServiceHelper;
import anywheresoftware.b4a.debug.*;

public class firebasemessaging extends android.app.Service{
	public static class firebasemessaging_BR extends android.content.BroadcastReceiver {

		@Override
		public void onReceive(android.content.Context context, android.content.Intent intent) {
            BA.LogInfo("** Receiver (firebasemessaging) OnReceive **");
			android.content.Intent in = new android.content.Intent(context, firebasemessaging.class);
			if (intent != null)
				in.putExtra("b4a_internal_intent", intent);
            ServiceHelper.StarterHelper.startServiceFromReceiver (context, in, false, anywheresoftware.b4a.ShellBA.class);
		}

	}
    static firebasemessaging mostCurrent;
	public static BA processBA;
    private ServiceHelper _service;
    public static Class<?> getObject() {
		return firebasemessaging.class;
	}
	@Override
	public void onCreate() {
        super.onCreate();
        mostCurrent = this;
        if (processBA == null) {
		    processBA = new anywheresoftware.b4a.ShellBA(this, null, null, "reparto_mazapa.keymon.lat", "reparto_mazapa.keymon.lat.firebasemessaging");
            if (BA.isShellModeRuntimeCheck(processBA)) {
                processBA.raiseEvent2(null, true, "SHELL", false);
		    }
            try {
                Class.forName(BA.applicationContext.getPackageName() + ".main").getMethod("initializeProcessGlobals").invoke(null, null);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            processBA.loadHtSubs(this.getClass());
            ServiceHelper.init();
        }
        _service = new ServiceHelper(this);
        processBA.service = this;
        
        if (BA.isShellModeRuntimeCheck(processBA)) {
			processBA.raiseEvent2(null, true, "CREATE", true, "reparto_mazapa.keymon.lat.firebasemessaging", processBA, _service, anywheresoftware.b4a.keywords.Common.Density);
		}
        if (!false && ServiceHelper.StarterHelper.startFromServiceCreate(processBA, false) == false) {
				
		}
		else {
            processBA.setActivityPaused(false);
            BA.LogInfo("*** Service (firebasemessaging) Create ***");
            processBA.raiseEvent(null, "service_create");
        }
        processBA.runHook("oncreate", this, null);
        if (false) {
			if (ServiceHelper.StarterHelper.runWaitForLayouts() == false) {
                BA.LogInfo("stopping spontaneous created service");
                stopSelf();
            }
		}
    }
		@Override
	public void onStart(android.content.Intent intent, int startId) {
		onStartCommand(intent, 0, 0);
    }
    @Override
    public int onStartCommand(final android.content.Intent intent, int flags, int startId) {
    	if (ServiceHelper.StarterHelper.onStartCommand(processBA, new Runnable() {
            public void run() {
                handleStart(intent);
            }}))
			;
		else {
			ServiceHelper.StarterHelper.addWaitForLayout (new Runnable() {
				public void run() {
                    processBA.setActivityPaused(false);
                    BA.LogInfo("** Service (firebasemessaging) Create **");
                    processBA.raiseEvent(null, "service_create");
					handleStart(intent);
                    ServiceHelper.StarterHelper.removeWaitForLayout();
				}
			});
		}
        processBA.runHook("onstartcommand", this, new Object[] {intent, flags, startId});
		return android.app.Service.START_NOT_STICKY;
    }
    public void onTaskRemoved(android.content.Intent rootIntent) {
        super.onTaskRemoved(rootIntent);
        if (false)
            processBA.raiseEvent(null, "service_taskremoved");
            
    }
    private void handleStart(android.content.Intent intent) {
    	BA.LogInfo("** Service (firebasemessaging) Start **");
    	java.lang.reflect.Method startEvent = processBA.htSubs.get("service_start");
    	if (startEvent != null) {
    		if (startEvent.getParameterTypes().length > 0) {
    			anywheresoftware.b4a.objects.IntentWrapper iw = ServiceHelper.StarterHelper.handleStartIntent(intent, _service, processBA);
    			processBA.raiseEvent(null, "service_start", iw);
    		}
    		else {
    			processBA.raiseEvent(null, "service_start");
    		}
    	}
    }
	
	@Override
	public void onDestroy() {
        super.onDestroy();
        if (false) {
            BA.LogInfo("** Service (firebasemessaging) Destroy (ignored)**");
        }
        else {
            BA.LogInfo("** Service (firebasemessaging) Destroy **");
		    processBA.raiseEvent(null, "service_destroy");
            processBA.service = null;
		    mostCurrent = null;
		    processBA.setActivityPaused(true);
            processBA.runHook("ondestroy", this, null);
        }
	}

@Override
	public android.os.IBinder onBind(android.content.Intent intent) {
		return null;
	}
public anywheresoftware.b4a.keywords.Common __c = null;
public static anywheresoftware.b4a.objects.FirebaseNotificationsService.FirebaseMessageWrapper _fm = null;
public static String _api_key = "";
public static String _locrequest = "";
public static anywheresoftware.b4a.phone.PhoneEvents _pe = null;
public static anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public static de.donmanfred.GZipStringswrapper _gzip = null;
public static String _sprvsr = "";
public static String _subscrito = "";
public static String _au = "";
public b4a.example.dateutils _dateutils = null;
public reparto_mazapa.keymon.lat.main _main = null;
public reparto_mazapa.keymon.lat.appupdater _appupdater = null;
public reparto_mazapa.keymon.lat.tracker _tracker = null;
public reparto_mazapa.keymon.lat.starter _starter = null;
public reparto_mazapa.keymon.lat.subs _subs = null;
public reparto_mazapa.keymon.lat.foto _foto = null;
public reparto_mazapa.keymon.lat.mapa_cliente _mapa_cliente = null;
public reparto_mazapa.keymon.lat.mapa_rutas _mapa_rutas = null;
public reparto_mazapa.keymon.lat.newinst2 _newinst2 = null;
public reparto_mazapa.keymon.lat.b4xpages _b4xpages = null;
public reparto_mazapa.keymon.lat.b4xcollections _b4xcollections = null;
public reparto_mazapa.keymon.lat.httputils2service _httputils2service = null;
public reparto_mazapa.keymon.lat.xuiviewsutils _xuiviewsutils = null;
public static String  _borragpshist() throws Exception{
RDebugUtils.currentModule="firebasemessaging";
if (Debug.shouldDelegate(processBA, "borragpshist", false))
	 {return ((String) Debug.delegate(processBA, "borragpshist", null));}
RDebugUtils.currentLine=70189056;
 //BA.debugLineNum = 70189056;BA.debugLine="Sub borraGPSHist";
RDebugUtils.currentLine=70189058;
 //BA.debugLineNum = 70189058;BA.debugLine="End Sub";
return "";
}
public static String  _borramosarchivogps() throws Exception{
RDebugUtils.currentModule="firebasemessaging";
if (Debug.shouldDelegate(processBA, "borramosarchivogps", false))
	 {return ((String) Debug.delegate(processBA, "borramosarchivogps", null));}
anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper _out = null;
String _s = "";
byte[] _t = null;
RDebugUtils.currentLine=69861376;
 //BA.debugLineNum = 69861376;BA.debugLine="Sub borramosArchivoGPS";
RDebugUtils.currentLine=69861377;
 //BA.debugLineNum = 69861377;BA.debugLine="Dim out As OutputStream = File.OpenOutput(File.Di";
_out = new anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper();
_out = anywheresoftware.b4a.keywords.Common.File.OpenOutput(anywheresoftware.b4a.keywords.Common.File.getDirRootExternal(),"gps.txt",anywheresoftware.b4a.keywords.Common.False);
RDebugUtils.currentLine=69861378;
 //BA.debugLineNum = 69861378;BA.debugLine="Dim s As String = \"\"";
_s = "";
RDebugUtils.currentLine=69861379;
 //BA.debugLineNum = 69861379;BA.debugLine="Dim t() As Byte = s.GetBytes(\"UTF-8\")";
_t = _s.getBytes("UTF-8");
RDebugUtils.currentLine=69861380;
 //BA.debugLineNum = 69861380;BA.debugLine="out.WriteBytes(t, 0, t.Length)";
_out.WriteBytes(_t,(int) (0),_t.length);
RDebugUtils.currentLine=69861381;
 //BA.debugLineNum = 69861381;BA.debugLine="out.Close";
_out.Close();
RDebugUtils.currentLine=69861382;
 //BA.debugLineNum = 69861382;BA.debugLine="End Sub";
return "";
}
public static String  _compress(String _str) throws Exception{
RDebugUtils.currentModule="firebasemessaging";
if (Debug.shouldDelegate(processBA, "compress", false))
	 {return ((String) Debug.delegate(processBA, "compress", new Object[] {_str}));}
anywheresoftware.b4a.objects.StringUtils _su = null;
byte[] _compressed = null;
String _base64 = "";
RDebugUtils.currentLine=69992448;
 //BA.debugLineNum = 69992448;BA.debugLine="Sub compress(str As String) As String";
RDebugUtils.currentLine=69992450;
 //BA.debugLineNum = 69992450;BA.debugLine="Private su As StringUtils";
_su = new anywheresoftware.b4a.objects.StringUtils();
RDebugUtils.currentLine=69992451;
 //BA.debugLineNum = 69992451;BA.debugLine="Dim compressed() As Byte = GZip.compress(str)";
_compressed = _gzip.compress(_str);
RDebugUtils.currentLine=69992452;
 //BA.debugLineNum = 69992452;BA.debugLine="Log($\"CompressedBytesLength: ${compressed.Length}";
anywheresoftware.b4a.keywords.Common.LogImpl("369992452",("CompressedBytesLength: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_compressed.length))+""),0);
RDebugUtils.currentLine=69992453;
 //BA.debugLineNum = 69992453;BA.debugLine="Dim base64 As String = su.EncodeBase64(compressed";
_base64 = _su.EncodeBase64(_compressed);
RDebugUtils.currentLine=69992454;
 //BA.debugLineNum = 69992454;BA.debugLine="Log($\"CompressedBytes converted to base64 Length:";
anywheresoftware.b4a.keywords.Common.LogImpl("369992454",("CompressedBytes converted to base64 Length: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_base64.length()))+""),0);
RDebugUtils.currentLine=69992455;
 //BA.debugLineNum = 69992455;BA.debugLine="Log($\"CompressedBytes converted to base64: ${base";
anywheresoftware.b4a.keywords.Common.LogImpl("369992455",("CompressedBytes converted to base64: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_base64))+""),0);
RDebugUtils.currentLine=69992456;
 //BA.debugLineNum = 69992456;BA.debugLine="Return base64";
if (true) return _base64;
RDebugUtils.currentLine=69992457;
 //BA.debugLineNum = 69992457;BA.debugLine="End Sub";
return "";
}
public static String  _dameruta() throws Exception{
RDebugUtils.currentModule="firebasemessaging";
if (Debug.shouldDelegate(processBA, "dameruta", false))
	 {return ((String) Debug.delegate(processBA, "dameruta", null));}
RDebugUtils.currentLine=70123520;
 //BA.debugLineNum = 70123520;BA.debugLine="Sub dameRuta As String";
RDebugUtils.currentLine=70123534;
 //BA.debugLineNum = 70123534;BA.debugLine="End Sub";
return "";
}
public static String  _decompress(String _base64) throws Exception{
RDebugUtils.currentModule="firebasemessaging";
if (Debug.shouldDelegate(processBA, "decompress", false))
	 {return ((String) Debug.delegate(processBA, "decompress", new Object[] {_base64}));}
anywheresoftware.b4a.objects.StringUtils _su = null;
byte[] _decompressedbytes = null;
anywheresoftware.b4a.agraham.byteconverter.ByteConverter _bc = null;
String _uncompressed = "";
RDebugUtils.currentLine=70057984;
 //BA.debugLineNum = 70057984;BA.debugLine="Sub decompress(base64 As String) As String 'ignore";
RDebugUtils.currentLine=70057986;
 //BA.debugLineNum = 70057986;BA.debugLine="Private su As StringUtils";
_su = new anywheresoftware.b4a.objects.StringUtils();
RDebugUtils.currentLine=70057987;
 //BA.debugLineNum = 70057987;BA.debugLine="Dim decompressedbytes() As Byte = su.DecodeBase64";
_decompressedbytes = _su.DecodeBase64(_base64);
RDebugUtils.currentLine=70057988;
 //BA.debugLineNum = 70057988;BA.debugLine="Log($\"decompressedbytesLength: ${decompressedbyte";
anywheresoftware.b4a.keywords.Common.LogImpl("370057988",("decompressedbytesLength: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_decompressedbytes.length))+""),0);
RDebugUtils.currentLine=70057989;
 //BA.debugLineNum = 70057989;BA.debugLine="Dim bc As ByteConverter";
_bc = new anywheresoftware.b4a.agraham.byteconverter.ByteConverter();
RDebugUtils.currentLine=70057990;
 //BA.debugLineNum = 70057990;BA.debugLine="Dim uncompressed As String = bc.StringFromBytes(d";
_uncompressed = _bc.StringFromBytes(_decompressedbytes,"UTF8");
RDebugUtils.currentLine=70057991;
 //BA.debugLineNum = 70057991;BA.debugLine="Log($\"uncompressedLength: ${uncompressed.Length}\"";
anywheresoftware.b4a.keywords.Common.LogImpl("370057991",("uncompressedLength: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_uncompressed.length()))+""),0);
RDebugUtils.currentLine=70057992;
 //BA.debugLineNum = 70057992;BA.debugLine="Log($\"Decompressed String = ${uncompressed}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("370057992",("Decompressed String = "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_uncompressed))+""),0);
RDebugUtils.currentLine=70057993;
 //BA.debugLineNum = 70057993;BA.debugLine="Return uncompressed";
if (true) return _uncompressed;
RDebugUtils.currentLine=70057994;
 //BA.debugLineNum = 70057994;BA.debugLine="End Sub";
return "";
}
public static String  _fm_messagearrived(anywheresoftware.b4a.objects.FirebaseNotificationsService.RemoteMessageWrapper _message) throws Exception{
RDebugUtils.currentModule="firebasemessaging";
if (Debug.shouldDelegate(processBA, "fm_messagearrived", false))
	 {return ((String) Debug.delegate(processBA, "fm_messagearrived", new Object[] {_message}));}
anywheresoftware.b4a.objects.collections.List _tipos = null;
anywheresoftware.b4a.objects.collections.Map _params = null;
String _rutagpscmp = "";
RDebugUtils.currentLine=69533696;
 //BA.debugLineNum = 69533696;BA.debugLine="Sub fm_MessageArrived (Message As RemoteMessage)";
RDebugUtils.currentLine=69533697;
 //BA.debugLineNum = 69533697;BA.debugLine="Log(\"Message arrived\")";
anywheresoftware.b4a.keywords.Common.LogImpl("369533697","Message arrived",0);
RDebugUtils.currentLine=69533698;
 //BA.debugLineNum = 69533698;BA.debugLine="Log($\"Message data: ${Message.GetData}\"$)";
anywheresoftware.b4a.keywords.Common.LogImpl("369533698",("Message data: "+anywheresoftware.b4a.keywords.Common.SmartStringFormatter("",(Object)(_message.GetData().getObject()))+""),0);
RDebugUtils.currentLine=69533700;
 //BA.debugLineNum = 69533700;BA.debugLine="If Message.GetData.ContainsKey(\"t\") Then";
if (_message.GetData().ContainsKey((Object)("t"))) { 
RDebugUtils.currentLine=69533701;
 //BA.debugLineNum = 69533701;BA.debugLine="Dim tipos As List = Regex.Split(\",\",Message.GetD";
_tipos = new anywheresoftware.b4a.objects.collections.List();
_tipos = anywheresoftware.b4a.keywords.Common.ArrayToList(anywheresoftware.b4a.keywords.Common.Regex.Split(",",BA.ObjectToString(_message.GetData().Get((Object)("t")))));
RDebugUtils.currentLine=69533702;
 //BA.debugLineNum = 69533702;BA.debugLine="If tipos.IndexOf(\"pu\") <> -1 Or tipos.IndexOf(\"a";
if (_tipos.IndexOf((Object)("pu"))!=-1 || _tipos.IndexOf((Object)("au"))!=-1) { 
RDebugUtils.currentLine=69533703;
 //BA.debugLineNum = 69533703;BA.debugLine="Log(\"Es una peticion de ubicacion\")";
anywheresoftware.b4a.keywords.Common.LogImpl("369533703","Es una peticion de ubicacion",0);
RDebugUtils.currentLine=69533704;
 //BA.debugLineNum = 69533704;BA.debugLine="locRequest=\"Activa\"";
_locrequest = "Activa";
RDebugUtils.currentLine=69533705;
 //BA.debugLineNum = 69533705;BA.debugLine="Log(\"Llamamos StartFLPSmall\")";
anywheresoftware.b4a.keywords.Common.LogImpl("369533705","Llamamos StartFLPSmall",0);
RDebugUtils.currentLine=69533706;
 //BA.debugLineNum = 69533706;BA.debugLine="CallSubDelayed(Tracker, \"StartFLPSmall\")";
anywheresoftware.b4a.keywords.Common.CallSubDelayed(processBA,(Object)(mostCurrent._tracker.getObject()),"StartFLPSmall");
RDebugUtils.currentLine=69533707;
 //BA.debugLineNum = 69533707;BA.debugLine="CallSubDelayed(Tracker, \"StartFLP\")";
anywheresoftware.b4a.keywords.Common.CallSubDelayed(processBA,(Object)(mostCurrent._tracker.getObject()),"StartFLP");
 };
RDebugUtils.currentLine=69533709;
 //BA.debugLineNum = 69533709;BA.debugLine="If tipos.IndexOf(\"au\") <> -1 Then 'Si es una act";
if (_tipos.IndexOf((Object)("au"))!=-1) { 
RDebugUtils.currentLine=69533710;
 //BA.debugLineNum = 69533710;BA.debugLine="au = 1";
_au = BA.NumberToString(1);
 };
RDebugUtils.currentLine=69533712;
 //BA.debugLineNum = 69533712;BA.debugLine="If tipos.IndexOf(\"ping\") <> -1 Then 'Si es un pi";
if (_tipos.IndexOf((Object)("ping"))!=-1) { 
RDebugUtils.currentLine=69533713;
 //BA.debugLineNum = 69533713;BA.debugLine="Log(\"Es un ping\")";
anywheresoftware.b4a.keywords.Common.LogImpl("369533713","Es un ping",0);
RDebugUtils.currentLine=69533714;
 //BA.debugLineNum = 69533714;BA.debugLine="Log(\"Mandamos pong\")";
anywheresoftware.b4a.keywords.Common.LogImpl("369533714","Mandamos pong",0);
RDebugUtils.currentLine=69533715;
 //BA.debugLineNum = 69533715;BA.debugLine="Dim params As Map = CreateMap(\"topic\":Sprvsr,\"t";
_params = new anywheresoftware.b4a.objects.collections.Map();
_params = anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("topic"),(Object)(_sprvsr),(Object)("title"),(Object)("pong"),(Object)("body"),(Object)(mostCurrent._b4xpages._mainpage /*reparto_mazapa.keymon.lat.b4xmainpage*/ (processBA)._usuario /*String*/ +" - Recibi mensaje "+BA.ObjectToString(_message.GetData().Get((Object)("title")))),(Object)("t"),(Object)("pong")});
RDebugUtils.currentLine=69533716;
 //BA.debugLineNum = 69533716;BA.debugLine="SendMessage(params)";
_sendmessage(_params);
 };
RDebugUtils.currentLine=69533718;
 //BA.debugLineNum = 69533718;BA.debugLine="If tipos.IndexOf(\"bgps\") <> -1 Then 'Si es una i";
if (_tipos.IndexOf((Object)("bgps"))!=-1) { 
RDebugUtils.currentLine=69533719;
 //BA.debugLineNum = 69533719;BA.debugLine="Log(\"Es una instruccion de borrar archivo gps\")";
anywheresoftware.b4a.keywords.Common.LogImpl("369533719","Es una instruccion de borrar archivo gps",0);
RDebugUtils.currentLine=69533720;
 //BA.debugLineNum = 69533720;BA.debugLine="Log(\"Borramos archivo gps\")";
anywheresoftware.b4a.keywords.Common.LogImpl("369533720","Borramos archivo gps",0);
RDebugUtils.currentLine=69533721;
 //BA.debugLineNum = 69533721;BA.debugLine="borramosArchivoGPS";
_borramosarchivogps();
 };
RDebugUtils.currentLine=69533723;
 //BA.debugLineNum = 69533723;BA.debugLine="If tipos.IndexOf(\"dr\") <> -1 Then 'Si es una pet";
if (_tipos.IndexOf((Object)("dr"))!=-1) { 
RDebugUtils.currentLine=69533724;
 //BA.debugLineNum = 69533724;BA.debugLine="Log(\"Es una peticion de Ruta GPS\")";
anywheresoftware.b4a.keywords.Common.LogImpl("369533724","Es una peticion de Ruta GPS",0);
RDebugUtils.currentLine=69533725;
 //BA.debugLineNum = 69533725;BA.debugLine="Dim rutaGpsCmp As String = dameRuta";
_rutagpscmp = _dameruta();
RDebugUtils.currentLine=69533726;
 //BA.debugLineNum = 69533726;BA.debugLine="Dim params As Map = CreateMap(\"topic\":Sprvsr,\"t";
_params = new anywheresoftware.b4a.objects.collections.Map();
_params = anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("topic"),(Object)(_sprvsr),(Object)("title"),(Object)("ruta"),(Object)("body"),(Object)(mostCurrent._b4xpages._mainpage /*reparto_mazapa.keymon.lat.b4xmainpage*/ (processBA)._usuario /*String*/ +" - Recibi mensaje "+BA.ObjectToString(_message.GetData().Get((Object)("title")))),(Object)("t"),(Object)("ruta"),(Object)("r"),(Object)(_rutagpscmp)});
RDebugUtils.currentLine=69533727;
 //BA.debugLineNum = 69533727;BA.debugLine="SendMessage(params)";
_sendmessage(_params);
 };
RDebugUtils.currentLine=69533729;
 //BA.debugLineNum = 69533729;BA.debugLine="If tipos.IndexOf(\"bgps2\") <> -1 Then 'Si es una";
if (_tipos.IndexOf((Object)("bgps2"))!=-1) { 
RDebugUtils.currentLine=69533730;
 //BA.debugLineNum = 69533730;BA.debugLine="Log(\"Es una instruccion de borrar BD gps\")";
anywheresoftware.b4a.keywords.Common.LogImpl("369533730","Es una instruccion de borrar BD gps",0);
RDebugUtils.currentLine=69533731;
 //BA.debugLineNum = 69533731;BA.debugLine="Log(\"Borramos BD gps\")";
anywheresoftware.b4a.keywords.Common.LogImpl("369533731","Borramos BD gps",0);
RDebugUtils.currentLine=69533732;
 //BA.debugLineNum = 69533732;BA.debugLine="borraGPSHist";
_borragpshist();
 };
RDebugUtils.currentLine=69533734;
 //BA.debugLineNum = 69533734;BA.debugLine="If tipos.IndexOf(\"pu\") = -1 And tipos.IndexOf(\"a";
if (_tipos.IndexOf((Object)("pu"))==-1 && _tipos.IndexOf((Object)("au"))==-1 && _tipos.IndexOf((Object)("ping"))==-1 && _tipos.IndexOf((Object)("dr"))==-1) { 
RDebugUtils.currentLine=69533735;
 //BA.debugLineNum = 69533735;BA.debugLine="Log(\"No es ping ni solicitud de ubicacion o rut";
anywheresoftware.b4a.keywords.Common.LogImpl("369533735","No es ping ni solicitud de ubicacion o ruta, entonces no hacemos nada",0);
 };
 };
RDebugUtils.currentLine=69533743;
 //BA.debugLineNum = 69533743;BA.debugLine="End Sub";
return "";
}
public static String  _sendmessage(anywheresoftware.b4a.objects.collections.Map _params) throws Exception{
RDebugUtils.currentModule="firebasemessaging";
if (Debug.shouldDelegate(processBA, "sendmessage", false))
	 {return ((String) Debug.delegate(processBA, "sendmessage", new Object[] {_params}));}
RDebugUtils.currentLine=69664768;
 //BA.debugLineNum = 69664768;BA.debugLine="Sub SendMessage(params As Map)";
RDebugUtils.currentLine=69664791;
 //BA.debugLineNum = 69664791;BA.debugLine="End Sub";
return "";
}
public static String  _guardainfoenarchivo(String _coords) throws Exception{
RDebugUtils.currentModule="firebasemessaging";
if (Debug.shouldDelegate(processBA, "guardainfoenarchivo", false))
	 {return ((String) Debug.delegate(processBA, "guardainfoenarchivo", new Object[] {_coords}));}
RDebugUtils.currentLine=69795840;
 //BA.debugLineNum = 69795840;BA.debugLine="Sub guardaInfoEnArchivo(coords As String) 'ignore";
RDebugUtils.currentLine=69795844;
 //BA.debugLineNum = 69795844;BA.debugLine="End Sub";
return "";
}
public static String  _mandamosloc(String _coords) throws Exception{
RDebugUtils.currentModule="firebasemessaging";
if (Debug.shouldDelegate(processBA, "mandamosloc", false))
	 {return ((String) Debug.delegate(processBA, "mandamosloc", new Object[] {_coords}));}
anywheresoftware.b4a.objects.collections.Map _params = null;
RDebugUtils.currentLine=69730304;
 //BA.debugLineNum = 69730304;BA.debugLine="Sub mandamosLoc(coords As String)";
RDebugUtils.currentLine=69730307;
 //BA.debugLineNum = 69730307;BA.debugLine="If locRequest=\"Activa\" Then 'Si hay solicitud de";
if ((_locrequest).equals("Activa")) { 
RDebugUtils.currentLine=69730308;
 //BA.debugLineNum = 69730308;BA.debugLine="Dim params As Map = CreateMap(\"topic\":Sprvsr,\"ti";
_params = new anywheresoftware.b4a.objects.collections.Map();
_params = anywheresoftware.b4a.keywords.Common.createMap(new Object[] {(Object)("topic"),(Object)(_sprvsr),(Object)("title"),(Object)("ubicacionRecibida"),(Object)("body"),(Object)(_coords),(Object)("t"),(Object)("u")});
RDebugUtils.currentLine=69730309;
 //BA.debugLineNum = 69730309;BA.debugLine="SendMessage(params)";
_sendmessage(_params);
RDebugUtils.currentLine=69730310;
 //BA.debugLineNum = 69730310;BA.debugLine="locRequest=\"Enviada\"";
_locrequest = "Enviada";
RDebugUtils.currentLine=69730311;
 //BA.debugLineNum = 69730311;BA.debugLine="CallSubDelayed(Tracker,\"CreateLocationRequest\")";
anywheresoftware.b4a.keywords.Common.CallSubDelayed(processBA,(Object)(mostCurrent._tracker.getObject()),"CreateLocationRequest");
 };
RDebugUtils.currentLine=69730313;
 //BA.debugLineNum = 69730313;BA.debugLine="End Sub";
return "";
}
public static String  _pe_batterychanged(int _level,int _scale,boolean _plugged,anywheresoftware.b4a.objects.IntentWrapper _intent) throws Exception{
RDebugUtils.currentModule="firebasemessaging";
if (Debug.shouldDelegate(processBA, "pe_batterychanged", false))
	 {return ((String) Debug.delegate(processBA, "pe_batterychanged", new Object[] {_level,_scale,_plugged,_intent}));}
RDebugUtils.currentLine=69926912;
 //BA.debugLineNum = 69926912;BA.debugLine="Sub pe_BatteryChanged (Level As Int, Scale As Int,";
RDebugUtils.currentLine=69926913;
 //BA.debugLineNum = 69926913;BA.debugLine="B4XPages.MainPage.batt=Level";
mostCurrent._b4xpages._mainpage /*reparto_mazapa.keymon.lat.b4xmainpage*/ (processBA)._batt /*int*/  = _level;
RDebugUtils.currentLine=69926914;
 //BA.debugLineNum = 69926914;BA.debugLine="End Sub";
return "";
}
public static String  _service_create() throws Exception{
RDebugUtils.currentModule="firebasemessaging";
if (Debug.shouldDelegate(processBA, "service_create", false))
	 {return ((String) Debug.delegate(processBA, "service_create", null));}
RDebugUtils.currentLine=69337088;
 //BA.debugLineNum = 69337088;BA.debugLine="Sub Service_Create";
RDebugUtils.currentLine=69337089;
 //BA.debugLineNum = 69337089;BA.debugLine="fm.Initialize(\"fm\") 'Inicializamos FirebaseMessag";
_fm.Initialize(processBA,"fm");
RDebugUtils.currentLine=69337090;
 //BA.debugLineNum = 69337090;BA.debugLine="pe.Initialize(\"pe\") 'Para obtener la bateria";
_pe.Initialize(processBA,"pe");
RDebugUtils.currentLine=69337091;
 //BA.debugLineNum = 69337091;BA.debugLine="End Sub";
return "";
}
public static String  _service_destroy() throws Exception{
RDebugUtils.currentModule="firebasemessaging";
if (Debug.shouldDelegate(processBA, "service_destroy", false))
	 {return ((String) Debug.delegate(processBA, "service_destroy", null));}
RDebugUtils.currentLine=69599232;
 //BA.debugLineNum = 69599232;BA.debugLine="Sub Service_Destroy";
RDebugUtils.currentLine=69599234;
 //BA.debugLineNum = 69599234;BA.debugLine="End Sub";
return "";
}
public static void  _service_start(anywheresoftware.b4a.objects.IntentWrapper _startingintent) throws Exception{
RDebugUtils.currentModule="firebasemessaging";
if (Debug.shouldDelegate(processBA, "service_start", false))
	 {Debug.delegate(processBA, "service_start", new Object[] {_startingintent}); return;}
ResumableSub_Service_Start rsub = new ResumableSub_Service_Start(null,_startingintent);
rsub.resume(processBA, null);
}
public static class ResumableSub_Service_Start extends BA.ResumableSub {
public ResumableSub_Service_Start(reparto_mazapa.keymon.lat.firebasemessaging parent,anywheresoftware.b4a.objects.IntentWrapper _startingintent) {
this.parent = parent;
this._startingintent = _startingintent;
}
reparto_mazapa.keymon.lat.firebasemessaging parent;
anywheresoftware.b4a.objects.IntentWrapper _startingintent;

@Override
public void resume(BA ba, Object[] result) throws Exception{
RDebugUtils.currentModule="firebasemessaging";

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
RDebugUtils.currentLine=69468161;
 //BA.debugLineNum = 69468161;BA.debugLine="If StartingIntent.IsInitialized Then fm.HandleInt";
if (true) break;

case 1:
//if
this.state = 6;
if (_startingintent.IsInitialized()) { 
this.state = 3;
;}if (true) break;

case 3:
//C
this.state = 6;
parent._fm.HandleIntent((android.content.Intent)(_startingintent.getObject()));
if (true) break;

case 6:
//C
this.state = -1;
;
RDebugUtils.currentLine=69468162;
 //BA.debugLineNum = 69468162;BA.debugLine="Sleep(0)";
anywheresoftware.b4a.keywords.Common.Sleep(processBA,new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "firebasemessaging", "service_start"),(int) (0));
this.state = 7;
return;
case 7:
//C
this.state = -1;
;
RDebugUtils.currentLine=69468163;
 //BA.debugLineNum = 69468163;BA.debugLine="Service.StopAutomaticForeground 'remove if not us";
parent.mostCurrent._service.StopAutomaticForeground();
RDebugUtils.currentLine=69468164;
 //BA.debugLineNum = 69468164;BA.debugLine="StartServiceAt(Me, DateTime.Now + 15 * DateTime.T";
anywheresoftware.b4a.keywords.Common.StartServiceAt(processBA,firebasemessaging.getObject(),(long) (anywheresoftware.b4a.keywords.Common.DateTime.getNow()+15*anywheresoftware.b4a.keywords.Common.DateTime.TicksPerMinute),anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=69468165;
 //BA.debugLineNum = 69468165;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public static String  _subscribetotopics() throws Exception{
RDebugUtils.currentModule="firebasemessaging";
if (Debug.shouldDelegate(processBA, "subscribetotopics", false))
	 {return ((String) Debug.delegate(processBA, "subscribetotopics", null));}
RDebugUtils.currentLine=69402624;
 //BA.debugLineNum = 69402624;BA.debugLine="Public Sub SubscribeToTopics";
RDebugUtils.currentLine=69402626;
 //BA.debugLineNum = 69402626;BA.debugLine="fm.SubscribeToTopic(\"Trckr\") 'Tracker Global";
_fm.SubscribeToTopic("Trckr");
RDebugUtils.currentLine=69402628;
 //BA.debugLineNum = 69402628;BA.debugLine="fm.SubscribeToTopic(\"Trckr-Cedex\") 'Topico de Gun";
_fm.SubscribeToTopic("Trckr-Cedex");
RDebugUtils.currentLine=69402629;
 //BA.debugLineNum = 69402629;BA.debugLine="If \"Cdx_\"&B4XPages.MainPage.usuario <> Subscrito";
if (("Cdx_"+mostCurrent._b4xpages._mainpage /*reparto_mazapa.keymon.lat.b4xmainpage*/ (processBA)._usuario /*String*/ ).equals(_subscrito) == false) { 
RDebugUtils.currentLine=69402630;
 //BA.debugLineNum = 69402630;BA.debugLine="fm.SubscribeToTopic(\"Cdx_\"&B4XPages.MainPage.usu";
_fm.SubscribeToTopic("Cdx_"+mostCurrent._b4xpages._mainpage /*reparto_mazapa.keymon.lat.b4xmainpage*/ (processBA)._usuario /*String*/ );
RDebugUtils.currentLine=69402631;
 //BA.debugLineNum = 69402631;BA.debugLine="fm.UnsubscribeFromTopic(Subscrito) 'Unsubscribe";
_fm.UnsubscribeFromTopic(_subscrito);
 };
RDebugUtils.currentLine=69402634;
 //BA.debugLineNum = 69402634;BA.debugLine="Subscrito = \"Cdx_\"&B4XPages.MainPage.usuario";
_subscrito = "Cdx_"+mostCurrent._b4xpages._mainpage /*reparto_mazapa.keymon.lat.b4xmainpage*/ (processBA)._usuario /*String*/ ;
RDebugUtils.currentLine=69402637;
 //BA.debugLineNum = 69402637;BA.debugLine="End Sub";
return "";
}
}