package shub.dpm;


import anywheresoftware.b4a.B4AMenuItem;
import android.app.Activity;
import android.os.Bundle;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.B4AActivity;
import anywheresoftware.b4a.ObjectWrapper;
import anywheresoftware.b4a.objects.ActivityWrapper;
import java.lang.reflect.InvocationTargetException;
import anywheresoftware.b4a.B4AUncaughtException;
import anywheresoftware.b4a.debug.*;
import java.lang.ref.WeakReference;

public class main extends Activity implements B4AActivity{
	public static main mostCurrent;
	static boolean afterFirstLayout;
	static boolean isFirst = true;
    private static boolean processGlobalsRun = false;
	BALayout layout;
	public static BA processBA;
	BA activityBA;
    ActivityWrapper _activity;
    java.util.ArrayList<B4AMenuItem> menuItems;
	public static final boolean fullScreen = false;
	public static final boolean includeTitle = true;
    public static WeakReference<Activity> previousOne;
    public static boolean dontPause;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
        mostCurrent = this;
		if (processBA == null) {
			processBA = new anywheresoftware.b4a.ShellBA(this.getApplicationContext(), null, null, "shub.dpm", "shub.dpm.main");
			processBA.loadHtSubs(this.getClass());
	        float deviceScale = getApplicationContext().getResources().getDisplayMetrics().density;
	        BALayout.setDeviceScale(deviceScale);
            
		}
		else if (previousOne != null) {
			Activity p = previousOne.get();
			if (p != null && p != this) {
                BA.LogInfo("Killing previous instance (main).");
				p.finish();
			}
		}
        processBA.setActivityPaused(true);
        processBA.runHook("oncreate", this, null);
		if (!includeTitle) {
        	this.getWindow().requestFeature(android.view.Window.FEATURE_NO_TITLE);
        }
        if (fullScreen) {
        	getWindow().setFlags(android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN,   
        			android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }
		
        processBA.sharedProcessBA.activityBA = null;
		layout = new BALayout(this);
		setContentView(layout);
		afterFirstLayout = false;
        WaitForLayout wl = new WaitForLayout();
        if (anywheresoftware.b4a.objects.ServiceHelper.StarterHelper.startFromActivity(this, processBA, wl, false))
		    BA.handler.postDelayed(wl, 5);

	}
	static class WaitForLayout implements Runnable {
		public void run() {
			if (afterFirstLayout)
				return;
			if (mostCurrent == null)
				return;
            
			if (mostCurrent.layout.getWidth() == 0) {
				BA.handler.postDelayed(this, 5);
				return;
			}
			mostCurrent.layout.getLayoutParams().height = mostCurrent.layout.getHeight();
			mostCurrent.layout.getLayoutParams().width = mostCurrent.layout.getWidth();
			afterFirstLayout = true;
			mostCurrent.afterFirstLayout();
		}
	}
	private void afterFirstLayout() {
        if (this != mostCurrent)
			return;
		activityBA = new BA(this, layout, processBA, "shub.dpm", "shub.dpm.main");
        
        processBA.sharedProcessBA.activityBA = new java.lang.ref.WeakReference<BA>(activityBA);
        anywheresoftware.b4a.objects.ViewWrapper.lastId = 0;
        _activity = new ActivityWrapper(activityBA, "activity");
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        if (BA.isShellModeRuntimeCheck(processBA)) {
			if (isFirst)
				processBA.raiseEvent2(null, true, "SHELL", false);
			processBA.raiseEvent2(null, true, "CREATE", true, "shub.dpm.main", processBA, activityBA, _activity, anywheresoftware.b4a.keywords.Common.Density, mostCurrent);
			_activity.reinitializeForShell(activityBA, "activity");
		}
        initializeProcessGlobals();		
        initializeGlobals();
        
        BA.LogInfo("** Activity (main) Create, isFirst = " + isFirst + " **");
        processBA.raiseEvent2(null, true, "activity_create", false, isFirst);
		isFirst = false;
		if (this != mostCurrent)
			return;
        processBA.setActivityPaused(false);
        BA.LogInfo("** Activity (main) Resume **");
        processBA.raiseEvent(null, "activity_resume");
        if (android.os.Build.VERSION.SDK_INT >= 11) {
			try {
				android.app.Activity.class.getMethod("invalidateOptionsMenu").invoke(this,(Object[]) null);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

	}
	public void addMenuItem(B4AMenuItem item) {
		if (menuItems == null)
			menuItems = new java.util.ArrayList<B4AMenuItem>();
		menuItems.add(item);
	}
	@Override
	public boolean onCreateOptionsMenu(android.view.Menu menu) {
		super.onCreateOptionsMenu(menu);
        try {
            if (processBA.subExists("activity_actionbarhomeclick")) {
                Class.forName("android.app.ActionBar").getMethod("setHomeButtonEnabled", boolean.class).invoke(
                    getClass().getMethod("getActionBar").invoke(this), true);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (processBA.runHook("oncreateoptionsmenu", this, new Object[] {menu}))
            return true;
		if (menuItems == null)
			return false;
		for (B4AMenuItem bmi : menuItems) {
			android.view.MenuItem mi = menu.add(bmi.title);
			if (bmi.drawable != null)
				mi.setIcon(bmi.drawable);
            if (android.os.Build.VERSION.SDK_INT >= 11) {
				try {
                    if (bmi.addToBar) {
				        android.view.MenuItem.class.getMethod("setShowAsAction", int.class).invoke(mi, 1);
                    }
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
			mi.setOnMenuItemClickListener(new B4AMenuItemsClickListener(bmi.eventName.toLowerCase(BA.cul)));
		}
        
		return true;
	}   
 @Override
 public boolean onOptionsItemSelected(android.view.MenuItem item) {
    if (item.getItemId() == 16908332) {
        processBA.raiseEvent(null, "activity_actionbarhomeclick");
        return true;
    }
    else
        return super.onOptionsItemSelected(item); 
}
@Override
 public boolean onPrepareOptionsMenu(android.view.Menu menu) {
    super.onPrepareOptionsMenu(menu);
    processBA.runHook("onprepareoptionsmenu", this, new Object[] {menu});
    return true;
    
 }
 protected void onStart() {
    super.onStart();
    processBA.runHook("onstart", this, null);
}
 protected void onStop() {
    super.onStop();
    processBA.runHook("onstop", this, null);
}
    public void onWindowFocusChanged(boolean hasFocus) {
       super.onWindowFocusChanged(hasFocus);
       if (processBA.subExists("activity_windowfocuschanged"))
           processBA.raiseEvent2(null, true, "activity_windowfocuschanged", false, hasFocus);
    }
	private class B4AMenuItemsClickListener implements android.view.MenuItem.OnMenuItemClickListener {
		private final String eventName;
		public B4AMenuItemsClickListener(String eventName) {
			this.eventName = eventName;
		}
		public boolean onMenuItemClick(android.view.MenuItem item) {
			processBA.raiseEventFromUI(item.getTitle(), eventName + "_click");
			return true;
		}
	}
    public static Class<?> getObject() {
		return main.class;
	}
    private Boolean onKeySubExist = null;
    private Boolean onKeyUpSubExist = null;
	@Override
	public boolean onKeyDown(int keyCode, android.view.KeyEvent event) {
        if (processBA.runHook("onkeydown", this, new Object[] {keyCode, event}))
            return true;
		if (onKeySubExist == null)
			onKeySubExist = processBA.subExists("activity_keypress");
		if (onKeySubExist) {
			if (keyCode == anywheresoftware.b4a.keywords.constants.KeyCodes.KEYCODE_BACK &&
					android.os.Build.VERSION.SDK_INT >= 18) {
				HandleKeyDelayed hk = new HandleKeyDelayed();
				hk.kc = keyCode;
				BA.handler.post(hk);
				return true;
			}
			else {
				boolean res = new HandleKeyDelayed().runDirectly(keyCode);
				if (res)
					return true;
			}
		}
		return super.onKeyDown(keyCode, event);
	}
	private class HandleKeyDelayed implements Runnable {
		int kc;
		public void run() {
			runDirectly(kc);
		}
		public boolean runDirectly(int keyCode) {
			Boolean res =  (Boolean)processBA.raiseEvent2(_activity, false, "activity_keypress", false, keyCode);
			if (res == null || res == true) {
                return true;
            }
            else if (keyCode == anywheresoftware.b4a.keywords.constants.KeyCodes.KEYCODE_BACK) {
				finish();
				return true;
			}
            return false;
		}
		
	}
    @Override
	public boolean onKeyUp(int keyCode, android.view.KeyEvent event) {
        if (processBA.runHook("onkeyup", this, new Object[] {keyCode, event}))
            return true;
		if (onKeyUpSubExist == null)
			onKeyUpSubExist = processBA.subExists("activity_keyup");
		if (onKeyUpSubExist) {
			Boolean res =  (Boolean)processBA.raiseEvent2(_activity, false, "activity_keyup", false, keyCode);
			if (res == null || res == true)
				return true;
		}
		return super.onKeyUp(keyCode, event);
	}
	@Override
	public void onNewIntent(android.content.Intent intent) {
        super.onNewIntent(intent);
		this.setIntent(intent);
        processBA.runHook("onnewintent", this, new Object[] {intent});
	}
    @Override 
	public void onPause() {
		super.onPause();
        if (_activity == null)
            return;
        if (this != mostCurrent)
			return;
		anywheresoftware.b4a.Msgbox.dismiss(true);
        if (!dontPause)
            BA.LogInfo("** Activity (main) Pause, UserClosed = " + activityBA.activity.isFinishing() + " **");
        else
            BA.LogInfo("** Activity (main) Pause event (activity is not paused). **");
        if (mostCurrent != null)
            processBA.raiseEvent2(_activity, true, "activity_pause", false, activityBA.activity.isFinishing());		
        if (!dontPause) {
            processBA.setActivityPaused(true);
            mostCurrent = null;
        }

        if (!activityBA.activity.isFinishing())
			previousOne = new WeakReference<Activity>(this);
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        processBA.runHook("onpause", this, null);
	}

	@Override
	public void onDestroy() {
        super.onDestroy();
		previousOne = null;
        processBA.runHook("ondestroy", this, null);
	}
    @Override 
	public void onResume() {
		super.onResume();
        mostCurrent = this;
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        if (activityBA != null) { //will be null during activity create (which waits for AfterLayout).
        	ResumeMessage rm = new ResumeMessage(mostCurrent);
        	BA.handler.post(rm);
        }
        processBA.runHook("onresume", this, null);
	}
    private static class ResumeMessage implements Runnable {
    	private final WeakReference<Activity> activity;
    	public ResumeMessage(Activity activity) {
    		this.activity = new WeakReference<Activity>(activity);
    	}
		public void run() {
            main mc = mostCurrent;
			if (mc == null || mc != activity.get())
				return;
			processBA.setActivityPaused(false);
            BA.LogInfo("** Activity (main) Resume **");
            if (mc != mostCurrent)
                return;
		    processBA.raiseEvent(mc._activity, "activity_resume", (Object[])null);
		}
    }
	@Override
	protected void onActivityResult(int requestCode, int resultCode,
	      android.content.Intent data) {
		processBA.onActivityResult(requestCode, resultCode, data);
        processBA.runHook("onactivityresult", this, new Object[] {requestCode, resultCode});
	}
	private static void initializeGlobals() {
		processBA.raiseEvent2(null, true, "globals", false, (Object[])null);
	}
    public void onRequestPermissionsResult(int requestCode,
        String permissions[], int[] grantResults) {
        for (int i = 0;i < permissions.length;i++) {
            Object[] o = new Object[] {permissions[i], grantResults[i] == 0};
            processBA.raiseEventFromDifferentThread(null,null, 0, "activity_permissionresult", true, o);
        }
            
    }



public static void initializeProcessGlobals() {
    
    if (main.processGlobalsRun == false) {
	    main.processGlobalsRun = true;
		try {
		        		
        } catch (Exception e) {
			throw new RuntimeException(e);
		}
    }
}
public static boolean isAnyActivityVisible() {
    boolean vis = false;
vis = vis | (main.mostCurrent != null);
vis = vis | (parameter.mostCurrent != null);
vis = vis | (about.mostCurrent != null);
vis = vis | (barcodescanner.mostCurrent != null);
vis = vis | (listpat.mostCurrent != null);
vis = vis | (endecodetester.mostCurrent != null);
vis = vis | (listdata.mostCurrent != null);
return vis;}

private static BA killProgramHelper(BA ba) {
    if (ba == null)
        return null;
    anywheresoftware.b4a.BA.SharedProcessBA sharedProcessBA = ba.sharedProcessBA;
    if (sharedProcessBA == null || sharedProcessBA.activityBA == null)
        return null;
    return sharedProcessBA.activityBA.get();
}
public static void killProgram() {
     {
            Activity __a = null;
            if (main.previousOne != null) {
				__a = main.previousOne.get();
			}
            else {
                BA ba = killProgramHelper(main.mostCurrent == null ? null : main.mostCurrent.processBA);
                if (ba != null) __a = ba.activity;
            }
            if (__a != null)
				__a.finish();}

 {
            Activity __a = null;
            if (parameter.previousOne != null) {
				__a = parameter.previousOne.get();
			}
            else {
                BA ba = killProgramHelper(parameter.mostCurrent == null ? null : parameter.mostCurrent.processBA);
                if (ba != null) __a = ba.activity;
            }
            if (__a != null)
				__a.finish();}

 {
            Activity __a = null;
            if (about.previousOne != null) {
				__a = about.previousOne.get();
			}
            else {
                BA ba = killProgramHelper(about.mostCurrent == null ? null : about.mostCurrent.processBA);
                if (ba != null) __a = ba.activity;
            }
            if (__a != null)
				__a.finish();}

 {
            Activity __a = null;
            if (barcodescanner.previousOne != null) {
				__a = barcodescanner.previousOne.get();
			}
            else {
                BA ba = killProgramHelper(barcodescanner.mostCurrent == null ? null : barcodescanner.mostCurrent.processBA);
                if (ba != null) __a = ba.activity;
            }
            if (__a != null)
				__a.finish();}

 {
            Activity __a = null;
            if (listpat.previousOne != null) {
				__a = listpat.previousOne.get();
			}
            else {
                BA ba = killProgramHelper(listpat.mostCurrent == null ? null : listpat.mostCurrent.processBA);
                if (ba != null) __a = ba.activity;
            }
            if (__a != null)
				__a.finish();}

 {
            Activity __a = null;
            if (endecodetester.previousOne != null) {
				__a = endecodetester.previousOne.get();
			}
            else {
                BA ba = killProgramHelper(endecodetester.mostCurrent == null ? null : endecodetester.mostCurrent.processBA);
                if (ba != null) __a = ba.activity;
            }
            if (__a != null)
				__a.finish();}

BA.applicationContext.stopService(new android.content.Intent(BA.applicationContext, jobservice.class));
 {
            Activity __a = null;
            if (listdata.previousOne != null) {
				__a = listdata.previousOne.get();
			}
            else {
                BA ba = killProgramHelper(listdata.mostCurrent == null ? null : listdata.mostCurrent.processBA);
                if (ba != null) __a = ba.activity;
            }
            if (__a != null)
				__a.finish();}

BA.applicationContext.stopService(new android.content.Intent(BA.applicationContext, starter.class));
BA.applicationContext.stopService(new android.content.Intent(BA.applicationContext, httputils2service.class));
}
public anywheresoftware.b4a.keywords.Common __c = null;
public shub.dpm.menuhandler _clsmenuhandler = null;
public shub.dpm.parameter _parameter = null;
public shub.dpm.about _about = null;
public shub.dpm.barcodescanner _barcodescanner = null;
public shub.dpm.allgfnkt _allgfnkt = null;
public shub.dpm.listpat _listpat = null;
public shub.dpm.endecodetester _endecodetester = null;
public shub.dpm.jobservice _jobservice = null;
public shub.dpm.listdata _listdata = null;
public shub.dpm.starter _starter = null;
public shub.dpm.b4xpages _b4xpages = null;
public shub.dpm.b4xcollections _b4xcollections = null;
public shub.dpm.httputils2service _httputils2service = null;
public static String  _activity_actionbarhomeclick() throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(mostCurrent.activityBA, "activity_actionbarhomeclick", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "activity_actionbarhomeclick", null));}
RDebugUtils.currentLine=327680;
 //BA.debugLineNum = 327680;BA.debugLine="Sub Activity_ActionBarHomeClick";
RDebugUtils.currentLine=327684;
 //BA.debugLineNum = 327684;BA.debugLine="End Sub";
return "";
}
public static String  _activity_create(boolean _firsttime) throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(mostCurrent.activityBA, "activity_create", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "activity_create", new Object[] {_firsttime}));}
shub.dpm.b4xpagesmanager _pm = null;
RDebugUtils.currentLine=131072;
 //BA.debugLineNum = 131072;BA.debugLine="Sub Activity_Create(FirstTime As Boolean)";
RDebugUtils.currentLine=131073;
 //BA.debugLineNum = 131073;BA.debugLine="Dim pm As B4XPagesManager";
_pm = new shub.dpm.b4xpagesmanager();
RDebugUtils.currentLine=131074;
 //BA.debugLineNum = 131074;BA.debugLine="pm.Initialize(Activity)";
_pm._initialize /*String*/ (null,mostCurrent.activityBA,mostCurrent._activity);
RDebugUtils.currentLine=131075;
 //BA.debugLineNum = 131075;BA.debugLine="Activity.LoadLayout(\"MainPage\")";
mostCurrent._activity.LoadLayout("MainPage",mostCurrent.activityBA);
RDebugUtils.currentLine=131076;
 //BA.debugLineNum = 131076;BA.debugLine="Activity.Title=\"DPM Mobile\"";
mostCurrent._activity.setTitle(BA.ObjectToCharSequence("DPM Mobile"));
RDebugUtils.currentLine=131077;
 //BA.debugLineNum = 131077;BA.debugLine="Activity.TitleColor=0xFF077AFF";
mostCurrent._activity.setTitleColor((int) (0xff077aff));
RDebugUtils.currentLine=131079;
 //BA.debugLineNum = 131079;BA.debugLine="End Sub";
return "";
}
public static boolean  _activity_keypress(int _keycode) throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(mostCurrent.activityBA, "activity_keypress", false))
	 {return ((Boolean) Debug.delegate(mostCurrent.activityBA, "activity_keypress", new Object[] {_keycode}));}
