chore: cleanup #81

Merged
PeterCxy merged 3 commits from septs/OpenEUICC:cleanup into master 2024-12-07 15:57:16 +01:00
5 changed files with 8 additions and 7 deletions

View file

@ -38,8 +38,8 @@ class OmapiApduInterface(
check(!this::lastChannel.isInitialized) {
"Can only open one channel"
}
lastChannel = session.openLogicalChannel(aid)!!;
return 1;
lastChannel = session.openLogicalChannel(aid)!!
return 1
}
override fun logicalChannelClose(handle: Int) {

View file

@ -109,7 +109,7 @@ open class MainActivity : BaseEuiccAccessActivity(), OpenEuiccContextMarker {
override fun onOptionsItemSelected(item: MenuItem): Boolean =
when (item.itemId) {
R.id.settings -> {
startActivity(Intent(this, SettingsActivity::class.java));
startActivity(Intent(this, SettingsActivity::class.java))
true
}
R.id.reload -> {

View file

@ -39,7 +39,7 @@ class TelephonyManagerApduInterface(
val hex = aid.encodeHex()
val channel = tm.iccOpenLogicalChannelByPortCompat(port.card.physicalSlotIndex, port.portIndex, hex, 0)
if (channel.status != IccOpenLogicalChannelResponse.STATUS_NO_ERROR || channel.channel == IccOpenLogicalChannelResponse.INVALID_CHANNEL) {
throw IllegalArgumentException("Cannot open logical channel $hex via TelephonManager on slot ${port.card.physicalSlotIndex} port ${port.portIndex}");
throw IllegalArgumentException("Cannot open logical channel $hex via TelephonManager on slot ${port.card.physicalSlotIndex} port ${port.portIndex}")
}
lastChannel = channel.channel
return lastChannel

View file

@ -94,6 +94,7 @@ val TelephonyManager.uiccCardsInfoCompat: List<RealUiccCardInfoCompat>
fun TelephonyManager.iccOpenLogicalChannelByPortCompat(
slotIndex: Int, portIndex: Int, aid: String?, p2: Int
): IccOpenLogicalChannelResponse =
@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
iccOpenLogicalChannelByPort(slotIndex, portIndex, aid, p2)!!
} else {

View file

@ -16,9 +16,9 @@ android {
externalNativeBuild {
ndkBuild {
cFlags(
"-fmacro-prefix-map=${project.projectDir.toString()}=/fake/path/",
"-fdebug-prefix-map=${project.projectDir.toString()}=/fake/path/",
"-ffile-prefix-map=${project.projectDir.toString()}=/fake/path/"
"-fmacro-prefix-map=${project.projectDir}=/fake/path/",
"-fdebug-prefix-map=${project.projectDir}=/fake/path/",
"-ffile-prefix-map=${project.projectDir}=/fake/path/"
)
}
}