package reparto_mazapa.keymon.lat;


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

public class cl_appupdate 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.cl_appupdate");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", reparto_mazapa.keymon.lat.cl_appupdate.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 int _err_nopkg = 0;
public int _err_notxt = 0;
public int _err_noapk = 0;
public int _err_txtrow = 0;
public int _err_html = 0;
public int _err_nospace = 0;
public int _err_noperm = 0;
public int _err_download = 0;
public int _err_http = 0;
public int _ok_init = 0;
public int _ok_curver = 0;
public int _ok_webver = 0;
public int _no_newerapk = 0;
public int _ok_newerapk = 0;
public int _ok_download = 0;
public int _ok_install = 0;
public Object _callback = null;
public String _event = "";
public String _spackagename = "";
public String _snewvertxt = "";
public String _snewverapk = "";
public int _sstatuscode = 0;
public String _susername = "";
public String _supassword = "";
public String _curver = "";
public String _webver = "";
public String _webclog = "";
public String _webfsize = "";
public boolean _sverbose = false;
public anywheresoftware.b4a.objects.PanelWrapper _pnlsplash = null;
public boolean _splashshowing = false;
public anywheresoftware.b4a.phone.Phone _phone = null;
public anywheresoftware.b4a.objects.RuntimePermissions _rp = null;
public String _sharedfolder = "";
public boolean _usefileprovider = false;
public int _logcolor1 = 0;
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 boolean  _canrequestpackageinstalls(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "canrequestpackageinstalls", true))
	 {return ((Boolean) Debug.delegate(ba, "canrequestpackageinstalls", null));}
anywheresoftware.b4j.object.JavaObject _ctxt = null;
anywheresoftware.b4j.object.JavaObject _packagemanager = null;
RDebugUtils.currentLine=23330816;
 //BA.debugLineNum = 23330816;BA.debugLine="Public Sub CanRequestPackageInstalls As Boolean";
RDebugUtils.currentLine=23330817;
 //BA.debugLineNum = 23330817;BA.debugLine="Dim ctxt As JavaObject";
_ctxt = new anywheresoftware.b4j.object.JavaObject();
RDebugUtils.currentLine=23330818;
 //BA.debugLineNum = 23330818;BA.debugLine="ctxt.InitializeContext";
_ctxt.InitializeContext(ba);
RDebugUtils.currentLine=23330819;
 //BA.debugLineNum = 23330819;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=23330820;
 //BA.debugLineNum = 23330820;BA.debugLine="Return PackageManager.RunMethod(\"canRequestPackag";
if (true) return BA.ObjectToBoolean(_packagemanager.RunMethod("canRequestPackageInstalls",(Object[])(__c.Null)));
RDebugUtils.currentLine=23330821;
 //BA.debugLineNum = 23330821;BA.debugLine="End Sub";
return false;
}
public boolean  _checknonmarketappsenabled(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "checknonmarketappsenabled", true))
	 {return ((Boolean) Debug.delegate(ba, "checknonmarketappsenabled", null));}
anywheresoftware.b4j.object.JavaObject _context = null;
anywheresoftware.b4j.object.JavaObject _resolver = null;
anywheresoftware.b4j.object.JavaObject _global = null;
RDebugUtils.currentLine=23396352;
 //BA.debugLineNum = 23396352;BA.debugLine="Public Sub CheckNonMarketAppsEnabled As Boolean";
RDebugUtils.currentLine=23396353;
 //BA.debugLineNum = 23396353;BA.debugLine="If phone.SdkVersion >= 26 Then Return True";
if (__ref._phone /*anywheresoftware.b4a.phone.Phone*/ .getSdkVersion()>=26) { 
if (true) return __c.True;};
RDebugUtils.currentLine=23396354;
 //BA.debugLineNum = 23396354;BA.debugLine="If phone.SdkVersion < 17 Or phone.SdkVersion >= 2";
if (__ref._phone /*anywheresoftware.b4a.phone.Phone*/ .getSdkVersion()<17 || __ref._phone /*anywheresoftware.b4a.phone.Phone*/ .getSdkVersion()>=21) { 
RDebugUtils.currentLine=23396355;
 //BA.debugLineNum = 23396355;BA.debugLine="Return phone.GetSettings(\"install_non_market_app";
if (true) return (__ref._phone /*anywheresoftware.b4a.phone.Phone*/ .GetSettings("install_non_market_apps")).equals("1");
 }else {
RDebugUtils.currentLine=23396357;
 //BA.debugLineNum = 23396357;BA.debugLine="Dim context As JavaObject";
_context = new anywheresoftware.b4j.object.JavaObject();
RDebugUtils.currentLine=23396358;
 //BA.debugLineNum = 23396358;BA.debugLine="context.InitializeContext";
_context.InitializeContext(ba);
RDebugUtils.currentLine=23396359;
 //BA.debugLineNum = 23396359;BA.debugLine="Dim resolver As JavaObject = context.RunMethod(\"";
_resolver = new anywheresoftware.b4j.object.JavaObject();
_resolver = (anywheresoftware.b4j.object.JavaObject) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.object.JavaObject(), (java.lang.Object)(_context.RunMethod("getContentResolver",(Object[])(__c.Null))));
RDebugUtils.currentLine=23396360;
 //BA.debugLineNum = 23396360;BA.debugLine="Dim global As JavaObject";
_global = new anywheresoftware.b4j.object.JavaObject();
RDebugUtils.currentLine=23396361;
 //BA.debugLineNum = 23396361;BA.debugLine="global.InitializeStatic(\"android.provider.Settin";
_global.InitializeStatic("android.provider.Settings.Global");
RDebugUtils.currentLine=23396362;
 //BA.debugLineNum = 23396362;BA.debugLine="Return global.RunMethod(\"getString\", Array(resol";
if (true) return (_global.RunMethod("getString",new Object[]{(Object)(_resolver.getObject()),(Object)("install_non_market_apps")})).equals((Object)("1"));
 };
RDebugUtils.currentLine=23396364;
 //BA.debugLineNum = 23396364;BA.debugLine="End Sub";
return false;
}
public String  _class_globals(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
RDebugUtils.currentLine=21430272;
 //BA.debugLineNum = 21430272;BA.debugLine="Private Sub Class_Globals";
RDebugUtils.currentLine=21430274;
 //BA.debugLineNum = 21430274;BA.debugLine="Public ERR_NOPKG = -1	As Int				'missing package";
_err_nopkg = (int) (-1);
RDebugUtils.currentLine=21430275;
 //BA.debugLineNum = 21430275;BA.debugLine="Public ERR_NOTXT = -2 As Int				'missing webserve";
_err_notxt = (int) (-2);
RDebugUtils.currentLine=21430276;
 //BA.debugLineNum = 21430276;BA.debugLine="Public ERR_NOAPK = -3 As Int				'missing webserve";
_err_noapk = (int) (-3);
RDebugUtils.currentLine=21430277;
 //BA.debugLineNum = 21430277;BA.debugLine="Public ERR_TXTROW = -4 As Int				'wrong row forma";
_err_txtrow = (int) (-4);
RDebugUtils.currentLine=21430278;
 //BA.debugLineNum = 21430278;BA.debugLine="Public ERR_HTML = -5 As Int					'website returned";
_err_html = (int) (-5);
RDebugUtils.currentLine=21430279;
 //BA.debugLineNum = 21430279;BA.debugLine="Public ERR_NOSPACE = -6 As Int				'no enough spac";
_err_nospace = (int) (-6);
RDebugUtils.currentLine=21430280;
 //BA.debugLineNum = 21430280;BA.debugLine="Public ERR_NOPERM = -7 As Int				'no permissions";
_err_noperm = (int) (-7);
RDebugUtils.currentLine=21430281;
 //BA.debugLineNum = 21430281;BA.debugLine="Public ERR_DOWNLOAD = -8 As Int				'failed to dow";
_err_download = (int) (-8);
RDebugUtils.currentLine=21430282;
 //BA.debugLineNum = 21430282;BA.debugLine="Public ERR_HTTP = -100 As Int				'HttpUtils error";
_err_http = (int) (-100);
RDebugUtils.currentLine=21430283;
 //BA.debugLineNum = 21430283;BA.debugLine="Public OK_INIT = 0 As Int";
_ok_init = (int) (0);
RDebugUtils.currentLine=21430284;
 //BA.debugLineNum = 21430284;BA.debugLine="Public OK_CURVER = 1 As Int					'curver has valid";
_ok_curver = (int) (1);
RDebugUtils.currentLine=21430285;
 //BA.debugLineNum = 21430285;BA.debugLine="Public OK_WEBVER = 2 As Int";
_ok_webver = (int) (2);
RDebugUtils.currentLine=21430286;
 //BA.debugLineNum = 21430286;BA.debugLine="Public NO_NEWERAPK = 3 As Int				'apk version on";
_no_newerapk = (int) (3);
RDebugUtils.currentLine=21430287;
 //BA.debugLineNum = 21430287;BA.debugLine="Public OK_NEWERAPK = 4 As Int				'current apk has";
_ok_newerapk = (int) (4);
RDebugUtils.currentLine=21430288;
 //BA.debugLineNum = 21430288;BA.debugLine="Public OK_DOWNLOAD = 5 As Int				'newer apk corre";
_ok_download = (int) (5);
RDebugUtils.currentLine=21430289;
 //BA.debugLineNum = 21430289;BA.debugLine="Public OK_INSTALL = 6 As Int				'user asked to in";
_ok_install = (int) (6);
RDebugUtils.currentLine=21430292;
 //BA.debugLineNum = 21430292;BA.debugLine="Private Callback As Object";
_callback = new Object();
RDebugUtils.currentLine=21430293;
 //BA.debugLineNum = 21430293;BA.debugLine="Private Event As String";
_event = "";
RDebugUtils.currentLine=21430294;
 //BA.debugLineNum = 21430294;BA.debugLine="Private sPackageName As String      		'ex: com.te";
_spackagename = "";
RDebugUtils.currentLine=21430295;
 //BA.debugLineNum = 21430295;BA.debugLine="Private sNewVerTxt As String        		'ex: http:/";
_snewvertxt = "";
RDebugUtils.currentLine=21430296;
 //BA.debugLineNum = 21430296;BA.debugLine="Private sNewVerApk  As String       		'ex: http:/";
_snewverapk = "";
RDebugUtils.currentLine=21430297;
 //BA.debugLineNum = 21430297;BA.debugLine="Private sStatusCode As Int          		'negatives";
_sstatuscode = 0;
RDebugUtils.currentLine=21430298;
 //BA.debugLineNum = 21430298;BA.debugLine="Private sUserName As String         		'user name";
_susername = "";
RDebugUtils.currentLine=21430299;
 //BA.debugLineNum = 21430299;BA.debugLine="Private sUPassword As String        		'password r";
_supassword = "";
RDebugUtils.currentLine=21430300;
 //BA.debugLineNum = 21430300;BA.debugLine="Private curver, webver As String    		'curver = c";
_curver = "";
_webver = "";
RDebugUtils.currentLine=21430301;
 //BA.debugLineNum = 21430301;BA.debugLine="Private webclog As String					'webclog = optional";
_webclog = "";
RDebugUtils.currentLine=21430302;
 //BA.debugLineNum = 21430302;BA.debugLine="Private webfsize As String					'webfsize = option";
_webfsize = "";
RDebugUtils.currentLine=21430303;
 //BA.debugLineNum = 21430303;BA.debugLine="Private sVerbose As Boolean					'TRUE = a lot of";
_sverbose = false;
RDebugUtils.currentLine=21430304;
 //BA.debugLineNum = 21430304;BA.debugLine="Private pnlSplash As Panel					'panel used to sup";
_pnlsplash = new anywheresoftware.b4a.objects.PanelWrapper();
RDebugUtils.currentLine=21430305;
 //BA.debugLineNum = 21430305;BA.debugLine="Private SplashShowing As Boolean			'True = splash";
_splashshowing = false;
RDebugUtils.currentLine=21430306;
 //BA.debugLineNum = 21430306;BA.debugLine="Private phone As Phone";
_phone = new anywheresoftware.b4a.phone.Phone();
RDebugUtils.currentLine=21430307;
 //BA.debugLineNum = 21430307;BA.debugLine="Private rp As RuntimePermissions";
_rp = new anywheresoftware.b4a.objects.RuntimePermissions();
RDebugUtils.currentLine=21430308;
 //BA.debugLineNum = 21430308;BA.debugLine="Private SharedFolder As String				'Foder where to";
_sharedfolder = "";
RDebugUtils.currentLine=21430309;
 //BA.debugLineNum = 21430309;BA.debugLine="Private UseFileProvider As Boolean			'TRUE = SDK";
_usefileprovider = false;
RDebugUtils.currentLine=21430310;
 //BA.debugLineNum = 21430310;BA.debugLine="Private LogColor1 As Int = 0xFFFF8C00		'first col";
_logcolor1 = ((int)0xffff8c00);
RDebugUtils.currentLine=21430311;
 //BA.debugLineNum = 21430311;BA.debugLine="End Sub";
return "";
}
public void  _downloadapk(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "downloadapk", true))
	 {Debug.delegate(ba, "downloadapk", null); return;}
