Skip to content

Commit

Permalink
feat: add EuiccConfiguredAddresses in euiccinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
BeRealQueally committed Jan 31, 2024
1 parent 90bb728 commit 6a2283d
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ public EuiccInfo call() throws Exception {
String eid = lpa.getEID();
Log.debug(TAG,"EID: " + eid);

String address = lpa.getEuiccConfiguredAddresses();
Log.debug(TAG,"EuiccConfiguredAddresses: " + address);

EuiccInfo euiccInfo = lpa.getEuiccInfo2();
euiccInfo.setEid(eid);
euiccInfo.setConfiguredAddresses(address);

Log.debug(TAG,"EuiccInfo: " + euiccInfo);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class EuiccDetailsActivity extends AppCompatActivity {
private EuiccDetailsViewModel viewModel;

private TextView textViewEid;
private TextView textViewConfiguredAddresses;
private TextView textViewTcaVersion;
private TextView textViewGsmaVersion;
private TextView textViewFirmwareVer;
Expand Down Expand Up @@ -103,6 +104,7 @@ public void onStop() {

private void attachUi() {
textViewEid = findViewById(R.id.text_eid);
textViewConfiguredAddresses = findViewById(R.id.text_configured_addresses);
textViewTcaVersion = findViewById(R.id.text_tca_version);
textViewGsmaVersion = findViewById(R.id.text_gsma_version);
textViewFirmwareVer = findViewById(R.id.text_firmware_version);
Expand All @@ -120,6 +122,7 @@ private void attachUi() {
textViewCertificationDataObject = findViewById(R.id.text_certificationDataObject);

textViewEid.setText("");
textViewConfiguredAddresses.setText("");
textViewTcaVersion.setText("");
textViewGsmaVersion.setText("");
textViewFirmwareVer.setText("");
Expand All @@ -143,6 +146,7 @@ private void setEuiccInfo(EuiccInfo euiccInfo) {
ArrayList<String> memoryData = parseMemoryData(extCardResource);

textViewEid.setText(euiccInfo.getEid());
textViewConfiguredAddresses.setText(euiccInfo.getConfiguredAddresses());
textViewTcaVersion.setText(euiccInfo.getProfileVersion());
textViewGsmaVersion.setText(euiccInfo.getSvn());
textViewFirmwareVer.setText(euiccInfo.getEuiccFirmwareVer());
Expand Down
24 changes: 24 additions & 0 deletions app/src/main/res/layout/activity_euicc_details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,30 @@
android:layout_height="20dp"
android:layout_width="match_parent" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:text="@string/euicc_info_configured_addresses_title"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold"
android:textIsSelectable="true"
/>

<TextView
android:id="@+id/text_configured_addresses"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:text="@string/euicc_info_configured_addresses_example"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textIsSelectable="true"
/>

<Space
android:layout_height="20dp"
android:layout_width="match_parent" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
<string name="euicc_info_progress_getting_euicc_info">Reading eUICC information</string>
<string name="euicc_info_eid_title">EID</string>
<string name="euicc_info_eid_example">89034011560010000000000000000121</string>
<string name="euicc_info_configured_addresses_title">eUICC Configured Addresses</string>
<string name="euicc_info_configured_addresses_example">rootDSAddress: testrootsmds.gsma.com</string>
<string name="euicc_info_tca_version_title">TCA eUICC Profile Package Version</string>
<string name="euicc_info_tca_version_example">2.2.2</string>
<string name="euicc_info_gsma_sgp_22_version_title">GSMA SGP.22 Version</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
public interface LocalProfileAssistantCore {
// Profile management
String getEID() throws Exception;
String getEuiccConfiguredAddresses() throws Exception;
EuiccInfo getEuiccInfo2() throws Exception;
List<ProfileMetadata> getProfiles() throws Exception;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import com.infineon.esim.lpa.core.worker.local.DisableProfileWorker;
import com.infineon.esim.lpa.core.worker.local.EnableProfileWorker;
import com.infineon.esim.lpa.core.worker.local.GetEidWorker;
import com.infineon.esim.lpa.core.worker.local.GetEuiccConfiguredAddressesWorker;
import com.infineon.esim.lpa.core.worker.local.GetEuiccInfo2Worker;
import com.infineon.esim.lpa.core.worker.local.ListProfilesWorker;
import com.infineon.esim.lpa.core.worker.local.SetNicknameWorker;
Expand Down Expand Up @@ -120,6 +121,11 @@ public String getEID() throws Exception {
return new GetEidWorker(es10Interface).getEid();
}

@Override
public String getEuiccConfiguredAddresses() throws Exception {
return new GetEuiccConfiguredAddressesWorker(es10Interface).getEuiccConfiguredAddresses();
}

@Override
public EuiccInfo getEuiccInfo2() throws Exception {
return new GetEuiccInfo2Worker(es10Interface).getEuiccInfo2();
Expand Down
22 changes: 20 additions & 2 deletions core/src/main/java/com/infineon/esim/lpa/core/dtos/EuiccInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
public class EuiccInfo {
private static final String TAG = EuiccInfo.class.getName();
private String eid;
private String configuredAddresses;
private final String profileVersion;
private final String svn;
private final String euiccFirmwareVer;
Expand All @@ -57,12 +58,14 @@ public class EuiccInfo {
private final String treProductReference;

public EuiccInfo(EUICCInfo2 euiccInfo2) {
this(null, euiccInfo2);
this(null, null, euiccInfo2);
}

public EuiccInfo(String eid, EUICCInfo2 euiccInfo2) {
public EuiccInfo(String eid, String configuredAddresses, EUICCInfo2 euiccInfo2) {
this.eid = eid;

this.configuredAddresses = configuredAddresses;

this.profileVersion = versionTypeToString(euiccInfo2.getProfileVersion());
this.svn = versionTypeToString(euiccInfo2.getSvn());
this.euiccFirmwareVer = versionTypeToString(euiccInfo2.getEuiccFirmwareVer());
Expand Down Expand Up @@ -95,6 +98,21 @@ public String getEid() {
return eid;
}

public void setConfiguredAddresses(String configuredAddresses) {
StringBuilder sb = new StringBuilder();
sb.append(configuredAddresses);
sb.delete(0, 2);
int i;
while ((i = sb.indexOf("\t")) != -1) {
sb.deleteCharAt(i);
}
this.configuredAddresses = sb.subSequence(0, sb.length() - 2).toString();
}

public String getConfiguredAddresses() {
return configuredAddresses;
}

public String getProfileVersion() {
return profileVersion;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.infineon.esim.lpa.core.worker.local;

import com.gsma.sgp.messages.rspdefinitions.EuiccConfiguredAddressesResponse;
import com.infineon.esim.lpa.core.es10.Es10Interface;
import com.infineon.esim.util.Log;

public class GetEuiccConfiguredAddressesWorker {
private static final String TAG = GetEuiccConfiguredAddressesWorker.class.getName();

private final Es10Interface es10Interface;

public GetEuiccConfiguredAddressesWorker(Es10Interface es10Interface) {
this.es10Interface = es10Interface;
}

public String getEuiccConfiguredAddresses() throws Exception {
Log.debug(TAG, "Getting the EuiccConfiguredAddresses of the eUICC...");

EuiccConfiguredAddressesResponse euiccConfiguredAddressesResponse = es10Interface.es10a_getEuiccConfiguredAddresses();

return euiccConfiguredAddressesResponse.toString();
}
}

0 comments on commit 6a2283d

Please sign in to comment.