mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 14:36:16 +01:00
Use downloaded plist.h
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,6 +5,7 @@ Image.dmg.trustcache
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
*.pcap
|
*.pcap
|
||||||
idevice.h
|
idevice.h
|
||||||
|
plist.h
|
||||||
/ffi/examples/build
|
/ffi/examples/build
|
||||||
/.cache
|
/.cache
|
||||||
/ffi/examples/.cache
|
/ffi/examples/.cache
|
||||||
|
|||||||
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -1153,6 +1153,7 @@ dependencies = [
|
|||||||
"plist_ffi",
|
"plist_ffi",
|
||||||
"simplelog",
|
"simplelog",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
"ureq",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ default = ["full", "aws-lc"]
|
|||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
cbindgen = "0.29.0"
|
cbindgen = "0.29.0"
|
||||||
|
ureq = "3"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["staticlib"]
|
crate-type = ["staticlib"]
|
||||||
|
|||||||
12
ffi/build.rs
12
ffi/build.rs
@@ -12,10 +12,20 @@ fn main() {
|
|||||||
)
|
)
|
||||||
.with_language(cbindgen::Language::C)
|
.with_language(cbindgen::Language::C)
|
||||||
.with_sys_include("sys/socket.h")
|
.with_sys_include("sys/socket.h")
|
||||||
.with_sys_include("plist/plist.h")
|
.with_include("plist.h")
|
||||||
.generate()
|
.generate()
|
||||||
.expect("Unable to generate bindings")
|
.expect("Unable to generate bindings")
|
||||||
.write_to_file("idevice.h");
|
.write_to_file("idevice.h");
|
||||||
|
|
||||||
|
// download plist.h
|
||||||
|
let h = ureq::get("https://raw.githubusercontent.com/libimobiledevice/libplist/refs/heads/master/include/plist/plist.h")
|
||||||
|
.call()
|
||||||
|
.expect("failed to download plist.h");
|
||||||
|
let h = h
|
||||||
|
.into_body()
|
||||||
|
.read_to_string()
|
||||||
|
.expect("failed to get string content");
|
||||||
|
std::fs::write("plist.h", h).expect("failed to save to string");
|
||||||
|
|
||||||
println!("cargo:rustc-link-arg=-lplist-2.0");
|
println!("cargo:rustc-link-arg=-lplist-2.0");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Jackson Coxson
|
// Jackson Coxson
|
||||||
|
|
||||||
#include "idevice.h"
|
#include "idevice.h"
|
||||||
#include "plist/plist.h"
|
#include "plist.h"
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -122,7 +122,7 @@ int main() {
|
|||||||
|
|
||||||
// Get all values
|
// Get all values
|
||||||
plist_t all_values = NULL;
|
plist_t all_values = NULL;
|
||||||
err = lockdownd_get_all_values(client, NULL, &all_values);
|
err = lockdownd_get_value(client, NULL, NULL, &all_values);
|
||||||
if (err != NULL) {
|
if (err != NULL) {
|
||||||
fprintf(stderr, "Failed to get all values: [%d] %s", err->code,
|
fprintf(stderr, "Failed to get all values: [%d] %s", err->code,
|
||||||
err->message);
|
err->message);
|
||||||
|
|||||||
Reference in New Issue
Block a user