RDebugUtils.currentLine=393216;
 //BA.debugLineNum = 393216;BA.debugLine="Sub Activity_KeyPress (KeyCode As Int) As Boolean";
RDebugUtils.currentLine=393217;
 //BA.debugLineNum = 393217;BA.debugLine="Return B4XPages.Delegate.Activity_KeyPress(KeyCod";
if (true) return mostCurrent._b4xpages._delegate /*shub.dpm.b4xpagesdelegator*/ ._activity_keypress /*boolean*/ (null,_keycode);
RDebugUtils.currentLine=393218;
 //BA.debugLineNum = 393218;BA.debugLine="End Sub";
return false;
}
public static String  _activity_pause(boolean _userclosed) throws Exception{
RDebugUtils.currentModule="main";
RDebugUtils.currentLine=524288;
 //BA.debugLineNum = 524288;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
RDebugUtils.currentLine=524289;
 //BA.debugLineNum = 524289;BA.debugLine="B4XPages.Delegate.Activity_Pause";
mostCurrent._b4xpages._delegate /*shub.dpm.b4xpagesdelegator*/ ._activity_pause /*String*/ (null);
RDebugUtils.currentLine=524290;
 //BA.debugLineNum = 524290;BA.debugLine="End Sub";
return "";
}
public static String  _activity_permissionresult(String _permission,boolean _result) throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(mostCurrent.activityBA, "activity_permissionresult", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "activity_permissionresult", new Object[] {_permission,_result}));}
RDebugUtils.currentLine=589824;
 //BA.debugLineNum = 589824;BA.debugLine="Sub Activity_PermissionResult (Permission As Strin";
RDebugUtils.currentLine=589825;
 //BA.debugLineNum = 589825;BA.debugLine="B4XPages.Delegate.Activity_PermissionResult(Permi";
mostCurrent._b4xpages._delegate /*shub.dpm.b4xpagesdelegator*/ ._activity_permissionresult /*String*/ (null,_permission,_result);
RDebugUtils.currentLine=589826;
 //BA.debugLineNum = 589826;BA.debugLine="End Sub";
return "";
}
public static String  _activity_resume() throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(mostCurrent.activityBA, "activity_resume", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "activity_resume", null));}
RDebugUtils.currentLine=458752;
 //BA.debugLineNum = 458752;BA.debugLine="Sub Activity_Resume";
RDebugUtils.currentLine=458753;
 //BA.debugLineNum = 458753;BA.debugLine="B4XPages.Delegate.Activity_Resume";
mostCurrent._b4xpages._delegate /*shub.dpm.b4xpagesdelegator*/ ._activity_resume /*String*/ (null);
RDebugUtils.currentLine=458755;
 //BA.debugLineNum = 458755;BA.debugLine="End Sub";
return "";
}
public static String  _btnsetings_click() throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(mostCurrent.activityBA, "btnsetings_click", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "btnsetings_click", null));}
anywheresoftware.b4a.agraham.byteconverter.ByteConverter _bconv = null;
String _clear = "";
byte[] _key = null;
byte[] _data = null;
byte[] _iv = null;
anywheresoftware.b4a.objects.StringUtils _su = null;
String _x = "";
byte[] _y = null;
String _xx = "";
anywheresoftware.b4a.agraham.encryption.CipherWrapper.KeyGeneratorWrapper _kg = null;
anywheresoftware.b4a.agraham.encryption.CipherWrapper _c = null;
RDebugUtils.currentLine=196608;
 //BA.debugLineNum = 196608;BA.debugLine="Private Sub BtnSetings_Click";