ResumableSub_DownloadApk rsub = new ResumableSub_DownloadApk(this,__ref);
rsub.resume(ba, null);
}
public static class ResumableSub_DownloadApk extends BA.ResumableSub {
public ResumableSub_DownloadApk(reparto_mazapa.keymon.lat.cl_appupdate parent,reparto_mazapa.keymon.lat.cl_appupdate __ref) {
this.parent = parent;
this.__ref = __ref;
this.__ref = parent;
}
reparto_mazapa.keymon.lat.cl_appupdate __ref;
reparto_mazapa.keymon.lat.cl_appupdate parent;
reparto_mazapa.keymon.lat.httpjob _j = null;
anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper _out = null;

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

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

case 0:
//C
this.state = 1;
RDebugUtils.currentLine=22478849;
 //BA.debugLineNum = 22478849;BA.debugLine="LogColor(\"---- AppUpdating.DownloadApk\", LogColor";
parent.__c.LogImpl("922478849","---- AppUpdating.DownloadApk",__ref._logcolor1 /*int*/ );
RDebugUtils.currentLine=22478851;
 //BA.debugLineNum = 22478851;BA.debugLine="If sNewVerApk = \"\" Then";
if (true) break;

case 1:
//if
this.state = 10;
if ((__ref._snewverapk /*String*/ ).equals("")) { 
this.state = 3;
}if (true) break;

case 3:
//C
this.state = 4;
RDebugUtils.currentLine=22478852;
 //BA.debugLineNum = 22478852;BA.debugLine="sStatusCode = ERR_NOAPK";
__ref._sstatuscode /*int*/  = __ref._err_noapk /*int*/ ;
RDebugUtils.currentLine=22478853;
 //BA.debugLineNum = 22478853;BA.debugLine="If sVerbose Then Log($\"${TAB}missing apk file fu";
if (true) break;

case 4:
//if
this.state = 9;
if (__ref._sverbose /*boolean*/ ) { 
this.state = 6;
;}if (true) break;

case 6:
//C
this.state = 9;
parent.__c.LogImpl("922478853",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"missing apk file full path indication"),0);
if (true) break;

case 9:
//C
this.state = 10;
;
RDebugUtils.currentLine=22478854;
 //BA.debugLineNum = 22478854;BA.debugLine="Finito";
__ref._finito /*String*/ (null);
RDebugUtils.currentLine=22478855;
 //BA.debugLineNum = 22478855;BA.debugLine="Return";
if (true) return ;
 if (true) break;

case 10:
//C
this.state = 11;
;
RDebugUtils.currentLine=22478858;
 //BA.debugLineNum = 22478858;BA.debugLine="Dim j As HttpJob";
_j = new reparto_mazapa.keymon.lat.httpjob();
RDebugUtils.currentLine=22478859;
 //BA.debugLineNum = 22478859;BA.debugLine="j.Initialize(\"\", Me)";
_j._initialize /*String*/ (null,ba,"",parent);
RDebugUtils.currentLine=22478860;
 //BA.debugLineNum = 22478860;BA.debugLine="j.Username = sUserName";
_j._username /*String*/  = __ref._susername /*String*/ ;
RDebugUtils.currentLine=22478861;
 //BA.debugLineNum = 22478861;BA.debugLine="j.Password = sUPassword";
_j._password /*String*/  = __ref._supassword /*String*/ ;
RDebugUtils.currentLine=22478862;
 //BA.debugLineNum = 22478862;BA.debugLine="j.Download(sNewVerApk)							'ex: j.Download(\"htt";
_j._download /*String*/ (null,__ref._snewverapk /*String*/ );
RDebugUtils.currentLine=22478863;
 //BA.debugLineNum = 22478863;BA.debugLine="Wait For (j) JobDone(j As HttpJob)";
parent.__c.WaitFor("jobdone", ba, new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "cl_appupdate", "downloadapk"), (Object)(_j));
this.state = 29;
return;
case 29:
//C
this.state = 11;
_j = (reparto_mazapa.keymon.lat.httpjob) result[1];
;
RDebugUtils.currentLine=22478864;
 //BA.debugLineNum = 22478864;BA.debugLine="Log($\"Donload ok? ${j.Success}\"$)";
parent.__c.LogImpl("922478864",("Donload ok? "+parent.__c.SmartStringFormatter("",(Object)(_j._success /*boolean*/ ))+""),0);
RDebugUtils.currentLine=22478865;
 //BA.debugLineNum = 22478865;BA.debugLine="If j.Success Then";
if (true) break;

case 11:
//if
this.state = 28;
if (_j._success /*boolean*/ ) { 
this.state = 13;
}else {
this.state = 21;
}if (true) break;

case 13:
//C
this.state = 14;
RDebugUtils.currentLine=22478867;
 //BA.debugLineNum = 22478867;BA.debugLine="Dim out As OutputStream";
_out = new anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper();
RDebugUtils.currentLine=22478868;
 //BA.debugLineNum = 22478868;BA.debugLine="out = File.OpenOutput(SharedFolder,\"tmp.apk\",Fal";
_out = parent.__c.File.OpenOutput(__ref._sharedfolder /*String*/ ,"tmp.apk",parent.__c.False);
RDebugUtils.currentLine=22478869;
 //BA.debugLineNum = 22478869;BA.debugLine="File.Copy2(J.GetInputStream, out)";
parent.__c.File.Copy2((java.io.InputStream)(_j._getinputstream /*anywheresoftware.b4a.objects.streams.File.InputStreamWrapper*/ (null).getObject()),(java.io.OutputStream)(_out.getObject()));
RDebugUtils.currentLine=22478870;
 //BA.debugLineNum = 22478870;BA.debugLine="out.Close";
_out.Close();
RDebugUtils.currentLine=22478871;
 //BA.debugLineNum = 22478871;BA.debugLine="Log($\"Copy2 (saving) ok? TRUE\"$)";
parent.__c.LogImpl("922478871",("Copy2 (saving) ok? TRUE"),0);
RDebugUtils.currentLine=22478872;
 //BA.debugLineNum = 22478872;BA.debugLine="sStatusCode = OK_DOWNLOAD";
__ref._sstatuscode /*int*/  = __ref._ok_download /*int*/ ;
RDebugUtils.currentLine=22478873;
 //BA.debugLineNum = 22478873;BA.debugLine="If sVerbose Then Log($\"${TAB}new apk version dow";
if (true) break;

case 14:
//if
this.state = 19;
if (__ref._sverbose /*boolean*/ ) { 
this.state = 16;
;}if (true) break;

case 16:
//C
this.state = 19;
parent.__c.LogImpl("922478873",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"new apk version downloaded and ready to install"),0);
if (true) break;

case 19:
//C
this.state = 28;
;
 if (true) break;

case 21:
//C
this.state = 22;
RDebugUtils.currentLine=22478875;
 //BA.debugLineNum = 22478875;BA.debugLine="Log($\"${TAB}Error: ${J.ErrorMessage}\"$)";
parent.__c.LogImpl("922478875",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"Error: "+parent.__c.SmartStringFormatter("",(Object)(_j._errormessage /*String*/ ))+""),0);
RDebugUtils.currentLine=22478876;
 //BA.debugLineNum = 22478876;BA.debugLine="sStatusCode = ERR_HTTP";
__ref._sstatuscode /*int*/  = __ref._err_http /*int*/ ;
RDebugUtils.currentLine=22478877;
 //BA.debugLineNum = 22478877;BA.debugLine="If sVerbose Then Log($\"${TAB}error in httputils2";
if (true) break;

case 22:
//if
this.state = 27;
if (__ref._sverbose /*boolean*/ ) { 
this.state = 24;
;}if (true) break;

case 24:
//C
this.state = 27;
parent.__c.LogImpl("922478877",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"error in httputils2"),0);
if (true) break;

case 27:
//C
this.state = 28;
;
RDebugUtils.currentLine=22478878;
 //BA.debugLineNum = 22478878;BA.debugLine="ToastMessageShow(\"Error: \" & J.ErrorMessage, Tru";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("Error: "+_j._errormessage /*String*/ ),parent.__c.True);
 if (true) break;

case 28:
//C
this.state = -1;
;
RDebugUtils.currentLine=22478880;
 //BA.debugLineNum = 22478880;BA.debugLine="j.Release";
_j._release /*String*/ (null);
RDebugUtils.currentLine=22478881;
 //BA.debugLineNum = 22478881;BA.debugLine="Finito";
__ref._finito /*String*/ (null);
RDebugUtils.currentLine=22478882;
 //BA.debugLineNum = 22478882;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _finito(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "finito", true))
	 {return ((String) Debug.delegate(ba, "finito", null));}
RDebugUtils.currentLine=22740992;
 //BA.debugLineNum = 22740992;BA.debugLine="Private Sub Finito";
RDebugUtils.currentLine=22740993;
 //BA.debugLineNum = 22740993;BA.debugLine="If SubExists(Callback,Event&\"_UpdateComplete\") Th";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._event /*String*/ +"_UpdateComplete")) { 
RDebugUtils.currentLine=22740994;
 //BA.debugLineNum = 22740994;BA.debugLine="CallSub(Callback,Event&\"_UpdateComplete\")";
__c.CallSubNew(ba,__ref._callback /*Object*/ ,__ref._event /*String*/ +"_UpdateComplete");
 };
RDebugUtils.currentLine=22740996;
 //BA.debugLineNum = 22740996;BA.debugLine="End Sub";
return "";
}
public String  _extractcl(reparto_mazapa.keymon.lat.cl_appupdate __ref,String _txtrow) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "extractcl", true))
	 {return ((String) Debug.delegate(ba, "extractcl", new Object[] {_txtrow}));}
int _i = 0;
int _j1 = 0;
int _j2 = 0;
RDebugUtils.currentLine=23003136;
 //BA.debugLineNum = 23003136;BA.debugLine="Private Sub ExtractCL(TxtRow As String) As String";
RDebugUtils.currentLine=23003137;
 //BA.debugLineNum = 23003137;BA.debugLine="Dim i As Int";
_i = 0;
RDebugUtils.currentLine=23003138;
 //BA.debugLineNum = 23003138;BA.debugLine="i = TxtRow.IndexOf(\"<ChangeLog>\")";
_i = _txtrow.indexOf("<ChangeLog>");
RDebugUtils.currentLine=23003139;
 //BA.debugLineNum = 23003139;BA.debugLine="If i <> -1 Then";
if (_i!=-1) { 
RDebugUtils.currentLine=23003140;
 //BA.debugLineNum = 23003140;BA.debugLine="Dim j1 As Int = TxtRow.IndexOf(\"</ChangeLog>\")";
_j1 = _txtrow.indexOf("</ChangeLog>");
RDebugUtils.currentLine=23003141;
 //BA.debugLineNum = 23003141;BA.debugLine="If j1 = -1 Then";
if (_j1==-1) { 
RDebugUtils.currentLine=23003142;
 //BA.debugLineNum = 23003142;BA.debugLine="Dim j2 As Int = TxtRow.IndexOf(\"<FileSize>\")	'l";
_j2 = _txtrow.indexOf("<FileSize>");
RDebugUtils.currentLine=23003143;
 //BA.debugLineNum = 23003143;BA.debugLine="j1 = j2";
_j1 = _j2;
RDebugUtils.currentLine=23003144;
 //BA.debugLineNum = 23003144;BA.debugLine="If j1 < i Then j1 = -1";
if (_j1<_i) { 
_j1 = (int) (-1);};
 };
RDebugUtils.currentLine=23003146;
 //BA.debugLineNum = 23003146;BA.debugLine="If j1 <> -1 Then Return TxtRow.SubString2(i+11,j";
if (_j1!=-1) { 
if (true) return _txtrow.substring((int) (_i+11),_j1);}
else {
if (true) return _txtrow.substring((int) (_i+11));};
 }else {
RDebugUtils.currentLine=23003148;
 //BA.debugLineNum = 23003148;BA.debugLine="Return \"\"";
if (true) return "";
 };
RDebugUtils.currentLine=23003150;
 //BA.debugLineNum = 23003150;BA.debugLine="End Sub";
return "";
}
public String  _extractsz(reparto_mazapa.keymon.lat.cl_appupdate __ref,String _txtrow) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "extractsz", true))
	 {return ((String) Debug.delegate(ba, "extractsz", new Object[] {_txtrow}));}
