Skip to content

Commit

Permalink
4.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Apr 17, 2023
1 parent 2d25688 commit 431acf7
Show file tree
Hide file tree
Showing 20 changed files with 148 additions and 86 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes

## 4.0.3 (2023-04-06)

Maintenance:
- Update to latest dependency versions
- Minor housekeeping

## 4.0.2 (2022-08-23)

Bugfix:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This software supports the following features:
* Confirmation code handling
* Switching/Enabling/Disabling of profiles
* Deleting of profiles
* Support for three reader types:
* Support for two reader types:
* Secure Element Reader: Reads an internal (soldered) or SIM slot inserted eSIM
* Identiv USB Reader: Reads from an external Identiv USB reader (e.g. Identiv SCR3500)
* Display of eUICC information
Expand Down
93 changes: 52 additions & 41 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ apply plugin: 'de.undercouch.download'

android {
namespace 'com.infineon.esim.lpa'
compileSdkVersion 32
compileSdkVersion 33

defaultConfig {
applicationId "com.infineon.esim.lpa"
minSdkVersion 28
targetSdkVersion 32
versionCode 40002
versionName "4.0.2"
targetSdkVersion 33
versionCode 40003
versionName "4.0.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.debug
}
Expand Down Expand Up @@ -65,6 +65,13 @@ android {
}
}

// Task to print project version name (e.g. for CI/CD purposes)
task printVersionName {
doLast {
println android.defaultConfig.versionName
}
}

