Search in sources :

Example 1 with FlashActivity

use of com.topjohnwu.magisk.FlashActivity in project MagiskManager by topjohnwu.

the class InstallMagisk method onPostExecute.

@Override
protected void onPostExecute(Boolean result) {
    FlashActivity activity = (FlashActivity) getActivity();
    if (!result) {
        Shell.Async.sh("rm -rf " + install);
        console.add("! Installation failed");
        activity.reboot.setVisibility(View.GONE);
    }
    activity.buttonPanel.setVisibility(View.VISIBLE);
}
Also used : FlashActivity(com.topjohnwu.magisk.FlashActivity)

Example 2 with FlashActivity

use of com.topjohnwu.magisk.FlashActivity in project MagiskManager by topjohnwu.

the class FlashZip method onPostExecute.

// -1 = error, manual install; 0 = invalid zip; 1 = success
@Override
protected void onPostExecute(Integer result) {
    FlashActivity activity = (FlashActivity) getActivity();
    Shell.Async.su("rm -rf " + mCachedFile.getParent(), "rm -rf " + Const.TMP_FOLDER_PATH);
    switch(result) {
        case -1:
            console.add("! Installation failed");
            Utils.showUriSnack(getActivity(), mUri);
            break;
        case 0:
            console.add("! This zip is not a Magisk Module!");
            break;
        case 1:
            // Success
            new LoadModules().exec();
            break;
    }
    activity.reboot.setVisibility(result > 0 ? View.VISIBLE : View.GONE);
    activity.buttonPanel.setVisibility(View.VISIBLE);
}
Also used : FlashActivity(com.topjohnwu.magisk.FlashActivity)

Aggregations

FlashActivity (com.topjohnwu.magisk.FlashActivity)2