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

[MM-62491] Removing exported receivers. #8466

wants to merge 2 commits into from

Conversation

coltoneshaw
Copy link
Member

Summary

Mattermost Calls does not need to have the receiver exported. This is disabling that export and securing the use of these to just the Mattermost app.

Ticket Link

https://mattermost.atlassian.net/browse/MM-62491

Checklist

  • Added or updated unit tests (required for all new features)
  • Has UI changes
  • Includes text changes and localization file updates
  • Have tested against the 5 core themes to ensure consistency between them.
  • Have run E2E tests by adding label E2E iOS tests for PR.

Device Information

Has not been tested yet, pending an external pipeline where I can test this.

Release Note


@coltoneshaw coltoneshaw added the Build Apps for PR Build the mobile app for iOS and Android to test label Jan 9, 2025
@coltoneshaw coltoneshaw requested a review from cpoile January 10, 2025 14:26
+ } 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);

Choose a reason for hiding this comment

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

The PDF says this line is for Android 12 or lower. Android 12 would be Build.VERSION_CODES.S_V2

Build.VERSION_CODES.O which you specified is Android 8

Choose a reason for hiding this comment

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

Looking back at the code though i think you want >= Build.VERSION_CODES.TIRAMISU (which would be Android 13 and up)

@coltoneshaw coltoneshaw added Build Apps for PR Build the mobile app for iOS and Android to test and removed Build Apps for PR Build the mobile app for iOS and Android to test labels Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Apps for PR Build the mobile app for iOS and Android to test release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants