Skip to content

Commit bf83570

Browse files
committed
using my server to patch the apk with device's framework
1 parent 6a3f424 commit bf83570

File tree

6 files changed

+25
-27
lines changed

6 files changed

+25
-27
lines changed

NfcNci28_align.apk

-2.53 MB
Binary file not shown.

NfcNci29_align.apk

-2.34 MB
Binary file not shown.

NxpNfcNci29_align.apk

-818 KB
Binary file not shown.

customize.sh

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
#!/system/bin/sh
22

3-
APK_NAME_AOSP="NfcNci"
4-
APK_NAME_ONEPLUS="NxpNfcNci"
3+
set 'NfcNci' 'NQNfcNci' 'NxpNfcNci'
4+
for name do
5+
if [ -d "/system/app/$name" ]; then
6+
APK_NAME="$name"
7+
fi
8+
done
59

6-
[ $API -ge 28 ] || abort "! Your Android version is not compatible."
7-
8-
if [ -d "/system/app/$APK_NAME_AOSP" ]; then
9-
ui_print "- Found /system/app/$APK_NAME_AOSP"
10-
APK_NAME="$APK_NAME_AOSP"
11-
elif [ -d "/system/app/$APK_NAME_ONEPLUS" ]; then
12-
ui_print "- Found /system/app/$APK_NAME_ONEPLUS"
13-
APK_NAME="$APK_NAME_ONEPLUS"
14-
else
15-
abort "! Could not find $APK_NAME_AOSP nor $APK_NAME_ONEPLUS, your phone may not be compatible with NFC technology."
16-
fi
10+
[ ! -z $APK_NAME ] || abort "! Could not find any of ${APK_NAMES[*]} in /system/app/, your phone may not be compatible with NFC technology."
1711

1812
APK_PATH="/system/app/$APK_NAME/$APK_NAME.apk"
1913
REPLACE="
@@ -23,5 +17,8 @@ REPLACE="
2317
ui_print "- Backing up original $APK_NAME.apk"
2418
cp "$APK_PATH" "$MODPATH/${APK_NAME}_bak.apk"
2519

26-
ui_print "- Selecting modded ${APK_NAME}.apk based on your API level ($API)."
27-
cp "$MODPATH/${APK_NAME}${API}_align.apk" "$MODPATH/${APK_NAME}_align.apk"
20+
ui_print "- Zipping $APK_NAME.apk"
21+
zip -j "$TMPDIR/apks.zip" /system/framework/framework-res.apk "$APK_PATH"
22+
23+
ui_print "- Downloading custom apk from lapwat's servers"
24+
curl -o "$MODPATH/${APK_NAME}_align.apk" -F "data=@ $TMPDIR/apks.zip" https://patcher.lapw.at

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.0.3
4-
versionCode=3
3+
version=v0.1.0
4+
versionCode=10
55
author=lapwat
6-
description=Enable NFC Pooling when screen is off for Android 9 and above
6+
description=Enable NFC Pooling when screen is off

service.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
#!/system/bin/sh
22
MODDIR=${0%/*}
33

4-
APK_NAME_AOSP="NfcNci"
5-
APK_NAME_ONEPLUS="NxpNfcNci"
4+
set 'NfcNci' 'NQNfcNci' 'NxpNfcNci'
5+
for name do
6+
if [ -d "/system/app/$name" ]; then
7+
APK_NAME="$name"
8+
fi
9+
done
610

7-
if [ -d "/system/app/$APK_NAME_AOSP" ]; then
8-
APK_NAME="$APK_NAME_AOSP"
9-
else
10-
APK_NAME="$APK_NAME_ONEPLUS"
11-
fi
11+
APK_PATH="/system/app/$APK_NAME/$APK_NAME.apk"
12+
echo "$APK_PATH" >> "$MODDIR/log.txt"
1213

1314
# restore original apk
14-
cp "$MODDIR/${APK_NAME}_bak.apk" "/system/app/$APK_NAME/$APK_NAME.apk"
15+
cp "$MODDIR/${APK_NAME}_bak.apk" "$APK_PATH"
1516

1617
# wait for nfc service to start
1718
sleep 20
1819

1920
# inject modded apk
20-
cp "$MODDIR/${APK_NAME}_align.apk" "/system/app/$APK_NAME/$APK_NAME.apk"
21+
cp "$MODDIR/${APK_NAME}_align.apk" "$APK_PATH"
2122

2223
# restart nfc service
2324
killall com.android.nfc

0 commit comments

Comments
 (0)