Download examples/bluetooth/react-native/plugins/withAndroid16KbPageSize.js from Anirudh1950/MentraOS: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/Anirudh1950/MentraOS/resolve/main/examples/bluetooth/react-native/plugins/withAndroid16KbPageSize.js
- Command line
-
hf download hf://Anirudh1950/MentraOS/examples/bluetooth/react-native/plugins/withAndroid16KbPageSize.js
-
curl -L -o withAndroid16KbPageSize.js https://huggingface.co/Anirudh1950/MentraOS/resolve/main/examples/bluetooth/react-native/plugins/withAndroid16KbPageSize.js
1.27 kB
| const { withGradleProperties, withProjectBuildGradle } = require("expo/config-plugins"); | |
| const CONFIG_BLOCK = ` | |
| // Keep release APK native libraries compatible with Android's 16 KB page-size devices. | |
| subprojects { subproject -> | |
| subproject.plugins.withId("com.android.library") { | |
| if (subproject.name == "lc3Lib") { | |
| subproject.android.defaultConfig.externalNativeBuild.cmake.arguments( | |
| "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON" | |
| ) | |
| } | |
| } | |
| } | |
| `; | |
| module.exports = function withAndroid16KbPageSize(config) { | |
| config = withGradleProperties(config, (gradleConfig) => { | |
| const property = gradleConfig.modResults.find( | |
| (item) => item.type === "property" && item.key === "reactNativeArchitectures" | |
| ); | |
| if (property) { | |
| property.value = "arm64-v8a,x86_64"; | |
| } else { | |
| gradleConfig.modResults.push({ | |
| type: "property", | |
| key: "reactNativeArchitectures", | |
| value: "arm64-v8a,x86_64", | |
| }); | |
| } | |
| return gradleConfig; | |
| }); | |
| return withProjectBuildGradle(config, (gradleConfig) => { | |
| if (!gradleConfig.modResults.contents.includes(CONFIG_BLOCK.trim())) { | |
| gradleConfig.modResults.contents += CONFIG_BLOCK; | |
| } | |
| return gradleConfig; | |
| }); | |
| }; | |