<p>herlesupreeth has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/pysim/+/17519">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">cards.py: Added parsing of all the AIDs in the UICC<br><br>Introduced a new member variable and a member function to Card class to fetch<br>and store the AIDs present in UICC. And, this variable (a list) is populated<br>by reading the EF 2f00 under MF 3f00 (function read_aids()).<br><br>Change-Id: I7ca77a73ebb42a8ba1381588d878040675d3019a<br>---<br>M pySim/cards.py<br>1 file changed, 15 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/19/17519/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/pySim/cards.py b/pySim/cards.py</span><br><span>index a872ee0..abac51a 100644</span><br><span>--- a/pySim/cards.py</span><br><span>+++ b/pySim/cards.py</span><br><span>@@ -32,6 +32,7 @@</span><br><span>        def __init__(self, scc):</span><br><span>             self._scc = scc</span><br><span>              self._adm_chv_num = 4</span><br><span style="color: hsl(120, 100%, 40%);">+         self._aids = []</span><br><span> </span><br><span>  def reset(self):</span><br><span>             self._scc.reset_card()</span><br><span>@@ -168,6 +169,20 @@</span><br><span> </span><br><span>            return None</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+       # Fetch all the AIDs present on UICC</span><br><span style="color: hsl(120, 100%, 40%);">+  def read_aids(self):</span><br><span style="color: hsl(120, 100%, 40%);">+          try:</span><br><span style="color: hsl(120, 100%, 40%);">+                  # Find out how many records the EF.DIR has</span><br><span style="color: hsl(120, 100%, 40%);">+                    # and store all the AIDs in the UICC</span><br><span style="color: hsl(120, 100%, 40%);">+                  rec_cnt = self._scc.record_count(['3f00', '2f00'])</span><br><span style="color: hsl(120, 100%, 40%);">+                    for i in range(0, rec_cnt):</span><br><span style="color: hsl(120, 100%, 40%);">+                           rec = self._scc.read_record(['3f00', '2f00'], i + 1)</span><br><span style="color: hsl(120, 100%, 40%);">+                          if (rec[0][0:2], rec[0][4:6]) == ('61', '4f') and len(rec[0]) > 12 \</span><br><span style="color: hsl(120, 100%, 40%);">+                               and rec[0][8:8 + int(rec[0][6:8], 16) * 2] not in self._aids:</span><br><span style="color: hsl(120, 100%, 40%);">+                                 self._aids.append(rec[0][8:8 + int(rec[0][6:8], 16) * 2])</span><br><span style="color: hsl(120, 100%, 40%);">+             except Exception as e:</span><br><span style="color: hsl(120, 100%, 40%);">+                        pass</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> </span><br><span> class _MagicSimBase(Card):</span><br><span>     """</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/pysim/+/17519">change 17519</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/pysim/+/17519"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: pysim </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I7ca77a73ebb42a8ba1381588d878040675d3019a </div>
<div style="display:none"> Gerrit-Change-Number: 17519 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: herlesupreeth <herlesupreeth@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>