File tree Expand file tree Collapse file tree 6 files changed +25
-27
lines changed Expand file tree Collapse file tree 6 files changed +25
-27
lines changed Original file line number Diff line number Diff line change 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
1812APK_PATH=" /system/app/$APK_NAME /$APK_NAME .apk"
1913REPLACE="
@@ -23,5 +17,8 @@ REPLACE="
2317ui_print " - Backing up original $APK_NAME .apk"
2418cp " $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
Original file line number Diff line number Diff line change 11id=NFCScreenOff
22name=NFC Screen Off
3- version=v0.0.3
4- versionCode=3
3+ version=v0.1.0
4+ versionCode=10
55author=lapwat
6- description=Enable NFC Pooling when screen is off for Android 9 and above
6+ description=Enable NFC Pooling when screen is off
Original file line number Diff line number Diff line change 11#! /system/bin/sh
22MODDIR=${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
1718sleep 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
2324killall com.android.nfc
You can’t perform that action at this time.
0 commit comments