RDebugUtils.currentLine=196610;
 //BA.debugLineNum = 196610;BA.debugLine="Dim Bconv As ByteConverter";
_bconv = new anywheresoftware.b4a.agraham.byteconverter.ByteConverter();
RDebugUtils.currentLine=196611;
 //BA.debugLineNum = 196611;BA.debugLine="Dim clear As String";
_clear = "";
RDebugUtils.currentLine=196612;
 //BA.debugLineNum = 196612;BA.debugLine="Dim key(0) As Byte";
_key = new byte[(int) (0)];
;
RDebugUtils.currentLine=196613;
 //BA.debugLineNum = 196613;BA.debugLine="Dim data(0) As Byte";
_data = new byte[(int) (0)];
;
RDebugUtils.currentLine=196614;
 //BA.debugLineNum = 196614;BA.debugLine="Dim iv(0) As Byte";
_iv = new byte[(int) (0)];
;
RDebugUtils.currentLine=196616;
 //BA.debugLineNum = 196616;BA.debugLine="Dim su As StringUtils";
_su = new anywheresoftware.b4a.objects.StringUtils();
RDebugUtils.currentLine=196617;
 //BA.debugLineNum = 196617;BA.debugLine="clear = \"3hba8fOumOPrMG0.G?-mkF-scGOkPwyW\"";
_clear = "3hba8fOumOPrMG0.G?-mkF-scGOkPwyW";
RDebugUtils.currentLine=196618;
 //BA.debugLineNum = 196618;BA.debugLine="data = Bconv.StringToBytes(clear, \"UTF8\")";
_data = _bconv.StringToBytes(_clear,"UTF8");
RDebugUtils.currentLine=196619;
 //BA.debugLineNum = 196619;BA.debugLine="Dim x As String =su.EncodeBase64(data)";
_x = _su.EncodeBase64(_data);
RDebugUtils.currentLine=196620;
 //BA.debugLineNum = 196620;BA.debugLine="Dim y() As Byte=su.DecodeBase64(x)";
_y = _su.DecodeBase64(_x);
RDebugUtils.currentLine=196621;
 //BA.debugLineNum = 196621;BA.debugLine="Dim xx As String = Bconv.StringFromBytes(y,\"UTF8\"";
_xx = _bconv.StringFromBytes(_y,"UTF8");
RDebugUtils.currentLine=196625;
 //BA.debugLineNum = 196625;BA.debugLine="iv = \"Q.6qYq0_C+mGmymX\".GetBytes(\"UTF8\")";
_iv = "Q.6qYq0_C+mGmymX".getBytes("UTF8");
RDebugUtils.currentLine=196627;
 //BA.debugLineNum = 196627;BA.debugLine="Dim kg As KeyGenerator";
