package reparto_mazapa.keymon.lat;


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

public class c_updateavailable 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, "reparto_mazapa.keymon.lat.c_updateavailable");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", reparto_mazapa.keymon.lat.c_updateavailable.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 anywheresoftware.b4a.objects.B4XViewWrapper _root = null;
public anywheresoftware.b4a.objects.B4XViewWrapper.XUI _xui = null;
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.firebasemessaging _firebasemessaging = 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 Object  _initialize(reparto_mazapa.keymon.lat.c_updateavailable __ref,anywheresoftware.b4a.BA _ba) throws Exception{
__ref = this;
innerInitialize(_ba);
RDebugUtils.currentModule="c_updateavailable";
if (Debug.shouldDelegate(ba, "initialize", false))
	 {return ((Object) Debug.delegate(ba, "initialize", new Object[] {_ba}));}
RDebugUtils.currentLine=61800448;
 //BA.debugLineNum = 61800448;BA.debugLine="Public Sub Initialize As Object";
RDebugUtils.currentLine=61800449;
 //BA.debugLineNum = 61800449;BA.debugLine="Return Me";
if (true) return this;
RDebugUtils.currentLine=61800450;
 //BA.debugLineNum = 61800450;BA.debugLine="End Sub";
return null;
}
public void  _b4xpage_appear(reparto_mazapa.keymon.lat.c_updateavailable __ref) throws Exception{
RDebugUtils.currentModule="c_updateavailable";
if (Debug.shouldDelegate(ba, "b4xpage_appear", false))
	 {Debug.delegate(ba, "b4xpage_appear", null); return;}
ResumableSub_B4XPage_Appear rsub = new ResumableSub_B4XPage_Appear(this,__ref);
rsub.resume(ba, null);
}
public static class ResumableSub_B4XPage_Appear extends BA.ResumableSub {
public ResumableSub_B4XPage_Appear(reparto_mazapa.keymon.lat.c_updateavailable parent,reparto_mazapa.keymon.lat.c_updateavailable __ref) {
this.parent = parent;
this.__ref = __ref;
this.__ref = parent;
}
reparto_mazapa.keymon.lat.c_updateavailable __ref;
reparto_mazapa.keymon.lat.c_updateavailable parent;
int _result = 0;
anywheresoftware.b4a.objects.IntentWrapper _in = null;

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

    while (true) {
try {

        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
RDebugUtils.currentLine=61931521;
 //BA.debugLineNum = 61931521;BA.debugLine="Try";
if (true) break;

case 1:
//try
this.state = 10;
this.catchState = 9;
this.state = 3;
if (true) break;

case 3:
//C
this.state = 4;
this.catchState = 9;
RDebugUtils.currentLine=61931522;
 //BA.debugLineNum = 61931522;BA.debugLine="Do While Not(CanRequestPackageInstalls)";
if (true) break;

case 4:
//do while
this.state = 7;
while (parent.__c.Not(__ref._canrequestpackageinstalls /*boolean*/ (null))) {
this.state = 6;
if (true) break;
}
if (true) break;

case 6:
//C
this.state = 4;
RDebugUtils.currentLine=61931523;
 //BA.debugLineNum = 61931523;BA.debugLine="MsgboxAsync($\"Por favor permita que ${Applicati";
parent.__c.MsgboxAsync(BA.ObjectToCharSequence(("Por favor permita que "+parent.__c.SmartStringFormatter("",(Object)(parent.__c.Application.getPackageName()))+" instale actualizaciones")),BA.ObjectToCharSequence("Instalar actualización"),ba);
RDebugUtils.currentLine=61931524;
 //BA.debugLineNum = 61931524;BA.debugLine="Wait For Msgbox_Result(Result As Int)";
parent.__c.WaitFor("msgbox_result", ba, new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "c_updateavailable", "b4xpage_appear"), null);
this.state = 16;
return;
case 16:
//C
this.state = 4;
_result = (Integer) result[1];
;
RDebugUtils.currentLine=61931525;
 //BA.debugLineNum = 61931525;BA.debugLine="Dim in As Intent";
_in = new anywheresoftware.b4a.objects.IntentWrapper();
RDebugUtils.currentLine=61931526;
 //BA.debugLineNum = 61931526;BA.debugLine="in.Initialize(\"android.settings.MANAGE_UNKNOWN_";
_in.Initialize("android.settings.MANAGE_UNKNOWN_APP_SOURCES","package:"+parent.__c.Application.getPackageName());
RDebugUtils.currentLine=61931527;
 //BA.debugLineNum = 61931527;BA.debugLine="StartActivity(in)";
parent.__c.StartActivity(ba,(Object)(_in.getObject()));
 if (true) break;

case 7:
//C
this.state = 10;
;
 if (true) break;

case 9:
//C
this.state = 10;
this.catchState = 0;
RDebugUtils.currentLine=61931530;
 //BA.debugLineNum = 61931530;BA.debugLine="Log(\"updateAvailable() Error - \" & LastException";
parent.__c.LogImpl("361931530","updateAvailable() Error - "+parent.__c.LastException(ba).getMessage(),0);
 if (true) break;
if (true) break;
;
RDebugUtils.currentLine=61931532;
 //BA.debugLineNum = 61931532;BA.debugLine="If appUpdater.newApp.update Then";

case 10:
//if
this.state = 15;
this.catchState = 0;
if (parent._appupdater._newapp /*reparto_mazapa.keymon.lat.appupdater._mnewversion*/ .update /*boolean*/ ) { 
this.state = 12;
}else {
this.state = 14;
}if (true) break;

case 12:
//C
this.state = 15;
RDebugUtils.currentLine=61931533;
 //BA.debugLineNum = 61931533;BA.debugLine="ofreceActualizacion";
__ref._ofreceactualizacion /*String*/ (null);
 if (true) break;

case 14:
//C
this.state = 15;
RDebugUtils.currentLine=61931535;
 //BA.debugLineNum = 61931535;BA.debugLine="sinActualizacion";
__ref._sinactualizacion /*String*/ (null);
 if (true) break;

case 15:
//C
this.state = -1;
;
RDebugUtils.currentLine=61931537;
 //BA.debugLineNum = 61931537;BA.debugLine="End Sub";
if (true) break;
}} 
       catch (Exception e0) {
			
if (catchState == 0)
    throw e0;
else {
    state = catchState;
ba.setLastException(e0);}
            }
        }
    }
}
public boolean  _canrequestpackageinstalls(reparto_mazapa.keymon.lat.c_updateavailable __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_updateavailable";
if (Debug.shouldDelegate(ba, "canrequestpackageinstalls", false))
	 {return ((Boolean) Debug.delegate(ba, "canrequestpackageinstalls", null));}
anywheresoftware.b4j.object.JavaObject _ctxt = null;
anywheresoftware.b4j.object.JavaObject _packagemanager = null;
RDebugUtils.currentLine=61997056;
 //BA.debugLineNum = 61997056;BA.debugLine="public Sub CanRequestPackageInstalls As Boolean";
RDebugUtils.currentLine=61997058;
 //BA.debugLineNum = 61997058;BA.debugLine="Dim ctxt As JavaObject";
_ctxt = new anywheresoftware.b4j.object.JavaObject();
RDebugUtils.currentLine=61997059;
 //BA.debugLineNum = 61997059;BA.debugLine="ctxt.InitializeContext";
_ctxt.InitializeContext(ba);
RDebugUtils.currentLine=61997060;
 //BA.debugLineNum = 61997060;BA.debugLine="Dim PackageManager As JavaObject = ctxt.RunMethod";
_packagemanager = new anywheresoftware.b4j.object.JavaObject();
_packagemanager = (anywheresoftware.b4j.object.JavaObject) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.object.JavaObject(), (java.lang.Object)(_ctxt.RunMethod("getPackageManager",(Object[])(__c.Null))));
RDebugUtils.currentLine=61997061;
 //BA.debugLineNum = 61997061;BA.debugLine="Return PackageManager.RunMethod(\"canRequestPackag";
if (true) return BA.ObjectToBoolean(_packagemanager.RunMethod("canRequestPackageInstalls",(Object[])(__c.Null)));
RDebugUtils.currentLine=61997062;
 //BA.debugLineNum = 61997062;BA.debugLine="End Sub";
