mirror of
https://github.com/Fox2Code/FoxMagiskModuleManager
synced 2024-10-30 15:20:15 +00:00
Fix InstallerActivity error messages on failure.
This commit is contained in:
parent
8995f2757c
commit
44472aaadb
@ -117,6 +117,7 @@ public class InstallerActivity extends CompatActivity {
|
|||||||
if (moduleCache.exists() && !moduleCache.delete() &&
|
if (moduleCache.exists() && !moduleCache.delete() &&
|
||||||
!new SuFile(moduleCache.getAbsolutePath()).delete())
|
!new SuFile(moduleCache.getAbsolutePath()).delete())
|
||||||
Log.e(TAG, "Failed to delete module cache");
|
Log.e(TAG, "Failed to delete module cache");
|
||||||
|
String errMessage = "Failed to download module zip";
|
||||||
try {
|
try {
|
||||||
Log.i(TAG, "Downloading: " + target);
|
Log.i(TAG, "Downloading: " + target);
|
||||||
byte[] rawModule = Http.doHttpGet(target,(progress, max, done) -> {
|
byte[] rawModule = Http.doHttpGet(target,(progress, max, done) -> {
|
||||||
@ -145,6 +146,7 @@ public class InstallerActivity extends CompatActivity {
|
|||||||
outputStream.flush();
|
outputStream.flush();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
errMessage = "Failed to patch module zip";
|
||||||
this.runOnUiThread(() -> {
|
this.runOnUiThread(() -> {
|
||||||
this.installerTerminal.addLine("- Patching " + name);
|
this.installerTerminal.addLine("- Patching " + name);
|
||||||
this.progressIndicator.setVisibility(View.GONE);
|
this.progressIndicator.setVisibility(View.GONE);
|
||||||
@ -162,11 +164,12 @@ public class InstallerActivity extends CompatActivity {
|
|||||||
this.runOnUiThread(() -> {
|
this.runOnUiThread(() -> {
|
||||||
this.installerTerminal.addLine("- Installing " + name);
|
this.installerTerminal.addLine("- Installing " + name);
|
||||||
});
|
});
|
||||||
|
errMessage = "Failed to install module zip";
|
||||||
this.doInstall(moduleCache, noExtensions, rootless);
|
this.doInstall(moduleCache, noExtensions, rootless);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.e(TAG, "Failed to download module zip", e);
|
Log.e(TAG, errMessage, e);
|
||||||
this.setInstallStateFinished(false,
|
this.setInstallStateFinished(false,
|
||||||
"! Failed to download module zip", "");
|
"! " + errMessage, "");
|
||||||
}
|
}
|
||||||
}, "Module download Thread").start();
|
}, "Module download Thread").start();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user