From 502da49e786d088369ee1fea822df898c38eeef7 Mon Sep 17 00:00:00 2001 From: AndroPlus-org Date: Mon, 13 Feb 2023 22:54:43 +0900 Subject: [PATCH] Fix NFC on Xiaomi MIUI 14 (Android 13) --- post-fs-data.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/post-fs-data.sh b/post-fs-data.sh index 3fa27aa..881cec3 100644 --- a/post-fs-data.sh +++ b/post-fs-data.sh @@ -24,4 +24,16 @@ maybe_set_prop gsm.sim.operator.numeric "," "44011,44011" maybe_set_prop gsm.sim.operator.iso-country "," "jp,jp" # Change to MIUI Global (but less features) -# resetprop ro.product.mod_device "$(getprop "ro.product.mod_device")_global" \ No newline at end of file +# resetprop ro.product.mod_device "$(getprop "ro.product.mod_device")_global" + +# Fix NFC on Xiaomi MIUI 14 (Android 13) +lastVersion=$(getprop ro.build.version.incremental) +lastVersionFilePath=$MODDIR/lastVersion +productDirPath=$MODDIR/system/product +if [ -d "/system/product/pangu/system" ] ; then + if [ ! -f $lastVersionFilePath ] || [ ! -d "$productDirPath" ] || [ $(cat $lastVersionFilePath) != $lastVersion ] ; then + mkdir -p ${productDirPath} + cp -p -a -R /system/product/pangu/system/* ${productDirPath} + echo "$lastVersion" >$lastVersionFilePath + fi +fi \ No newline at end of file