PIN number handling in j2me application - java-me

have to make a PIN protected j2me application, how can a default PIN number be applied to the application so that the user may have to change the PIN on the first run.
PS: PIN number is not the actual PIN number of the phone,it is application specific PIN

Do you need for the default PIN to be different for different clients? If not, then have a default PIN and let the client know the PIN and provide an option to change the PIN after login.

Related

Bluetooth Advertisement (Exposure Notification) in Background

I have read several stuff in the internet and understood that its not possible to use bluetooth with two iOS devices in Background. It is only partially possible.
If the peripheral is in Background the UUID is no more visible. And if the central is in Background it is in passive scanning mode which means it can only search for a specific UUID, which is not visible when the peripheral is in Background.
I checked the "new" Exposure Notification service from Apple and Google and in this case I was able to see a UUID with 16-bits and a custom ID. This also works in background really well. Do you think there is any possibility to use this to enable the iOS peripheral also works in Background. If Its possible to change the ID or at least to read our which ID is currently advertised would be also helpful.
What do you guys think is this possible?

BLE Peripheral not displaying correctly

I am currently having some issues with connecting to my peripheral. The bluetooth module in our peripheral does not seem to be advertising a name initially. I've have found that once I connect to the peripheral for the first time it will update the name and my scanner is then able to see the correct name.
I have no understanding why this is the case. I have also tried it using the Swift app we are developing, as well as a range of Bluetooth scanners on iOS and Android so I do not believe that this is an OS or programming error on the scanner side.
Is there a specific parameter that should be set on the peripheral. As I am just the app developer I do not have very much understanding about how the module is handing the process.
Any help would be much appreciated.
Just to confirm the scanner does not see a name for the peripheral until it has connected once. After this it will start displaying the name. Once the peripherals name is changed the old name is still being displayed until I have connected to it once again.
To display the name of device you need to see in advertisementData Dictionary which contains several keys depending on your device, in callback of didDiscoverPeripheral from CentralManager.
- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary<NSString *, id> *)advertisementData RSSI:(NSNumber *)RSSI
You can look for key CBAdvertisementDataLocalNameKey.
If you do not see the name, you can make changes in your firmware to include a name in GATT characteristic .
You can use LightBlue app to verify once. This is a good app on app-store to test your BLE device.

Bluetooth device maintains connection even after passkey (PIN) change

I am using a SPP Bluetooth module to send data between my Android phone app and the module. I stumbled upon an interesting thing today.
I pair to my module by entering a passkey
I can normally send data back and forth between my app and the module
From within my app I disconnect from the module and close my app.
On the module I change its passkey to a new value.
I reopen my app and can still exchange data. I do not need to go through pairing again. All security information exchanged by my phone and module when I first paired them (using the old passkey) seem to still be valid even after changing the PIN on the module.
I then close my app and unpair the device from Bluetooth settings.
After that I pair the two devices to make sure Passkey change was in fact accepted and surely enough it was. I can now only pair with the new PIN.
My surprise is that in point 5 above everything still worked even without updating the PIN also on my mobile phone. I plan on getting around this by calling removeBond() using reflection after I send the module a command to change PIN since this is enough for my particular use case. But if the PIN change could be triggered by something else then my phone this would not work.
My question is if this is normal. Bluetooth specs are quite long so I was hoping someone else knows this. I would imagine that after changing the passkey for a Bluetooth device all devices already paired with it will have to go through the pairing process again, this time with the new passkey. But steps above indicate this is not the case. Is this a bug on my Bluetooth module (Bluegiga WT12) or is this expected behaviour? Has Anyone encountered this before?
Thank you.
Cheers!
So, Bluetooth specs are more friendly than I thought. I found my answer in this paragraph:
The Bluetooth PIN is used to authenticate two Bluetooth devices (that have not
previously exchanged link keys) to each other and create a trusted relationship
between them. The PIN is used in the pairing procedure (see Section 11.2 on
page 241) to generate the initial link key that is used for further authentication.
So passkey is not like a password in a router. It is just a sequence which both devices need to know when connecting so that one authenticates the other. Once they are sure they can trust each other they exchange link keys and those are used for future communication. Passkeys/PINs are then irrelevant.
I hope I understand this right.
Terribly sorry for posting too soon.
Cheers!

