Skip to content

Commit ca5c0bb

Browse files
committed
android 11 support
1 parent 3898706 commit ca5c0bb

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

customize.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,19 @@ create_backup() {
2323
fi
2424
}
2525

26-
ui_print "-- Searching for NFC app in /system/app/ folder..."
26+
ui_print "-- Searching for NFC app in /system/app/ and /system/system_ext/app/ folders..."
2727
set 'NfcNci' 'NQNfcNci' 'NxpNfcNci'
2828
for name do
2929
if [ -d "/system/app/$name" ]; then
3030
APK_NAME="$name"
31+
APK_PATH="/system/app/$APK_NAME/$APK_NAME.apk"
32+
fi
33+
if [ -d "/system/system_ext/app/$name" ]; then
34+
APK_NAME="$name"
35+
APK_PATH="/system/system_ext/app/$APK_NAME/$APK_NAME.apk"
3136
fi
3237
done
33-
[ -z $APK_NAME ] && abort "!! Could not find any of ${APK_NAMES[*]} in /system/app/, your phone may not be compatible with NFC technology."
38+
[ -z $APK_NAME ] && abort "!! Could not find any of ${APK_NAMES[*]} in /system/app/ or /system/system_ext/app/, your phone may not be compatible with NFC technology."
3439
ui_print "-- $APK_NAME.apk found!"
3540

3641
# save device infos
@@ -48,10 +53,10 @@ ui_print '-- Device info --'
4853
ui_print "$(cat $MODPATH/.env)"
4954
ui_print '-----------------'
5055

51-
APK_PATH="/system/app/$APK_NAME/$APK_NAME.apk"
56+
# APK_PATH="/system/app/$APK_NAME/$APK_NAME.apk"
5257
APK_DIR="$(dirname $APK_PATH)"
5358
REPLACE="
54-
/system/app/$APK_NAME
59+
$APK_DIR
5560
"
5661
mkdir "$MODPATH/$APK_NAME"
5762

module.prop

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
id=NFCScreenOff
22
name=NFC Screen Off
3-
version=v0.3.1
4-
versionCode=31
3+
version=v0.3.2
4+
versionCode=32
55
author=lapwat
6-
description=Read NFC tags when screen is off.
6+
description=Read NFC tags when screen is off. Disable NFC tagging sound.

service.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,27 @@ set 'NfcNci' 'NQNfcNci' 'NxpNfcNci'
55
for name do
66
if [ -d "/system/app/$name" ]; then
77
APK_NAME="$name"
8+
APK_PATH="/system/app/$APK_NAME/$APK_NAME.apk"
9+
fi
10+
if [ -d "/system/system_ext/app/$name" ]; then
11+
APK_NAME="$name"
12+
APK_PATH="/system/system_ext/app/$APK_NAME/$APK_NAME.apk"
813
fi
914
done
1015

11-
APK_PATH="/system/app/$APK_NAME/$APK_NAME.apk"
16+
# APK_PATH="/system/app/$APK_NAME/$APK_NAME.apk"
17+
APK_DIR="$(dirname $APK_PATH)"
1218

1319
# restore original apk
1420
cp "$MODDIR/${APK_NAME}_bak.apk" "$MODDIR/$APK_NAME/$APK_NAME.apk"
15-
mount --bind "$MODDIR/$APK_NAME" "/system/app/$APK_NAME"
21+
mount --bind "$MODDIR/$APK_NAME" "$APK_DIR"
1622

1723
# wait for nfc service to start
1824
sleep 20
1925

2026
# inject modded apk
2127
cp "$MODDIR/${APK_NAME}_align.apk" "$MODDIR/$APK_NAME/$APK_NAME.apk"
22-
mount --bind "$MODDIR/$APK_NAME" "/system/app/$APK_NAME"
28+
mount --bind "$MODDIR/$APK_NAME" "$APK_DIR"
2329

2430
# restart nfc service
2531
killall com.android.nfc

0 commit comments

Comments
 (0)