commit 2f484687b4e7f1e790ba59ac299caa308e7d9532
parent e01390c72c2e80ab408b510de7f2a2847a22690f
Author: Darren Clarke <darren@redaranj.com>
Date: Wed, 15 Nov 2023 11:47:09 +0100
Add Makefile and add_assert to .udl
Diffstat:
6 files changed, 21 insertions(+), 18 deletions(-)
diff --git a/Makefile b/Makefile
@@ -0,0 +1,7 @@
+.PHONY: apple android
+
+apple:
+ ./mobile/apple/build.sh;
+
+android:
+ ./mobile/android/build.sh;
diff --git a/mobile/android/.gitlab-ci.yml b/mobile/android/.gitlab-ci.yml
@@ -8,7 +8,7 @@ build_android:
- proofmode-macos
stage: build
script:
- - ./mobile/android/build.sh
+ - make android
artifacts:
paths:
- ./mobile/android/out/
diff --git a/mobile/apple/.gitlab-ci.yml b/mobile/apple/.gitlab-ci.yml
@@ -8,7 +8,7 @@ build_apple:
- proofmode-macos
stage: build
script:
- - ./mobile/apple/build.sh
+ - make apple
artifacts:
paths:
- ./mobile/apple/out/
diff --git a/mobile/src/lib.rs b/mobile/src/lib.rs
@@ -32,8 +32,6 @@ fn add_proof_assert(
proof_path: &str,
output_path: &str,
) {
- let proof_data = fs::read_to_string(proof_path).expect("Can't read proof");
-
let content_credentials_key = fs::read_to_string(cert_key).expect("Can't load cert");
let content_credentials_certificate = fs::read_to_string(cert_path).expect("Can't load cert");
@@ -44,16 +42,16 @@ fn add_proof_assert(
cc.add_proof_assertion(image_path.to_string(), output_path.to_string(), proof_data);
}
-
+*/
fn add_assert(
- cert_path: &str,
- cert_key: &str,
- is_capture: &bool,
- image_path: &str,
- identity: &str,
- _fingerprint: &str,
- allow_machine_learning: &bool,
- output_path: &str,
+ cert_path: String,
+ cert_key: String,
+ is_capture: bool,
+ image_path: String,
+ identity: String,
+ _fingerprint: String,
+ allow_machine_learning: bool,
+ output_path: String,
) {
let content_credentials_key = fs::read_to_string(cert_key).expect("Can't load cert");
let content_credentials_certificate = fs::read_to_string(cert_path).expect("Can't load cert");
@@ -89,4 +87,3 @@ fn add_assert(
);
}
}
-*/
diff --git a/mobile/src/simple-c2pa-mobile.udl b/mobile/src/simple-c2pa-mobile.udl
@@ -1,3 +1,5 @@
namespace simple_c2pa_mobile {
- void generate_cert(string fingerprint, string cert_path, string cert_key_path);
+ void generate_cert(string fingerprint, string cert_path, string cert_key_path);
+
+ void add_assert(string cert_path, string cert_key, boolean is_capture, string image_path, string identity, string fingerprint, boolean allow_machine_learning, string output_path);
};
diff --git a/src/lib.rs b/src/lib.rs
@@ -1,6 +1,3 @@
-use anyhow::Result;
-use std::fs;
-
mod content_credentials;
pub use content_credentials::ContentCredentials;