int _i = 0;
int _j1 = 0;
int _j2 = 0;
String _s = "";
RDebugUtils.currentLine=23068672;
 //BA.debugLineNum = 23068672;BA.debugLine="Private Sub ExtractSZ(TxtRow As String) As String";
RDebugUtils.currentLine=23068673;
 //BA.debugLineNum = 23068673;BA.debugLine="Dim i As Int";
_i = 0;
RDebugUtils.currentLine=23068674;
 //BA.debugLineNum = 23068674;BA.debugLine="i = TxtRow.IndexOf(\"<FileSize>\")";
_i = _txtrow.indexOf("<FileSize>");
RDebugUtils.currentLine=23068675;
 //BA.debugLineNum = 23068675;BA.debugLine="If i <> -1 Then";
if (_i!=-1) { 
RDebugUtils.currentLine=23068676;
 //BA.debugLineNum = 23068676;BA.debugLine="Dim j1 As Int = TxtRow.IndexOf(\"</FileSize>\")		'";
_j1 = _txtrow.indexOf("</FileSize>");
RDebugUtils.currentLine=23068677;
 //BA.debugLineNum = 23068677;BA.debugLine="If j1 = -1 Then";
if (_j1==-1) { 
RDebugUtils.currentLine=23068678;
 //BA.debugLineNum = 23068678;BA.debugLine="Dim j2 As Int = TxtRow.IndexOf(\"<ChangeLog>\")	'";
_j2 = _txtrow.indexOf("<ChangeLog>");
RDebugUtils.currentLine=23068679;
 //BA.debugLineNum = 23068679;BA.debugLine="j1 = j2";
_j1 = _j2;
RDebugUtils.currentLine=23068680;
 //BA.debugLineNum = 23068680;BA.debugLine="If j1 < i Then j1 = -1";
if (_j1<_i) { 
_j1 = (int) (-1);};
 };
RDebugUtils.currentLine=23068682;
 //BA.debugLineNum = 23068682;BA.debugLine="Dim s As String";
_s = "";
RDebugUtils.currentLine=23068683;
 //BA.debugLineNum = 23068683;BA.debugLine="If j1 <> -1 Then s = TxtRow.SubString2(i+10,j1)";
if (_j1!=-1) { 
_s = _txtrow.substring((int) (_i+10),_j1);}
else {
_s = _txtrow.substring((int) (_i+10));};
RDebugUtils.currentLine=23068684;
 //BA.debugLineNum = 23068684;BA.debugLine="s = s.Replace(CRLF,\"\")";
_s = _s.replace(__c.CRLF,"");
RDebugUtils.currentLine=23068685;
 //BA.debugLineNum = 23068685;BA.debugLine="s=s.Replace(Chr(13),\"\")";
_s = _s.replace(BA.ObjectToString(__c.Chr((int) (13))),"");
RDebugUtils.currentLine=23068686;
 //BA.debugLineNum = 23068686;BA.debugLine="Return s";
if (true) return _s;
 }else {
RDebugUtils.currentLine=23068688;
 //BA.debugLineNum = 23068688;BA.debugLine="Return \"\"";
if (true) return "";
 };
RDebugUtils.currentLine=23068690;
 //BA.debugLineNum = 23068690;BA.debugLine="End Sub";
return "";
}
public String  _extractvn(reparto_mazapa.keymon.lat.cl_appupdate __ref,String _txtrow) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "extractvn", true))
	 {return ((String) Debug.delegate(ba, "extractvn", new Object[] {_txtrow}));}
int _i = 0;
int _j1 = 0;
int _j2 = 0;
int _j = 0;
String _s = "";
RDebugUtils.currentLine=22937600;
 //BA.debugLineNum = 22937600;BA.debugLine="Private Sub ExtractVN(TxtRow As String) As String";
RDebugUtils.currentLine=22937601;
 //BA.debugLineNum = 22937601;BA.debugLine="Dim i As Int";
_i = 0;
RDebugUtils.currentLine=22937602;
 //BA.debugLineNum = 22937602;BA.debugLine="i = TxtRow.IndexOf(\"=\")";
_i = _txtrow.indexOf("=");
RDebugUtils.currentLine=22937603;
 //BA.debugLineNum = 22937603;BA.debugLine="If i <> -1 Then";
if (_i!=-1) { 
RDebugUtils.currentLine=22937604;
 //BA.debugLineNum = 22937604;BA.debugLine="Dim j1 As Int = TxtRow.IndexOf(\"<ChangeLog>\")	'l";
_j1 = _txtrow.indexOf("<ChangeLog>");
RDebugUtils.currentLine=22937605;
 //BA.debugLineNum = 22937605;BA.debugLine="Dim j2 As Int = TxtRow.IndexOf(\"<FileSize>\")	'lo";
_j2 = _txtrow.indexOf("<FileSize>");
RDebugUtils.currentLine=22937606;
 //BA.debugLineNum = 22937606;BA.debugLine="Dim j As Int = Min(j1, j2)";
_j = (int) (__c.Min(_j1,_j2));
RDebugUtils.currentLine=22937607;
 //BA.debugLineNum = 22937607;BA.debugLine="If j = -1 Then j = Max(j1,j2)";
if (_j==-1) { 
_j = (int) (__c.Max(_j1,_j2));};
RDebugUtils.currentLine=22937608;
 //BA.debugLineNum = 22937608;BA.debugLine="Dim s As String";
_s = "";
RDebugUtils.currentLine=22937609;
 //BA.debugLineNum = 22937609;BA.debugLine="If j <> - 1 Then s=TxtRow.SubString2(i+1,j) Else";
if (_j!=-1) { 
_s = _txtrow.substring((int) (_i+1),_j);}
else {
_s = _txtrow.substring((int) (_i+1));};
RDebugUtils.currentLine=22937610;
 //BA.debugLineNum = 22937610;BA.debugLine="s=s.Replace(CRLF,\"\")";
_s = _s.replace(__c.CRLF,"");
RDebugUtils.currentLine=22937611;
 //BA.debugLineNum = 22937611;BA.debugLine="s=s.Replace(Chr(13),\"\")";
_s = _s.replace(BA.ObjectToString(__c.Chr((int) (13))),"");
RDebugUtils.currentLine=22937612;
 //BA.debugLineNum = 22937612;BA.debugLine="Return s";
if (true) return _s;
 }else {
RDebugUtils.currentLine=22937614;
 //BA.debugLineNum = 22937614;BA.debugLine="Return \"\"";
if (true) return "";
 };
RDebugUtils.currentLine=22937616;
 //BA.debugLineNum = 22937616;BA.debugLine="End Sub";
return "";
}
public long  _getavailablespace(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "getavailablespace", true))
	 {return ((Long) Debug.delegate(ba, "getavailablespace", null));}
RDebugUtils.currentLine=22282240;
 //BA.debugLineNum = 22282240;BA.debugLine="Public Sub GetAvailableSpace As Long";
RDebugUtils.currentLine=22282241;
 //BA.debugLineNum = 22282241;BA.debugLine="Return GetFreeSpace";
if (true) return __ref._getfreespace /*long*/ (null);
RDebugUtils.currentLine=22282242;
 //BA.debugLineNum = 22282242;BA.debugLine="End Sub";
return 0L;
}
public long  _getfreespace(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "getfreespace", true))
	 {return ((Long) Debug.delegate(ba, "getfreespace", null));}
anywheresoftware.b4j.object.JavaObject _jo = null;
RDebugUtils.currentLine=23134208;
 //BA.debugLineNum = 23134208;BA.debugLine="Private Sub GetFreeSpace As Long";
RDebugUtils.currentLine=23134209;
 //BA.debugLineNum = 23134209;BA.debugLine="Dim jo As JavaObject";
_jo = new anywheresoftware.b4j.object.JavaObject();
RDebugUtils.currentLine=23134210;
 //BA.debugLineNum = 23134210;BA.debugLine="jo.InitializeNewInstance(\"java.io.File\", Array(Sh";
_jo.InitializeNewInstance("java.io.File",new Object[]{(Object)(__ref._sharedfolder /*String*/ )});
RDebugUtils.currentLine=23134211;
 //BA.debugLineNum = 23134211;BA.debugLine="Return jo.RunMethod(\"getFreeSpace\", Null)";
if (true) return BA.ObjectToLongNumber(_jo.RunMethod("getFreeSpace",(Object[])(__c.Null)));
RDebugUtils.currentLine=23134212;
 //BA.debugLineNum = 23134212;BA.debugLine="End Sub";
return 0L;
}
public String  _getcurvn(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "getcurvn", true))
	 {return ((String) Debug.delegate(ba, "getcurvn", null));}
RDebugUtils.currentLine=22020096;
 //BA.debugLineNum = 22020096;BA.debugLine="Public Sub getCurVN As String";
RDebugUtils.currentLine=22020097;
 //BA.debugLineNum = 22020097;BA.debugLine="Return curver";
if (true) return __ref._curver /*String*/ ;
RDebugUtils.currentLine=22020098;
 //BA.debugLineNum = 22020098;BA.debugLine="End Sub";
return "";
}
public Object  _getfileuri(reparto_mazapa.keymon.lat.cl_appupdate __ref,String _filename) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "getfileuri", true))
	 {return ((Object) Debug.delegate(ba, "getfileuri", new Object[] {_filename}));}
anywheresoftware.b4j.object.JavaObject _uri = null;
anywheresoftware.b4j.object.JavaObject _f = null;
anywheresoftware.b4j.object.JavaObject _fp = null;
anywheresoftware.b4j.object.JavaObject _context = null;
RDebugUtils.currentLine=23527424;
 //BA.debugLineNum = 23527424;BA.debugLine="Private Sub GetFileUri (FileName As String) As Obj";
RDebugUtils.currentLine=23527425;
 //BA.debugLineNum = 23527425;BA.debugLine="If UseFileProvider = False Then";
if (__ref._usefileprovider /*boolean*/ ==__c.False) { 
RDebugUtils.currentLine=23527426;
 //BA.debugLineNum = 23527426;BA.debugLine="Dim uri As JavaObject";
_uri = new anywheresoftware.b4j.object.JavaObject();
RDebugUtils.currentLine=23527427;
 //BA.debugLineNum = 23527427;BA.debugLine="Return uri.InitializeStatic(\"android.net.Uri\").R";
if (true) return _uri.InitializeStatic("android.net.Uri").RunMethod("parse",new Object[]{(Object)("file://"+__c.File.Combine(__ref._sharedfolder /*String*/ ,_filename))});
 }else {
RDebugUtils.currentLine=23527429;
 //BA.debugLineNum = 23527429;BA.debugLine="Dim f As JavaObject";
_f = new anywheresoftware.b4j.object.JavaObject();
RDebugUtils.currentLine=23527430;
 //BA.debugLineNum = 23527430;BA.debugLine="f.InitializeNewInstance(\"java.io.File\", Array(Sh";
_f.InitializeNewInstance("java.io.File",new Object[]{(Object)(__ref._sharedfolder /*String*/ ),(Object)(_filename)});
RDebugUtils.currentLine=23527431;
 //BA.debugLineNum = 23527431;BA.debugLine="Dim fp As JavaObject";
_fp = new anywheresoftware.b4j.object.JavaObject();
RDebugUtils.currentLine=23527432;
 //BA.debugLineNum = 23527432;BA.debugLine="Dim context As JavaObject";
_context = new anywheresoftware.b4j.object.JavaObject();
RDebugUtils.currentLine=23527433;
 //BA.debugLineNum = 23527433;BA.debugLine="context.InitializeContext";
_context.InitializeContext(ba);
RDebugUtils.currentLine=23527434;
 //BA.debugLineNum = 23527434;BA.debugLine="fp.InitializeStatic(\"android.support.v4.content.";
_fp.InitializeStatic("androidx.core.content.FileProvider");
RDebugUtils.currentLine=23527435;
 //BA.debugLineNum = 23527435;BA.debugLine="Return fp.RunMethod(\"getUriForFile\", Array(conte";
if (true) return _fp.RunMethod("getUriForFile",new Object[]{(Object)(_context.getObject()),(Object)(__c.Application.getPackageName()+".provider"),(Object)(_f.getObject())});
 };
RDebugUtils.currentLine=23527437;
 //BA.debugLineNum = 23527437;BA.debugLine="End Sub";
return null;
}
public String  _getnmappinst(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "getnmappinst", true))
	 {return ((String) Debug.delegate(ba, "getnmappinst", null));}
anywheresoftware.b4j.object.JavaObject _jo = null;
anywheresoftware.b4j.object.JavaObject _context = null;
anywheresoftware.b4j.object.JavaObject _resolver = null;
RDebugUtils.currentLine=23265280;
 //BA.debugLineNum = 23265280;BA.debugLine="Private Sub GetNMAppInst As String";
RDebugUtils.currentLine=23265281;
 //BA.debugLineNum = 23265281;BA.debugLine="Dim jo As JavaObject";
