-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Android 14 update #2894
Android 14 update #2894
Changes from 12 commits
241b9a8
b93b72e
000fef6
e8879bc
5f83b76
88760e3
569476d
124f9f1
65a8b2a
476f0dd
ecee832
ef25be8
641857f
0e86fb6
38a4dc9
26eb7c3
86ef226
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 |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
import android.content.Intent; | ||
import android.content.IntentFilter; | ||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import android.os.Build; | ||
import android.util.Log; | ||
|
||
import org.commcare.activities.DispatchActivity; | ||
|
@@ -52,7 +54,11 @@ public static boolean handleSessionExpiration(AppCompatActivity activity) { | |
} | ||
|
||
public static void registerSessionExpirationReceiver(AppCompatActivity activity) { | ||
activity.registerReceiver(userSessionExpiredReceiver, expirationFilter); | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||
activity.registerReceiver(userSessionExpiredReceiver, expirationFilter, Context.RECEIVER_NOT_EXPORTED); | ||
} else { | ||
activity.registerReceiver(userSessionExpiredReceiver, expirationFilter); | ||
} | ||
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. 💡 Codebase verification Broadcast receiver security improvements needed in several files The verification revealed additional broadcast receiver registrations that need security improvements:
🔗 Analysis chainLGTM! Secure broadcast receiver registration implemented correctly. The conditional registration of the session expiration receiver with Let's verify that all broadcast receiver registrations in the codebase follow this pattern: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check for potentially insecure broadcast receiver registrations
# Look for registerReceiver calls that might need the RECEIVER_NOT_EXPORTED flag
# Search for registerReceiver calls without RECEIVER_NOT_EXPORTED
rg "registerReceiver\([^,]+,[^,]+" -A 2
Length of output: 2983 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. @avazirna can you verify this please. 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.
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. I pushed a fix in commit 38a4dc9, please review it. |
||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="org.commcare.commcaresupportlibrary" /> | ||
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. Think we should be bumping the Android sdk version in support lib |
||
<manifest /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should either add a qa note to test clearning of notifications or test it out ourselves and mention it in safety story of the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this and it worked fine, I will add a note to the PR.