File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,3 +10,6 @@ mkdir -p /data/adb/kp-next
1010if [ -f " /data/adb/ap/package_config" ] && [ ! -f " /data/adb/kp-next/package_config" ]; then
1111 cp " /data/adb/ap/package_config" /data/adb/kp-next/package_config
1212fi
13+
14+ # backup module.prop
15+ cp " $MODPATH /module.prop" " $MODPATH /module.prop.bak"
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #! /system/bin/sh
2+
3+ MODDIR=${0%/* }
4+ SERVICE_D=" /data/adb/service.d"
5+ STATUS_SH=" $SERVICE_D /kp-next.sh"
6+
7+ if [ ! -d " $SERVICE_D " ] || [ ! -f " $STATUS_SH " ]; then
8+ mkdir -p " $SERVICE_D "
9+ cp " $MODDIR /status.sh" " $STATUS_SH "
10+ chmod 755 " $STATUS_SH "
11+ fi
Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ PATH="$MODDIR/bin:$PATH"
66CONFIG=" $KPNDIR /package_config"
77key=" $( cat $KPNDIR /key | base64 -d) "
88
9- nohup sh " $MODDIR /status.sh" " $key " &
10-
119if [ -z " $key " ] || [ -z " $( kpatch $key hello) " ]; then
1210 touch " $MODDIR /unresolved"
1311 exit 0
Original file line number Diff line number Diff line change 11#! /bin/sh
22
3- MODDIR=${0 %/* }
3+ MODDIR=" /data/adb/modules/KPatch-Next "
44KPNDIR=" /data/adb/kp-next"
55PATH=" $MODDIR /bin:$PATH "
66key=" $1 "
77
88PROP_FILE=" $MODDIR /module.prop"
9- PROP_BAK=" $MODDIR /module.prop .bak"
9+ PROP_BAK=" $PROP_FILE .bak"
1010
1111set_prop () {
1212 local prop=" $1 "
@@ -23,13 +23,16 @@ set_prop() {
2323}
2424
2525restore_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
26+ grep -q " ^id=" " $PROP_FILE " && return
27+ [ -f " $PROP_BAK " ] && cat " $PROP_BAK " > " $PROP_FILE "
3128}
3229
30+ # self cleanup if module removed improperly
31+ if [ ! -d " $MODDIR " ]; then
32+ rm -f " $( realpath " $0 " ) "
33+ exit 0
34+ fi
35+
3336active=" Status: active 😊"
3437inactive=" Status: inactive 😕"
3538info=" info: key incorrect, not set or kernel not patched yet ❌"
Original file line number Diff line number Diff line change 1- rm -rf /data/adb/kp-next
1+ rm -rf /data/adb/kp-next /data/adb/service.d/kp-next.sh
Original file line number Diff line number Diff line change @@ -64,17 +64,16 @@ function updateBtnState(value) {
6464 document . getElementById ( 'start' ) . disabled = ! value ;
6565}
6666
67- export function initInfo ( ) {
68- return exec ( 'uname -r && getprop ro.build.version.release && getprop ro.build.fingerprint && getenforce' ) . then ( ( result ) => {
69- if ( import . meta. env . DEV ) { // vite debug
70- result . stdout = '6.18.2-linux\n16\nLinuxPC\nEnforcing'
71- }
72- const info = result . stdout . trim ( ) . split ( '\n' ) ;
73- document . getElementById ( 'kernel-release' ) . textContent = info [ 0 ] ;
74- document . getElementById ( 'system' ) . textContent = info [ 1 ] ;
75- document . getElementById ( 'fingerprint' ) . textContent = info [ 2 ] ;
76- document . getElementById ( 'selinux' ) . textContent = info [ 3 ] ;
77- } ) ;
67+ export async function initInfo ( ) {
68+ const result = await exec ( 'uname -r && getprop ro.build.version.release && getprop ro.build.fingerprint && getenforce' ) ;
69+ if ( import . meta. env . DEV ) { // vite debug
70+ result . stdout = '6.18.2-linux\n16\nLinuxPC\nEnforcing' ;
71+ }
72+ const info = result . stdout . trim ( ) . split ( '\n' ) ;
73+ document . getElementById ( 'kernel-release' ) . textContent = info [ 0 ] ;
74+ document . getElementById ( 'system' ) . textContent = info [ 1 ] ;
75+ document . getElementById ( 'fingerprint' ) . textContent = info [ 2 ] ;
76+ document . getElementById ( 'selinux' ) . textContent = info [ 3 ] ;
7877}
7978
8079async function reboot ( reason = "" ) {
You can’t perform that action at this time.
0 commit comments