package b4a.example;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.pc.*;

public class get_data_subs_0 {


public static RemoteObject  _newdata(RemoteObject _data) throws Exception{
try {
		Debug.PushSubsStack("NewData (get_data) ","get_data",2,get_data.processBA,get_data.mostCurrent,40);
if (RapidSub.canDelegate("newdata")) { return b4a.example.get_data.remoteMe.runUserSub(false, "get_data","newdata", _data);}
RemoteObject _key = RemoteObject.createImmutable(0);
RemoteObject _data_byte_decrypted = RemoteObject.createImmutable(0);
RemoteObject _pos = RemoteObject.createImmutable(0);
RemoteObject _message = RemoteObject.createImmutable("");
RemoteObject _byte1 = null;
RemoteObject _carac = RemoteObject.createImmutable("");
Debug.locals.put("data", _data);
 BA.debugLineNum = 40;BA.debugLine="Sub NewData (data() As Byte)";
Debug.ShouldStop(128);
 BA.debugLineNum = 42;BA.debugLine="Dim key As Int=171";
Debug.ShouldStop(512);
_key = BA.numberCast(int.class, 171);Debug.locals.put("key", _key);Debug.locals.put("key", _key);
 BA.debugLineNum = 44;BA.debugLine="Dim data_byte_decrypted As Int";
Debug.ShouldStop(2048);
_data_byte_decrypted = RemoteObject.createImmutable(0);Debug.locals.put("data_byte_decrypted", _data_byte_decrypted);
 BA.debugLineNum = 45;BA.debugLine="Dim pos As Int=0";
Debug.ShouldStop(4096);
_pos = BA.numberCast(int.class, 0);Debug.locals.put("pos", _pos);Debug.locals.put("pos", _pos);
 BA.debugLineNum = 48;BA.debugLine="Dim message As String=\"\"";
Debug.ShouldStop(32768);
_message = BA.ObjectToString("");Debug.locals.put("message", _message);Debug.locals.put("message", _message);
 BA.debugLineNum = 49;BA.debugLine="For pos = 4 To data.Length-1";
Debug.ShouldStop(65536);
{
final int step5 = 1;
final int limit5 = RemoteObject.solve(new RemoteObject[] {_data.getField(true,"length"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
_pos = BA.numberCast(int.class, 4) ;
for (;(step5 > 0 && _pos.<Integer>get().intValue() <= limit5) || (step5 < 0 && _pos.<Integer>get().intValue() >= limit5) ;_pos = RemoteObject.createImmutable((int)(0 + _pos.<Integer>get().intValue() + step5))  ) {
Debug.locals.put("pos", _pos);
 BA.debugLineNum = 51;BA.debugLine="data_byte_decrypted=Bit.Xor(Bit.And(data(pos), 0";
Debug.ShouldStop(262144);
_data_byte_decrypted = get_data.mostCurrent.__c.getField(false,"Bit").runMethod(true,"Xor",(Object)(get_data.mostCurrent.__c.getField(false,"Bit").runMethod(true,"And",(Object)(BA.numberCast(int.class, _data.getArrayElement(true,_pos))),(Object)(BA.numberCast(int.class, 0xff)))),(Object)(_key));Debug.locals.put("data_byte_decrypted", _data_byte_decrypted);
 BA.debugLineNum = 52;BA.debugLine="Dim byte1(1) As Byte";
Debug.ShouldStop(524288);
_byte1 = RemoteObject.createNewArray ("byte", new int[] {1}, new Object[]{});Debug.locals.put("byte1", _byte1);
 BA.debugLineNum = 53;BA.debugLine="byte1(0)=data_byte_decrypted";
Debug.ShouldStop(1048576);
_byte1.setArrayElement (BA.numberCast(byte.class, _data_byte_decrypted),BA.numberCast(int.class, 0));
 BA.debugLineNum = 55;BA.debugLine="Dim carac As String = bconv.StringFromBytes(byte";
Debug.ShouldStop(4194304);
_carac = get_data._bconv.runMethod(true,"StringFromBytes",(Object)(_byte1),(Object)(RemoteObject.createImmutable("ASCII")));Debug.locals.put("carac", _carac);Debug.locals.put("carac", _carac);
 BA.debugLineNum = 56;BA.debugLine="key=data(pos)";
Debug.ShouldStop(8388608);
_key = BA.numberCast(int.class, _data.getArrayElement(true,_pos));Debug.locals.put("key", _key);
 BA.debugLineNum = 57;BA.debugLine="message=message & carac";
Debug.ShouldStop(16777216);
_message = RemoteObject.concat(_message,_carac);Debug.locals.put("message", _message);
 }
}Debug.locals.put("pos", _pos);
;
 BA.debugLineNum = 60;BA.debugLine="Log(message)";
Debug.ShouldStop(134217728);
get_data.mostCurrent.__c.runVoidMethod ("LogImpl","22031636",_message,0);
 BA.debugLineNum = 63;BA.debugLine="End Sub";
Debug.ShouldStop(1073741824);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _process_globals() throws Exception{
 //BA.debugLineNum = 6;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 9;BA.debugLine="Dim bconv As ByteConverter";
get_data._bconv = RemoteObject.createNew ("anywheresoftware.b4a.agraham.byteconverter.ByteConverter");
 //BA.debugLineNum = 11;BA.debugLine="End Sub";
return RemoteObject.createImmutable("");
}
public static RemoteObject  _service_create() throws Exception{
try {
		Debug.PushSubsStack("Service_Create (get_data) ","get_data",2,get_data.processBA,get_data.mostCurrent,13);
if (RapidSub.canDelegate("service_create")) { return b4a.example.get_data.remoteMe.runUserSub(false, "get_data","service_create");}
 BA.debugLineNum = 13;BA.debugLine="Sub Service_Create";
Debug.ShouldStop(4096);
 BA.debugLineNum = 14;BA.debugLine="StartServiceAt(Me,DateTime.Now + 5000,True)";
Debug.ShouldStop(8192);
get_data.mostCurrent.__c.runVoidMethod ("StartServiceAt",get_data.processBA,(Object)(get_data.getObject()),(Object)(RemoteObject.solve(new RemoteObject[] {get_data.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getNow"),RemoteObject.createImmutable(5000)}, "+",1, 2)),(Object)(get_data.mostCurrent.__c.getField(true,"True")));
 BA.debugLineNum = 15;BA.debugLine="If Starter.connected=False Then";
Debug.ShouldStop(16384);
if (RemoteObject.solveBoolean("=",get_data.mostCurrent._starter._connected /*RemoteObject*/ ,get_data.mostCurrent.__c.getField(true,"False"))) { 
 BA.debugLineNum = 16;BA.debugLine="CallSub2(Starter, \"ConnectToServer\",\"192.168.0.41";
Debug.ShouldStop(32768);
get_data.mostCurrent.__c.runMethodAndSync(false,"CallSubNew2",get_data.processBA,(Object)((get_data.mostCurrent._starter.getObject())),(Object)(BA.ObjectToString("ConnectToServer")),(Object)((RemoteObject.createImmutable("192.168.0.41"))));
 };
 BA.debugLineNum = 19;BA.debugLine="End Sub";
Debug.ShouldStop(262144);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _service_destroy() throws Exception{
try {
		Debug.PushSubsStack("Service_Destroy (get_data) ","get_data",2,get_data.processBA,get_data.mostCurrent,65);
if (RapidSub.canDelegate("service_destroy")) { return b4a.example.get_data.remoteMe.runUserSub(false, "get_data","service_destroy");}
 BA.debugLineNum = 65;BA.debugLine="Sub Service_Destroy";
Debug.ShouldStop(1);
 BA.debugLineNum = 66;BA.debugLine="StartServiceAt(Me,DateTime.Now + 5000,True)";
Debug.ShouldStop(2);
get_data.mostCurrent.__c.runVoidMethod ("StartServiceAt",get_data.processBA,(Object)(get_data.getObject()),(Object)(RemoteObject.solve(new RemoteObject[] {get_data.mostCurrent.__c.getField(false,"DateTime").runMethod(true,"getNow"),RemoteObject.createImmutable(5000)}, "+",1, 2)),(Object)(get_data.mostCurrent.__c.getField(true,"True")));
 BA.debugLineNum = 67;BA.debugLine="End Sub";
Debug.ShouldStop(4);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _service_start(RemoteObject _startingintent) throws Exception{
try {
		Debug.PushSubsStack("Service_Start (get_data) ","get_data",2,get_data.processBA,get_data.mostCurrent,21);
if (RapidSub.canDelegate("service_start")) { return b4a.example.get_data.remoteMe.runUserSub(false, "get_data","service_start", _startingintent);}
Debug.locals.put("StartingIntent", _startingintent);
 BA.debugLineNum = 21;BA.debugLine="Sub Service_Start (StartingIntent As Intent)";
Debug.ShouldStop(1048576);
 BA.debugLineNum = 37;BA.debugLine="End Sub";
Debug.ShouldStop(16);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			throw Debug.ErrorCaught(e);
		} 
finally {
			Debug.PopSubsStack();
		}}
}