Fix manager package name database management

This commit is contained in:
topjohnwu
2019-08-12 03:31:59 -07:00
parent e6561e5f84
commit 84f0ff2fad
2 changed files with 19 additions and 16 deletions
@@ -6,12 +6,10 @@ import android.text.TextUtils
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import com.topjohnwu.magisk.*
import com.topjohnwu.magisk.data.database.SettingsDao
import com.topjohnwu.magisk.utils.Utils
import com.topjohnwu.magisk.view.Notifications
import com.topjohnwu.magisk.view.Shortcuts
import com.topjohnwu.superuser.Shell
import org.koin.android.ext.android.get
open class SplashActivity : AppCompatActivity() {
@@ -35,7 +33,7 @@ open class SplashActivity : AppCompatActivity() {
private fun initAndStart() {
val pkg = Config.suManager
if (Config.suManager.isNotEmpty() && packageName == BuildConfig.APPLICATION_ID) {
get<SettingsDao>().delete(Config.Key.SU_MANAGER)
Config.suManager = ""
Shell.su("pm uninstall $pkg").submit()
}
if (TextUtils.equals(pkg, packageName)) {