mirror of
https://github.com/bitwarden/android.git
synced 2026-04-28 03:48:14 -05:00
[BWA-10] Handle exception when checking for suspicious intents (#228)
This commit is contained in:
@@ -7,7 +7,13 @@ import android.content.Intent
|
||||
*/
|
||||
val Intent.isSuspicious: Boolean
|
||||
get() {
|
||||
val containsSuspiciousExtras = extras?.isEmpty?.not() ?: false
|
||||
val containsSuspiciousData = data != null
|
||||
return containsSuspiciousData || containsSuspiciousExtras
|
||||
return try {
|
||||
val containsSuspiciousExtras = extras?.isEmpty() == false
|
||||
val containsSuspiciousData = data != null
|
||||
containsSuspiciousData || containsSuspiciousExtras
|
||||
} catch (_: Exception) {
|
||||
// `unparcel()` throws an exception on Android 12 and below if the bundle contains
|
||||
// suspicious data, so we catch the exception and return true.
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user