Skip to content

Commit

Permalink
android 11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
lapwat committed Jun 4, 2021
1 parent 3898706 commit ca5c0bb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
13 changes: 9 additions & 4 deletions customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,19 @@ create_backup() {
fi
}

ui_print "-- Searching for NFC app in /system/app/ folder..."
ui_print "-- Searching for NFC app in /system/app/ and /system/system_ext/app/ folders..."
set 'NfcNci' 'NQNfcNci' 'NxpNfcNci'
for name do
if [ -d "/system/app/$name" ]; then
APK_NAME="$name"
APK_PATH="/system/app/$APK_NAME/$APK_NAME.apk"
fi
if [ -d "/system/system_ext/app/$name" ]; then
APK_NAME="$name"
APK_PATH="/system/system_ext/app/$APK_NAME/$APK_NAME.apk"
fi
done
[ -z $APK_NAME ] && abort "!! Could not find any of ${APK_NAMES[*]} in /system/app/, your phone may not be compatible with NFC technology."
[ -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."
ui_print "-- $APK_NAME.apk found!"

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

APK_PATH="/system/app/$APK_NAME/$APK_NAME.apk"
# APK_PATH="/system/app/$APK_NAME/$APK_NAME.apk"
APK_DIR="$(dirname $APK_PATH)"
REPLACE="
/system/app/$APK_NAME
$APK_DIR
"
mkdir "$MODPATH/$APK_NAME"

Expand Down
6 changes: 3 additions & 3 deletions module.prop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
id=NFCScreenOff
name=NFC Screen Off
version=v0.3.1
versionCode=31
version=v0.3.2
versionCode=32
author=lapwat
description=Read NFC tags when screen is off.
description=Read NFC tags when screen is off. Disable NFC tagging sound.
12 changes: 9 additions & 3 deletions service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,27 @@ set 'NfcNci' 'NQNfcNci' 'NxpNfcNci'
for name do
if [ -d "/system/app/$name" ]; then
APK_NAME="$name"
APK_PATH="/system/app/$APK_NAME/$APK_NAME.apk"
fi
if [ -d "/system/system_ext/app/$name" ]; then
APK_NAME="$name"
APK_PATH="/system/system_ext/app/$APK_NAME/$APK_NAME.apk"
fi
done

APK_PATH="/system/app/$APK_NAME/$APK_NAME.apk"
# APK_PATH="/system/app/$APK_NAME/$APK_NAME.apk"
APK_DIR="$(dirname $APK_PATH)"

# restore original apk
cp "$MODDIR/${APK_NAME}_bak.apk" "$MODDIR/$APK_NAME/$APK_NAME.apk"
mount --bind "$MODDIR/$APK_NAME" "/system/app/$APK_NAME"
mount --bind "$MODDIR/$APK_NAME" "$APK_DIR"

# wait for nfc service to start
sleep 20

# inject modded apk
cp "$MODDIR/${APK_NAME}_align.apk" "$MODDIR/$APK_NAME/$APK_NAME.apk"
mount --bind "$MODDIR/$APK_NAME" "/system/app/$APK_NAME"
mount --bind "$MODDIR/$APK_NAME" "$APK_DIR"

# restart nfc service
killall com.android.nfc

0 comments on commit ca5c0bb

Please sign in to comment.