SIMnotRecognized » History » Revision 29

Revision 28 (Denis 'GNUtoo' Carikli, 09/09/2020 01:16 PM) → Revision 29/30 (Denis 'GNUtoo' Carikli, 09/09/2020 01:20 PM)

h1. SIM not recognized with libsamsung-ipc and libsamsung-ril 


 h2. Introduction 

 This page attempts to list SIM cards that are known to be compatible with Replicant, and the ones were known not to be compatible because of a bug. 

 The main bug is fixed now and has been part of Replicant 4.0 0004 RC1, however we still need to make sure that all the reported bugs are also fixed as the symptoms could be similar but have another cause. 

 In order to make it easier to reproduce, a list of compatible and incompatible cards has stated to be sumarized here, mostly using the information from the various bugreports. 

 h2. List of cards and related bugs 

 |_. country |_. type |_. carrier |_. date |_. works |_. references |_. prices and conditions | 
 | France | contract | Free | ? (years ago, 2013?) | Yes |    | | 
 | France | prepaid | SFR | bought the 2018-08-24 in Paris | Yes | |    | 
 | France | ? | SFR | Very old card, expired | * Replicant 6.0: No 
 * Replicant 4.2: Yes | #1909 | N/A | 
 | France | prepaid | Orange | ? (probably bought last year) | Yes | #1868 | | 
 | France | conrtact? | Orange | | No | #1868 | | 
 | Italy | ? | Fastweb | | No | #1824 | | 
 | Italy | ? | Wind | older SIM cards | Yes | #1871 | | 
 | Italy | prepaid | Wind | | No | #1871 | 25E, valid one month, 10E per recharge | 
 | Spain | ? | Vodafone |    micro-SIM bought before the 2018-02-23 | No | #1874 | | 
 | NZ | prepaid | Spark | 2013? | No ||| 

 h2. History of SIM not recognized bugs 

 At the time of writing, we know of two completely different bugs that broke the detection of SIM cards. 

 h3. Broken after Replicant 6.0 0004 RC2 

 *Fix*: "sent for review for libsamsung-ipc": 
 *How it was broken*: libsamsung-ipc was converted to a consistent code style. That kind of work is very mentally tiring as you keep doing the same thing again and again during many many hours, it's also very prone to mistakes because of that. So the person that did the conversion (GNUtoo) did a typo and that slipped through the review as well as reviewers have the same issue: they need to keep looking for the same thing again and again. 

 *How it was Fixed*: It was fixed with a bisect. libsamsung-ipc and libsamsung-ril were first bisected manually which consisted of picking a libsamsung-ipc+libsamsung-ril revision set, building it, wiping the data, installing the image, and booting the result and testing. To test if the SIM appeared in the welcome application (by displaying the SIM carrier name) it was good, if not I still tested if the SIM was recognized in Settings->About phone->SIM status as sometimes you need to wait a bit before the SIM is ready. Once libsamsung-ril was removed of the equation, a simple bisect on libsamsung-ril was done. Then I bisected some functions inside the commit. this can be done by saving the older revision to a file with git ls-tree <previous-revision> -- path/to/file and git show <resulting_hash> > old_file. Then you can just use meld and keep track manually of the functions. And at then end reading the code was faster than testing so I did that. 


 h3. Broken since Replicant 6.0 up to Replicant 6.0 000 RC1 

 *Bug report(s)*: At least #1909. Maybe #1868, #1868, #1824, #1871, #1874 were related too but we'd need confirmation from the bug reporters. 

 *Fix*: "In libsamsung-ril": 

 *How it was broken*: Libsamsung-ril incorrectly implemented SIM message parsing, but for some reason it wasn't an issue in Replicant 4.2. 
 *How it was Fixed*: It was not possible to bisect as it was broken since the very first Replicant 6.0 version and it did work in Replicant 4.2 fine. So somehow "Replicant 6" broke it. GNUtoo also tried to understand what was happening by tracing the SIM but it wasn't enough to fix it. GNUtoo never found enough time to dig into the code and go look for what was really happening. So at the end Belgin did that and fixed it.