_kg = new anywheresoftware.b4a.agraham.encryption.CipherWrapper.KeyGeneratorWrapper();
RDebugUtils.currentLine=196628;
 //BA.debugLineNum = 196628;BA.debugLine="Dim c As Cipher";
_c = new anywheresoftware.b4a.agraham.encryption.CipherWrapper();
RDebugUtils.currentLine=196629;
 //BA.debugLineNum = 196629;BA.debugLine="c.Initialize(\"AES/CBC/PKCS5Padding\") ' replace \"D";
_c.Initialize("AES/CBC/PKCS5Padding");
RDebugUtils.currentLine=196632;
 //BA.debugLineNum = 196632;BA.debugLine="c.InitialisationVector = iv";
_c.setInitialisationVector(_iv);
RDebugUtils.currentLine=196633;
 //BA.debugLineNum = 196633;BA.debugLine="kg.Initialize(\"AES\") ' replace \"DES\" with \"AES\" f";
_kg.Initialize("AES");
RDebugUtils.currentLine=196635;
 //BA.debugLineNum = 196635;BA.debugLine="kg.Keyfrombytes(\"3hba8fOumOPrMG0.G?-mkF-scGOkPwyW";
_kg.KeyFromBytes("3hba8fOumOPrMG0.G?-mkF-scGOkPwyW".getBytes("UTF8"));
RDebugUtils.currentLine=196639;
 //BA.debugLineNum = 196639;BA.debugLine="clear = \"3hba8fOumOPrMG0.G?-mkF-scGOkPwyW\"";
