Skip to content

Commit b64e428

Browse files
committed
Add fallback to susfs version
1 parent 8e296e2 commit b64e428

File tree

1 file changed

+3
-5
lines changed
  • app/src/main/java/com/github/capntrips/kernelflasher/ui/screens/main

1 file changed

+3
-5
lines changed

app/src/main/java/com/github/capntrips/kernelflasher/ui/screens/main/MainViewModel.kt

+3-5
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,9 @@ class MainViewModel(
7979
init {
8080
PartitionUtil.init(context, fileSystemManager)
8181
kernelVersion = Shell.cmd("echo $(uname -r) $(uname -v)").exec().out[0]
82-
susfsVersion = try {
83-
Shell.cmd("susfsd version").exec().out[0]
84-
} catch (e: Exception) {
85-
"v0.0.0"
86-
}
82+
susfsVersion = runCatching { Shell.cmd("susfsd version").exec().out[0] }
83+
.recoverCatching { Shell.cmd("ksu_susfs show version").exec().out[0] }
84+
.getOrDefault("v0.0.0")
8785
slotSuffix = Shell.cmd("getprop ro.boot.slot_suffix").exec().out[0]
8886
backups = BackupsViewModel(context, fileSystemManager, navController, _isRefreshing, _backups)
8987
updates = UpdatesViewModel(context, fileSystemManager, navController, _isRefreshing)

0 commit comments

Comments
 (0)