File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,12 +5,8 @@ KPNDIR="/data/adb/kp-next"
55PATH=" $MODDIR /bin:$PATH "
66CONFIG=" $KPNDIR /package_config"
77key=" $( cat $KPNDIR /key | base64 -d) "
8- active=" Status: active 😊"
9- inactive=" Status: inactive 😕"
10- info=" info: key incorrect, not set or kernel not patched yet ❌"
11- string=" description=$inactive | $info "
128
13- sed -i " s/^description=.*/ $string / " " $MODDIR /module.prop "
9+ sh " $MODDIR /status.sh " " $key "
1410
1511if [ -z " $key " ] || [ -z " $( kpatch $key hello) " ]; then
1612 touch " $MODDIR /unresolved"
@@ -37,10 +33,3 @@ tail -n +2 "$CONFIG" | while IFS=, read -r pkg exclude allow uid; do
3733 [ -n " $UID " ] && kpatch " $key " exclude_set " $UID " 1
3834 fi
3935done
40-
41- if [ -n " $key " ] && kpatch " $key " hello > /dev/null 2>&1 ; then
42- KPM_COUNT=" $( kpatch " $key " kpm num 2> /dev/null || echo 0) "
43- [ -z " $KPM_COUNT " ] && KPM_COUNT=0
44- string=" description=$active | kpmodule: $KPM_COUNT 💉"
45- sed -i " s/^description=.*/$string /" " $MODDIR /module.prop"
46- fi
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ MODDIR=${0%/* }
4+ key=" $1 "
5+
6+ set_prop () {
7+ local prop=" $1 "
8+ local value=" $2 "
9+ local file=" $3 "
10+
11+ if ! grep -q " ^$prop =" " $file " ; then
12+ echo " $prop =$value " >> " $file "
13+ return
14+ fi
15+ sed " s/^$prop =.*/$prop =$value /" " $file " > " $file .tmp"
16+ cat " $file .tmp" > " $file "
17+ rm -f " $file .tmp"
18+ }
19+
20+ active=" Status: active 😊"
21+ inactive=" Status: inactive 😕"
22+ info=" info: key incorrect, not set or kernel not patched yet ❌"
23+ string=" $inactive | $info "
24+
25+ until [ " $( getprop sys.boot_completed) " = " 1" ]; do
26+ sleep 1
27+ done
28+
29+ if [ -n " $key " ] && kpatch " $key " hello > /dev/null 2>&1 ; then
30+ KPM_COUNT=" $( kpatch " $key " kpm num 2> /dev/null || echo 0) "
31+ [ -z " $KPM_COUNT " ] && KPM_COUNT=0
32+ string=" $active | kpmodule: $KPM_COUNT 💉"
33+ fi
34+
35+ set_prop " description" " $string " " $MODDIR /module.prop"
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ async function unloadModule(moduleName) {
7878}
7979
8080async function loadModule ( modulePath ) {
81- const result = await exec ( `kpatch ${ superkey } kpm load "${ modulePath } "` , { env : { PATH : `${ modDir } /bin` } } ) ;
81+ const result = await exec ( `kpatch ${ superkey } kpm load "${ modulePath } " && sh " ${ modDir } /status.sh" " ${ superkey } " ` , { env : { PATH : `${ modDir } /bin` } } ) ;
8282 return result . errno === 0 ;
8383}
8484
You can’t perform that action at this time.
0 commit comments