Skip to content

Commit fe6187c

Browse files
committed
added system_dlkm to Available Partitions
1 parent be8d489 commit fe6187c

File tree

4 files changed

+28
-25
lines changed

4 files changed

+28
-25
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ android {
1212
applicationId "com.github.capntrips.kernelflasher"
1313
minSdk 29
1414
targetSdk 34
15-
versionCode 17
16-
versionName "1.0.0-alpha17"
15+
versionCode 18
16+
versionName "1.0.0-alpha18"
1717

1818
javaCompileOptions {
1919
annotationProcessorOptions {

app/src/main/java/com/github/capntrips/kernelflasher/MainActivity.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.github.capntrips.kernelflasher
33
import android.animation.ObjectAnimator
44
import android.animation.PropertyValuesHolder
55
import android.content.ComponentName
6-
import android.content.Context
76
import android.content.Intent
87
import android.content.ServiceConnection
98
import android.os.Bundle
@@ -99,8 +98,8 @@ class MainActivity : ComponentActivity() {
9998
Shell.cmd("chmod +x $dest").exec()
10099
}
101100

102-
private fun copyNativeBinary(context: Context, filename: String) {
103-
val binary = File(context.applicationInfo.nativeLibraryDir, "lib$filename.so")
101+
private fun copyNativeBinary(filename: String) {
102+
val binary = File(applicationInfo.nativeLibraryDir, "lib$filename.so")
104103
println("binary: $binary")
105104
val dest = File(filesDir, filename)
106105
println("dest: $dest")
@@ -167,9 +166,9 @@ class MainActivity : ComponentActivity() {
167166
fun onAidlConnected(fileSystemManager: FileSystemManager) {
168167
try {
169168
Shell.cmd("cd $filesDir").exec()
170-
copyNativeBinary(this, "lptools_static") // v20220825
171-
copyNativeBinary(this, "httools_static") // v3.2.0
172-
copyNativeBinary(this, "magiskboot") // v25.2
169+
copyNativeBinary("lptools_static") // v20220825
170+
copyNativeBinary("httools_static") // v3.2.0
171+
copyNativeBinary("magiskboot") // v25.2
173172
copyAsset("flash_ak3.sh")
174173
} catch (e: Exception) {
175174
Log.e(TAG, e.message, e)

app/src/main/java/com/github/capntrips/kernelflasher/common/PartitionUtil.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ import java.security.MessageDigest
1414
object PartitionUtil {
1515
val PartitionNames = listOf(
1616
"boot",
17-
"vbmeta",
1817
"dtbo",
18+
"init_boot",
19+
"recovery",
20+
"system_dlkm",
21+
"vbmeta",
1922
"vendor_boot",
20-
"vendor_kernel_boot",
2123
"vendor_dlkm",
22-
"init_boot",
23-
"recovery"
24+
"vendor_kernel_boot"
2425
)
2526

2627
val AvailablePartitions = mutableListOf<String>()

app/src/main/java/com/github/capntrips/kernelflasher/common/types/partitions/Partitions.kt

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,42 @@ import kotlinx.serialization.Serializable
55
@Serializable
66
data class Partitions(
77
val boot: String? = null,
8-
val vbmeta: String? = null,
98
val dtbo: String? = null,
9+
@Suppress("PropertyName") val init_boot: String? = null,
10+
val recovery: String? = null,
11+
@Suppress("PropertyName") val system_dlkm: String? = null,
12+
val vbmeta: String? = null,
1013
@Suppress("PropertyName") val vendor_boot: String? = null,
11-
@Suppress("PropertyName") val vendor_kernel_boot: String? = null,
1214
@Suppress("PropertyName") val vendor_dlkm: String? = null,
13-
@Suppress("PropertyName") val init_boot: String? = null,
14-
val recovery: String? = null
15+
@Suppress("PropertyName") val vendor_kernel_boot: String? = null
1516
) {
1617
companion object {
1718
fun from(sparseMap: Map<String, String>) = object {
1819
val map = sparseMap.withDefault { null }
1920
val boot by map
20-
val vbmeta by map
2121
val dtbo by map
22-
val vendor_boot by map
23-
val vendor_kernel_boot by map
24-
val vendor_dlkm by map
2522
val init_boot by map
2623
val recovery by map
27-
val partitions = Partitions(boot, vbmeta, dtbo, vendor_boot, vendor_kernel_boot, vendor_dlkm, init_boot, recovery)
24+
val system_dlkm by map
25+
val vbmeta by map
26+
val vendor_boot by map
27+
val vendor_dlkm by map
28+
val vendor_kernel_boot by map
29+
val partitions = Partitions(boot, dtbo, init_boot, recovery, system_dlkm, vbmeta, vendor_boot, vendor_dlkm, vendor_kernel_boot)
2830
}.partitions
2931
}
3032

3133
fun get(partition: String): String? {
3234
return when (partition) {
3335
"boot" -> boot
34-
"vbmeta" -> vbmeta
3536
"dtbo" -> dtbo
36-
"vendor_boot" -> vendor_boot
37-
"vendor_kernel_boot" -> vendor_kernel_boot
38-
"vendor_dlkm" -> vendor_dlkm
3937
"init_boot" -> init_boot
4038
"recovery" -> recovery
39+
"system_dlkm" -> system_dlkm
40+
"vbmeta" -> vbmeta
41+
"vendor_boot" -> vendor_boot
42+
"vendor_dlkm" -> vendor_dlkm
43+
"vendor_kernel_boot" -> vendor_kernel_boot
4144
else -> null
4245
}
4346
}

0 commit comments

Comments
 (0)