package SHARK2.keymon.com.mx;


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, "SHARK2.keymon.com.mx.c_updateavailable");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", SHARK2.keymon.com.mx.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 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_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=26673152;
 //BA.debugLineNum = 26673152;BA.debugLine="Public Sub Initialize As Object";
RDebugUtils.currentLine=26673153;
 //BA.debugLineNum = 26673153;BA.debugLine="Return Me";
if (true) return this;
RDebugUtils.currentLine=26673154;
 //BA.debugLineNum = 26673154;BA.debugLine="End Sub";
return null;
}
public void  _b4xpage_appear(SHARK2.keymon.com.mx.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(SHARK2.keymon.com.mx.c_updateavailable parent,SHARK2.keymon.com.mx.c_updateavailable __ref) {
this.parent = parent;
this.__ref = __ref;
this.__ref = parent;
}
SHARK2.keymon.com.mx.c_updateavailable __ref;
SHARK2.keymon.com.mx.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=26804225;
 //BA.debugLineNum = 26804225;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=26804226;
 //BA.debugLineNum = 26804226;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=26804227;
 //BA.debugLineNum = 26804227;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=26804228;
 //BA.debugLineNum = 26804228;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=26804229;
 //BA.debugLineNum = 26804229;BA.debugLine="Dim in As Intent";
_in = new anywheresoftware.b4a.objects.IntentWrapper();
RDebugUtils.currentLine=26804230;
 //BA.debugLineNum = 26804230;BA.debugLine="in.Initialize(\"android.settings.MANAGE_UNKNOWN_";
_in.Initialize("android.settings.MANAGE_UNKNOWN_APP_SOURCES","package:"+parent.__c.Application.getPackageName());
RDebugUtils.currentLine=26804231;
 //BA.debugLineNum = 26804231;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=26804234;
 //BA.debugLineNum = 26804234;BA.debugLine="Log(\"updateAvailable() Error - \" & LastException";
parent.__c.LogImpl("526804234","updateAvailable() Error - "+parent.__c.LastException(ba).getMessage(),0);
 if (true) break;
if (true) break;
;
RDebugUtils.currentLine=26804236;
 //BA.debugLineNum = 26804236;BA.debugLine="If appUpdater.newApp.update Then";

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

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

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

case 15:
//C
this.state = -1;
;
RDebugUtils.currentLine=26804241;
 //BA.debugLineNum = 26804241;BA.debugLine="End Sub";
if (true) break;
}} 
       catch (Exception e0) {
			
if (catchState == 0)
    throw e0;
else {
    state = catchState;
ba.setLastException(e0);}
            }
        }
    }
}
public boolean  _canrequestpackageinstalls(SHARK2.keymon.com.mx.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=26869760;
 //BA.debugLineNum = 26869760;BA.debugLine="public Sub CanRequestPackageInstalls As Boolean";
RDebugUtils.currentLine=26869762;
 //BA.debugLineNum = 26869762;BA.debugLine="Dim ctxt As JavaObject";
_ctxt = new anywheresoftware.b4j.object.JavaObject();
RDebugUtils.currentLine=26869763;
 //BA.debugLineNum = 26869763;BA.debugLine="ctxt.InitializeContext";
_ctxt.InitializeContext(ba);
RDebugUtils.currentLine=26869764;
 //BA.debugLineNum = 26869764;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=26869765;
 //BA.debugLineNum = 26869765;BA.debugLine="Return PackageManager.RunMethod(\"canRequestPackag";
if (true) return BA.ObjectToBoolean(_packagemanager.RunMethod("canRequestPackageInstalls",(Object[])(__c.Null)));
RDebugUtils.currentLine=26869766;
 //BA.debugLineNum = 26869766;BA.debugLine="End Sub";
return false;
}
public String  _ofreceactualizacion(SHARK2.keymon.com.mx.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=26935296;
 //BA.debugLineNum = 26935296;BA.debugLine="Sub ofreceActualizacion";
RDebugUtils.currentLine=26935297;
 //BA.debugLineNum = 26935297;BA.debugLine="If Msgbox2(appUpdater.newApp.newMsg,\"Actualizació";
if (__c.Msgbox2(BA.ObjectToCharSequence(_appupdater._newapp /*SHARK2.keymon.com.mx.appupdater._mnewversion*/ .newMsg /*String*/ ),BA.ObjectToCharSequence("Actualización disponible"),"Si","","No",(android.graphics.Bitmap)(__c.Null),ba)==__c.DialogResponse.POSITIVE) { 
RDebugUtils.currentLine=26935299;
 //BA.debugLineNum = 26935299;BA.debugLine="CallSubDelayed(appUpdater, \"download_newApk\")";
__c.CallSubDelayed(ba,(Object)(_appupdater.getObject()),"download_newApk");
 };
RDebugUtils.currentLine=26935301;
 //BA.debugLineNum = 26935301;BA.debugLine="B4XPages.MainPage.ocultaProgreso";
_b4xpages._mainpage /*SHARK2.keymon.com.mx.b4xmainpage*/ (ba)._ocultaprogreso /*String*/ (null);
RDebugUtils.currentLine=26935302;
 //BA.debugLineNum = 26935302;BA.debugLine="StartActivity(Main)";
__c.StartActivity(ba,(Object)(_main.getObject()));
RDebugUtils.currentLine=26935304;
 //BA.debugLineNum = 26935304;BA.debugLine="B4XPages.ShowPage(\"Login\")";
_b4xpages._showpage /*String*/ (ba,"Login");
RDebugUtils.currentLine=26935305;
 //BA.debugLineNum = 26935305;BA.debugLine="End Sub";
return "";
}
public String  _sinactualizacion(SHARK2.keymon.com.mx.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=27000832;
 //BA.debugLineNum = 27000832;BA.debugLine="Sub sinActualizacion";
RDebugUtils.currentLine=27000833;
 //BA.debugLineNum = 27000833;BA.debugLine="Msgbox(appUpdater.newApp.okMsg, \"Aplicación al co";
__c.Msgbox(BA.ObjectToCharSequence(_appupdater._newapp /*SHARK2.keymon.com.mx.appupdater._mnewversion*/ .okMsg /*String*/ ),BA.ObjectToCharSequence("Aplicación al corriente"),ba);
RDebugUtils.currentLine=27000835;
 //BA.debugLineNum = 27000835;BA.debugLine="B4XPages.MainPage.ocultaProgreso";
_b4xpages._mainpage /*SHARK2.keymon.com.mx.b4xmainpage*/ (ba)._ocultaprogreso /*String*/ (null);
RDebugUtils.currentLine=27000836;
 //BA.debugLineNum = 27000836;BA.debugLine="B4XPages.ShowPage(\"Login\")";
_b4xpages._showpage /*String*/ (ba,"Login");
RDebugUtils.currentLine=27000837;
 //BA.debugLineNum = 27000837;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_created(SHARK2.keymon.com.mx.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=26738688;
 //BA.debugLineNum = 26738688;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
RDebugUtils.currentLine=26738689;
 //BA.debugLineNum = 26738689;BA.debugLine="Root = Root1";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/  = _root1;
RDebugUtils.currentLine=26738691;
 //BA.debugLineNum = 26738691;BA.debugLine="Root.Color = Colors.Transparent";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .setColor(__c.Colors.Transparent);
RDebugUtils.currentLine=26738692;
 //BA.debugLineNum = 26738692;BA.debugLine="End Sub";
return "";
}
public String  _class_globals(SHARK2.keymon.com.mx.c_updateavailable __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_updateavailable";
RDebugUtils.currentLine=26607616;
 //BA.debugLineNum = 26607616;BA.debugLine="Sub Class_Globals";
RDebugUtils.currentLine=26607617;
 //BA.debugLineNum = 26607617;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
RDebugUtils.currentLine=26607618;
 //BA.debugLineNum = 26607618;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
RDebugUtils.currentLine=26607619;
 //BA.debugLineNum = 26607619;BA.debugLine="End Sub";
return "";
}
}