// Gradle tasks to automatically download Identiv Smartcard SDK dependency
task downloadIdentivAndroidSdkZipFile(type: Download) {
src 'https://files.identiv.com/products/smart-card-readers/developer-tools/Android_Smartcard_SDK_v1.2.zip'
Expand All @@ -74,10 +81,10 @@ task downloadIdentivAndroidSdkZipFile(type: Download) {
task resolveIdentivAndroidSdkDependency(dependsOn: downloadIdentivAndroidSdkZipFile, type: Copy) {
outputs.file('libs/identiv/lib/androidSCardV1.2.jar')
from zipTree(downloadIdentivAndroidSdkZipFile.dest)
into "/libs/identiv"
into "libs/identiv"
}

getDependencies.dependsOn resolveIdentivAndroidSdkDependency
preBuild.dependsOn resolveIdentivAndroidSdkDependency

dependencies {
// ---------------------------------------------------------------------------------------------
Expand All @@ -90,19 +97,19 @@ dependencies {
// ---------------------------------------------------------------------------------------------
// Identiv reader library
// ---------------------------------------------------------------------------------------------
implementation fileTree(dir: '/libs/identiv/lib', include: ['*.jar'])
implementation fileTree(dir: 'libs/identiv/lib', include: ['*.jar'])

// ---------------------------------------------------------------------------------------------
// Google libraries
// ---------------------------------------------------------------------------------------------
// Open source license plugin (see: https://developers.google.com/android/guides/opensource)
implementation "com.google.android.gms:play-services-oss-licenses:17.0.0"
// Android Material design
implementation "com.google.android.material:material:1.6.1"
implementation "com.google.android.material:material:1.8.0"
// QR Code Scanner
implementation "com.google.mlkit:barcode-scanning:17.0.2"
implementation "com.google.mlkit:barcode-scanning:17.1.0"
// Location Services
implementation "com.google.android.gms:play-services-location:20.0.0"
implementation "com.google.android.gms:play-services-location:21.0.1"

////////////////////////////////////////////////////////////////////////////////////////////////
// AndroidX / Jetpack Dependencies (see: https://developer.android.com/jetpack/androidx/versions)
Expand All @@ -111,79 +118,83 @@ dependencies {
// ---------------------------------------------------------------------------------------------
// CameraX library
// ---------------------------------------------------------------------------------------------
def cameraVersion = "1.2.0-alpha04"
// Camera2 library
implementation "androidx.camera:camera-camera2:$cameraVersion"
implementation "androidx.camera:camera-camera2:1.3.0-alpha05"
// Camera core
implementation "androidx.camera:camera-core:$cameraVersion"
implementation "androidx.camera:camera-core:1.3.0-alpha05"
// Camera lifecycle management
implementation "androidx.camera:camera-lifecycle:$cameraVersion"
implementation "androidx.camera:camera-lifecycle:1.3.0-alpha05"
// Camera extensions
implementation "androidx.camera:camera-extensions:$cameraVersion"
implementation "androidx.camera:camera-extensions:1.3.0-alpha05"
// Camera view fragment
implementation "androidx.camera:camera-view:$cameraVersion"
implementation "androidx.camera:camera-view:1.3.0-alpha05"

// ---------------------------------------------------------------------------------------------
// UI support
// ---------------------------------------------------------------------------------------------
// AppCompat
implementation "androidx.appcompat:appcompat:1.5.0"
implementation "androidx.appcompat:appcompat:1.6.1"
// Activity (for permission handling)
implementation "androidx.activity:activity:1.5.1"
implementation "androidx.activity:activity:1.7.0"
// Fragment is needed for ActivityResult API to work properly (needs 1.3.0-rc01, 1.2.5 is not supporting ActivityResult)
// see: https://stackoverflow.com/questions/62771948/new-result-api-error-can-only-use-lower-16-bits-for-requestcode
implementation "androidx.fragment:fragment:1.5.2"
implementation "androidx.fragment:fragment:1.5.6"
// ConstraintLayout for profile list
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
// SwiperefreshLayout for profile list
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
// Preference
implementation "androidx.preference:preference:1.2.0"
// WorkManager
implementation "androidx.work:work-runtime:2.7.1"
implementation "androidx.work:work-runtime:2.8.1"

// ---------------------------------------------------------------------------------------------
// Lifecycle management
// ---------------------------------------------------------------------------------------------
def lifecycle_version = "2.5.1"
// ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel:2.6.1"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1"
// LiveData
implementation "androidx.lifecycle:lifecycle-livedata:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-livedata:2.6.1"
// Lifecycle runtime only (without ViewModel or LiveData)
implementation "androidx.lifecycle:lifecycle-runtime:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-runtime:2.6.1"
// Saved state module for ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.1"
// Annotation processor
// annotationProcessor "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
// alternately - if using Java8, use the following instead of lifecycle-compiler
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-common-java8:2.6.1"
// optional - helpers for implementing LifecycleOwner in a Service
implementation "androidx.lifecycle:lifecycle-service:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-service:2.6.1"
// optional - ProcessLifecycleOwner provides a lifecycle for the whole application process
implementation "androidx.lifecycle:lifecycle-process:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-process:2.6.1"
// optional - ReactiveStreams support for LiveData
implementation "androidx.lifecycle:lifecycle-reactivestreams:$lifecycle_version"

implementation "androidx.work:work-runtime:2.7.1"
implementation "androidx.lifecycle:lifecycle-reactivestreams:2.6.1"

////////////////////////////////////////////////////////////////////////////////////////////////
// Testing
////////////////////////////////////////////////////////////////////////////////////////////////
testImplementation "androidx.arch.core:core-testing:2.1.0"
testImplementation "org.junit.jupiter:junit-jupiter-params:5.8.1"
testImplementation "androidx.arch.core:core-testing:2.2.0"
testImplementation "org.junit.jupiter:junit-jupiter-params:5.8.2"

androidTestImplementation "androidx.test:rules:1.4.1-alpha07"
androidTestImplementation "androidx.test.ext:junit:1.1.3"
androidTestImplementation "androidx.test:rules:1.5.0"
androidTestImplementation "androidx.test.ext:junit:1.1.5"

def espressoVersion = "3.5.0-alpha07"
androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
androidTestImplementation "androidx.test.espresso:espresso-contrib:3.5.1"
androidTestImplementation "androidx.test.espresso:espresso-core:3.5.1"

////////////////////////////////////////////////////////////////////////////////////////////////
// Compatibility
////////////////////////////////////////////////////////////////////////////////////////////////
// Fix "warning: unknown enum constant ... " during build
//implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.0"

// Fixing Duplicate class kotlin.... issue
// See: https://stackoverflow.com/questions/75263047/duplicate-class-in-kotlin-android
constraints {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
}
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
}
}
}
4 changes: 4 additions & 0 deletions app/src/main/java/com/infineon/esim/lpa/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public class Application extends android.app.Application {
private static Context applicationContext;
private static Resources resources;

// Intent extra identifiers
public static final String INTENT_EXTRA_PROFILE_METADATA = "com.infineon.esim.lpa.PROFILE_METADATA";
public static final String INTENT_EXTRA_ACTIVATION_CODE = "com.infineon.esim.lpa.ACTIVATION_CODE";

@Override
public void onCreate() {
Log.debug(TAG, "Initializing application.");
Expand Down
30 changes: 20 additions & 10 deletions app/src/main/java/com/infineon/esim/lpa/euicc/EuiccManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

public class EuiccManager implements EuiccInterfaceStatusChangeHandler {
private static final String TAG = EuiccManager.class.getName();
Expand Down Expand Up @@ -290,16 +291,25 @@ public void onEuiccListRefreshed(List<String> euiccList) {
Log.debug(TAG, "eUICC list has been refreshed: " + euiccList);
this.euiccList.postValue(euiccList);

if(switchEuiccInterface != null) {
String euiccName = getDefaultEuiccNameFromTag(switchEuiccInterface);
selectEuicc(euiccName);

switchEuiccInterface = null;
}

if(enableFallbackEuicc) {
String euiccName = getFallbackEuicc();
selectEuicc(euiccName);
if(euiccList.isEmpty()) {
selectEuicc(Preferences.getNoEuiccName());
} else {
Log.verbose(TAG, "Current eUICC connection: " + currentEuicc.getValue());
if (switchEuiccInterface != null) {
String euiccName = getDefaultEuiccNameFromTag(switchEuiccInterface);
Log.verbose(TAG, "Switch eUICC after refresh: " + euiccName);
selectEuicc(euiccName);
switchEuiccInterface = null;
} else if (enableFallbackEuicc) {
String euiccName = getFallbackEuicc();
Log.debug(TAG, "Enable fallback eUICC: " + euiccName);
selectEuicc(euiccName);
} else if(Objects.equals(currentEuicc.getValue(), Preferences.getNoEuiccName())) {
Log.debug(TAG, "Current SIM: " + currentEuicc.getValue());
Log.debug(TAG, "There is no eUICC enabled but a eUICC detected. Enable the fallback eUICC.");
String euiccName = getFallbackEuicc();
selectEuicc(euiccName);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
public class Atr {
private static final String TAG = Atr.class.getName();

// Allowed/valid ATRs
// Allowed/valid ATRs of tested eUICCs. Extend on own risk.
private static final List<String> VALID_ATR_PARTS = new ArrayList<>(Arrays.asList(
"3B9F96803FC7828031E073F6215757A44D000560700014", // TWPHW004, TWPHW007, TWPHW008
"3B9F96803FC7828031E073F62157574A4D0005608000E4", // TWPHW011, TWPHW013, TWPHW040, TWPHW041
"3B9F96803FC7828031E073F62157574A4D0005609000F4", // TWPOC002, TWPOC101, TWPOC102
"3B9F96803FC7828031E073F62157574A4D020B60010069" // Comprion Test eUICC Consumer Device
"3B9F96803FC7828031E073F6215757A44D000560700014",
"3B9F96803FC7828031E073F62157574A4D0005608000E4",
"3B9F96803FC7828031E073F62157574A4D0005609000F4",
"3B9F96803FC7828031E073F62157574A4D020B60010069"
));

public static Boolean isAtrValid(byte[] atr) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import android.content.IntentFilter;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbManager;
import android.os.Build;

import com.infineon.esim.lpa.Application;
import com.infineon.esim.util.Log;
Expand All @@ -50,13 +51,21 @@ public IdentiveConnectionBroadcastReceiver(Context context, OnDisconnectCallback
}

@Override
@SuppressWarnings("deprecation")
public void onReceive(Context context, Intent intent) {
Log.debug(TAG, "Received a broadcast.");
Log.debug(TAG, "Action: " + intent.getAction());

switch (intent.getAction()) {
case UsbManager.ACTION_USB_DEVICE_ATTACHED:
UsbDevice usbDevice = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
UsbDevice usbDevice;

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
usbDevice = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE, UsbDevice.class);
} else {
usbDevice = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
}

lastReaderName = usbDevice.getProductName();

Log.info(TAG,"USB reader \"" + lastReaderName + "\" attached.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import android.app.AlertDialog;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.inputmethod.EditorInfo;
Expand All @@ -37,6 +38,7 @@
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;

import com.infineon.esim.lpa.Application;
import com.infineon.esim.lpa.R;
import com.infineon.esim.lpa.core.dtos.ActivationCode;
import com.infineon.esim.lpa.core.dtos.enums.CancelSessionReasons;
Expand Down Expand Up @@ -74,12 +76,18 @@ final public class DownloadActivity extends AppCompatActivity {
// region Lifecycle management

@Override
@SuppressWarnings("deprecation")
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// retrieve the data passed using caller's intent
this.activationCode = getIntent().getParcelableExtra(getResources()
.getString(R.string.intent_extra_activation_code));

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
this.activationCode = getIntent().getParcelableExtra(Application.INTENT_EXTRA_ACTIVATION_CODE, ActivationCode.class);
} else {
this.activationCode = getIntent().getParcelableExtra(Application.INTENT_EXTRA_ACTIVATION_CODE);
}

this.authenticateResult = null;
this.downloadResult = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
package com.infineon.esim.lpa.ui.profileDetails;

import android.app.AlertDialog;
import android.os.Build;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
Expand Down Expand Up @@ -57,13 +58,19 @@ final public class ProfileDetailsActivity extends AppCompatActivity {
private ProfileMetadata profileMetadata;

@Override
@SuppressWarnings("deprecation")
protected void onCreate(Bundle savedInstanceState) {
Log.debug(TAG,"Creating activity.");
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile_details);

// retrieve the data passed using caller's intent
this.profileMetadata = getIntent().getParcelableExtra(Application.getStringResource(R.string.intent_extra_profile));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
this.profileMetadata = getIntent().getParcelableExtra(Application.INTENT_EXTRA_PROFILE_METADATA, ProfileMetadata.class);
} else {
this.profileMetadata = getIntent().getParcelableExtra(Application.INTENT_EXTRA_PROFILE_METADATA);
}

if(profileMetadata == null) {
DialogHelper.showGenericErrorDialog(this, true);
}
Expand Down
Loading

0 comments on commit 431acf7

Please sign in to comment.