diff --git a/pySim-prog.py b/pySim-prog.py index b6c86af8..e6508b16 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -39,7 +39,7 @@ from pySim.commands import SimCardCommands from pySim.transport import init_reader, argparse_add_reader_args from pySim.legacy.cards import _cards_classes, card_detect from pySim.utils import derive_milenage_opc, calculate_luhn, dec_iccid -from pySim.ts_51_011 import EF_AD +from pySim.profile.ts_51_011 import EF_AD from pySim.legacy.ts_51_011 import EF from pySim.card_handler import * from pySim.utils import * diff --git a/pySim-read.py b/pySim-read.py index 91e17aed..91a43bd5 100755 --- a/pySim-read.py +++ b/pySim-read.py @@ -31,7 +31,7 @@ import sys from osmocom.utils import h2b, h2s, swap_nibbles, rpad -from pySim.ts_51_011 import EF_SST_map, EF_AD +from pySim.profile.ts_51_011 import EF_SST_map, EF_AD from pySim.legacy.ts_51_011 import EF, DF from pySim.ts_31_102 import EF_UST_map from pySim.legacy.ts_31_102 import EF_USIM_ADF_map diff --git a/pySim-shell.py b/pySim-shell.py index 08f00f9c..396d9101 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -60,7 +60,6 @@ from pySim.card_handler import CardHandler, CardHandlerAuto from pySim.filesystem import CardMF, CardEF, CardDF, CardADF, LinFixedEF, TransparentEF, BerTlvEF from pySim.ts_102_221 import pin_names from pySim.ts_102_222 import Ts102222Commands -from pySim.gsm_r import DF_EIRENE from pySim.cat import ProactiveCommand from pySim.card_key_provider import CardKeyProviderCsv, card_key_provider_register, card_key_provider_get_field diff --git a/pySim/app.py b/pySim/app.py index babd054c..4391234a 100644 --- a/pySim/app.py +++ b/pySim/app.py @@ -22,7 +22,7 @@ from pySim.filesystem import CardModel, CardApplication from pySim.cards import card_detect, SimCardBase, UiccCardBase, CardBase from pySim.runtime import RuntimeState from pySim.profile import CardProfile -from pySim.cdma_ruim import CardProfileRUIM +from pySim.profile.cdma_ruim import CardProfileRUIM from pySim.profile.ts_102_221 import CardProfileUICC from pySim.utils import all_subclasses from pySim.exceptions import SwMatchError diff --git a/pySim/cards.py b/pySim/cards.py index b1a84cf2..2e685779 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -26,7 +26,7 @@ from typing import Optional, Tuple from osmocom.utils import * from pySim.profile.ts_102_221 import EF_DIR, CardProfileUICC -from pySim.ts_51_011 import DF_GSM +from pySim.profile.ts_51_011 import DF_GSM from pySim.utils import SwHexstr from pySim.commands import Path, SimCardCommands diff --git a/pySim/legacy/cards.py b/pySim/legacy/cards.py index 1f5db8a6..13e2c47f 100644 --- a/pySim/legacy/cards.py +++ b/pySim/legacy/cards.py @@ -16,7 +16,7 @@ from pySim.legacy.ts_51_011 import EF, DF from pySim.legacy.ts_31_102 import EF_USIM_ADF_map from pySim.legacy.ts_31_103 import EF_ISIM_ADF_map -from pySim.ts_51_011 import EF_AD, EF_SPN +from pySim.profile.ts_51_011 import EF_AD, EF_SPN def format_addr(addr: str, addr_type: str) -> str: """ diff --git a/pySim/legacy/utils.py b/pySim/legacy/utils.py index 4bfd061e..ae7321c8 100644 --- a/pySim/legacy/utils.py +++ b/pySim/legacy/utils.py @@ -148,7 +148,7 @@ def dec_st(st, table="sim") -> str: from pySim.ts_31_102 import EF_UST_map lookup_map = EF_UST_map else: - from pySim.ts_51_011 import EF_SST_map + from pySim.profile.ts_51_011 import EF_SST_map lookup_map = EF_SST_map st_bytes = [st[i:i+2] for i in range(0, len(st), 2)] diff --git a/pySim/profile/cdma_ruim.py b/pySim/profile/cdma_ruim.py index f20e77cd..152087b8 100644 --- a/pySim/profile/cdma_ruim.py +++ b/pySim/profile/cdma_ruim.py @@ -25,9 +25,9 @@ from osmocom.construct import * from pySim.filesystem import * from pySim.profile import CardProfile, CardProfileAddon -from pySim.ts_51_011 import CardProfileSIM -from pySim.ts_51_011 import DF_TELECOM, DF_GSM -from pySim.ts_51_011 import EF_ServiceTable +from pySim.profile.ts_51_011 import CardProfileSIM +from pySim.profile.ts_51_011 import DF_TELECOM, DF_GSM +from pySim.profile.ts_51_011 import EF_ServiceTable # Mapping between CDMA Service Number and its description diff --git a/pySim/gsm_r.py b/pySim/profile/gsm_r.py similarity index 100% rename from pySim/gsm_r.py rename to pySim/profile/gsm_r.py diff --git a/pySim/profile/ts_51_011.py b/pySim/profile/ts_51_011.py index d28e8eef..a7174f6a 100644 --- a/pySim/profile/ts_51_011.py +++ b/pySim/profile/ts_51_011.py @@ -43,7 +43,7 @@ from pySim.utils import dec_iccid, enc_iccid, dec_imsi, enc_imsi, dec_plmn, enc_ from pySim.profile import CardProfile, CardProfileAddon from pySim.filesystem import * from pySim.ts_31_102_telecom import DF_PHONEBOOK, DF_MULTIMEDIA, DF_MCS, DF_V2X -from pySim.gsm_r import AddonGSMR +from pySim.profile.gsm_r import AddonGSMR # Mapping between SIM Service Number and its description EF_SST_map = { diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py index ab8b1d5e..eaa27c75 100644 --- a/pySim/ts_31_102.py +++ b/pySim/ts_31_102.py @@ -36,12 +36,12 @@ from osmocom.utils import is_hexstr from osmocom.tlv import * from osmocom.construct import * -from pySim.ts_51_011 import EF_ACMmax, EF_AAeM, EF_eMLPP, EF_CMI, EF_PNN -from pySim.ts_51_011 import EF_MMSN, EF_MMSICP, EF_MMSUP, EF_MMSUCP, EF_VGCS, EF_VGCSS, EF_NIA -from pySim.ts_51_011 import EF_SMSR, EF_DCK, EF_EXT, EF_CNL, EF_OPL, EF_MBI, EF_MWIS -from pySim.ts_51_011 import EF_CBMID, EF_CBMIR, EF_ADN, EF_CFIS, EF_SMS, EF_MSISDN, EF_SMSP, EF_SMSS -from pySim.ts_51_011 import EF_IMSI, EF_xPLMNwAcT, EF_SPN, EF_CBMI, EF_ACC, EF_PLMNsel -from pySim.ts_51_011 import EF_Kc, EF_CPBCCH, EF_InvScan +from pySim.profile.ts_51_011 import EF_ACMmax, EF_AAeM, EF_eMLPP, EF_CMI, EF_PNN +from pySim.profile.ts_51_011 import EF_MMSN, EF_MMSICP, EF_MMSUP, EF_MMSUCP, EF_VGCS, EF_VGCSS, EF_NIA +from pySim.profile.ts_51_011 import EF_SMSR, EF_DCK, EF_EXT, EF_CNL, EF_OPL, EF_MBI, EF_MWIS +from pySim.profile.ts_51_011 import EF_CBMID, EF_CBMIR, EF_ADN, EF_CFIS, EF_SMS, EF_MSISDN, EF_SMSP, EF_SMSS +from pySim.profile.ts_51_011 import EF_IMSI, EF_xPLMNwAcT, EF_SPN, EF_CBMI, EF_ACC, EF_PLMNsel +from pySim.profile.ts_51_011 import EF_Kc, EF_CPBCCH, EF_InvScan from pySim.profile.ts_102_221 import EF_ARR, CardProfileUICC from pySim.filesystem import * from pySim.ts_31_102_telecom import DF_PHONEBOOK, EF_UServiceTable diff --git a/pySim/ts_31_103.py b/pySim/ts_31_103.py index 8f895c3e..d15e227a 100644 --- a/pySim/ts_31_103.py +++ b/pySim/ts_31_103.py @@ -27,7 +27,7 @@ from osmocom.utils import * from osmocom.tlv import * from osmocom.construct import * from pySim.filesystem import * -from pySim.ts_51_011 import EF_AD, EF_SMS, EF_SMSS, EF_SMSR, EF_SMSP +from pySim.profile.ts_51_011 import EF_AD, EF_SMS, EF_SMSS, EF_SMSR, EF_SMSP from pySim.ts_31_102 import ADF_USIM, EF_FromPreferred from pySim.ts_31_102_telecom import EF_UServiceTable from pySim.ts_31_103_shared import * diff --git a/pySim/ts_31_104.py b/pySim/ts_31_104.py index 780fa445..993a3afa 100644 --- a/pySim/ts_31_104.py +++ b/pySim/ts_31_104.py @@ -24,7 +24,7 @@ from osmocom.utils import * from osmocom.tlv import * from pySim.filesystem import * from pySim.ts_31_102 import ADF_USIM -from pySim.ts_51_011 import EF_IMSI, EF_AD +from pySim.profile.ts_51_011 import EF_IMSI, EF_AD from pySim.profile.ts_102_221 import EF_ARR, CardProfileUICC diff --git a/tests/unittests/test_files.py b/tests/unittests/test_files.py index a3ccf065..679d6d1d 100755 --- a/tests/unittests/test_files.py +++ b/tests/unittests/test_files.py @@ -25,10 +25,10 @@ import pySim.ts_102_221 import pySim.ts_102_222 import pySim.ts_31_102 import pySim.ts_31_103 -import pySim.ts_51_011 +import pySim.profile.ts_51_011 import pySim.sysmocom_sja2 -import pySim.gsm_r -import pySim.cdma_ruim +import pySim.profile.gsm_r +import pySim.profile.cdma_ruim from construct import Int8ub, Struct, Padding, this from osmocom.tlv import BER_TLV_IE diff --git a/tests/unittests/test_tlvs.py b/tests/unittests/test_tlvs.py index 7f1b72b8..ac7596b1 100755 --- a/tests/unittests/test_tlvs.py +++ b/tests/unittests/test_tlvs.py @@ -26,10 +26,10 @@ import pySim.ts_102_221 import pySim.ts_102_222 import pySim.ts_31_102 import pySim.ts_31_103 -import pySim.ts_51_011 +import pySim.profile.ts_51_011 import pySim.sysmocom_sja2 -import pySim.gsm_r -import pySim.cdma_ruim +import pySim.profile.gsm_r +import pySim.profile.cdma_ruim import pySim.global_platform import pySim.global_platform.http