File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ MODDIR=${0%/*}
44KPNDIR=" /data/adb/kp-next"
55PATH=" $MODDIR /bin:$PATH "
66CONFIG=" $KPNDIR /package_config"
7+ REHOOK=" $( cat $KPNDIR /rehook) "
78key=" $( cat $KPNDIR /key | base64 -d) "
89
910if [ -z " $key " ] || [ -z " $( kpatch $key hello) " ]; then
@@ -16,6 +17,8 @@ for kpm in $KPNDIR/kpm/*.kpm; do
1617 kpatch " $key " kpm load " $kpm " || rm -f " $kpm "
1718done
1819
20+ [ -n " $REHOOK " ] && [ " $REHOOK " -ge 0 ] && [ " $REHOOK " -le 2 ] && kpatch " $key " rehook $REHOOK
21+
1922until [ " $( getprop sys.boot_completed) " = " 1" ]; do
2023 sleep 1
2124done
Original file line number Diff line number Diff line change @@ -131,7 +131,10 @@ async function updateRehookStatus() {
131131}
132132
133133function setRehookMode ( mode ) {
134- exec ( `kpatch ${ escapeShell ( superkey ) } rehook ${ mode } ` , { env : { PATH : `${ modDir } /bin` } } ) . then ( ( result ) => {
134+ exec ( `
135+ kpatch ${ escapeShell ( superkey ) } rehook ${ mode } && echo ${ mode } > ${ persistDir } /rehook` ,
136+ { env : { PATH : `${ modDir } /bin:$PATH` } }
137+ ) . then ( ( result ) => {
135138 if ( result . errno !== 0 ) {
136139 toast ( getString ( 'msg_error' , result . stderr ) ) ;
137140 return ;
You can’t perform that action at this time.
0 commit comments