Skip to content

Commit 64f34c2

Browse files
authored
Update ShizukuManager.kt
1 parent 012669d commit 64f34c2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

app/src/main/kotlin/com/dev/debloater/utils/Shizuku/ShizukuManager.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,21 @@ object ShizukuManager {
138138
showMessage("Uninstall failed: ${e.message}", SnackbarDuration.Long)
139139
}
140140
}
141+
142+
fun restore(packageName: String) {
143+
if (!isBound || debloaterService == null) {
144+
showMessage("Shizuku not connected - retrying...")
145+
attemptBind()
146+
return
147+
}
148+
149+
try {
150+
debloaterService?.restore(packageName)
151+
showMessage("Restore command sent: $packageName")
152+
} catch (e: Exception) {
153+
showMessage("Restore failed: ${e.message}", SnackbarDuration.Long)
154+
}
155+
}
141156

142157
fun disable(packageName: String) {
143158
if (!isBound || debloaterService == null) {

0 commit comments

Comments
 (0)