_clear = "3hba8fOumOPrMG0.G?-mkF-scGOkPwyW";
RDebugUtils.currentLine=196640;
 //BA.debugLineNum = 196640;BA.debugLine="data = Bconv.StringToBytes(clear, \"UTF8\")";
_data = _bconv.StringToBytes(_clear,"UTF8");
RDebugUtils.currentLine=196641;
 //BA.debugLineNum = 196641;BA.debugLine="data = c.Encrypt(data, kg.Key, True)";
_data = _c.Encrypt(_data,(java.security.Key)(_kg.getKey()),anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=196642;
 //BA.debugLineNum = 196642;BA.debugLine="Log(\"Encoding: \" & Bconv.HexFromBytes(data))";
anywheresoftware.b4a.keywords.Common.LogImpl("1196642","Encoding: "+_bconv.HexFromBytes(_data),0);
RDebugUtils.currentLine=196643;
 //BA.debugLineNum = 196643;BA.debugLine="Msgbox(Bconv.HexFromBytes(data), \"Encrypted is \"";
anywheresoftware.b4a.keywords.Common.Msgbox(BA.ObjectToCharSequence(_bconv.HexFromBytes(_data)),BA.ObjectToCharSequence("Encrypted is "+BA.NumberToString(_data.length)+" bytes"),mostCurrent.activityBA);
RDebugUtils.currentLine=196644;
 //BA.debugLineNum = 196644;BA.debugLine="data = c.Decrypt(data, kg.Key, True)";
_data = _c.Decrypt(_data,(java.security.Key)(_kg.getKey()),anywheresoftware.b4a.keywords.Common.True);
RDebugUtils.currentLine=196645;
 //BA.debugLineNum = 196645;BA.debugLine="Log(\"Decoding: \" & Bconv.StringFromBytes(data, \"U";
anywheresoftware.b4a.keywords.Common.LogImpl("1196645","Decoding: "+_bconv.StringFromBytes(_data,"UTF8"),0);
RDebugUtils.currentLine=196646;
 //BA.debugLineNum = 196646;BA.debugLine="Msgbox(Bconv.StringFromBytes(data, \"UTF8\"), \"Decr";
anywheresoftware.b4a.keywords.Common.Msgbox(BA.ObjectToCharSequence(_bconv.StringFromBytes(_data,"UTF8")),BA.ObjectToCharSequence("Decrypted"),mostCurrent.activityBA);
RDebugUtils.currentLine=196649;
 //BA.debugLineNum = 196649;BA.debugLine="StartActivity(\"Parameter\")";
anywheresoftware.b4a.keywords.Common.StartActivity(processBA,(Object)("Parameter"));
RDebugUtils.currentLine=196650;
 //BA.debugLineNum = 196650;BA.debugLine="End Sub";
return "";
}
public static String  _button1_click() throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(mostCurrent.activityBA, "button1_click", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "button1_click", null));}
RDebugUtils.currentLine=262144;
 //BA.debugLineNum = 262144;BA.debugLine="Private Sub Button1_Click";
