Browse Source

Merged with kftc_keypad

master
preyearegmi 6 years ago
parent
commit
98400dbecc
  1. 30
      app/src/main/java/com/gmeremit/online/gmeremittance_native/changepasswordV2/view/ChangePasswordV2Activity.java
  2. 82
      app/src/main/java/com/gmeremit/online/gmeremittance_native/registerV2/view/RegisterV2Activity.java
  3. 5
      app/src/main/java/com/gmeremit/online/gmeremittance_native/transactionpasspromt/TransactionPasswordPromptActivity.java
  4. 47
      app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/security/securitykeypad/SecurityKeypadRequestParamBuilder.java

30
app/src/main/java/com/gmeremit/online/gmeremittance_native/changepasswordV2/view/ChangePasswordV2Activity.java

@ -287,6 +287,7 @@ public class ChangePasswordV2Activity extends BaseActivity implements ChangePass
@Override
public void onSecurityViewRecievedFocus() {
hideKeyboardFromRemainingWidget();
if (securityKeyboardCurrentPasswordManager != null && !securityKeyboardCurrentPasswordManager.isKeyboardVisible()) {
hideKeyBoard();
securityKeyboardCurrentPasswordManager.showKeyboard();
@ -304,6 +305,15 @@ public class ChangePasswordV2Activity extends BaseActivity implements ChangePass
else
hideKeyBoard();
}
//In some cases remaining keyboard widget may still be focusable as our layout can be scrolled for which the on screen location of remaining widget may be false
private void hideKeyboardFromRemainingWidget()
{
if(securityKeyboardNewPasswordManager!=null&&securityKeyboardNewPasswordManager.isKeyboardVisible())
securityKeyboardNewPasswordManager.hideKeyboard();
if(securityKeyboardConfirmPasswordManager!=null&&securityKeyboardConfirmPasswordManager.isKeyboardVisible())
securityKeyboardConfirmPasswordManager.hideKeyboard();
}
}
class SecurityKeypadNewPasswordListener implements SecurityKeyboardManager.SecurityKeyboardActionListenerFacade,SecurityKeyboardView.SecurityKeyboardFocusStateListener {
@Override
@ -348,6 +358,7 @@ public class ChangePasswordV2Activity extends BaseActivity implements ChangePass
@Override
public void onSecurityViewRecievedFocus() {
hideKeyboardFromRemainingWidget();
if (securityKeyboardNewPasswordManager != null && !securityKeyboardNewPasswordManager.isKeyboardVisible()) {
hideKeyBoard();
securityKeyboardNewPasswordManager.showKeyboard();
@ -366,6 +377,15 @@ public class ChangePasswordV2Activity extends BaseActivity implements ChangePass
else
hideKeyBoard();
}
//In some cases remaining keyboard widget may still be focusable as our layout can be scrolled for which the on screen location of remaining widget may be false
private void hideKeyboardFromRemainingWidget()
{
if(securityKeyboardCurrentPasswordManager!=null&&securityKeyboardCurrentPasswordManager.isKeyboardVisible())
securityKeyboardCurrentPasswordManager.hideKeyboard();
if(securityKeyboardConfirmPasswordManager!=null&&securityKeyboardConfirmPasswordManager.isKeyboardVisible())
securityKeyboardConfirmPasswordManager.hideKeyboard();
}
}
class SecurityKeypadConfirmPasswordListener implements SecurityKeyboardManager.SecurityKeyboardActionListenerFacade,SecurityKeyboardView.SecurityKeyboardFocusStateListener {
@Override
@ -410,6 +430,7 @@ public class ChangePasswordV2Activity extends BaseActivity implements ChangePass
@Override
public void onSecurityViewRecievedFocus() {
hideKeyboardFromRemainingWidget();
if (securityKeyboardConfirmPasswordManager != null && !securityKeyboardConfirmPasswordManager.isKeyboardVisible()) {
hideKeyBoard();
securityKeyboardConfirmPasswordManager.showKeyboard();
@ -427,5 +448,14 @@ public class ChangePasswordV2Activity extends BaseActivity implements ChangePass
else
hideKeyBoard();
}
//In some cases remaining keyboard widget may still be focusable as our layout can be scrolled for which the on screen location of remaining widget may be false
private void hideKeyboardFromRemainingWidget()
{
if(securityKeyboardCurrentPasswordManager!=null&&securityKeyboardCurrentPasswordManager.isKeyboardVisible())
securityKeyboardCurrentPasswordManager.hideKeyboard();
if(securityKeyboardNewPasswordManager!=null&&securityKeyboardNewPasswordManager.isKeyboardVisible())
securityKeyboardNewPasswordManager.hideKeyboard();
}
}
}

82
app/src/main/java/com/gmeremit/online/gmeremittance_native/registerV2/view/RegisterV2Activity.java

@ -119,7 +119,7 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen
dobContainerOnClickGestureDetector = new RegisterDobClickGestureDetector();
dobConatinerClickGestureDetector = new GestureDetectorCompat(this, dobContainerOnClickGestureDetector);
securityKeyboardPasswordListener=new SecurityKeypadPasswordListener();
securityKeyboardPasswordListener = new SecurityKeypadPasswordListener();
securityKeyboardPasswordView.setKeyboardContainerView(keypadContainer);
securityKeyboardPasswordView.setKeyboardBallonView(ballonView);
try {
@ -141,7 +141,7 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen
Log.d("GMESecurityKeyboard", e.getMessage());
}
securityKeyboardConfirmPasswordListener=new SecurityKeypadConfirmPasswordListener();
securityKeyboardConfirmPasswordListener = new SecurityKeypadConfirmPasswordListener();
securityKeyboardConfirmPasswordView.setKeyboardContainerView(keypadContainer);
securityKeyboardConfirmPasswordView.setKeyboardBallonView(ballonView);
try {
@ -192,7 +192,7 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
return (securityKeyboardPasswordView.checkIfTouchIntersectKeypadLayout(ev)||securityKeyboardConfirmPasswordView.checkIfTouchIntersectKeypadLayout(ev)||dobConatinerClickGestureDetector.onTouchEvent(ev)|| super.dispatchTouchEvent(ev));
return (securityKeyboardPasswordView.checkIfTouchIntersectKeypadLayout(ev) || securityKeyboardConfirmPasswordView.checkIfTouchIntersectKeypadLayout(ev) || dobConatinerClickGestureDetector.onTouchEvent(ev) || super.dispatchTouchEvent(ev));
}
@ -283,6 +283,15 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen
return false;
}
@Override
public void onBackPressed() {
if (securityKeyboardPasswordManager != null && securityKeyboardPasswordManager.isKeyboardVisible())
securityKeyboardPasswordManager.hideKeyboard();
else if (securityKeyboardConfirmPasswordManager != null && securityKeyboardConfirmPasswordManager.isKeyboardVisible())
securityKeyboardConfirmPasswordManager.hideKeyboard();
else
super.onBackPressed();
}
class RegisterDobClickGestureDetector extends GestureDetector.SimpleOnGestureListener {
@Override
@ -315,20 +324,23 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen
}
class SecurityKeypadPasswordListener implements SecurityKeyboardManager.SecurityKeyboardActionListenerFacade,SecurityKeyboardView.SecurityKeyboardFocusStateListener {
class SecurityKeypadPasswordListener implements SecurityKeyboardManager.SecurityKeyboardActionListenerFacade, SecurityKeyboardView.SecurityKeyboardFocusStateListener {
@Override
public void done(Intent intent) {
presenter.updatePassword(intent.getStringExtra(TransKeyActivity.mTK_PARAM_CIPHER_DATA),getDecryptedDataFromIntent(intent));
String encryptedText = intent.getStringExtra(TransKeyActivity.mTK_PARAM_SECURE_DATA);
Log.d("RegisterScreen", encryptedText);
presenter.updatePassword(intent.getStringExtra(encryptedText), getDecryptedDataFromIntent(intent));
}
@Override
public void cancel(Intent intent) {
presenter.updatePassword(intent.getStringExtra(TransKeyActivity.mTK_PARAM_CIPHER_DATA),getDecryptedDataFromIntent(intent));
String encryptedText = intent.getStringExtra(TransKeyActivity.mTK_PARAM_SECURE_DATA);
Log.d("RegisterScreen", encryptedText);
presenter.updatePassword(encryptedText, getDecryptedDataFromIntent(intent));
}
private String getDecryptedDataFromIntent(Intent intent)
{
private String getDecryptedDataFromIntent(Intent intent) {
if (intent == null)
return "";
@ -336,8 +348,8 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen
byte[] secureKey = intent.getByteArrayExtra(TransKeyActivity.mTK_PARAM_SECURE_KEY);
int iRealDataLength = intent.getIntExtra(TransKeyActivity.mTK_PARAM_DATA_LENGTH, 0);
Log.d("EncryptedData",cipherData);
return EncryptionManager.decryptCipherText(cipherData,secureKey,iRealDataLength);
Log.d("EncryptedData", cipherData);
return EncryptionManager.decryptCipherText(cipherData, secureKey, iRealDataLength);
}
@ -358,12 +370,13 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen
@Override
public void onSecurityViewRecievedFocus() {
hideKeyboardFromRemainingWidget();
if (securityKeyboardPasswordManager != null && !securityKeyboardPasswordManager.isKeyboardVisible()) {
hideKeyBoard();
securityKeyboardPasswordManager.showKeyboard();
scrollView.postDelayed(()->{
scrollView.postDelayed(() -> {
scrollView.smoothScrollTo(0, passwordTextView.getTop());
},250);
}, 250);
}
}
@ -372,27 +385,37 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen
public void onSecurityViewLostFocus() {
if (securityKeyboardPasswordManager != null && securityKeyboardPasswordManager.isKeyboardVisible()) {
securityKeyboardPasswordManager.hideKeyboard();
Log.d("RegisterScreen","PasswordKeyboard Hide");
}
else
Log.d("RegisterScreen", "PasswordKeyboard Hide");
} else
hideKeyBoard();
}
//In some cases remaining keyboard widget may still be focusable as our layout can be scrolled for which the on screen location of remaining widget may be false
private void hideKeyboardFromRemainingWidget() {
if (securityKeyboardConfirmPasswordManager != null && securityKeyboardConfirmPasswordManager.isKeyboardVisible())
securityKeyboardConfirmPasswordManager.hideKeyboard();
}
class SecurityKeypadConfirmPasswordListener implements SecurityKeyboardManager.SecurityKeyboardActionListenerFacade,SecurityKeyboardView.SecurityKeyboardFocusStateListener {
}
class SecurityKeypadConfirmPasswordListener implements SecurityKeyboardManager.SecurityKeyboardActionListenerFacade, SecurityKeyboardView.SecurityKeyboardFocusStateListener {
@Override
public void done(Intent intent) {
presenter.updateConfirmPassword(intent.getStringExtra(TransKeyActivity.mTK_PARAM_CIPHER_DATA),getDecryptedDataFromIntent(intent));
String encryptedText = intent.getStringExtra(TransKeyActivity.mTK_PARAM_SECURE_DATA);
Log.d("RegisterScreen", encryptedText);
presenter.updateConfirmPassword(encryptedText, getDecryptedDataFromIntent(intent));
}
@Override
public void cancel(Intent intent) {
presenter.updateConfirmPassword(intent.getStringExtra(TransKeyActivity.mTK_PARAM_CIPHER_DATA),getDecryptedDataFromIntent(intent));
String encryptedText = intent.getStringExtra(TransKeyActivity.mTK_PARAM_SECURE_DATA);
Log.d("RegisterScreen", encryptedText);
presenter.updateConfirmPassword(encryptedText, getDecryptedDataFromIntent(intent));
}
private String getDecryptedDataFromIntent(Intent intent)
{
private String getDecryptedDataFromIntent(Intent intent) {
if (intent == null)
return "";
@ -400,8 +423,7 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen
byte[] secureKey = intent.getByteArrayExtra(TransKeyActivity.mTK_PARAM_SECURE_KEY);
int iRealDataLength = intent.getIntExtra(TransKeyActivity.mTK_PARAM_DATA_LENGTH, 0);
Log.d("EncryptedData",cipherData);
return EncryptionManager.decryptCipherText(cipherData,secureKey,iRealDataLength);
return EncryptionManager.decryptCipherText(cipherData, secureKey, iRealDataLength);
}
@ -422,13 +444,14 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen
@Override
public void onSecurityViewRecievedFocus() {
hideKeyboardFromRemainingWidget();
if (securityKeyboardConfirmPasswordManager != null && !securityKeyboardConfirmPasswordManager.isKeyboardVisible()) {
hideKeyBoard();
securityKeyboardConfirmPasswordManager.showKeyboard();
scrollView.postDelayed(()->{
scrollView.postDelayed(() -> {
scrollView.smoothScrollTo(0, confirmPasswordTextView.getTop());
},250);
}, 250);
}
}
@ -437,10 +460,15 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen
public void onSecurityViewLostFocus() {
if (securityKeyboardConfirmPasswordManager != null && securityKeyboardConfirmPasswordManager.isKeyboardVisible()) {
securityKeyboardConfirmPasswordManager.hideKeyboard();
Log.d("RegisterScreen","PasswordConfirmKeyboard Hide");
}
else
Log.d("RegisterScreen", "PasswordConfirmKeyboard Hide");
} else
hideKeyBoard();
}
//In some cases remaining keyboard widget may still be focusable as our layout can be scrolled for which the on screen location of remaining widget may be false
private void hideKeyboardFromRemainingWidget() {
if (securityKeyboardPasswordManager != null && securityKeyboardPasswordManager.isKeyboardVisible())
securityKeyboardPasswordManager.hideKeyboard();
}
}
}

5
app/src/main/java/com/gmeremit/online/gmeremittance_native/transactionpasspromt/TransactionPasswordPromptActivity.java

@ -160,7 +160,10 @@ public class TransactionPasswordPromptActivity extends BaseActivity implements S
class SecurityKeypadListener implements SecurityKeyboardManager.SecurityKeyboardActionListenerFacade {
@Override
public void done(Intent intent) {
String encData=intent.getStringExtra(TransKeyActivity.mTK_PARAM_CIPHER_DATA);
// String encData=intent.getStringExtra(TransKeyActivity.mTK_PARAM_CIPHER_DATA);
String encData=intent.getStringExtra(TransKeyActivity.mTK_PARAM_SECURE_DATA);
Log.d("PasswordPrompt",encData);
String decData=getDecryptedDataFromIntent(intent);
if(validateStringNotEmpty(decData)) {
passwordErrorTxt.setErrorText(null);

47
app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/security/securitykeypad/SecurityKeypadRequestParamBuilder.java

@ -96,12 +96,6 @@ public class SecurityKeypadRequestParamBuilder
Intent newIntent = new Intent(context,
TransKeyActivity.class);
//public static final int mTK_TYPE_KEYPAD_NUMBER //숫자전용
//public static final int mTK_TYPE_KEYPAD_QWERTY_LOWER //소문자 쿼티
//public static final int mTK_TYPE_KEYPAD_QWERTY_UPPER //대문자 쿼티
//public static final int mTK_TYPE_KEYPAD_ABCD_LOWER //소문자 순열자판
//public static final int mTK_TYPE_KEYPAD_ABCD_UPPER //대문자 순열자판
//public static final int mTK_TYPE_KEYPAD_SYMBOL //심벌자판
newIntent.putExtra(TransKeyActivity.mTK_PARAM_KEYPAD_TYPE, keyPadType);
@ -125,11 +119,9 @@ public class SecurityKeypadRequestParamBuilder
newIntent.putExtra(TransKeyActivity.mTK_PARAM_USE_TOAST_MIN_ALERT , false);
newIntent.putExtra(TransKeyActivity.mTK_PARAM_USE_TOAST_MAX_ALERT,false);
//newIntent.putExtra(TransKeyActivity.mTK_PARAM_USE_CUSTOM_MAX_ALERT , false);
//newIntent.putExtra(TransKeyActivity.mTK_PARAM_USE_CUSTOM_MIN_ALERT,false);
//--> SERVER 연동테스트
newIntent.putExtra(TransKeyActivity.mTK_PARAM_CRYPT_TYPE, TransKeyActivity.mTK_TYPE_CRYPT_SERVER);
newIntent.putExtra(TransKeyActivity.mTK_PARAM_CRYPT_TYPE, TransKeyActivity.mTK_TYPE_CRYPT_LOCAL);
newIntent.putExtra(TransKeyActivity.mTK_PARAM_SECURE_KEY, secureKey);
//<-- SERVER 연동테스트
@ -152,11 +144,6 @@ public class SecurityKeypadRequestParamBuilder
//심볼 변환 버튼을 비활성화 시킬 경우 팝업 메시지를 설정한다.
newIntent.putExtra(TransKeyActivity.mTK_PARAM_DISABLE_SYMBOL_MESSAGE, "심볼키는 사용할 수 없습니다.");
//////////////////////////////////////////////////////////////////////////////
//인터페이스 - line3 padding 설정 가능 인자. 기본은 0 값이면 아무 설정 안했을 원래 transkey에서 제공하던 값을 제공한다..
// newIntent.putExtra(TransKeyActivity.mTK_PARAM_KEYPAD_MARGIN, line3Padding);
// newIntent.putExtra(TransKeyActivity.mTK_PARAM_KEYPAD_LEFT_RIGHT_MARGIN, 0);
// newIntent.putExtra(TransKeyActivity.mTK_PARAM_KEYPAD_HIGHEST_TOP_MARGIN, 2);
newIntent.putExtra(TransKeyActivity.mTK_PARAM_USE_TALKBACK, true);
newIntent.putExtra(TransKeyActivity.mTK_PARAM_SUPPORT_ACCESSIBILITY_SPEAK_PASSWORD, true);
@ -169,52 +156,22 @@ public class SecurityKeypadRequestParamBuilder
newIntent.putExtra(TransKeyActivity.mTK_PARAM_NUMPAD_USE_CANCEL_BUTTON, true);
//
// String originalPassword = "acc4af609fad57f1cd870a5d94092a24be5fd974";
// byte[] pbkdfKey = toByteArray(originalPassword);
// byte[] PBKDF2_SALT = {1, 6, 0, 7, 4, 4, 4, 4, 8, 8, 7, 1, 4, 3, 3, 3, 3, 3, 3, 3};
// int PBKDF2_IT = 512;
//
// newIntent.putExtra(TransKeyActivity. mTK_PARAM_PBKDF2_RANDKEY, pbkdfKey);
// newIntent.putExtra(TransKeyActivity. mTK_PARAM_PBKDF2_SALT, PBKDF2_SALT);
// newIntent.putExtra(TransKeyActivity. mTK_PARAM_PBKDF2_IT, PBKDF2_IT);
newIntent.putExtra(TransKeyActivity.mTK_PARAM_MIN_LENGTH_MESSAGE, "최소 글자 2글자 미만입니다");
newIntent.putExtra(TransKeyActivity.mTK_PARAM_INPUT_MINLENGTH, 0);
newIntent.putExtra(TransKeyActivity.mTK_PARAM_ALERTDIALOG_TITLE, "mTranskey alert");
// newIntent.putExtra(TransKeyActivity.mTK_PARAM_QWERTY_BUTTON_MARGIN, 1f);
newIntent.putExtra(TransKeyActivity.mTK_PARAM_NUMBER_BUTTON_MARGIN, 0.44f);
// 드래그기능을 막고 최초 터치값으로 입력되도록 설정
// newIntent.putExtra(TransKeyActivity.mTK_PARAM_DISABLE_DRAG_EVENT, true);
// 심볼키패드에서 불필요한 더미화
newIntent.putExtra(TransKeyActivity.mTK_PARAM_CUSTOM_DUMMY_STRING, "%$<>&()\"'");
// 순차적인 더미 이미지 다르게 표현하기위한 옵션
// newIntent.putExtra(TransKeyActivity.mTK_PARAM_USE_CUSTOM_DUMMY, true);
// 커서를 이미지로 사용하는 옵션
// newIntent.putExtra(TransKeyActivity.mTK_PARAM_USE_CUSTOM_CURSOR, true);
// 비대칭키 사용시 공개키 설정하는 옵션
// newIntent.putExtra(TransKeyActivity.mTK_PARAM_RSA_PUBLICK_KEY, publicKey);
// 쿼티 자판 높이 설정
// newIntent.putExtra(TransKeyActivity.mTK_PARAM_QWERTY_HEIGHT, (float)1.5);
// 넘버 자판 높이 설정
// newIntent.putExtra(TransKeyActivity.mTK_PARAM_NUMBER_HEIGHT, (float)0.5);
// 오토포커싱 설정
newIntent.putExtra(TransKeyActivity.mTK_PARAM_USE_AUTO_FOCUSING, isUseAutoFocusing);
//시프트옵션
newIntent.putExtra(TransKeyActivity.mTK_PARAM_USE_SHIFT_OPTION, false);
//라이센스 적용
// newIntent.putExtra(TransKeyActivity.mTK_PARAM_LICENSE_FILE_NAME, "license_mtk_20181105_20991231");
newIntent.putExtra(TransKeyActivity.mTK_PARAM_LICENSE_FILE_NAME, "license_IBK_TEST_IONEBANK_20181105_20190531");
newIntent.putExtra(TransKeyActivity.mTK_PARAM_LANGUAGE, TransKeyActivity. mTK_Language_English);

Loading…
Cancel
Save