_jo = new anywheresoftware.b4j.object.JavaObject();
RDebugUtils.currentLine=23265282;
 //BA.debugLineNum = 23265282;BA.debugLine="jo.InitializeStatic(\"android.provider.Settings.Se";
_jo.InitializeStatic("android.provider.Settings.Secure");
RDebugUtils.currentLine=23265283;
 //BA.debugLineNum = 23265283;BA.debugLine="Dim context As JavaObject";
_context = new anywheresoftware.b4j.object.JavaObject();
RDebugUtils.currentLine=23265284;
 //BA.debugLineNum = 23265284;BA.debugLine="context.InitializeContext";
_context.InitializeContext(ba);
RDebugUtils.currentLine=23265285;
 //BA.debugLineNum = 23265285;BA.debugLine="Dim resolver As JavaObject = context.RunMethod(\"g";
_resolver = new anywheresoftware.b4j.object.JavaObject();
_resolver = (anywheresoftware.b4j.object.JavaObject) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.object.JavaObject(), (java.lang.Object)(_context.RunMethod("getContentResolver",(Object[])(__c.Null))));
RDebugUtils.currentLine=23265286;
 //BA.debugLineNum = 23265286;BA.debugLine="Return jo.RunMethod(\"getString\", Array(resolver,";
if (true) return BA.ObjectToString(_jo.RunMethod("getString",new Object[]{(Object)(_resolver.getObject()),(Object)("install_non_market_apps")}));
RDebugUtils.currentLine=23265287;
 //BA.debugLineNum = 23265287;BA.debugLine="End Sub";
return "";
}
public String  _getpackagename(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "getpackagename", true))
	 {return ((String) Debug.delegate(ba, "getpackagename", null));}
RDebugUtils.currentLine=21626880;
 //BA.debugLineNum = 21626880;BA.debugLine="Public Sub getPackageName As String";
RDebugUtils.currentLine=21626881;
 //BA.debugLineNum = 21626881;BA.debugLine="Return sPackageName";
if (true) return __ref._spackagename /*String*/ ;
RDebugUtils.currentLine=21626882;
 //BA.debugLineNum = 21626882;BA.debugLine="End Sub";
return "";
}
public int  _getsdkversion(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "getsdkversion", true))
	 {return ((Integer) Debug.delegate(ba, "getsdkversion", null));}
anywheresoftware.b4j.object.JavaObject _jo = null;
RDebugUtils.currentLine=23199744;
 //BA.debugLineNum = 23199744;BA.debugLine="Private Sub GetSDKVersion As Int";
RDebugUtils.currentLine=23199745;
 //BA.debugLineNum = 23199745;BA.debugLine="Dim jo As JavaObject";
_jo = new anywheresoftware.b4j.object.JavaObject();
RDebugUtils.currentLine=23199746;
 //BA.debugLineNum = 23199746;BA.debugLine="jo.InitializeStatic(\"android.os.Build.VERSION\")";
_jo.InitializeStatic("android.os.Build.VERSION");
RDebugUtils.currentLine=23199747;
 //BA.debugLineNum = 23199747;BA.debugLine="Return jo.GetField(\"SDK_INT\")";
if (true) return (int)(BA.ObjectToNumber(_jo.GetField("SDK_INT")));
RDebugUtils.currentLine=23199748;
 //BA.debugLineNum = 23199748;BA.debugLine="End Sub";
return 0;
}
public int  _getstatus(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "getstatus", true))
	 {return ((Integer) Debug.delegate(ba, "getstatus", null));}
RDebugUtils.currentLine=21954560;
 //BA.debugLineNum = 21954560;BA.debugLine="Public Sub getStatus As Int";
RDebugUtils.currentLine=21954561;
 //BA.debugLineNum = 21954561;BA.debugLine="Return sStatusCode";
if (true) return __ref._sstatuscode /*int*/ ;
RDebugUtils.currentLine=21954562;
 //BA.debugLineNum = 21954562;BA.debugLine="End Sub";
return 0;
}
public String  _getwebchangelog(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "getwebchangelog", true))
	 {return ((String) Debug.delegate(ba, "getwebchangelog", null));}
RDebugUtils.currentLine=22151168;
 //BA.debugLineNum = 22151168;BA.debugLine="Public Sub getWebChangeLog As String";
RDebugUtils.currentLine=22151169;
 //BA.debugLineNum = 22151169;BA.debugLine="Return webclog";
if (true) return __ref._webclog /*String*/ ;
RDebugUtils.currentLine=22151170;
 //BA.debugLineNum = 22151170;BA.debugLine="End Sub";
return "";
}
public String  _getwebfilesize(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "getwebfilesize", true))
	 {return ((String) Debug.delegate(ba, "getwebfilesize", null));}
RDebugUtils.currentLine=22216704;
 //BA.debugLineNum = 22216704;BA.debugLine="Public Sub getWebFileSize As String";
RDebugUtils.currentLine=22216705;
 //BA.debugLineNum = 22216705;BA.debugLine="Return webfsize";
if (true) return __ref._webfsize /*String*/ ;
RDebugUtils.currentLine=22216706;
 //BA.debugLineNum = 22216706;BA.debugLine="End Sub";
return "";
}
public String  _getwebvn(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "getwebvn", true))
	 {return ((String) Debug.delegate(ba, "getwebvn", null));}
RDebugUtils.currentLine=22085632;
 //BA.debugLineNum = 22085632;BA.debugLine="Public Sub getWebVN As String";
RDebugUtils.currentLine=22085633;
 //BA.debugLineNum = 22085633;BA.debugLine="Return webver";
if (true) return __ref._webver /*String*/ ;
RDebugUtils.currentLine=22085634;
 //BA.debugLineNum = 22085634;BA.debugLine="End Sub";
return "";
}
public String  _initialize(reparto_mazapa.keymon.lat.cl_appupdate __ref,anywheresoftware.b4a.BA _ba,Object _callbackmodule,String _eventname) throws Exception{
__ref = this;
innerInitialize(_ba);
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "initialize", true))
	 {return ((String) Debug.delegate(ba, "initialize", new Object[] {_ba,_callbackmodule,_eventname}));}
anywheresoftware.b4a.phone.Phone _p = null;
RDebugUtils.currentLine=21495808;
 //BA.debugLineNum = 21495808;BA.debugLine="Public Sub Initialize(CallbackModule As Object, Ev";
RDebugUtils.currentLine=21495809;
 //BA.debugLineNum = 21495809;BA.debugLine="Callback = CallbackModule";
__ref._callback /*Object*/  = _callbackmodule;
RDebugUtils.currentLine=21495810;
 //BA.debugLineNum = 21495810;BA.debugLine="Event = EventName";
__ref._event /*String*/  = _eventname;
RDebugUtils.currentLine=21495811;
 //BA.debugLineNum = 21495811;BA.debugLine="sPackageName = \"\"";
__ref._spackagename /*String*/  = "";
RDebugUtils.currentLine=21495812;
 //BA.debugLineNum = 21495812;BA.debugLine="sNewVerTxt = \"\"";
__ref._snewvertxt /*String*/  = "";
RDebugUtils.currentLine=21495813;
 //BA.debugLineNum = 21495813;BA.debugLine="sNewVerApk = \"\"";
__ref._snewverapk /*String*/  = "";
RDebugUtils.currentLine=21495814;
 //BA.debugLineNum = 21495814;BA.debugLine="sUserName = \"\"";
__ref._susername /*String*/  = "";
RDebugUtils.currentLine=21495815;
 //BA.debugLineNum = 21495815;BA.debugLine="sUPassword = \"\"";
__ref._supassword /*String*/  = "";
RDebugUtils.currentLine=21495816;
 //BA.debugLineNum = 21495816;BA.debugLine="sStatusCode = OK_INIT";
__ref._sstatuscode /*int*/  = __ref._ok_init /*int*/ ;
RDebugUtils.currentLine=21495817;
 //BA.debugLineNum = 21495817;BA.debugLine="curver = \"\"";
__ref._curver /*String*/  = "";
RDebugUtils.currentLine=21495818;
 //BA.debugLineNum = 21495818;BA.debugLine="webver = \"\"";
__ref._webver /*String*/  = "";
RDebugUtils.currentLine=21495819;
 //BA.debugLineNum = 21495819;BA.debugLine="sVerbose = False";
__ref._sverbose /*boolean*/  = __c.False;
RDebugUtils.currentLine=21495820;
 //BA.debugLineNum = 21495820;BA.debugLine="Dim p As Phone";
_p = new anywheresoftware.b4a.phone.Phone();
RDebugUtils.currentLine=21495821;
 //BA.debugLineNum = 21495821;BA.debugLine="If p.SdkVersion >= 24 Or File.ExternalWritable =";
if (_p.getSdkVersion()>=24 || __c.File.getExternalWritable()==__c.False) { 
RDebugUtils.currentLine=21495822;
 //BA.debugLineNum = 21495822;BA.debugLine="UseFileProvider = True";
__ref._usefileprovider /*boolean*/  = __c.True;
RDebugUtils.currentLine=21495823;
 //BA.debugLineNum = 21495823;BA.debugLine="SharedFolder = File.Combine(File.DirInternal, \"s";
__ref._sharedfolder /*String*/  = __c.File.Combine(__c.File.getDirInternal(),"shared");
RDebugUtils.currentLine=21495824;
 //BA.debugLineNum = 21495824;BA.debugLine="File.MakeDir(\"\", SharedFolder)";
__c.File.MakeDir("",__ref._sharedfolder /*String*/ );
 }else {
RDebugUtils.currentLine=21495826;
 //BA.debugLineNum = 21495826;BA.debugLine="UseFileProvider = False";
__ref._usefileprovider /*boolean*/  = __c.False;
RDebugUtils.currentLine=21495827;
 //BA.debugLineNum = 21495827;BA.debugLine="SharedFolder = rp.GetSafeDirDefaultExternal(\"sha";
__ref._sharedfolder /*String*/  = __ref._rp /*anywheresoftware.b4a.objects.RuntimePermissions*/ .GetSafeDirDefaultExternal("shared");
 };
RDebugUtils.currentLine=21495829;
 //BA.debugLineNum = 21495829;BA.debugLine="Log($\"SDK#: ${p.SdkVersion} - UseFP: ${UseFilePro";
__c.LogImpl("921495829",("SDK#: "+__c.SmartStringFormatter("",(Object)(_p.getSdkVersion()))+" - UseFP: "+__c.SmartStringFormatter("",(Object)(__ref._usefileprovider /*boolean*/ ))+" - SharedFolder: "+__c.SmartStringFormatter("",(Object)(__ref._sharedfolder /*String*/ ))+""),0);
RDebugUtils.currentLine=21495830;
 //BA.debugLineNum = 21495830;BA.debugLine="End Sub";
return "";
}
public String  _installapk(reparto_mazapa.keymon.lat.cl_appupdate __ref,boolean _pstatus) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "installapk", true))
	 {return ((String) Debug.delegate(ba, "installapk", new Object[] {_pstatus}));}
RDebugUtils.currentLine=22544384;
 //BA.debugLineNum = 22544384;BA.debugLine="Public Sub InstallApk(pstatus As Boolean)";
RDebugUtils.currentLine=22544385;
 //BA.debugLineNum = 22544385;BA.debugLine="LogColor(\"---- AppUpdating.InstallApk\", LogColor1";
__c.LogImpl("922544385","---- AppUpdating.InstallApk",__ref._logcolor1 /*int*/ );
RDebugUtils.currentLine=22544386;
 //BA.debugLineNum = 22544386;BA.debugLine="If pstatus Then";
if (_pstatus) { 
RDebugUtils.currentLine=22544387;
 //BA.debugLineNum = 22544387;BA.debugLine="SendInstallIntent";
__ref._sendinstallintent /*String*/ (null);
RDebugUtils.currentLine=22544388;
 //BA.debugLineNum = 22544388;BA.debugLine="sStatusCode = OK_INSTALL";
__ref._sstatuscode /*int*/  = __ref._ok_install /*int*/ ;
RDebugUtils.currentLine=22544389;
 //BA.debugLineNum = 22544389;BA.debugLine="If sVerbose Then Log(TAB & \"user asked to instal";
if (__ref._sverbose /*boolean*/ ) { 
__c.LogImpl("922544389",__c.TAB+"user asked to install new apk",0);};
 }else {
RDebugUtils.currentLine=22544391;
 //BA.debugLineNum = 22544391;BA.debugLine="sStatusCode = ERR_NOPERM";
__ref._sstatuscode /*int*/  = __ref._err_noperm /*int*/ ;
RDebugUtils.currentLine=22544392;
 //BA.debugLineNum = 22544392;BA.debugLine="If sVerbose Then Log(TAB & \"no permissions from";
if (__ref._sverbose /*boolean*/ ) { 
__c.LogImpl("922544392",__c.TAB+"no permissions from user to install new apk",0);};
 };
RDebugUtils.currentLine=22544394;
 //BA.debugLineNum = 22544394;BA.debugLine="Finito";
__ref._finito /*String*/ (null);
RDebugUtils.currentLine=22544395;
 //BA.debugLineNum = 22544395;BA.debugLine="End Sub";
return "";
}
public String  _sendinstallintent(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "sendinstallintent", true))
	 {return ((String) Debug.delegate(ba, "sendinstallintent", null));}
String _apkname = "";
anywheresoftware.b4a.objects.IntentWrapper _i = null;
RDebugUtils.currentLine=23461888;
 //BA.debugLineNum = 23461888;BA.debugLine="Private Sub SendInstallIntent";
RDebugUtils.currentLine=23461889;
 //BA.debugLineNum = 23461889;BA.debugLine="Dim ApkName As String = \"tmp.apk\"";
_apkname = "tmp.apk";
RDebugUtils.currentLine=23461890;
 //BA.debugLineNum = 23461890;BA.debugLine="Dim i As Intent";
_i = new anywheresoftware.b4a.objects.IntentWrapper();
RDebugUtils.currentLine=23461891;
 //BA.debugLineNum = 23461891;BA.debugLine="If phone.SdkVersion >= 24 Then													'Nouga";
if (__ref._phone /*anywheresoftware.b4a.phone.Phone*/ .getSdkVersion()>=24) { 
RDebugUtils.currentLine=23461892;
 //BA.debugLineNum = 23461892;BA.debugLine="i.Initialize(\"android.intent.action.INSTALL_PACK";
_i.Initialize("android.intent.action.INSTALL_PACKAGE",BA.ObjectToString(__ref._getfileuri /*Object*/ (null,_apkname)));
RDebugUtils.currentLine=23461893;
 //BA.debugLineNum = 23461893;BA.debugLine="i.Flags = Bit.Or(i.Flags, 1) 'FLAG_GRANT_READ_UR";
_i.setFlags(__c.Bit.Or(_i.getFlags(),(int) (1)));
 }else {
RDebugUtils.currentLine=23461895;
 //BA.debugLineNum = 23461895;BA.debugLine="i.Initialize(i.ACTION_VIEW, \"file://\" & File.Com";
_i.Initialize(_i.ACTION_VIEW,"file://"+__c.File.Combine(__ref._sharedfolder /*String*/ ,_apkname));
RDebugUtils.currentLine=23461896;
 //BA.debugLineNum = 23461896;BA.debugLine="i.SetType(\"application/vnd.android.package-archi";
_i.SetType("application/vnd.android.package-archive");
 };
RDebugUtils.currentLine=23461898;
 //BA.debugLineNum = 23461898;BA.debugLine="StartActivity(i)";
__c.StartActivity(ba,(Object)(_i.getObject()));
RDebugUtils.currentLine=23461899;
 //BA.debugLineNum = 23461899;BA.debugLine="End Sub";
return "";
}
public boolean  _isvalidcv(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "isvalidcv", true))
	 {return ((Boolean) Debug.delegate(ba, "isvalidcv", null));}
anywheresoftware.b4a.phone.PackageManagerWrapper _pm = null;
RDebugUtils.currentLine=22806528;
 //BA.debugLineNum = 22806528;BA.debugLine="Private Sub IsValidCV As Boolean";
RDebugUtils.currentLine=22806529;
 //BA.debugLineNum = 22806529;BA.debugLine="If sPackageName = \"\" Then";
if ((__ref._spackagename /*String*/ ).equals("")) { 
RDebugUtils.currentLine=22806530;
 //BA.debugLineNum = 22806530;BA.debugLine="curver = \"\"";
__ref._curver /*String*/  = "";
RDebugUtils.currentLine=22806531;
 //BA.debugLineNum = 22806531;BA.debugLine="sStatusCode = ERR_NOPKG";
__ref._sstatuscode /*int*/  = __ref._err_nopkg /*int*/ ;
RDebugUtils.currentLine=22806532;
 //BA.debugLineNum = 22806532;BA.debugLine="If sVerbose Then Log($\"${TAB}missing package nam";
if (__ref._sverbose /*boolean*/ ) { 
__c.LogImpl("922806532",(""+__c.SmartStringFormatter("",(Object)(__c.TAB))+"missing package name for current version check"),0);};
 }else {
RDebugUtils.currentLine=22806534;
 //BA.debugLineNum = 22806534;BA.debugLine="Dim pm As PackageManager";
_pm = new anywheresoftware.b4a.phone.PackageManagerWrapper();
RDebugUtils.currentLine=22806535;
 //BA.debugLineNum = 22806535;BA.debugLine="curver = pm.GetVersionName(sPackageName)";
__ref._curver /*String*/  = _pm.GetVersionName(__ref._spackagename /*String*/ );
RDebugUtils.currentLine=22806536;
 //BA.debugLineNum = 22806536;BA.debugLine="sStatusCode = OK_CURVER 									'got current ve";
__ref._sstatuscode /*int*/  = __ref._ok_curver /*int*/ ;
RDebugUtils.currentLine=22806537;
 //BA.debugLineNum = 22806537;BA.debugLine="If sVerbose Then Log($\"${TAB}Current Version: ${";
if (__ref._sverbose /*boolean*/ ) { 
__c.LogImpl("922806537",(""+__c.SmartStringFormatter("",(Object)(__c.TAB))+"Current Version: "+__c.SmartStringFormatter("",(Object)(__ref._curver /*String*/ ))+""),0);};
 };
RDebugUtils.currentLine=22806539;
 //BA.debugLineNum = 22806539;BA.debugLine="Return (sStatusCode == OK_CURVER)";
if (true) return (__ref._sstatuscode /*int*/ ==__ref._ok_curver /*int*/ );
RDebugUtils.currentLine=22806540;
 //BA.debugLineNum = 22806540;BA.debugLine="End Sub";
return false;
}
public anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _isvalidwv(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "isvalidwv", true))
	 {return ((anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) Debug.delegate(ba, "isvalidwv", null));}
ResumableSub_IsvalidWV rsub = new ResumableSub_IsvalidWV(this,__ref);
rsub.resume(ba, null);
return (anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.keywords.Common.ResumableSubWrapper(), rsub);
}
public static class ResumableSub_IsvalidWV extends BA.ResumableSub {
public ResumableSub_IsvalidWV(reparto_mazapa.keymon.lat.cl_appupdate parent,reparto_mazapa.keymon.lat.cl_appupdate __ref) {
this.parent = parent;
this.__ref = __ref;
this.__ref = parent;
}
reparto_mazapa.keymon.lat.cl_appupdate __ref;
reparto_mazapa.keymon.lat.cl_appupdate parent;
reparto_mazapa.keymon.lat.httpjob _j = null;

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

    while (true) {
        switch (state) {
            case -1:
{
parent.__c.ReturnFromResumableSub(this,null);return;}
case 0:
//C
this.state = 1;
RDebugUtils.currentLine=22872065;
 //BA.debugLineNum = 22872065;BA.debugLine="Log(\"IsValidComplete start\")";
parent.__c.LogImpl("922872065","IsValidComplete start",0);
RDebugUtils.currentLine=22872066;
 //BA.debugLineNum = 22872066;BA.debugLine="If sNewVerTxt = \"\" Then";
if (true) break;

case 1:
//if
this.state = 60;
if ((__ref._snewvertxt /*String*/ ).equals("")) { 
this.state = 3;
}else {
this.state = 11;
}if (true) break;

case 3:
//C
this.state = 4;
RDebugUtils.currentLine=22872067;
 //BA.debugLineNum = 22872067;BA.debugLine="webver = \"\"";
__ref._webver /*String*/  = "";
RDebugUtils.currentLine=22872068;
 //BA.debugLineNum = 22872068;BA.debugLine="sStatusCode = ERR_NOTXT";
__ref._sstatuscode /*int*/  = __ref._err_notxt /*int*/ ;
RDebugUtils.currentLine=22872069;
 //BA.debugLineNum = 22872069;BA.debugLine="If sVerbose Then Log($\"${TAB}missing info file f";
if (true) break;

case 4:
//if
this.state = 9;
if (__ref._sverbose /*boolean*/ ) { 
this.state = 6;
;}if (true) break;

case 6:
//C
this.state = 9;
parent.__c.LogImpl("922872069",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"missing info file full path indication"),0);
if (true) break;

case 9:
//C
this.state = 60;
;
 if (true) break;

case 11:
//C
this.state = 12;
RDebugUtils.currentLine=22872072;
 //BA.debugLineNum = 22872072;BA.debugLine="Dim j As HttpJob";
_j = new reparto_mazapa.keymon.lat.httpjob();
RDebugUtils.currentLine=22872073;
 //BA.debugLineNum = 22872073;BA.debugLine="j.Initialize(\"\", Me)";
_j._initialize /*String*/ (null,ba,"",parent);
RDebugUtils.currentLine=22872074;
 //BA.debugLineNum = 22872074;BA.debugLine="j.Username = sUserName";
_j._username /*String*/  = __ref._susername /*String*/ ;
RDebugUtils.currentLine=22872075;
 //BA.debugLineNum = 22872075;BA.debugLine="j.Password = sUPassword";
_j._password /*String*/  = __ref._supassword /*String*/ ;
RDebugUtils.currentLine=22872076;
 //BA.debugLineNum = 22872076;BA.debugLine="j.Download(sNewVerTxt)								'ex: jobapk.Downlo";
_j._download /*String*/ (null,__ref._snewvertxt /*String*/ );
RDebugUtils.currentLine=22872077;
 //BA.debugLineNum = 22872077;BA.debugLine="Log(\"before\")";
parent.__c.LogImpl("922872077","before",0);
RDebugUtils.currentLine=22872078;
 //BA.debugLineNum = 22872078;BA.debugLine="Wait For (j) JobDone(j As HttpJob)";
parent.__c.WaitFor("jobdone", ba, new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "cl_appupdate", "isvalidwv"), (Object)(_j));
this.state = 61;
return;
case 61:
//C
this.state = 12;
_j = (reparto_mazapa.keymon.lat.httpjob) result[1];
;
RDebugUtils.currentLine=22872079;
 //BA.debugLineNum = 22872079;BA.debugLine="Log(\"after\")";
parent.__c.LogImpl("922872079","after",0);
RDebugUtils.currentLine=22872080;
 //BA.debugLineNum = 22872080;BA.debugLine="If j.Success Then";
if (true) break;

case 12:
//if
this.state = 59;
if (_j._success /*boolean*/ ) { 
this.state = 14;
}else {
this.state = 52;
}if (true) break;

case 14:
//C
this.state = 15;
RDebugUtils.currentLine=22872081;
 //BA.debugLineNum = 22872081;BA.debugLine="If sVerbose Then Log($\"Webserver's info file co";
if (true) break;

case 15:
//if
this.state = 20;
if (__ref._sverbose /*boolean*/ ) { 
this.state = 17;
;}if (true) break;

case 17:
//C
this.state = 20;
parent.__c.LogImpl("922872081",("Webserver's info file content: "+parent.__c.SmartStringFormatter("",(Object)(parent.__c.CRLF))+""+parent.__c.SmartStringFormatter("",(Object)(_j._getstring /*String*/ (null)))+""),0);
if (true) break;

case 20:
//C
this.state = 21;
;
RDebugUtils.currentLine=22872082;
 //BA.debugLineNum = 22872082;BA.debugLine="If Not(J.GetString.Contains(\"<!DOCTYPE html>\"))";
if (true) break;

case 21:
//if
this.state = 50;
if (parent.__c.Not(_j._getstring /*String*/ (null).contains("<!DOCTYPE html>"))) { 
this.state = 23;
}else {
this.state = 43;
}if (true) break;

case 23:
//C
this.state = 24;
RDebugUtils.currentLine=22872083;
 //BA.debugLineNum = 22872083;BA.debugLine="webver = ExtractVN(J.GetString)";
__ref._webver /*String*/  = __ref._extractvn /*String*/ (null,_j._getstring /*String*/ (null));
RDebugUtils.currentLine=22872084;
 //BA.debugLineNum = 22872084;BA.debugLine="webclog = ExtractCL(J.GetString)					'optional";
__ref._webclog /*String*/  = __ref._extractcl /*String*/ (null,_j._getstring /*String*/ (null));
RDebugUtils.currentLine=22872085;
 //BA.debugLineNum = 22872085;BA.debugLine="webfsize = ExtractSZ(J.GetString)					'optiona";
__ref._webfsize /*String*/  = __ref._extractsz /*String*/ (null,_j._getstring /*String*/ (null));
RDebugUtils.currentLine=22872086;
 //BA.debugLineNum = 22872086;BA.debugLine="If webver = \"\" Then";
if (true) break;

case 24:
//if
this.state = 41;
if ((__ref._webver /*String*/ ).equals("")) { 
this.state = 26;
}else {
this.state = 34;
}if (true) break;

case 26:
//C
this.state = 27;
RDebugUtils.currentLine=22872087;
 //BA.debugLineNum = 22872087;BA.debugLine="sStatusCode = ERR_TXTROW";
__ref._sstatuscode /*int*/  = __ref._err_txtrow /*int*/ ;
RDebugUtils.currentLine=22872088;
 //BA.debugLineNum = 22872088;BA.debugLine="If sVerbose Then Log($\"${TAB}wrong row format";
if (true) break;

case 27:
//if
this.state = 32;
if (__ref._sverbose /*boolean*/ ) { 
this.state = 29;
;}if (true) break;

case 29:
//C
this.state = 32;
parent.__c.LogImpl("922872088",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"wrong row format in info file "),0);
if (true) break;

case 32:
//C
this.state = 41;
;
 if (true) break;

case 34:
//C
this.state = 35;
RDebugUtils.currentLine=22872090;
 //BA.debugLineNum = 22872090;BA.debugLine="sStatusCode = OK_WEBVER							'read apk's ver";
__ref._sstatuscode /*int*/  = __ref._ok_webver /*int*/ ;
RDebugUtils.currentLine=22872091;
 //BA.debugLineNum = 22872091;BA.debugLine="If sVerbose Then Log($\"${TAB}Web version numb";
if (true) break;

case 35:
//if
this.state = 40;
if (__ref._sverbose /*boolean*/ ) { 
this.state = 37;
;}if (true) break;

case 37:
//C
this.state = 40;
parent.__c.LogImpl("922872091",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"Web version number: "+parent.__c.SmartStringFormatter("",(Object)(__ref._webver /*String*/ ))+""),0);
if (true) break;

case 40:
//C
this.state = 41;
;
 if (true) break;

case 41:
//C
this.state = 50;
;
 if (true) break;

case 43:
//C
this.state = 44;
RDebugUtils.currentLine=22872094;
 //BA.debugLineNum = 22872094;BA.debugLine="sStatusCode = ERR_HTML								'website returne";
__ref._sstatuscode /*int*/  = __ref._err_html /*int*/ ;
RDebugUtils.currentLine=22872095;
 //BA.debugLineNum = 22872095;BA.debugLine="If sVerbose Then Log($\"${TAB}ERROR: website re";
if (true) break;

case 44:
//if
this.state = 49;
if (__ref._sverbose /*boolean*/ ) { 
this.state = 46;
;}if (true) break;

case 46:
//C
this.state = 49;
parent.__c.LogImpl("922872095",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"ERROR: website returned an HTML error page"),0);
if (true) break;

case 49:
//C
this.state = 50;
;
 if (true) break;

case 50:
//C
this.state = 59;
;
 if (true) break;

case 52:
//C
this.state = 53;
RDebugUtils.currentLine=22872098;
 //BA.debugLineNum = 22872098;BA.debugLine="Log($\"${TAB}Error: ${J.ErrorMessage}\"$)";
parent.__c.LogImpl("922872098",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"Error: "+parent.__c.SmartStringFormatter("",(Object)(_j._errormessage /*String*/ ))+""),0);
RDebugUtils.currentLine=22872099;
 //BA.debugLineNum = 22872099;BA.debugLine="sStatusCode = ERR_HTTP";
__ref._sstatuscode /*int*/  = __ref._err_http /*int*/ ;
RDebugUtils.currentLine=22872100;
 //BA.debugLineNum = 22872100;BA.debugLine="If sVerbose Then Log($\"${TAB}error in httputils";
if (true) break;

case 53:
//if
this.state = 58;
if (__ref._sverbose /*boolean*/ ) { 
this.state = 55;
;}if (true) break;

case 55:
//C
this.state = 58;
parent.__c.LogImpl("922872100",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"error in httputils2"),0);
if (true) break;

case 58:
//C
this.state = 59;
;
RDebugUtils.currentLine=22872101;
 //BA.debugLineNum = 22872101;BA.debugLine="ToastMessageShow(\"Error: \" & J.ErrorMessage, Tr";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("Error: "+_j._errormessage /*String*/ ),parent.__c.True);
 if (true) break;

case 59:
//C
this.state = 60;
;
RDebugUtils.currentLine=22872103;
 //BA.debugLineNum = 22872103;BA.debugLine="j.Release";
_j._release /*String*/ (null);
 if (true) break;

case 60:
//C
this.state = -1;
;
RDebugUtils.currentLine=22872105;
 //BA.debugLineNum = 22872105;BA.debugLine="Return (sStatusCode == OK_WEBVER)";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)((__ref._sstatuscode /*int*/ ==__ref._ok_webver /*int*/ )));return;};
RDebugUtils.currentLine=22872106;
 //BA.debugLineNum = 22872106;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _readcurvn(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "readcurvn", true))
	 {return ((String) Debug.delegate(ba, "readcurvn", null));}
RDebugUtils.currentLine=22347776;
 //BA.debugLineNum = 22347776;BA.debugLine="Public Sub ReadCurVN";
RDebugUtils.currentLine=22347777;
 //BA.debugLineNum = 22347777;BA.debugLine="LogColor(\"---- AppUpdating.ReadCurVN\", LogColor1)";
__c.LogImpl("922347777","---- AppUpdating.ReadCurVN",__ref._logcolor1 /*int*/ );
RDebugUtils.currentLine=22347778;
 //BA.debugLineNum = 22347778;BA.debugLine="IsValidCV											'we don't care about its resu";
__ref._isvalidcv /*boolean*/ (null);
RDebugUtils.currentLine=22347779;
 //BA.debugLineNum = 22347779;BA.debugLine="Finito";
__ref._finito /*String*/ (null);
RDebugUtils.currentLine=22347780;
 //BA.debugLineNum = 22347780;BA.debugLine="End Sub";
return "";
}
public void  _readwebvn(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "readwebvn", true))
	 {Debug.delegate(ba, "readwebvn", null); return;}
ResumableSub_ReadWebVN rsub = new ResumableSub_ReadWebVN(this,__ref);
rsub.resume(ba, null);
}
public static class ResumableSub_ReadWebVN extends BA.ResumableSub {
public ResumableSub_ReadWebVN(reparto_mazapa.keymon.lat.cl_appupdate parent,reparto_mazapa.keymon.lat.cl_appupdate __ref) {
this.parent = parent;
this.__ref = __ref;
this.__ref = parent;
}
reparto_mazapa.keymon.lat.cl_appupdate __ref;
reparto_mazapa.keymon.lat.cl_appupdate parent;
boolean _okwebver = false;

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

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

case 0:
//C
this.state = -1;
RDebugUtils.currentLine=22413313;
 //BA.debugLineNum = 22413313;BA.debugLine="LogColor(\"---- AppUpdating.ReadWebVN\", LogColor1)";
parent.__c.LogImpl("922413313","---- AppUpdating.ReadWebVN",__ref._logcolor1 /*int*/ );
RDebugUtils.currentLine=22413314;
 //BA.debugLineNum = 22413314;BA.debugLine="Wait For(IsvalidWV) Complete (OkWebVer As Boolean";
parent.__c.WaitFor("complete", ba, new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "cl_appupdate", "readwebvn"), __ref._isvalidwv /*anywheresoftware.b4a.keywords.Common.ResumableSubWrapper*/ (null));
this.state = 1;
return;
case 1:
//C
this.state = -1;
_okwebver = (Boolean) result[1];
;
RDebugUtils.currentLine=22413315;
 //BA.debugLineNum = 22413315;BA.debugLine="Finito";
__ref._finito /*String*/ (null);
RDebugUtils.currentLine=22413316;
 //BA.debugLineNum = 22413316;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _setandstartsplashscreen(reparto_mazapa.keymon.lat.cl_appupdate __ref,anywheresoftware.b4a.objects.ActivityWrapper _callingact,anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper _bm) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "setandstartsplashscreen", true))
	 {return ((String) Debug.delegate(ba, "setandstartsplashscreen", new Object[] {_callingact,_bm}));}
anywheresoftware.b4a.objects.drawable.BitmapDrawable _bitimage = null;
RDebugUtils.currentLine=23658496;
 //BA.debugLineNum = 23658496;BA.debugLine="Public Sub SetAndStartSplashScreen(CallingAct As A";
RDebugUtils.currentLine=23658497;
 //BA.debugLineNum = 23658497;BA.debugLine="If BM.IsInitialized Then";
if (_bm.IsInitialized()) { 
RDebugUtils.currentLine=23658498;
 //BA.debugLineNum = 23658498;BA.debugLine="pnlSplash.Initialize(\"pnl1\")";
__ref._pnlsplash /*anywheresoftware.b4a.objects.PanelWrapper*/ .Initialize(ba,"pnl1");
RDebugUtils.currentLine=23658499;
 //BA.debugLineNum = 23658499;BA.debugLine="pnlSplash.Tag = \"splash\"";
__ref._pnlsplash /*anywheresoftware.b4a.objects.PanelWrapper*/ .setTag((Object)("splash"));
RDebugUtils.currentLine=23658500;
 //BA.debugLineNum = 23658500;BA.debugLine="Dim BitImage As BitmapDrawable";
_bitimage = new anywheresoftware.b4a.objects.drawable.BitmapDrawable();
RDebugUtils.currentLine=23658501;
 //BA.debugLineNum = 23658501;BA.debugLine="BitImage.Initialize(BM)";
_bitimage.Initialize((android.graphics.Bitmap)(_bm.getObject()));
RDebugUtils.currentLine=23658502;
 //BA.debugLineNum = 23658502;BA.debugLine="BitImage.Gravity = Gravity.FILL";
_bitimage.setGravity(__c.Gravity.FILL);
RDebugUtils.currentLine=23658503;
 //BA.debugLineNum = 23658503;BA.debugLine="CallingAct.AddView(pnlSplash, 0, 0, CallingAct.W";
_callingact.AddView((android.view.View)(__ref._pnlsplash /*anywheresoftware.b4a.objects.PanelWrapper*/ .getObject()),(int) (0),(int) (0),_callingact.getWidth(),_callingact.getHeight());
RDebugUtils.currentLine=23658504;
 //BA.debugLineNum = 23658504;BA.debugLine="pnlSplash.Background = BitImage";
__ref._pnlsplash /*anywheresoftware.b4a.objects.PanelWrapper*/ .setBackground((android.graphics.drawable.Drawable)(_bitimage.getObject()));
RDebugUtils.currentLine=23658505;
 //BA.debugLineNum = 23658505;BA.debugLine="pnlSplash.BringToFront";
__ref._pnlsplash /*anywheresoftware.b4a.objects.PanelWrapper*/ .BringToFront();
RDebugUtils.currentLine=23658506;
 //BA.debugLineNum = 23658506;BA.debugLine="SplashShowing = True";
__ref._splashshowing /*boolean*/  = __c.True;
 };
RDebugUtils.currentLine=23658508;
 //BA.debugLineNum = 23658508;BA.debugLine="End Sub";
return "";
}
public String  _setcredentials(reparto_mazapa.keymon.lat.cl_appupdate __ref,String _usern,String _userp) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "setcredentials", true))
	 {return ((String) Debug.delegate(ba, "setcredentials", new Object[] {_usern,_userp}));}
RDebugUtils.currentLine=21823488;
 //BA.debugLineNum = 21823488;BA.debugLine="Public Sub setCredentials(UserN As String, UserP A";
RDebugUtils.currentLine=21823489;
 //BA.debugLineNum = 21823489;BA.debugLine="sUserName = UserN";
__ref._susername /*String*/  = _usern;
RDebugUtils.currentLine=21823490;
 //BA.debugLineNum = 21823490;BA.debugLine="sUPassword = UserP";
__ref._supassword /*String*/  = _userp;
RDebugUtils.currentLine=21823491;
 //BA.debugLineNum = 21823491;BA.debugLine="End Sub";
return "";
}
public String  _setfileuriasintentdata(reparto_mazapa.keymon.lat.cl_appupdate __ref,anywheresoftware.b4a.objects.IntentWrapper _intent,String _filename) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "setfileuriasintentdata", true))
	 {return ((String) Debug.delegate(ba, "setfileuriasintentdata", new Object[] {_intent,_filename}));}
anywheresoftware.b4j.object.JavaObject _jo = null;
RDebugUtils.currentLine=23592960;
 //BA.debugLineNum = 23592960;BA.debugLine="Private Sub SetFileUriAsIntentData (Intent As Inte";
RDebugUtils.currentLine=23592961;
 //BA.debugLineNum = 23592961;BA.debugLine="Dim jo As JavaObject = Intent";
_jo = new anywheresoftware.b4j.object.JavaObject();
_jo = (anywheresoftware.b4j.object.JavaObject) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4j.object.JavaObject(), (java.lang.Object)(_intent.getObject()));
RDebugUtils.currentLine=23592962;
 //BA.debugLineNum = 23592962;BA.debugLine="jo.RunMethod(\"setData\", Array(GetFileUri(FileName";
_jo.RunMethod("setData",new Object[]{__ref._getfileuri /*Object*/ (null,_filename)});
RDebugUtils.currentLine=23592963;
 //BA.debugLineNum = 23592963;BA.debugLine="Intent.Flags = Bit.Or(Intent.Flags, 1) 'FLAG_GRAN";
_intent.setFlags(__c.Bit.Or(_intent.getFlags(),(int) (1)));
RDebugUtils.currentLine=23592964;
 //BA.debugLineNum = 23592964;BA.debugLine="End Sub";
return "";
}
public String  _setnewverapk(reparto_mazapa.keymon.lat.cl_appupdate __ref,String _nva) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "setnewverapk", true))
	 {return ((String) Debug.delegate(ba, "setnewverapk", new Object[] {_nva}));}
RDebugUtils.currentLine=21757952;
 //BA.debugLineNum = 21757952;BA.debugLine="Public Sub setNewVerApk(NVA As String)";
RDebugUtils.currentLine=21757953;
 //BA.debugLineNum = 21757953;BA.debugLine="sNewVerApk = NVA";
__ref._snewverapk /*String*/  = _nva;
RDebugUtils.currentLine=21757954;
 //BA.debugLineNum = 21757954;BA.debugLine="End Sub";
return "";
}
public String  _setnewvertxt(reparto_mazapa.keymon.lat.cl_appupdate __ref,String _nvt) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "setnewvertxt", true))
	 {return ((String) Debug.delegate(ba, "setnewvertxt", new Object[] {_nvt}));}
RDebugUtils.currentLine=21692416;
 //BA.debugLineNum = 21692416;BA.debugLine="Public Sub setNewVerTxt(NVT As String)";
RDebugUtils.currentLine=21692417;
 //BA.debugLineNum = 21692417;BA.debugLine="sNewVerTxt = NVT";
__ref._snewvertxt /*String*/  = _nvt;
RDebugUtils.currentLine=21692418;
 //BA.debugLineNum = 21692418;BA.debugLine="End Sub";
return "";
}
public String  _setpackagename(reparto_mazapa.keymon.lat.cl_appupdate __ref,String _pn) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "setpackagename", true))
	 {return ((String) Debug.delegate(ba, "setpackagename", new Object[] {_pn}));}
RDebugUtils.currentLine=21561344;
 //BA.debugLineNum = 21561344;BA.debugLine="Public Sub setPackageName(PN As String)";
RDebugUtils.currentLine=21561345;
 //BA.debugLineNum = 21561345;BA.debugLine="sPackageName = PN";
__ref._spackagename /*String*/  = _pn;
RDebugUtils.currentLine=21561346;
 //BA.debugLineNum = 21561346;BA.debugLine="End Sub";
return "";
}
public String  _setverbose(reparto_mazapa.keymon.lat.cl_appupdate __ref,boolean _verbose) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "setverbose", true))
	 {return ((String) Debug.delegate(ba, "setverbose", new Object[] {_verbose}));}
RDebugUtils.currentLine=21889024;
 //BA.debugLineNum = 21889024;BA.debugLine="Public Sub setVerbose(Verbose As Boolean)";
RDebugUtils.currentLine=21889025;
 //BA.debugLineNum = 21889025;BA.debugLine="sVerbose = Verbose";
__ref._sverbose /*boolean*/  = _verbose;
RDebugUtils.currentLine=21889026;
 //BA.debugLineNum = 21889026;BA.debugLine="newinst2.svcVerbose = Verbose";
_newinst2._svcverbose /*boolean*/  = _verbose;
RDebugUtils.currentLine=21889027;
 //BA.debugLineNum = 21889027;BA.debugLine="End Sub";
return "";
}
public String  _stopsplashscreen(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "stopsplashscreen", true))
	 {return ((String) Debug.delegate(ba, "stopsplashscreen", null));}
RDebugUtils.currentLine=23724032;
 //BA.debugLineNum = 23724032;BA.debugLine="Public Sub StopSplashScreen";
RDebugUtils.currentLine=23724033;
 //BA.debugLineNum = 23724033;BA.debugLine="If SplashShowing Then";
if (__ref._splashshowing /*boolean*/ ) { 
RDebugUtils.currentLine=23724034;
 //BA.debugLineNum = 23724034;BA.debugLine="SplashShowing = False";
__ref._splashshowing /*boolean*/  = __c.False;
RDebugUtils.currentLine=23724035;
 //BA.debugLineNum = 23724035;BA.debugLine="pnlSplash.RemoveView";
__ref._pnlsplash /*anywheresoftware.b4a.objects.PanelWrapper*/ .RemoveView();
 };
RDebugUtils.currentLine=23724037;
 //BA.debugLineNum = 23724037;BA.debugLine="End Sub";
return "";
}
public void  _tryapkupdate(reparto_mazapa.keymon.lat.cl_appupdate __ref) throws Exception{
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "tryapkupdate", true))
	 {Debug.delegate(ba, "tryapkupdate", null); return;}
ResumableSub_TryApkUpdate rsub = new ResumableSub_TryApkUpdate(this,__ref);
rsub.resume(ba, null);
}
public static class ResumableSub_TryApkUpdate extends BA.ResumableSub {
public ResumableSub_TryApkUpdate(reparto_mazapa.keymon.lat.cl_appupdate parent,reparto_mazapa.keymon.lat.cl_appupdate __ref) {
this.parent = parent;
this.__ref = __ref;
this.__ref = parent;
}
reparto_mazapa.keymon.lat.cl_appupdate __ref;
reparto_mazapa.keymon.lat.cl_appupdate parent;
reparto_mazapa.keymon.lat.httpjob _j = null;
anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper _out = null;

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

    while (true) {
try {

        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
RDebugUtils.currentLine=22675457;
 //BA.debugLineNum = 22675457;BA.debugLine="LogColor($\"${TAB}-- TryApkUpdate\"$, LogColor1)";
parent.__c.LogImpl("922675457",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"-- TryApkUpdate"),__ref._logcolor1 /*int*/ );
RDebugUtils.currentLine=22675459;
 //BA.debugLineNum = 22675459;BA.debugLine="If ((sStatusCode >= 0) And (sStatusCode <> NO_NEW";
if (true) break;

case 1:
//if
this.state = 44;
if (((__ref._sstatuscode /*int*/ >=0) && (__ref._sstatuscode /*int*/ !=__ref._no_newerapk /*int*/ ))) { 
this.state = 3;
}if (true) break;

case 3:
//C
this.state = 4;
RDebugUtils.currentLine=22675461;
 //BA.debugLineNum = 22675461;BA.debugLine="Dim j As HttpJob";
_j = new reparto_mazapa.keymon.lat.httpjob();
RDebugUtils.currentLine=22675462;
 //BA.debugLineNum = 22675462;BA.debugLine="j.Initialize(\"\", Me)";
_j._initialize /*String*/ (null,ba,"",parent);
RDebugUtils.currentLine=22675463;
 //BA.debugLineNum = 22675463;BA.debugLine="j.Username = sUserName";
_j._username /*String*/  = __ref._susername /*String*/ ;
RDebugUtils.currentLine=22675464;
 //BA.debugLineNum = 22675464;BA.debugLine="j.Password = sUPassword";
_j._password /*String*/  = __ref._supassword /*String*/ ;
RDebugUtils.currentLine=22675465;
 //BA.debugLineNum = 22675465;BA.debugLine="j.Download(sNewVerApk)								'ex: jobapk.Downlo";
_j._download /*String*/ (null,__ref._snewverapk /*String*/ );
RDebugUtils.currentLine=22675466;
 //BA.debugLineNum = 22675466;BA.debugLine="Wait For (j) JobDone(j As HttpJob)";
parent.__c.WaitFor("jobdone", ba, new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "cl_appupdate", "tryapkupdate"), (Object)(_j));
this.state = 45;
return;
case 45:
//C
this.state = 4;
_j = (reparto_mazapa.keymon.lat.httpjob) result[1];
;
RDebugUtils.currentLine=22675467;
 //BA.debugLineNum = 22675467;BA.debugLine="Log($\"Donload ok? ${j.Success}\"$)";
parent.__c.LogImpl("922675467",("Donload ok? "+parent.__c.SmartStringFormatter("",(Object)(_j._success /*boolean*/ ))+""),0);
RDebugUtils.currentLine=22675468;
 //BA.debugLineNum = 22675468;BA.debugLine="If j.Success Then";
if (true) break;

case 4:
//if
this.state = 33;
if (_j._success /*boolean*/ ) { 
this.state = 6;
}else {
this.state = 26;
}if (true) break;

case 6:
//C
this.state = 7;
RDebugUtils.currentLine=22675469;
 //BA.debugLineNum = 22675469;BA.debugLine="Try";
if (true) break;

case 7:
//try
this.state = 24;
this.catchState = 17;
this.state = 9;
if (true) break;

case 9:
//C
this.state = 10;
this.catchState = 17;
RDebugUtils.currentLine=22675471;
 //BA.debugLineNum = 22675471;BA.debugLine="Dim out As OutputStream";
_out = new anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper();
RDebugUtils.currentLine=22675472;
 //BA.debugLineNum = 22675472;BA.debugLine="out = File.OpenOutput(SharedFolder,\"tmp.apk\",F";
_out = parent.__c.File.OpenOutput(__ref._sharedfolder /*String*/ ,"tmp.apk",parent.__c.False);
RDebugUtils.currentLine=22675473;
 //BA.debugLineNum = 22675473;BA.debugLine="File.Copy2(j.GetInputStream, out)";
parent.__c.File.Copy2((java.io.InputStream)(_j._getinputstream /*anywheresoftware.b4a.objects.streams.File.InputStreamWrapper*/ (null).getObject()),(java.io.OutputStream)(_out.getObject()));
RDebugUtils.currentLine=22675474;
 //BA.debugLineNum = 22675474;BA.debugLine="out.Close";
_out.Close();
RDebugUtils.currentLine=22675475;
 //BA.debugLineNum = 22675475;BA.debugLine="Log($\"Copy2 (saving) ok? TRUE\"$)";
parent.__c.LogImpl("922675475",("Copy2 (saving) ok? TRUE"),0);
RDebugUtils.currentLine=22675476;
 //BA.debugLineNum = 22675476;BA.debugLine="sStatusCode = OK_DOWNLOAD";
__ref._sstatuscode /*int*/  = __ref._ok_download /*int*/ ;
RDebugUtils.currentLine=22675477;
 //BA.debugLineNum = 22675477;BA.debugLine="If sVerbose Then Log($\"${TAB}new apk version d";
if (true) break;

case 10:
//if
this.state = 15;
if (__ref._sverbose /*boolean*/ ) { 
this.state = 12;
;}if (true) break;

case 12:
//C
this.state = 15;
parent.__c.LogImpl("922675477",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"new apk version downloaded and ready to install"),0);
if (true) break;

case 15:
//C
this.state = 24;
;
 if (true) break;

case 17:
//C
this.state = 18;
this.catchState = 0;
RDebugUtils.currentLine=22675479;
 //BA.debugLineNum = 22675479;BA.debugLine="Log($\"Copy2 (saving) ok? FALSE\"$)";
parent.__c.LogImpl("922675479",("Copy2 (saving) ok? FALSE"),0);
RDebugUtils.currentLine=22675480;
 //BA.debugLineNum = 22675480;BA.debugLine="sStatusCode = ERR_DOWNLOAD";
__ref._sstatuscode /*int*/  = __ref._err_download /*int*/ ;
RDebugUtils.currentLine=22675481;
 //BA.debugLineNum = 22675481;BA.debugLine="If sVerbose Then Log($\"${TAB}failed download o";
if (true) break;

case 18:
//if
this.state = 23;
if (__ref._sverbose /*boolean*/ ) { 
this.state = 20;
;}if (true) break;

case 20:
//C
this.state = 23;
parent.__c.LogImpl("922675481",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"failed download of new apk version"),0);
if (true) break;

case 23:
//C
this.state = 24;
;
RDebugUtils.currentLine=22675482;
 //BA.debugLineNum = 22675482;BA.debugLine="ToastMessageShow(LastException, True)";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence(parent.__c.LastException(ba).getObject()),parent.__c.True);
 if (true) break;
if (true) break;

case 24:
//C
this.state = 33;
this.catchState = 0;
;
 if (true) break;

case 26:
//C
this.state = 27;
RDebugUtils.currentLine=22675485;
 //BA.debugLineNum = 22675485;BA.debugLine="Log($\"${TAB}Error: ${J.ErrorMessage}\"$)";
