Compare commits
No commits in common. "5ab07d626276e6381e4ce48ad70449d8d2a77b36" and "7f67000074b5146945a7dd822ef8dd64f6f1a681" have entirely different histories.
5ab07d6262
...
7f67000074
5 changed files with 36 additions and 39 deletions
|
@ -15,10 +15,6 @@ There are two variants of this project:
|
||||||
- Prebuilt release-mode EasyEUICC apks can be downloaded [here](https://gitea.angry.im/PeterCxy/OpenEUICC/releases)
|
- Prebuilt release-mode EasyEUICC apks can be downloaded [here](https://gitea.angry.im/PeterCxy/OpenEUICC/releases)
|
||||||
- For removable eSIM chip vendors: to have your chip supported by official builds of EasyEUICC when inserted, include the ARA-M hash `2A2FA878BC7C3354C2CF82935A5945A3EDAE4AFA`
|
- For removable eSIM chip vendors: to have your chip supported by official builds of EasyEUICC when inserted, include the ARA-M hash `2A2FA878BC7C3354C2CF82935A5945A3EDAE4AFA`
|
||||||
|
|
||||||
__This project is Free Software licensed under GNU GPL v3, WITHOUT the "or later" clause.__ Any modification and derivative work __MUST__ be released under the SAME license, which means, at the very least, that the source code __MUST__ be available upon request.
|
|
||||||
|
|
||||||
__If you are releasing a modification of this app, you are kindly asked to make changes to at least the app name and package name.__
|
|
||||||
|
|
||||||
Building (Gradle)
|
Building (Gradle)
|
||||||
===
|
===
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ internal object LpacJni {
|
||||||
|
|
||||||
// C <-> Java struct / linked list handling
|
// C <-> Java struct / linked list handling
|
||||||
// Notifications
|
// Notifications
|
||||||
external fun notificationsNext(curr: Long): Long
|
external fun notificationNext(curr: Long): Long
|
||||||
external fun notificationGetSeq(curr: Long): Long
|
external fun notificationGetSeq(curr: Long): Long
|
||||||
external fun notificationGetOperationString(curr: Long): String
|
external fun notificationGetOperationString(curr: Long): String
|
||||||
external fun notificationGetAddress(curr: Long): String
|
external fun notificationGetAddress(curr: Long): String
|
||||||
|
|
|
@ -56,7 +56,7 @@ class LocalProfileAssistantImpl(
|
||||||
LpacJni.notificationGetAddress(curr),
|
LpacJni.notificationGetAddress(curr),
|
||||||
LpacJni.notificationGetIccid(curr),
|
LpacJni.notificationGetIccid(curr),
|
||||||
))
|
))
|
||||||
curr = LpacJni.notificationsNext(curr)
|
curr = LpacJni.notificationNext(curr)
|
||||||
}
|
}
|
||||||
LpacJni.notificationsFree(head)
|
LpacJni.notificationsFree(head)
|
||||||
return ret.sortedBy { it.seqNumber }.reversed()
|
return ret.sortedBy { it.seqNumber }.reversed()
|
||||||
|
|
|
@ -51,30 +51,3 @@ extern JavaVM *jvm;
|
||||||
extern jclass string_class;
|
extern jclass string_class;
|
||||||
|
|
||||||
jstring toJString(JNIEnv *env, const char *pat);
|
jstring toJString(JNIEnv *env, const char *pat);
|
||||||
|
|
||||||
#define LPAC_JNI_STRUCT_GETTER_LINKED_LIST_NEXT(st, st_jname) \
|
|
||||||
JNIEXPORT jlong JNICALL Java_net_typeblog_lpac_1jni_LpacJni_##st_jname##Next(JNIEnv *env, jobject thiz, jlong raw) { \
|
|
||||||
st *p = (st *) raw; \
|
|
||||||
if (p == NULL) return 0; \
|
|
||||||
return (jlong) p->next; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define LPAC_JNI_STRUCT_LINKED_LIST_FREE(st, st_jname, free_func) \
|
|
||||||
JNIEXPORT void JNICALL Java_net_typeblog_lpac_1jni_LpacJni_##st_jname##Free(JNIEnv *env, jobject thiz, jlong raw) { \
|
|
||||||
st *p = (st *) raw; \
|
|
||||||
if (p == NULL) return; \
|
|
||||||
free_func(p); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define LPAC_JNI_STRUCT_GETTER_LONG(st, name, jname) \
|
|
||||||
JNIEXPORT jlong JNICALL Java_net_typeblog_lpac_1jni_LpacJni_notificationGet##jname(JNIEnv *env, jobject thiz, jlong raw) { \
|
|
||||||
st *p = (st *) raw; \
|
|
||||||
if (p == NULL) return 0; \
|
|
||||||
return (jlong) p->name; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define LPAC_JNI_STRUCT_GETTER_STRING(st, name, jname) \
|
|
||||||
JNIEXPORT jstring JNICALL Java_net_typeblog_lpac_1jni_LpacJni_notificationGet##jname(JNIEnv *env, jobject thiz, jlong raw) { \
|
|
||||||
st *p = (st *) raw; \
|
|
||||||
return toJString(env, p->name); \
|
|
||||||
}
|
|
|
@ -46,6 +46,21 @@ Java_net_typeblog_lpac_1jni_LpacJni_es10bDeleteNotification(JNIEnv *env, jobject
|
||||||
return es10b_remove_notification_from_list(ctx, (unsigned long) seq_number);
|
return es10b_remove_notification_from_list(ctx, (unsigned long) seq_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT jlong JNICALL
|
||||||
|
Java_net_typeblog_lpac_1jni_LpacJni_notificationNext(JNIEnv *env, jobject thiz, jlong curr) {
|
||||||
|
struct es10b_notification_metadata_list *info = (struct es10b_notification_metadata_list *) curr;
|
||||||
|
if (info == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return (jlong) info->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
JNIEXPORT jlong JNICALL
|
||||||
|
Java_net_typeblog_lpac_1jni_LpacJni_notificationGetSeq(JNIEnv *env, jobject thiz, jlong curr) {
|
||||||
|
struct es10b_notification_metadata_list *info = (struct es10b_notification_metadata_list *) curr;
|
||||||
|
return info->seqNumber;
|
||||||
|
}
|
||||||
|
|
||||||
JNIEXPORT jstring JNICALL
|
JNIEXPORT jstring JNICALL
|
||||||
Java_net_typeblog_lpac_1jni_LpacJni_notificationGetOperationString(JNIEnv *env, jobject thiz,
|
Java_net_typeblog_lpac_1jni_LpacJni_notificationGetOperationString(JNIEnv *env, jobject thiz,
|
||||||
jlong curr) {
|
jlong curr) {
|
||||||
|
@ -72,8 +87,21 @@ Java_net_typeblog_lpac_1jni_LpacJni_notificationGetOperationString(JNIEnv *env,
|
||||||
return toJString(env, profileManagementOperationStr);
|
return toJString(env, profileManagementOperationStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
LPAC_JNI_STRUCT_GETTER_LINKED_LIST_NEXT(struct es10b_notification_metadata_list, notifications)
|
JNIEXPORT jstring JNICALL
|
||||||
LPAC_JNI_STRUCT_LINKED_LIST_FREE(struct es10b_notification_metadata_list, notifications, es10b_notification_metadata_list_free_all)
|
Java_net_typeblog_lpac_1jni_LpacJni_notificationGetAddress(JNIEnv *env, jobject thiz, jlong curr) {
|
||||||
LPAC_JNI_STRUCT_GETTER_LONG(struct es10b_notification_metadata_list, seqNumber, Seq)
|
struct es10b_notification_metadata_list *info = (struct es10b_notification_metadata_list *) curr;
|
||||||
LPAC_JNI_STRUCT_GETTER_STRING(struct es10b_notification_metadata_list, notificationAddress, Address)
|
return toJString(env, info->notificationAddress);
|
||||||
LPAC_JNI_STRUCT_GETTER_STRING(struct es10b_notification_metadata_list, iccid, Iccid)
|
}
|
||||||
|
|
||||||
|
JNIEXPORT jstring JNICALL
|
||||||
|
Java_net_typeblog_lpac_1jni_LpacJni_notificationGetIccid(JNIEnv *env, jobject thiz, jlong curr) {
|
||||||
|
struct es10b_notification_metadata_list *info = (struct es10b_notification_metadata_list *) curr;
|
||||||
|
return toJString(env, info->iccid);
|
||||||
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL
|
||||||
|
Java_net_typeblog_lpac_1jni_LpacJni_notificationsFree(JNIEnv *env, jobject thiz, jlong head) {
|
||||||
|
struct es10b_notification_metadata_list *info = (struct es10b_notification_metadata_list *) head;
|
||||||
|
if (info == NULL) return;
|
||||||
|
es10b_notification_metadata_list_free_all(info);
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue