Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Aug 26, 2024
1 parent 0a838f7 commit edf8423
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions app/src/main/java/org/andbootmgr/app/DeviceInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,15 @@ abstract class MetaOnSdDeviceInfo : DeviceInfo {
return !SuFile.open(logic.abmDb, "db.conf").exists()
}
override fun getAbmSettings(logic: DeviceLogic): String? {
return logic.dmPath.absolutePath
if (SuFile.open(bdev).exists())
SDUtils.generateMeta(this)?.let { meta ->
if (meta.p.isNotEmpty()) {
val part = meta.dumpKernelPartition(1)
if (part.type == SDUtils.PartitionType.RESERVED)
return part.path
}
}
return null
}
}

Expand All @@ -72,15 +80,7 @@ abstract class SdLessDeviceInfo : DeviceInfo {
return !SuFile.open(logic.abmDb, "db.conf").exists()
}
override fun getAbmSettings(logic: DeviceLogic): String? {
if (SuFile.open(bdev).exists())
SDUtils.generateMeta(this)?.let { meta ->
if (meta.p.isNotEmpty()) {
val part = meta.dumpKernelPartition(1)
if (part.type == SDUtils.PartitionType.RESERVED)
return part.path
}
}
return null
return logic.dmPath.absolutePath
}
}

Expand Down

0 comments on commit edf8423

Please sign in to comment.