@@ -122,18 +122,17 @@ protected void onCreate(Bundle savedInstanceState) {
122122 this .getWindow ().setFlags ( // Note: Doesn't require WAKELOCK permission
123123 WindowManager .LayoutParams .FLAG_KEEP_SCREEN_ON ,
124124 WindowManager .LayoutParams .FLAG_KEEP_SCREEN_ON );
125- final File moduleFile = urlMode ? null : new File (target );
126125 this .progressIndicator .setVisibility (View .VISIBLE );
127- this .installerTerminal .addLine ("- Downloading " + name );
126+ if ( urlMode ) this .installerTerminal .addLine ("- Downloading " + name );
128127 new Thread (() -> {
129128 File moduleCache = this .toDelete = urlMode ?
130- new File (this .moduleCache , "module.zip" ) : moduleFile ;
131- if (moduleCache .exists () && !moduleCache .delete () &&
129+ new File (this .moduleCache , "module.zip" ) : new File ( target ) ;
130+ if (urlMode && moduleCache .exists () && !moduleCache .delete () &&
132131 !new SuFile (moduleCache .getAbsolutePath ()).delete ())
133132 Log .e (TAG , "Failed to delete module cache" );
134133 String errMessage = "Failed to download module zip" ;
135134 try {
136- Log .i (TAG , "Downloading: " + target );
135+ Log .i (TAG , ( urlMode ? "Downloading: " : "Loading: " ) + target );
137136 byte [] rawModule = urlMode ? Http .doHttpGet (target , (progress , max , done ) -> {
138137 if (max <= 0 && this .progressIndicator .isIndeterminate ())
139138 return ;
@@ -142,7 +141,7 @@ protected void onCreate(Bundle savedInstanceState) {
142141 this .progressIndicator .setMax (max );
143142 this .progressIndicator .setProgressCompat (progress , true );
144143 });
145- }) : Files .readSU (moduleFile );
144+ }) : Files .readSU (moduleCache );
146145 this .runOnUiThread (() -> {
147146 this .progressIndicator .setVisibility (View .GONE );
148147 this .progressIndicator .setIndeterminate (true );
0 commit comments