11import { linkRedirect , basePath , showPrompt } from './main.js' ;
22import { getString } from './language.js' ;
3- import { spawn } from 'kernelsu-alt' ;
3+ import { spawn , exec } from 'kernelsu-alt' ;
44
55const aboutDialog = document . getElementById ( 'about-dialog' ) ;
66const closeAbout = document . getElementById ( 'close-about' ) ;
@@ -135,17 +135,24 @@ function downloadUpdate(link) {
135135 */
136136function installUpdate ( ) {
137137 showPrompt ( getString ( "prompt_installing" ) ) ;
138+ let stdout = "" ;
138139 const output = spawn ( 'sh' , [ `${ basePath } /common/get_extra.sh` , '--install-update' ] ,
139140 { env : { PATH : "$PATH:/data/adb/ap/bin:/data/adb/ksu/bin:/data/adb/magisk" } } ) ;
141+ output . stdout . on ( 'data' , ( data ) => stdout += data ) ;
140142 output . stderr . on ( 'data' , ( data ) => {
141143 console . error ( 'Error during installation:' , data ) ;
142144 } ) ;
143145 output . on ( 'exit' , ( code ) => {
146+ if ( stdout . includes ( 'No need to reboot' ) ) {
147+ exec ( `rm -f ${ basePath } /module.prop` ) . then ( ( ) => {
148+ window . location . reload ( ) ;
149+ } ) ;
150+ }
144151 if ( code === 0 ) {
145152 showPrompt ( getString ( "prompt_installed" ) ) ;
146153 } else {
147154 showPrompt ( getString ( "prompt_install_fail" ) , false ) ;
148155 }
149156 isDownloading = false ;
150157 } ) ;
151- }
158+ }
0 commit comments