File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,15 +47,15 @@ echo "- Unpacking boot image"
4747magiskboot unpack " $BOOTIMAGE " > /dev/null 2>&1
4848 if [ $? -ne 0 ]; then
4949 >&2 echo " - Unpack error: $? "
50- exit $?
50+ exit 1
5151 fi
5252fi
5353
5454if [ ! $( kptools -i kernel -f | grep CONFIG_KALLSYMS=y) ]; then
5555 echo " - Patcher has Aborted!"
5656 echo " - APatch requires CONFIG_KALLSYMS to be Enabled."
5757 echo " - But your kernel seems NOT enabled it."
58- exit 0
58+ exit 1
5959fi
6060
6161if [ $( kptools -i kernel -l | grep patched=false) ]; then
7474
7575if [ $patch_rc -ne 0 ]; then
7676 >&2 echo " - Patch kernel error: $patch_rc "
77- exit $?
77+ exit 1
7878fi
7979
8080echo " - Repacking boot image"
8888
8989if [ $? -ne 0 ]; then
9090 >&2 echo " - Repack error: $? "
91- exit $?
91+ exit 1
9292fi
9393
9494if [ " $FLASH_TO_DEVICE " = " true" ]; then
@@ -98,7 +98,7 @@ if [ "$FLASH_TO_DEVICE" = "true" ]; then
9898 flash_image new-boot.img " $BOOTIMAGE "
9999 if [ $? -ne 0 ]; then
100100 >&2 echo " - Flash error: $? "
101- exit $?
101+ exit 1
102102 fi
103103 fi
104104
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ echo "- Unpacking boot image"
2929magiskboot unpack " $BOOTIMAGE " > /dev/null 2>&1
3030if [ $? -ne 0 ]; then
3131 >&2 echo " - Unpack error: $? "
32- exit $?
32+ exit 1
3333 fi
3434fi
3535
@@ -43,13 +43,13 @@ if [ ! $(kptools -i kernel -l | grep patched=false) ]; then
4343 kptools -u --image kernel.ori --out kernel
4444 if [ $? -ne 0 ]; then
4545 >&2 echo " - Unpatch error: $? "
46- exit $?
46+ exit 1
4747 fi
4848 echo " - Repacking boot image"
4949 magiskboot repack " $BOOTIMAGE " > /dev/null 2>&1
5050 if [ $? -ne 0 ]; then
5151 >&2 echo " - Repack error: $? "
52- exit $?
52+ exit 1
5353 fi
5454 fi
5555
@@ -64,7 +64,7 @@ if [ -f "new-boot.img" ]; then
6464
6565 if [ $? -ne 0 ]; then
6666 >&2 echo " - Flash error: $? "
67- exit $?
67+ exit 1
6868 fi
6969fi
7070
Original file line number Diff line number Diff line change @@ -324,6 +324,11 @@ async function embedKPM() {
324324function patch ( type ) {
325325 const superkeyVal = document . querySelector ( '#superkey md-outlined-text-field' ) . value ;
326326 const terminal = document . querySelector ( '#patch-terminal' ) ;
327+ const pageContent = terminal . closest ( '.page-content' ) ;
328+ const onOutput = ( data ) => {
329+ terminal . innerHTML += `<div>${ data } </div>` ;
330+ pageContent . scrollTo ( { top : pageContent . scrollHeight , behavior : 'smooth' } ) ;
331+ } ;
327332
328333 if ( ! bootDev ) {
329334 terminal . textContent = 'Error: No boot image found.' ;
@@ -359,21 +364,17 @@ function patch(type) {
359364 args . push ( `${ modDir } /boot_unpatch.sh` , bootDev ) ;
360365 }
361366
362- const process = spawn ( `busybox` , args ,
367+ const process = spawn (
368+ `busybox` ,
369+ args ,
363370 {
364371 cwd : `${ modDir } /tmp` ,
365372 env : {
366373 PATH : `${ modDir } /bin:/data/adb/ksu/bin:/data/adb/magisk:$PATH` ,
367374 ASH_STANDALONE : '1'
368375 }
369- } ) ;
370-
371- const pageContent = terminal . closest ( '.page-content' ) ;
372- const onOutput = ( data ) => {
373- terminal . innerHTML += `<div>${ data } </div>` ;
374- pageContent . scrollTo ( { top : pageContent . scrollHeight , behavior : 'smooth' } ) ;
375- } ;
376-
376+ }
377+ ) ;
377378 process . stdout . on ( 'data' , onOutput ) ;
378379 process . stderr . on ( 'data' , onOutput ) ;
379380 process . on ( 'exit' , ( code ) => {
You can’t perform that action at this time.
0 commit comments