-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathservice.sh
More file actions
31 lines (25 loc) · 777 Bytes
/
service.sh
File metadata and controls
31 lines (25 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/system/bin/sh
MODDIR=${0%/*}
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_DIR="$(dirname $APK_PATH)"
# restore original apk
cp "$MODDIR/${APK_NAME}_bak.apk" "$MODDIR/$APK_NAME/$APK_NAME.apk"
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" "$APK_DIR"
# restart nfc service
killall com.android.nfc