Compare commits
No commits in common. "58bd80556a316dbbec5e4e437aeea439c3a37c62" and "b5a63f3de352b9f35ba2e81e0e335db04bab6665" have entirely different histories.
58bd80556a
...
b5a63f3de3
5 changed files with 15 additions and 74 deletions
17
Android.bp
17
Android.bp
|
@ -1,7 +1,8 @@
|
||||||
android_app {
|
android_app {
|
||||||
name: "OpenEUICC",
|
name: "OpenEUICC",
|
||||||
static_libs: [
|
static_libs: [
|
||||||
// Dependencies that must be pulled from maven,
|
// Dependencies that must be pulled from maven
|
||||||
|
"asn1bean-prebuilt-jar",
|
||||||
"zxing-core-prebuilt-jar",
|
"zxing-core-prebuilt-jar",
|
||||||
"zxing-android-embedded-prebuilt-aar",
|
"zxing-android-embedded-prebuilt-aar",
|
||||||
|
|
||||||
|
@ -13,22 +14,18 @@ android_app {
|
||||||
"androidx.lifecycle_lifecycle-runtime-ktx",
|
"androidx.lifecycle_lifecycle-runtime-ktx",
|
||||||
"androidx.swiperefreshlayout_swiperefreshlayout",
|
"androidx.swiperefreshlayout_swiperefreshlayout",
|
||||||
"com.google.android.material_material",
|
"com.google.android.material_material",
|
||||||
"gson",
|
"gson-prebuilt-jar",
|
||||||
"kotlinx_coroutines",
|
"kotlinx_coroutines",
|
||||||
],
|
],
|
||||||
jni_libs: [
|
|
||||||
"liblpac-jni",
|
|
||||||
],
|
|
||||||
srcs: [
|
srcs: [
|
||||||
// Main app
|
// Main app
|
||||||
"app/src/main/**/*.kt",
|
"app/src/main/**/*.kt",
|
||||||
|
|
||||||
// lpac-jni interface
|
// TruPhone LPAd library
|
||||||
"libs/lpac-jni/src/main/**/*.kt",
|
"libs/lpad-sm-dp-plus-connector/src/generated/**/*.java",
|
||||||
|
"libs/lpad-sm-dp-plus-connector/src/main/**/*.java",
|
||||||
|
"libs/lpad-sm-dp-plus-connector/src/main/**/*.kt",
|
||||||
],
|
],
|
||||||
optimize: {
|
|
||||||
enabled: false,
|
|
||||||
},
|
|
||||||
resource_dirs: [
|
resource_dirs: [
|
||||||
"app/src/main/res",
|
"app/src/main/res",
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
tools:ignore="ProtectedPermissions"
|
tools:ignore="ProtectedPermissions">
|
||||||
package="im.angry.openeuicc">
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
|
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
|
||||||
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" />
|
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" />
|
||||||
|
@ -55,4 +54,4 @@
|
||||||
tools:replace="screenOrientation" />
|
tools:replace="screenOrientation" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
|
@ -29,24 +29,21 @@ class TelephonyManagerApduInterface(
|
||||||
if (channel.status != IccOpenLogicalChannelResponse.STATUS_NO_ERROR || channel.channel == IccOpenLogicalChannelResponse.INVALID_CHANNEL) {
|
if (channel.status != IccOpenLogicalChannelResponse.STATUS_NO_ERROR || channel.channel == IccOpenLogicalChannelResponse.INVALID_CHANNEL) {
|
||||||
throw IllegalArgumentException("Cannot open logical channel " + hex + " via TelephonManager on slot " + info.slotId);
|
throw IllegalArgumentException("Cannot open logical channel " + hex + " via TelephonManager on slot " + info.slotId);
|
||||||
}
|
}
|
||||||
lastChannel = channel.channel
|
return channel.channel
|
||||||
return lastChannel
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun logicalChannelClose(handle: Int) {
|
override fun logicalChannelClose(handle: Int) {
|
||||||
check(handle == lastChannel) { "Invalid channel handle " }
|
|
||||||
tm.iccCloseLogicalChannelBySlot(info.slotId, handle)
|
tm.iccCloseLogicalChannelBySlot(info.slotId, handle)
|
||||||
lastChannel = -1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun transmit(tx: ByteArray): ByteArray {
|
override fun transmit(tx: ByteArray): ByteArray {
|
||||||
check(lastChannel != -1) { "Uninitialized" }
|
check(lastChannel != -1) { "Uninitialized" }
|
||||||
|
|
||||||
val cla = tx[0].toUByte().toInt()
|
val cla = tx[0].toInt()
|
||||||
val instruction = tx[1].toUByte().toInt()
|
val instruction = tx[1].toInt()
|
||||||
val p1 = tx[2].toUByte().toInt()
|
val p1 = tx[2].toInt()
|
||||||
val p2 = tx[3].toUByte().toInt()
|
val p2 = tx[3].toInt()
|
||||||
val p3 = tx[4].toUByte().toInt()
|
val p3 = tx[4].toInt()
|
||||||
val p4 = tx.drop(5).toByteArray().encodeHex()
|
val p4 = tx.drop(5).toByteArray().encodeHex()
|
||||||
|
|
||||||
return tm.iccTransmitApduLogicalChannelBySlot(info.slotId, lastChannel,
|
return tm.iccTransmitApduLogicalChannelBySlot(info.slotId, lastChannel,
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
cc_defaults {
|
|
||||||
name: "lpac-jni-defaults",
|
|
||||||
local_include_dirs: ["lpac"],
|
|
||||||
sdk_version: "current",
|
|
||||||
cflags: ["-Wno-error"],
|
|
||||||
}
|
|
||||||
|
|
||||||
cc_library_static {
|
|
||||||
name: "liblpac-cjson",
|
|
||||||
defaults: ["lpac-jni-defaults"],
|
|
||||||
srcs: [
|
|
||||||
"lpac/cjson/*.c",
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
cc_library_static {
|
|
||||||
name: "liblpac-asn1c",
|
|
||||||
defaults: ["lpac-jni-defaults"],
|
|
||||||
local_include_dirs: ["lpac/euicc/asn1c"],
|
|
||||||
cflags: ["-DHAVE_CONFIG_H"],
|
|
||||||
srcs: [
|
|
||||||
"lpac/euicc/asn1c/asn1/*.c",
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
cc_library_static {
|
|
||||||
name: "liblpac-euicc",
|
|
||||||
defaults: ["lpac-jni-defaults"],
|
|
||||||
srcs: [
|
|
||||||
"lpac/euicc/*.c",
|
|
||||||
],
|
|
||||||
static_libs: [
|
|
||||||
"liblpac-asn1c",
|
|
||||||
"liblpac-cjson",
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
cc_library_shared {
|
|
||||||
name: "liblpac-jni",
|
|
||||||
defaults: ["lpac-jni-defaults"],
|
|
||||||
header_libs: ["jni_headers"],
|
|
||||||
srcs: [
|
|
||||||
"lpac-jni/*.c",
|
|
||||||
],
|
|
||||||
static_libs: [
|
|
||||||
"liblpac-euicc",
|
|
||||||
"liblpac-asn1c",
|
|
||||||
"liblpac-cjson",
|
|
||||||
],
|
|
||||||
shared_libs: ["liblog"],
|
|
||||||
system_ext_specific: true,
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue