You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Clean ups
This commit is contained in:
@@ -3,16 +3,19 @@ package com.topjohnwu.magisk.view.dialogs
|
||||
import android.app.Activity
|
||||
import android.app.ProgressDialog
|
||||
import android.widget.Toast
|
||||
import androidx.core.net.toUri
|
||||
import com.topjohnwu.magisk.Info
|
||||
import com.topjohnwu.magisk.R
|
||||
import com.topjohnwu.magisk.tasks.MagiskInstaller
|
||||
import com.topjohnwu.magisk.utils.Utils
|
||||
import com.topjohnwu.magisk.utils.cachedFile
|
||||
import com.topjohnwu.magisk.utils.reboot
|
||||
import com.topjohnwu.net.Networking
|
||||
import com.topjohnwu.superuser.Shell
|
||||
import com.topjohnwu.superuser.ShellUtils
|
||||
import com.topjohnwu.superuser.internal.UiThreadHandler
|
||||
import com.topjohnwu.superuser.io.SuFile
|
||||
import java.io.File
|
||||
|
||||
class EnvFixDialog(activity: Activity) : CustomAlertDialog(activity) {
|
||||
|
||||
@@ -28,8 +31,10 @@ class EnvFixDialog(activity: Activity) : CustomAlertDialog(activity) {
|
||||
override fun operations(): Boolean {
|
||||
installDir = SuFile("/data/adb/magisk")
|
||||
Shell.su("rm -rf /data/adb/magisk/*").exec()
|
||||
if (!ShellUtils.checkSum("MD5", zipFile, Info.remote.magisk.hash))
|
||||
Networking.get(Info.remote.magisk.link).execForFile(zipFile)
|
||||
val zip : File = activity.cachedFile("magisk.zip")
|
||||
if (!ShellUtils.checkSum("MD5", zip, Info.remote.magisk.hash))
|
||||
Networking.get(Info.remote.magisk.link).execForFile(zip)
|
||||
zipUri = zip.toUri()
|
||||
return extractZip() && Shell.su("fix_env").exec().isSuccess
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user