parent.__c.LogImpl("922675485",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"Error: "+parent.__c.SmartStringFormatter("",(Object)(_j._errormessage /*String*/ ))+""),0);
RDebugUtils.currentLine=22675486;
 //BA.debugLineNum = 22675486;BA.debugLine="sStatusCode = ERR_HTTP";
__ref._sstatuscode /*int*/  = __ref._err_http /*int*/ ;
RDebugUtils.currentLine=22675487;
 //BA.debugLineNum = 22675487;BA.debugLine="If sVerbose Then Log($\"${TAB}error in httputils";
if (true) break;

case 27:
//if
this.state = 32;
if (__ref._sverbose /*boolean*/ ) { 
this.state = 29;
;}if (true) break;

case 29:
//C
this.state = 32;
parent.__c.LogImpl("922675487",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"error in httputils2"),0);
if (true) break;

case 32:
//C
this.state = 33;
;
RDebugUtils.currentLine=22675488;
 //BA.debugLineNum = 22675488;BA.debugLine="ToastMessageShow($\"Error: ${J.ErrorMessage}\"$,";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence(("Error: "+parent.__c.SmartStringFormatter("",(Object)(_j._errormessage /*String*/ ))+"")),parent.__c.True);
 if (true) break;

case 33:
//C
this.state = 34;
;
RDebugUtils.currentLine=22675490;
 //BA.debugLineNum = 22675490;BA.debugLine="j.Release";
_j._release /*String*/ (null);
RDebugUtils.currentLine=22675491;
 //BA.debugLineNum = 22675491;BA.debugLine="If sStatusCode == OK_DOWNLOAD Then";
if (true) break;

case 34:
//if
this.state = 43;
if (__ref._sstatuscode /*int*/ ==__ref._ok_download /*int*/ ) { 
this.state = 36;
}if (true) break;

case 36:
//C
this.state = 37;
RDebugUtils.currentLine=22675492;
 //BA.debugLineNum = 22675492;BA.debugLine="SendInstallIntent";
__ref._sendinstallintent /*String*/ (null);
RDebugUtils.currentLine=22675493;
 //BA.debugLineNum = 22675493;BA.debugLine="sStatusCode = OK_INSTALL";
__ref._sstatuscode /*int*/  = __ref._ok_install /*int*/ ;
RDebugUtils.currentLine=22675494;
 //BA.debugLineNum = 22675494;BA.debugLine="If sVerbose Then Log($\"${TAB}user asked to inst";
if (true) break;

case 37:
//if
this.state = 42;
if (__ref._sverbose /*boolean*/ ) { 
this.state = 39;
;}if (true) break;

case 39:
//C
this.state = 42;
parent.__c.LogImpl("922675494",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"user asked to install new apk"),0);
if (true) break;

case 42:
//C
this.state = 43;
;
 if (true) break;

case 43:
//C
this.state = 44;
;
 if (true) break;

case 44:
//C
this.state = -1;
;
RDebugUtils.currentLine=22675497;
 //BA.debugLineNum = 22675497;BA.debugLine="Finito";
__ref._finito /*String*/ (null);
RDebugUtils.currentLine=22675498;
 //BA.debugLineNum = 22675498;BA.debugLine="End Sub";
if (true) break;
}} 
       catch (Exception e0) {
			
if (catchState == 0)
    throw e0;
else {
    state = catchState;
ba.setLastException(e0);}
            }
        }
    }
}
public void  _updateapk(reparto_mazapa.keymon.lat.cl_appupdate __ref,boolean _pstatus) throws Exception{
RDebugUtils.currentModule="cl_appupdate";
if (Debug.shouldDelegate(ba, "updateapk", true))
	 {Debug.delegate(ba, "updateapk", new Object[] {_pstatus}); return;}
ResumableSub_UpdateApk rsub = new ResumableSub_UpdateApk(this,__ref,_pstatus);
rsub.resume(ba, null);
}
public static class ResumableSub_UpdateApk extends BA.ResumableSub {
public ResumableSub_UpdateApk(reparto_mazapa.keymon.lat.cl_appupdate parent,reparto_mazapa.keymon.lat.cl_appupdate __ref,boolean _pstatus) {
this.parent = parent;
this.__ref = __ref;
this._pstatus = _pstatus;
this.__ref = parent;
}
reparto_mazapa.keymon.lat.cl_appupdate __ref;
reparto_mazapa.keymon.lat.cl_appupdate parent;
boolean _pstatus;
boolean _okwebver = false;
long _fsize = 0L;

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

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

case 0:
//C
this.state = 1;
RDebugUtils.currentLine=22609921;
 //BA.debugLineNum = 22609921;BA.debugLine="LogColor(\"---- AppUpdating.UpdateApk\", LogColor1)";
parent.__c.LogImpl("922609921","---- AppUpdating.UpdateApk",__ref._logcolor1 /*int*/ );
RDebugUtils.currentLine=22609922;
 //BA.debugLineNum = 22609922;BA.debugLine="If Not(pstatus) Then";
if (true) break;

case 1:
//if
this.state = 61;
if (parent.__c.Not(_pstatus)) { 
this.state = 3;
}else {
this.state = 11;
}if (true) break;

case 3:
//C
this.state = 4;
RDebugUtils.currentLine=22609923;
 //BA.debugLineNum = 22609923;BA.debugLine="sStatusCode = ERR_NOPERM";
__ref._sstatuscode /*int*/  = __ref._err_noperm /*int*/ ;
RDebugUtils.currentLine=22609924;
 //BA.debugLineNum = 22609924;BA.debugLine="If sVerbose Then Log(TAB & \"no permissions from";
if (true) break;

case 4:
//if
this.state = 9;
if (__ref._sverbose /*boolean*/ ) { 
this.state = 6;
;}if (true) break;

case 6:
//C
this.state = 9;
parent.__c.LogImpl("922609924",parent.__c.TAB+"no permissions from user to install new apk",0);
if (true) break;

case 9:
//C
this.state = 61;
;
 if (true) break;

case 11:
//C
this.state = 12;
RDebugUtils.currentLine=22609926;
 //BA.debugLineNum = 22609926;BA.debugLine="Wait For(IsvalidWV) Complete (OkWebVer As Boolea";
parent.__c.WaitFor("complete", ba, new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "cl_appupdate", "updateapk"), __ref._isvalidwv /*anywheresoftware.b4a.keywords.Common.ResumableSubWrapper*/ (null));
this.state = 62;
return;
case 62:
//C
this.state = 12;
_okwebver = (Boolean) result[1];
;
RDebugUtils.currentLine=22609927;
 //BA.debugLineNum = 22609927;BA.debugLine="If (IsValidCV And OkWebVer) Then							'here we";
if (true) break;

case 12:
//if
this.state = 60;
if ((__ref._isvalidcv /*boolean*/ (null) && _okwebver)) { 
this.state = 14;
}if (true) break;

case 14:
//C
this.state = 15;
RDebugUtils.currentLine=22609928;
 //BA.debugLineNum = 22609928;BA.debugLine="If curver < webver Then";
if (true) break;

case 15:
//if
this.state = 59;
if ((double)(Double.parseDouble(__ref._curver /*String*/ ))<(double)(Double.parseDouble(__ref._webver /*String*/ ))) { 
this.state = 17;
}else {
this.state = 52;
}if (true) break;

case 17:
//C
this.state = 18;
RDebugUtils.currentLine=22609930;
 //BA.debugLineNum = 22609930;BA.debugLine="If IsNumber(webfsize) Then";
if (true) break;

case 18:
//if
this.state = 31;
if (parent.__c.IsNumber(__ref._webfsize /*String*/ )) { 
this.state = 20;
}if (true) break;

case 20:
//C
this.state = 21;
RDebugUtils.currentLine=22609931;
 //BA.debugLineNum = 22609931;BA.debugLine="Dim fsize As Long = webfsize";
_fsize = (long)(Double.parseDouble(__ref._webfsize /*String*/ ));
RDebugUtils.currentLine=22609932;
 //BA.debugLineNum = 22609932;BA.debugLine="If fsize*2 > GetFreeSpace Then";
if (true) break;

case 21:
//if
this.state = 30;
if (_fsize*2>__ref._getfreespace /*long*/ (null)) { 
this.state = 23;
}if (true) break;

case 23:
//C
this.state = 24;
RDebugUtils.currentLine=22609933;
 //BA.debugLineNum = 22609933;BA.debugLine="sStatusCode = ERR_NOSPACE";
__ref._sstatuscode /*int*/  = __ref._err_nospace /*int*/ ;
RDebugUtils.currentLine=22609934;
 //BA.debugLineNum = 22609934;BA.debugLine="If sVerbose Then Log($\"${TAB}no enough avail";
if (true) break;

case 24:
//if
this.state = 29;
if (__ref._sverbose /*boolean*/ ) { 
this.state = 26;
;}if (true) break;

case 26:
//C
this.state = 29;
parent.__c.LogImpl("922609934",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"no enough available space to download apk"),0);
if (true) break;

case 29:
//C
this.state = 30;
;
 if (true) break;

case 30:
//C
this.state = 31;
;
 if (true) break;
;
RDebugUtils.currentLine=22609937;
 //BA.debugLineNum = 22609937;BA.debugLine="If sStatusCode >= 0 Then";

case 31:
//if
this.state = 50;
if (__ref._sstatuscode /*int*/ >=0) { 
this.state = 33;
}if (true) break;

case 33:
//C
this.state = 34;
RDebugUtils.currentLine=22609938;
 //BA.debugLineNum = 22609938;BA.debugLine="sStatusCode = OK_NEWERAPK			'info file tells";
__ref._sstatuscode /*int*/  = __ref._ok_newerapk /*int*/ ;
RDebugUtils.currentLine=22609939;
 //BA.debugLineNum = 22609939;BA.debugLine="If sVerbose Then Log($\"${TAB}Newer version av";
if (true) break;

case 34:
//if
this.state = 39;
if (__ref._sverbose /*boolean*/ ) { 
this.state = 36;
;}if (true) break;

case 36:
//C
this.state = 39;
parent.__c.LogImpl("922609939",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"Newer version available. Now I try its downloading"),0);
if (true) break;

case 39:
//C
this.state = 40;
;
RDebugUtils.currentLine=22609940;
 //BA.debugLineNum = 22609940;BA.debugLine="If sNewVerApk = \"\" Then";
if (true) break;

case 40:
//if
this.state = 49;
if ((__ref._snewverapk /*String*/ ).equals("")) { 
this.state = 42;
}if (true) break;

case 42:
//C
this.state = 43;
RDebugUtils.currentLine=22609941;
 //BA.debugLineNum = 22609941;BA.debugLine="sStatusCode = ERR_NOAPK";
__ref._sstatuscode /*int*/  = __ref._err_noapk /*int*/ ;
RDebugUtils.currentLine=22609942;
 //BA.debugLineNum = 22609942;BA.debugLine="If sVerbose Then Log($\"${TAB}missing apk fil";
if (true) break;

case 43:
//if
this.state = 48;
if (__ref._sverbose /*boolean*/ ) { 
this.state = 45;
;}if (true) break;

case 45:
//C
this.state = 48;
parent.__c.LogImpl("922609942",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"missing apk file full path indication"),0);
if (true) break;

case 48:
//C
this.state = 49;
;
 if (true) break;

case 49:
//C
this.state = 50;
;
 if (true) break;

case 50:
//C
this.state = 59;
;
 if (true) break;

case 52:
//C
this.state = 53;
RDebugUtils.currentLine=22609946;
 //BA.debugLineNum = 22609946;BA.debugLine="sStatusCode = NO_NEWERAPK";
__ref._sstatuscode /*int*/  = __ref._no_newerapk /*int*/ ;
RDebugUtils.currentLine=22609947;
 //BA.debugLineNum = 22609947;BA.debugLine="If sVerbose Then Log($\"${TAB}No newer version";
if (true) break;

case 53:
//if
this.state = 58;
if (__ref._sverbose /*boolean*/ ) { 
this.state = 55;
;}if (true) break;

case 55:
//C
this.state = 58;
parent.__c.LogImpl("922609947",(""+parent.__c.SmartStringFormatter("",(Object)(parent.__c.TAB))+"No newer version available on webserver."),0);
if (true) break;

case 58:
//C
this.state = 59;
;
 if (true) break;

case 59:
//C
this.state = 60;
;
 if (true) break;

case 60:
//C
this.state = 61;
;
 if (true) break;

case 61:
//C
this.state = -1;
;
RDebugUtils.currentLine=22609951;
 //BA.debugLineNum = 22609951;BA.debugLine="TryApkUpdate						'if available and permitted, do";
__ref._tryapkupdate /*void*/ (null);
RDebugUtils.currentLine=22609952;
 //BA.debugLineNum = 22609952;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
}