Przeglądaj źródła

Merge passy from https://github.com/bettse/passy

Willy-JL 9 miesięcy temu
rodzic
commit
08628d25f2

+ 16 - 0
passy/.catalog/README.md

@@ -0,0 +1,16 @@
+
+## Tested with the following countries:
+🇺🇸
+🇨🇱
+
+(If it works for yours, submit a PR to add your country flag)
+
+## Notes:
+ - Caches MRZ info to make subsequent use faster
+
+## Limitations
+ - Does not parse some of the optional DG (under 'advanced' menu)
+
+## To do
+ - Support more countries passports
+

+ 4 - 0
passy/.catalog/changelog.md

@@ -1,2 +1,6 @@
+## 1.0
+ - Better DG1 parsing
+ - Added reading DG2 and saving photo
+ - Added reading DG7 and saving signature (thanks @EstebanFuentealba)
 ## 0.1
  - Initial release

BIN
passy/.catalog/screenshots/menu.png


+ 1 - 2
passy/README.md

@@ -10,11 +10,10 @@
  - Caches MRZ info to make subsequent use faster
 
 ## Limitations
- - Only requests DG1, the contents of the MRZ
+ - Does not parse some of the optional DG (under 'advanced' menu)
 
 ## To do
  - Support other country passports
- - Add event for file not found when selecting file, and UI
 
 ## Generate asn:
 

+ 1 - 1
passy/application.fam

@@ -8,7 +8,7 @@ App(
     stack_size=2 * 1024,
     fap_category="NFC",
     # Optional values
-    fap_version="0.1",
+    fap_version="1.0",
     fap_icon="passy.png",  # 10x10 1-bit PNG
     fap_description="eMRTD Reader",
     fap_author="bettse",

+ 2 - 0
passy/passy_common.c

@@ -142,6 +142,8 @@ char passy_checksum(char* str) {
             value = values[str[i] - '0'];
         } else if(str[i] >= 'A' && str[i] <= 'Z') {
             value = values[str[i] - 'A' + 10];
+        } else if(str[i] >= 'a' && str[i] <= 'z') {
+            value = values[str[i] - 'a' + 10];
         } else if(str[i] == '<') {
             value = 0;
         } else {

BIN
passy/reference/9303_p10_cons_en.pdf


BIN
passy/reference/9303_p11_cons_en.pdf


BIN
passy/reference/master-ferdig.pdf


BIN
passy/reference/mrtd-cs08prt.pdf


+ 3 - 2
passy/scenes/passy_scene_dob_input.c

@@ -16,10 +16,11 @@ void passy_scene_dob_input_on_enter(void* context) {
     // Setup view
     TextInput* text_input = passy->text_input;
 
-    // TODO: reload from saved data
-
     text_input_set_header_text(text_input, "DoB: YYMMDD");
     text_input_set_minimum_length(text_input, 6);
+    if(passy->date_of_birth[0] != '\0') {
+        strlcpy(passy->text_store, passy->date_of_birth, sizeof(passy->text_store));
+    }
     text_input_set_result_callback(
         text_input,
         passy_scene_dob_input_text_input_callback,

+ 3 - 2
passy/scenes/passy_scene_doe_input.c

@@ -15,10 +15,11 @@ void passy_scene_doe_input_on_enter(void* context) {
     // Setup view
     TextInput* text_input = passy->text_input;
 
-    // TODO: reload from saved data
-
     text_input_set_header_text(text_input, "DoE: YYMMDD");
     text_input_set_minimum_length(text_input, 6);
+    if(passy->date_of_expiry[0] != '\0') {
+        strlcpy(passy->text_store, passy->date_of_expiry, sizeof(passy->text_store));
+    }
     text_input_set_result_callback(
         text_input,
         passy_scene_doe_input_text_input_callback,

+ 3 - 0
passy/scenes/passy_scene_main_menu.c

@@ -84,6 +84,9 @@ bool passy_scene_main_menu_on_event(void* context, SceneManagerEvent event) {
             scene_manager_next_scene(passy->scene_manager, PassySceneRead);
             consumed = true;
         }
+    } else if(event.type == SceneManagerEventTypeBack) {
+        while(scene_manager_previous_scene(passy->scene_manager))
+            ;
     }
 
     return consumed;

+ 4 - 2
passy/scenes/passy_scene_passport_number_input.c

@@ -15,9 +15,11 @@ void passy_scene_passport_number_input_on_enter(void* context) {
     // Setup view
     TextInput* text_input = passy->text_input;
 
-    // TODO: reload from saved data
-
     text_input_set_header_text(text_input, "Passport Number");
+    text_input_set_minimum_length(text_input, 9);
+    if(passy->passport_number[0] != '\0') {
+        strlcpy(passy->text_store, passy->passport_number, sizeof(passy->text_store));
+    }
     text_input_set_result_callback(
         text_input,
         passy_scene_passport_number_input_text_input_callback,