Skip to content
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

[MM-62491] Removing exported receivers. #8466

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ index afc578c..c8c32e3 100644
filter.addAction(FOREGROUND_SERVICE_BUTTON_PRESSED);
- getReactApplicationContext().registerReceiver(foregroundReceiver, filter);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ getReactApplicationContext().registerReceiver(foregroundReceiver, filter, Context.RECEIVER_EXPORTED);
+ getReactApplicationContext().registerReceiver(foregroundReceiver, filter, Context.RECEIVER_NOT_EXPORTED);
+ } else {
+ getReactApplicationContext().registerReceiver(foregroundReceiver, filter);
+ getReactApplicationContext().registerReceiver(foregroundReceiver, filter, null, handler, ContextCompat.RECEIVER_NOT_EXPORTED);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build does not like how this is exported. Need to see how to do this for older android versions since the vulnerability report suggested this but it's failing.

 > Task :voximplant_react-native-foreground-service:compileReleaseJavaWithJavac FAILED
/home/runner/work/mattermost-mobile/mattermost-mobile/node_modules/@voximplant/react-native-foreground-service/android/src/main/java/com/voximplant/foregroundservice/VIForegroundServiceModule.java:116: error: cannot find symbol
            getReactApplicationContext().registerReceiver(foregroundReceiver, filter, null, handler, ContextCompat.RECEIVER_NOT_EXPORTED);
                                                                                            ^
  symbol:   variable handler
  location: class VIForegroundServiceModule
/home/runner/work/mattermost-mobile/mattermost-mobile/node_modules/@voximplant/react-native-foreground-service/android/src/main/java/com/voximplant/foregroundservice/VIForegroundServiceModule.java:116: error: cannot find symbol
            getReactApplicationContext().registerReceiver(foregroundReceiver, filter, null, handler, ContextCompat.RECEIVER_NOT_EXPORTED);

+ }

if (componentName != null) {
Expand Down
Loading