4

So I've research this subject and I didn't get much information, even though I did read a few threads here like Check SIM PIN with SDK Android and Ask user for SIM Card PIN but neither of them really answer the question - the app I'm trying to write is based on USSD and will run on devices with SIMCards.

I also read the thread Use system PIN dialog in Android application, but I'm not trying to overwrite the OS, I'm just trying to write a simple app that can check an entered String against the SIMCard PIN. On this last thread, a user (a.ch.) said that trying to access or even check the SIMCard PIN number is not allowed by the OS (at least without modifications, I suppose). Can you guys confirm or give me a link that mentions this prohibition?

Also, is it possible to, using only USSD, check the PIN? For example, I only know the MMI code to change PIN: **04*Current PIN * New PIN * New PIN#. And this actually returns fail or sucess messages, and if I make Current PIN = New PIN, I can actually identify if the PIN I introduced is correct or not, but I see this on a text message. Does the smartphone return this info in a attribute that I can check? How can I access the return code?

I need all the help I can get :)

Community
  • 1
  • 1
mauro1855
  • 116
  • 1
  • 7
  • This should give you a little headway: http://stackoverflow.com/questions/25784141/android-set-or-reset-sim-card-pin-code-programmatically – IAmTheSquidward Nov 19 '14 at 15:40
  • I actually read that, but it doesn't help me that much because I honestly don't know what the supplyPin does internally. All the documentation I've read about supplyPin mentions locking or unlocking the phone, so I guess that does more than I want. What would happen if I input the wrong PIN? Would it lock my phone? (I don't want that). Does that only work when SIM_STATE_PIN_REQUIRED or SIM_STATE_PUK_REQUIRED are true? I didn't get the answer for this during my reading. Anyway, it's not about locking my phone or not... all I'd like, if it's possible, is a PIN check, that's it. – mauro1855 Nov 19 '14 at 15:50
  • Hm. Thinking about this more, to be honest, I'm not sure that it's possible. I can't find an API anywhere that enables direct reference to the PIN - everything is just unlock SIM or replace PIN. – IAmTheSquidward Nov 19 '14 at 15:53
  • Yes, that's the conclusion I'm reaching too. Of course the phone does this, but I suppose, for security purposes, they don't even allow the developer to check the PIN (I could easily make a brute-force app to test all the PINs and get the right one). What about getting a response from USSD/MMI, is only returns text or do you know if the MMI to change the PIN returns a code that allows me to distinguish what happened? – mauro1855 Nov 19 '14 at 15:59
  • I just found this: http://stackoverflow.com/questions/19066677/how-to-get-response-from-ussd-code-from-android I suppose it's not possible to manage USSD responses in Android, right? – mauro1855 Nov 19 '14 at 16:03
  • Correct. I'm at the same conclusion - for security reasons, it's all unavailable to call directly. – IAmTheSquidward Nov 19 '14 at 16:06

0 Answers0