openbmap / radiocells-scanner-android

WLAN and cell tower scanner for Radiocells.org
https://www.radiocells.org
Other
56 stars 26 forks source link

Dual SIM support #128

Open amilopowers opened 8 years ago

amilopowers commented 8 years ago

Does your app support dual SIM devices? I am thinking about buying a duals SIM device like that I could scan all Swiss networks simultaneousely.

FelixSchwarz commented 8 years ago

I think this depends on the Android implementation. AFAIU for Android 6 the app should be able to scan with both sim cards otherwise it just uses the default one. Most mobile vendors don't patch the API themselves for Android 5 so an app would have to use "non-standard" calls to scan with all sim cards. This hasn't been done for this app but is certainly possible.

amilopowers commented 8 years ago

I might give it a try.

wish7code commented 8 years ago

Well, I tried it some time ago with a friends dual sim phone, there getAllCellInfo only first sims cells, but as Felix mentions it might vary depending on the device manufactorer and the Android version.

Quote from https://developer.android.com/reference/android/telephony/TelephonyManager.html#getAllCellInfo()

On devices with multiple radios it is typical to see instances of one or more of any these in the list.

app would have to use "non-standard" calls

@FelixSchwarz By instance, have you already experimented with this? Any hints?

amilopowers commented 8 years ago

I might try a magic sim adapter for my Nexus 5

FelixSchwarz commented 8 years ago

@wish7code No, but I provided some debug logs to the author of the proprietary app "netmonitor" which he used to implement dual-sim scanning.

I think (based on the log files I provided) he accessed (vendor specific?) API which had a "gemini" suffix. Maybe http://stackoverflow.com/questions/27767127/android-dual-sim-signal-strength and https://github.com/dragos-niculescu/dualsim/blob/master/src/com/example/dualsim/TelephonyInfo.java might be related.

Also I noticed that MozStumbler has some dual sim support. Maybe openbmap could just use their scanner class?

amilopowers commented 8 years ago

Something related to that: When I walk around I noticed that I scan always the same cells. Generally I scan the newest technology because I told my phone to use 4G (LTE) if available. But there are 3G and GSM cells around which never get scanned or updated like that.

AFAIU 4G is only for data and therefore cellphones switch to a 3G or GSM cell when calls are made. So are they a) connected to both technologies or do the b) switch pretty fast from 4G to <4G when needed?

Because if a) is true our app should be capable of asking for the cell-ID of the "unused" <4G cell as well.

Like that we wouldn't need to switch cell technology by hand and we gained al lot more cells in a short time.

amilopowers commented 8 years ago

Today I scanned with MozStumbler and Radiobeacon simuntaneousely. MozScanner got 45 and RB 32 radiocells in the same period. So I guess a) is true that it should be possible to get more cell data.

FelixSchwarz commented 8 years ago

Just by chance I tried MozStumbler a few minutes ago and on my phone (BQ Aquaris M5) MozStumbler only found the cells from my default SIM.

(One thing I'm asking myself is if it is really necessary for openbmap to develop a custom app completely on their own. It might be an interesting experiment to fork MozStumbler, change the name+references to Mozilla's service and implement openbmap's upload API. Maybe it's even possible to get some kind of API into MozStumbler so the openbmap changes are easier to build.)

wish7code commented 8 years ago

@amilopowers I just scanned the MozStumbler code @ https://github.com/mozilla/MozStumbler/blob/7e43c8387963c9d460ecc3fba17fceeefc33a6be/libraries/stumbler/src/main/java/org/mozilla/mozstumbler/service/stumblerthread/scanners/cellscanner/SimpleCellScannerImplementation.java

As far as I can see our friends just use the Android default API getAllCellInfo, basically the same as we do. Possibly they've found a better way to handle neighboring cells (an Android API nightmare).

@FelixSchwarz I'm quite sure it we could integrate a forked MozStumbler server side quite easily. If anyone is volunteering, we'll would be happy to do integrate such modified client.. But aside that, I guess the main differences between both clients are the level of detail of uploaded files and the type of submission (XML vs. JSON) only. While obviously our XML file format is archaic and overbloated for historic reasons, it's still verbose and relatively easy to process for bold researchers :-)

wish7code commented 8 years ago

@FelixSchwarz Thanks for the keyword 'Gemini': there's not much documentation to be found, BUT one link went to some Samsung developer forum. I think I vaguely remember that some Samsung devices expose some extra modem information - at least that's what I understood from the discussions on AIMSID (https://github.com/SecUpwN/Android-IMSI-Catcher-Detector)

Good news nevertheless: Android versions >= 5.1 seems to support dual sim mode https://developer.android.com/about/versions/android-5.1.html#multisim

FelixSchwarz commented 8 years ago

Good news nevertheless: Android versions >= 5.1 seems to support dual sim mode

That is true but at least on my device (Android 5.1.?) it seems I still get only scans from the default SIM. It seems Android chipset manufacturers are really sloppy when implementing these APIs...

amilopowers commented 8 years ago

@FelixSchwarz You could install a custom ROM like www.omnirom.org to upgrade Android. I think it shouldn't void warranty. And if in doubt you can always go back to the original.

merlink01 commented 8 years ago

Also only first sim scanned: Android 5.1.1, Cyanogenmod 12.1, Zuk Z1

merlink01 commented 8 years ago

Retested on CM 13: Both Sims are scanned now.

wish7code commented 8 years ago

That's cool to hear!