Skip to content

Commit

Permalink
fix(root): Fixed crash on broken MIUI systems when attempting to inst…
Browse files Browse the repository at this point in the history
…all update APK
  • Loading branch information
timschneeb committed Aug 1, 2023
1 parent 2eccc97 commit 91070b7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package me.timschneeberger.rootlessjamesdsp.flavor.updates

import android.app.Service
import android.content.ActivityNotFoundException
import android.content.Intent
import android.content.pm.PackageInstaller
import android.os.IBinder
Expand All @@ -27,7 +28,12 @@ class SessionInstallerService : Service() {
it.putExtra(Intent.EXTRA_INSTALLER_PACKAGE_NAME, "com.android.vending")
it.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)

startActivity(it)
try {
startActivity(it)
}
catch (ex: ActivityNotFoundException) {
toast(R.string.no_activity_found)
}
}
} else {
notifyStatus(intent)
Expand Down

0 comments on commit 91070b7

Please sign in to comment.