return false;
}
public String  _ofreceactualizacion(reparto_mazapa.keymon.lat.c_updateavailable __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_updateavailable";
if (Debug.shouldDelegate(ba, "ofreceactualizacion", false))
	 {return ((String) Debug.delegate(ba, "ofreceactualizacion", null));}
RDebugUtils.currentLine=62062592;
 //BA.debugLineNum = 62062592;BA.debugLine="Sub ofreceActualizacion";
RDebugUtils.currentLine=62062593;
 //BA.debugLineNum = 62062593;BA.debugLine="If Msgbox2(appUpdater.newApp.newMsg,\"Actualizació";
if (__c.Msgbox2(BA.ObjectToCharSequence(_appupdater._newapp /*reparto_mazapa.keymon.lat.appupdater._mnewversion*/ .newMsg /*String*/ ),BA.ObjectToCharSequence("Actualización disponible"),"Si","","No",(android.graphics.Bitmap)(__c.Null),ba)==__c.DialogResponse.POSITIVE) { 
RDebugUtils.currentLine=62062595;
 //BA.debugLineNum = 62062595;BA.debugLine="CallSubDelayed(appUpdater, \"download_newApk\")";
__c.CallSubDelayed(ba,(Object)(_appupdater.getObject()),"download_newApk");
 };
RDebugUtils.currentLine=62062598;
 //BA.debugLineNum = 62062598;BA.debugLine="B4XPages.MainPage.ocultaProgreso";
_b4xpages._mainpage /*reparto_mazapa.keymon.lat.b4xmainpage*/ (ba)._ocultaprogreso /*String*/ (null);
RDebugUtils.currentLine=62062599;
 //BA.debugLineNum = 62062599;BA.debugLine="StartActivity(Main)";
__c.StartActivity(ba,(Object)(_main.getObject()));
RDebugUtils.currentLine=62062601;
 //BA.debugLineNum = 62062601;BA.debugLine="B4XPages.ShowPage(\"Login\")";
_b4xpages._showpage /*String*/ (ba,"Login");
RDebugUtils.currentLine=62062602;
 //BA.debugLineNum = 62062602;BA.debugLine="End Sub";
return "";
}
public String  _sinactualizacion(reparto_mazapa.keymon.lat.c_updateavailable __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_updateavailable";
if (Debug.shouldDelegate(ba, "sinactualizacion", false))
	 {return ((String) Debug.delegate(ba, "sinactualizacion", null));}
RDebugUtils.currentLine=62128128;
 //BA.debugLineNum = 62128128;BA.debugLine="Sub sinActualizacion";
RDebugUtils.currentLine=62128129;
 //BA.debugLineNum = 62128129;BA.debugLine="Msgbox(appUpdater.newApp.okMsg, \"Aplicación al co";
__c.Msgbox(BA.ObjectToCharSequence(_appupdater._newapp /*reparto_mazapa.keymon.lat.appupdater._mnewversion*/ .okMsg /*String*/ ),BA.ObjectToCharSequence("Aplicación al corriente"),ba);
RDebugUtils.currentLine=62128131;
 //BA.debugLineNum = 62128131;BA.debugLine="B4XPages.MainPage.ocultaProgreso";
_b4xpages._mainpage /*reparto_mazapa.keymon.lat.b4xmainpage*/ (ba)._ocultaprogreso /*String*/ (null);
RDebugUtils.currentLine=62128132;
 //BA.debugLineNum = 62128132;BA.debugLine="B4XPages.ShowPage(\"Login\")";
_b4xpages._showpage /*String*/ (ba,"Login");
RDebugUtils.currentLine=62128133;
 //BA.debugLineNum = 62128133;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_created(reparto_mazapa.keymon.lat.c_updateavailable __ref,anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_updateavailable";
if (Debug.shouldDelegate(ba, "b4xpage_created", false))
	 {return ((String) Debug.delegate(ba, "b4xpage_created", new Object[] {_root1}));}
RDebugUtils.currentLine=61865984;
 //BA.debugLineNum = 61865984;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
RDebugUtils.currentLine=61865985;
 //BA.debugLineNum = 61865985;BA.debugLine="Root = Root1";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/  = _root1;
RDebugUtils.currentLine=61865987;
 //BA.debugLineNum = 61865987;BA.debugLine="Root.Color = Colors.Transparent";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .setColor(__c.Colors.Transparent);
RDebugUtils.currentLine=61865988;
 //BA.debugLineNum = 61865988;BA.debugLine="End Sub";
return "";
}
public String  _class_globals(reparto_mazapa.keymon.lat.c_updateavailable __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_updateavailable";
RDebugUtils.currentLine=61734912;
 //BA.debugLineNum = 61734912;BA.debugLine="Sub Class_Globals";
RDebugUtils.currentLine=61734913;
 //BA.debugLineNum = 61734913;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
RDebugUtils.currentLine=61734914;
 //BA.debugLineNum = 61734914;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
RDebugUtils.currentLine=61734915;
 //BA.debugLineNum = 61734915;BA.debugLine="End Sub";
return "";
}
}