Пример #1
0
        public void PWOFF(object sender, EventArgs args)
        {
            Secure2Key.writeIsPWOn(-1);
            String saveData = Secure2Key.getEncData();

            Settings.Data = saveData;
        }
Пример #2
0
        public void ReleaseTask()
        {
            String resultAsyncTask;

            resultAsyncTask = Secure2Key.pc_registerDeviceChange(userID, userPW, StaticValues.reqNumber);



            if (resultAsyncTask.Contains("FAIL"))
            {
                DisplayAlert("Error", "Please try again", "OK");
            }
            else
            {
                String resultValue = "";
                try
                {
                    var returnJSON = JsonConvert.SerializeObject(new { type = "resultAsyncTask" }, Formatting.None);
                }
                catch (JsonException e)
                {
                }

                if (resultValue.Contains("OKAY"))
                {
                    //dialogSingleAndNext("다시 로그인 해주세요");
                    DisplayAlert("Success", "Initialization Completed. Enter your ID and Password to use the app normally.", "OK");
                }
                else
                {
                    DisplayAlert("Error", "Please try again", "OK");
                }
            }
        }
Пример #3
0
		public MainActivity()
		{
			  MqttClient client;
			  string brokerURL = "tcp://68.71.11.18:1883";
			System.ip
			string clientId = "";
			MqttSslUtility.
			              client = new MqttClient(brokerURL,;

			DeviceUuidFactory uuidFactory = new DeviceUuidFactory();
			String uuidString = ID.getID();
			if ((uuidString != null) && (0 < uuidString.Length))
			{
				if ((StaticValues.UUID != null) && !(0 < StaticValues.UUID.Length))
				{
					StaticValues.UUID = uuidString;
				}
			}

			Secure2Key.clearInternalData();
			Secure2Key.enterUUID(StaticValues.UUID);

			String encData = Settings.Data;

			if (0 < encData.Length)
			{
				Secure2Key.refreshData(encData);
			}

			loginCheck();
 		 

		}
Пример #4
0
        public void FindPW(object sender, EventArgs args)
        {
            userID    = IDEntry.Text;
            userEmail = EmailEntry.Text;

            //if (userID.Length < 4 || userEmail.Length <= 0)
            //{
            //	DisplayAlert("ID Error", "The ID or Password you entered is invalid", "OK");
            //	return;
            //}
            //if (!EmailIsValid(userEmail))
            //{
            //	DisplayAlert("Email Error", "The email you entered is invalid", "OK");
            //	return;
            //}
            byte[] emailBytes = Encoding.UTF8.GetBytes(userEmail);
            String hexedEmail = bytesToHex(emailBytes);
            String result     = Secure2Key.pc_requestTempPassword(userID, StaticValues.reqNumber, hexedEmail);

            //IntPtr test = Secure2Key.pc_requestTempPassword(userID, StaticValues.reqNumber, hexedEmail);
            Debug.WriteLine(result);
            //String TaskResult = result.ToString();
            //Debug.WriteLine(TaskResult);
            //var ver = Secure2Key.test();
            //String test = ver.ToString();
            //Debug.WriteLine(ver);
        }
Пример #5
0
        private void TaskLogin()
        {
            String resultLoginAsyncTask;

            loginResult = Secure2Key.authLogin(idValue, pwValue);



            idValue = null;
            pwValue = null;



            if (loginResult != null)
            {
                if (loginResult.Equals("OKAY"))
                {
                    resultOkay();
                }
                else if (loginResult.Equals("NR"))
                {
                    DisplayAlert("Error", "ID is unregistered", "OK");
                }
                else if (loginResult.Equals("NA"))
                {
                    DisplayAlert("Error", "ID is not available", "OK");
                }
                else if (loginResult.Equals("EX"))
                {
                    DisplayAlert("Error", "Login Error", "OK");
                }
                else if (loginResult.Equals("ES"))
                {
                    DisplayAlert("Error", "Login Error", "OK");
                }
                else if (loginResult.Equals("FAIL_l"))
                {
                    DisplayAlert("Error", "Login Error", "OK");
                }
                else if (loginResult.Equals("FAIL_s"))
                {
                    DisplayAlert("Error", "Login Error", "OK");
                }
                else if (loginResult.Equals("PW"))
                {
                    DisplayAlert("Error", "Incorrect Password", "OK");
                }
                else if (loginResult.Equals("AR"))
                {
                    //					dialogSingle("이미 사용중인 아이디입니다.");
                    DisplayAlert("Error", "ID is already in use, please press the reset button below. This is to protect the end user", "OK");
                }
                else
                {
                    DisplayAlert("Error", "Login Error", "OK");
                }
            }
        }
Пример #6
0
        private void registerOkay()
        {
            /////////////////////////////////////
            Secure2Key.writePassword("0000");
            String saveData = Secure2Key.getEncData();

            Settings.Data = saveData;
            String state = "ON";

            Settings.Vibration = state;
            Settings.Sound     = state;
            /////////////////////////////////////

            DisplayAlert("Notice", "Defalut App Password is 0000.", "OK");
        }
Пример #7
0
        //	private   BroadcastReceiver mHandleMessageReceiver = new BroadcastReceiver()
        //	{
        //		@Override
        //	public void onReceive(Context context, Intent intent)
        //	{
        //		String msg = intent.getExtras().getString("msg");

        //		if (msg.equals("continue"))
        //		{
        //			nextActivity();
        //		}
        //		else
        //		{
        //			dialogSingle("Fail_P");
        //		}
        //	}
        //};


        private void ConfirmService()
        {
            String resultRegisterConfirmAsync;

            resultRegisterConfirmAsync = Secure2Key.authRegisterConfirm();
            if (resultRegisterConfirmAsync.Equals("OKAY"))
            {
                registerOkay();
            }
            else
            {
                DisplayAlert("Error", "Please Try Again", "OK");
            }

            return;
        }
Пример #8
0
        private void makeSession()
        {
            String resultString;

            resultString = Secure2Key.makeSignSession();
            if (resultString.Contains("FINISH"))
            {
                registerDevice();
            }
            else
            {
                DisplayAlert("Error", "Registration Error", "OK");
            }

            return;
        }
Пример #9
0
        private void registerDevice()
        {
            String resultRegisterDeviceAsync;

            resultRegisterDeviceAsync = Secure2Key.authDeviceRegister(StaticValues.RegistrationId);


            if (resultRegisterDeviceAsync.Equals("OKAY"))
            {
                // wait continue push
            }
            else
            {
                DisplayAlert("Error", "Registration Error", "OK");
            }

            return;
        }
Пример #10
0
		private void loginCheck()
		{
			//SharedPreferences pref = getSharedPreferences(StaticValues.Info,MODE_PRIVATE);
			//String logResult = pref.getString(StaticValues.LogResult, "");
			//String registerResult = pref.getString(StaticValues.RegisterResult, "");
			//System.out.println("loginCheck() in MainActivity if 이전에 -----> "+logResult + " " + registerResult);


			String registerResult = Secure2Key.isAvailable();

			//		System.out.println("registerResult in MainActivity 는 " + registerResult);

			if (registerResult != null)
			{
				if (registerResult.Equals("OKAY"))
				{
					 
				}else{
 
 				}
			}
		}
Пример #11
0
        private void SignUpTask()
        {
            String resultAsyncTask;

            String tempEmail = enter_email + "@" + enter_emailCompany;

            byte[] emailBytes = Encoding.UTF8.GetBytes(tempEmail);
            String hexedEmail = bytesToHex(emailBytes);

            resultAsyncTask = Secure2Key.pc_registerDeviceAndUserInfo(enter_id, enter_pw, StaticValues.reqNumber, hexedEmail, agree, StaticValues.RegistrationId);


            if (resultAsyncTask.Contains("FAIL"))
            {
                DisplayAlert("Error", "Please Try Again", "OK");
            }
            else
            {
                if (resultAsyncTask.CompareTo("OKAY") == 0)
                {
                    makeSession();
                }
                else if (resultAsyncTask.CompareTo("AR") == 0)
                {
                    DisplayAlert("Error", "ID is alrady in use", "OK");
                }
                else if (resultAsyncTask.CompareTo("FAIL") == 0)
                {
                    DisplayAlert("Error", "Registration Error", "OK");
                }
                else
                {
                    DisplayAlert("Error", "Registration Error", "OK");
                }
            }
        }