Mobile handsets can have dual SIMs, where each SIM (usually) has a single IMSI. However it is possible for a SIM card to have dual IMSI as well, and in fact IMSI that can be "configured on it" on-the-fly by operator. The latter mechanism is used for roaming scenarios, such as for business customers, where one (fixed) IMSI will be used by your home-country operator's phone number, and the other (flexible) IMSI that could be configured to visited-country operator's phone number (with whom your operator has a specific roaming arrangement). This way people can call you on either number, and you do not have to swap SIMs. Note that this was possible even before dual-SIM phones became relatively common.
For multi-SIM, I found some answers such as this one where one answer suggests using MultiSIM API (from 3rd party), and another answer suggests using the official supported API available since Android 5.1 (API level >22) or the unsupported TelephonyManager way from this answer (which I presume works for older API levels as well). However, it is not evident if those API's work for single SIM multi IMSI as well.
Unfortunately, I am yet to lay my hands on dual-IMSI SIM card to try this out. While I am trying to procure one, can anyone who has tried confirm or share findings ?
I'm not exactly sure what the question is, however a single SIM will only ever have one active imsi. Yes SIM cards can can multiple imsi's and an operator can update the imsi. However a SIM will only have ONE active IMSI.
A SIM can only have one active IMSI due to the SIM specification which says a IMSI must be stored in file ID:
3F00 (MF) -> 7F20 -> (DF_GSM) -> 6F07 (EF_IMSI).
A device (phone/modem) will request the IMSI from this file and only this file. if they were two "active" IMSI's no device currently would know where to find that IMSI without a firmware change.
Related
I have three questions on what and how the IMEI can be used. My current knowledge is the IMEI is the devices "Social Security Number", Source Here, so:
Can another phone/device have the same IMEI?
If not, can I have my app use the IMEI to recognize that the device it is on is the exact same device it was used on before?
If this one is also a yes how could I get the Android SDK to pull the IMEI for device validation. (I'm looking for something like ANDROID_PULL_IMEI then Android_VALIDATECHECK_KEY or similar)
CDMA devices have a MEID instead of an IMEI. This answer describes how to obtain them programmatically.
This is not foolproof. I've encountered cheap Chinese devices where TelephonyManager#getDeviceId() returns null or some obviously bogus string like "0123456789ABCDEF".
I have a dual sim Android phone. Using this solution I retrieve IMEI numbers of both sims.
Given the IMEI number, how can I find out the phone number of each sim?
There are methods getDeviceIdGemini(int slotId) and getSimStateGemini(int slotId) it is possible to find out the IMEI number and the state of each sims.
I'm looking for a similar method for reading the phone number of the sim.
You can't. Phone number it's not stored on sim card, it's stored on operator's servers. Look for TelephonyManager.getSubscriberId(), this will give the unique id for each SIM.
Programmatically obtain the phone number of the Android phone
Basic answer- there is no way to get your current phone number. There's things that sometimes work, but not always and not on all carriers.
No,
Android doesn't support dual sim devices.
See: Detect the status of two SIM cards in a dual-SIM Android phone
as Android does not support multiple SIMs, at least from the SDK.
You can contact your device manufacturer and see if they have an SDK add-on or something that allows you to access the second SIM.May be an API which can help youto get your desired result.
Although you can find out the status of the device whether it is Dual sim or not by using this link Android : Check whether the phone is dual SIM
Using reflection, I looked at the methods of TelephonyManager and found this method: int getLine1NumberGemini(int).
I tried to invoke it (getLine1NumberGemini(0) for first sim and getLine1NumberGemini(1) for the second). In both cases I received an empty string.
But the reason for this seems to be the inability of the phone to get the phone number of my sims:
TelephonyManager.getLine1Number() returns empty string as well.
When I open "Sim management" in the settings of the phone, no phone numbers are displayed.
Is IMSI number unique for each phone ?
I want to know the answer with respect to Android.
Please help.
Wikipdia:
An International Mobile Subscriber Identity or IMSI (play /ˈɪmziː/) is a unique identification associated with all GSM and UMTS network mobile phone users.
Not all android devices are on GSM or UMTS. So I would guess that the ones that don't use those networks aren't going to have any value at all for IMSI. But I would be really really carful relying on something like that to be unique. I've found that different manufacturers/carriers sometimes put the same # as the value on every device for some of the supposedly unique IDs. Which will cause you major headaches if it turns out that there are thousands of devices out there using the same ID.
That being said, I have no experience working specifically with IMSI so this is just my guess.
Edit: there is no one end all be all "correct" value to use as unique ID as far as I am aware. Here are some links that can give you some ideas though:
Is Secure.ANDROID_ID unique for each device?
Is there a unique Android device ID?
If possible I think you are better off generating your own UUID and storing it yourself. But this of course means that it won't persist through uninstallation of your application (or through SDcard wipe if you choose to store it there)
IMSI is the subscriber identifier and is associated with the SIM, not the phone. If you move the SIM from one phone to another you are moving the IMSI also, so no, it is not unique per phone if this was what you were looking for.
There is an identifier associated with the phone itself - it's the IMEI (International Mobile Equipment Identity). This should be unique per phone - one key use is by operators to detect stolen handsets.
See: http://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity
For a GSM Android device, whose sim card has been removed, is there any way to detect which carrier the device was previously running on, or perhaps sold by? I am most concerned with detecting phones who have the same Build.Device and are sold by multiple different carrier/operators.
Most method's of carrier/operator detection seem to depend on it currently being connected to the network, or a SIM being present.
Check the Build.FINGERPRINT string. It may not be 100% reliable, but most carriers put their name on the first section of the string: $(PRODUCT_BRAND).
http://developer.android.com/reference/android/os/Build.html
The FINGERPRINT format is the following:
$(PRODUCT_BRAND)/$(PRODUCT_NAME)/$(PRODUCT_DEVICE)/$(TARGET_BOOTLOADER_BOARD_NAME):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
Of those, $(BUILD_ID) is specific for carrier/build/region.
Of course, none of this will work in unbranded devices or in devices with custom ROMs, since they are not bound to any carrier without a sim. For those two cases, I believe there is no way to determine anything besides checking the sim, simply because there is nothing to check.
Is it possible, in Android or any other mobile OS, to access the encrypted information passed from the SIM card to the cellular network? I mean the mobile signature, or the TMSI number. I need this data after it is encripted by the sim. I mean the IMSI after it is encrypted by the SIM to be sent to the network.
Thanks :)
Impossible. Android so far does not provide any direct API's and/or other interfaces to SIM card, except for some basic information like country code, operator name, etc, which is kindly provided by TelephonyManager.
Additionally, SIM interface normally is connected to modem CPU, not application one, thus eliminating any possible hacks/workarounds.
As I know SIM doesn't encrypt the IMSI information,that's the one reason to use TMSI.
Exactly, SIM doesn't do that. Its all done using Hardware of phone. And TMSI don't have anything to do with phone. It is used in radio interfaces just to secure user information and confidentiality. Phone will be always identified by IMSI not TMSI.
Basically they uses some key values. And those keys do the twist. Algorithm A5 and A8 are used for key purpose.
Pankaj Singh