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+ KPNDIR=" /data/adb/kp-next"
5+ PATH=" $MODDIR /bin:$PATH "
6+ key=" $1 "
7+
8+ set_prop () {
9+ local prop=" $1 "
10+ local value=" $2 "
11+ local file=" $3 "
12+
13+ if ! grep -q " ^$prop =" " $file " ; then
14+ echo " $prop =$value " >> " $file "
15+ return
16+ fi
17+ sed " s/^$prop =.*/$prop =$value /" " $file " > " $file .tmp"
18+ cat " $file .tmp" > " $file "
19+ rm -f " $file .tmp"
20+ }
21+
22+ active=" Status: active 😊"
23+ inactive=" Status: inactive 😕"
24+ info=" info: key incorrect, not set or kernel not patched yet ❌"
25+ string=" $inactive | $info "
26+
27+ [ -z " $key " ] && key=" $( cat $KPNDIR /key | base64 -d) "
28+
29+ until [ " $( getprop sys.boot_completed) " = " 1" ]; do
30+ sleep 1
31+ done
32+
33+ if [ -n " $key " ] && kpatch " $key " hello > /dev/null 2>&1 ; then
34+ KPM_COUNT=" $( kpatch " $key " kpm num 2> /dev/null || echo 0) "
35+ [ -z " $KPM_COUNT " ] && KPM_COUNT=0
36+ string=" $active | kpmodule: $KPM_COUNT 💉"
37+ fi
38+
39+ set_prop " description" " $string " " $MODDIR /module.prop"
Original file line number Diff line number Diff line change @@ -42,7 +42,10 @@ async function getKpmList() {
4242 ] ;
4343 }
4444
45- const listResult = await exec ( `kpatch ${ superkey } kpm list` , { env : { PATH : `${ modDir } /bin` } } ) ;
45+ const listResult = await exec (
46+ `kpatch ${ superkey } kpm list && sh "${ modDir } /status.sh" "${ superkey } "` ,
47+ { env : { PATH : `${ modDir } /bin:$PATH` } }
48+ ) ;
4649 const modules = listResult . stdout . trim ( ) . split ( '\n' ) . filter ( line => line . trim ( ) ) ;
4750
4851 const modulePromises = modules . map ( async ( moduleName ) => {
You can’t perform that action at this time.
0 commit comments