package SHARK2.keymon.com.mx;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.pc.*;

public class filehandler_subs_0 {


public static RemoteObject  _checkforreceivedfiles(RemoteObject __ref) throws Exception{
try {
		Debug.PushSubsStack("CheckForReceivedFiles (filehandler) ","filehandler",23,__ref.getField(false, "ba"),__ref,96);
if (RapidSub.canDelegate("checkforreceivedfiles")) { return __ref.runUserSub(false, "filehandler","checkforreceivedfiles", __ref);}
RemoteObject _activity = RemoteObject.declareNull("anywheresoftware.b4a.objects.ActivityWrapper");
RemoteObject _in = RemoteObject.declareNull("anywheresoftware.b4a.objects.IntentWrapper");
RemoteObject _uri = RemoteObject.createImmutable("");
RemoteObject _res = RemoteObject.declareNull("SHARK2.keymon.com.mx.filehandler._loadresult");
 BA.debugLineNum = 96;BA.debugLine="Public Sub CheckForReceivedFiles As LoadResult";
Debug.ShouldStop(-2147483648);
 BA.debugLineNum = 97;BA.debugLine="Dim Activity As Activity = B4XPages.GetNativePare";
Debug.ShouldStop(1);
_activity = RemoteObject.createNew ("anywheresoftware.b4a.objects.ActivityWrapper");
_activity = filehandler._b4xpages.runMethod(false,"_getnativeparent" /*RemoteObject*/ ,__ref.runMethod(false,"getActivityBA"),(Object)((filehandler._b4xpages.runMethod(false,"_mainpage" /*RemoteObject*/ ,__ref.runMethod(false,"getActivityBA")))));Debug.locals.put("Activity", _activity);Debug.locals.put("Activity", _activity);
 BA.debugLineNum = 98;BA.debugLine="If IsRelevantIntent(Activity.GetStartingIntent) T";
Debug.ShouldStop(2);
if (__ref.runClassMethod (SHARK2.keymon.com.mx.filehandler.class, "_isrelevantintent" /*RemoteObject*/ ,(Object)(_activity.runMethod(false,"GetStartingIntent"))).<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 99;BA.debugLine="Dim in As Intent = Activity.GetStartingIntent";
Debug.ShouldStop(4);
_in = RemoteObject.createNew ("anywheresoftware.b4a.objects.IntentWrapper");
_in = _activity.runMethod(false,"GetStartingIntent");Debug.locals.put("in", _in);Debug.locals.put("in", _in);
 BA.debugLineNum = 100;BA.debugLine="Dim uri As String";
Debug.ShouldStop(8);
_uri = RemoteObject.createImmutable("");Debug.locals.put("uri", _uri);
 BA.debugLineNum = 101;BA.debugLine="If in.HasExtra(\"android.intent.extra.STREAM\") Th";
Debug.ShouldStop(16);
if (_in.runMethod(true,"HasExtra",(Object)(RemoteObject.createImmutable("android.intent.extra.STREAM"))).<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 102;BA.debugLine="uri = in.As(JavaObject).RunMethod(\"getParcelabl";
Debug.ShouldStop(32);
_uri = BA.ObjectToString((RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4j.object.JavaObject"), _in.getObject())).runMethod(false,"RunMethod",(Object)(BA.ObjectToString("getParcelableExtra")),(Object)(RemoteObject.createNewArray("Object",new int[] {1},new Object[] {(RemoteObject.createImmutable("android.intent.extra.STREAM"))}))));Debug.locals.put("uri", _uri);
 }else {
 BA.debugLineNum = 104;BA.debugLine="uri = in.GetData";
Debug.ShouldStop(128);
_uri = _in.runMethod(true,"GetData");Debug.locals.put("uri", _uri);
 };
 BA.debugLineNum = 106;BA.debugLine="Dim res As LoadResult = CreateLoadResult(True, \"";
Debug.ShouldStop(512);
_res = __ref.runClassMethod (SHARK2.keymon.com.mx.filehandler.class, "_createloadresult" /*RemoteObject*/ ,(Object)(filehandler.__c.getField(true,"True")),(Object)(BA.ObjectToString("ContentDir")),(Object)(_uri));Debug.locals.put("res", _res);Debug.locals.put("res", _res);
 BA.debugLineNum = 107;BA.debugLine="ExtractInformationFromURI(res.FileName, res)";
Debug.ShouldStop(1024);
__ref.runClassMethod (SHARK2.keymon.com.mx.filehandler.class, "_extractinformationfromuri" /*RemoteObject*/ ,(Object)(_res.getField(true,"FileName" /*RemoteObject*/ )),(Object)(_res));
 BA.debugLineNum = 108;BA.debugLine="Return res";
Debug.ShouldStop(2048);
if (true) return _res;
 };
 BA.debugLineNum = 110;BA.debugLine="Return CreateLoadResult(False, \"\", \"\")";
Debug.ShouldStop(8192);
if (true) return __ref.runClassMethod (SHARK2.keymon.com.mx.filehandler.class, "_createloadresult" /*RemoteObject*/ ,(Object)(filehandler.__c.getField(true,"False")),(Object)(BA.ObjectToString("")),(Object)(RemoteObject.createImmutable("")));
 BA.debugLineNum = 111;BA.debugLine="End Sub";
Debug.ShouldStop(16384);
return RemoteObject.createImmutable(null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _class_globals(RemoteObject __ref) throws Exception{
 //BA.debugLineNum = 14;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 16;BA.debugLine="Private ion As Object";
filehandler._ion = RemoteObject.createNew ("Object");__ref.setField("_ion",filehandler._ion);
 //BA.debugLineNum = 17;BA.debugLine="Private OldIntent As Intent";
filehandler._oldintent = RemoteObject.createNew ("anywheresoftware.b4a.objects.IntentWrapper");__ref.setField("_oldintent",filehandler._oldintent);
 //BA.debugLineNum = 19;BA.debugLine="Type LoadResult (Success As Boolean, Dir As Strin";
;
 //BA.debugLineNum = 21;BA.debugLine="End Sub";
return RemoteObject.createImmutable("");
}
public static RemoteObject  _createloadresult(RemoteObject __ref,RemoteObject _success,RemoteObject _dir,RemoteObject _filename) throws Exception{
try {
		Debug.PushSubsStack("CreateLoadResult (filehandler) ","filehandler",23,__ref.getField(false, "ba"),__ref,149);
if (RapidSub.canDelegate("createloadresult")) { return __ref.runUserSub(false, "filehandler","createloadresult", __ref, _success, _dir, _filename);}
RemoteObject _t1 = RemoteObject.declareNull("SHARK2.keymon.com.mx.filehandler._loadresult");
Debug.locals.put("Success", _success);
Debug.locals.put("Dir", _dir);
Debug.locals.put("FileName", _filename);
 BA.debugLineNum = 149;BA.debugLine="Private Sub CreateLoadResult (Success As Boolean,";
Debug.ShouldStop(1048576);
 BA.debugLineNum = 150;BA.debugLine="Dim t1 As LoadResult";
Debug.ShouldStop(2097152);
_t1 = RemoteObject.createNew ("SHARK2.keymon.com.mx.filehandler._loadresult");Debug.locals.put("t1", _t1);
 BA.debugLineNum = 151;BA.debugLine="t1.Initialize";
Debug.ShouldStop(4194304);
_t1.runVoidMethod ("Initialize");
 BA.debugLineNum = 152;BA.debugLine="t1.Success = Success";
Debug.ShouldStop(8388608);
_t1.setField ("Success" /*RemoteObject*/ ,_success);
 BA.debugLineNum = 153;BA.debugLine="t1.Dir = Dir";
Debug.ShouldStop(16777216);
_t1.setField ("Dir" /*RemoteObject*/ ,_dir);
 BA.debugLineNum = 154;BA.debugLine="t1.FileName = FileName";
Debug.ShouldStop(33554432);
_t1.setField ("FileName" /*RemoteObject*/ ,_filename);
 BA.debugLineNum = 155;BA.debugLine="Return t1";
Debug.ShouldStop(67108864);
if (true) return _t1;
 BA.debugLineNum = 156;BA.debugLine="End Sub";
Debug.ShouldStop(134217728);
return RemoteObject.createImmutable(null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _extractinformationfromuri(RemoteObject __ref,RemoteObject _uri,RemoteObject _res) throws Exception{
try {
		Debug.PushSubsStack("ExtractInformationFromURI (filehandler) ","filehandler",23,__ref.getField(false, "ba"),__ref,70);
if (RapidSub.canDelegate("extractinformationfromuri")) { return __ref.runUserSub(false, "filehandler","extractinformationfromuri", __ref, _uri, _res);}
RemoteObject _resolver = RemoteObject.declareNull("anywheresoftware.b4a.objects.ContentResolverWrapper");
RemoteObject _u = RemoteObject.declareNull("anywheresoftware.b4a.objects.ContentResolverWrapper.UriWrapper");
RemoteObject _rs = RemoteObject.declareNull("anywheresoftware.b4a.sql.SQL.ResultSetWrapper");
RemoteObject _columns = RemoteObject.declareNull("SHARK2.keymon.com.mx.b4xset");
int _i = 0;
Debug.locals.put("Uri", _uri);
Debug.locals.put("res", _res);
 BA.debugLineNum = 70;BA.debugLine="Private Sub ExtractInformationFromURI (Uri As Stri";
Debug.ShouldStop(32);
 BA.debugLineNum = 71;BA.debugLine="Try";
Debug.ShouldStop(64);
try { BA.debugLineNum = 73;BA.debugLine="Dim resolver As ContentResolver";
Debug.ShouldStop(256);
_resolver = RemoteObject.createNew ("anywheresoftware.b4a.objects.ContentResolverWrapper");Debug.locals.put("resolver", _resolver);
 BA.debugLineNum = 74;BA.debugLine="resolver.Initialize(\"\")";
Debug.ShouldStop(512);
_resolver.runVoidMethod ("Initialize",(Object)(RemoteObject.createImmutable("")));
 BA.debugLineNum = 75;BA.debugLine="Dim u As Uri";
Debug.ShouldStop(1024);
_u = RemoteObject.createNew ("anywheresoftware.b4a.objects.ContentResolverWrapper.UriWrapper");Debug.locals.put("u", _u);
 BA.debugLineNum = 76;BA.debugLine="u.Parse(Uri)";
Debug.ShouldStop(2048);
_u.runVoidMethod ("Parse",(Object)(_uri));
 BA.debugLineNum = 77;BA.debugLine="Dim rs As ResultSet = resolver.Query(u, Null, \"\",";
Debug.ShouldStop(4096);
_rs = RemoteObject.createNew ("anywheresoftware.b4a.sql.SQL.ResultSetWrapper");
_rs = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.sql.SQL.ResultSetWrapper"), _resolver.runMethod(false,"Query",(Object)(_u),(Object)((filehandler.__c.getField(false,"Null"))),(Object)(BA.ObjectToString("")),(Object)((filehandler.__c.getField(false,"Null"))),(Object)(RemoteObject.createImmutable(""))).getObject());Debug.locals.put("rs", _rs);Debug.locals.put("rs", _rs);
 BA.debugLineNum = 78;BA.debugLine="If rs.NextRow Then";
Debug.ShouldStop(8192);
if (_rs.runMethod(true,"NextRow").<Boolean>get().booleanValue()) { 
 BA.debugLineNum = 79;BA.debugLine="Dim columns As B4XSet = B4XCollections.CreateSet";
Debug.ShouldStop(16384);
_columns = filehandler._b4xcollections.runMethod(false,"_createset" /*RemoteObject*/ ,__ref.runMethod(false,"getActivityBA"));Debug.locals.put("columns", _columns);Debug.locals.put("columns", _columns);
 BA.debugLineNum = 80;BA.debugLine="For i = 0 To rs.ColumnCount - 1";
Debug.ShouldStop(32768);
{
final int step9 = 1;
final int limit9 = RemoteObject.solve(new RemoteObject[] {_rs.runMethod(true,"getColumnCount"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
_i = 0 ;
for (;(step9 > 0 && _i <= limit9) || (step9 < 0 && _i >= limit9) ;_i = ((int)(0 + _i + step9))  ) {
Debug.locals.put("i", _i);
 BA.debugLineNum = 81;BA.debugLine="columns.Add(rs.GetColumnName(i))";
Debug.ShouldStop(65536);
_columns.runClassMethod (SHARK2.keymon.com.mx.b4xset.class, "_add" /*RemoteObject*/ ,(Object)((_rs.runMethod(true,"GetColumnName",(Object)(BA.numberCast(int.class, _i))))));
 }
}Debug.locals.put("i", _i);
;
 BA.debugLineNum = 83;BA.debugLine="If columns.Contains(\"_display_name\") Then res.Re";
Debug.ShouldStop(262144);
if (_columns.runClassMethod (SHARK2.keymon.com.mx.b4xset.class, "_contains" /*RemoteObject*/ ,(Object)((RemoteObject.createImmutable("_display_name")))).<Boolean>get().booleanValue()) { 
_res.setField ("RealName" /*RemoteObject*/ ,_rs.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("_display_name"))));};
 BA.debugLineNum = 84;BA.debugLine="If columns.Contains(\"_size\") Then res.Size = rs.";
Debug.ShouldStop(524288);
if (_columns.runClassMethod (SHARK2.keymon.com.mx.b4xset.class, "_contains" /*RemoteObject*/ ,(Object)((RemoteObject.createImmutable("_size")))).<Boolean>get().booleanValue()) { 
_res.setField ("Size" /*RemoteObject*/ ,_rs.runMethod(true,"GetLong",(Object)(RemoteObject.createImmutable("_size"))));};
 BA.debugLineNum = 85;BA.debugLine="If columns.Contains(\"last_modified\") Then res.Mo";
Debug.ShouldStop(1048576);
if (_columns.runClassMethod (SHARK2.keymon.com.mx.b4xset.class, "_contains" /*RemoteObject*/ ,(Object)((RemoteObject.createImmutable("last_modified")))).<Boolean>get().booleanValue()) { 
_res.setField ("Modified" /*RemoteObject*/ ,_rs.runMethod(true,"GetLong",(Object)(RemoteObject.createImmutable("last_modified"))));};
 BA.debugLineNum = 86;BA.debugLine="If columns.Contains(\"mime_type\") Then res.MimeTy";
Debug.ShouldStop(2097152);
if (_columns.runClassMethod (SHARK2.keymon.com.mx.b4xset.class, "_contains" /*RemoteObject*/ ,(Object)((RemoteObject.createImmutable("mime_type")))).<Boolean>get().booleanValue()) { 
_res.setField ("MimeType" /*RemoteObject*/ ,_rs.runMethod(true,"GetString",(Object)(RemoteObject.createImmutable("mime_type"))));};
 };
 BA.debugLineNum = 88;BA.debugLine="rs.Close";
Debug.ShouldStop(8388608);
_rs.runVoidMethod ("Close");
 Debug.CheckDeviceExceptions();
} 
       catch (Exception e19) {
			BA.rdebugUtils.runVoidMethod("setLastException",__ref.getField(false, "ba"), e19.toString()); BA.debugLineNum = 91;BA.debugLine="Log(\"error extracting information from file prov";
Debug.ShouldStop(67108864);
filehandler.__c.runVoidMethod ("LogImpl","532309269",RemoteObject.createImmutable("error extracting information from file provider"),0);
 BA.debugLineNum = 92;BA.debugLine="Log(LastException)";
Debug.ShouldStop(134217728);
filehandler.__c.runVoidMethod ("LogImpl","532309270",BA.ObjectToString(filehandler.__c.runMethod(false,"LastException",__ref.runMethod(false,"getActivityBA"))),0);
 };
 BA.debugLineNum = 94;BA.debugLine="End Sub";
Debug.ShouldStop(536870912);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _getba(RemoteObject __ref) throws Exception{
try {
		Debug.PushSubsStack("GetBA (filehandler) ","filehandler",23,__ref.getField(false, "ba"),__ref,66);
if (RapidSub.canDelegate("getba")) { return __ref.runUserSub(false, "filehandler","getba", __ref);}
 BA.debugLineNum = 66;BA.debugLine="Private Sub GetBA As Object";
Debug.ShouldStop(2);
 BA.debugLineNum = 67;BA.debugLine="Return Me.As(JavaObject).RunMethod(\"getBA\", Null)";
Debug.ShouldStop(4);
if (true) return (RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4j.object.JavaObject"), __ref)).runMethod(false,"RunMethod",(Object)(BA.ObjectToString("getBA")),(Object)((filehandler.__c.getField(false,"Null"))));
 BA.debugLineNum = 68;BA.debugLine="End Sub";
Debug.ShouldStop(8);
return RemoteObject.createImmutable(null);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _initialize(RemoteObject __ref,RemoteObject _ba) throws Exception{
try {
		Debug.PushSubsStack("Initialize (filehandler) ","filehandler",23,__ref.getField(false, "ba"),__ref,23);
if (RapidSub.canDelegate("initialize")) { return __ref.runUserSub(false, "filehandler","initialize", __ref, _ba);}
__ref.runVoidMethodAndSync("innerInitializeHelper", _ba);
Debug.locals.put("ba", _ba);
 BA.debugLineNum = 23;BA.debugLine="Public Sub Initialize";
Debug.ShouldStop(4194304);
 BA.debugLineNum = 25;BA.debugLine="End Sub";
Debug.ShouldStop(16777216);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _isrelevantintent(RemoteObject __ref,RemoteObject _in) throws Exception{
try {
		Debug.PushSubsStack("IsRelevantIntent (filehandler) ","filehandler",23,__ref.getField(false, "ba"),__ref,113);
if (RapidSub.canDelegate("isrelevantintent")) { return __ref.runUserSub(false, "filehandler","isrelevantintent", __ref, _in);}
Debug.locals.put("in", _in);
 BA.debugLineNum = 113;BA.debugLine="Private Sub IsRelevantIntent(in As Intent) As Bool";
Debug.ShouldStop(65536);
 BA.debugLineNum = 114;BA.debugLine="If in.IsInitialized And in <> OldIntent And in.Ac";
Debug.ShouldStop(131072);
if (RemoteObject.solveBoolean(".",_in.runMethod(true,"IsInitialized")) && RemoteObject.solveBoolean("!",_in,__ref.getField(false,"_oldintent" /*RemoteObject*/ )) && RemoteObject.solveBoolean("=",_in.runMethod(true,"getAction"),_in.getField(true,"ACTION_VIEW"))) { 
 BA.debugLineNum = 115;BA.debugLine="OldIntent = in";
Debug.ShouldStop(262144);
__ref.setField ("_oldintent" /*RemoteObject*/ ,_in);
 BA.debugLineNum = 116;BA.debugLine="Return True";
Debug.ShouldStop(524288);
if (true) return filehandler.__c.getField(true,"True");
 };
 BA.debugLineNum = 118;BA.debugLine="Return False";
Debug.ShouldStop(2097152);
if (true) return filehandler.__c.getField(true,"False");
 BA.debugLineNum = 119;BA.debugLine="End Sub";
Debug.ShouldStop(4194304);
return RemoteObject.createImmutable(false);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _load(RemoteObject __ref) throws Exception{
try {
		Debug.PushSubsStack("Load (filehandler) ","filehandler",23,__ref.getField(false, "ba"),__ref,48);
if (RapidSub.canDelegate("load")) { return __ref.runUserSub(false, "filehandler","load", __ref);}
ResumableSub_Load rsub = new ResumableSub_Load(null,__ref);
rsub.remoteResumableSub = anywheresoftware.b4a.pc.PCResumableSub.createDebugResumeSubForFilter();
rsub.resume(null, null);
return RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.keywords.Common.ResumableSubWrapper"), rsub.remoteResumableSub);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static class ResumableSub_Load extends BA.ResumableSub {
public ResumableSub_Load(SHARK2.keymon.com.mx.filehandler parent,RemoteObject __ref) {
this.parent = parent;
this.__ref = __ref;
}
java.util.LinkedHashMap<String, Object> rsLocals = new java.util.LinkedHashMap<String, Object>();
RemoteObject __ref;
SHARK2.keymon.com.mx.filehandler parent;
RemoteObject _cc = RemoteObject.declareNull("anywheresoftware.b4a.phone.Phone.ContentChooser");
RemoteObject _success = RemoteObject.createImmutable(false);
RemoteObject _dir = RemoteObject.createImmutable("");
RemoteObject _filename = RemoteObject.createImmutable("");
RemoteObject _res = RemoteObject.declareNull("SHARK2.keymon.com.mx.filehandler._loadresult");

@Override
public void resume(BA ba, RemoteObject result) throws Exception{
try {
		Debug.PushSubsStack("Load (filehandler) ","filehandler",23,__ref.getField(false, "ba"),__ref,48);
Debug.locals = rsLocals;Debug.currentSubFrame.locals = rsLocals;

    while (true) {
        switch (state) {
            case -1:
{
parent.__c.runVoidMethod ("ReturnFromResumableSub",this.remoteResumableSub,RemoteObject.createImmutable(null));return;}
case 0:
//C
this.state = 1;
Debug.locals.put("_ref", __ref);
 BA.debugLineNum = 49;BA.debugLine="Dim cc As ContentChooser";
Debug.ShouldStop(65536);
_cc = RemoteObject.createNew ("anywheresoftware.b4a.phone.Phone.ContentChooser");Debug.locals.put("cc", _cc);
 BA.debugLineNum = 50;BA.debugLine="cc.Initialize(\"cc\")";
Debug.ShouldStop(131072);
_cc.runVoidMethod ("Initialize",(Object)(RemoteObject.createImmutable("cc")));
 BA.debugLineNum = 51;BA.debugLine="cc.Show(\"application/octet-stream\", \"Choose text";
Debug.ShouldStop(262144);
_cc.runVoidMethod ("Show",__ref.getField(false, "ba"),(Object)(BA.ObjectToString("application/octet-stream")),(Object)(RemoteObject.createImmutable("Choose text file")));
 BA.debugLineNum = 52;BA.debugLine="Wait For CC_Result (Success As Boolean, Dir As St";
Debug.ShouldStop(524288);
parent.__c.runVoidMethod ("WaitFor","cc_result", __ref.getField(false, "ba"), anywheresoftware.b4a.pc.PCResumableSub.createDebugResumeSub(this, "filehandler", "load"), null);
this.state = 7;
return;
case 7:
//C
this.state = 1;
_success = (RemoteObject) result.getArrayElement(true,RemoteObject.createImmutable(1));Debug.locals.put("Success", _success);
_dir = (RemoteObject) result.getArrayElement(true,RemoteObject.createImmutable(2));Debug.locals.put("Dir", _dir);
_filename = (RemoteObject) result.getArrayElement(true,RemoteObject.createImmutable(3));Debug.locals.put("FileName", _filename);
;
 BA.debugLineNum = 53;BA.debugLine="Log($\"***************************${CRLF}${Dir}${C";
Debug.ShouldStop(1048576);
parent.__c.runVoidMethod ("LogImpl","532112645",(RemoteObject.concat(RemoteObject.createImmutable("***************************"),parent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((parent.__c.getField(true,"CRLF")))),RemoteObject.createImmutable(""),parent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_dir))),RemoteObject.createImmutable(""),parent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((parent.__c.getField(true,"CRLF")))),RemoteObject.createImmutable(" "),parent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_filename))),RemoteObject.createImmutable(""))),0);
 BA.debugLineNum = 54;BA.debugLine="Dim res As LoadResult = CreateLoadResult(Success,";
Debug.ShouldStop(2097152);
_res = __ref.runClassMethod (SHARK2.keymon.com.mx.filehandler.class, "_createloadresult" /*RemoteObject*/ ,(Object)(_success),(Object)(_dir),(Object)(_filename));Debug.locals.put("res", _res);Debug.locals.put("res", _res);
 BA.debugLineNum = 55;BA.debugLine="Log($\"***************************${CRLF}${res.Fil";
Debug.ShouldStop(4194304);
parent.__c.runVoidMethod ("LogImpl","532112647",(RemoteObject.concat(RemoteObject.createImmutable("***************************"),parent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((parent.__c.getField(true,"CRLF")))),RemoteObject.createImmutable(""),parent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_res.getField(true,"FileName" /*RemoteObject*/ )))),RemoteObject.createImmutable(""),parent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((parent.__c.getField(true,"CRLF")))),RemoteObject.createImmutable(" "),parent.__c.runMethod(true,"SmartStringFormatter",(Object)(BA.ObjectToString("")),(Object)((_res))),RemoteObject.createImmutable(""))),0);
 BA.debugLineNum = 56;BA.debugLine="If res.Success Then ExtractInformationFromURI(res";
Debug.ShouldStop(8388608);
if (true) break;

case 1:
//if
this.state = 6;
if (_res.getField(true,"Success" /*RemoteObject*/ ).<Boolean>get().booleanValue()) { 
this.state = 3;
;}if (true) break;

case 3:
//C
this.state = 6;
__ref.runClassMethod (SHARK2.keymon.com.mx.filehandler.class, "_extractinformationfromuri" /*RemoteObject*/ ,(Object)(_res.getField(true,"FileName" /*RemoteObject*/ )),(Object)(_res));
if (true) break;

case 6:
//C
this.state = -1;
;
 BA.debugLineNum = 57;BA.debugLine="Return res";
Debug.ShouldStop(16777216);
if (true) {
parent.__c.runVoidMethod ("ReturnFromResumableSub",this.remoteResumableSub,(_res));return;};
 BA.debugLineNum = 58;BA.debugLine="End Sub";
Debug.ShouldStop(33554432);
if (true) break;

            }
        }
    }
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
}
public static void  _cc_result(RemoteObject __ref,RemoteObject _success,RemoteObject _dir,RemoteObject _filename) throws Exception{
}
public static RemoteObject  _saveas(RemoteObject __ref,RemoteObject _source,RemoteObject _mimetype,RemoteObject _title) throws Exception{
try {
		Debug.PushSubsStack("SaveAs (filehandler) ","filehandler",23,__ref.getField(false, "ba"),__ref,28);
if (RapidSub.canDelegate("saveas")) { return __ref.runUserSub(false, "filehandler","saveas", __ref, _source, _mimetype, _title);}
ResumableSub_SaveAs rsub = new ResumableSub_SaveAs(null,__ref,_source,_mimetype,_title);
rsub.remoteResumableSub = anywheresoftware.b4a.pc.PCResumableSub.createDebugResumeSubForFilter();
rsub.resume(null, null);
return RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.keywords.Common.ResumableSubWrapper"), rsub.remoteResumableSub);
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static class ResumableSub_SaveAs extends BA.ResumableSub {
public ResumableSub_SaveAs(SHARK2.keymon.com.mx.filehandler parent,RemoteObject __ref,RemoteObject _source,RemoteObject _mimetype,RemoteObject _title) {
this.parent = parent;
this.__ref = __ref;
this._source = _source;
this._mimetype = _mimetype;
this._title = _title;
}
java.util.LinkedHashMap<String, Object> rsLocals = new java.util.LinkedHashMap<String, Object>();
RemoteObject __ref;
SHARK2.keymon.com.mx.filehandler parent;
RemoteObject _source;
RemoteObject _mimetype;
RemoteObject _title;
RemoteObject _intent = RemoteObject.declareNull("anywheresoftware.b4a.objects.IntentWrapper");
RemoteObject _methodname = RemoteObject.createImmutable("");
RemoteObject _args = null;
RemoteObject _result = RemoteObject.declareNull("anywheresoftware.b4a.objects.IntentWrapper");
RemoteObject _jo = RemoteObject.declareNull("anywheresoftware.b4j.object.JavaObject");
RemoteObject _ctxt = RemoteObject.declareNull("anywheresoftware.b4j.object.JavaObject");
RemoteObject _out = RemoteObject.declareNull("anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper");

@Override
public void resume(BA ba, RemoteObject result) throws Exception{
try {
		Debug.PushSubsStack("SaveAs (filehandler) ","filehandler",23,__ref.getField(false, "ba"),__ref,28);
Debug.locals = rsLocals;Debug.currentSubFrame.locals = rsLocals;

    while (true) {
        switch (state) {
            case -1:
{
parent.__c.runVoidMethod ("ReturnFromResumableSub",this.remoteResumableSub,RemoteObject.createImmutable(null));return;}
case 0:
//C
this.state = 1;
Debug.locals.put("_ref", __ref);
Debug.locals.put("Source", _source);
Debug.locals.put("MimeType", _mimetype);
Debug.locals.put("Title", _title);
 BA.debugLineNum = 29;BA.debugLine="Dim intent As Intent";
Debug.ShouldStop(268435456);
_intent = RemoteObject.createNew ("anywheresoftware.b4a.objects.IntentWrapper");Debug.locals.put("intent", _intent);
 BA.debugLineNum = 30;BA.debugLine="intent.Initialize(\"android.intent.action.CREATE_D";
Debug.ShouldStop(536870912);
_intent.runVoidMethod ("Initialize",(Object)(BA.ObjectToString("android.intent.action.CREATE_DOCUMENT")),(Object)(RemoteObject.createImmutable("")));
 BA.debugLineNum = 31;BA.debugLine="intent.AddCategory(\"android.intent.category.OPENA";
Debug.ShouldStop(1073741824);
_intent.runVoidMethod ("AddCategory",(Object)(RemoteObject.createImmutable("android.intent.category.OPENABLE")));
 BA.debugLineNum = 32;BA.debugLine="intent.PutExtra(\"android.intent.extra.TITLE\", Tit";
Debug.ShouldStop(-2147483648);
_intent.runVoidMethod ("PutExtra",(Object)(BA.ObjectToString("android.intent.extra.TITLE")),(Object)((_title)));
 BA.debugLineNum = 33;BA.debugLine="intent.SetType(MimeType)";
Debug.ShouldStop(1);
_intent.runVoidMethod ("SetType",(Object)(_mimetype));
 BA.debugLineNum = 34;BA.debugLine="StartActivityForResult(intent)";
Debug.ShouldStop(2);
__ref.runClassMethod (SHARK2.keymon.com.mx.filehandler.class, "_startactivityforresult" /*RemoteObject*/ ,(Object)(_intent));
 BA.debugLineNum = 35;BA.debugLine="Wait For ion_Event (MethodName As String, Args()";
Debug.ShouldStop(4);
parent.__c.runVoidMethod ("WaitFor","ion_event", __ref.getField(false, "ba"), anywheresoftware.b4a.pc.PCResumableSub.createDebugResumeSub(this, "filehandler", "saveas"), null);
this.state = 5;
return;
case 5:
//C
this.state = 1;
_methodname = (RemoteObject) result.getArrayElement(true,RemoteObject.createImmutable(1));Debug.locals.put("MethodName", _methodname);
_args = (RemoteObject) result.getArrayElement(false,RemoteObject.createImmutable(2));Debug.locals.put("Args", _args);
;
 BA.debugLineNum = 36;BA.debugLine="If -1 = Args(0) Then 'resultCode = RESULT_OK";
Debug.ShouldStop(8);
if (true) break;

case 1:
//if
this.state = 4;
if (RemoteObject.solveBoolean("=",RemoteObject.createImmutable(-(double) (0 + 1)),BA.numberCast(double.class, _args.getArrayElement(false,BA.numberCast(int.class, 0))))) { 
this.state = 3;
}if (true) break;

case 3:
//C
this.state = 4;
 BA.debugLineNum = 37;BA.debugLine="Dim result As Intent = Args(1)";
Debug.ShouldStop(16);
_result = RemoteObject.createNew ("anywheresoftware.b4a.objects.IntentWrapper");
_result = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.IntentWrapper"), _args.getArrayElement(false,BA.numberCast(int.class, 1)));Debug.locals.put("result", _result);Debug.locals.put("result", _result);
 BA.debugLineNum = 38;BA.debugLine="Dim jo As JavaObject = result";
Debug.ShouldStop(32);
_jo = RemoteObject.createNew ("anywheresoftware.b4j.object.JavaObject");
_jo = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4j.object.JavaObject"), _result.getObject());Debug.locals.put("jo", _jo);Debug.locals.put("jo", _jo);
 BA.debugLineNum = 39;BA.debugLine="Dim ctxt As JavaObject";
Debug.ShouldStop(64);
_ctxt = RemoteObject.createNew ("anywheresoftware.b4j.object.JavaObject");Debug.locals.put("ctxt", _ctxt);
 BA.debugLineNum = 40;BA.debugLine="Dim out As OutputStream = ctxt.InitializeContext";
Debug.ShouldStop(128);
_out = RemoteObject.createNew ("anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper");
_out = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4a.objects.streams.File.OutputStreamWrapper"), _ctxt.runMethod(false,"InitializeContext",__ref.getField(false, "ba")).runMethod(false,"RunMethodJO",(Object)(BA.ObjectToString("getContentResolver")),(Object)((parent.__c.getField(false,"Null")))).runMethod(false,"RunMethod",(Object)(BA.ObjectToString("openOutputStream")),(Object)(RemoteObject.createNewArray("Object",new int[] {1},new Object[] {_jo.runMethod(false,"RunMethod",(Object)(BA.ObjectToString("getData")),(Object)((parent.__c.getField(false,"Null"))))}))));Debug.locals.put("out", _out);Debug.locals.put("out", _out);
 BA.debugLineNum = 41;BA.debugLine="File.Copy2(Source, out)";
Debug.ShouldStop(256);
parent.__c.getField(false,"File").runVoidMethod ("Copy2",(Object)((_source.getObject())),(Object)((_out.getObject())));
 BA.debugLineNum = 42;BA.debugLine="out.Close";
Debug.ShouldStop(512);
_out.runVoidMethod ("Close");
 BA.debugLineNum = 43;BA.debugLine="Return True";
Debug.ShouldStop(1024);
if (true) {
parent.__c.runVoidMethod ("ReturnFromResumableSub",this.remoteResumableSub,(parent.__c.getField(true,"True")));return;};
 if (true) break;

case 4:
//C
this.state = -1;
;
 BA.debugLineNum = 45;BA.debugLine="Return False";
Debug.ShouldStop(4096);
if (true) {
parent.__c.runVoidMethod ("ReturnFromResumableSub",this.remoteResumableSub,(parent.__c.getField(true,"False")));return;};
 BA.debugLineNum = 46;BA.debugLine="End Sub";
Debug.ShouldStop(8192);
if (true) break;

            }
        }
    }
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
}
public static void  _ion_event(RemoteObject __ref,RemoteObject _methodname,RemoteObject _args) throws Exception{
}
public static RemoteObject  _startactivityforresult(RemoteObject __ref,RemoteObject _i) throws Exception{
try {
		Debug.PushSubsStack("StartActivityForResult (filehandler) ","filehandler",23,__ref.getField(false, "ba"),__ref,60);
if (RapidSub.canDelegate("startactivityforresult")) { return __ref.runUserSub(false, "filehandler","startactivityforresult", __ref, _i);}
RemoteObject _jo = RemoteObject.declareNull("anywheresoftware.b4j.object.JavaObject");
Debug.locals.put("i", _i);
 BA.debugLineNum = 60;BA.debugLine="Private Sub StartActivityForResult(i As Intent)";
Debug.ShouldStop(134217728);
 BA.debugLineNum = 61;BA.debugLine="Dim jo As JavaObject = GetBA";
Debug.ShouldStop(268435456);
_jo = RemoteObject.createNew ("anywheresoftware.b4j.object.JavaObject");
_jo = RemoteObject.declareNull("anywheresoftware.b4a.AbsObjectWrapper").runMethod(false, "ConvertToWrapper", RemoteObject.createNew("anywheresoftware.b4j.object.JavaObject"), __ref.runClassMethod (SHARK2.keymon.com.mx.filehandler.class, "_getba" /*RemoteObject*/ ));Debug.locals.put("jo", _jo);Debug.locals.put("jo", _jo);
 BA.debugLineNum = 62;BA.debugLine="ion = jo.CreateEvent(\"anywheresoftware.b4a.IOnAct";
Debug.ShouldStop(536870912);
__ref.setField ("_ion" /*RemoteObject*/ ,_jo.runMethod(false,"CreateEvent",__ref.getField(false, "ba"),(Object)(BA.ObjectToString("anywheresoftware.b4a.IOnActivityResult")),(Object)(BA.ObjectToString("ion")),(Object)(filehandler.__c.getField(false,"Null"))));
 BA.debugLineNum = 63;BA.debugLine="jo.RunMethod(\"startActivityForResult\", Array(ion,";
Debug.ShouldStop(1073741824);
_jo.runVoidMethod ("RunMethod",(Object)(BA.ObjectToString("startActivityForResult")),(Object)(RemoteObject.createNewArray("Object",new int[] {2},new Object[] {__ref.getField(false,"_ion" /*RemoteObject*/ ),(_i.getObject())})));
 BA.debugLineNum = 64;BA.debugLine="End Sub";
Debug.ShouldStop(-2147483648);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
}