mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-14 13:22:37 +00:00
* fix(android): declare the camera optional so camera-less devices can install Requesting CAMERA makes Android treat android.hardware.camera as a required feature, so Google Play marks devices without a camera as incompatible. Pairing works without QR scanning, so declare the camera features optional. Fixes #6303 * test(app): resolve the manifest with the Expo CLI's prebuild packages Load @expo/prebuild-config and @expo/config-plugins from @expo/cli instead of the older hoisted copies, and set the F-Droid flag explicitly for each build profile case. --------- Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
25 lines
970 B
JavaScript
25 lines
970 B
JavaScript
const { withAndroidManifest } = require("expo/config-plugins");
|
|
|
|
// Requesting CAMERA implies these features are required, which hides the app
|
|
// on Google Play for devices without a camera. Pairing works without QR scanning.
|
|
const OPTIONAL_CAMERA_FEATURES = ["android.hardware.camera", "android.hardware.camera.autofocus"];
|
|
|
|
function withAndroidOptionalCamera(config) {
|
|
return withAndroidManifest(config, (modConfig) => {
|
|
const manifest = modConfig.modResults.manifest;
|
|
const features = manifest["uses-feature"] ?? [];
|
|
for (const name of OPTIONAL_CAMERA_FEATURES) {
|
|
const existing = features.find((feature) => feature.$["android:name"] === name);
|
|
if (existing) {
|
|
existing.$["android:required"] = "false";
|
|
} else {
|
|
features.push({ $: { "android:name": name, "android:required": "false" } });
|
|
}
|
|
}
|
|
manifest["uses-feature"] = features;
|
|
return modConfig;
|
|
});
|
|
}
|
|
|
|
module.exports = withAndroidOptionalCamera;
|