File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ id=KPatch-Next
2+ name=KPatch-Next
3+ version=v0.0.1
4+ versionCode=1
5+ author=rifsxd, KOWX712
6+ description=Standalone implementation of KPM support for Magisk/KernelSU
7+ updateJson=https://raw.githubusercontent.com/KernelSU-Next/KPatch-Next-Module/main/update.json
8+ banner=banner.png
Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ KPNDIR="/data/adb/kp-next"
55PATH=" $MODDIR /bin:$PATH "
66key=" $1 "
77
8+ PROP_FILE=" $MODDIR /module.prop"
9+ PROP_BAK=" $MODDIR /module.prop.bak"
10+
811set_prop () {
912 local prop=" $1 "
1013 local value=" $2 "
@@ -19,6 +22,14 @@ set_prop() {
1922 rm -f " $file .tmp"
2023}
2124
25+ restore_prop_if_needed () {
26+ if ! grep -q " ^id=" " $PROP_FILE " ; then
27+ if [ -f " $PROP_BAK " ]; then
28+ cp " $PROP_BAK " " $PROP_FILE "
29+ fi
30+ fi
31+ }
32+
2233active=" Status: active 😊"
2334inactive=" Status: inactive 😕"
2435info=" info: key incorrect, not set or kernel not patched yet ❌"
@@ -36,4 +47,6 @@ if [ -n "$key" ] && kpatch "$key" hello >/dev/null 2>&1; then
3647 string=" $active | kpmodule: $KPM_COUNT 💉"
3748fi
3849
39- set_prop " description" " $string " " $MODDIR /module.prop"
50+ restore_prop_if_needed
51+
52+ set_prop " description" " $string " " $PROP_FILE "
You can’t perform that action at this time.
0 commit comments