forked from PeterCxy/OpenEUICC
app-unpriv: Downgrade minSDK to 28 (P)
This is probably the lowest version we can reasonably support with OMAPI.
This commit is contained in:
parent
41a53816f8
commit
0b66a64fdb
|
@ -8,7 +8,7 @@ android {
|
|||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 30
|
||||
minSdk = 28
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ open class EuiccChannelManager(protected val context: Context) {
|
|||
private val handler = Handler(HandlerThread("BaseEuiccChannelManager").also { it.start() }.looper)
|
||||
|
||||
protected open val uiccCards: Collection<UiccCardInfoCompat>
|
||||
get() = (0..<tm.activeModemCount).map { FakeUiccCardInfoCompat(it) }
|
||||
get() = (0..<tm.activeModemCountCompat).map { FakeUiccCardInfoCompat(it) }
|
||||
|
||||
private suspend fun connectSEService(): SEService = suspendCoroutine { cont ->
|
||||
handler.post {
|
||||
|
|
|
@ -3,7 +3,7 @@ package im.angry.openeuicc.core
|
|||
import android.se.omapi.Channel
|
||||
import android.se.omapi.SEService
|
||||
import android.se.omapi.Session
|
||||
import im.angry.openeuicc.util.UiccPortInfoCompat
|
||||
import im.angry.openeuicc.util.*
|
||||
import net.typeblog.lpac_jni.ApduInterface
|
||||
import net.typeblog.lpac_jni.LocalProfileAssistant
|
||||
import net.typeblog.lpac_jni.impl.HttpInterfaceImpl
|
||||
|
@ -17,7 +17,7 @@ class OmapiApduInterface(
|
|||
private lateinit var lastChannel: Channel
|
||||
|
||||
override fun connect() {
|
||||
session = service.getUiccReader(port.logicalSlotIndex + 1).openSession()
|
||||
session = service.getUiccReaderCompat(port.logicalSlotIndex + 1).openSession()
|
||||
}
|
||||
|
||||
override fun disconnect() {
|
||||
|
|
|
@ -1,5 +1,25 @@
|
|||
package im.angry.openeuicc.util
|
||||
|
||||
import android.os.Build
|
||||
import android.se.omapi.Reader
|
||||
import android.se.omapi.SEService
|
||||
import android.telephony.TelephonyManager
|
||||
|
||||
val TelephonyManager.activeModemCountCompat: Int
|
||||
get() = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
activeModemCount
|
||||
} else {
|
||||
phoneCount
|
||||
}
|
||||
|
||||
fun SEService.getUiccReaderCompat(slotNumber: Int): Reader {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
return getUiccReader(slotNumber)
|
||||
} else {
|
||||
return readers.first { it.name == "SIM${slotNumber}" || (slotNumber == 1 && it.name == "SIM") }
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* In the privileged version, the EuiccChannelManager should work
|
||||
* based on real Uicc{Card,Port}Info reported by TelephonyManager.
|
||||
|
|
|
@ -21,7 +21,7 @@ android {
|
|||
|
||||
defaultConfig {
|
||||
applicationId = "im.angry.easyeuicc"
|
||||
minSdk = 30
|
||||
minSdk = 28
|
||||
targetSdk = 34
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue