mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 18:19:43 +00:00
Update
This commit is contained in:
1 parent
4c18afaeae
commit
785e73d6c0
19 files changed
+3808
-4748
No files matched your search
@@ -0,0 +1,31 @@
|
||||
const { withAndroidManifest } = require('expo/config-plugins');
|
||||
|
||||
/**
|
||||
* Fixes react-native-android-widget setting android:exported="false" on widget receivers.
|
||||
* Widget receivers MUST be exported so the launcher can send APPWIDGET_UPDATE broadcasts.
|
||||
*
|
||||
* Uses withAndroidManifest's dangerous modifier priority to run after all other plugins.
|
||||
*/
|
||||
module.exports = function withWidgetExported(config) {
|
||||
return withAndroidManifest(config, (config) => {
|
||||
const mainApplication =
|
||||
config.modResults.manifest.application?.[0];
|
||||
if (!mainApplication?.receiver) return config;
|
||||
|
||||
for (const receiver of mainApplication.receiver) {
|
||||
const intentFilters = receiver['intent-filter'] ?? [];
|
||||
const isWidget = intentFilters.some((filter) =>
|
||||
filter.action?.some(
|
||||
(a) =>
|
||||
a.$?.['android:name'] ===
|
||||
'android.appwidget.action.APPWIDGET_UPDATE'
|
||||
)
|
||||
);
|
||||
if (isWidget) {
|
||||
receiver.$['android:exported'] = 'true';
|
||||
}
|
||||
}
|
||||
|
||||
return config;
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user