RDebugUtils.currentLine=262145;
 //BA.debugLineNum = 262145;BA.debugLine="StartActivity(\"BarcodeScanner\")";
anywheresoftware.b4a.keywords.Common.StartActivity(processBA,(Object)("BarcodeScanner"));
RDebugUtils.currentLine=262147;
 //BA.debugLineNum = 262147;BA.debugLine="End Sub";
return "";
}
public static String  _create_menu(Object _menu) throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(mostCurrent.activityBA, "create_menu", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "create_menu", new Object[] {_menu}));}
RDebugUtils.currentLine=655360;
 //BA.debugLineNum = 655360;BA.debugLine="Sub Create_Menu (Menu As Object)";
RDebugUtils.currentLine=655361;
 //BA.debugLineNum = 655361;BA.debugLine="B4XPages.Delegate.Create_Menu(Menu)";
mostCurrent._b4xpages._delegate /*shub.dpm.b4xpagesdelegator*/ ._create_menu /*String*/ (null,_menu);
RDebugUtils.currentLine=655362;
 //BA.debugLineNum = 655362;BA.debugLine="End Sub";
return "";
}
public static String  _imageview1_click() throws Exception{
RDebugUtils.currentModule="main";
if (Debug.shouldDelegate(mostCurrent.activityBA, "imageview1_click", false))
	 {return ((String) Debug.delegate(mostCurrent.activityBA, "imageview1_click", null));}
RDebugUtils.currentLine=720896;
 //BA.debugLineNum = 720896;BA.debugLine="Private Sub ImageView1_Click";
RDebugUtils.currentLine=720897;
 //BA.debugLineNum = 720897;BA.debugLine="StartActivity(\"About\")";
anywheresoftware.b4a.keywords.Common.StartActivity(processBA,(Object)("About"));
RDebugUtils.currentLine=720898;
 //BA.debugLineNum = 720898;BA.debugLine="End Sub";
return "";
}
public boolean _onCreateOptionsMenu(android.view.Menu menu) {
	 processBA.raiseEvent(null, "create_menu", menu);
	 return true;
	
}
}