-
Notifications
You must be signed in to change notification settings - Fork 312
Update libraries and fix crashes #1733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
a2dd907
29f865a
b93a823
1c532e8
170b5c1
891f3db
849c77a
28c7b25
22fefde
175490c
fbf7b21
8c792b4
2589709
9229a7a
6f51438
e9447a5
7a4fb34
daae06d
3616f1a
0448e63
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| package org.wordpress.passcodelock; | ||
|
|
||
| import android.annotation.SuppressLint; | ||
| import android.app.Activity; | ||
| import android.content.pm.ActivityInfo; | ||
| import android.os.Bundle; | ||
|
|
@@ -24,9 +25,11 @@ public abstract class AbstractPasscodeKeyboardActivity extends Activity { | |
| protected InputFilter[] filters = null; | ||
| protected TextView topMessage = null; | ||
|
|
||
| @SuppressLint("RestrictedApi") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added this to avoid linter complaining for now, but tracking separately here #1734 |
||
| protected FingerprintManagerCompat mFingerprintManager; | ||
| protected CancellationSignal mCancel; | ||
|
|
||
| @SuppressLint("RestrictedApi") | ||
| @Override | ||
| protected void onCreate(Bundle savedInstanceState) { | ||
| super.onCreate(savedInstanceState); | ||
|
|
@@ -36,21 +39,21 @@ protected void onCreate(Bundle savedInstanceState) { | |
| } | ||
|
|
||
| setContentView(R.layout.app_passcode_keyboard); | ||
|
|
||
| topMessage = (TextView) findViewById(R.id.passcodelock_prompt); | ||
|
|
||
| Bundle extras = getIntent().getExtras(); | ||
| if (extras != null) { | ||
| String message = extras.getString(KEY_MESSAGE); | ||
| if (message != null) { | ||
| topMessage.setText(message); | ||
| } | ||
| } | ||
|
|
||
| filters = new InputFilter[2]; | ||
| filters[0]= new InputFilter.LengthFilter(1); | ||
| filters[1] = onlyNumber; | ||
|
|
||
| mPinCodeField = (EditText)findViewById(R.id.pin_field); | ||
|
|
||
| //setup the keyboard | ||
|
|
@@ -158,8 +161,9 @@ public void run() { | |
| protected void showPasswordError(){ | ||
| Toast.makeText(AbstractPasscodeKeyboardActivity.this, R.string.passcode_wrong_passcode, Toast.LENGTH_SHORT).show(); | ||
| } | ||
|
|
||
| protected abstract void onPinLockInserted(); | ||
| @SuppressLint("RestrictedApi") | ||
| protected abstract FingerprintManagerCompat.AuthenticationCallback getFingerprintCallback(); | ||
|
|
||
| private InputFilter onlyNumber = new InputFilter() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,8 +27,13 @@ class DeepLinkActivity : AppCompatActivity() { | |
| startActivity(intent) | ||
| } | ||
| VERIFIED_WEB_SCHEME -> { | ||
| // New MagicLink | ||
| startMagicLinkConfirmation(uri) | ||
| // Check if this is a password reset URL | ||
| if (uri.path?.contains("/account/") == true && uri.path?.contains("/reset") == true) { | ||
ParaskP7 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| handlePasswordReset(uri) | ||
| } else { | ||
| // New MagicLink | ||
| startMagicLinkConfirmation(uri) | ||
| } | ||
| } | ||
| LOGIN_SCHEME -> { | ||
| if (queryParamContainsData(uri.query, USERNAME_KEY_QUERY) && queryParamContainsData(uri.query, AUTH_CODE_QUERY)) { | ||
|
|
@@ -88,6 +93,21 @@ class DeepLinkActivity : AppCompatActivity() { | |
| } | ||
| } | ||
|
|
||
| private fun handlePasswordReset(uri: Uri) { | ||
| val redirectParam = uri.getQueryParameter("redirect") | ||
| if (redirectParam == "simplenote://launch") { | ||
|
||
| // Handle the redirect to launch the app | ||
| val intent = IntentUtils.maybeAliasedIntent(applicationContext) | ||
| intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK) | ||
| startActivity(intent) | ||
| } else { | ||
| // Default behavior for reset URLs without redirect | ||
| val intent = IntentUtils.maybeAliasedIntent(applicationContext) | ||
| intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK) | ||
| startActivity(intent) | ||
| } | ||
| } | ||
|
|
||
| private fun queryParamContainsData(path: String?, otherString: String) : Boolean = path?.contains(otherString, true) == true | ||
|
|
||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.