Files
paseo/packages/app/plugins/with-android-optional-camera.js
T
paseo-bot[bot] b63a325be3 Let Android devices without a camera install Paseo from Google Play (#6339)
* 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>
2026-10-10 09:54:15 +02:00

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;