forked from PeterCxy/OpenEUICC
Compare commits
1 commit
ebfca5b309
...
9af4518d0f
Author | SHA1 | Date | |
---|---|---|---|
9af4518d0f |
4 changed files with 29 additions and 20 deletions
|
@ -7,7 +7,9 @@ data class LocalProfileInfo(
|
||||||
val nickName: String,
|
val nickName: String,
|
||||||
val providerName: String,
|
val providerName: String,
|
||||||
val isdpAID: String,
|
val isdpAID: String,
|
||||||
val profileClass: ProfileClass
|
val profileClass: ProfileClass,
|
||||||
|
val iconType: String,
|
||||||
|
val icon: String,
|
||||||
)
|
)
|
||||||
|
|
||||||
enum class ProfileState { Enabled, Disabled }
|
enum class ProfileState { Enabled, Disabled }
|
||||||
|
|
|
@ -147,6 +147,8 @@ Java_net_typeblog_lpac_1jni_LpacJni_es10cGetProfilesInfo(
|
||||||
"Ljava/lang/String;" // provider name
|
"Ljava/lang/String;" // provider name
|
||||||
"Ljava/lang/String;" // ISD-P AID
|
"Ljava/lang/String;" // ISD-P AID
|
||||||
"Lnet/typeblog/lpac_jni/ProfileClass;"
|
"Lnet/typeblog/lpac_jni/ProfileClass;"
|
||||||
|
"Ljava/lang/String;" // icon type
|
||||||
|
"Ljava/lang/String;" // icon
|
||||||
")"
|
")"
|
||||||
"V" // (returns) void
|
"V" // (returns) void
|
||||||
);
|
);
|
||||||
|
@ -164,7 +166,9 @@ Java_net_typeblog_lpac_1jni_LpacJni_es10cGetProfilesInfo(
|
||||||
toJString(env, info->profileNickname),
|
toJString(env, info->profileNickname),
|
||||||
toJString(env, info->serviceProviderName),
|
toJString(env, info->serviceProviderName),
|
||||||
toJString(env, info->isdpAid),
|
toJString(env, info->isdpAid),
|
||||||
to_profile_class(info->profileClass)
|
to_profile_class(info->profileClass),
|
||||||
|
to_icon_type(env, info->iconType),
|
||||||
|
toJString(env, info->icon)
|
||||||
);
|
);
|
||||||
(*env)->CallBooleanMethod(env, profile_list, add_profile, element);
|
(*env)->CallBooleanMethod(env, profile_list, add_profile, element);
|
||||||
info = info->next;
|
info = info->next;
|
||||||
|
|
|
@ -116,6 +116,21 @@ jobject to_profile_class(enum es10c_profile_class profile_class) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jobject to_profile_management_operation(enum es10b_profile_management_operation operation) {
|
||||||
|
switch (operation) {
|
||||||
|
case ES10B_PROFILE_MANAGEMENT_OPERATION_INSTALL:
|
||||||
|
return profile_management_operation_install;
|
||||||
|
case ES10B_PROFILE_MANAGEMENT_OPERATION_DELETE:
|
||||||
|
return profile_management_operation_delete;
|
||||||
|
case ES10B_PROFILE_MANAGEMENT_OPERATION_ENABLE:
|
||||||
|
return profile_management_operation_enable;
|
||||||
|
case ES10B_PROFILE_MANAGEMENT_OPERATION_DISABLE:
|
||||||
|
return profile_management_operation_disable;
|
||||||
|
default:
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
jstring to_icon_type(JNIEnv *env, enum es10c_icon_type icon_type) {
|
jstring to_icon_type(JNIEnv *env, enum es10c_icon_type icon_type) {
|
||||||
switch (icon_type) {
|
switch (icon_type) {
|
||||||
case ES10C_ICON_TYPE_JPEG:
|
case ES10C_ICON_TYPE_JPEG:
|
||||||
|
@ -182,25 +197,11 @@ jobject build_profile_metadata(JNIEnv *env, struct es8p_metadata *metadata) {
|
||||||
toJString(env, metadata->profileName),
|
toJString(env, metadata->profileName),
|
||||||
to_icon_type(env, metadata->iconType),
|
to_icon_type(env, metadata->iconType),
|
||||||
toJString(env, metadata->icon),
|
toJString(env, metadata->icon),
|
||||||
to_profile_class(metadata->profileClass)
|
to_profile_class(metadata->profileClass
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
jobject to_profile_management_operation(enum es10b_profile_management_operation operation) {
|
|
||||||
switch (operation) {
|
|
||||||
case ES10B_PROFILE_MANAGEMENT_OPERATION_INSTALL:
|
|
||||||
return profile_management_operation_install;
|
|
||||||
case ES10B_PROFILE_MANAGEMENT_OPERATION_DELETE:
|
|
||||||
return profile_management_operation_delete;
|
|
||||||
case ES10B_PROFILE_MANAGEMENT_OPERATION_ENABLE:
|
|
||||||
return profile_management_operation_enable;
|
|
||||||
case ES10B_PROFILE_MANAGEMENT_OPERATION_DISABLE:
|
|
||||||
return profile_management_operation_disable;
|
|
||||||
default:
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
jobject new_array_list(JNIEnv *env) {
|
jobject new_array_list(JNIEnv *env) {
|
||||||
jclass array_list_class = (*env)->FindClass(env, ARRAY_LIST_CLASS);
|
jclass array_list_class = (*env)->FindClass(env, ARRAY_LIST_CLASS);
|
||||||
jmethodID array_list_constructor = (*env)->GetMethodID(env, array_list_class, "<init>", "()V");
|
jmethodID array_list_constructor = (*env)->GetMethodID(env, array_list_class, "<init>", "()V");
|
||||||
|
|
|
@ -27,6 +27,10 @@ jobject to_profile_state(enum es10c_profile_state profile_state);
|
||||||
|
|
||||||
jobject to_profile_class(enum es10c_profile_class profile_class);
|
jobject to_profile_class(enum es10c_profile_class profile_class);
|
||||||
|
|
||||||
|
jobject to_profile_management_operation(enum es10b_profile_management_operation operation);
|
||||||
|
|
||||||
|
jstring to_icon_type(JNIEnv *env, enum es10c_icon_type icon_type);
|
||||||
|
|
||||||
jobject to_version(JNIEnv *env, const char *version);
|
jobject to_version(JNIEnv *env, const char *version);
|
||||||
|
|
||||||
jobject to_string_set(JNIEnv *env, char **values);
|
jobject to_string_set(JNIEnv *env, char **values);
|
||||||
|
@ -35,6 +39,4 @@ jobject to_string_list(JNIEnv *env, char **values);
|
||||||
|
|
||||||
jobject build_profile_metadata(JNIEnv *env, struct es8p_metadata *metadata);
|
jobject build_profile_metadata(JNIEnv *env, struct es8p_metadata *metadata);
|
||||||
|
|
||||||
jobject to_profile_management_operation(enum es10b_profile_management_operation operation);
|
|
||||||
|
|
||||||
jobject new_array_list(JNIEnv *env);
|
jobject new_array_list(JNIEnv *env);
|
||||||
|
|
Loading…
Add table
Reference in a new issue