Shutdown nokia series 40 phone if sim is changed

I need to restrict only a particular sim on a given phone (nokia 2700) such that the phone is not usable if the sim is changed. I'm thinking of either preventing the sim from registering on the network or having some background app that will shutdown the phone or prevent usage if the sim is change.
QT (new to it) and JavaMe suggestions are both fine.
How do I proceed with this?
Edit1:
The idea is to prevent the user of the phone from changing the sim card. The phone should not work if the sim card is changed. For this, I need a way of notifying this and either shutting down the phone or doing something to prevent it from being used.
regards
Qt is not supported on Series 40 phones. It is available for Symbian and MeeGo based Nokia phones. Check this list for supported models.
In order to achieve this you need to be able to detect a sim card and prevent phone from functioning if necessary.
On Series 40 JavaME, there are a few system.properties that you can use to detect the current sim card. There are no events for receiving the sim card change. Some of the properties are restricted to manufacturer and operator security domains. Unfortunately, com.nokia.mid.imsi which identifies a particular sim card is one of those. However com.nokia.mid.networkid is not restricted and should be sufficient to identify a particular network(If that is your purpose).
There is no JavaME way of blocking the use of the phone (I guess that is the point with Java security and sandboxing). Also the ability to start an app. at the boot and keep it running on the background is restricted to manufacturer and operator signing on Series 40 phones.
The phone should have this function already.
From the manual (page 12):
Access codes
The security code helps to protect your phone against
unauthorised use. The preset code is 12345. You can create and change
the code, and set the phone to request the code. Keep the code secret
and in a safe place separate from your phone. If you forget the code
and your phone is locked, your phone will require service and
additional charges may apply. For more information, contact a Nokia
Care point or your phone dealer. The PIN code supplied with the SIM
card protects the card against unauthorised use. The PIN2 code
supplied with some SIM cards is required to access certain services.
If you enter the PIN or PIN2 code incorrectly three times in
succession, you are asked for the PUK or PUK2 code. If you do not have
them, contact your service provider. The module PIN is required to
access the information in the security module of your SIM card. The
signing PIN may be required for the digital signature. The barring
password is required when using the call barring service. To set how
your phone uses the access codes and security settings, select Menu >
Settings > Security.
I used to have a Sony-Ericsson phone that had the same function and it allowed the access code to be saved on the sim card. The phone would not ask for the access code unless the sim was changed. I hope you can find the same function in the Security menu on your Nokia phone.

Identifying mobile devices paired via bluetooth with PixelSense

I want to be able to pair Microsoft PixelSense hardware with multiple mobile devices via bluetooth and I want PixelSense to know which device is which. So if I place two phones on a table, PixelSense should be able to label them by device name. My initial thought was to have the phone display an Identity Tag that has encoded its Bluetooth MAC address so that it could associate them but PixelSense sees in infrared and can't read the phone screen so that idea is out. Can anyone think of another way to do this?
Microsoft has demonstrated a way to do this in their Mobile Connect sample application. They've ingeniously used the fact that almost all phones have a camera that faces down when the phone is placed on a flat surface. So they created an app that will read incoming color data from Surface while the phone is sitting on it.
So it goes like this:
The Surface app starts and makes the Surface computer itself visible on bluetooth (although you may have to do this manually in admin mode, can't remember)
you run the mobile app on your phone, click connect, and place it on the Surface at a designated spot
the Surface flashes a serious of colors into the phone's camera
the phone decodes those colors into a pin and scans through all the open bluetooth devices it can see until it finds one that is a desktop running the appropriate service and accepts the decoded pin.
Now the two are connected with no need for manual input and the Surface knows which physical device it's talking to because it knows which pin it displayed to each device.
*Note - They don't actually allow multiple simultaneous connections in this sample app, but I see no reason why it wouldn't work.
One issue with this approach (other than being pretty complicated to code), is the need for the app on the phone. One way to make it easier for people to get the app is to display a Microsoft Tag or qrcode on the Surface for people to scan (they're much more likely to have a scanning app already). I don't think there's any getting around the need to have something installed on the phone if you're using bluetooth anyway.

Resources