chore: build V2
Frontend Admin - EAS Build / build (push) Successful in 1h41m39s

This commit is contained in:
Xor290
2026-11-07 16:32:48 +01:00
parent 2ea9499de8
commit 8ce3a0d38b
3 changed files with 27 additions and 74 deletions
@@ -0,0 +1,26 @@
const { withMainActivity } = require("expo/config-plugins");
const CALL =
"if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) setRecentsScreenshotEnabled(false)";
// Masque l'écran dans les apps récentes sans bloquer les captures (Android 13+).
module.exports = (config) =>
withMainActivity(config, (cfg) => {
let src = cfg.modResults.contents;
if (cfg.modResults.language !== "kt") {
throw new Error("withRecentsProtection: MainActivity Kotlin attendue");
}
if (src.includes("setRecentsScreenshotEnabled")) return cfg;
const superOnCreate = /^(\s*)super\.onCreate\([^)]*\)[ \t]*;?[ \t]*$/m;
if (!superOnCreate.test(src)) {
throw new Error("withRecentsProtection: super.onCreate introuvable");
}
src = src.replace(superOnCreate, (m, indent) => `${m}\n${indent}${CALL}`);
if (!src.includes("import android.os.Build\n")) {
src = src.replace(/^(package .+\n)/m, `$1\nimport android.os.Build\n`);
}
cfg.modResults.contents = src;
return cfg;
});