diff options
author | Supreeth Herle <herlesupreeth@gmail.com> | 2020-03-18 12:14:48 +0100 |
---|---|---|
committer | Supreeth Herle <herlesupreeth@gmail.com> | 2020-03-22 10:17:05 +0100 |
commit | 98a6927b271fefd33f8218542794f8d0c8269cf1 (patch) | |
tree | 29e2dd592270718b0178b265f8649ead33ff54b4 | |
parent | f9762dc98fb9588849017a99c0cf90fcbe42ddfd (diff) |
Move parsing of GID1 to generic Card class
Change-Id: Ie96408b1eecd6fc2595d619f6f0e3af851dacecb
-rwxr-xr-x | pySim-read.py | 2 | ||||
-rw-r--r-- | pySim/cards.py | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/pySim-read.py b/pySim-read.py index ed6cb29..083f91b 100755 --- a/pySim-read.py +++ b/pySim-read.py @@ -114,7 +114,7 @@ if __name__ == '__main__': # EF.GID1 try: - (res, sw) = scc.read_binary(EF['GID1']) + (res, sw) = card.read_gid1() if sw == '9000': print("GID1: %s" % (res,)) else: diff --git a/pySim/cards.py b/pySim/cards.py index a43da9c..61a3707 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -145,6 +145,13 @@ class Card(object): data, sw = self._scc.update_binary(EF['SPN'], rpad(content, 32)) return sw + def read_gid1(self): + (res, sw) = self._scc.read_binary(EF['GID1']) + if sw == '9000': + return (res, sw) + else: + return (None, sw) + # Read the (full) AID for either ISIM or USIM application def read_aid(self, isim = False): |