Add option to display test + provisioning profiles #30
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Right now it seems that EasyEUICC has a filter to filter the list of profiles to "operational" profiles. This means that users (mostly developers, system integrators, technicians) who work with test profiles are not able to use it.
If you do want to keep the default filter to "operational", I would suggest to introduce a setting by which the users can disable the filter to really see all profiles on the eUICC.
Thanks again for your work and for considering feature requests.
I agree that the test profiles need to (optionally) be visible to users. I just had to buy a SIM reader so that I could disable the test profile and enable my "operational" profile.
Note: I really have absolutely no existing clue about Android development or the Kotlin language, but still decided to have a look if I can add the related functionality. Sadly, it's not as easy as I would have hoped.
Adding the preference itself is of course relatively trivial, see
8a17e5c058
But the more interesting question is how to actually make use of it.
The actual filtering seems to be done in the following piece of
util/LPAUtils.kt
The actual code using that to retrieving the list is
as well as
So my approach would be to
visible
property, then use that at the two user sites instead of theoperational
propertyFirst of all,
LocalProfileInfo
is an imported class, coming from another project, so extending it directly is difficult, so I guess that's the reason whyLPAUtils
exists in the first place, since it makes use of Kotlins' "Extensions" mechanism, i.e. extension functions:https://kotlinlang.org/docs/extensions.html
Using it, you can "attach" additional functions to existing classes, even if they are imported. For example, you can even extend "library" functions like the List class, etc.
What I am not sure about is where the information will be provided, when which profile should be visible.
In case you will provide it, something like this should work:
and
The list the must contain the elements which one would expect in the
profileClass
properties.After that, you can replace the calls to
channel.lpa.profiles.operational
bychannel.lpa.profiles.visible
.Hi @retrofreak83 - thanks for taking some time to help me out here.
While I was lacking any Kotlin background knowledge, I did manage to figure that much just by looking at the code. Thanks for confirming.
The list of profiles is actually read from the eUICC chip inside the device (usually a smartphone). In terms of EasyEUICC, this is done by utilizing the
lpac
program (an external C language program) with JNI bindings. The lpac basically has three interfaces:So basically EasyEUICC asks lpac to list the profiles, which will make lpac trigger some APDU exchanges with the eUICC, which come right back into EasyEUICC which feeds those into OMAPI calls. The responses go back from eUICC via OMAPI into lpac, which does ASN.1 decoding and outputs a JSON document towards EasyEUICC. that JSON document now contains the list of profiles.
And that list of profiles is so-far filtered/constrained to the list of operational profiles. I want to introduce a preference (see
8a17e5c058
already linked above), wich controls that filter.The critical question is: How do I integrate that "Flow" preference in a way that my "visible" filter changes depending on whether or not that boolean prefreence is set or not? Let me know if you have any input on that. Thanks!
Ah, I'm sorry, I guess I didn't really understand what you're trying to accomplish in the first place.
I'm a bit puzzled why the preference seems to be modeled as a
Flow
, since this is type for providing a series of values one after another.So, most likely you will need to change add an extension function, and replace calls to the
operational
property by calling a function, like so:In the calling classes you then need to figure out how to access your new preference. But at least in one of them,
preferenceRepository
seems to be accessible from there.